Skip to content

refactor: slim CLAUDE.md, port pr-review-toolkit agents, sync .opencode parity#1833

Merged
Aureliolo merged 6 commits into
mainfrom
refactor/claude-md-and-agents
May 9, 2026
Merged

refactor: slim CLAUDE.md, port pr-review-toolkit agents, sync .opencode parity#1833
Aureliolo merged 6 commits into
mainfrom
refactor/claude-md-and-agents

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

Slim Claude Code's session context baseline. Empty /context was reading 53.5k tokens; this PR brings it to ~37–39k by:

  • CLAUDE.md: 238 → 107 lines (~12.8k → ~3.5k tokens). 11 MANDATORY paragraphs collapse to one-liners + reference links. The 30-script gate inventory moves to a new docs/reference/convention-gates.md.
  • Plugin port: 6 agents migrated verbatim from the pr-review-toolkit plugin into .claude/agents/ (descriptions slimmed to project style, bodies preserved). The /pre-pr-review skill drops the pr-review-toolkit: qualifier on 18 subagent_type references; the .opencode/ mirror does the same.
  • OpenCode parity: 5 MAJOR drift findings from tool-parity-checker fixed in-PR. New .opencode/agents/code-simplifier.md (SynthOrg-tuned standalone) plugs the parity gap.
  • AGENTS.md: tier listings updated (22 → 26 review agents).

The actual agent slim work (descriptions tightened from 451–731 tokens each to ~120 tokens) was tracked under #1826 and closed as part of this PR.

Files

Edited:

  • CLAUDE.md (slim)
  • .claude/skills/pre-pr-review/SKILL.md (qualifier strip)
  • .opencode/commands/pre-pr-review.md (qualifier strip + code-simplifier mapping)
  • .opencode/commands/aurelio-review-pr.md (qualifier strip)
  • AGENTS.md (tier listings)

Created:

  • docs/reference/convention-gates.md (35 enforcement gates + meta-gate; replaces inline inventory in CLAUDE.md)
  • .claude/agents/code-reviewer.md, code-simplifier.md, comment-analyzer.md, pr-test-analyzer.md, silent-failure-hunter.md, type-design-analyzer.md (ported)
  • .opencode/agents/code-simplifier.md (parity)

Test plan

  • Pre-commit + pre-push hooks pass (em-dashes, gate inventory, secrets, etc.)
  • scripts/check_convention_gate_inventory.py passes (every MANDATORY one-liner detected via inline-bold regex match against scripts/convention_gate_map.yaml)
  • Manual /context baseline check in a fresh Claude Code session: confirm drop from ~53.5k to ~37–39k.
  • End-to-end /pre-pr-review quick against a topic branch: confirm at least the ported code-reviewer agent fires (note: the harness may need a session restart for the new .claude/agents/ to appear in the subagent registry).

Review coverage

Pre-reviewed by 3 agents (docs-consistency, comment-quality-rot, tool-parity-checker). 5 MAJOR findings addressed in-PR; 1 MEDIUM advisory (wrap .opencode/agents/* to @.claude/agents/*) was investigated and rejected as a false positive against the documented standalone-tier architecture in AGENTS.md (the OpenCode prompts are intentionally SynthOrg-tuned with HIGH/MEDIUM/LOW severity vs. the upstream-ported Claude prompts using confidence scoring). Triage table at _audit/pre-pr-review/triage.md (gitignored).

Closes #1826.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 9, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR adds six new CLAUDE agent prompt/config files and one OPENCODE agent spec, refactors agent routing and adapter mappings to use unprefixed agent identifiers, updates AGENTS.md, condenses CLAUDE.md into mandatory repository rules, introduces docs/reference/convention-gates.md and wires it into pre-commit and the numeric-macro checker, adds a convention_gates runtime stat with fetcher and YAML mapping, and extends unit tests to cover the new stat.

Suggested labels

autorelease: tagged

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 40.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately reflects the main refactoring work: slimming CLAUDE.md, porting agents from pr-review-toolkit, and syncing .opencode parity.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, explaining the context-token reduction strategy and implementation details.
Linked Issues check ✅ Passed All requirements from #1826 (slim six agent description fields to project style) are met: agent bodies preserved, descriptions condensed to ~120 tokens, following project style, and verified via /context baseline and /pre-pr-review quick.
Out of Scope Changes check ✅ Passed All changes are within scope: CLAUDE.md slimming, convention-gates documentation, agent porting/description slimming, qualifier removal, AGENTS.md tier updates, and supporting script/test changes align with stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 9, 2026 08:25 — with GitHub Actions Inactive
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new automated review agents for both Claude and OpenCode, updates agent routing in the pre-PR review skill, and significantly refactors CLAUDE.md to be more concise by moving detailed reference material to dedicated documentation files. A new convention-gates.md reference file was also added to document the project's enforcement policy. Feedback was provided regarding the code-simplifier agent definition for Claude, which incorrectly prioritized JavaScript conventions over the project's Python-centric standards, suggesting an update to align it with the Python 3.14 core.

Comment thread .claude/agents/code-simplifier.md Outdated
Comment on lines +3 to +20
description: Refines recently modified code for clarity, consistency, and maintainability while preserving exact functionality. Prefers explicit/readable over compact; never changes behaviour. Applies CLAUDE.md project standards (function over arrow, ES module imports with extensions, explicit return types). Operates on recently touched code unless told otherwise.
model: opus
---

You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer.

You will analyze recently modified code and apply refinements that:

1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.

2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including:

- Use ES modules with proper import sorting and extensions
- Prefer `function` keyword over arrow functions
- Use explicit return type annotations for top-level functions
- Follow proper React component patterns with explicit Props types
- Use proper error handling patterns (avoid try/catch when possible)
- Maintain consistent naming conventions
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.

medium

The Claude version of the code-simplifier agent appears to be using JS/TS-centric conventions (e.g., "function over arrow", "ES module imports") as its primary examples of project standards. However, the project is primarily Python-centric (Python 3.14+).

In contrast, the OpenCode version (.opencode/agents/code-simplifier.md) is correctly tuned for the project's Python core, referencing model_copy, itertools, and PEP 649. The Claude version should be updated to include these Pythonic standards to ensure it provides relevant suggestions for the backend codebase while still supporting the React dashboard.

Suggested change
description: Refines recently modified code for clarity, consistency, and maintainability while preserving exact functionality. Prefers explicit/readable over compact; never changes behaviour. Applies CLAUDE.md project standards (function over arrow, ES module imports with extensions, explicit return types). Operates on recently touched code unless told otherwise.
model: opus
---
You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer.
You will analyze recently modified code and apply refinements that:
1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.
2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including:
- Use ES modules with proper import sorting and extensions
- Prefer `function` keyword over arrow functions
- Use explicit return type annotations for top-level functions
- Follow proper React component patterns with explicit Props types
- Use proper error handling patterns (avoid try/catch when possible)
- Maintain consistent naming conventions
description: Refines recently modified code for clarity, consistency, and maintainability while preserving exact functionality. Prefers explicit/readable over compact; never changes behaviour. Applies CLAUDE.md project standards (no __future__ annotations, explicit return types, function over arrow). Operates on recently touched code unless told otherwise.
model: opus
---
You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. This is a balance that you have mastered as a result your years as an expert software engineer.
You will analyze recently modified code and apply refinements that:
1. **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact.
2. **Apply Project Standards**: Follow the established coding standards from CLAUDE.md including:
- No `from __future__ import annotations` (Python 3.14+ uses PEP 649)
- Use explicit return type annotations for all public functions
- Prefer `function` keyword over arrow functions in React components
- Use `model_copy(update={...})` for Pydantic model updates
- Maintain consistent naming conventions (British English)
- Use proper error handling patterns (avoid broad try/except or try/catch)
- Use ES modules with proper import sorting and extensions (web only)

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/code-reviewer.md:
- Around line 29-43: The confidence-band ranges conflict with the reporting
threshold and overlap; update the rubric lines (the "**76-90**" and "**91-100**"
entries and the "Only report issues with confidence ≥ 80" rule) so ranges are
mutually exclusive and align with the threshold — e.g., change the Important
band to "**80-89**" and the Critical band to "**90-100**", remove or repurpose
the "**76-90**"/"**76-79**" text so no scores below 80 are listed as reportable,
and ensure the "Only report issues with confidence ≥ 80" statement matches these
new bands.

In @.claude/agents/code-simplifier.md:
- Around line 13-20: The checklist item "2. **Apply Project Standards**"
currently lists frontend-specific rules (e.g., "Use ES modules with proper
import sorting and extensions", "Prefer `function` keyword over arrow
functions", "Follow proper React component patterns with explicit Props types")
as global standards; update the section in .claude/agents/code-simplifier.md so
these bullets are explicitly scoped to frontend files only (add a qualifying
sentence like "Apply the following frontend-specific standards only to
JavaScript/TypeScript/React frontend files" and leave backend/Python/Go rules
unaffected), and ensure the bullets remain unchanged except for the added scope
note so reviewers working on non-frontend languages are not misdirected.

In @.claude/agents/type-design-analyzer.md:
- Around line 52-79: The fenced example block starting at the "## Type:
[TypeName]" section uses an untyped triple-backtick code fence; update that
fence to include a language tag (e.g., change ``` to ```text) so markdownlint
passes and rendering is consistent across viewers—ensure the opening fence above
the Invariants/Ratings block is modified (leave the closing ``` unchanged).

In @.opencode/agents/code-simplifier.md:
- Around line 23-31: The markdown has lint violations: add a blank line before
each subsection heading (e.g., before "### 1. Unnecessary complexity (HIGH)" and
"### 2. Dead and redundant code (HIGH)" and any similar third-level headings
later in the file) so headings follow markdownlint spacing rules, and update the
fenced example block to include a language tag (e.g., change the fence to
```text) and ensure there is a blank line before and after the fenced block;
locate the fenced block and headings by their exact text in the diff and apply
these spacing and fence-tag fixes consistently (also apply the same changes to
the other occurrences referenced in the comment).

In `@CLAUDE.md`:
- Around line 29-35: Update the quick-command examples that call pytest so they
consistently include the mandatory xdist distribution flag; add
"--dist=loadfile" to each shown command variant (e.g. the commands beginning
with "uv run python -m pytest tests/ -m unit -n 8", "uv run python -m pytest
tests/ -m integration -n 8", "uv run python -m pytest tests/ -m e2e -n 8", the
coverage command with "--cov=synthorg", the benchmarks command, and the
HYPOTHESIS_PROFILE examples) so the docs match the requirement stated elsewhere
and prevent users from copying commands that omit --dist=loadfile.

In `@docs/reference/convention-gates.md`:
- Line 49: Replace the hardcoded numeric claim "(35 enforcement gates plus the
meta-gate below = 36 total `check_*.py` scripts.)" in
docs/reference/convention-gates.md with a runtime-stats marker; use the
appropriate key from data/runtime_stats.yaml (e.g. add or use a key like
CONVENTION_GATES) and insert the marker <!--RS:CONVENTION_GATES--> where the
number currently appears so the docs pull the total at build/runtime instead of
hardcoding it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b8d5844d-566f-4c60-8747-c70465fd6e41

📥 Commits

Reviewing files that changed from the base of the PR and between d1faf86 and 23c6108.

📒 Files selected for processing (13)
  • .claude/agents/code-reviewer.md
  • .claude/agents/code-simplifier.md
  • .claude/agents/comment-analyzer.md
  • .claude/agents/pr-test-analyzer.md
  • .claude/agents/silent-failure-hunter.md
  • .claude/agents/type-design-analyzer.md
  • .claude/skills/pre-pr-review/SKILL.md
  • .opencode/agents/code-simplifier.md
  • .opencode/commands/aurelio-review-pr.md
  • .opencode/commands/pre-pr-review.md
  • AGENTS.md
  • CLAUDE.md
  • docs/reference/convention-gates.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Lighthouse Site
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (4)
.opencode/commands/**/*

📄 CodeRabbit inference engine (AGENTS.md)

PowerShell translation of bash commands happens in OpenCode adapters (.opencode/commands/), not in shared skill content

Files:

  • .opencode/commands/aurelio-review-pr.md
  • .opencode/commands/pre-pr-review.md
{README.md,docs/**/*.md}

📄 CodeRabbit inference engine (CLAUDE.md)

Numeric claims in README and public docs must be sourced from data/runtime_stats.yaml via <!--RS:NAME--> markers

Files:

  • docs/reference/convention-gates.md
**/*.{d2,md}

📄 CodeRabbit inference engine (CLAUDE.md)

Use d2 for architecture/nested container diagrams; use mermaid for flowcharts/sequence/pipelines; use Markdown tables for tabular data. D2 theme 200 (Dark Mauve), CI pinned to v0.7.1

Files:

  • docs/reference/convention-gates.md
  • AGENTS.md
  • CLAUDE.md
.claude/skills/**/*

📄 CodeRabbit inference engine (AGENTS.md)

Shared skills in .claude/skills/ should remain shell-neutral or bash-based; use POSIX/bash-compatible commands (ls -la, grep, pipes)

Git commands in shared skills work the same in both shells and do not require translation

Files:

  • .claude/skills/pre-pr-review/SKILL.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:23:56.593Z
Learning: All project conventions, commands, and standards are defined in CLAUDE.md - reference it for project structure, package layout, code conventions, quick commands, Git workflow, testing standards, design specs, logging, resilience, security patterns, convention rollout enforcement, and telemetry
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:23:56.593Z
Learning: Memory directory structure should include MEMORY.md (index), research-log.md (one-liner entries), research/ subdirectory (detailed write-ups), and individual memory files with prefixes (user_*.md, feedback_*.md, project_*.md, reference_*.md)
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Read `docs/design/` page before implementing; deviations need approval per DESIGN_SPEC.md
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Present every plan for accept/deny before coding
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: No region/currency/locale should be privileged; use metric units and British English
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Every convention PR must ship its enforcement gate
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Test timeout/slow failures indicate source-code regression; never edit `tests/baselines/unit_timing.json`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: After issue resolution: branch + commit + push (no auto-PR); use `/pre-pr-review` command; after PR merge use `/post-merge-cleanup`; after PR creation use `/aurelio-review-pr` for external feedback. Fix everything valid; never defer.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Always run tests with `pytest-xdist -n 8 --dist=loadfile` (loadfile prevents 3.14+Windows ProactorEventLoop leak)
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Git commits: `<type>: <description>` format (feat/fix/refactor/docs/test/chore/perf/ci); commitizen-enforced. Branches: `<type>/<slug>` from main
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Signed commits required on protected refs (GPG/SSH or GitHub App via `synthorg-repo-bot`)
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Pre-commit/pre-push hooks configured via `.pre-commit-config.yaml`; hookify rules in `.claude/hookify.*.md`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Squash merge on PRs; PR body becomes squash commit; trailers (`Release-As`, `Closes `#N``) must be in PR body
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: GitHub queries: use `gh issue list` via Bash, NOT MCP `list_issues`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: CLI is Docker-only (init/start/stop/status); features go in dashboard + REST API. See `cli/CLAUDE.md` (use `go -C cli`, never `cd cli`)
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:24:39.425Z
Learning: Web code: see `web/CLAUDE.md` for React 19 + design system details; use Go binary for CLI
🪛 LanguageTool
.claude/agents/silent-failure-hunter.md

[style] ~61-~61: This phrase is redundant. Consider using “outside”.
Context: ...to a mock, stub, or fake implementation outside of test code? Error Propagation: - Sh...

(OUTSIDE_OF)


[style] ~74-~74: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...oes it provide actionable next steps? - Does it avoid jargon unless the user is a de...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[grammar] ~113-~113: Use a hyphen to join words.
Context: ...keptical, and uncompromising about error handling quality. You: - Call out every ...

(QB_NEW_EN_HYPHEN)

.claude/agents/code-simplifier.md

[style] ~35-~35: To elevate your writing, try using a synonym here.
Context: ...Create overly clever solutions that are hard to understand - Combine too many con...

(HARD_TO)

.claude/agents/pr-test-analyzer.md

[style] ~29-~29: ‘absolutely essential’ might be wordy. Consider a shorter alternative.
Context: ... - Rate criticality from 1-10 (10 being absolutely essential) - Explain the specific regression o...

(EN_WORDINESS_PREMIUM_ABSOLUTELY_ESSENTIAL)

CLAUDE.md

[grammar] ~89-~89: Ensure spelling is correct
Context: ...d @example(...)). - Flaky: NEVER skip/xfail; fix fundamentally. Use `asyncio.Event()...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.22.1)
.claude/agents/type-design-analyzer.md

[warning] 52-52: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

.opencode/agents/code-simplifier.md

[warning] 23-23: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 29-29: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 34-34: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 39-39: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 45-45: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


[warning] 66-66: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


[warning] 66-66: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (4)
AGENTS.md (1)

51-53: Roster update is internally consistent

Agent totals and tier membership align with the stated 26-agent architecture.

.opencode/commands/aurelio-review-pr.md (1)

15-20: Mapping key migration looks correct

The unprefixed subagent_type mappings are consistent with the new routing scheme.

.opencode/commands/pre-pr-review.md (1)

15-24: Pre-PR adapter parity is correctly wired

The routing keys and dedicated code-simplifier prompt mapping are consistent with the refactor intent.

.claude/skills/pre-pr-review/SKILL.md (1)

252-275: Subagent-type migration is consistent

The unprefixed agent identifiers and Phase 9 code-simplifier update are coherent with the new agent registry and adapter mappings.

Also applies to: 919-919

Comment thread .claude/agents/code-reviewer.md Outdated
Comment thread .claude/agents/code-simplifier.md Outdated
Comment thread .claude/agents/type-design-analyzer.md Outdated
Comment thread .opencode/agents/code-simplifier.md
Comment thread CLAUDE.md Outdated
Comment thread docs/reference/convention-gates.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/code-simplifier.md:
- Line 49: Update the conditional-style guidance that currently reads "Avoid
nested ternary operators - prefer switch statements or if/else chains for
multiple conditions" to be language-aware: when the target language is Python
(see the documented Python scope), recommend "match/case" or "if/elif" instead
of "switch"; keep "switch" as the recommendation for TypeScript/Go. Ensure the
guidance text (the sentence starting with "Avoid nested ternary operators") is
modified to branch by language and mentions the language-idiomatic alternatives
"match/case" and "if/elif" for Python and "switch" for TypeScript/Go.

In `@docs/reference/convention-gates.md`:
- Around line 11-12: The inventory sentence is inconsistent with the bullet
list: the glob scripts/check_*.py would include
check_convention_gate_inventory.py but the bullets omit it and list it
separately; either add check_convention_gate_inventory.py into the bullets (so
the bullets reflect the exact output of scripts/check_*.py) or change the
sentence to clarify that the listed items cover only enforcement gates and
exclude the meta-gate (reword the sentence referencing scripts/check_*.py
accordingly). Ensure you update the text that mentions scripts/check_*.py and/or
the bullet list that references check_convention_gate_inventory.py so the page
is self-consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 882dadd8-fd9d-410a-8b23-98719e1c138b

📥 Commits

Reviewing files that changed from the base of the PR and between 23c6108 and cdb7cb8.

📒 Files selected for processing (12)
  • .claude/agents/code-reviewer.md
  • .claude/agents/code-simplifier.md
  • .claude/agents/type-design-analyzer.md
  • .opencode/agents/code-simplifier.md
  • .pre-commit-config.yaml
  • CLAUDE.md
  • data/runtime_stats.yaml
  • docs/reference/convention-gates.md
  • scripts/check_doc_numeric_macros.py
  • scripts/generate_runtime_stats.py
  • scripts/inject_runtime_stats.py
  • tests/unit/scripts/test_generate_runtime_stats.py
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Build Web Assets (melange)
  • GitHub Check: Lighthouse Site
  • GitHub Check: Analyze (python)
🧰 Additional context used
📓 Path-based instructions (2)
tests/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use pytest markers: @pytest.mark.{unit,integration,e2e,slow}. Async tests use auto. Global timeout 30s. Coverage minimum 80%.

Windows: unit tests use WindowsSelectorEventLoopPolicy (3.14 IOCP teardown race). Subprocess tests override back.

Mock-spec: every Mock declares spec=ConcreteClass; baseline at scripts/mock_spec_baseline.txt.

Use FakeClock from tests._shared.fake_clock; inject via clock= parameter.

Files:

  • tests/unit/scripts/test_generate_runtime_stats.py

⚙️ CodeRabbit configuration file

Test files do not require Google-style docstrings on classes or functions -- ruff D rules are only enforced on src/. A bare @settings() decorator with no arguments on Hypothesis property tests is a no-op and should not be suggested -- the HYPOTHESIS_PROFILE env var controls example counts via registered profiles, which @given() honors automatically.

Files:

  • tests/unit/scripts/test_generate_runtime_stats.py
**.md

📄 CodeRabbit inference engine (CLAUDE.md)

Numerics in README + public docs must be sourced from data/runtime_stats.yaml via markers.

Use d2 for architecture/nested container diagrams (theme 200 - Dark Mauve, CI pinned to v0.7.1); use mermaid for flowcharts/sequence/pipelines. Use Markdown tables for tabular data.

Files:

  • CLAUDE.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:42:33.930Z
Learning: Read CLAUDE.md for project structure, package layout, code conventions, quick commands, Git workflow, commit conventions, branch naming, testing standards, coverage requirements, design specifications, logging, resilience, security patterns, convention rollout, and telemetry standards
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:42:33.930Z
Learning: OpenCode adapters should translate bash commands to PowerShell equivalents in `.opencode/commands/` rather than modifying shared skill content
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Read `docs/design/` page before implementing; deviations need approval. See DESIGN_SPEC.md.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Present every plan for accept/deny before coding.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: No region/currency/locale privileged; use metric units; use British English.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Every convention PR must ship its enforcement gate. See docs/reference/convention-gates.md.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Timeout/slow test failures indicate source-code regression; never edit tests/baselines/unit_timing.json.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: After issue: branch + commit + push (no auto-PR); use /pre-pr-review. After PR: /aurelio-review-pr for external feedback. Fix EVERYTHING valid; no deferring.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Always run pytest with -n 8 --dist=loadfile (prevents 3.14+ Windows ProactorEventLoop leak).
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Commits: use <type>: <description> format (feat/fix/refactor/docs/test/chore/perf/ci); commitizen-enforced.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Signed commits required on protected refs (GPG/SSH or GitHub App via synthorg-repo-bot).
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Branches: use <type>/<slug> naming from main.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Use pre-commit/pre-push hooks: .pre-commit-config.yaml. Hookify rules: .claude/hookify.*.md.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Squash merge PRs. PR body becomes squash commit; trailers (Release-As, Closes `#N`) must be in PR body.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Use `gh issue list` via Bash for GitHub queries, NOT MCP `list_issues`.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: Finished issue: branch + commit + push (no auto-PR). Use /pre-pr-review. After merge: /post-merge-cleanup.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: PR review: fix everything valid; never skip as out-of-scope.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: CLI is Docker-only (init/start/stop/status); features go in dashboard + REST API.
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:43:10.639Z
Learning: For web development, see web/CLAUDE.md. For CLI development, see cli/CLAUDE.md (use `go -C cli`, never `cd cli`). For shell scripts, see ~/.claude/rules/common/bash.md.
📚 Learning: 2026-05-05T09:04:46.195Z
Learnt from: Aureliolo
Repo: Aureliolo/synthorg PR: 1760
File: scripts/_dual_backend_parity_lib.py:215-216
Timestamp: 2026-05-05T09:04:46.195Z
Learning: This repository targets Python 3.14+ and follows PEP 758. Therefore, reviewer tooling should NOT treat unparenthesized multi-exception `except` clauses written without an `as` clause (e.g., `except MemoryError, RecursionError:`) as syntax errors. Only flag `except`-clause problems when they are genuinely invalid for Python 3.14+.

Applied to files:

  • scripts/generate_runtime_stats.py
  • scripts/check_doc_numeric_macros.py
  • scripts/inject_runtime_stats.py
  • tests/unit/scripts/test_generate_runtime_stats.py
🪛 LanguageTool
.claude/agents/code-simplifier.md

[style] ~55-~55: To elevate your writing, try using a synonym here.
Context: ...Create overly clever solutions that are hard to understand - Combine too many con...

(HARD_TO)

CLAUDE.md

[grammar] ~89-~89: Ensure spelling is correct
Context: ...d @example(...)). - Flaky: NEVER skip/xfail; fix fundamentally. Use `asyncio.Event()...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (6)
.claude/agents/type-design-analyzer.md (1)

1-110: Looks good — agent spec is clean and objective-aligned.

The frontmatter is concise, the output contract is explicit, and the prior markdown fence-language issue is resolved.

CLAUDE.md (1)

7-107: Good consolidation with no new policy conflicts found.

The slimmed structure is coherent, and the previously conflicting pytest guidance now appears consistent across quick commands and testing rules.

.claude/agents/code-reviewer.md (1)

22-45: Scoring rubric and report threshold are now aligned.

The confidence bands are non-overlapping and consistent with the “report only ≥80” rule.

.opencode/agents/code-simplifier.md (1)

23-77: Markdown structure and reporting template look clean.

Section spacing and fenced-block formatting are now lint-friendly, and the simplification boundaries are clearly defined.

tests/unit/scripts/test_generate_runtime_stats.py (1)

265-289: Good coverage for the new gate-count fetcher.

This exercises both the normal globbing path and the missing-scripts/ failure path, which is exactly the contract the new stat needs.

scripts/generate_runtime_stats.py (1)

274-292: Fetcher wiring matches the existing runtime-stats pattern.

The new convention_gates fetcher keeps the same error contract and registry shape as the other stats, which makes the addition low-risk.

- Improving readability through clear variable and function names
- Consolidating related logic
- Removing unnecessary comments that describe obvious code
- IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Python 3.14 support a switch statement keyword, and what is the idiomatic alternative for multi-branch conditionals?

💡 Result:

No. Python 3.14 does not have a dedicated switch statement keyword. The idiomatic alternative for multi-branch conditionals in modern Python is: 1) match / case (structural pattern matching) when you want a “switch-like” dispatch based on a value/pattern. Python’s docs explicitly note that ifelif… is a substitute for switch/case statements, and also that match can be used for similar multi-branch logic [1]. The match statement compares a subject against successive case patterns, executing only the first matching case (and optionally using case _: as a fallback) [1][2]. 2) Plain if / elif / else when pattern matching is unnecessary; Python’s control-flow tutorial describes ifelif… as the substitute for switch/case statements in other languages [1]. So, for multi-branch conditionals in Python 3.14, prefer match ... case ... if it fits your use case; otherwise use if/elif/else [1].

Citations:


🏁 Script executed:

# Verify the file exists and read relevant sections
if [ -f ".claude/agents/code-simplifier.md" ]; then
  echo "=== File exists. Reading full content ==="
  cat -n ".claude/agents/code-simplifier.md"
else
  echo "File not found at .claude/agents/code-simplifier.md"
fi

Repository: Aureliolo/synthorg

Length of output: 4972


Make conditional-style guidance language-aware to avoid invalid Python recommendations

Line 49 recommends switch statements globally, but Python (explicitly scoped at line 15) does not have a switch keyword. This can misdirect the agent when simplifying Python code. Use language-idiomatic alternatives: match/case or if/elif for Python; switch for TypeScript/Go.

Suggested patch
-   - IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains for multiple conditions
+   - IMPORTANT: Avoid nested ternary operators. For multiple conditions, prefer language-idiomatic branching (Python: `match/case` or `if/elif`; TS/Go: `switch` or `if/else`)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/code-simplifier.md at line 49, Update the conditional-style
guidance that currently reads "Avoid nested ternary operators - prefer switch
statements or if/else chains for multiple conditions" to be language-aware: when
the target language is Python (see the documented Python scope), recommend
"match/case" or "if/elif" instead of "switch"; keep "switch" as the
recommendation for TypeScript/Go. Ensure the guidance text (the sentence
starting with "Avoid nested ternary operators") is modified to branch by
language and mentions the language-idiomatic alternatives "match/case" and
"if/elif" for Python and "switch" for TypeScript/Go.

Comment thread docs/reference/convention-gates.md
Aureliolo added 6 commits May 9, 2026 10:50
…de parity

CLAUDE.md: 238 to 107 lines (~12.8k to ~3.5k context tokens) by
collapsing MANDATORY paragraphs to one-liners + reference links. The
30-script gate inventory moved to docs/reference/convention-gates.md
(now 34 enforcement gates + meta-gate, reflecting all
scripts/check_*.py).

Six pr-review-toolkit plugin agents ported verbatim to .claude/agents/
with descriptions slimmed to project style: code-reviewer,
code-simplifier, comment-analyzer, pr-test-analyzer,
silent-failure-hunter, type-design-analyzer. The /pre-pr-review SKILL
drops the pr-review-toolkit qualifier on 18 subagent_type references;
the .opencode commands match. New .opencode/agents/code-simplifier.md
fills the parity gap. AGENTS.md tier listings updated: 22 to 26 agents.

Pre-reviewed by 3 agents (docs-consistency, comment-quality-rot,
tool-parity-checker), 5 findings addressed.
…lifecycle

The convention-gates.md inventory and CLAUDE.md reference both reflect
the new gate that landed on main during this PR's review. CLAUDE.md
line 45 now says "35 enforcement gates" matching the inventory list.
… detection

The convention-gate-inventory meta-gate (scripts/check_convention_gate_inventory.py)
detects MANDATORY paragraphs by `(MANDATORY)` suffix on a section header
or inside a bold marker (`**Name (MANDATORY)**`). The slim collapsed the
11 paragraphs into bullet items but omitted the suffix, so every YAML
entry in scripts/convention_gate_map.yaml became "stale". Adding
`(MANDATORY)` inside the bold marker matches the inline-bold regex
without re-expanding the section.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CLAUDE.md`:
- Around line 29-31: Remove the redundant inline comment on the unit pytest
command so the three pytest invocations are consistent; specifically edit the
line containing "uv run python -m pytest tests/ -m unit                         
# -n 8 --dist=loadfile via pyproject addopts" to drop the trailing "# -n 8
--dist=loadfile via pyproject addopts" (the other pytest lines "uv run python -m
pytest tests/ -m integration" and "uv run python -m pytest tests/ -m e2e" should
remain unchanged).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0faa1524-7be6-4253-9687-1ed48ff590b2

📥 Commits

Reviewing files that changed from the base of the PR and between cdb7cb8 and 2b1f8e4.

📒 Files selected for processing (1)
  • CLAUDE.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Test (Python 3.14)
  • GitHub Check: Lighthouse Site
  • GitHub Check: Analyze (python)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: All project conventions, commands, and standards are defined in CLAUDE.md - read it for project structure, package layout, code conventions, quick commands, git workflow, testing standards, design specs, logging, resilience, security patterns, and convention rollout procedures
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Design spec (docs/design/) must be read before implementation
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Convention Rollout (MANDATORY) sections in CLAUDE.md ship enforcement gates for every new project-wide convention
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Sessions in OpenCode persist in SQLite and can be resumed with --continue flag
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Quality tier review agents (Sonnet-class: ollama-cloud/qwen3-coder-next:cloud) verify: code-reviewer, code-simplifier, python-reviewer, frontend-reviewer, go-reviewer, conventions-enforcer, logging-audit, resilience-audit, api-contract-drift
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Parallel tier review agents (Haiku-class: ollama-cloud/minimax-m2.5:cloud) verify: async-concurrency-reviewer, comment-analyzer, comment-quality-rot, design-token-audit, diagram-syntax-validator, docs-consistency, go-conventions-enforcer, go-security-reviewer, infra-reviewer, issue-resolution-verifier, persistence-reviewer, pr-test-analyzer, security-reviewer, silent-failure-hunter, test-quality-reviewer, tool-parity-checker, type-design-analyzer
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Custom slash commands for workflows: /pre-pr-review, /aurelio-review-pr, /post-merge-cleanup, /worktree, /codebase-audit, /review-dep-pr, /research-link, /analyse-logs
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:49:46.487Z
Learning: Plugins (synthorg-hooks.ts, memory.ts) extend OpenCode functionality with PreToolUse/PostToolUse hooks and memory directory integration
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Read `docs/design/` page before implementing; deviations need approval
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Present every plan for accept/deny before coding
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Use no region/currency/locale privilege; use metric units and British English throughout
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Every convention PR must ship its enforcement gate
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Timeout/slow test failures indicate source-code regression; never edit `tests/baselines/unit_timing.json`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: After completing an issue: create branch, commit, push (no auto-PR); use `/pre-pr-review` command before opening PR
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: After PR merge: use `/post-merge-cleanup` command
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Git commits: use `<type>: <description>` format (feat/fix/refactor/docs/test/chore/perf/ci); enforced by commitizen
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Signed commits required on protected refs (GPG/SSH or GitHub App via `synthorg-repo-bot`)
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Branches: use `<type>/<slug>` naming from main
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: Squash merge; PR body becomes squash commit; trailers (`Release-As`, `Closes `#N``) must be in PR body
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: GitHub queries: use `gh issue list` via Bash, NOT MCP `list_issues`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: After PR review: fix everything valid; never skip as out-of-scope
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: For CLI development: use `go -C cli`, never `cd cli`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: For shell scripting conventions and `cd` / `git -C` / Bash file-write rules: see `~/.claude/rules/common/bash.md`
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: For web development: see `web/CLAUDE.md` for design system and component guidelines
Learnt from: CR
Repo: Aureliolo/synthorg

Timestamp: 2026-05-09T08:50:25.117Z
Learning: For CLI development: see `cli/CLAUDE.md` for Go-specific guidelines
🪛 LanguageTool
CLAUDE.md

[grammar] ~89-~89: Ensure spelling is correct
Context: ...d @example(...)). - Flaky: NEVER skip/xfail; fix fundamentally. Use `asyncio.Event()...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (1)
CLAUDE.md (1)

55-55: The PEP 758 exception syntax description is accurate. Python 3.14 does allow unparenthesized multiple exception types (except A, B:) when the as clause is not used, and parentheses remain required when binding an exception instance (except (A, B) as e:). No changes needed.

Comment thread CLAUDE.md
Comment on lines +29 to +31
uv run python -m pytest tests/ -m unit # -n 8 --dist=loadfile via pyproject addopts
uv run python -m pytest tests/ -m integration
uv run python -m pytest tests/ -m e2e
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.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Remove redundant inline comment for consistency.

Line 29 includes an inline comment explaining that -n 8 --dist=loadfile are auto-applied via pyproject addopts, but the identical pytest commands on lines 30-31 lack this comment. Line 83 already provides the canonical explanation of the addopts behavior. The inline comment creates visual inconsistency and line-length bloat.

♻️ Proposed fix to remove redundant comment
-uv run python -m pytest tests/ -m unit                                              # -n 8 --dist=loadfile via pyproject addopts
+uv run python -m pytest tests/ -m unit
 uv run python -m pytest tests/ -m integration
 uv run python -m pytest tests/ -m e2e
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CLAUDE.md` around lines 29 - 31, Remove the redundant inline comment on the
unit pytest command so the three pytest invocations are consistent; specifically
edit the line containing "uv run python -m pytest tests/ -m unit                
# -n 8 --dist=loadfile via pyproject addopts" to drop the trailing "# -n 8
--dist=loadfile via pyproject addopts" (the other pytest lines "uv run python -m
pytest tests/ -m integration" and "uv run python -m pytest tests/ -m e2e" should
remain unchanged).

@Aureliolo Aureliolo force-pushed the refactor/claude-md-and-agents branch from 2b1f8e4 to 080d443 Compare May 9, 2026 08:54
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 9, 2026 08:57 — with GitHub Actions Inactive
@Aureliolo Aureliolo merged commit e6372b8 into main May 9, 2026
65 of 67 checks passed
@Aureliolo Aureliolo deleted the refactor/claude-md-and-agents branch May 9, 2026 08:58
@Aureliolo Aureliolo temporarily deployed to cloudflare-preview May 9, 2026 08:58 — with GitHub Actions Inactive
@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.74%. Comparing base (410cb3b) to head (080d443).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1833   +/-   ##
=======================================
  Coverage   84.73%   84.74%           
=======================================
  Files        1799     1799           
  Lines      104779   104779           
  Branches     9187     9187           
=======================================
+ Hits        88788    88790    +2     
  Misses      13757    13757           
+ Partials     2234     2232    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Aureliolo pushed a commit that referenced this pull request May 10, 2026
<!-- HIGHLIGHTS_START -->
## Highlights

> _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub
Models). Commit-based changelog below._

### What you'll notice
- Improved error logging and Prometheus instrumentation provide better
system monitoring.
- Eliminated race conditions in CI tagging for more reliable development
releases.
- Fixed critical configuration access and kill-switch bugs to enhance
system stability.
- Enhanced client experience with retry-after headers and better
websocket reconnect behavior.

### What's new
- Introduced composite indexes and cursor pagination for faster data
queries.
- Added server-sent events rate limiting and Ollama input sanitization
for improved security.

### Under the hood
- Centralized workflow error mappings to standardize error handling.
- Refactored API lifecycle fallback to use a configuration snapshot for
consistency.
- Tightened startup settings baseline and reduced controller error
baseline to zero.
- Replaced flaky contributor-assistant GitHub action with a custom
stable step.
- Consolidated Renovate dependency groups to avoid update conflicts.
- Upgraded in-toto-golang dependency to fix security vulnerabilities and
dropped unnecessary CVE waivers.
- Extensive lock file maintenance and multiple infrastructure and Python
dependency updates.

<!-- HIGHLIGHTS_END -->

:robot: I have created a release *beep* *boop*
---


##
[0.8.2](v0.8.1...v0.8.2)
(2026-05-10)


### Features

* close audit gaps in error logging and Prometheus instrumentation
([#1821](#1821))
([ef00fdc](ef00fdc))


### Bug Fixes

* **ci:** eliminate dev-release tag-vs-downstream race + CI hygiene
audit ([#1827](#1827))
([b7b9a59](b7b9a59))
* **config:** close 6 settings reachability + kill-switch gaps
([#1798](#1798))
([410cb3b](410cb3b))
* correctness / safety fixes from 2026-05-05 audit (Wave 28)
([#1823](#1823))
([d01e624](d01e624))


### Performance

* composite indexes + cursor pagination + clock seam + SSE rate-limit +
Ollama sanitization + retry-after web client + WS reconnect jitter
([#1822](#1822))
([d1faf86](d1faf86))


### Refactoring

* **api:** move activities lifecycle-cap fallback to ApiBridgeConfig
snapshot ([#1840](#1840))
([7a56e9c](7a56e9c))
* centralise workflow error mapping and shared error codes
([#1778](#1778) sub-tasks A
+ E) ([#1843](#1843))
([11132cd](11132cd))
* drive controller-error baseline to zero
([#1778](#1778) sub-task A
tail) ([#1846](#1846))
([e96ae20](e96ae20))
* slim CLAUDE.md, port pr-review-toolkit agents, sync .opencode parity
([#1833](#1833))
([e6372b8](e6372b8))
* tighten settings → startup-trace baseline (8 → 0)
([#1847](#1847))
([3376ee2](3376ee2))


### Documentation

* fix CLAUDE.md inaccuracies and drop drift-prone counts
([#1844](#1844))
([371925f](371925f))


### Tests

* replace test placeholders with real subsystem wiring
([#1845](#1845))
([ddbb666](ddbb666))


### CI/CD

* **cla:** replace flaky contributor-assistant action with custom
read-path step
([#1819](#1819))
([11aeafe](11aeafe))
* tidy dev-release notes + stagger renovate lockfile day
([#1824](#1824))
([ec746a9](ec746a9))


### Maintenance

* cleanup roundup, sub-tasks a/c/d/g/h/j/l/m of
[#1781](#1781)
([#1838](#1838))
([099b871](099b871))
* close remaining 5 sub-tasks of
[#1781](#1781) (b/e/f/i/k)
([#1852](#1852))
([59cf0b2](59cf0b2))
* collapse Renovate dep groups into Python / Web / Infrastructure to
remove cross-PR overlap
([#1813](#1813))
([4cbd857](4cbd857))
* **deps,security:** bump in-toto-golang v0.11.0 + drop two patched CVE
waivers ([#1851](#1851))
([0b8b5bb](0b8b5bb))
* disable Renovate vulnerabilityAlerts so security flows into normal
updates ([#1834](#1834))
([6b7d15f](6b7d15f))
* Lock file maintenance
([#1820](#1820))
([ccbad73](ccbad73))
* Lock file maintenance
([#1842](#1842))
([13b68a5](13b68a5))
* Lock file maintenance
([#1853](#1853))
([db6650b](db6650b))
* Update dhi.io/nats:2.14-debian13 Docker digest to eb768bf
([#1841](#1841))
([37f84fc](37f84fc))
* Update Infrastructure dependencies
([#1815](#1815))
([75b12fe](75b12fe))
* Update Infrastructure dependencies
([#1831](#1831))
([3f3c50b](3f3c50b))
* Update Python dependencies
([#1817](#1817))
([e11332f](e11332f))
* Update Python dependencies
([#1832](#1832))
([4515c8e](4515c8e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Aureliolo added a commit that referenced this pull request May 12, 2026
## Summary

The pr-review-toolkit removal (PR #1833) left the agent inventory in a
broken state. Two distinct problems, one fix:

1. **3 agents have `.claude/agents/*.md` files but the Claude Code
harness silently drops them**: `pr-test-analyzer`,
`silent-failure-hunter`, `comment-analyzer`. Reproduced live during a
`/pre-pr-review` run on `worktree-password-toggle`, documented in #1871.
2. **13 specialist agents exist only in `.opencode/agents/`**, with no
`.claude/agents/` counterpart, breaking the dual-tool parity invariant
and forcing `/pre-pr-review` and `/aurelio-review-pr` to fall back to
`code-reviewer` with inline prompts (losing the specialised system
prompts).

### What changed

- Replaced `model: inherit` with `model: sonnet` on the 3 broken agents.
**Caveat**: this is the workaround suggested in #1871; the root cause is
not fully understood. `type-design-analyzer` also declares `model:
inherit` and IS loaded by the harness, which contradicts the issue's
hypothesis. The fix matches the loaded-agent baseline (`code-reviewer`,
`python-reviewer`, `security-reviewer`, `persistence-reviewer`,
`go-reviewer` all declare an explicit model) and should make the agents
load; a separate diagnostic issue may be worth filing to understand why
`inherit` works for one file and not the others.
- Ported 13 specialist agents from `.opencode/agents/` to
`.claude/agents/`:
- `api-contract-drift`, `async-concurrency-reviewer`,
`comment-quality-rot`, `conventions-enforcer`, `docs-consistency`,
`frontend-reviewer`, `go-conventions-enforcer`, `go-security-reviewer`,
`infra-reviewer`, `issue-resolution-verifier`, `logging-audit`,
`resilience-audit`, `test-quality-reviewer`
- Frontmatter translated from OpenCode (`mode: subagent`, cloud-provider
model, `permission:` map) to Claude Code (`name:`, `model: sonnet`,
`color:`, `tools:` list). Bodies preserved verbatim.
- Updated `.claude/skills/pre-pr-review/SKILL.md` and
`.claude/skills/aurelio-review-pr/SKILL.md` dispatch tables to call each
specialist directly (e.g. `subagent_type: docs-consistency`) instead of
`code-reviewer` with a custom prompt.

### Test plan

The Claude Code agent registry is built at session start, so the
restored agents are NOT visible in the session that created this PR.
Verification requires a fresh session.

After review:

1. Restart Claude Code.
2. Confirm the 16 restored agents appear in the available
`subagent_type` list when a new agent invocation is attempted.
3. Spot-check a representative subset by dispatching trivially:
`pr-test-analyzer`, `frontend-reviewer`, `docs-consistency`,
`logging-audit`. Each must accept the call (not `Agent type 'X' not
found`).
4. Run `/pre-pr-review` on a small change and confirm Phase 3 dispatches
each specialist by name without falling back to
`code-reviewer`-with-custom-prompt.
5. If any of `pr-test-analyzer` / `silent-failure-hunter` /
`comment-analyzer` still fails to load after the `inherit -> sonnet`
change, fall back to the canary-morph diagnostic (copy the working
`type-design-analyzer.md`, progressively morph fields, find the actual
differentiator).

### Review coverage

Local agent review skipped: all 18 changed files are `.md` under
`.claude/` (no `src_py`, `test_py`, `web_src`, `cli_go`, etc.), so the
`/pre-pr-review` skill's auto-skip rule applied. Phase 2 automated
checks had no scope (no Python/web/Go files). The change is
meta-tooling-only.

Closes #1871
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.

chore: slim ported pr-review-toolkit agent descriptions to project style (~3k context savings)

1 participant