Repository navigation
feat(bin): bake token-economy brevity caps into generated worker briefs - #12
Merged
Merged
Conversation
Ship, scout, and secondmate charter briefs now carry status, commit, PR, and narration caps; the charter adds the idle-then-/clear rule. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YJCaJmuhyCPCDUAhZ7qrdp
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YJCaJmuhyCPCDUAhZ7qrdp
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
Bake the captain's token-economy caps into the generated worker instructions in bin/fm-brief.sh (ship, scout, and secondmate charter variants): status lines under 300 characters; commit messages one subject line plus at most 3 prose body lines (git trailers outside the cap); PR description at most 5 lines plus the attribution footer; no narration of routine progress. The secondmate charter additionally says that once its queue is empty and its children are torn down it goes idle, and the main firstmate sends /clear (a secondmate cannot self-issue it). Keep wording short, do not duplicate existing lifecycle text. Colocated tests in tests/fm-brief.test.sh assert the caps appear in each variant. Shellcheck clean.
What Changed
bin/fm-brief.shnow puts the captain's token-economy caps into every brief it generates. Ship and scout briefs get them as a numbered "Brevity caps" rule, and the secondmate charter gets them in a new# Brevitysection. The caps are:/clear, because a secondmate can't issue it itself. The secondmate-provisioning skill now documents this step from the main firstmate's side, usingbin/fm-send.sh.tests/fm-brief.test.shaddstest_brevity_caps_in_every_variant. It checks that the caps appear in the ship, scout and secondmate briefs, and that the/clearrule appears in the secondmate charter (matched as a fixed string).🤖 Generated with Claude Code
Risk Assessment
✅ Low: This is a small, prompt-text-only change. It adds the caps to all three worker variants through unquoted heredocs, so the variables expand correctly, and it adds tests that use fixed-string checks on each variant and on the /clear rule, which matches what the intent asks for.
Testing
I ran the colocated test file
tests/fm-brief.test.sh. It passed, including the new brevity-caps test. I also generated real ship, scout and secondmate briefs withbin/fm-brief.sh. The ship and scout briefs carry the four caps on one line as rule 8. The secondmate charter carries them in a# Brevitysection, plus one short new line: go idle, then the main firstmate sends/clear, which the secondmate can't send itself. The generated briefs and the grep transcript are saved as evidence. I did not run shellcheck, because this phase does not run linters.Evidence: Brevity caps and /clear rule as they appear in each generated brief
===== ship brief ===== 46:8. Brevity caps: Status lines stay under 300 characters. Commit messages: one subject line plus at most 3 prose body lines; git trailers sit outside the cap. PR descriptions: at most 5 lines plus the attribution footer. Do not narrate routine progress. ===== scout brief ===== 39:8. Brevity caps: (same line) ===== second brief ===== 33:# Brevity 34:Status lines stay under 300 characters. 35:Commit messages: one subject line plus at most 3 prose body lines; git trailers sit outside the cap. 36:PR descriptions: at most 5 lines plus the attribution footer. 37:Do not narrate routine progress. 61:Once your queue is empty and your children are torn down, go idle; the main firstmate sends/clear(you cannot self-issue it).Evidence: Generated ship brief
Evidence: Generated scout brief
Evidence: Generated secondmate charter
Evidence: fm-brief test run log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-brief.sh:267- The new charter line 'Once your queue is empty and your children are torn down, go idle; ...' partly restates the line two above it ('When you have no assigned or in-flight work ... go idle and wait silently'). The intent explicitly asks for the idle clause, and the new parts ('children torn down' and the main firstmate sending /clear) are new, so this duplication is acceptable. If you want it tighter, you could reword it to just 'After your children are torn down, the main firstmate sends /clear (you cannot self-issue it).'✅ **Test** - passed
✅ No issues found.
bash tests/fm-brief.test.sh(colocated suite, including the newtest_brevity_caps_in_every_variant): exit 0, no failuresManual end-to-end:FM_HOME=$tmp bin/fm-brief.sh ev-ship firstmate --mode no-mistakes,bin/fm-brief.sh ev-scout firstmate --scout, andFM_SECONDMATE_CHARTER='Handle routed work.' bin/fm-brief.sh ev-second --secondmate --no-projects, then grepped each generated brief.md for the caps and the /clear ruleChecked there is one new /clear line and it does not repeat the existing lifecycle text ('Do not exit just because your queue is empty')🔧 **Document** - 1 issue found → auto-fixed ✅
.agents/skills/secondmate-provisioning/SKILL.md:227- The generated secondmate charter (bin/fm-brief.sh) now tells a secondmate that once its queue is empty and its children are torn down, the main firstmate sends /clear. But nothing on the main firstmate's side says it should do this: not AGENTS.md section 6, not the secondmate-provisioning skill, and not docs/architecture.md, whose idle-secondmate text only says idle panes are healthy. I didn't invent that policy, including when and how the main firstmate should send /clear, because it would be a new behavior contract for the main firstmate rather than a fix to stale docs. If this is intended, add one line to the secondmate-provisioning skill, which owns the secondmate lifecycle, and nowhere else.🔧 Fix: Document main firstmate /clear for idle secondmates
✅ Re-checked - no issues remain.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.