Read project AGENTS.md before choosing a connector repo

Merged
RO
2mo ago
+75-5

What

Restore the legacy connector's project-document behavior in the basecamp-connect skill:

  • Read the project's AGENTS.md after acknowledgement, before choosing a repo, even when last.json already has a mapping.
  • List documents with --all so pagination cannot hide the instruction doc.
  • Give the document's applicable repo mapping precedence over remembered mappings and heuristics, and pass the document to the subagent.
  • Keep failed reads or ambiguous/unavailable mappings from silently falling back; retain operator confirmation before changing remembered mappings.
  • Keep the subagent's fallback document discovery exhaustive too.

Validation

  • bin/ci passed (including Go tests, lint, e2e, skill drift, eval-pattern validation, and tidy).
  • Added a model-eval fixture where AGENTS.md is beyond the first page and overrides a stale remembered repo.
  • Exercised the fixture grader with five traces: correct handoff passes; missing --all, missing document read, reading before acknowledgement, and the stale repo fail.
  • Model-backed eval not run: ANTHROPIC_API_KEY is unavailable. Fixture checks validate the assertions, not actual model behavior.

Compared against skills/basecamp-connect/SKILL.md in basecamp-local-agent-connector, which reads every document and honors project repo mappings at repo resolution.


Summary by cubic

Reads the project's AGENTS.md before choosing a connector repo in the basecamp-connect skill, restoring the legacy connector's document behavior.

  • The document's repo mapping now takes precedence over remembered mappings, request hints, and the project-name heuristic, even when last.json already has a mapping.
  • Uses an exhaustive project recording index (--all) so pagination cannot hide AGENTS.md in a nested folder, and passes the document's full content to the subagent.
  • Failed reads, ambiguous mappings, and unreachable repos ask the person instead of silently falling back; remembered mappings stay operator-confirmed.
  • Added a model-eval fixture where AGENTS.md sits beyond the first page and overrides a stale remembered repo, with assertions scoped to the repo-selection commands.