Repository navigation
Extract crew contract into globally-loaded fm-crewmate skill - #178
rob-struction wants to merge 1 commit into
Conversation
The standing crewmate contract (worktree isolation, status protocol, escalation, tools, per-mode definition of done, project memory, scout rules, PR-review variant) was re-emitted into every brief by two large fm-brief.sh heredocs plus a per-mode case block. Move it once into a firstmate-owned skill at .agents/skills/fm-crewmate/SKILL.md. - fm-bootstrap.sh idempotently symlinks the skill into ~/.claude/skills so every crew in every repo auto-loads it (best-effort, non-fatal; never clobbers a real dir/file there). - fm-brief.sh now emits slim briefs: identity line + pointer to the fm-crewmate skill + the run's variables (task, repo, mode, branch, status-file path, report path, FM_ROOT). The mode-fragment case block is gone; only mode resolution remains. - AGENTS.md section 11 updated to the new brief shape. Briefs shrink from ~35-70 lines of contract to ~10 lines of variables; the contract lives once, versioned, and travels via git + /updatefirstmate.
…dc parser without a global install (#14) * fix(bin): catch reserved-mermaid-keyword node ids and run the real mmdc parser without a global install Layer 1 now flags a reserved mermaid keyword (graph, end, subgraph, class, style, click, linkStyle, direction, flowchart, classDef) used as a node id adjacent to a shape opener or edge, catching the PR kunchenguid#178 class of bug install-free. Layer 2 now falls back to `npx --yes @mermaid-js/mermaid-cli` when mmdc is not on PATH, so the authoritative parser actually runs instead of silently skipping. * no-mistakes(review): make mermaid keyword linter quote-aware and tests hermetic * no-mistakes(document): document mermaid reserved-keyword lint and npx real-parser fallback
Cierre firmado de la ventana WF-T1 — separación de roles PostgreSQLGO firmado por el capitán el 2026-09-02 con la privada
Los nueve gates
Resultado operativoEl cutover está en producción: API y worker corren como
ObservaciónUn ciclo, 14 h desde el cutover, muy por debajo del techo de 26 h. Una corrida de escaneo Todos los conteos de #189 en cero: permisos denegados, Lo que consta en rojo y no se maquilló
Ese criterio se corrigió durante esta ventana. La versión inicial comparaba conteos brutos de una Quiescencia de cierreCuatro diferencias frente a Q0, las cuatro atribuidas y ninguna inexplicada: bitácora +6 por los Correcciones abiertas, ninguna bloqueante#243, #244 y #245 quedaron aplazadas deliberadamente hasta esta firma para no mover Lo que este cierre NO autorizaNo autoriza P1–P5: ni el retiro de |



Phase 1 of the context-slimming plan: extract the crew contract into a reusable, globally-loaded
fm-crewmateskillFollows
data/scout-skill-extraction-ba/report.mdPart 1, with the captain's decision on skill home (firstmate-owned + global via symlink).The problem
bin/fm-brief.shre-emitted the entire crewmate contract into every brief via two large heredocs plus a per-modecaseblock. The invariant contract (worktree isolation, status protocol, escalation, push/merge rules, per-mode definition of done, project memory, scout rules) was duplicated on every dispatch and re-transmitted to the crewmate in full each time.The change
1. New skill
.agents/skills/fm-crewmate/SKILL.md(firstmate-owned, canonical).Holds the whole standing contract for all delivery shapes: worktree-isolation assertion, status-reporting protocol, escalation, tools (
gh-axi/chrome-devtools-axi), verification/no-hallucination, ship Setup (branch creation + no-mistakes init note), the per-mode Definition of Done (no-mistakes,direct-PR,local-only), the scout-task contract, the project-memory step, and the PR-review variant. Placeholders (<id>,<STATUS_FILE>,<DATA>,<FM_ROOT>) are supplied by the brief. Frontmatteruser-invocable: false. Lives in the repo so it travels with firstmate through git +/updatefirstmate(.claude/skillsalready symlinks to.agents/skills).2. Global auto-load via bootstrap symlink.
bin/fm-bootstrap.shgains an idempotent, best-effortensure_global_crew_skillthat symlinks~/.claude/skills/fm-crewmate -> <FM_ROOT>/.agents/skills/fm-crewmate, so every crew in every repo (not just firstmate) auto-loads it. Creates~/.claude/skillsif missing; never clobbers a real (non-symlink) dir/file there (warns + skips via a newSKILL_LINK:line); a symlink failure never aborts bootstrap. Scoped to claude's global skills dir, with a comment noting other harnesses would need their own link.3. Slim
bin/fm-brief.sh.Both contract heredocs and the
case "$MODE"fragment-assembly block are gone (only mode resolution viafm-project-mode.shremains). Briefs now emit an identity line + a pointer to thefm-crewmateskill + this run's variables (task, repo, delivery mode, branchfm/$ID, status-file path, report path for scout,FM_ROOT). Reference is unconditional (the skill is globally available). Net:bin/fm-brief.shloses ~125 lines; each brief transmits ~10 lines of variables instead of ~35-70 lines of contract.4.
AGENTS.mdsection 11 updated to the new brief shape and notes the skill is firstmate-owned + globally symlinked. (The larger AGENTS.md self-slimming is a later phase, out of scope here.)Verification (all run, not asserted)
bash -n bin/fm-brief.shandbash -n bin/fm-bootstrap.shboth pass.no-mistakes,direct-PR,local-only); every generated brief references thefm-crewmateskill and carries all needed variables with the correct resolved mode.ensure_global_crew_skillin an isolated HOME: fresh create produces the symlink andSKILL.mdresolves; re-run is a silent idempotent no-op; a non-symlink at the target is left untouched with aSKILL_LINK:warning.FM_ROOTpost-merge (guarded by an[ -d "$src" ]check).Out of scope (later phases)
bin/fm-spawn.sh(has intentional local uncommitted edits in the primary).