Skip to content

feat: support Amp code review checks (.agents/checks/*.md)#2295

Merged
dyoshikawa merged 3 commits into
mainfrom
resolve-scrap-issue-2206-amp-checks
Jul 17, 2026
Merged

feat: support Amp code review checks (.agents/checks/*.md)#2295
dyoshikawa merged 3 commits into
mainfrom
resolve-scrap-issue-2206-amp-checks

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

Adds a new first-class checks feature axis that generates and imports Amp's code review checks — Markdown files with YAML frontmatter that Amp runs as one subagent per check during code_review (announcement, manual "Checks" section).

This implements the design proposal recorded on the issue: a new feature target (not a sub-surface of rules/subagents/skills), driven by a new .rulesync/checks/*.md source, with both project and global scope (the issue's original "project scope only" premise was corrected in the comments — Amp also reads ~/.config/amp/checks/).

Design

  • Canonical source .rulesync/checks/<name>.md: frontmatter targets (standard targeting), description (optional), severity (optional strict enum low | medium | high | critical, kept generically named so future tools can map their own severity naming), tools (optional string array). Schema is z.looseObject, so unknown keys round-trip.
  • Amp emission: project .agents/checks/<name>.md, global ~/.config/amp/checks/<name>.md. The Amp-required name field is derived from the source file basename; severity maps to Amp's severity-default.
  • Import: lifts .agents/checks/*.md (and the global dir) back into .rulesync/checks/, mapping severity-defaultseverity and dropping name (re-derived on generate, so a divergent value cannot survive a round-trip anyway).
  • Out of scope (documented): subtree-scoped checks (api/.agents/checks/) — rulesync sources carry no directory-placement semantics (same reasoning as Hermes nested context files in Follow up Hermes Agent upstream updates: nested subdirectory context files (progressive discovery) #2214). Toolboxes (deprecated upstream) and the .amp/plugins/*.ts plugin API (Follow up Amp upstream updates: Plugin API (hooks via .amp/plugins/*.ts) #1938) are untouched.
  • No simulated mode.

Changes

  • New src/features/checks/: RulesyncCheck, ToolCheck, AmpCheck, ChecksProcessor (+ co-located tests), modeled on the subagents/skills feature classes.
  • Wiring: ALL_FEATURES, checksProcessorToolTargetTuple = ["amp"], PROCESSOR_REGISTRY, generate/import/convert cores, NON_SHARED_WRITE_FEATURES, fetch FEATURE_PATHS, MCP server tools (src/mcp/checks.ts), gitignore derivation (**/.agents/checks/ added by pnpm dev gitignore).
  • Counts: checksCount added to the shared CountableResult and every generate/import/convert result surface so check files are included in totals.
  • Docs: new .rulesync/checks/*.md section in docs/reference/file-formats.md (frontmatter mapping table + v1 subtree limitation); hand-enumerated feature lists in docs/reference/cli-commands.md; README / docs/reference/supported-tools.md matrices regenerated via pnpm run generate:tables; skills/rulesync/ synced.
  • E2E: src/e2e/e2e-checks.spec.ts — project generate, import round-trip, global generate, and assertGenerateMatrixCoversTargets coverage for both scopes.

Verification

  • pnpm cicheck — pass (typecheck, lint, 7161 unit tests, content checks).
  • npx vitest run --config vitest.e2e.config.ts src/e2e/e2e-checks.spec.ts — 5/5 pass.

Closes #2206

🤖 Generated with Claude Code

cm-dyoshikawa and others added 3 commits July 16, 2026 19:51
Add a new first-class 'checks' feature axis. Checks are per-check code
review instructions that Amp runs as one subagent per check during
code_review.

- Canonical source: .rulesync/checks/<name>.md with frontmatter
  targets / description / severity (low|medium|high|critical) / tools;
  unknown keys are preserved for round-trip.
- Amp output: .agents/checks/<name>.md (project) and
  ~/.config/amp/checks/<name>.md (global). The Amp-required 'name'
  field is derived from the source file basename, and 'severity' maps
  to Amp's 'severity-default'.
- Import lifts Amp checks back into .rulesync/checks/, mapping
  severity-default to severity and dropping the re-derivable name.
- Wire the new feature through the registry, generate/import/convert,
  MCP server tools, gitignore derivation, fetch paths, and the
  generated README / supported-tools matrix.
- Subtree-scoped checks (api/.agents/checks/) are documented as out of
  scope for v1.

Closes #2206

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Merge the tool-scoped 'amp:' frontmatter section with precedence over
  canonical values (per feature-change-guidelines), exclude all
  tool-target sections from the passthrough so they no longer leak into
  generated check files, and keep 'name' pinned to the file basename.
- Reuse AMP_GLOBAL_DIR for AMP_CHECKS_GLOBAL_DIR.
- Add checksCount to the result-shape assertions in the MCP tests and
  add checks feature suites to lib/import and lib/convert tests.
- Update the DIR_FEATURES comment to mention checks.
- Document the tool-scoped section behavior for checks.

The reviewer's note about 'does not support the feature checks' warning
noise for wildcard features is intentionally unchanged: it is the
established warnUnsupportedTargets pattern shared by every feature core,
and changing warning policy is a cross-feature UX decision out of scope
here.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Imported Amp check keys that collide with a rulesync tool-target name
are treated as tool-scoped sections and are not re-emitted, so the
round-trip claim needed the exception spelled out.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dyoshikawa
dyoshikawa merged commit ec83710 into main Jul 17, 2026
9 checks passed
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

@dyoshikawa
dyoshikawa deleted the resolve-scrap-issue-2206-amp-checks branch July 17, 2026 03:27
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.

Follow up Amp upstream updates: code review checks (.agents/checks/*.md)

2 participants