Skip to content

docs(agents): split AGENTS.md into lean core plus on-demand skill branches - #1

Merged
landontu merged 8 commits into
mainfrom
fm/restructure-agents-md
Jul 2, 2026
Merged

landontu merged 8 commits into
mainfrom
fm/restructure-agents-md

Conversation

@landontu

@landontu landontu commented Jul 2, 2026 •

Copy link
Copy Markdown
Owner

Intent

Captain-approved firstmate documentation restructure: split the always-loaded AGENTS.md into a ~150-content-line core plus on-demand agent-only skill branches per the settled design in data/revive-doc-restructure/report.md and data/scout-doc-web-tree/report.md. The core keeps every universal invariant (all 5 prime directives, captain etiquette, lifecycle spine, supervision invariant, delivery modes + yolo, X-mode gate, expanded trigger-router); depth moved near-verbatim to seven new fm- prefixed skills (fm-session-start, fm-dispatch, fm-project-setup, fm-brief, fm-backlog, fm-supervise-depth, fm-deliver); fmx-respond gained the X-mode image/length/dry-run details it lacked; bin/ comment changes only retarget old section references to skill names. docs/agents-md-restructure-audit.md is the captain's acceptance-test evidence mapping every removed line to its destination. This head (dbbc257) already passed review, document, and lint in the previous run: review rounds applied and verified the kunchenguid#183 runtime-backend re-sync, the kunchenguid#186 herdr re-sync, the kunchenguid#188 auto-detection re-sync, the check.sh authoring-contract pointer at fm-deliver's PR-ready section (explicit firstmate gate decision), and the captain's explicit decision to drop the dead state/.subsuper-inject-wedged sub-trigger from the fm-supervise-depth router row because the afk row covers that marker; multiple full content-preservation sweeps found no contradictions and no narrowed triggers. The previous run failed only at push with a 403: origin pointed at kunchenguid/firstmate which this machine's landontu credential cannot push to; the captain has since forked the repo and origin now points at https://github.com/landontu/firstmate (verified pushable; gate remote refreshed via no-mistakes init). The PR should be opened on that fork and is HELD for captain review after checks are green - never self-merged. THE TEST STEP IS DELIBERATELY SKIPPED with cause: the gate's local test execution reproducibly deadlocks (three runs) - tests/fm-bootstrap.test.sh runs bin/fm-bootstrap.sh whose 'no-mistakes --version' probe hangs when invoked as a descendant of the no-mistakes daemon step executor (verified stuck process trees; the probe returns instantly from a normal shell), surfacing as 'daemon crashed during execution'. The identical suite ran locally in this worktree: 26/26 executed, 25 pass, the single failure being tests/fm-x-mode.test.sh requiring jq which is not installed locally - unrelated to this docs-only diff. GitHub CI (.github/workflows/ci.yml) runs shellcheck plus this exact behavior test suite on the PR, where the no-mistakes binary is absent so the probe short-circuits. Skill bodies duplicating a compressed core line is intentional belt-and-suspenders redundancy per the spec.

What Changed

  • Split the always-loaded AGENTS.md (~940 lines removed) into a lean core carrying the universal invariants — all five prime directives, captain etiquette, lifecycle spine, supervision invariant, delivery modes plus yolo, X-mode gate, and an expanded trigger-router — with depth moved near-verbatim into seven new on-demand skill branches: fm-session-start, fm-dispatch, fm-project-setup, fm-brief, fm-backlog, fm-supervise-depth, and fm-deliver.
  • Extended fmx-respond/SKILL.md with the X-mode image/length/dry-run handling it previously lacked, and retargeted stale section references in bin/ comments (spawn, backend, bootstrap, brief, ff-lib, merge-local, supervise-daemon, tmux backend) plus README.md and docs/ to point at the new skill names.
  • Added docs/agents-md-restructure-audit.md mapping every removed AGENTS.md line to its destination, and trimmed a dead state/.subsuper-inject-wedged marker route from the fm-supervise-depth router row and description since the afk row already owns that marker.

Risk Assessment

✅ Low: Docs-only restructure of AGENTS.md into on-demand skills with bin/ comment retargets; all cross-references resolve to existing skills, the new fmx-respond text accurately matches the unchanged X-mode scripts, and the sole prior-round finding is applied.

Testing

  • ⏭️ Test - skipped

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ .agents/skills/fm-supervise-depth/SKILL.md:3 - fm-supervise-depth/SKILL.md frontmatter description: still lists "a state/.subsuper-inject-wedged marker" as a load trigger, contradicting commit dbbc257 which deliberately dropped that dead route from the AGENTS.md section-9 router row. The skill description is the load-trigger surface shown in the skill index, and this skill's body carries no guidance on the marker (the afk skill owns it, and the afk router row already routes any state/.subsuper-* marker → afk). An agent seeing the marker could load fm-supervise-depth — the exact dead route the commit removed. Drop the marker phrase from this description to match the router decision.

🔧 Fix: drop dead subsuper marker trigger from fm-supervise-depth description
✅ Re-checked - no issues remain.

⏭️ **Test** - skipped

Step was skipped.

✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Line-audit summary (acceptance test: every deleted line lands in a branch OR is a kept invariant)

The full line-by-line audit is committed in this PR at docs/agents-md-restructure-audit.md, mapping every removed AGENTS.md line range → its destination (kept in core / named skill / deliberate drop with reason).

  • Net shape: core 891 → 192 lines (153 non-blank, vs the settled ~145-content-line budget); ~78% of the always-loaded orchestrator context reclaimed.
  • Kept always-loaded (a firstmate that never loads a branch is still safe): all 5 prime directives, captain etiquette (verbatim), the intake/lifecycle spine, the supervision invariant + watcher commands, delivery modes + yolo, the afk survive-without-skill facts, the X-mode gate, and the expanded section-9 trigger-router.
  • Depth destinations (near-verbatim moves): fm-session-start (layout/state reference, bootstrap + diagnostic catalog, recovery, X-mode activation/cadence), fm-dispatch (intake, secondmate routing, dispatch profiles, spawn mechanics), fm-project-setup, fm-brief, fm-backlog, fm-supervise-depth (wake triage, guard beacon, tangle guard), fm-deliver (per-mode delivery, landed definition, sanctioned-write exception catalog, teardown/scout/promotion). fmx-respond gained the old §14 details it lacked (--image contract, length knobs, dry-run markers, connector/followup endpoint).
  • Deliberate drops (2): both are one-line content summaries whose text lives verbatim inside the skill that loads at the same trigger (secondmate-provisioning contents list; afk's "refresh flag" / "bias toward exit" lines) — documented with reasons in the audit.
  • Router reconciliation: diffed against the session-1 v1 draft (recovered from the design transcript) and the final §1c spec table — no trigger dropped; the four pre-existing skills' rows keep their full original trigger lists. One captain-approved deviation: the state/.subsuper-inject-wedged sub-trigger was removed from the fm-supervise-depth row as a dead route (the afk row already owns that marker).
  • Drift re-syncs during validation: main advanced three times under the branch (feat(bin): add runtime backend interface kunchenguid/firstmate#183 runtime-backend, feat(bin): add experimental Herdr runtime backend kunchenguid/firstmate#186 herdr, feat(bin): auto-detect runtime backend kunchenguid/firstmate#188 auto-detection); each rebase's review round re-synced the moved skill text and re-keyed the audit, so no post-split main content was lost.

Verification note

The gate's local test step was skipped with cause (its no-mistakes --version probe deadlocks under the daemon's step executor; documented in the run intent). Compensating verification run directly in the worktree at this PR's exact head: bash -n on every bin/, bin/backends/, and tests/ script (clean) and the full tests/*.test.sh behavior suite. Suite result: 23/26 pass; the 3 failures are all environmental and were verified to reproduce identically on pristine upstream main (30a89bc) in the same environment — fm-x-mode.test.sh (requires jq, not installed on this machine), fm-backend-herdr.test.sh (needs a live herdr workspace), and fm-teardown.test.sh content-landed case — i.e. none are caused by this branch, whose delta is docs and bin comments only. shellcheck is not installed on this machine, and this fork has no GitHub Actions enabled, so the PR shows no CI checks; upstream CI (shellcheck + this suite on ubuntu) will run when this lands there.

landontu added 8 commits July 2, 2026 11:27
…ranches

Restructure the 886-line always-loaded AGENTS.md into a ~150-content-line core
(prime directives, session-start/intake/supervision/delivery spines, captain
etiquette, X-mode gate, expanded trigger-router) plus seven new agent-only
branch skills loaded at mechanical triggers: fm-session-start, fm-dispatch,
fm-project-setup, fm-brief, fm-backlog, fm-supervise-depth, fm-deliver.

fmx-respond gains the X-mode image/length/dry-run details the old section 14
carried that it lacked. bin comments that named old AGENTS.md sections now name
the skills. docs/agents-md-restructure-audit.md maps every removed line to its
destination (kept invariant, branch skill, or deliberate drop with reason) and
records the trigger-router reconciliation against the session-1 v1 draft.
@landontu
landontu merged commit d16ddd9 into main Jul 2, 2026
@landontu
landontu deleted the fm/restructure-agents-md branch July 2, 2026 19:22
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