Repository navigation
fix(bin): stop fm-brief.sh directing workers to write AGENTS.md or a nonexistent skill - #17
Merged
Merged
Conversation
…r a fake skill The captain set a standing rule today: workers never write a project's AGENTS.md, only firstmate does, and only on explicit confirmation. Every worker was appending to it instead, and one conflicted merge landed on php8 with unresolved markers left in. The generator's project-memory section now forbids the write and points at the existing note: CANDIDATE routing mechanism (Rule 4) instead of restating it. Also drops the `mr-description` skill instruction from the direct-PR and no-mistakes definitions of done: no such skill exists anywhere in the repo, and two workers independently hit the fake instruction today. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019YN6JkYC7wgfTy5ReiM5P9
alandomio
pushed a commit
that referenced
this pull request
Sep 26, 2026
… skill The direct-PR and no-mistakes definitions of done ordered every ship worker to write the PR/MR description with ~/.claude/skills/mr-description, a skill that exists nowhere, so every worker hit a dead reference. fc4f0bf (#19) reintroduced the line that da0e670 (#17) had already removed. The worker now writes the description itself, keeps the no-trailer and no-orchestration-vocabulary rule, and is still told to create the PR/MR without waiting for confirmation on a step the brief already authorizes. The test now pins the new wording in both forge vocabularies and asserts no generated brief names mr-description, guarding against a third return.
alandomio
added a commit
that referenced
this pull request
Sep 26, 2026
… skill (#35) The direct-PR and no-mistakes definitions of done ordered every ship worker to write the PR/MR description with ~/.claude/skills/mr-description, a skill that exists nowhere, so every worker hit a dead reference. fc4f0bf (#19) reintroduced the line that da0e670 (#17) had already removed. The worker now writes the description itself, keeps the no-trailer and no-orchestration-vocabulary rule, and is still told to create the PR/MR without waiting for confirmation on a step the brief already authorizes. The test now pins the new wording in both forge vocabularies and asserts no generated brief names mr-description, guarding against a third return. Co-authored-by: Alan Domio <[email protected]>
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
Fix two defects in bin/fm-brief.sh, the generator for every crewmate brief this fleet produces.
Defect 1: the generated ship brief's Project memory section told workers to run fm-ensure-agents-md.sh and write to a project's AGENTS.md/CLAUDE.md. The captain set a standing rule today (2026-09-06): workers must NEVER write to a project's AGENTS.md - only firstmate writes it, and only on the captain's explicit confirmation. This caused real damage: AGENTS.md was the only conflicting file on four separate branches today because every worker was appending to it, and one merge was resolved by committing both sides with conflict markers left in (now on php8, 848 lines where 700 are an unresolved conflict). Fix: remove the write instruction, replace it with the opposite - the worker never touches AGENTS.md/CLAUDE.md, and durable project knowledge is instead raised as a 'note: CANDIDATE - {finding}' status line (the existing Rule 4 / AGENTS.md section 6 candidate mechanism - cross-reference it, do not restate its contract, per the one-owner rule in firstmate-coding-guidelines). Also fixed the header comment (was lines 59-62) that described the same wrong behavior, since nothing else was allowed to still imply the worker owns that file.
Defect 2: lines 458 and 497 instructed the worker to write the PR/MR description using an 'mr-description' skill that does not exist anywhere in the repo (verified: not in .agents/skills/, not anywhere else, not in the skill list workers actually see). Independently reported by two different workers on two different tasks today. Decision: remove the reference rather than create the skill (out of this task's scope) - removing is the honest choice per the task instructions. Also fixed a now-stale 'Three firstmate-specific rules' count in the no-mistakes DOD prose that needed to become 'Two' once the mr-description bullet was removed.
Explicitly out of scope: AGENTS.md itself currently contradicts the captain's new standing rule in its own section 1/6 language (section 1 says a crewmate creates/updates a project's AGENTS.md via fm-ensure-agents-md.sh). That contradiction is a separate fix for whoever owns AGENTS.md - this task was scoped strictly to bin/fm-brief.sh and its test coverage, not to reconciling AGENTS.md's own text.
Done means: a brief generated for a ship task contains no instruction to write AGENTS.md and no reference to a non-existent skill. Verified via before/after diffs of generated briefs (no-mistakes and direct-PR modes) rather than just describing the change. Updated the two existing tests that covered the old (buggy) wording: test_mr_description_skill_required_for_pr_modes (renamed to test_mr_description_skill_not_referenced) and test_ship_project_memory_wording, so they assert the new contract instead of the old one. Ran bin/fm-lint.sh (shellcheck 0.11.0 + actionlint 1.7.12, both pinned) clean, and the full fm-brief.test.sh suite (29 checks) plus spot-checked fm-tangle-guard, fm-secondmate-safety, and fm-ask-user-authority tests that also exercise fm-brief.sh - no regressions.
What Changed
bin/fm-brief.sh: replaced the ship-task project-memory section's instruction to runfm-ensure-agents-md.shand write a project'sAGENTS.md/CLAUDE.mdwith a rule forbidding worker writes to those files, routing durable findings through the existingnote: CANDIDATE - {finding}status line (Rule 4) instead; updated the matching header comment; removed both references to the non-existentmr-descriptionskill (direct-PR and no-mistakes brief templates) and updated the now-stale "Three firstmate-specific rules" DOD prose to "Two".docs/architecture.md: updated "Project memory belongs to projects" and "Operational memory routing" sections to describe the new candidate-note routing instead of direct crewmate writes toAGENTS.md..agents/skills/stow/SKILL.md: updated the approved-destinations and routing guidance to reflect that project-intrinsic knowledge is raised as a candidate note for firstmate to route and write, rather than committed directly by a crewmate viafm-ensure-agents-md.sh.tests/fm-brief.test.sh: renamedtest_mr_description_skill_required_for_pr_modestotest_mr_description_skill_not_referencedand rewrote it to assert no generated brief referencesmr-description; rewrotetest_ship_project_memory_wordingto assert the new forbid-write/candidate-note contract instead of the old AGENTS.md-authoring-bar assertions.Risk Assessment
✅ Low: The change is a small, well-scoped text fix in bin/fm-brief.sh that removes the two identified defects (AGENTS.md write instruction and non-existent mr-description skill reference) cleanly with no dangling references, correctly updates the "Two firstmate-specific rules" count, cross-references the pre-existing Rule 4/CANDIDATE mechanism instead of restating it, and updates the two affected tests to assert the new contract by exercising the generated brief.md output (the legitimate generated-artifact interface, not source-content grepping).
Testing
All targeted automated tests pass (29-check fm-brief suite plus three related suites, no regressions), and manual before/after diffs of actual generated ship briefs in both delivery modes confirm end-to-end that the AGENTS.md-write instruction and the non-existent mr-description skill reference are gone, replaced by the note: CANDIDATE routing per the user's intent.
Evidence: Diff of generated no-mistakes-mode brief.md (base vs. target fm-brief.sh)
Source: Diff of generated no-mistakes-mode brief.md (base vs. target fm-brief.sh)
Evidence: Diff of generated direct-PR-mode brief.md (base vs. target fm-brief.sh)
Source: Diff of generated direct-PR-mode brief.md (base vs. target fm-brief.sh)
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.
bash tests/fm-brief.test.sh (29/29 pass)bash tests/fm-tangle-guard.test.sh (pass, no regressions)bash tests/fm-secondmate-safety.test.sh (pass, no regressions)bash tests/fm-ask-user-authority.test.sh (pass, no regressions)Manually generated brief.md for --mode no-mistakes and --mode direct-PR using both the base commit's (27159321) and target commit's (0a8a3ae) fm-brief.sh, then diffed each pair to confirm the AGENTS.md-write instruction, fm-ensure-agents-md.sh reference, and mr-description skill reference are removed, replaced by the note: CANDIDATE routing and 'Two firstmate-specific rules' wording✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Install actionlint 1.7.12 locally so fm-lint.sh passes clean
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.