Shadow Architecture
Set up and maintain a repository-owned .shadow/ graph as durable, reviewable
architecture memory. The repository's .shadow/README.md, declared index, and
declared schema remain authoritative. Read the
Shadow v2 reference contract when creating,
migrating, or changing the graph contract.
Scope
This skill owns:
- initial
.shadow/ setup and migration from the minimal convention;
- index, schema, identifier, relation, and compatibility maintenance;
- recording decisions after the required human approval;
- moving decisions through
observed, proposed, accepted, and
superseded;
- preserving accepted history by linked supersession; and
- rendering reviewed records into disposable derived output.
This skill does not autonomously discover candidate observations, invent
future-state architecture, or compare the graph with implementation for drift.
Hand those requests to shadow-observe, shadow-dream, or shadow-drift
respectively. Use codebase-exploration for a repository map and
documentation-maintenance for ordinary documentation work unrelated to the
.shadow/ contract.
Evidence Rules
- Separate verified evidence, inference, and unknowns in every record.
- Cite repository-relative code, tests, documentation, issues, pull requests,
or commits for material claims.
- Never invent historical intent or rationale. Store
unknown when it cannot
be verified.
- Treat approved decision records as historical artifacts. Do not silently
rewrite them to match current preferences.
- Treat candidate observations, future-state proposals, and drift reports as
inputs for review, not as accepted decisions.
- Treat rendered files as derived output, never as authority.
Workflow
1. Read Repository Authority
- Read workspace instructions before changing files.
- Read
.shadow/README.md first when it exists.
- Follow the index and schema locations declared there, even when they differ
from the reference layout.
- Inventory decision statuses, record kinds, identifiers, relations,
approvals, provenance, and derived output.
- Preserve valid repository-specific fields and older records unless an
approved migration explicitly changes them.
2. Classify the Request
Choose one or more bounded operations:
setup: create the minimal repository-owned graph and document its authority;
migrate: add v2 concepts without invalidating readable legacy records;
maintain: repair or evolve indexes, schemas, relations, or compatibility;
record: add or transition a decision with the required approval evidence;
supersede: replace accepted history with linked new history; or
render: generate a view from reviewed records without changing them.
Do not broaden a maintenance request into repository observation, architecture
ideation, or drift analysis.
3. Set Up or Migrate
- When
.shadow/ is absent, create the smallest useful layout: a README,
declared index, declared schema, and decision-record location.
- Document which files are authoritative, which are inputs awaiting review,
and which are derived.
- Define stable IDs, record kinds, lifecycle states, relation types, evidence
fields, approval fields, and run provenance.
- For an existing graph, preserve its current paths and readable record shape.
- Add aliases, optional fields, schema unions, or a version marker before
requiring destructive rewrites.
- Record migration provenance and unresolved compatibility gaps.
- Require human approval before changing the authoritative contract or
promoting any record to
accepted.
4. Maintain the Contract
- Make the schema accept every record that the README promises is supported.
- Keep the index synchronized with authoritative records and their statuses.
- Keep IDs stable and relation targets resolvable.
- Preserve unknown values instead of replacing them with guesses.
- Retain run, approval, and source provenance through format changes.
- Make derived output regenerable and exclude it from authority decisions.
- Report incompatible legacy records instead of silently dropping fields.
5. Record a Decision
- Identify the reviewed input and the evidence supporting the decision.
- Create a stable ID and a present-tense statement.
- Record rationale only when verified; otherwise mark it
unknown.
- Record explicit evidence, inference, unknowns, anchors, relations, source
provenance, and approval state.
- Use
observed for an evidence-supported description of current
architecture and proposed for a not-yet-adopted decision.
- Promote to
accepted only with recorded human approval.
- Update the authoritative index and schema-compatible record together.
Candidate observations from shadow-observe, future-state proposals from
shadow-dream, and drift reports from shadow-drift remain their original
record kinds until reviewed. Approval may produce or update a decision; it does
not retroactively turn the source artifact into an accepted decision.
6. Supersede Accepted History
- Never overwrite the substance of an accepted decision to express a new
choice.
- Create a new decision with its own evidence, rationale, approval, and ID.
- Link the new record to the old one with
supersedes.
- Mark the old record
superseded and link it to the replacement.
- Preserve the old statement, rationale, evidence, approval, and provenance.
- Update the index atomically so both records and their relationship remain
visible.
7. Render Reviewed Records
- Read only authoritative, reviewed records and indexes.
- Exclude unapproved candidates unless the requested view explicitly labels
them as unapproved inputs.
- Write output under the repository-declared derived location.
- Record generator identity or command, source record IDs, source revisions or
hashes when available, and generation time.
- Mark the output as derived and disposable.
- Do not alter decision text, lifecycle status, approval, evidence, or
rationale while rendering.
Approval Gates
Stop for human approval before:
- promoting a decision to
accepted;
- changing an accepted decision's meaning;
- superseding accepted history;
- changing the authoritative README, index, or schema contract incompatibly; or
- treating a candidate observation, future-state proposal, or drift report as a
decision.
Mechanical index synchronization and regeneration of already-reviewed derived
output do not require a new architecture approval when repository policy allows
them.
Validation
- Run the repository-declared
.shadow/ validator when one exists.
- Otherwise parse the declared machine-readable files.
- Check unique IDs, supported kinds and statuses, relation targets, required
approval fields, provenance fields, and index-to-record agreement.
- Check that evidence and anchor references use the repository's declared
conventions and that missing rationale remains explicit.
- Confirm legacy records remain readable after migration.
- Confirm derived output identifies its sources and is not indexed as an
authoritative decision.
- Review the diff for invented rationale, silent history rewrites, and
accidental observation, dreaming, or drift work.
Response
Report the operation performed, authoritative files changed, decision lifecycle
transitions, approvals used or still required, compatibility preserved, records
rendered, validation commands and results, unknowns, and any handoff needed to a
sibling skill.
1---2name: shadow-architecture3description: Sets up and maintains a repository-owned .shadow graph, manages approved decision lifecycles and index or schema compatibility, supersedes accepted history, and renders reviewed records. Use when creating or migrating .shadow, recording approved architecture decisions, maintaining its index or schema, superseding accepted decisions, or generating derived views from reviewed records; not for discovering observations, imagining future states, or checking drift.4license: MIT5---67# Shadow Architecture89Set up and maintain a repository-owned `.shadow/` graph as durable, reviewable10architecture memory. The repository's `.shadow/README.md`, declared index, and11declared schema remain authoritative. Read the12[Shadow v2 reference contract](references/shadow-conventions.md) when creating,13migrating, or changing the graph contract.1415## Scope1617This skill owns:1819* initial `.shadow/` setup and migration from the minimal convention;20* index, schema, identifier, relation, and compatibility maintenance;21* recording decisions after the required human approval;22* moving decisions through `observed`, `proposed`, `accepted`, and23 `superseded`;24* preserving accepted history by linked supersession; and25* rendering reviewed records into disposable derived output.2627This skill does not autonomously discover candidate observations, invent28future-state architecture, or compare the graph with implementation for drift.29Hand those requests to `shadow-observe`, `shadow-dream`, or `shadow-drift`30respectively. Use `codebase-exploration` for a repository map and31`documentation-maintenance` for ordinary documentation work unrelated to the32`.shadow/` contract.3334## Evidence Rules35361. Separate verified evidence, inference, and unknowns in every record.372. Cite repository-relative code, tests, documentation, issues, pull requests,38 or commits for material claims.393. Never invent historical intent or rationale. Store `unknown` when it cannot40 be verified.414. Treat approved decision records as historical artifacts. Do not silently42 rewrite them to match current preferences.435. Treat candidate observations, future-state proposals, and drift reports as44 inputs for review, not as accepted decisions.456. Treat rendered files as derived output, never as authority.4647## Workflow4849### 1. Read Repository Authority50511. Read workspace instructions before changing files.522. Read `.shadow/README.md` first when it exists.533. Follow the index and schema locations declared there, even when they differ54 from the reference layout.554. Inventory decision statuses, record kinds, identifiers, relations,56 approvals, provenance, and derived output.575. Preserve valid repository-specific fields and older records unless an58 approved migration explicitly changes them.5960### 2. Classify the Request6162Choose one or more bounded operations:6364* `setup`: create the minimal repository-owned graph and document its authority;65* `migrate`: add v2 concepts without invalidating readable legacy records;66* `maintain`: repair or evolve indexes, schemas, relations, or compatibility;67* `record`: add or transition a decision with the required approval evidence;68* `supersede`: replace accepted history with linked new history; or69* `render`: generate a view from reviewed records without changing them.7071Do not broaden a maintenance request into repository observation, architecture72ideation, or drift analysis.7374### 3. Set Up or Migrate75761. When `.shadow/` is absent, create the smallest useful layout: a README,77 declared index, declared schema, and decision-record location.782. Document which files are authoritative, which are inputs awaiting review,79 and which are derived.803. Define stable IDs, record kinds, lifecycle states, relation types, evidence81 fields, approval fields, and run provenance.824. For an existing graph, preserve its current paths and readable record shape.835. Add aliases, optional fields, schema unions, or a version marker before84 requiring destructive rewrites.856. Record migration provenance and unresolved compatibility gaps.867. Require human approval before changing the authoritative contract or87 promoting any record to `accepted`.8889### 4. Maintain the Contract90911. Make the schema accept every record that the README promises is supported.922. Keep the index synchronized with authoritative records and their statuses.933. Keep IDs stable and relation targets resolvable.944. Preserve unknown values instead of replacing them with guesses.955. Retain run, approval, and source provenance through format changes.966. Make derived output regenerable and exclude it from authority decisions.977. Report incompatible legacy records instead of silently dropping fields.9899### 5. Record a Decision1001011. Identify the reviewed input and the evidence supporting the decision.1022. Create a stable ID and a present-tense statement.1033. Record rationale only when verified; otherwise mark it `unknown`.1044. Record explicit evidence, inference, unknowns, anchors, relations, source105 provenance, and approval state.1065. Use `observed` for an evidence-supported description of current107 architecture and `proposed` for a not-yet-adopted decision.1086. Promote to `accepted` only with recorded human approval.1097. Update the authoritative index and schema-compatible record together.110111Candidate observations from `shadow-observe`, future-state proposals from112`shadow-dream`, and drift reports from `shadow-drift` remain their original113record kinds until reviewed. Approval may produce or update a decision; it does114not retroactively turn the source artifact into an accepted decision.115116### 6. Supersede Accepted History1171181. Never overwrite the substance of an accepted decision to express a new119 choice.1202. Create a new decision with its own evidence, rationale, approval, and ID.1213. Link the new record to the old one with `supersedes`.1224. Mark the old record `superseded` and link it to the replacement.1235. Preserve the old statement, rationale, evidence, approval, and provenance.1246. Update the index atomically so both records and their relationship remain125 visible.126127### 7. Render Reviewed Records1281291. Read only authoritative, reviewed records and indexes.1302. Exclude unapproved candidates unless the requested view explicitly labels131 them as unapproved inputs.1323. Write output under the repository-declared derived location.1334. Record generator identity or command, source record IDs, source revisions or134 hashes when available, and generation time.1355. Mark the output as derived and disposable.1366. Do not alter decision text, lifecycle status, approval, evidence, or137 rationale while rendering.138139## Approval Gates140141Stop for human approval before:142143* promoting a decision to `accepted`;144* changing an accepted decision's meaning;145* superseding accepted history;146* changing the authoritative README, index, or schema contract incompatibly; or147* treating a candidate observation, future-state proposal, or drift report as a148 decision.149150Mechanical index synchronization and regeneration of already-reviewed derived151output do not require a new architecture approval when repository policy allows152them.153154## Validation1551561. Run the repository-declared `.shadow/` validator when one exists.1572. Otherwise parse the declared machine-readable files.1583. Check unique IDs, supported kinds and statuses, relation targets, required159 approval fields, provenance fields, and index-to-record agreement.1604. Check that evidence and anchor references use the repository's declared161 conventions and that missing rationale remains explicit.1625. Confirm legacy records remain readable after migration.1636. Confirm derived output identifies its sources and is not indexed as an164 authoritative decision.1657. Review the diff for invented rationale, silent history rewrites, and166 accidental observation, dreaming, or drift work.167168## Response169170Report the operation performed, authoritative files changed, decision lifecycle171transitions, approvals used or still required, compatibility preserved, records172rendered, validation commands and results, unknowns, and any handoff needed to a173sibling skill.