From skills
Split (1-to-N) a Brain knowledge-graph note into multiple notes using a distribution plan. Triggers on phrases like "decompose this note", "split this ADR into per-decision notes", "break this analysis into clusters". Authors a distribution plan YAML, presents it for adjudication, then executes via the composition library with SHA-256 round-trip validation guaranteeing zero content drift.
How this skill is triggered — by the user, by Claude, or both
Slash command
/skills:decomposeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Splits a single Brain knowledge-graph note into N destination notes using a deterministic distribution plan. The LLM authors the plan (cognitive work); the composition library executes it (mechanical work, hash-validated).
Splits a single Brain knowledge-graph note into N destination notes using a deterministic distribution plan. The LLM authors the plan (cognitive work); the composition library executes it (mechanical work, hash-validated).
Use when the user asks to:
This skill follows the locked three-phase workflow from KICKOFF-BRIEF.md:
source_type, identify cluster seams, and author a distribution plan YAMLbun run shared/composition/src/decompose.ts --plan <path> and report the audit logNever write to destination files directly. Never bypass the adjudication step.
read_note (Brain notes under docs/**)type — this becomes the plan's source_type field (e.g., decision → adr, analysis → analysis, session → session, plan → plan, spec → spec)Examine the source's structure for natural split boundaries. For an ADR, the seams are usually the ### D-N decision headings. For an ANALYSIS index, the seams are the findings or sub-analysis sections. Decide on the partition shape: how many destinations, which identifiers belong to each cluster, and any cross-cluster wikilink remapping required.
Write a YAML file to docs/_restructure/decompose-{id}-plan.yaml where {id} is a short kebab-case slug describing the operation (e.g., adr-042-split, analysis-012-findings). The required shape:
plan_type: distribution
source_type: adr # frontmatter type, mapped to a registered adapter source_type
source_path: <path/to/source.md relative to plan file>
renumber_map:
D-1: D-100
D-2: D-101
# Must be injective (no duplicate values).
wikilink_map: {} # optional inbound-link substitutions
clusters: # optional — declare the partitioning
cluster_a:
description: ...
destination_path: <path/to/dest-a.md>
identifiers: [D-100, D-101]
Keep the YAML under 1 MB; the loader enforces this guard.
Present the plan to the user with a markdown summary AND the path to the raw YAML for deep inspection. Use AskUserQuestion with exactly these three options:
On reject, rename the rejected plan file to decompose-{id}-plan-rejected-{N}.yaml (incrementing N per rejection) so the rejection history is auditable, then re-enter Step 3 with the feedback incorporated.
On abort, optionally delete the plan file and stop. No further action.
Summary format:
**Source**: `<path>` (source_type: `<adr|analysis|...>`)
**Destinations** (N):
- `<dest-path-1>` — <description>
- `<dest-path-2>` — <description>
**Renumber map** (M entries): D-1→D-100, D-2→D-101, ...
**Wikilink map**: <count> entries (or "empty")
**Raw plan**: `docs/_restructure/decompose-{id}-plan.yaml`
Run the CLI entry point via Bun.$:
bun run shared/composition/src/decompose.ts --plan docs/_restructure/decompose-{id}-plan.yaml
The script:
js-yaml FAILSAFE_SCHEMA (CWE-502 mitigation)DistributionPlanSchema.parseAsync), including bijection of renumber_mapgetAdapter(source_type)applyMutations then reverseMutations and SHA-256-compares the round trip (ADR-001 F-8 invariant — blocking)Exit codes:
0 — success1 — validation error (parse the structured PlanValidationError from stderr and report to the user)2 — hash mismatch (the script halted before any destructive write; this is a guarantee violation — surface it loudly)Summarize the audit log: number of destination files written, their paths, and the SHA-256 of each. Confirm the source file remains unchanged.
PlanValidationError — Zod rejection. Parse the issues array ({path, message}), display each, and offer to re-author the plan with corrections.HashMismatch (exit 2) — extraordinarily rare; means the adapter's applyMutations/reverseMutations pair is not bijective on this content. Do NOT retry; surface to user with the source path so the adapter implementation can be investigated.getAdapter throws "Unknown source_type", the user picked a source_type that has no shipped adapter. Surface the message verbatim and ask the user how to proceed.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub acmelabs-15/skills --plugin skills