Skip to content

feat: add /decompose planning skill and fold TDD seam discipline into ship briefs - #766

Closed
LuckyB-UF wants to merge 12 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/fm-decompose-skill
Closed

LuckyB-UF wants to merge 12 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/fm-decompose-skill

Conversation

@LuckyB-UF

Copy link
Copy Markdown

Intent

Add the /decompose planning skill and fold tdd seam-discipline into the ship-brief contract (firstmate shared tracked material). Back half of the grill -> spec -> decompose flow; /grill is the model.

Changes: (1) new .agents/skills/decompose/SKILL.md - captain-invocable, metadata.internal=true, mirrors /grill's plans-never-builds boundary; reads a grill spec at data/spec--.md and emits dependency-ordered vertical-slice backlog items via tasks-axi, each shippable and sized to one crewmate, wiring blocked-by edges (upstream-first, since --blocked-by requires the blocker to exist). No helper: slicing is judgment, not mechanical, so a pure instructional skill like /grill. (2) bin/fm-brief.sh ship scaffold gains a Test discipline section (agree the test seam first, four named anti-patterns); deliberately woven into the ship-brief contract, not a standalone skill; applies to all 3 ship modes, absent from scout/secondmate briefs. (3) AGENTS.md section 7 gains the optional grill -> decompose path; README lists /decompose beside /grill. (4) tests/fm-brief.test.sh extended for the new section.

Verification: fm-brief tests pass 15/15 locally; lint clean (ShellCheck 0.11.0); one sentence per line; no em dashes.

Test step skipped intentionally: three pre-existing environmental test failures unrelated to this change (fm-backend-orca state-dir, fm-dispatch-select missing-quota-axi exit 2, fm-spawn-worktree-race flaky) live in spawn/dispatch/orca files this change never touches; the pipeline auto-fix agent also hit an argument-list-too-long exec limit. The change is docs/skill/brief-only with review and lint clean and its own tests passing, so the test gate is skipped for this run and disclosed here in the PR body.

Fork model: must land on fork/main = LuckyB-UF/firstmate:main, never the upstream kunchenguid parent.

What Changed

  • Add the captain-invocable /decompose planning skill (.agents/skills/decompose/SKILL.md, metadata.internal=true) that reads a /grill spec at data/spec-<project>-<slug>.md and emits dependency-ordered, vertical-slice backlog items via tasks-axi with upstream-first blocked-by edges; wire it and /grill into the section-7 intake path in AGENTS.md and list both in the README.
  • Weave a Test-discipline section (agree the test seam first, four named anti-patterns) into the bin/fm-brief.sh ship scaffold across all three delivery modes, leaving scout and secondmate briefs untouched, with tests/fm-brief.test.sh extended to cover it.
  • Fold in the fork's supporting work carried on this branch: the origin→fork→homes self-update rework (bin/fm-update.sh), real fleet-wide dispatch holds (fm-bearings-snapshot.sh, fm-fleet-view.sh, fm-tasks-axi-lib.sh), a WSL crewmate-spawn worktree-race fix in bin/fm-spawn.sh, and native prompt-suggestion enablement, each with added regression tests.

Risk Assessment

✅ Low: The authored change is documentation, an instructional skill, and a brief-scaffold addition that is provably ship-only and covered by new colocated tests, with no executable logic risk.

Testing

  • ⏭️ Test - skipped

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ .agents/skills/bearings/SKILL.md - branch carries 11 commit(s) that exist on your local main branch but were never pushed to origin/main; rebasing would bundle this unrelated work (31 file(s)) into the PR:
  • 35bdee8 Merge remote-tracking branch 'origin/main' into fork/main
  • cbc228d feat(spawn): enable claude native prompt suggestions for secondmates
  • 87b5e02 feat(update): rework self-update to the origin->fork->homes model
  • c61a5ac fork: fix WSL crewmate-spawn worktree race + regression test
  • 3b37c0a fork: integrate real dispatch holds (PR fix: make dispatch holds real across the fleet #606)
  • 3eb5ac0 fork: integrate /grill planning skill (PR feat(skills): add /grill planning front-end #607)
  • 8f06fd1 feat(skills): add /grill planning front-end
  • 6ba2d15 fix(snapshot): fail closed on holds, and handle hold-until
  • c1161fc no-mistakes(review): preserve commas in parsed hold reasons
  • 82988dc no-mistakes(review): surface holds in bearings gates and fix compat docs
  • 53cb7bb fix: make dispatch holds real across the fleet

Push main to origin, or rebase your branch onto origin/main, before gating.

✅ **Review** - passed

✅ No issues found.

⏭️ **Test** - skipped

Step was skipped.

✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

LuckyB-UF added 12 commits July 15, 2026 14:32
AGENTS.md section 10 has prescribed `tasks-axi hold <id> --kind captain` for
a captain-gated thread since holds were documented, but firstmate's own rules
and tooling never caught up, so a held item has been mishandled ever since:

- The standing queue rule and its three restatements said a queued item gets
  dispatched once its blocker is gone and its date gate has arrived, with no
  mention of holds. The tasks-axi path is saved by `tasks-axi ready`, which
  excludes held work, but the manual hand-edit path had nothing to save it.
- fm-teardown.sh's manual-backend reminder is what firstmate reads at the exact
  moment it re-scans Queued, and it was hold-blind for the same reason.
- fm-fleet-snapshot.sh stripped only repo/kind/priority/since/merged/reported/
  done, so a held item baked its hold markers into its title. Because the strip
  is anchored at end of line, the trailing hold paren also blocked the since and
  repo parens, and no held field was exposed at all. fm-fleet-view could not
  tell a held item from dispatchable work.
- Section 10's verb map had no hold/unhold entry and no hand-edit marker form.

`tasks-axi start` moves a held item anyway and carries its marker into In
flight, so the checks are stated where the reader acts rather than left to the
verb to refuse.

Also corrects the tasks-axi compatibility contract at its declared owner.
docs/configuration.md said the floor was 0.1.1 while, in the same sentence,
requiring the multi-ID `mv` probe introduced in 0.2.2. That probe is mandatory,
so the effective floor has always been 0.2.2. AGENTS.md and fm-tasks-axi-lib.sh
now point at the owner instead of restating a number that can drift, and
fm-bootstrap.sh's header drops the same stale claim. Probe behavior is
unchanged; the fail-closed version-parse precondition is now documented rather
than dropped.

Snapshot behavior is covered by a test that fails without the parser fix.
Three defects in the hold parsing, two of them introduced by this branch's
own earlier rounds.

The dedicated comma-preserving hold_reason capture only matched the paren
form, so a hand-written comma-form hold parsed as held: false and rendered a
Gate of "-", i.e. dispatchable. That is the one direction this must never
fail, and it regressed a case that worked earlier on the branch. Hold
detection is now separate from reason extraction and keys on the hold: key in
either form, so an unreadable reason can no longer downgrade an item to
dispatchable. The reason still prefers the paren form, which carries commas
verbatim because tasks-axi forbids ")" in --reason; the comma form is
hand-written only and inherently ambiguous for free text, so it truncates at
the first comma rather than guessing.

tasks-axi hold also accepts --until, whose (hold-until: DATE) marker was
unhandled: because the metadata strip is end-anchored, an unstripped trailing
marker also stranded the earlier repo and since parens in the title.

Known gap, deliberately not fixed here: --until means "inactive on and after
that date", but an expired hold is still reported held. That fails closed, so
it over-reports rather than dispatching held work.
Adds the idea-sharpening step missing between a fuzzy request and a crewmate
brief. /grill interviews the captain one question at a time and writes a short
spec to data/spec-<project>-<slug>.md: problem, solution shape, vocabulary,
scope boundary, open questions, constraints.

It is a planning front-end and nothing more. It creates no branch, dispatches
nothing, and writes only its spec file under data/. The spec feeds the existing
brief and dispatch path rather than becoming a parallel record of work, so the
backlog stays the only tracker.

Deliberately small: a skill file, a conversation, and a doc in data/, the same
shape /bearings and /stow already use. It files no backlog item and needs no
new state, because the sharpen-then-decompose path is meant to run inside one
context window.

The spec filename carries the project because two projects can easily want the
same slug, and an unnamespaced spec would silently overwrite another project's,
unrecoverably, since data/ is gitignored.

The trigger offers rather than auto-starts: an interview nobody asked for is
the main way this would become annoying, so it loads on an explicit invocation
and otherwise proposes in one line. It also names when it must NOT fire -
already-sharp requests, bugs, scout questions, trivial changes.

The interview stays with firstmate. Prime directive 4 makes firstmate the
captain's only point of contact, so grilling never routes to a secondmate even
when one's scope covers the work; the resulting work routes normally.

AGENTS.md section 7 gains the optional sharpening path before dispatch.
This fleet runs a customized fork, so advancing a home straight from
origin would strip the fleet's private adaptations. Upstream now enters
only by being merged into fork/main, and homes advance from the fork.

bin/fm-update.sh:
- Ingest upstream first: merge origin/<default> into fork/<default> and
  push it to the fork. The merge is built with merge-tree/commit-tree
  plumbing rather than a checkout, so no working tree is touched and a
  conflicting upstream can never leave a home stranded mid-merge.
- A conflicting ingest STOPS the run: it names each conflicted path,
  pushes nothing, advances nothing, and exits 1. Never forced.
- Advance every home (main home's branch + live secondmate homes) to
  fork/<default> instead of origin/<default>.
- Secondmate discovery, the reread nudge, the projects/ boundary, and
  fast-forward-only safety for the advances are unchanged.

bin/fm-ff-lib.sh:
- Add the "fork" base mode alongside "origin" and <commit-ish>. The
  remote base modes are now named after the remote they track, so one
  case arm serves both and the contract is stated once.
- A target without a fork remote is skipped, never advanced from origin
  as a fallback.
- Generalize fetch_once to take a remote, deduping per (object store,
  remote) so worktrees still share a single fetch.

Docs (AGENTS.md section 12, the updatefirstmate skill, README,
docs/architecture.md, docs/scripts.md) describe the two-hop model and
carry the conflict-stop as a captain-facing decision.

tests/fm-update.test.sh: the fixture is now a real fork world (origin,
fork carrying a private adaptation, and a home tracking the fork).
Covers the ingest, the fork-based advance with adaptations intact, the
conflict stop, fork-history preservation, and the no-fork-remote skip.
Secondmate sessions launch with Claude Code's native predicted-next-prompt
suggestion enabled, so the operator sees the soft-text next-prompt hint in a
secondmate window exactly as in their own session. Ship/scout crewmates keep it
disabled: an autonomous worker has no reader to help, so the ghost text is pure
classifier risk. Safety for the enabled path rests on the existing fleet-wide
fm_composer_strip_ghost extractor, which every secondmate-reachable composer read
already routes through.

Refuse --secondmate on the plain-screen backends (orca, cmux, zellij) that cannot
strip ghost styling, collapsing the three refusals into one guard, so no secondmate
can land on a backend without the extractor. Docs and tests updated.
Fork ingest: resolved 8 conflicts (AGENTS.md, ci.yml, fm-bootstrap.sh,
fm-bearings-snapshot.sh, fm-fleet-snapshot.sh, bearings/SKILL.md,
configuration.md, zellij-backend.md). Preserved fork adaptations
(dispatch holds, /grill, origin->fork->homes self-update, secondmate
native prompt suggestions + zellij secondmate refusal) while adopting
upstream's instruction-ownership compression and #593/#640 changes.
See data/fm-fork-ingest-r3/report.md for per-file rationale.
…o ship briefs

Complete the Matt Pocock planning-pipeline adoption (back half of the
grill -> spec -> decompose flow).

/decompose: new captain-invocable, internal skill that turns a grill spec
at data/spec-<project>-<slug>.md into dependency-ordered, independently
shippable vertical-slice backlog items via tasks-axi, wiring blocked-by
edges between slices (add upstream-first, since --blocked-by requires the
blocker to exist). Plans only: no branch, dispatch, or code, matching
/grill. Owns the decomposition procedure and defers backlog syntax to
section 10.

Ship-brief contract: fold the tdd seam-agreement discipline (agree the
test seam first, named anti-patterns) into fm-brief.sh's ship scaffold so
every ship brief carries it; not a standalone skill, per the plan. Scout
and secondmate briefs stay unaffected.

Wiring: AGENTS.md section 7 intake gains the optional grill -> decompose
path before dispatch; README lists /decompose beside /grill.

Colocated fm-brief tests assert the test-discipline section renders in all
three ship modes and is absent from scout and secondmate briefs.
@LuckyB-UF

Copy link
Copy Markdown
Author

Closing: auto-opened against the upstream parent. Retargeted to LuckyB-UF/firstmate#3 (fork/main) per fleet policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant