Skip to content

Agent compatibility audit + CLI ergonomics fixes (stack 1/5) - #42

Closed
martient wants to merge 7 commits into
developfrom
claude/ai-agents-capabilities-report-fgpp3p-v2
Closed

martient wants to merge 7 commits into
developfrom
claude/ai-agents-capabilities-report-fgpp3p-v2

Conversation

@martient

@martient martient commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

First of a stacked series resolving the findings in the September 2026 agent compatibility audit.

What this adds

docs/audits/agent-compatibility-2026-09.md — a full audit of every surface an AI coding agent touches: the agent instruction files, the shared Codex/Claude plugin and skills, the machine-readable CLI contract, the generated hooks/CI, and the src/ai integration.

What this fixes

Agents were failing against the CLI for three mechanical reasons, each reproduced and now covered by tests/agent_ergonomics_tests.rs (12 tests):

  • Flag placement. --non-interactive and -q/--quiet were root-only, so committy schema --non-interactive … — the form agents write by default — was rejected by clap. Both are now global.
  • Argument-parse errors broke the machine contract. A rejected invocation wrote nothing to stdout and prose to stderr, even with --output json. It now emits the standard envelope with "code": "invalid_usage". Text mode is unchanged; --help/--version still print plain text and exit 0.
  • COMMITTY_NONINTERACTIVE=1 makes flag placement irrelevant but appeared in no agent-facing doc. Now documented in AGENTS.md, CLAUDE.md and the agent-workflows reference.

Capability discovery went from 10 entries to 21, covering the whole surface the shipped skills already tell agents to use (tag, bump, changelog, group-commit, config, packages). Each now declares mutating and requires_confirmation, so an agent can reason about consent without pattern-matching command names — tag.publish is the only one gated on explicit confirmation.

--verbose was deliberately not made global: -v already means --validate on branch, and --verbose belongs to config validate|show. Promoting it panics the binary at startup on a short-flag collision. A test pins that trade-off.

Verification

cargo test 374 passed, cargo fmt --all -- --check clean, cargo clippy --all-targets --all-features -- -D warnings clean.

Two pre-existing test problems were found and are not addressed here:

  • tag_tests::test_tag_respects_repo_git_overrides_and_cli_can_override_them fails deterministically on a clean develop — a tag creation that should be rejected succeeds.
  • config::hierarchy::tests::test_repository_config_overrides_user passes alone and under --test-threads=1, fails under parallelism — shared global state.

Audit the repository's agent-facing surfaces (AGENTS.md/CLAUDE.md, the
shared Codex/Claude plugin and skills, the schema capability contract,
generated hooks/CI, and the src/ai LLM integration) against the current
state of the agent-integration ecosystem.

Records 15 prioritised findings covering defects, compatibility gaps and
removals, plus two explicit non-recommendations.
Agents consistently failed against the CLI for three mechanical reasons,
each now reproduced and covered by tests/agent_ergonomics_tests.rs.

- --non-interactive and -q/--quiet are global, so they parse on either
  side of the subcommand. --verbose stays root-only: -v belongs to
  `branch --validate` and --verbose to `config validate|show`, and
  promoting it would steal both shorts. A test pins that trade-off.
- Argument-parse rejections now emit the machine envelope on stdout with
  code "invalid_usage" when --output json was requested, instead of an
  empty stdout and prose on stderr. Text mode is unchanged, and --help
  and --version keep their plain-text form and exit 0.
- schema capabilities cover the whole agent command surface (tag, bump,
  changelog, group-commit, config, packages, schema) and each entry now
  declares `mutating` and `requires_confirmation`, so an agent can reason
  about consent without pattern-matching command names.
- COMMITTY_NONINTERACTIVE is documented in AGENTS.md, CLAUDE.md and the
  agent-workflows reference; it makes flag placement irrelevant.

Also withdraws the audit's blanket "do not build an MCP server": that was
argued against eager-loading MCP, which the 2026-07-28 stateless spec has
moved off.
Second half of the agent-ergonomics change: main.rs flag globals and the
clap rejection handler, the expanded schema capability list, the
ergonomics test suite, and the docs describing flag placement.
Adds tests/agent_ergonomics_tests.rs (12 tests) covering flag placement
on both sides of the subcommand, the invalid_usage envelope on argv
rejection, the expanded capability surface with consent metadata, and
the presence of COMMITTY_NONINTERACTIVE in agent-facing docs.

Documents flag placement in the agent-workflows reference and records
the diagnosis in the audit, withdrawing its blanket recommendation
against an MCP server.
Tooling re-adds Co-Authored-By and Claude-Session by default, so the
prohibition has to live where agents read it rather than being restated
each session.

Copy link
Copy Markdown
Owner Author

Superseded by #49.

The stack could not be merged: every PR here is authored by the repo owner, and develop requires an approving review from someone other than the last pusher. That made the required approval impossible to give on any of the six — not a code problem.

#49 carries the identical 14 signed commits on a single branch against develop, so it needs one approval rather than six. Closing this in its favour; nothing is lost.


Generated by Claude Code

@martient martient closed this Sep 20, 2026
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.

1 participant