Repository navigation
docs: move situational AGENTS.md contracts into skills - #173
Merged
Merged
Conversation
Port upstream kunchenguid#5872's intent onto the fork's own AGENTS.md text: the home layout, session-start digest steps, validation supervision, PR landing and teardown, scout completion, away-mode safety facts, and the agent-only trigger list move verbatim into agent-only skills loaded at their triggers. X-mode and ext-bridge mechanics move into fmx-respond and ext-respond. Hard rules, merge authority, lock-refused read-only mode, install consent, and the away/X/ext authority boundaries stay inline, and every operating section keeps an inline pointer for each skill it depends on.
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.
Ports upstream kunchenguid#5872 (merged as
49a218bb) onto this fork. Situational contracts leave the always-loadedAGENTS.mdand go into agent-only skills that load at their triggers. The fork diverged a lot from upstream, so this is a port and not a cherry-pick: every moved block is the fork's own wording moved verbatim, fork-only rules included. Upstream's text was used only as a map.AGENTS.mdgoes from 624 lines / 79,878 bytes / 26,626 estimated tokens to 433 lines / 46,783 bytes / 15,595 estimated tokens, a 41.4% cut. The estimate isceil(UTF-8 bytes / 3)fromfm_startup_memory_measure_fileinbin/fm-startup-memory-budget-lib.sh, the fork's own estimator.What moved where
New agent-only skills. Each one has
user-invocable: falseandmetadata.internal: true, and each is registered asagent-runtimeindocs/documentation-audiences.json.AGENTS.mdtextAGENTS.mdpointer)operational-home-layoutstate/file (§2 pointer)secondmate-provisioningowns startup sync" linesession-start-recovery### Validatebody (receipt-check lifecycle, run ownership, supersession, ask-user return, ordinary-finding custody return, state judgment)validation-supervisiondone:, any ship with a no-mistakes run starting or active, a mid-run requirement change or finding, and before deciding or answering any ask-user finding (§7 pointer plus the merge-authority line)### PR ready, landing, and teardownbody (including thefm-pr-checkarm, custom-check rules, teardown, and secondmate retirement)ship-landingstate/<id>.check.sh, and before any teardown or secondmate retirement (§7 pointer)### Scout outcome and promotionbodyscout-completionaway-quiet-supervision(upstream's name kept; the fork has no quiet mode, and the skill says so)/afkon the same triggers (§8 pointer)ext-respond, the Cloud Devin/handoffclause, and thedecision-hold-lifecycleredirect), plus entries for the new skillsagent-skill-trigger-indexMoves into existing skills:
## X mode activation and ownership contractsection infmx-respond(this is the counterpart of upstream's Relay move)docs/configuration.mdowns activation..."ext-respond, next to its existing enablement lineFMX_PAIRING_TOKEN, or pending-reply"ext-respondline 22 already owns itupdatefirstmatestep 5 already owns both the stopped-fleet proof and the detect-only--checkgh-axi/chrome-devtools-axi/lavish-axilinefirstmate-coding-guidelinesgets upstream's new rule to runbin/-sourcing tests underbashexplicitly. Its placement and trigger-hygiene rules are updated for the new structure.Cross-references fixed:
captain-hold-lifecycle(it pointed at §7 Validate),fmx-respond(it pointed at §13),harness-adapters(session-start owner, plus the Cloud Devin/handofftrigger added to its description), thefirstmate-codexappdescription (smoke-evidence trigger), anddocs/sessionstart-nudge.md. Nobin/script changed. The fork's startup-memory budget measures onlydata/files, so the move needed no budget wiring.Where I deviated from upstream, and why
AGENTS.mdpointer, and I did not rely on skill descriptions being always loaded. In the headless Claude smoke below, Claude listed the skills by name but showed no descriptions. So upstream's "skill descriptions are the always-loaded trigger index" does not hold on every harness here. Some skills were named only in the old §13 list, so each now gets a one-line pointer in the section where its trigger fires:firstmate-orcaandfirstmate-codexappin §4;process-event-sourcesin §8, together with the "never run a registered source's blocking command yourself" rule;captain-hold-lifecycle, forRECORD DIVERGENCE, in §8;firstmate-coding-guidelinesin §1.docs/configuration.mdandbootstrap-diagnosticsalready describe them as inline.no-mistakes axi respondfor a crew-owned run" stays in §7 as one deliberate reinforcement, next to thevalidation-supervisionpointer.NETWORK CHECKS;## Captain's intentrule;Section-by-section assessment (including fork-only sections)
operational-home-layoutFM_TASK_IDworker refusal, read-once, ABSENT, lock-refused read-only, todo re-projection (fork-only), install consent, bootstrap-diagnostics triggersession-start-recoveryquota-array-dispatchalready owns the procedure; a later pass could shrink itvalidation-supervision,ship-landing,scout-completionaway-quiet-supervision.tasks.toml,tasks-axi, andfm-todo-project.shupdatefirstmate)agent-skill-trigger-indexfmx-respond; opt-in, authority, and trigger keptext-respond; opt-in, authority, and trigger kept/handofftrigger inharness-adaptersand the indexHard-rule and boundary locations (AC2)
--force, crewmates never address the captain, report faithfully)yolo, never merge red, destructive/irreversible/security escalation,fm-pr-merge.sh/fm-merge-local.shguards, autonomous-merge report)yolois the only standing routine merge authority"ship-landing; the same authority is still stated inline by hard rule 2 and §7--yes; process every synchronous returnvalidation-supervision, loaded before deciding or answering any ask-user findingaxi respondfor a crew runvalidation-supervisionship-landingscout-completionFM_TASK_ID)fmx-respond(loaded before promising one and on every follow-up trigger)operational-home-layout, loaded before touching anystate/fileupdatefirstmatestep 5ship-landing, loaded before writing or retiring a custom checkTest plan
Every command was run with
bashexplicitly, in the task worktree:bash tests/fm-startup-memory-budget.test.sh: all passedbash tests/fm-supervision-instructions.test.sh: all passedbash tests/fm-ensure-agents-md.test.sh: all passedbash tests/fm-documentation-audiences.test.sh: all passedbash bin/fm-doc-audience-check.sh:ok surfaces=87 local_links=321env -u FM_TASK_ID bash tests/fm-session-start.test.sh: all passedfm-ensure-agents-md.sh .: unchanged/tmp/port5872/smoke-home, a copy of the tracked files:fm-session-start.shrendered every section: lock, bootstrap, wake queue, supervision instructions, fleet state, context, next step. It correctly stayed read-only because no harness owned the lock.fm-supervision-instructions.shrendered.fm-startup-memory-budget.sh reportreturnedwithin-budgetat 7500.claude -pwith hooks disabled and read-only tools listedvalidation-supervisionandship-landingas available skills. It quoted the exact new §7 pointer lines when asked which skill to load for a checks-green PR and for an implementation-completedone:.The no-mistakes Test step came back inconclusive because only the session-start smoke counted as live. It was approved as a recorded exception, because AC3, AC4, and AC5 name their own proofs and the receipts carry them. The pipeline also could not drive a live Claude session.
Pipeline testing record
The prior payload recorded four affected test shards, an AGENTS.md word-count comparison, and an isolated live session-start smoke. Only the session-start smoke had live=true with evidence; the other scenarios are downgraded to untested as required.
Evidence: Live session-start digest smoke
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-startup-memory-budget.test.shbash tests/fm-supervision-instructions.test.shbash tests/fm-ensure-agents-md.test.shbash tests/fm-documentation-audiences.test.shFM_HOME=.tmp-session-smoke FM_ROOT_OVERRIDE=$PWD FM_BOOTSTRAP_DETECT_ONLY=1 bin/fm-session-start.shAGENTS.md before/after word-count comparison✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.