GitHub Spec Kit Workflow
TraderX baseline generation now follows a root-canonical GitHub Spec Kit flow.
Canonical Locations​
.specify/**for constitution and templatesspecs/001-baseline-uncontainerized-parity/**for baseline requirements, stories, plan, tasks, and contractspipeline/**for generation and validation orchestration
Each state pack under specs/NNN-* must include:
research.mddata-model.mdquickstart.md
Convergence states must also include:
system/convergence-rationale.md
Browse in docs:
/specs/baseline-uncontainerized-parity/specs/baseline-uncontainerized-parity/system/system-requirements/specs/baseline-uncontainerized-parity/system/user-stories/specs/baseline-uncontainerized-parity/system/acceptance-criteria/specs/baseline-uncontainerized-parity/system/requirements-traceability/specs/baseline-uncontainerized-parity/system/end-to-end-flows/specs/baseline-uncontainerized-parity/system/architecture/docs/spec-kit/state-docs/docs/learning/api/specify
Input Evidence For Requirements​
specs/001-baseline-uncontainerized-parity/system/architecture.model.jsonspecs/001-baseline-uncontainerized-parity/system/end-to-end-flows.mdspecs/001-baseline-uncontainerized-parity/system/system-requirements.mddocs/README.mdREADME.md
Baseline Generation Flow​
- Validate Spec Kit readiness and requirement coverage.
- Compile component manifests from Spec Kit artifacts.
- Synthesize generated components from manifest + templates.
- Start generated overlays and run smoke tests/parity checks.
Derived-State Generation Flow​
For states 002+, generation follows:
- Generate parent state output.
- Apply ordered patch set from
specs/<state>/generation/patches/*.patch. - Regenerate architecture docs and run state smoke checks.
Convergence-State Policy​
- Prefer new state proposals from the nearest suitable convergence state (
C0/C1/C2/C3). - Keep
previoussingle-parent for publish lineage. - Use
dottedParentsonly for convergence states. - If convergence-state metadata/content changes, update that state's
system/convergence-rationale.md. - Reference:
/docs/spec-kit/convergence-states
LLM Feature-Add Implementation Contract​
When implementing a new state delta with an LLM:
- Generate the parent state (
bash pipeline/generate-state.sh <parent-state-id>). - Make only the intended child-state edits against generated output.
- Capture patch set (
bash pipeline/create-state-patchset.sh <state-id> <parent-state-id> [target-path]). - Keep state hook as parent-generation +
apply-state-patchset.shonly. - Update
specs/<state>/generation/generation-hook.mdwith parent, patch path, and refresh commands. - Do not introduce or keep large file-payload heredoc generators for derived states.
Validation Commands​
bash pipeline/refresh-state-docs.sh --check
bash pipeline/validate-state-pack-artifacts.sh
./pipeline/speckit/validate-speckit-readiness.sh
./pipeline/speckit/verify-spec-expressiveness.sh
bash pipeline/speckit/compile-all-component-manifests.sh
./pipeline/validate-regeneration-readiness.sh
./pipeline/verify-spec-coverage.sh
Learning-path catalog policy:
catalog/state-catalog.jsonis the source for state lineage.- Derived artifacts are regenerated together by:
bash pipeline/refresh-state-docs.sh
- Derived artifacts include:
catalog/learning-paths.yamlcatalog/learning-paths.md/docs/learning-paths/docs/spec-kit/state-docs/docs/learning/index/docs/learning/state-*.md
Generation Commands​
Generate any state:
bash pipeline/generate-state.sh <state-id>
These commands also regenerate state architecture docs from specs/*/system/architecture.model.json.
State docs (/docs/spec-kit/state-docs) are generated from catalog/state-catalog.json.
Scaffold a new planned state pack:
bash pipeline/scaffold-state-pack.sh <NNN-state-name> --title "<Title>" --previous <prior-state-id> --track <prelude|baseline|architecture|nonfunctional|functional|devex>
Run the state-change playbook (refresh docs -> gates -> generate -> optional publish/push):
bash pipeline/state-playbook.sh --state <state-id> --publish-neighborhood --push-generated
Generated outputs:
generated/code/components/*-specfirstgenerated/manifests/*.manifest.jsongenerated/code/target-generated/**(assembled at startup)
Run generated baseline stack:
CORS_ALLOWED_ORIGINS=http://localhost:18093 ./scripts/start-base-uncontainerized-generated.sh
Run generated containerized stack (state 003):
./scripts/start-state-003-containerized-generated.sh
./scripts/status-state-003-containerized-generated.sh
./scripts/test-state-003-containerized.sh
./scripts/stop-state-003-containerized-generated.sh
Ingress endpoint: http://localhost:8080
Full Parity Gate​
Run end-to-end parity validation (generation + startup + all baseline smoke tests):
bash pipeline/speckit/run-full-parity-validation.sh
API Explorer​
npm --prefix website run start and npm --prefix website run build now generate OpenAPI docs on demand.
To regenerate explicitly:
npm --prefix website run gen:api-docs
Compare Generation Output​
To compare a single component generated output between a legacy script revision and current Spec Kit-driven generation:
bash pipeline/speckit/compare-component-generation.sh <component-id> <legacy-ref>
Example:
bash pipeline/speckit/compare-component-generation.sh reference-data HEAD
Iterating Learning-Path States​
After baseline parity is green:
- add FR/NFR deltas in the next feature pack under
specs/NNN-* - update contracts if interfaces change
- update and capture state patch set:
bash pipeline/create-state-patchset.sh <state-id> <parent-state-id> [target-path]
- rerun conformance + parity gates
This keeps each learning-path state reproducible from requirements instead of from copied source.