This file defines the recommended implementation order for Claude Code. Follow this order strictly. Do not redesign the architecture.
Read these files first:
- README.md
- manifest.yaml
- docs/fact-design/*.md
- protocols/*.md
- docs/fact/schemas/*.md
Produce a short summary of:
- command model
- skill model
- artifact layout
- schema rules
- refine loop
- sampling policy
- versioning policy
Do not implement yet.
Implement a minimal runtime skeleton with:
- command dispatcher
- skill loader
- prompt loader
- artifact writer
- repository state inspector
Do not implement advanced intelligence yet.
Implement init first.
Requirements:
- create required directories
- create missing default files
- do not overwrite existing user content
Required structure:
docs/fact/ schemas/ discovery/ review/ baseline/
docs/fact/review/ architect-feedback.md semantic-change-log.md
docs/fact/discovery/ sampling-report.md
Implement skills/repo-semantic-discovery.skill exactly in declared step order.
Requirements:
- follow step order exactly
- write every artifact
- apply versioning policy
- do not skip validation
- honor sampling mode and timeout
Discovery flow:
- repo-sampling.prompt
- repo-facts.prompt
- evidence-extraction.prompt
- validate-artifact.prompt
- domain-candidates.prompt
- repo-understanding.prompt
- validate-artifact.prompt
- knowledge-confidence.prompt
- review-summary.prompt
- apply artifact versioning
Implement skills/semantic-refinement.skill.
Requirements:
- always read latest versioned discovery artifacts
- patch sections instead of rewriting whole files
- preserve architect edits
- preserve evidence
- generate semantic-change-log.md
- only synthesize baseline after explicit acceptance
Refine flow:
- semantic-refine.patch.prompt
- semantic-change-log.prompt
- validate-artifact.prompt
- apply artifact versioning
- baseline-synthesis.prompt if accepted
Implement the orchestrator last.
Requirements:
- inspect current semantic state
- choose discover or refine
- do not run autonomous multi-round loops
- report current state and next recommended step
Routing logic:
- if no versioned discovery artifacts exist: run discovery skill
- elif no accepted baseline exists: run refinement skill
- else: report semantic baseline exists and wait for new architect feedback
Implement validation according to:
- protocols/artifact-validation.md
- prompts/validation/validate-artifact.prompt
Validation must check:
- required fields
- evidence presence
- confidence presence where required
- stable field names
Invalid artifact must not replace last valid artifact.
Implement sampling policy according to:
- protocols/sampling-policy.md
- prompts/discover/repo-sampling.prompt
Sampling modes:
- auto
- confirm
Timeout behavior:
- in auto mode, timeout switches to confirm mode
- emit sampling-report.md before continuing
Implement artifact versioning according to:
- protocols/artifact-versioning.md
Policy:
- keep latest 3 working versions by default
- keep accepted baseline versions
- do not delete explicitly checkpointed or accepted versions
Versioning applies to:
- discovery artifacts
- review artifacts
After implementation, run these scenarios:
- verify directory creation
- verify no overwrite
- verify sampling-report.md generated
- verify versioned discovery artifacts generated
- verify review-summary.md generated
- provide architect feedback
- verify patch update
- verify semantic-change-log.md generated
- verify baseline synthesis after acceptance
For each scenario, report:
- executed steps
- written files
- validation failures if any
At the end, produce a report with:
- fully implemented items
- partially implemented items
- unresolved gaps vs spec
- recommended next follow-up