Skip to content

fix(instructions): require Lefthook only where the repo configures it - #263

Merged
DevSecNinja merged 1 commit into
mainfrom
devsecninja-fix-lefthook-instruction-scope
Nov 16, 2026
Merged

DevSecNinja merged 1 commit into
mainfrom
devsecninja-fix-lefthook-instruction-scope

Conversation

@DevSecNinja

@DevSecNinja DevSecNinja commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

The devsecninja-conventions instruction made mise exec -- lefthook run pre-commit mandatory before every PR and every commit. Copilot flagged this on DevSecNinja/net-worth-calculator#57: that repo has no Lefthook config and documents its own checks in CONTRIBUTING.md, so an agent can't follow the rule there.

Changes

  • devsecninja-conventions (pre-PR checks and "Tooling and files"): repos with a Lefthook config still must run mise exec -- lefthook run pre-commit plus their test command. Other repos run the lint, hook and test commands they document, and agents shouldn't add Lefthook just to satisfy the rule. Never opening a PR with failing checks and the execution-authorization gate stay as they were.
  • commit-and-release skill, step 4: the same condition, since it repeated the unconditional Lefthook step.

INDEX.md and the README index are unchanged because no description or category changed. The .github/ copies and apm.lock.yaml hashes get updated by the usual materialize PR.

Validation

  • Lefthook pre-commit passed on the commit: validate-prompts, generate-index and all Python unit-test suites.
  • bash tests/validate-prompts.sh and scripts/check-index.sh pass in an isolated copy.

Rollout

After the next release, config-sync delivers the updated instruction to consumer repos and refreshes DevSecNinja/net-worth-calculator#57.

Closes #261

Summary by CodeRabbit

  • Documentation
    • Updated repository check and commit guidance to account for whether Lefthook is configured and whether its checks are authorized.
    • Clarified that repositories without Lefthook should use their documented lint, hook, and test commands, without installing Lefthook just for the checks.
    • Clarified that checks should stop on failure and that commits should not proceed when they would trigger unapproved hooks or filters.

The devsecninja-conventions instruction and the commit-and-release skill
made `mise exec -- lefthook run pre-commit` mandatory before every PR and
commit. Repos that don't configure Lefthook, such as net-worth-calculator,
can't satisfy that. Keep the Lefthook gate for repos with a Lefthook config
and otherwise run the repo's documented lint, hook and test commands.

Closes #261

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@DevSecNinja
DevSecNinja requested a balanced review from Copilot November 16, 2026 12:39
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The PR and commit instructions now select checks based on whether the repository configures Lefthook. They also describe documented checks for repositories without Lefthook and when to stop before running unapproved hooks or filters.

Changes: Repository check instructions

Layer / File(s) Summary
PR check selection
.apm/instructions/devsecninja-conventions.instructions.md
PR instructions require Lefthook checks when configured. Otherwise, they direct the reader to documented lint, hook, and test commands and say not to install Lefthook solely to satisfy the rule.
Commit checks and authorization
.apm/instructions/devsecninja-conventions.instructions.md, .apm/skills/commit-and-release/SKILL.md
Commit instructions direct authorized work to run Lefthook or documented checks, as applicable. They require stopping before a commit that would run unapproved hooks or filters. The workflow also requires repository tests, if any, and says to stop on failure.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to e1102

This updates agent instructions so Lefthook is required only in repositories that configure it, and other repositories use their documented checks. No remaining risk blocks merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Lefthook is now required only in repositories that configure it. The changeset updates the devsecninja-conventions instruction and the commit-and-release skill to matc…
Linked Issues check Passed Issue #261 (direct, open) requires that Lefthook be required only where the repo configures it, and that other repos run their documented lint and test commands without adding Lefthook. Both requireme…
Out of Scope Changes check Passed The PR changes two files, as the summary states: the devsecninja-conventions instruction and the commit-and-release skill. Both edits touch only the Lefthook-conditional pre-commit and test guidan…
Full details: Title check

Explanation

The title names the main change: Lefthook is now required only in repositories that configure it. The changeset updates the devsecninja-conventions instruction and the commit-and-release skill to match that scope, and the objectives confirm this. The title's 'fix(instructions)' prefix is a conventional-commit style scope that still describes the change accurately.

Full details: Linked Issues check

Explanation

Issue #261 (direct, open) requires that Lefthook be required only where the repo configures it, and that other repos run their documented lint and test commands without adding Lefthook. Both requirements are met at the reviewed head.

  • .apm/instructions/devsecninja-conventions.instructions.md, "Pull requests": if the repo configures Lefthook (for example lefthook.yml or .lefthook.toml), run mise exec -- lefthook run pre-commit plus the test command. Otherwise run the documented lint, hook, and test commands (for example in CONTRIBUTING.md). The text states not to add or install Lefthook to satisfy the rule. The original unconditional wording is gone.
  • Same file, "Tooling and files": the pre-commit step is conditional on the same Lefthook check, with the documented pre-commit checks as the alternative. This covers the second location cited in the issue (line 108 of the old file).
  • .apm/skills/commit-and-release/SKILL.md, step 4: the same conditional applies. Lefthook runs only when a Lefthook config exists. Otherwise the documented lint and hook checks run, and the repo test command runs in either case.

Limitation: the whole-PR text diff could not be read (changed blobs unavailable). I verified the requirements from the full head content of both files, not from the diff against the base. The PR summary lists only these two files as changed, and this does not affect the head-state result.

Full details: Out of Scope Changes check

Explanation

The PR changes two files, as the summary states: the devsecninja-conventions instruction and the commit-and-release skill. Both edits touch only the Lefthook-conditional pre-commit and test guidance that issue #261 requests. The other rules in the reviewed head content (execution authorization gate, never opening a PR with failing checks, signing, PR size, and docs) are unchanged in substance. The PR description states that INDEX.md, the README index, and the .github/ copies are not changed in this PR, and the summary does not list them as changed. No unrelated change was found in the head content of the two files. The diff against the base could not be read, so the no-other-changes conclusion rests on the PR summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 025d7d99-f89c-4a43-b595-370b15dc9086
Commits

Reviewing files that changed from the base of the PR and between eef88cf and e110223.

Files selected for processing: 2

  • .apm/instructions/devsecninja-conventions.instructions.md
  • .apm/skills/commit-and-release/SKILL.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the changes making Lefthook requirements conditional on repository configuration.

No open issues 🎉

What changed in this PR

This PR resolves #261 by making Lefthook checks conditional on repository configuration in the shared APM instruction and release skill, allowing consumer repositories to use their documented checks.

Changes:

  • Require Lefthook only in repositories that configure it; otherwise use documented lint, hook, and test commands.
  • Preserve execution-authorization requirements and the prohibition on committing or opening PRs with known-failing checks.
  • Clarify that agents should not install Lefthook solely to satisfy these instructions.
File Description
.apm/​skills/​commit-and-release/​SKILL.md Makes step 4 conditional on Lefthook configuration while retaining repository tests.
.apm/​instructions/​devsecninja-conventions.instructions.md Aligns pre-PR and pre-commit requirements with each repository’s configured tooling.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

SkillSpector report: ✅ Passed

SkillSpector 2.13.4 static scan (no LLM, no network) of 22 AI primitive targets at 35ec78e.
HIGH/CRITICAL findings block unless the owner accepted them in .github/skillspector-accepted.json. Findings are heuristic, not confirmed vulnerabilities.

Severity Reported Accepted Blocking
CRITICAL 0 0 0
HIGH 27 27 0
MEDIUM 53 - -
LOW 3 - -

Top findings

Severity Rule Location Finding Status
HIGH MP3 .agents/skills/security-audit/AI-AND-LLM.md:29 Memory Manipulation: delete memory Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): audit guidance asking who may create, update and delete agent memory across tenants; it does no...
HIGH PE3 .agents/skills/security-audit/ATTACK-CLASSES.md:118 Credential Access: credentials.json Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): checklist item asking whether credentials.json or .env files are committed to the audited repo;...
HIGH PE3 .agents/skills/security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md:15 Credential Access: keychain Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): names keychain ACLs as an OS control to account for when judging a trust boundary; it does not ...
HIGH AE1 .agents/skills/security-audit/SKILL.md:175 Incomplete referenced artifact analysis: validate-coverage-ledger.cjs (partial) Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): derived from the accepted static_parse_limit on the bundled validator, which only reads its JSO...
HIGH AE1 .agents/skills/security-audit/SKILL.md:175 Incomplete referenced artifact analysis: validate-findings.cjs (partial) Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): derived from the accepted static_parse_limit on the bundled validator, which only reads its JSO...
HIGH PE3 .agents/skills/security-audit/validate-coverage-ledger.test.cjs:495 Credential Access: /etc/passwd Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): test fixture asserting the ledger validator rejects /etc/passwd as an unsafe absolute path; the...
HIGH PE3 .agents/skills/security-audit/validate-findings.test.cjs:320 Credential Access: /etc/passwd Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): test fixture (unsafe source paths) asserting the findings validator rejects /etc/passwd; the fi...
HIGH PE3 .agents/skills/security-audit/validate-findings.test.cjs:606 Credential Access: /etc/passwd Accepted: External cloudflare/security-audit-skill (vendored via apm.yml): test fixture (unsafe fingerprint paths) asserting the findings validator rejects /etc/passwd; t...
HIGH AR2 .apm/skills/humanizer/SKILL.md:202 Anti-Refusal Statement: without warning Accepted: Owner-approved false positive: section 8's quoted before-example describes a policy announced unexpectedly. It is sample prose illustrating dash punctuation, no...
HIGH AR2 .apm/skills/humanizer/SKILL.md:205 Anti-Refusal Statement: without warning Accepted: Owner-approved false positive: section 8's quoted after-example retains the same policy-announcement fact while replacing dashes with commas. It does not direct...

Showing 10 of 83 findings, blocking first; see Code Scanning for all.

Analysis limitations (37)
Target Location Reason Status
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:121 reference_missing Caveat, non-blocking
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:122 reference_missing Caveat, non-blocking
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:129 reference_missing Caveat, non-blocking
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:178 reference_missing Caveat, non-blocking
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:180 reference_missing Caveat, non-blocking
.apm/skills/commit-and-release .apm/skills/commit-and-release/SKILL.md:188 reference_missing Caveat, non-blocking
.apm/skills/meeting-transcript-creation .apm/skills/meeting-transcript-creation/SKILL.md:17 reference_missing Caveat, non-blocking
.apm/skills/morning-briefing .apm/skills/morning-briefing/SKILL.md:49 reference_missing Caveat, non-blocking
.apm/skills/morning-briefing .apm/skills/morning-briefing/SKILL.md:58 reference_missing Caveat, non-blocking
.apm/skills/obsidian .apm/skills/obsidian/SKILL.md:32 reference_missing Accepted: The path-like reference is generic `[text](url)` link syntax in prose, not a bundled file.

Showing 10 of 37 limitations; see the run summary for all.

Full results: Code Scanning alerts · workflow run and full reports

@DevSecNinja
DevSecNinja merged commit b4ff3e4 into main Nov 16, 2026
27 checks passed
@DevSecNinja
DevSecNinja deleted the devsecninja-fix-lefthook-instruction-scope branch November 16, 2026 13:16
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.

fix(instructions): require Lefthook only where the repo configures it

2 participants