decomposing-design-documents
Decompose an accepted request or design document into a Change DAG. Use when new work needs semantic decomposition and exact work nodes authored as a Change DAG; do not create task plans or implementation graphs.
- License 许可
- MIT
- 所属仓库
- xiaden/SkyScow
- 最近更新
- 2026-09-30
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- decomposing-design-documents
- description
- Decompose an accepted request or design document into a Change DAG. Use when new work needs semantic decomposition and exact work nodes authored as a Change DAG; do not create task plans or implementation graphs.
02 资源文件 3
- 参考文档references/ADR_MARKDOWN_SCHEMA.json4.2 KB
- 参考文档references/semantic-generation.md12.8 KB
- 参考文档references/subagent-protocol.md12.1 KB
03 SKILL.md 正文
Decomposing Design Documents
For new work, this skill derives a Change DAG from an accepted request or design document and hands it to change-dag-author. The Change DAG is the single implementation-work authority. This skill does not create task plans, plan phases, plan letters, CONTRACTS.md, execution rounds, or GRAPH.json implementation graphs.
New-work pipeline
accepted request / accepted DD
↓
bounded live-repository discovery
↓
change-dag-author (one atomic semantic dag_create, then exits)
↓
controller-owned serialized frontier motion and one bounded change-dag-worker per opaque branch_ref per round (lower to exact work, or decompose further)
↓
observable independent-review trigger?
├─ no → Nyx: dag_start / dag_status
└─ yes → change-dag-reviewer (bounded external evidence)
↓
PASS → Nyx lifecycle control
FINDINGS → route by category: Fixer for exact work, semantic-repairer for semantic/graph, upstream for authority
↓
independent post-change QA (separate lifecycle, not a DAG phase)
The Change DAG bundle keeps construction and execution records separate: DAG.json is current declarative construction state; DAG_MUTATIONS.jsonl, when present, is append-only construction provenance; EXECUTION_STATE.json records terminal-node execution lifecycle state for resumability; and WORK_LOG.jsonl is append-only execution evidence. Archival moves these bundle files as-is and does not merge mutation provenance into the Work Log.
Graph model
requiresis the only edge; it is ALL-of and expresses what must become true for a semantic requirement to be fulfilled — a semantic node is satisfied only when every node it directly requires is satisfied.- A semantic node with no
requiresis an unresolved semantic node and is not satisfied; unresolved semantic nodes are legal graph state. A semantic node is locally resolved when it directly requires at least one terminal work node, or declaresdecomposition_only=trueover semantic children only. Unresolved DAGs are valid authoring artifacts but are not executable. - Shared descendants are legal: multiple parents may reference one child identity, and that child is executed or satisfied once.
- Opaque branch components are serialized authoring units; nodes grouped in one branch are not necessarily independently dispatchable. The frontier service derives branches from the graph and never infers a missing causal relationship. If correct authoring of B requires accepted work from A, B must have a
requirespath to A rather than being treated as an independent sibling. - Node IDs are opaque, service-assigned, and monotonic (
^N[0-9]+$); agents never allocate IDs. - Depth is derived from the longest path from root and is never persisted.
- Direct-terminal composition is structural: semantic children are always allowed;
editis composable (any number may coexist with each other and with semantic children);create,remove,move, andrunare exclusive direct terminals — when a semantic node has any of them it must be that node's only terminal child. Arunchild is additionally the run-barrier node, and a semantic node has at most one directrunchild. schema_valid,executable, andresolvedare distinct derived properties.executableis the aggregate execution-admission/lint result: it requires structural validity,resolved, and no deterministic compiler/context admission conflict. Recoverable live-applicability failures stay reported asruntime_failures, not admission blockers.- A running/in-progress DAG is immutable; repair requires execution to stop/fail or
dag_stop, then the stopped mutable region may be edited beforedag_start(retry=true).
Authoring a Change DAG
- Read the authoritative request, the accepted DD when present, repository facts, and relevant live surfaces. Discovery always reads the live repository; there is no projected planning worktree.
- Generate the smallest complete semantic graph as an initial semantic skeleton grounded in known correctness/causal structure: distinct obligations stated as postconditions, with causal edges derived as a separate judgment. Do not pre-size nodes for one Worker context; Worker-discovered breadth may be refined later through lossless SCALE decomposition. Follow the canonical derivation procedure in
references/semantic-generation.md— obligation extraction, postcondition normalization, deduplication, compound splitting, the sibling-independence test, and the representation-assumption guard. State a condition/postcondition per semantic node — never an implementation action, and never an assumed file/symbol/mechanism unless authoritative. Pure paraphrase or recursive restatement is invalid decomposition. - Submit the whole semantic graph atomically through
dag_create(slug, semantic_graph). Initial semantic construction is not a loop ofdag_add_requirementcalls; incremental insertion is reserved for later review, reconciliation, and recovery. - After the atomic create, the controller queries the decomposition frontier and admits at most one fresh bounded
change-dag-workerper opaque branch in each serialized round. The packet containsslug,branch_ref, the opaque capabilityconstruction_ref, andcheckpoint_identity, not a selected node ID. The Worker first callsdag_worker_resolve(slug, branch_ref, construction_ref), and the service selects/binds one currently authorable semantic node before the Worker usesdag_decomposition_scopeand lowers the returned node's requirement into exact terminal work (create,edit,remove,move,run, attached withdag_add_create/dag_add_edit/dag_add_remove/dag_add_move/dag_add_run) or refines it into further semantic decomposition. The controller never computes depths itself, never keeps a processed-frontier registry, and reconciles a frontier only when worker results or conflicts require it. Edit work is authored as exact{old, new}replacements (dag_add_edit(slug, parent_ids, path, replacements)); the service generates the internal unified diff, so agents never author diff syntax. A worker that reportsedit_base_unavailablefor a peer-produced file signals a missing causal edge or decomposition defect, which the author repairs by adding arequiresedge or decomposing the producing obligation — never by exposing peer work. - For affected paths, combine live source with applicable accepted lower DAG work through
dag_read/dag_grep/dag_searchatnode_id=<boundary semantic node>. These return that boundary's SELF view — live source, strictly-deeper accepted work, and the boundary node's own persisted terminal work — while same-frontier peers and shallower/future work stay excluded. The narrower BASE lens (accepted lower work only, without the boundary's own work) is what a new mutation is validated against, so an operation never becomes its own base.dag_preview(path=..., node_id=...)remains available for compiled operation/conflict metadata. New files, renamed paths, and planned-only symbols are read from DAG work, not rediscovered by repository search. - Correct proposed mutable nodes with the typed
dag_update_*tools ordag_remove.dag_add_requirementmay insert a requirement between existing parents and selected children (convergence) and is also the recovery tool. - Validate with
dag_validateand inspect withdag_showanddag_preview. Authoring stops at a validated DAG; it never edits repository source.
Discovery and generation boundaries
- Discovery remains bounded by the semantic requirement being handled. Broad implementation discovery is evidence to evaluate SCALE decomposition, not automatic evidence of a new semantic concern. The file-count rule and the MEANING/SCALE model are defined once in
change-dag-semantics; real repository breadth or context cost may justify narrowing the SAME predicate recursively. - Decomposition has two reasons: MEANING (distinct required states or causal obligations) and SCALE (the same semantic postcondition is too broad for one bounded context); SCALE refinement is lossless and exhaustive. The Worker owns scale refinement beneath its assigned scope; the Author owns the initial semantic skeleton. The canonical model — including the parent/child completeness invariant — is
change-dag-semantics. - Each returned branch is processed by at most one bounded
change-dag-workerinvocation per round; the service selects the concrete semantic node inside the branch at resolution time reasoning from its SELF view — BASE plus the boundary node's own persisted terminal work, where BASE is live repository plus strictly-deeper accepted work. A new or changing mutation is validated against BASE alone, so an operation never becomes its own base. Branch components are serialized authoring units, so same-frontier nodes are not necessarily independently dispatchable; peer proposals are excluded from both lenses and are not a design basis, and the frontier service infers no missing causal dependency. There is no persisted frontier, worker registry, or construction-state artifact — the DAG is the only construction artifact. - Exact work is authored against live repository source plus applicable accepted lower DAG patches; there is no generated write scope and no file-ownership claim system.
- GPU/consumer contracts are not a second dependency system. Interface coherence is re-homed to semantic requirements, bounded caller/implementation discovery, and patch-aware work review.
- A
runnode verifies or satisfies the change (tests, builds, type checks, schema checks). Publication/lifecycle commands — commit, push, PR, release, deploy — never belong in arunnode and are excluded by the canonical argv policy. - Edit work is authored as ordered exact
{old, new}replacements applied sequentially with zero fuzz (oldnon-empty and occurring exactly once); the service derives and validates the internal unified diff. Agents never author unified diff syntax, hunk numbers, or*** Begin Patch/*** End Patch. anchor_commitis a creation-time drift/provenance marker only; a dirty tree andHEAD != anchor_commitdo not invalidate the DAG.
Optional independent review
Dispatch change-dag-author for one initial semantic dag_create; it verifies creation and exits. The controller owns frontier motion, serialized Worker admission, mandatory review, exact-work routing to change-dag-fixer, semantic/graph routing to change-dag-semantic-repairer, authority escalation, reconciliation, dag_preview, dag_validate, and mutable recovery. The Author uses semantic authoring tools only, never mutates source, and never dispatches agents.
The orchestrator/controller selects change-dag-reviewer only when observable conditions justify independent judgment: shared semantic convergence, incompatible cross-branch proposals, nontrivial behavior-changing ordering, producer/consumer or interface migration, shared schema/registry/persistence/migration work, request/DD decomposition ambiguity, DD authority ambiguity, materially useful recovery amendment, or an explicit user request. Do not invoke it for node count, node types, ordinary run barriers, mechanically independent branches, or ordinary author-correctable mechanical errors.
Reviewer input includes the DAG slug, relevant node IDs/bounded scope, source context, a concrete review question, the observable trigger, and review_kind (SEMANTIC, EXACT_WORK, DD_CONSISTENCY, or COMBINED). The reviewer is read-only (dag_show, dag_preview, dag_validate). PASS means only that the requested scope found no material issue; it is not persisted DAG state, execution authorization, or a mandatory lifecycle transition. Final review uses BLOCK_RUN, ALLOW_WITH_FOLLOWUP, or ALLOW: Nyx routes exact-work defects to change-dag-fixer, semantic/graph defects to change-dag-semantic-repairer, and authority issues upstream. ALLOW_WITH_FOLLOWUP preserves evidence for post-run QA or follow-on repair; ordinary repairable correctness defects do not automatically block execution.
Lifecycle boundary
Authoring ends at a validated DAG; optional independent review is a controller-selected evidence step. Nyx owns lifecycle control through the four public tools; dag_executor performs deterministic execution:
dag_start(slug, retry?)launches or queues whole-DAG execution and returnsrunningorqueued.dag_status(slug?)is the canonical completion poll until the DAG isroot_satisfiedor idle/not active. There is no durablequiescentstate; a stopped DAG with failed/unresolved blockers is reported descriptively.dag_stop(slug)stops a queued or running DAG; it is recovery, not rollback.- On successful root satisfaction the executor records inherited starting-worktree state, runs
git add -A, and creates a local checkpoint commit. That checkpoint is not publication and is not a DAGrunnode. dag_archive(slug, reason)retires a pending bundle intoartifacts/change-dags/archived/with a required reason and anARCHIVE.jsondisposition record. It is lifecycle cleanup: it does not require resolution, executability, root satisfaction, absence of failures, or QA. A running DAG must be stopped first; a queued DAG must be cancelled withdag_stop. Loadchange-dag-lifecyclefor the concise operating contract.
DD lifecycle
A DD may be archived through dd_archive only after every Change DAG bundle linked from its Related Documents (or referenced from its Change DAG section) has been retired into artifacts/change-dags/archived/ (artifact lifecycle). Retirement is not success: consult the Change DAG's ARCHIVE.json for the recorded outcome. dd_archive evaluates both linked Change DAG completion and any declared non-DAG prerequisite gate. A declared prerequisite must be satisfied or explicitly migrated before archival; ordinary DDs with no declared prerequisite are not subject to an invented prerequisite gate. Archival does not depend on independent Change-DAG QA or final_qa PASS. QA-before-publication remains enforced by the separate qa-push-manager publication gate.
Validation checklist
- [ ] Every required requirement maps to an owned semantic node.
- [ ] Each semantic node states a postcondition, not an action.
- [ ] Every semantic node is either locally resolved or an explicit unresolved semantic node.
- [ ] The graph is acyclic, reachable, and free of illegal exclusive-terminal structure (
editcomposable;create/remove/move/runexclusive direct terminals). - [ ] Exact work is authored against live source plus applicable accepted lower DAG patches.
- [ ] No
GRAPH.json, task plan, phase letter, orCONTRACTS.mdauthority is created. - [ ]
dag_validatereports the DAG as schema-valid (and executable when execution is intended). - [ ]
dag_construction_statereports completion anddag_validateconfirms resolved before construction is declared complete.
References
file://config/skills/decomposing-design-documents/references/subagent-protocol.md— Change DAG authoring and handoff protocol.file://config/skills/decomposing-design-documents/references/semantic-generation.md— canonical initial semantic-graph derivation procedure.file://config/skills/dispatching-agents/references/change-dag-author.md— author dispatch contract.file://config/skills/dispatching-agents/references/change-dag-worker.md— bounded opaque/session-bound Worker dispatch contract (internal to the controller).file://config/skills/dispatching-agents/references/change-dag-reviewer.md— read-only review dispatch contract.file://artifacts/SkyScow_Change_DAG_Agents.md— Change DAG agent construction protocol.file://artifacts/SkyScow_Change_DAG_Toolset.md— Change DAG tool contract.file://artifacts/SkyScow_Change_Execution_Artifacts.md— Change DAG / Execution State / Work Log artifacts.
04 同仓库更多 Skills
unquoted-colon
暂无简介
quoted-description
Use when a plain scalar contains a colon: like this one.
block-description
Use when a plain scalar contains a colon: like this one.
work-routing
Canonical authority for who owns the next unit of work — direct work versus delegation, task tiers, bounded localization, the Change DAG size threshold, R&D evaluation routing, progressive research escalation, researcher scope signals, and QA/support owner selection. Use before choosing execution, investigation, design, or QA ownership; do not use to construct dispatch prompts, handoff schemas, or Change DAG/DD tool operation.
update-docs
Update project documentation to match code changes — generate codemaps, refresh READMEs, detect doc/code drift using AST analysis. Use when updating documentation after code changes, generating codemaps, verifying doc accuracy, or detecting stale documentation. Do NOT use for writing API reference docs from scratch (use doc-coauthoring) or for creating new skill files (use making-editing-skills).
skill-loading-system
Explain or troubleshoot OpenCode skill discovery, loading, permissions, availability, or prompt injection.