docs: trim redundant instruction-surface wording across AGENTS.md and skills - #30
Merged
Conversation
added 2 commits
August 20, 2026 20:53
Applies the captain-approved edit set from two read-only audits (data/instruction-surface-audit, 2026-08-13; data/instruction-verbosity-audit, 2026-08-14). Every edit was applied as an exact-match replacement that fails on zero or multiple matches, then re-measured with gpt-tokenizer (cl100k). Cross-surface duplication (first audit): - AGENTS.md section 2's annotated layout tree collapses to a compact map plus three rules; docs/configuration.md and each producing script's header remain the owners of the schemas and field lists. The new state/ dot-file rule is broader than the three "never touch" globs it replaces. - AGENTS.md section 3's six-step session-start walkthrough collapses to the four facts that survive with no digest in front of the reader: the ordering, lock-gates-mutation, the idle-secondmate policy, and liveness-vs-state. - AGENTS.md section 13 keeps every trigger but states each one once, at the operating section that owns it. - AGENTS.md section 9's 11-row translation table becomes the rule it supported; the fail-closed/fail-open row is kept in plain-English form because that jargon reads as ordinary engineering English. - bin/fm-brief.sh: the project-memory block no longer asks the worker to hand-add the self-governance section that fm-ensure-agents-md.sh injects itself, and the no-mistakes block drops its scaffolding prose while keeping both firstmate-specific rules. Pure wording (second audit), applied only where an edit deletes words: - harness-adapters, afk, bootstrap-diagnostics, secondmate-provisioning, bearings, and fmx-respond drop summary sections that restate their own bodies, plus rationale clauses after complete rules. - afk's max-defer and submit-model duplicates are deleted together with the two facts that lived only in the deleted copy moved into the owning section. - fmx-respond's Notes section keeps its three unique bullets. - Six skills drop a body opening line that restated their own frontmatter trigger. - Skill frontmatter descriptions drop trailing behavioral-narrative and contents-list tails; every "Use when"/"Use before" trigger survives verbatim. Measured (cl100k): AGENTS.md 11,900 -> 8,600 (-27.7%); always-loaded per home, including injected skill frontmatter, 13,787 -> 10,157 (-3,630, -26.3%); the 18 loaded skills 44,474 -> 42,199 per load; the ship brief 1,689 -> 1,516 per spawn. No conditional, exception, precedence order, or prohibition changed; each deletion was checked against a surviving owner before it was applied. tests/fm-brief.test.sh follows the four generated-brief strings that changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Apply the captain-approved token-reduction edit set from two completed read-only scout audits (instruction-surface-audit 2026-08-13 and instruction-verbosity-audit 2026-08-14) to firstmate's own shared tracked material: AGENTS.md, bin/fm-brief.sh, and several .agents/skills/*/SKILL.md files. Scope: report 1's F1/F2/F3 (AGENTS.md layout tree, section 13 skill list, session-start walkthrough) shipped as recommended; F4 (captain-facing translation table) cut per captain decision, replaced with the report's ~85-token version, keeping the fail-closed/fail-open row's plain-English framing; F5a/F5b (fm-brief.sh project-memory and no-mistakes blocks) shipped as recommended; F6 (harness-adapters per-harness file split) explicitly NOT applied - separate follow-up; F8 and other explicit-KEEP items untouched. From report 2: the recommended 35-edit set across harness-adapters, afk, bootstrap-diagnostics, AGENTS.md (F9), the secondmate charter template, secondmate-provisioning, bearings, and the F7 opening-line pattern - restricted to edits that delete words only; 11 sentence-tightening rewrites measuring 0-2 tokens were excluded as pure churn. K2 and K3 landed together (delete+compensating-add pair); F1's X1 kept its three unique Notes bullets in fmx-respond. D1 (skill frontmatter description trims): captain decision to CUT, every 'Use when'/'Use before' trigger condition preserved verbatim, only trailing behavioral-narrative/contents-list tails trimmed. D2: captain decision to cut two emphasis-only sentences (AGENTS.md's 'This is mandatory respectful address, not performance' and 'The scaffold is a safety contract, not a suggestion.') and keep the third (fm-brief.sh's secondmate no-self-directed-work emphasis) untouched. Report 2's section 4 'Examined and deliberately not cut' items were not touched. This is a resume of a prior worker's already-completed, content-approved work (original commit 564d90f, authored 2026-08-14) that got orphaned before reaching a PR. My job this session: rebase that commit onto current main (26 PRs merged since authoring) as new commit f1210e6, resolve the one resulting conflict (AGENTS.md section 13's skill list - main had not independently changed it, so I took the trimmed replacement verbatim), and re-verify: heading/fence counts and section presence/order identical before/after; token counts freshly measured with gpt-tokenizer cl100k (AGENTS.md 11907->8600, -27.7%; combined changed-file total 71708->65966); tests/fm-brief.test.sh all passing; bin/fm-lint.sh and bin/fm-doc-audience-check.sh clean. Every conditional, exception, precedence order, and hard boundary in touched files was spot-checked to confirm identical trigger conditions and identical permitted/forbidden actions before and after - only wording shrank, no logic changed. A prior no-mistakes run against the pre-rebase commit failed at the review step and left stale preserved commits in pipeline custody; I recovered custody with --keep-local to keep this freshly-rebased, re-verified head as the one to validate.
What Changed
AGENTS.md(layout tree, section 13 skill list, session-start walkthrough, and F9 edits), replacing the captain-facing translation table with a shorter ~85-token version while preserving the fail-closed/fail-open row's plain-English framing, and cutting two emphasis-only sentences flagged for removal..agents/skills/afk,.agents/skills/bearings,.agents/skills/bootstrap-diagnostics,.agents/skills/diagnostic-reasoning,.agents/skills/firstmate-codexapp,.agents/skills/firstmate-coding-guidelines,.agents/skills/fmx-respond,.agents/skills/harness-adapters,.agents/skills/project-management,.agents/skills/secondmate-provisioning,.agents/skills/stuck-crewmate-recovery, and.agents/skills/updatefirstmate, trimming skill frontmatter descriptions to keep every "Use when"/"Use before" trigger condition verbatim while cutting trailing narrative/contents-list tails.bin/fm-brief.shand updatestests/fm-brief.test.shto match the reduced output.Risk Assessment
✅ Low: This is a pure documentation/instruction-surface trim (AGENTS.md, several SKILL.md files, bin/fm-brief.sh, and its tests) that removes duplicated or narrative-only prose while leaving every operative rule, trigger condition, precedence order, and safety boundary intact; spot-checking a large sample of the deleted text confirmed each removed passage is either a verbatim duplicate preserved elsewhere in the same file/AGENTS.md (e.g. the PR full-URL rule, the destructive/security-sensitive flagging rule, the never-inline-into-shell-command rule, the fmx-respond Notes bullets, the Max-defer-escape and type-once-submit mechanics in afk/SKILL.md, the grok popup mechanism in harness-adapters) or genuinely non-operative narrative/contents-list tail (matching the stated D1/D2/F7 captain decisions), and heading/fence counts, section order, and frontmatter 'Use when'/'Use before' trigger lines all verified unchanged.
Testing
Ran
tests/fm-brief.test.sh(the only executable/behavioral test surface touched by this change) — all 22 assertions pass, exit code 0, including the three tests updated to check the new trimmed no-mistakes-DOD, project-memory, and project-less-charter wording. As additional end-to-end evidence, manually invokedbin/fm-brief.shto scaffold a real brief.md and confirmed the trimmed sentences ("its own guidance is authoritative and version-matched...", "Record only knowledge useful to almost every future session...", "it owns the self-governance section, so never add one by hand") render correctly in the generated document, which is the actual artifact a secondmate agent reads. The remaining changed files (AGENTS.md, SKILL.md files) are non-executable documentation/prose with no test harness of their own; the user intent's heading/fence-count and token-count checks, plus fm-lint.sh/fm-doc-audience-check.sh, belong to other pipeline phases (review/lint) not this test phase, and are not re-verified here. Working tree left clean; only files touched during testing were transient temp directories under /tmp, which were removed.Evidence: tests/fm-brief.test.sh full run output (22/22 passing)
Evidence: Sample generated brief.md rendered end-to-end via bin/fm-brief.sh, showing the trimmed no-mistakes DOD and project-memory wording as an actual secondmate would receive it
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
./tests/fm-brief.test.sh— full suite, 22/22 ok, exit 0Manual:FM_HOME=<tmp> ./bin/fm-brief.sh test-secondmate some-proj --pr-repo owner/some-proj --pr-base mainthen inspected generated brief.md for the trimmed no-mistakes DOD and project-memory sentences✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.