Repository navigation
docs(agents): move X-mode procedures out of AGENTS - #253
Merged
Merged
Conversation
AGENTS.md diet PR 1 of 3 (agentsmd-diet-s2 report, move-plan items 1-2).
Replaces section 14's "Answering"/"Completion follow-up"/"Conversations"/
"Length and threads"/"Preview / dry-run" blocks (54 lines) and the
"Mechanism" narrative (6 lines) with two short pointers: fmx-respond
(section 13) for the procedure, docs/configuration.md "X mode (.env)"
for the wire protocol. Net -55 lines in AGENTS.md.
Destination edits landed first, deletions second (q4 discipline):
- docs/configuration.md: added the "purely additive, watcher untouched"
guarantee that AGENTS.md's Mechanism block stated but configuration.md
did not.
- fmx-respond/SKILL.md: added the x-mode-error wake boundary (report as
a blocker, do not load this skill), the --image flag for replies and
follow-ups, the "images are for real artifacts, not prose" rule, and
the dry-run compact-image-marker behavior - none of these were
previously in the skill even though AGENTS.md described them, so they
were genuine gaps, not pre-existing duplication. Also made the skill's
own "Completion follow-up" section the sole, full owner of that
procedure instead of deferring to AGENTS.md section 14 for substance
that no longer lives there (two internal cross-references updated to
point at section 8's terminal-wake trigger and the skill's own section
instead).
Mechanical line-by-line audit of every removed AGENTS.md line:
Mechanism block (6 lines removed):
- bootstrap artifact-writing description -> already owned by
docs/configuration.md "X mode (.env)" (locked-bootstrap paragraph)
- check-shim/poll mechanism description -> already owned by
docs/configuration.md same section
- missing-deps/x-mode-error diagnostic description -> already owned by
docs/configuration.md ("Relay auth or config problems...") plus
bin/fm-x-poll.sh's own header comment for the missing-curl/jq mechanics
- opt-out artifact removal description -> already owned by
docs/configuration.md same section
- "purely additive, no edit to fm-watch.sh/fm-watch-arm.sh/fm-wake-lib.sh/
afk daemon" guarantee -> MOVED to docs/configuration.md (added in this
PR; this fact had no other home before)
Answering/Completion follow-up/Conversations/Length and threads/
Preview-dry-run blocks (54 lines removed):
- x-mention wake -> load fmx-respond: already owned by section 13's
existing trigger line (unchanged) and restated in the new pointer
- x-mode-error wake -> report as blocker, don't load fmx-respond: MOVED
to fmx-respond/SKILL.md (added in this PR)
- inbox-draining, classification, acting, reply composition, submission,
cleanup-on-success/failure: already owned by fmx-respond/SKILL.md
"Procedure" section (unchanged, pre-existing)
- owner-only routing / captain-as-asker framing: already owned by
fmx-respond/SKILL.md "The asker is your own captain" section
- standing X-mode authorization / autonomous posting / dry-run as only
non-posting path: already owned by fmx-respond/SKILL.md same section
- acknowledge-first -> act -> follow-up shape, three-case classification:
already owned by fmx-respond/SKILL.md "A request to act on" section
- destructive/irreversible/security-sensitive escalation guardrail:
already owned by fmx-respond/SKILL.md "Public channel..." section and
Procedure step 2c
- dismiss-instead-of-reply for pure acknowledgments, relay re-offer
prevention, dry-run honoring: already owned by fmx-respond/SKILL.md
Procedure steps 2b/2c/2e-skip and docs/configuration.md
- public-safety bar (no task ids/internals/captain-private/secrets):
already owned by fmx-respond/SKILL.md "The reply is public" section
- never-inline-into-shell-command / --text-file or stdin: already owned
by fmx-respond/SKILL.md Procedure step 2e and Notes
- --image flag for replies (formats, base64, no-inline guarantee): MOVED
to fmx-respond/SKILL.md Procedure step 2e (added in this PR - this was
not previously in the skill)
- fm-x-link field names (x_request=, x_request_ts=, x_followups=):
already owned by AGENTS.md section 2's state/<id>.meta field list
(untouched, out of scope for this PR) and fmx-respond/SKILL.md
- carry-count/carry-ts relink behavior, three-follow-up budget, milestone
sparingness, --check/--text-file posting, connector/followup wire
detail, --final clearing, cap/window graceful degradation: already
owned by fmx-respond/SKILL.md "Completion follow-up" section (now sole
owner) and docs/configuration.md wire-protocol paragraphs
- --image flag for follow-ups: MOVED to fmx-respond/SKILL.md "Completion
follow-up" section (added in this PR - genuine gap)
- "failed task still gets an honest final follow-up": already owned by
fmx-respond/SKILL.md "Completion follow-up" section
- FMX_DRY_RUN whole-loop previewability: already owned by
fmx-respond/SKILL.md "Dry-run / preview mode" section
- in_reply_to conversation continuity, untrusted-thread handling,
follow-up worthiness judgment, relay-owned self-reply guard/cap:
already owned by fmx-respond/SKILL.md "The direct ask is the captain's"
section and Notes (one bullet is a verbatim match)
- concise-by-default / no hand-numbered threads: already owned by
fmx-respond/SKILL.md "Voice" section
- auto-split behavior, char/tweet caps, premium-independence, wire shape
({text}/{text,texts}): behavior already owned by fmx-respond/SKILL.md
Voice section; exact defaults and wire shape already owned by
docs/configuration.md; "premium-independent" mechanics already owned
by bin/fm-x-reply.sh's own header comment
- "images are for real artifacts, not prose": MOVED to fmx-respond/
SKILL.md "Voice" section (added in this PR - genuine gap)
- image-on-thread wire behavior: already owned by docs/configuration.md;
reinforced in fmx-respond/SKILL.md's new --image note
- dry-run POST-body shape, endpoint marker, truthy-value definition,
jq-only dependency, end-to-end testability, x-outbox inspection:
already owned by fmx-respond/SKILL.md "Dry-run / preview mode" section
(several near-verbatim matches) and docs/configuration.md wire detail
- dry-run compact image marker: MOVED to fmx-respond/SKILL.md "Dry-run /
preview mode" section (added in this PR - genuine gap)
Section 8's terminal-wake completion-follow-up trigger (the one fact
required to survive inline) is untouched and already present; the new
section 14 pointer references it instead of restating it.
Nothing outside section 14 (plus the two destination files) is touched.
Full test suite green, including all 74 fm-x-mode.test.sh checks.
mielyemitchell
added a commit
to mielyemitchell/firstmate
that referenced
this pull request
Jul 6, 2026
Intent
AGENTS.md diet PR 1 of 3 (agentsmd-diet-s2 report, move-plan items 1-2): collapse the inert-by-default X-mode section 14 in AGENTS.md. Replaced the 'Answering'/'Completion follow-up'/'Conversations'/'Length and threads'/'Preview / dry-run' blocks (54 lines) and the 'Mechanism' narrative (6 lines) with short pointers to the fmx-respond skill (procedure) and docs/configuration.md 'X mode (.env)' (wire protocol), keeping only the one fact that must survive inline: the terminal-wake completion-follow-up trigger already in section 8. Deliberately followed a destination-first discipline: before deleting anything, re-verified fmx-respond/SKILL.md against current (post-PR#241) content and found it was NOT actually a complete superset as an earlier scout report assumed - image-attachment support (--image flag for replies and follow-ups, the image-only-for-real-artifacts rule, and the dry-run compact image marker) and the x-mode-error wake handling boundary were genuinely missing from the skill, so I added them there first. Also added one missing architectural fact ('X mode is purely additive, no edit to the watcher core scripts') to docs/configuration.md, since it was only previously stated in the AGENTS.md text being deleted. Also trimmed fmx-respond's own 'Completion follow-up' section so it is now the section's sole full owner (stating the procedure once, completely) instead of deferring back to AGENTS.md section 14 for content that no longer lives there - updated its two internal cross-references to point at AGENTS.md section 8 (the terminal-wake trigger) instead. This is intentionally scoped to section 14 only plus the two destination files; sections 1-13 are out of scope for this PR (planned as PR 3). Ran the full test suite (42 files) plus a targeted rerun of fm-x-mode.test.sh (74/74 passing) to confirm no behavior changed - only prose moved homes.
What Changed
Risk Assessment
✅ Low: Captain, the change is a bounded instruction/docs relocation, and the X-mode trigger gaps from earlier review rounds are now covered without introducing a substantiated operational risk.
Testing
The previously successful full-suite baseline is accounted for; I reran the targeted X-mode behavior suite, manually exercised the completion follow-up dry-run path with an image to verify compact image metadata and final link cleanup, and simulated a relay auth failure to show the
x-mode-error ...wake output that fmx-respond now owns. No rendered UI was involved in this docs and CLI change.Evidence: Targeted X-mode test log
Evidence: Documentation routing evidence
Evidence: Dry-run image follow-up summary
{"request_id":"req-e2e","endpoint":"followup","image":{"media_type":"image/png","bytes":30},"image_has_base64":false}Evidence: X-mode config-error wake output
x-mode-error relay returned HTTP 401Evidence: Final follow-up cleared X link
window=fm-task-e2ePipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed (2) ✅
AGENTS.md:914- The always-loaded AGENTS guidance now preserves only the terminal-state X follow-up trigger and sends the rest tofmx-respond, but that skill is only loaded forx-mentionwakes. Later non-terminal milestone wakes for an already X-linked task therefore no longer have an inline trigger to load the skill or runfm-x-followup.sh, so the promised in-thread progress follow-ups can be silently missed until the final terminal update. Add an explicit section 8/13 trigger to loadfmx-respondfor X-linked milestone or terminal wakes, or keep a short non-terminal follow-up trigger inline here.🔧 Fix: Preserve X-linked follow-up triggers
1 warning still open:
.agents/skills/fmx-respond/SKILL.md:22- The concretex-mode-errorhandling now lives only insidefmx-respond, but this instruction says not to load the skill for that wake, and the section 13/front-matter triggers only coverx-mentionplus X-linked follow-up wakes. A poll/auth failure surfaced ascheck: x-mode-error ...can therefore miss the explicit blocker-reporting path. Keep a one-linex-mode-erroraction inline in AGENTS.md, or add it as an explicit load trigger and remove the contradiction.🔧 Fix: Fix x-mode error trigger
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Baseline already ran successfully before this validation:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc".bash tests/fm-x-mode.test.sh > /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/fm-x-mode.test.log 2>&1FM_HOME=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/followup-dryrun-home FMX_DRY_RUN=1 FMX_NOW_OVERRIDE=1700000100 bin/fm-x-followup.sh task-e2e --image /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/followup-visual-artifact.png --final --text-file /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/followup-text.txtjq -e '.request_id == "req-e2e" and .endpoint == "followup" and .image.media_type == "image/png" and .image_has_base64 == false' /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/followup-dryrun-summary.jsonPATH=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/x-mode-error-fakebin:/usr/bin:/bin:/usr/sbin:/sbin FM_HOME=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/x-mode-error-home FMX_RELAY_URL=https://relay.test bin/fm-x-poll.sh > /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/x-mode-error.stdout 2> /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KWQB22BAZMQM76EQSK9AK298/x-mode-error.stderrgit status --short✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.