From dce4d8fe565ee816913da5b7605e88d6c2f3b41a Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Nov 2026 08:20:43 +0000 Subject: [PATCH 1/3] :sparkles: Allow human co-authors in the commit checker The checker rejected any Co-authored-by trailer, which also blocked a real person. The trailer is meant to credit a human co-author, and git and GitHub use it for that; only AI providers, agents and bots are unwanted. Match the trailer value against a blocklist of providers and agents plus bot identities, and point to the dedicated AI-assisted-by trailer for AI participation. Co-authored-by joins the trailer exemption of the 80-character body rule. Update the tests, CONTRIBUTING.md, the create-commit skill and the commit memory to the new rule. AI-assisted-by: deepseek-v4.1-flash Signed-off-by: Andrey Antukh --- .agents/skills/create-commit/SKILL.md | 4 +- .serena/memories/workflow/creating-commits.md | 5 +- CONTRIBUTING.md | 7 +- scripts/check-commit | 33 +++++++-- scripts/test_check_commit.py | 74 ++++++++++++++++--- 5 files changed, 99 insertions(+), 24 deletions(-) diff --git a/.agents/skills/create-commit/SKILL.md b/.agents/skills/create-commit/SKILL.md index dd85191fd9..264f870e03 100644 --- a/.agents/skills/create-commit/SKILL.md +++ b/.agents/skills/create-commit/SKILL.md @@ -63,6 +63,8 @@ subject/body limits, and the `AI-assisted-by` trailer. Follow it exactly. - Do not pass `--author`. Author identity comes from the local git config. - Do not amend a commit you did not create in this session, unless explicitly asked. - Do not bypass pre-commit hooks (`--no-verify`) unless explicitly asked. -- Never add a `Co-authored-by:` trailer. It is forbidden and fails `./scripts/check-commit`. +- Add `Co-authored-by:` only for a human co-author. AI providers, agents and + bots are rejected by `./scripts/check-commit`; for AI participation use the + `AI-assisted-by:` trailer. - Do not add untracked files that were not created in this session. - Do not skip the `scripts/check-commit` verification step (Iron Rule 4). diff --git a/.serena/memories/workflow/creating-commits.md b/.serena/memories/workflow/creating-commits.md index cf08358aaf..914ba4f0bc 100644 --- a/.serena/memories/workflow/creating-commits.md +++ b/.serena/memories/workflow/creating-commits.md @@ -43,10 +43,9 @@ that breaks them is wrong, even if the code is right. - For another commit: `./scripts/check-commit -c ` - **NEVER** hand-wave the body as "one long line". If a line exceeds 80, break it at a space. -- **NEVER add a `Co-authored-by:` trailer.** It is forbidden; `scripts/check-commit` fails the commit when any line matches it (case-insensitive). +- **`Co-authored-by:` is for human co-authors only** (`Co-authored-by: Name `). AI providers, agents and bots must not be credited that way; use `AI-assisted-by:` instead. `scripts/check-commit` rejects a trailer value that names an AI provider or agent (`Claude`, `Copilot`, `Cursor`, `Codex`, `Gemini`, `Aider`, `Cline`, `Windsurf`, `DeepSeek`, `OpenCode`, `devin-ai`, `amazon q`, and similar) or carries a bot identity (`[bot]`, `bot@`). `NON_HUMAN_COAUTHOR_PATTERN` is the list; extend it when a new tool starts adding trailers. A person whose own name or email matches one of those tokens (a surname like `Cline`, an address at a provider) is rejected too; amend the trailer or credit them with `Reviewed-by:`. - CI runs `scripts/check-commit` on every new commit (`mem:workflow/creating-commits` is enforced by `.github/workflows/commit-checker.yml`), so a forbidden trailer fails the build. -- Exceptions inside the body (do not wrap these): `Signed-off-by:`, - `AI-assisted-by:` trailers, and lines carrying a URL. +- Exceptions inside the body (do not wrap these): `Signed-off-by:`, `Co-authored-by:`, `AI-assisted-by:` trailers, and lines carrying a URL. **AI-assisted-by trailer rules:** - Use only the model name, e.g. `mimo-v2.5`, `deepseek-v4-flash` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b23ae0fa9..83ab63e168 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -225,8 +225,11 @@ Commit messages must follow this format: those prefixes to an existing subject) - **Wrap body lines at 80 characters or fewer** (trailers and URLs excepted) - Separate the subject from the body with a **blank line** -- Never add a `Co-authored-by` trailer — it is forbidden and fails - `./scripts/check-commit` +- Use `Co-authored-by:` only for a human co-author + (`Co-authored-by: Name `). AI providers, agents and bots are not + allowed there; for AI participation add an `AI-assisted-by: ` + trailer instead. `./scripts/check-commit` rejects the trailer when its value + names one of them. You can check a commit against these rules with `./scripts/check-commit`. CI runs the same script on every new commit in diff --git a/scripts/check-commit b/scripts/check-commit index df4672ea59..852bab8240 100755 --- a/scripts/check-commit +++ b/scripts/check-commit @@ -52,11 +52,26 @@ MAX_SUBJECT_LINE = 80 MAX_BODY_LINE = 80 TRAILER_PATTERN = re.compile( - r"^(Signed-off-by|Co-developed-by|Reviewed-by|" + r"^(Signed-off-by|Co-authored-by|Co-developed-by|Reviewed-by|" r"Acked-by|Tested-by|Reported-by|Suggested-by|AI-assisted-by):" ) -FORBIDDEN_TRAILER_PATTERN = re.compile(r"^\s*Co-authored-by\s*:", re.IGNORECASE) +# ── Co-authored-by trailer ─────────────────────────────────────────────────── +# A human co-author may be credited with Co-authored-by. The trailer is +# forbidden when its value names an AI provider, an AI agent, or a bot: for AI +# participation the message uses "AI-assisted-by: " instead. +# Extend this list when a new tool starts adding trailers. +NON_HUMAN_COAUTHOR_PATTERN = re.compile( + r"^\s*co-authored-by\s*:.*(" + r"\b(?:chatgpt|openai|anthropic|claude|copilot|codex|gemini|bard|" + r"deepseek|mistral|qwen|kimi|llama|grok|cursor|" + r"windsurf|cline|aider|codeium|tabnine|amazon\s+q|sourcegraph\s+cody|" + r"roo\s+code|kilo\s+code|opencode)\b" + r"|\bdevin-ai|@devin\.ai" + r"|\[bot\]|\bbot@" + r")", + re.IGNORECASE, +) URL_PATTERN = re.compile(r"https?://\S+") @@ -218,12 +233,12 @@ def check_signed_off_by(message): return True, None -def check_no_co_authored_by(message): - """Check that the forbidden Co-authored-by trailer is absent.""" +def check_co_authored_by(message): + """Co-authored-by is allowed for humans, not for AI providers or bots.""" offenders = [ (line_number, line) for line_number, line in enumerate(message.split("\n"), start=1) - if FORBIDDEN_TRAILER_PATTERN.match(line) + if NON_HUMAN_COAUTHOR_PATTERN.match(line) ] if not offenders: return True, None @@ -232,8 +247,10 @@ def check_no_co_authored_by(message): for line_number, line in offenders ) return False, ( - "The 'Co-authored-by:' trailer is forbidden and must not appear " - "in the commit message. Offending line(s):\n" + details + "The 'Co-authored-by:' trailer is only for human co-authors. This one " + "names an AI provider, an AI agent, or a bot. Offending line(s):\n" + + details + + "\n For AI participation use: AI-assisted-by: " ) @@ -262,7 +279,7 @@ def main(): ("Subject capitalized", check_subject_capitalized), ("Blank line after subject", check_body_blank_line), ("Body wrapped at 80 chars", check_body_line_length), - ("No Co-authored-by trailer", check_no_co_authored_by), + ("Co-authored-by is human only", check_co_authored_by), ] all_ok = True diff --git a/scripts/test_check_commit.py b/scripts/test_check_commit.py index 037bc8fd56..05cc38671d 100644 --- a/scripts/test_check_commit.py +++ b/scripts/test_check_commit.py @@ -6,7 +6,9 @@ Run with: python3 scripts/test_check_commit.py Covers the body line-wrapping validator added to enforce the commit body -wrap rule documented in .serena/memories/workflow/creating-commits.md. +wrap rule documented in .serena/memories/workflow/creating-commits.md, and +the Co-authored-by validator, which allows human co-authors and rejects AI +providers and bots. """ import importlib.machinery @@ -87,6 +89,14 @@ class BodyLineLengthTests(unittest.TestCase): line = "Signed-off-by: Someone With A Long Name " self.assert_ok(":bug: Fix crash\n\nBody.\n\n" + line + "\n") + def test_human_co_author_trailer_passes(self): + line = ( + "Co-authored-by: Someone With A Very Long Name " + "" + ) + self.assertGreater(len(line), 80) + self.assert_ok(":bug: Fix crash\n\nBody.\n\n" + line + "\n") + def test_unbreakable_token_passes(self): line = "a" * 100 # no whitespace to wrap at self.assert_ok(":bug: Fix crash\n\n" + line + "\n") @@ -106,14 +116,16 @@ class BodyLineLengthTests(unittest.TestCase): self.assertIn("line 4", error) -class ForbiddenTrailerTests(unittest.TestCase): +class CoAuthorTrailerTests(unittest.TestCase): + """Co-authored-by is allowed for humans, forbidden for AI providers/bots.""" + def assert_ok(self, message): - ok, error = check_commit.check_no_co_authored_by(message) + ok, error = check_commit.check_co_authored_by(message) self.assertTrue(ok, error) self.assertIsNone(error) def assert_fail(self, message): - ok, error = check_commit.check_no_co_authored_by(message) + ok, error = check_commit.check_co_authored_by(message) self.assertFalse(ok) self.assertIsNotNone(error) return error @@ -121,15 +133,57 @@ class ForbiddenTrailerTests(unittest.TestCase): def test_body_without_trailer_passes(self): self.assert_ok(":bug: Fix crash\n\nBody.\n\nSigned-off-by: Someone \n") - def test_co_authored_by_fails(self): - error = self.assert_fail(":bug: Fix crash\n\nBody.\n\nCo-authored-by: Someone \n") - self.assertIn("Co-authored-by", error) + def test_human_co_author_passes(self): + self.assert_ok(":bug: Fix crash\n\nBody.\n\nCo-authored-by: Jane Doe \n") - def test_co_authored_by_case_insensitive_fails(self): - self.assert_fail(":bug: Fix crash\n\nBody.\n\nco-authored-by: Someone \n") + def test_human_with_github_noreply_email_passes(self): + self.assert_ok( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: Jane Doe <1234+jane@users.noreply.github.com>\n" + ) + + def test_human_whose_email_ends_with_bot_passes(self): + # "abbot@" must not count as a "bot@" identity. + self.assert_ok( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: Jane Abbot \n" + ) + + def test_claude_fails(self): + error = self.assert_fail( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: Claude \n" + ) + self.assertIn("Co-authored-by", error) + self.assertIn("AI-assisted-by", error) + + def test_cursor_fails(self): + self.assert_fail( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: Cursor Agent \n" + ) + + def test_copilot_fails(self): + self.assert_fail( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>\n" + ) + + def test_case_insensitive_fails(self): + self.assert_fail( + ":bug: Fix crash\n\nBody.\n\nco-authored-by: CHATGPT \n" + ) + + def test_bot_identity_fails(self): + self.assert_fail( + ":bug: Fix crash\n\nBody.\n\n" + "Co-authored-by: dependabot[bot] \n" + ) def test_co_authored_by_in_body_fails(self): - self.assert_fail(":bug: Fix crash\n\nCo-authored-by: Someone \nBody.\n") + self.assert_fail( + ":bug: Fix crash\n\nCo-authored-by: Gemini \nBody.\n" + ) def test_similar_trailer_passes(self): self.assert_ok(":bug: Fix crash\n\nBody.\n\nCo-developed-by: Someone \n") From 5c93ece9b9503dc21b7c7cd8190c9c4d781c5d7f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Nov 2026 08:28:28 +0000 Subject: [PATCH 2/3] :books: Slim the code review skills without losing checks code-review-criteria and review-code carried weight that changed no decision: a 16-row rationalizations table, red flags that repeated the axes, and three sections written for the author of a change rather than for the reviewer. 338 lines become 251. Drop that layer, dedupe DRY/KISS/YAGNI between the core principles and the axes, merge the two instruction lists of the flow, and compress the GitHub comment format. The reviewer no longer re-runs the suite or a build: the author's run and CI already provide that evidence, and repeating it only made reviews longer. It runs at most the single test file that settles a specific doubt, and states which evidence it relied on. AI-assisted-by: deepseek-v4.1-flash Signed-off-by: Andrey Antukh --- .agents/skills/code-review-criteria/SKILL.md | 138 +++++-------------- .agents/skills/review-code/SKILL.md | 55 +++----- 2 files changed, 53 insertions(+), 140 deletions(-) diff --git a/.agents/skills/code-review-criteria/SKILL.md b/.agents/skills/code-review-criteria/SKILL.md index 398aa440ee..b95c563a57 100644 --- a/.agents/skills/code-review-criteria/SKILL.md +++ b/.agents/skills/code-review-criteria/SKILL.md @@ -13,19 +13,17 @@ Multi-dimensional code review with quality gates. Every change gets reviewed bef ## When to Use -- The reviewer subagent of the `review-code` flow loads this skill to perform - the review of a code change. -- To review code, always go through the `review-code` flow — never load this - skill directly for that. This is the criteria reference, not the flow. +- The reviewer subagent of the `review-code` flow loads this skill to perform the review of a code change. +- To review code, always go through the `review-code` flow — never load this skill directly for that. This is the criteria reference, not the flow. ## Core Principles These principles underpin every axis. When in doubt, default to them. -- **DRY (Don't Repeat Yourself):** Every piece of knowledge has one authoritative representation. If the same logic appears in two places, extract it into a shared helper, model, or type. Reviewers: flag duplicated logic as a required change — it's not "just similar," it's drift that will diverge. -- **KISS (Keep It Simple, Stupid):** The simplest solution that works is the best solution. Complexity must earn its place. Reviewers: if you need more than one sentence to explain what a piece of code does, it's too complex — push for simplification before merge. -- **YAGNI (You Aren't Gonna Need It):** Don't add abstractions, hooks, or generalizations for hypothetical future use cases. Generalize on the third occurrence, not the first. Reviewers: delete speculative generality. -- **Don't invent problems:** Do not manufacture issues to produce more feedback. Every finding must be a real risk, a real readability barrier, or a real architectural concern — not a hypothetical or a stylistic preference disguised as a problem. +- **DRY (Don't Repeat Yourself):** Every piece of knowledge has one authoritative representation. Flag duplicated logic as a required change — it is not "just similar", it is drift that will diverge. +- **KISS (Keep It Simple, Stupid):** The simplest solution that works is the best solution. Complexity must earn its place: if it needs more than a sentence to explain, push for simplification before merge. +- **YAGNI (You Aren't Gonna Need It):** No abstractions, hooks or generalizations for hypothetical future use cases. Generalize on the third occurrence, not the first. +- **Don't invent problems:** Every finding must be a real risk, a real readability barrier, or a real architectural concern — not a hypothetical or a stylistic preference disguised as a problem. ## The Five-Axis Review @@ -38,7 +36,7 @@ Does the code do what it claims to do? - Does it match the spec or task requirements? - Are edge cases handled (null, empty, boundary values)? - Are error paths handled (not just the happy path)? -- Does it pass all tests? Are the tests actually testing the right things? +- Do the tests cover the changed behavior, including its edge cases? - Are there off-by-one errors, race conditions, or state inconsistencies? ### 2. Readability & Simplicity @@ -47,10 +45,7 @@ Can another engineer (or agent) understand this code without the author explaini - Are names descriptive and consistent with project conventions? (No `temp`, `data`, `result` without context) - Is the control flow straightforward (avoid nested ternaries, deep callbacks)? -- Are there any "clever" tricks that should be simplified? -- **KISS check:** Is this the simplest approach that solves the problem? A 20-line straightforward function beats a 5-line clever one that requires a comment to explain. -- Could this be done in fewer lines? (1000 lines where 100 suffice is a failure) -- Are abstractions earning their complexity? (Don't generalize until the third use case) +- Are there "clever" tricks that should be simplified? Could this be done in fewer lines? (1000 lines where 100 suffice is a failure) - Is a new conditional bolted onto an unrelated flow? Push the logic into its own helper, state, or policy. - Do repeated conditionals on the same shape appear? They signal a missing model or dispatcher. - Are there dead code artifacts: no-op variables, backwards-compat shims, or `// removed` comments? @@ -60,14 +55,13 @@ Can another engineer (or agent) understand this code without the author explaini Does the change fit the system's design? - Does it follow existing patterns or introduce a new one? If new, is it justified? -- Does it maintain clean module boundaries? -- **DRY check:** Is there existing code that does the same thing? Reuse the canonical helper instead of writing a near-duplicate. If two branches do nearly the same thing, collapse them. -- Are dependencies flowing in the right direction (no circular dependencies)? +- Does it keep clean module boundaries, with dependencies flowing the right way (no cycles)? - Is the abstraction level appropriate (not over-engineered, not too coupled)? -- Does this refactor reduce complexity or just relocate it? Count the concepts a reader must hold. Prefer the restructuring that makes whole branches disappear over one that re-centralizes the same logic. Prefer deleting an abstraction to polishing it. +- Is there existing code that already does this? Reuse the canonical helper instead of a near-duplicate, and collapse branches that do nearly the same thing. - Is feature-specific logic leaking into a shared or general-purpose module? - Are type boundaries explicit? Question gratuitous `any`/`unknown`/optional/casts and silent fallbacks. -- **Structural remedies:** When you flag a problem, propose the move — not just the problem. Replace conditionals with dispatchers, collapse duplicate branches, separate orchestration from business logic, extract helpers, split large files. Prefer the remedy that removes moving pieces over one that spreads the same complexity around. +- Does the change reduce complexity or relocate it? Count the concepts a reader must hold: prefer the restructuring that makes whole branches disappear, and deleting an abstraction over polishing it. +- **Give the remedy, not only the problem:** replace conditionals with dispatchers, separate orchestration from business logic, extract helpers, split large files. Prefer the remedy that removes moving pieces over one that spreads the same complexity around. ### 4. Security @@ -111,7 +105,17 @@ For each finding, describe the circumstances under which it could fail: specific Lead with what matters: correctness and security first, then structural issues, then everything else. A few high-conviction comments beat a long list. -5. **Verify the verification** — What tests were run? Did the build pass? Was the change tested manually? Screenshots for UI changes? +5. **Check the evidence, do not re-run it** — Which tests cover the change? What did the author run, and what did CI report? Never re-run the full suite or a build yourself: the author's run and CI already cover that, and repeating it only lengthens the review. Run at most the single test file that settles a specific doubt. When no checks have been run at all (a change you did not see tested), run the module's checks before the verdict. + +## Change Sizing + +Small, focused changes are easier to review, faster to merge, and safer to deploy. Flag the size when a diff exceeds ~300 lines, or when it grows a file past ~1000 total lines, and name the remedy: split it, and separate refactoring from feature work. This is a finding about the change, not work to do inside the review. + +## Dependencies + +Before accepting a new dependency: does the existing stack already solve it, how large is the bundle impact, is it maintained, does `npm audit` report anything, is the license compatible. Prefer the standard library and existing utilities — every dependency is a liability. + +For upgrades: read the changelog, not just the version number; one dependency per change; a green suite before and after; review the lockfile diff and never hand-edit it. Supply-chain triage follows `security-and-hardening`. ## Review Output @@ -151,96 +155,18 @@ Choose one: List the finding IDs the verdict depends on (e.g. "Request changes: R1, R2"). -## Change Sizing - -Small, focused changes are easier to review, faster to merge, and safer to deploy. - -``` -~100 lines changed → Good. Reviewable in one sitting. -~300 lines changed → Acceptable if it's a single logical change. -~1000 lines changed → Too large. Split it. -``` - -**Watch file size, not just diff size.** Around 1000 *total* lines in a single file is a common inspection signal. When a change materially grows an already-large file, decompose first. - -**Splitting strategies:** - -| Strategy | How | When | -|----------|-----|------| -| **Stack** | Submit a small change, start the next one based on it | Sequential dependencies | -| **By file group** | Separate changes for groups needing different reviewers | Cross-cutting concerns | -| **Horizontal** | Create shared code/stubs first, then consumers | Layered architecture | -| **Vertical** | Break into smaller full-stack slices of the feature | Feature work | - -**Separate refactoring from feature work.** A change that refactors and adds new behavior is two changes — submit them separately. - -## Change Descriptions - -- **First line:** Short, imperative, standalone. "Delete the FizzBuzz RPC" not "Deleting the FizzBuzz RPC." -- **Body:** What is changing and why. Include context and reasoning not visible in the code itself. -- **Anti-patterns:** "Fix bug," "Fix build," "Add patch," "Phase 1." - -## Dependencies - -Before adding any dependency: - -1. Does the existing stack solve this? (Often it does.) -2. How large is the dependency? (Check bundle impact.) -3. Is it actively maintained? (Check last commit, open issues.) -4. Does it have known vulnerabilities? (`npm audit`) -5. What's the license? (Must be compatible with the project.) - -**Rule:** Prefer standard library and existing utilities over new dependencies. Every dependency is a liability. - -**Upgrading dependencies:** - -- Read the changelog, not just the version number. Semver is a promise the maintainer may not have kept. -- One dependency per change. When a bulk bump breaks the build, you've lost which package did it. -- Let the tests decide — a green suite before *and* after, not just "it installed." -- Review the lockfile diff, not just `package.json`. Commit it and never hand-edit it. - -For supply-chain risk triage, follow the `security-and-hardening` skill. - -## Common Rationalizations - -| Rationalization | Reality | -|---|---| -| "It works, that's good enough" | Working code that's unreadable, insecure, or architecturally wrong creates debt that compounds. | -| "I wrote it, so I know it's correct" | Authors are blind to their own assumptions. Every change benefits from another set of eyes. | -| "We'll clean it up later" | Later never comes. The review is the quality gate — use it. | -| "AI-generated code is probably fine" | AI code needs more scrutiny, not less. It's confident and plausible, even when wrong. | -| "The tests pass, so it's good" | Tests are necessary but not sufficient. They don't catch architecture, security, or readability problems. | -| "The refactor makes it cleaner" | Relocating complexity isn't reducing it. If the reader still holds the same number of concepts, the structure didn't improve. | -| "It's only a small addition to this file" | Small diffs still push files past healthy size and bolt branches onto unrelated flows. | -| "It's just a version bump" | A bump is a behavior change you didn't write. Read the changelog. | -| "I'll upgrade everything in one PR" | A bulk bump hides which package broke the build. One per change. | -| "It's duplicated but it's only two places" | Two becomes three becomes five. Extract now, before the copies diverge. | -| "The abstraction is future-proof" | YAGNI. Delete speculative generality — generalize on the third occurrence, not the first. | -| "It's clever but efficient" | Cleverness is a readability tax. If it needs a comment to understand, simplify it. | - ## Red Flags -- PRs merged without any review -- Review that only checks if tests pass (ignoring other axes) -- "LGTM" without evidence of actual review -- Security-sensitive changes without security-focused review -- Large PRs that are "too big to review properly" (split them) -- No regression tests with bug fix PRs -- Accepting "I'll fix it later" — it never happens -- A refactor that moves code around without reducing the number of concepts a reader must hold -- New conditionals scattered into unrelated code paths (a missing abstraction) -- A bespoke helper that duplicates an existing canonical one -- A bulk "bump dependencies" PR with no changelog review +- A change merged without any review. +- A review that only checks whether the tests pass. +- Security-sensitive changes without a security-focused review. +- A change too large to review properly: split it. ## Verification -Before emitting the verdict, verify the change as it stands. This is the reviewer's own due diligence — it covers the state of the code at review time, not the later resolution of findings (fixing findings is the author's job; confirming them is a new review): +Before emitting the verdict, confirm the evidence the review rests on. This covers the state of the code at review time, not the later fixing of findings: -- [ ] Tests pass — run them yourself, don't trust the claim -- [ ] Build succeeds -- [ ] The verification story is documented (what changed, how it was verified) -- [ ] Dependency upgrades reviewed against changelog, isolated per package, verified by green suite - -## See Also - -- For detailed security review guidance, see `security-and-hardening` +- [ ] The suite is green, and the evidence is the author's run or CI — not your own re-run. Say which one you relied on. +- [ ] New behavior has tests that cover the edge cases in the diff. +- [ ] The verification story is stated: what changed and how it was verified. +- [ ] Dependency changes were reviewed against the changelog and the lockfile diff. diff --git a/.agents/skills/review-code/SKILL.md b/.agents/skills/review-code/SKILL.md index 21e7a7c7fd..65c811e71d 100644 --- a/.agents/skills/review-code/SKILL.md +++ b/.agents/skills/review-code/SKILL.md @@ -22,8 +22,20 @@ Act as a senior software engineer and perform a thorough code review. diff, a commit range, a branch, a PR (number or URL), or specific files. If the target is ambiguous, ask before reviewing. 2. Delegate the review to the `general` subagent (via the task tool), unless the - user specifies another agent. Include in the prompt the - **`code-review-criteria`** skill name and all user context. + user specifies another agent. The prompt carries the **`code-review-criteria`** + skill name, all user context, and these requirements: + - Load `code-review-criteria` and follow its process and output format. + - Read `AGENTS.md` (if present) and the module memories it points to for the + code being reviewed. + - Return the COMPLETE review, verbatim, exactly as the skill instructs it to + be produced. Never summarize it. + - Read-only: modify no file and create no commit. Reviewing never writes. + - Do not invent problems: every finding must be real and actionable. + - Missing tests are an issue, not a suggestion — a severity-tagged finding. + - Prioritize by impact: one structural issue outweighs ten nits, and "this + could be better" is not a finding — say why and how. + - Skip generated files, lockfile-only changes and unrelated modifications + unless they introduce security risks. 3. When the subagent returns, output the review to the user verbatim. Do not summarize it and do not act on its findings. 4. Right after the review, suggest how to proceed based on the findings. These @@ -44,43 +56,18 @@ the findings. Once the user explicitly states the review is done (or moves on to a different task), this rule no longer applies and you act as a normal build agent again. -## Instructions for the subagent - -1. Load the **`code-review-criteria`** skill and follow its process and output - format. -2. Read `AGENTS.md` (if present) and follow its instructions for finding and - reading all related testing documentation from memories before reviewing. -3. Return in your final message the COMPLETE review, verbatim, exactly as the - skill instructs it to be produced. Do not summarize it — include the full - structured review. - -### Strong rules for the subagent - -1. Do not invent problems. Every finding must be real and actionable. -2. Read-only: do not modify any file and do not create a commit — reviewing - never writes. -3. Be specific and constructive. "This could be better" is not helpful — explain - why and how. -4. Prioritize by impact. One structural issue outweighs ten nits. -5. Missing tests are an issue, not a suggestion. Report as a severity-tagged - finding — never as a recommendation. -6. Skip generated files, lockfile-only changes, and unrelated modifications - unless they introduce security risks. - ## Posting as a GitHub comment -Only post the review as a comment when the user asks for it explicitly. Keep -it in the session otherwise. - -When posting: PR comments go in English, with this minimal structure: +Post only when the user asks for it explicitly; otherwise keep the review in the +session. PR comments go in English, with this minimal structure: 1. **Intro line** — one sentence: what was found and the overall tone. No greetings. -2. **`## Main issues`** — one subsection per required finding: what breaks, - the failure circumstances, and the minimal fix (code snippet when useful). - A missing test belongs here, not under minor suggestions. -3. **`## Minor suggestions`** — one bullet per minor finding or suggestion: - file/function, problem, concrete remedy. +2. **`## Main issues`** — one subsection per required finding: what breaks, the + failure circumstances, and the minimal fix (code snippet when useful). A + missing test belongs here, not under minor suggestions. +3. **`## Minor suggestions`** — one bullet per minor finding: file/function, + problem, concrete remedy. 4. **Closing** — optional and short. Cut it when it adds nothing. Reference every finding by its ID (`R1`, `M1`, `S1`, … from From 09259623da4f5243a6668d130553d2d6c5c0528c Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Nov 2026 08:28:51 +0000 Subject: [PATCH 3/3] :fire: Remove the unused Signed-off-by validator check_signed_off_by was never registered in the validator list, so it never ran, and no test exercised it. The DCO sign-off applies to external contributors through CONTRIBUTING.md, not to every commit, so the local checker has nothing to enforce there. Drop the function and the DCO mention in the script docstring. AI-assisted-by: deepseek-v4.1-flash Signed-off-by: Andrey Antukh --- scripts/check-commit | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/scripts/check-commit b/scripts/check-commit index 852bab8240..44ed1e47fd 100755 --- a/scripts/check-commit +++ b/scripts/check-commit @@ -4,7 +4,7 @@ Check commit messages against Penpot's commit guidelines. Validates commit messages using the rules defined in: - .github/workflows/commit-checker.yml (regex pattern) - - CONTRIBUTING.md (formatting rules, subject length, DCO) + - CONTRIBUTING.md (formatting rules, subject length) - .serena/memories/workflow/creating-commits.md (body wrapped at 80 chars) By default, checks HEAD. Use --commit to specify a different commit. @@ -222,17 +222,6 @@ def check_body_line_length(message): ) -def check_signed_off_by(message): - """Check for the DCO Signed-off-by line (required for code changes).""" - if "Signed-off-by:" not in message: - return False, ( - "Missing 'Signed-off-by:' line in the commit footer.\n" - " Add it with 'git commit -s' or append it manually:\n" - " Signed-off-by: Your Real Name " - ) - return True, None - - def check_co_authored_by(message): """Co-authored-by is allowed for humans, not for AI providers or bots.""" offenders = [