[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CA4QD9RFDC379VD9DNK90D":3,"skill-same:01M7CA4QD9RFDC379VD9DNK90D":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":53},"01M7CA4QD9RFDC379VD9DNK90D","transition-brief",null,"Publish or abandon a draft brief, updating lifecycle metadata and indexes without changing its body.","bionic-coding\u002Fcrux","bionic-coding","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F301040008?v=4","01M7C9T2NA1V1V0EF1M552HRB3","Bionic Coding","01M7C9T2P72H1AQV5T5PTBFNHN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-brief\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: transition-brief\ndescription: \"Publish or abandon a draft brief, updating lifecycle metadata and indexes without changing its body.\"\ndisable-model-invocation: true\nmetadata:\n  tags: \"briefs, state-machine, transitions, lifecycle\"\n  bundles: \"crux-docs\"\n  risk_level: \"low\"\n  requires_access: \"write-tree\"\n  triggers: \"publish brief | abandon brief | close out a brief | mark brief published | mark brief abandoned | transition BRIEF-\u003Cslug>\"\n  routing_note: \"Transitions a brief `draft → published | abandoned`; mutates only frontmatter, never the body; updates the rollup + writes a `brief` op.\"\n---\n\n# Transition Brief\n\n\u003C!-- BEGIN GENERATED: runtime-compat -->\n## Runtime compatibility\n\nThis skill is portable across Claude Code, Codex, OpenCode, and OMP (Oh My Pi). This section overrides platform-specific labels below.\n\n- Before running a command that uses `CRUX_PLUGIN_ROOT`, set it to the installed plugin root. In Claude Code, use the value of `CLAUDE_PLUGIN_ROOT`. In Codex, OpenCode, and OMP, derive it from the absolute path of this selected `SKILL.md`: the plugin root is the parent of its `skills\u002F` directory (in OMP `bash`, `skill:\u002F\u002F\u003Cname>` resolves to the skill directory). In a source checkout, use the checkout `crux\u002F` directory.\n- For project-local skills, use `.claude\u002Fskills` in Claude Code, `.agents\u002Fskills` in Codex, `.opencode\u002Fskills` in OpenCode (which also reads the singular `.opencode\u002Fskill`), and `.omp\u002Fskills` in OMP. Set `CRUX_LOCAL_SKILLS_DIR` to that path before following any command below that uses it.\n- Translate Claude Code tool labels such as `Agent`, `Read`, `Write`, `Bash`, `WebSearch`, and `WebFetch` to the matching capability in the current session. Codex names its own capabilities; OpenCode uses the lowercase forms `subagent`, `read`, `edit`, `shell`, `websearch`, and `webfetch`, where `edit` covers both `Edit` and `Write`; OMP uses `task`, `read`, `edit`, `write`, `bash`, `grep`, `glob`, `find`, `todo`, and `web_search` (where `read` also handles URLs and `skill:\u002F\u002F` URIs). Do not attempt to invoke the Claude Code labels as literal commands on another host.\n- Install the generated role agents before delegating: `install-codex-agents` in Codex, `install-opencode-agents` in OpenCode, `install-omp-agents` in OMP. Codex names them `crux_architect`, `crux_brainstormer`, `crux_commander`, `crux_dev_lead`, `crux_developer`, `crux_historian`, `crux_librarian`, `crux_night_gardener`, `crux_reviewer`, and `crux_wayfinder`; OpenCode and OMP use the bare role names `architect`, `brainstormer`, `commander`, `dev-lead`, `developer`, `historian`, `librarian`, `night-gardener`, `reviewer`, and `wayfinder` (in OMP, `scout` may also be used for reconnaissance alongside `wayfinder`). If a required role or capability is unavailable, report that truthfully instead of claiming it ran.\n- Argument placeholders such as `$adr` and `$book` bind only in Claude Code. On a host without argument binding they are unset — take the value from the user's phrase. The \"Fields OpenCode ignores\" section of `OPENCODE_GUIDE.md` names the invocation-control fields OpenCode ignores.\n\u003C!-- END GENERATED: runtime-compat -->\n\n\n## Overview\n\nThe status state machine for **briefs** — the pre-decision exploration documents `propose-brief` scaffolds. This skill closes the lifecycle that `propose-brief` opens: a brief is born `draft`, and it ends either `published` (the exploration is preserved as a standing reference) or `abandoned` (the exploration was dropped without becoming a decision). Two named transitions — `publish` and `abandon` — each enforcing the single allowed transition out of `draft`.\n\nWhy a dedicated skill: `propose-brief` opens the lifecycle but nothing else closes it, and without a closer the only path to publish\u002Fabandon would be hand-editing frontmatter — which the docs schema otherwise forbids. This skill is the sanctioned closer, mirroring `transition-adr` for ADRs. `docs\u002FAGENTS.md` §6's `brief` op names `transition-brief` as a second writer.\n\nCore principle: **the state machine is the contract, and the body is frozen.** A brief's body is human-authored (per `docs\u002FAGENTS.md` §2 ownership); this skill mutates ONLY the `status` and `updated_at` frontmatter between the `---` fences and rewrites the body byte-for-byte. Every transition that isn't explicitly allowed is refused with a clear error.\n\n```\ndraft ──publish──▶ published\n  │\n  └──abandon──▶ abandoned\n```\n\nAllowed transitions, exhaustively:\n\n| From | Op | To | Notes |\n|------|-----|------|-----|\n| draft | publish | published | The exploration stands as a reference. |\n| draft | abandon | abandoned | Exploration dropped; body kept for the historical record. |\n\nEverything else is **REFUSED** with an error message naming the disallowed transition. There is no path *out of* `published` or `abandoned`, and no path *into* `draft` (that's `propose-brief`'s job, at creation only).\n\n## When to use\n\n- User says: \"publish brief\", \"abandon brief\", \"close out a brief\", \"mark BRIEF-\u003Cslug> published\", \"mark BRIEF-\u003Cslug> abandoned\", \"transition BRIEF-\u003Cslug>\".\n- After an exploration concludes — either it stands as a standing reference (`publish`) or it was dropped without becoming a decision (`abandon`).\n- As the natural follow-on when `propose-brief` hands a `draft` brief to a human who later finishes the exploration.\n\nDo **not** use this skill for:\n- Creating a new brief (that's `propose-brief`).\n- Editing a brief's body — refuse, even if asked. The body is human-authored; this skill only flips frontmatter status.\n- \"Un-publishing\" or \"un-abandoning\" a brief. The state machine is forward-only out of `draft`; a re-opened exploration is a new brief.\n- Transitioning an ADR (that's `transition-adr`).\n- Promoting a brief to a decision — that's `propose-adr` (cite the brief with `--related-briefs BRIEF-\u003Cslug>`); publishing a brief is not the same as deciding.\n\n## Inputs\n\nSubcommand form: `transition-brief \u003Cop> \u003Cslug>` where:\n\n- `\u003Cop>`: one of `publish | abandon`.\n- `\u003Cslug>`: the brief slug being transitioned (e.g., `caching-strategy`), with or without the `BRIEF-` prefix and `.md` suffix; normalize to the bare slug.\n\n## The pipeline\n\nExecute in order. Read the brief before any write. Validation (steps 1–2) visibly precedes the side-effecting writes (steps 3–5).\n\n### 1. Resolve and validate the brief\n\n- Normalize `\u003Cslug>`: strip any leading `BRIEF-` and trailing `.md`, lowercase nothing else (the slug is already lowercase by construction).\n- **Validate the slug**: `\u003Cslug>` MUST match `^[a-z0-9-]+$`. If it does not, **STOP** with a BROKEN error naming the offending slug.\n- `${FILE}` = `docs\u002Fbriefs\u002FBRIEF-${slug}.md`. Locate it.\n  - If zero matches, **STOP** with a BROKEN error (\"no brief `BRIEF-${slug}.md` under `docs\u002Fbriefs\u002F`\").\n  - If more than one path resolves (e.g. a glob collision), **STOP** with a BROKEN error.\n- **Path-escape guard**: resolve `${FILE}` and confirm the resolved path stays **UNDER** `docs\u002Fbriefs\u002F`. If the slug — even one that passed the regex — produces a resolved path that escapes `docs\u002Fbriefs\u002F` (path traversal), **STOP** with a BROKEN error. (`^[a-z0-9-]+$` already excludes `\u002F` and `.`; the resolved-path check is the belt-and-suspenders defense.)\n- Read the file. Parse the frontmatter. Read the current `status:` field.\n\n### 2. Validate the status transition\n\nLook up `(current_status, op)` in the allowed-transitions table above.\n\n- `(draft, publish)` → allowed, destination `published`.\n- `(draft, abandon)` → allowed, destination `abandoned`.\n- Any other pair → **REFUSE** with a clear message naming the current status and the requested op, e.g.:\n  - For `(published, *)` or `(abandoned, *)`: \"BRIEF-${slug} is already `${current_status}`; the briefs lifecycle is forward-only out of `draft`. A re-opened exploration is a new brief (`propose-brief`).\"\n  - For an attempt to set `draft` (e.g. published→draft): \"Cannot transition a brief back to `draft`. The state machine only allows `draft` → `published` and `draft` → `abandoned`. Scaffold a new brief with `propose-brief` if you need a fresh exploration.\"\n\nIf the target brief is already in the requested destination state, refuse with \"BRIEF-${slug} is already `${current_status}`; no-op refused.\" Do not write anything.\n\n### 3. Mutate ONLY the `status` + `updated_at` frontmatter\n\n`${TODAY}` = today's date (`YYYY-MM-DD`).\n\n- Read the file as bytes. Identify the frontmatter block — the content between the opening `---` and the closing `---` fences.\n- Within the frontmatter block, mutate ONLY:\n  - `status: ${new_status}` (`published` or `abandoned`).\n  - `updated_at: ${TODAY}`.\n- **Rewrite the body byte-for-byte.** Read everything after the closing `---` fence and rewrite it identically — never reformat, re-wrap, or touch a single line outside the frontmatter block.\n- Preserve frontmatter key order, comments, quote style, and trailing-newline conventions. Do NOT touch `created_at`, `title`, `slug`, `type`, `authors`, `tags`, `related_adrs`, `related_research`, or any other field.\n- Write `${FILE}` back. If the write fails, **STOP** — no index or operations log changes.\n\n### 4. Update `docs\u002Findex.md` brief rollup\n\n- Under the `## Briefs (N)` section, find the existing row for this brief and update it to:\n  - `- [[briefs\u002FBRIEF-${slug}]] — \\`${new_status}\\` — \\`updated_at: ${TODAY}\\``\n- The `(N)` count is **unchanged** (the brief still exists; only its status changed) — but verify it still matches the actual `docs\u002Fbriefs\u002FBRIEF-*.md` file count.\n- Update the `_Last updated:_` line to `${TODAY}`.\n\n### 5. Record the `brief` operation\n\nWrite the entry through the log writer (`docs\u002FAGENTS.md` §6),[^log-writer] using the `brief` op (§6 names `transition-brief` as that op's second writer). Write the body below to a file outside the tree, then run:\n\n```\nuv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" append --repo-root \u003Crepo-root> \\\n  --op brief --subject 'BRIEF-${slug}: ${old_status} → ${new_status}' --date ${TODAY} --body-file \u003Cpath>\n```\n\nThe entry it writes at the top of the current month's detail file `docs\u002Flog\u002FYYYY-MM.md`:\n\n```markdown\n## [${TODAY}] brief | BRIEF-${slug}: ${old_status} → ${new_status}\n\nTransitioned BRIEF-${slug} from `${old_status}` to `${new_status}`. Body unchanged.\n```\n\nThe body is the transition format `BRIEF-\u003Cslug>: \u003Cold-status> → \u003Cnew-status>`. Keep it terse — the operations log is for grep, not reading.\n\nA refused append keeps this skill's other writes and adds no entry: fix the cause it names, then rerun the append alone (§6). Then run the commit step of §6 over the result's `commit_paths` and `restore_paths`.\n\n### 6. Hand off to the user\n\n- Confirm the new status and the file path.\n- Remind: the body of the brief was not touched; only the `status`\u002F`updated_at` frontmatter changed.\n- For `published`, optionally note that an ADR can now cite this brief via `propose-adr --related-briefs BRIEF-${slug}`. For `abandoned`, note the body is preserved for the historical record.\n\n## Verification checklist\n\n- [ ] `\u003Cslug>` matched `^[a-z0-9-]+$` and `${FILE}` resolved **under** `docs\u002Fbriefs\u002F` (no path-escape).\n- [ ] The transition was one of `draft → published` or `draft → abandoned`; any other was refused.\n- [ ] Brief frontmatter `status:` equals the new state (`published` or `abandoned`).\n- [ ] Brief frontmatter `updated_at:` equals `${TODAY}`.\n- [ ] `created_at` and every other frontmatter field are **unchanged**.\n- [ ] **Brief body bytes are byte-identical to pre-write** (nothing outside the frontmatter block changed).\n- [ ] `docs\u002Findex.md` `## Briefs (N)` row for this brief shows the new status and `updated_at: ${TODAY}`; the `(N)` count is unchanged and still matches the file count.\n- [ ] `docs\u002Findex.md` `_Last updated:_` is `${TODAY}`.\n- [ ] The current month's detail file `docs\u002Flog\u002FYYYY-MM.md` has a new `## [${TODAY}] brief | BRIEF-${slug}: ${old_status} → ${new_status}` entry at the top, written by `operation-log.py append`.\n- [ ] No ADR and no other brief was created or modified.\n\n## Red flags — STOP and reconsider\n\n- About to write a transition that isn't in the allowed table (`draft → published`, `draft → abandoned`). REFUSE with the error message — including any attempt to move *into* `draft` (e.g. published→draft) or *out of* a terminal state.\n- **About to touch any line outside the frontmatter block.** The brief body is human-authored and frozen here — read the body bytes between the closing `---` fence and EOF and rewrite them identically. Editing, re-wrapping, or \"cleaning up\" the body is forbidden, even if asked.\n- About to mutate any frontmatter field other than `status` and `updated_at`. Touch nothing else — not `created_at`, not `title`, not `tags`.\n- **About to act on a slug that doesn't match `^[a-z0-9-]+$`, or whose resolved path escapes `docs\u002Fbriefs\u002F`.** STOP with a BROKEN error — never follow a path-traversal slug.\n- About to \"no-op\" silently when the brief is already in the destination state. Refuse with a clear message — the user thought a transition was needed; tell them it wasn't.\n- About to rewrite the frontmatter with reformatted YAML (different key order, different quote style). Preserve byte layout outside the two keys you're explicitly mutating.\n- About to bump the `## Briefs (N)` count. The file count didn't change on a status transition. Don't bump.\n- About to use the `journal` op (or any op other than `brief`) for the log entry. The `brief` op is canonical for both `propose-brief` (scaffold) and `transition-brief` (transition).\n\n## Rationalization table\n\n| Excuse | Reality |\n|--------|---------|\n| \"The brief body has a typo — while I'm flipping status I'll fix it.\" | The body is frozen here. This skill touches ONLY `status`\u002F`updated_at`. Body edits are the human's; refuse. |\n| \"The user wants to re-open a published brief as `draft` — close enough to a transition.\" | The state machine is forward-only out of `draft`. A re-opened exploration is a new brief (`propose-brief`). Refuse the backward move. |\n| \"Publishing the brief means it became a decision — I'll also write the ADR.\" | Publishing ≠ deciding. `transition-brief` closes the brief lifecycle; recording the decision is `propose-adr` (cite the brief with `--related-briefs`). Two skills. |\n| \"The slug has a slash in it pointing at a sibling dir — I'll resolve it anyway.\" | A slug with `\u002F` fails `^[a-z0-9-]+$` and\u002For escapes `docs\u002Fbriefs\u002F`. STOP with a BROKEN error; never follow a traversal path. |\n| \"BRIEF-foo is already `abandoned`; I'll just confirm and exit silently.\" | Silent no-op is indistinguishable from success. Refuse explicitly so the user notices their model is wrong. |\n| \"I'll re-emit the frontmatter through a YAML library to tidy it.\" | A lossy YAML round-trip reorders keys and changes quoting — diff noise that destroys git-blame and risks the body. Parse-then-mutate-then-byte-merge only the two keys. |\n| \"I'll log this under `journal` since there's narrative.\" | Brief transitions are a `brief` op, not a `journal` op (per `docs\u002FAGENTS.md` §6). |\n\n## Common mistakes\n\n- **Touching the body.** The single most important invariant: mutate ONLY the frontmatter `status`\u002F`updated_at`; rewrite the body byte-for-byte. Mirrors `transition-adr`'s body-freeze.\n- **Forgetting to update `updated_at`** along with `status`. Both move on every transition; `created_at` never does.\n- **Bumping the `## Briefs (N)` count** on a status transition — the file count is unchanged; only the row's status\u002Fdate update.\n- **Allowing a backward or terminal-state transition** — only `draft → published` and `draft → abandoned` are legal.\n- **Updating only the index, not the file** — the file's frontmatter is source of truth; the `docs\u002Findex.md` rollup mirrors it. Write the file first.\n- **Using the wrong log op** — it's `brief`, not `journal`, with body `BRIEF-\u003Cslug>: \u003Cold-status> → \u003Cnew-status>`.\n- **Skipping the slug\u002Fpath validation** — a slug must match `^[a-z0-9-]+$` and resolve under `docs\u002Fbriefs\u002F` before any read or write.\n\n## See also\n\n- `propose-brief` — scaffolds the `draft` brief this skill closes out (the lifecycle opener).\n- `transition-adr` — the symmetric ADR state machine this skill mirrors (body-freeze, frontmatter-only mutation, clear refusals).\n- `propose-adr` — the decision artifact that may cite a published brief (`--related-briefs BRIEF-\u003Cslug>`).\n- `audit-docs` — enforces brief↔ADR consistency; CHK-ADR-11 cross-checks brief draft-states.\n- `docs\u002FAGENTS.md` §2 (ownership — briefs are human-authored), §4 (briefs write rules), §5 (index brief rollup format), §6 (`brief` log op), §7.A (SKILL.md frontmatter contract), §9 (slug rule), §10 (skill-invocation table).\n\n[^log-writer]: rule:log-entries-go-through-the-log-writer, rule:no-writer-writes-the-legacy-log-file\n","# Transition Brief\n\n\u003C!-- BEGIN GENERATED: runtime-compat -->\n## Runtime compatibility\n\nThis skill is portable across Claude Code, Codex, OpenCode, and OMP (Oh My Pi). This section overrides platform-specific labels below.\n\n- Before running a command that uses `CRUX_PLUGIN_ROOT`, set it to the installed plugin root. In Claude Code, use the value of `CLAUDE_PLUGIN_ROOT`. In Codex, OpenCode, and OMP, derive it from the absolute path of this selected `SKILL.md`: the plugin root is the parent of its `skills\u002F` directory (in OMP `bash`, `skill:\u002F\u002F\u003Cname>` resolves to the skill directory). In a source checkout, use the checkout `crux\u002F` directory.\n- For project-local skills, use `.claude\u002Fskills` in Claude Code, `.agents\u002Fskills` in Codex, `.opencode\u002Fskills` in OpenCode (which also reads the singular `.opencode\u002Fskill`), and `.omp\u002Fskills` in OMP. Set `CRUX_LOCAL_SKILLS_DIR` to that path before following any command below that uses it.\n- Translate Claude Code tool labels such as `Agent`, `Read`, `Write`, `Bash`, `WebSearch`, and `WebFetch` to the matching capability in the current session. Codex names its own capabilities; OpenCode uses the lowercase forms `subagent`, `read`, `edit`, `shell`, `websearch`, and `webfetch`, where `edit` covers both `Edit` and `Write`; OMP uses `task`, `read`, `edit`, `write`, `bash`, `grep`, `glob`, `find`, `todo`, and `web_search` (where `read` also handles URLs and `skill:\u002F\u002F` URIs). Do not attempt to invoke the Claude Code labels as literal commands on another host.\n- Install the generated role agents before delegating: `install-codex-agents` in Codex, `install-opencode-agents` in OpenCode, `install-omp-agents` in OMP. Codex names them `crux_architect`, `crux_brainstormer`, `crux_commander`, `crux_dev_lead`, `crux_developer`, `crux_historian`, `crux_librarian`, `crux_night_gardener`, `crux_reviewer`, and `crux_wayfinder`; OpenCode and OMP use the bare role names `architect`, `brainstormer`, `commander`, `dev-lead`, `developer`, `historian`, `librarian`, `night-gardener`, `reviewer`, and `wayfinder` (in OMP, `scout` may also be used for reconnaissance alongside `wayfinder`). If a required role or capability is unavailable, report that truthfully instead of claiming it ran.\n- Argument placeholders such as `$adr` and `$book` bind only in Claude Code. On a host without argument binding they are unset — take the value from the user's phrase. The \"Fields OpenCode ignores\" section of `OPENCODE_GUIDE.md` names the invocation-control fields OpenCode ignores.\n\u003C!-- END GENERATED: runtime-compat -->\n\n\n## Overview\n\nThe status state machine for **briefs** — the pre-decision exploration documents `propose-brief` scaffolds. This skill closes the lifecycle that `propose-brief` opens: a brief is born `draft`, and it ends either `published` (the exploration is preserved as a standing reference) or `abandoned` (the exploration was dropped without becoming a decision). Two named transitions — `publish` and `abandon` — each enforcing the single allowed transition out of `draft`.\n\nWhy a dedicated skill: `propose-brief` opens the lifecycle but nothing else closes it, and without a closer the only path to publish\u002Fabandon would be hand-editing frontmatter — which the docs schema otherwise forbids. This skill is the sanctioned closer, mirroring `transition-adr` for ADRs. `docs\u002FAGENTS.md` §6's `brief` op names `transition-brief` as a second writer.\n\nCore principle: **the state machine is the contract, and the body is frozen.** A brief's body is human-authored (per `docs\u002FAGENTS.md` §2 ownership); this skill mutates ONLY the `status` and `updated_at` frontmatter between the `---` fences and rewrites the body byte-for-byte. Every transition that isn't explicitly allowed is refused with a clear error.\n\n```\ndraft ──publish──▶ published\n  │\n  └──abandon──▶ abandoned\n```\n\nAllowed transitions, exhaustively:\n\n| From | Op | To | Notes |\n|------|-----|------|-----|\n| draft | publish | published | The exploration stands as a reference. |\n| draft | abandon | abandoned | Exploration dropped; body kept for the historical record. |\n\nEverything else is **REFUSED** with an error message naming the disallowed transition. There is no path *out of* `published` or `abandoned`, and no path *into* `draft` (that's `propose-brief`'s job, at creation only).\n\n## When to use\n\n- User says: \"publish brief\", \"abandon brief\", \"close out a brief\", \"mark BRIEF-\u003Cslug> published\", \"mark BRIEF-\u003Cslug> abandoned\", \"transition BRIEF-\u003Cslug>\".\n- After an exploration concludes — either it stands as a standing reference (`publish`) or it was dropped without becoming a decision (`abandon`).\n- As the natural follow-on when `propose-brief` hands a `draft` brief to a human who later finishes the exploration.\n\nDo **not** use this skill for:\n- Creating a new brief (that's `propose-brief`).\n- Editing a brief's body — refuse, even if asked. The body is human-authored; this skill only flips frontmatter status.\n- \"Un-publishing\" or \"un-abandoning\" a brief. The state machine is forward-only out of `draft`; a re-opened exploration is a new brief.\n- Transitioning an ADR (that's `transition-adr`).\n- Promoting a brief to a decision — that's `propose-adr` (cite the brief with `--related-briefs BRIEF-\u003Cslug>`); publishing a brief is not the same as deciding.\n\n## Inputs\n\nSubcommand form: `transition-brief \u003Cop> \u003Cslug>` where:\n\n- `\u003Cop>`: one of `publish | abandon`.\n- `\u003Cslug>`: the brief slug being transitioned (e.g., `caching-strategy`), with or without the `BRIEF-` prefix and `.md` suffix; normalize to the bare slug.\n\n## The pipeline\n\nExecute in order. Read the brief before any write. Validation (steps 1–2) visibly precedes the side-effecting writes (steps 3–5).\n\n### 1. Resolve and validate the brief\n\n- Normalize `\u003Cslug>`: strip any leading `BRIEF-` and trailing `.md`, lowercase nothing else (the slug is already lowercase by construction).\n- **Validate the slug**: `\u003Cslug>` MUST match `^[a-z0-9-]+$`. If it does not, **STOP** with a BROKEN error naming the offending slug.\n- `${FILE}` = `docs\u002Fbriefs\u002FBRIEF-${slug}.md`. Locate it.\n  - If zero matches, **STOP** with a BROKEN error (\"no brief `BRIEF-${slug}.md` under `docs\u002Fbriefs\u002F`\").\n  - If more than one path resolves (e.g. a glob collision), **STOP** with a BROKEN error.\n- **Path-escape guard**: resolve `${FILE}` and confirm the resolved path stays **UNDER** `docs\u002Fbriefs\u002F`. If the slug — even one that passed the regex — produces a resolved path that escapes `docs\u002Fbriefs\u002F` (path traversal), **STOP** with a BROKEN error. (`^[a-z0-9-]+$` already excludes `\u002F` and `.`; the resolved-path check is the belt-and-suspenders defense.)\n- Read the file. Parse the frontmatter. Read the current `status:` field.\n\n### 2. Validate the status transition\n\nLook up `(current_status, op)` in the allowed-transitions table above.\n\n- `(draft, publish)` → allowed, destination `published`.\n- `(draft, abandon)` → allowed, destination `abandoned`.\n- Any other pair → **REFUSE** with a clear message naming the current status and the requested op, e.g.:\n  - For `(published, *)` or `(abandoned, *)`: \"BRIEF-${slug} is already `${current_status}`; the briefs lifecycle is forward-only out of `draft`. A re-opened exploration is a new brief (`propose-brief`).\"\n  - For an attempt to set `draft` (e.g. published→draft): \"Cannot transition a brief back to `draft`. The state machine only allows `draft` → `published` and `draft` → `abandoned`. Scaffold a new brief with `propose-brief` if you need a fresh exploration.\"\n\nIf the target brief is already in the requested destination state, refuse with \"BRIEF-${slug} is already `${current_status}`; no-op refused.\" Do not write anything.\n\n### 3. Mutate ONLY the `status` + `updated_at` frontmatter\n\n`${TODAY}` = today's date (`YYYY-MM-DD`).\n\n- Read the file as bytes. Identify the frontmatter block — the content between the opening `---` and the closing `---` fences.\n- Within the frontmatter block, mutate ONLY:\n  - `status: ${new_status}` (`published` or `abandoned`).\n  - `updated_at: ${TODAY}`.\n- **Rewrite the body byte-for-byte.** Read everything after the closing `---` fence and rewrite it identically — never reformat, re-wrap, or touch a single line outside the frontmatter block.\n- Preserve frontmatter key order, comments, quote style, and trailing-newline conventions. Do NOT touch `created_at`, `title`, `slug`, `type`, `authors`, `tags`, `related_adrs`, `related_research`, or any other field.\n- Write `${FILE}` back. If the write fails, **STOP** — no index or operations log changes.\n\n### 4. Update `docs\u002Findex.md` brief rollup\n\n- Under the `## Briefs (N)` section, find the existing row for this brief and update it to:\n  - `- [[briefs\u002FBRIEF-${slug}]] — \\`${new_status}\\` — \\`updated_at: ${TODAY}\\``\n- The `(N)` count is **unchanged** (the brief still exists; only its status changed) — but verify it still matches the actual `docs\u002Fbriefs\u002FBRIEF-*.md` file count.\n- Update the `_Last updated:_` line to `${TODAY}`.\n\n### 5. Record the `brief` operation\n\nWrite the entry through the log writer (`docs\u002FAGENTS.md` §6),[^log-writer] using the `brief` op (§6 names `transition-brief` as that op's second writer). Write the body below to a file outside the tree, then run:\n\n```\nuv run \"${CRUX_PLUGIN_ROOT}\u002Fscripts\u002Foperation-log.py\" append --repo-root \u003Crepo-root> \\\n  --op brief --subject 'BRIEF-${slug}: ${old_status} → ${new_status}' --date ${TODAY} --body-file \u003Cpath>\n```\n\nThe entry it writes at the top of the current month's detail file `docs\u002Flog\u002FYYYY-MM.md`:\n\n```markdown\n## [${TODAY}] brief | BRIEF-${slug}: ${old_status} → ${new_status}\n\nTransitioned BRIEF-${slug} from `${old_status}` to `${new_status}`. Body unchanged.\n```\n\nThe body is the transition format `BRIEF-\u003Cslug>: \u003Cold-status> → \u003Cnew-status>`. Keep it terse — the operations log is for grep, not reading.\n\nA refused append keeps this skill's other writes and adds no entry: fix the cause it names, then rerun the append alone (§6). Then run the commit step of §6 over the result's `commit_paths` and `restore_paths`.\n\n### 6. Hand off to the user\n\n- Confirm the new status and the file path.\n- Remind: the body of the brief was not touched; only the `status`\u002F`updated_at` frontmatter changed.\n- For `published`, optionally note that an ADR can now cite this brief via `propose-adr --related-briefs BRIEF-${slug}`. For `abandoned`, note the body is preserved for the historical record.\n\n## Verification checklist\n\n- [ ] `\u003Cslug>` matched `^[a-z0-9-]+$` and `${FILE}` resolved **under** `docs\u002Fbriefs\u002F` (no path-escape).\n- [ ] The transition was one of `draft → published` or `draft → abandoned`; any other was refused.\n- [ ] Brief frontmatter `status:` equals the new state (`published` or `abandoned`).\n- [ ] Brief frontmatter `updated_at:` equals `${TODAY}`.\n- [ ] `created_at` and every other frontmatter field are **unchanged**.\n- [ ] **Brief body bytes are byte-identical to pre-write** (nothing outside the frontmatter block changed).\n- [ ] `docs\u002Findex.md` `## Briefs (N)` row for this brief shows the new status and `updated_at: ${TODAY}`; the `(N)` count is unchanged and still matches the file count.\n- [ ] `docs\u002Findex.md` `_Last updated:_` is `${TODAY}`.\n- [ ] The current month's detail file `docs\u002Flog\u002FYYYY-MM.md` has a new `## [${TODAY}] brief | BRIEF-${slug}: ${old_status} → ${new_status}` entry at the top, written by `operation-log.py append`.\n- [ ] No ADR and no other brief was created or modified.\n\n## Red flags — STOP and reconsider\n\n- About to write a transition that isn't in the allowed table (`draft → published`, `draft → abandoned`). REFUSE with the error message — including any attempt to move *into* `draft` (e.g. published→draft) or *out of* a terminal state.\n- **About to touch any line outside the frontmatter block.** The brief body is human-authored and frozen here — read the body bytes between the closing `---` fence and EOF and rewrite them identically. Editing, re-wrapping, or \"cleaning up\" the body is forbidden, even if asked.\n- About to mutate any frontmatter field other than `status` and `updated_at`. Touch nothing else — not `created_at`, not `title`, not `tags`.\n- **About to act on a slug that doesn't match `^[a-z0-9-]+$`, or whose resolved path escapes `docs\u002Fbriefs\u002F`.** STOP with a BROKEN error — never follow a path-traversal slug.\n- About to \"no-op\" silently when the brief is already in the destination state. Refuse with a clear message — the user thought a transition was needed; tell them it wasn't.\n- About to rewrite the frontmatter with reformatted YAML (different key order, different quote style). Preserve byte layout outside the two keys you're explicitly mutating.\n- About to bump the `## Briefs (N)` count. The file count didn't change on a status transition. Don't bump.\n- About to use the `journal` op (or any op other than `brief`) for the log entry. The `brief` op is canonical for both `propose-brief` (scaffold) and `transition-brief` (transition).\n\n## Rationalization table\n\n| Excuse | Reality |\n|--------|---------|\n| \"The brief body has a typo — while I'm flipping status I'll fix it.\" | The body is frozen here. This skill touches ONLY `status`\u002F`updated_at`. Body edits are the human's; refuse. |\n| \"The user wants to re-open a published brief as `draft` — close enough to a transition.\" | The state machine is forward-only out of `draft`. A re-opened exploration is a new brief (`propose-brief`). Refuse the backward move. |\n| \"Publishing the brief means it became a decision — I'll also write the ADR.\" | Publishing ≠ deciding. `transition-brief` closes the brief lifecycle; recording the decision is `propose-adr` (cite the brief with `--related-briefs`). Two skills. |\n| \"The slug has a slash in it pointing at a sibling dir — I'll resolve it anyway.\" | A slug with `\u002F` fails `^[a-z0-9-]+$` and\u002For escapes `docs\u002Fbriefs\u002F`. STOP with a BROKEN error; never follow a traversal path. |\n| \"BRIEF-foo is already `abandoned`; I'll just confirm and exit silently.\" | Silent no-op is indistinguishable from success. Refuse explicitly so the user notices their model is wrong. |\n| \"I'll re-emit the frontmatter through a YAML library to tidy it.\" | A lossy YAML round-trip reorders keys and changes quoting — diff noise that destroys git-blame and risks the body. Parse-then-mutate-then-byte-merge only the two keys. |\n| \"I'll log this under `journal` since there's narrative.\" | Brief transitions are a `brief` op, not a `journal` op (per `docs\u002FAGENTS.md` §6). |\n\n## Common mistakes\n\n- **Touching the body.** The single most important invariant: mutate ONLY the frontmatter `status`\u002F`updated_at`; rewrite the body byte-for-byte. Mirrors `transition-adr`'s body-freeze.\n- **Forgetting to update `updated_at`** along with `status`. Both move on every transition; `created_at` never does.\n- **Bumping the `## Briefs (N)` count** on a status transition — the file count is unchanged; only the row's status\u002Fdate update.\n- **Allowing a backward or terminal-state transition** — only `draft → published` and `draft → abandoned` are legal.\n- **Updating only the index, not the file** — the file's frontmatter is source of truth; the `docs\u002Findex.md` rollup mirrors it. Write the file first.\n- **Using the wrong log op** — it's `brief`, not `journal`, with body `BRIEF-\u003Cslug>: \u003Cold-status> → \u003Cnew-status>`.\n- **Skipping the slug\u002Fpath validation** — a slug must match `^[a-z0-9-]+$` and resolve under `docs\u002Fbriefs\u002F` before any read or write.\n\n## See also\n\n- `propose-brief` — scaffolds the `draft` brief this skill closes out (the lifecycle opener).\n- `transition-adr` — the symmetric ADR state machine this skill mirrors (body-freeze, frontmatter-only mutation, clear refusals).\n- `propose-adr` — the decision artifact that may cite a published brief (`--related-briefs BRIEF-\u003Cslug>`).\n- `audit-docs` — enforces brief↔ADR consistency; CHK-ADR-11 cross-checks brief draft-states.\n- `docs\u002FAGENTS.md` §2 (ownership — briefs are human-authored), §4 (briefs write rules), §5 (index brief rollup format), §6 (`brief` log op), §7.A (SKILL.md frontmatter contract), §9 (slug rule), §10 (skill-invocation table).\n\n[^log-writer]: rule:log-entries-go-through-the-log-writer, rule:no-writer-writes-the-legacy-log-file\n",{"name":5,"metadata":24,"description":7,"disable-model-invocation":31},{"tags":25,"bundles":26,"triggers":27,"risk_level":28,"routing_note":29,"requires_access":30},"briefs, state-machine, transitions, lifecycle","crux-docs","publish brief | abandon brief | close out a brief | mark brief published | mark brief abandoned | transition BRIEF-\u003Cslug>","low","Transitions a brief `draft → published | abandoned`; mutates only frontmatter, never the body; updates the rollup + writes a `brief` op.","write-tree",true,"main","dd4f16e7ac12ff940790660ec897677284ae4b6d","crux\u002Fskills\u002Ftransition-brief","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux","https:\u002F\u002Fbionic-coding.com\u002Fcrux\u002F","https:\u002F\u002Fgithub.com\u002Fbionic-coding","https:\u002F\u002Fbionic-coding.com","Durable intent, disposable code.","2026-11-12 09:36:33",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":31},[43,46,49],{"tool":44,"command":45},"npx","npx skills add bionic-coding\u002Fcrux --skill transition-brief",{"tool":47,"command":48},"bunx","bunx skills add bionic-coding\u002Fcrux --skill transition-brief",{"tool":50,"command":51},"pnpm","pnpm dlx skills add bionic-coding\u002Fcrux --skill transition-brief","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-brief\u002FSKILL.md",[],[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M7CA5PH4JT2V5WBTA5ZPJNS8","whiteboarding","Explore an idea through docs-informed dialogue before committing to a design. Capture the exploration for later filing as a brief.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fwhiteboarding\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7CA5GZPSVNJJZYQMF0JT3EH","verify-code-docs","Check generated code documentation against source and report drift without regenerating it.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Fverify-code-docs\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7CA5A4HA73VF91N8VY6SDBN","transition-observation","Apply a human disposition to an observation's lifecycle state without changing its claim or body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-observation\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7CA53X1ESGWKTPCEQ55JWEZ","transition-invariant","Ratify, reject, or retire an invariant on human direction. Update lifecycle metadata without changing the invariant's body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-invariant\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7CA4Y2VC25NFZE0XJZ47VSX","transition-decision","Apply a human ratify, reject, or defer verdict to a recovered decision candidate; ratification creates a Proposed ADR or observation.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-decision\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7CA4G9Z884TD07VBAQGCMNE","transition-adr","Accept, deprecate, supersede, or retract an existing ADR, or promote in-run guidance on the owner's instruction (\"promote ADR-NNNN: rules N\"). Update status and relationships without changing its narrative body.","https:\u002F\u002Fgithub.com\u002Fbionic-coding\u002Fcrux\u002Fblob\u002Fmain\u002Fcrux\u002Fskills\u002Ftransition-adr\u002FSKILL.md",[],[]]