Repository navigation
refactor(skills): move trigger-time procedure out of AGENTS.md into on-demand skills - #76
Merged
Merged
Conversation
added 3 commits
November 7, 2026 15:46
…kills AGENTS.md drops from 54193 bytes / 451 lines to 27713 bytes / 260 lines. Hard rules, merge authority, captain-instruction precedence, isolation, read-before-asserting and the captain-chat translation duty stay inline; intake, steering, wake handling, the term rewrite table, knowledge routing and backlog upkeep move into six new agent-only skills with load triggers.
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
riesci a spostare AGENTS.md in alcune skill per renderlo più leggero. quando inizi ad applicare i 12 principi degli agenti AI?
Context: earlier on 2026-11-07 firstmate analysed its own workflow against humanlayer/12-factor-agents. The top-ranked weakness was factor 3 (own your context window): every session loads about 70 KB before any work, AGENTS.md alone is 54 KB (353 lines), and the resulting frequent compactions caused lost details and repeated mistakes. Proposal #1, recommended, was "AGENTS.md split into a short core plus skills loaded only when needed". This ask starts that proposal.
What Changed
AGENTS.mdis loaded into every Firstmate session, so procedure that only matters at a specific moment now lives in agent-only skills loaded at that moment, leaving a one-line trigger inAGENTS.md.Size of
AGENTS.md: 54193 bytes / 451 lines before, 27713 bytes / 260 lines after (-48.9%).Section numbers and headings are unchanged, so existing
AGENTS.md section Nreferences and anchors still resolve.Moved blocks and their new owner
AGENTS.mdyolo, branch prefix, base branch, self-repo consent, prod-only surface classification, concurrencytask-intakefm-dispatch-resolve.shhandlingtask-intaketask-intakefm-send,--resolve-key, remote resend,fm-control, secondmate replies, captain mid-task changesworker-steeringwake-handlingcaptain-reportingCANDIDATErouting, correction mechanicsknowledge-routingbacklog-managementship-landingquota-array-dispatch(duplicate deleted, ownership line updated)The six new skills are listed in
agent-skill-trigger-indexand registered asagent-runtimeindocs/documentation-audiences.json.Comments and docs that pointed at moved text now point at the owning skill; no script logic changed.
No rule weakened
These stay inline in
AGENTS.md, word for word or with identical force:yolosemantics, never merging red or with a required check that has not reported, mandatoryfm-pr-merge.sh/fm-merge-local.sh);pkillwatchers;Every sentence removed from
AGENTS.mdwas checked against the new file and the skills: it now lives verbatim in its new owner, was merged into a rule that is still inline, or was a pointer to a script header that already owns it.Lint note
The pipeline lint step crashed inside
bin/fm-lint.shitself on this machine (LC_NUMERIC=it_ITmakesEPOCHREALTIMEuse a comma, givingvalue too great for base), not on this diff.The same lint on this head with
LC_NUMERIC=Cexits 0; the locale bug is filed as a separate follow-up.Risk Assessment
✅ Low: The fix round only changes comments and docs, pointing stale AGENTS.md section references at the skills that now own that content (knowledge-routing, task-intake, wake-handling, quota-array-dispatch). The remaining AGENTS.md section references point to rules AGENTS.md still owns.
Testing
I ran the targeted tests for documentation and owner pointers, instruction rendering, harness references, AGENTS.md handling, startup-network and captain-hold-lifecycle; all passed, including the full 13-minute captain-hold-lifecycle suite. A verification report shows AGENTS.md is 48.9% smaller (54 KB to 27.7 KB). It also shows that every receiving skill has valid frontmatter, every skill AGENTS.md says to load resolves, the trigger index lists the new triggers, and no
AGENTS.md section Nreference points to a missing section. I read each line from the review round-1 findings and all now point at the skill that owns the content. This is a documentation and instruction change with no UI, so there are no screenshots; the evidence is the text report. I created no temporary files in the worktree.Evidence: AGENTS.md split verification report (size, skill frontmatter, trigger index, section references)
Source: AGENTS.md split verification report (size, skill frontmatter, trigger index, section references)
AGENTS.md before: 54193 bytes, 451 lines; after: 27713 bytes, 260 lines (-48.9%). task-intake/worker-steering/wake-handling/captain-reporting/knowledge-routing/backlog-management: frontmatter OK, listed in trigger index and named in AGENTS.md. Unresolved load targets: none. References to missing AGENTS.md sections: none.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed ✅
docs/configuration.md:752- This line still says "AGENTS.md section 6 owns what a declaration changes about knowledge routing". That content (memory-tier routing, capture-on-behalf, correction rules) moved to.agents/skills/knowledge-routing/SKILL.md, and the commit updated other references in this same file but missed this one. A reader who follows the pointer lands on a section 6 that now only says to loadknowledge-routing. Point it at theknowledge-routingskill. The same leftover appears at.agents/skills/stow/SKILL.md:223, whose heading still reads "Route each finding using AGENTS.md's knowledge-routing table" even though the next line now names the skill.bin/fm-project-capacity-lib.sh:13- Several comments still credit AGENTS.md sections with procedures that moved into skills:bin/fm-project-capacity-lib.sh:13says uncapped dispatch is in "(AGENTS.md section 7)" (concurrency is now intask-intake);bin/fm-promote.sh:26says delivery resolution at promotion is in "(AGENTS.md section 7)" (nowtask-intake);docs/architecture.md:319says "The intake and authority contract inAGENTS.mdowns when separate scout research is warranted" (nowtask-intake); andbin/fm-bootstrap.sh:70says the dispatch-profile array "procedure in AGENTS.md section 4" (section 4 now holds only the trigger). Retarget each to the owning skill so the single-owner pointers stay accurate.bin/fm-startup-network.sh:36- The change updated the comment intests/fm-startup-network.test.sh:314to say a clean success is not captain-facing progress per "AGENTS.md section 9". The production header comment for the same rule inbin/fm-startup-network.sh:36still cites "(AGENTS.md section 8)". The wording it referred to ("no-change updates are not captain-facing progress") now lives in thewake-handlingskill. Make the two references agree.🔧 Fix: Retarget stale AGENTS.md section references to owning skills
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-documentation-audiences.test.sh(pointers to the owning file can't silently disappear, local links resolve)bash tests/fm-harness-adapter-references.test.shbash tests/fm-supervision-instructions.test.shbash tests/fm-ask-user-authority.test.shbash tests/fm-ensure-agents-md.test.shbash tests/fm-startup-network.test.shbash tests/fm-captain-hold-lifecycle.test.sh(full run: exit 0, 61 checks passed, none failed)Wrote a verification script (output in the evidence dir) that compares AGENTS.md size at 130c652 and 9542821, checks each receiving skill's frontmatter (name/description), checks that every skill AGENTS.md says to load resolves, checks that the trigger index lists the new triggers, and checks that everyAGENTS.md section Nreference in the repo points to a section that existsRead the lines from the round-1 review findings by hand (docs/configuration.md:752, stow/SKILL.md:224, fm-project-capacity-lib.sh:13, fm-promote.sh:26, architecture.md:319, fm-bootstrap.sh:70, fm-startup-network.sh:36, tests/fm-startup-network.test.sh:314); each now points at the skill that owns the contentbin/fm-subagent-pretool-check.sh:193- The guard's runtime ROUTE message (asserted in tests/fm-subagent-pretool-check.test.sh:20-21 and described in docs/subagent-guard.md:173) still tells the agent to classify work 'under the AGENTS.md intake contract'. Classification now lives in the task-intake skill; AGENTS.md section 7 still points there, so the message is indirect rather than wrong. Retargeting it changes executable output and tests, which is outside the document phase; consider a follow-up to name the task-intake skill directly.✅ **Push** - passed
✅ No issues found.