Skip to content

Add an opt-in Stop hook for nextflow lint - #14

Open
edmundmiller wants to merge 1 commit into
mainfrom
cursor/opt-in-nextflow-lint-stop-hook-6576
Open

edmundmiller wants to merge 1 commit into
mainfrom
cursor/opt-in-nextflow-lint-stop-hook-6576

Conversation

@edmundmiller

@edmundmiller edmundmiller commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Claude Code Stop hook that runs nextflow lint once, after the agent finishes a turn, on uncommitted .nf and .config files.

This is the small version of the lint hooks from nextflow-io/agent-skills #5 and #10. Those ran on every Write/Edit (PostToolUse), which linted half-finished files and started a JVM per edit. A Stop hook sees the working tree after the turn's edits are done, and it runs one lint for the whole set of changed files.

The hook is registered in hooks/hooks.json (the file Claude Code loads for a plugin) and stays idle until someone opts in:

  • one repository: mkdir -p .claude && touch .claude/nextflow-lint-hook
  • every repository: NEXTFLOW_LINT_HOOK=1

Until then it exits immediately and does not call Nextflow. It also skips when nextflow is missing, when the tree has no uncommitted .nf or .config files, and when a stop hook has already continued the turn (so a lint failure is reported once).

Plugin version is unchanged. No language-server or .lsp.json changes.

Test plan

  • python3 -I tools/check_sources.py (114 files, 0 errors)
  • python3 -I tools/test_consolidate_skills.py
  • claude plugin validate --strict on the marketplace and plugin manifests (Claude Code 2.1.295)
  • claude plugin install reports Hooks (1) Stop plus the existing 28 skills and the seqera MCP server
  • Hook script: no opt-in leaves nextflow uncalled; NEXTFLOW_LINT_HOOK=1 and a .claude/nextflow-lint-hook file both enable it; lint failure exits 2 with the report on stderr; stop_hook_active: true skips; missing nextflow and a non-git directory exit 0; a clean tree exits 0; quoted paths with spaces are passed through and deleted files are not
  • CI validate workflow
Open in Web Open in Cursor 

Register a Claude Code Stop hook that lints uncommitted .nf and .config
files once when a turn finishes. It stays idle unless NEXTFLOW_LINT_HOOK=1
or .claude/nextflow-lint-hook is present, so install does not lint on each edit.

Co-authored-by: Edmund Miller <edmundmiller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants