// Transform natural language requirements into mathematically verified specifications with proofs. Use when building new systems or features from requirements documents. Orchestrates 9 sub-skills to produce ADT specifications, type proofs, categorical architecture, API specs, and version migration strategies.
| name | system-architect |
| description | Transform natural language requirements into mathematically verified specifications with proofs. Use when building new systems or features from requirements documents. Orchestrates 9 sub-skills to produce ADT specifications, type proofs, categorical architecture, API specs, and version migration strategies. |
| allowed-tools | Read, Write, Bash |
| version | 1.0.0 |
Transform requirements from threads/engineering/{requirement}/ into complete mathematical specifications with proofs in artifacts/engineering/specifications/v{X}/.
threads/engineering/{requirement}/1-input.md - Natural language requirementsthreads/engineering/{requirement}/2-hypothesis.md - Technical feasibilitythreads/engineering/{requirement}/3-implication.md - Effort estimates, ROIthreads/engineering/{requirement}/4-decision.md - BUILD/DEFER/KILL verdictartifacts/engineering/specifications/
โโโ manifest.json # Content hashes (immutable)
โโโ v{X}/ # Versioned snapshot
โโโ requirements.adt # From adt-analyzer
โโโ types.curry-howard # From curry-howard-prover
โโโ architecture.categorical # From functor-generator + system-optimizer
โโโ api.openapi.json # OpenAPI 3.1 spec
โโโ services.spec.yaml # Service boundaries
โโโ state-machines.yaml # From state-machine-validator
โโโ versions.yaml # From version-compatibility-prover
When invoked, execute sub-skills in this order:
adt-analyzer: Parse requirements โ requirements.adt
Tenant ร ({Platform} + {AltPlatform}) โ 12 pathsalgebraic-structure-validator: Validate ADT correctness
requirements.adtfunctor-generator: Generate functors for each pattern
architecture.categorical (functor definitions)natural-transformation-engine: Version migrations
versions.yamlcurry-howard-prover: Type proofs
types.curry-howardsystem-optimizer: Apply algebraic laws
architecture.categoricalarchitecture-validator: Categorical law verification
proofs/architecture/validation-report.jsonstate-machine-validator: State transition proofs
state-machines.yaml + proofsversion-compatibility-prover: Migration correctness
versions.yaml# Create version directory
VERSION=$(date +%Y%m%d_%H%M%S)
mkdir -p artifacts/engineering/specifications/v${VERSION}
mkdir -p artifacts/engineering/proofs/architecture/{adt-validation,type-proofs,composition-proofs,functor-laws,natural-transformations,state-machine-proofs,version-compatibility}
# Store version in environment
echo "SPEC_VERSION=v${VERSION}" > /tmp/system-architect-session.env
# Invoke sub-skills sequentially
{baseDir}/scripts/orchestrate.py \
--phase 1 \
--requirement threads/engineering/{requirement} \
--output artifacts/engineering/specifications/v${VERSION}
The script will:
adt-analyzer โ Parse requirementsalgebraic-structure-validator โ Validate ADTfunctor-generator โ Generate functorsIf any sub-skill fails, stop and report error to human in ops/today.md.
{baseDir}/scripts/orchestrate.py \
--phase 2 \
--requirement threads/engineering/{requirement} \
--output artifacts/engineering/specifications/v${VERSION}
The script will:
4. Call natural-transformation-engine โ Version migrations
5. Call curry-howard-prover โ Type proofs
6. Call system-optimizer โ Optimize architecture
{baseDir}/scripts/orchestrate.py \
--phase 3 \
--requirement threads/engineering/{requirement} \
--output artifacts/engineering/specifications/v${VERSION}
The script will:
7. Call architecture-validator โ Validate laws (10K tests)
8. Call state-machine-validator โ Validate state machines
9. Call version-compatibility-prover โ Prove migrations
{baseDir}/scripts/generate_manifest.py \
--version v${VERSION} \
--output artifacts/engineering/specifications/manifest.json
Manifest format:
{
"version": "v20250120_143022",
"created_at": "2025-01-20T14:30:22Z",
"requirement": "multi-tenant-catalog-sync",
"files": {
"requirements.adt": "sha256:abc123...",
"types.curry-howard": "sha256:def456...",
"architecture.categorical": "sha256:ghi789..."
},
"validation": {
"laws_checked": 47,
"laws_passed": 47,
"property_tests": 10000
}
}
{baseDir}/scripts/generate_openapi.py \
--input artifacts/engineering/specifications/v${VERSION} \
--output artifacts/engineering/specifications/v${VERSION}/api.openapi.json
Add to threads/engineering/{requirement}/5-actions/action-1-architecture.md:
## Execution Log
**Status:** COMPLETE
**Version:** v{VERSION}
**Timestamp:** {ISO8601}
### Generated Artifacts
- โ
`requirements.adt` - 12 paths enumerated
- โ
`types.curry-howard` - All functions proven total
- โ
`architecture.categorical` - Functors + natural transformations
- โ
`api.openapi.json` - OpenAPI 3.1 specification
- โ
`services.spec.yaml` - Service boundaries
- โ
`state-machines.yaml` - State machines validated
- โ
`versions.yaml` - Migration strategies
### Validation Summary
- Algebraic laws: 47/47 passed
- Property tests: 10,000/10,000 passed
- Type proofs: All verified
- State machines: All reachable, deterministic
### Next Steps
Specifications ready for:
1. **backend-prover**: Generate Phase 1 maps (structural specifications)
2. **frontend-prover**: Generate client code
3. **infrastructure-prover**: Generate deployment configs
If any sub-skill fails:
ops/today.md:โ ๏ธ System Architect Failed: {sub-skill-name}
- Thread: threads/engineering/{requirement}/
- Error: {error message}
- Action: Review and retry/abort
โ Always execute sub-skills in order (dependencies) โ Validate each phase before proceeding โ Generate immutable manifest (content hashes) โ All proofs must pass before completion โ Store specifications in versioned snapshots (never overwrite)
โ Never skip validation steps โ Never proceed if proofs fail โ Never modify previous specification versions โ Never execute phases in parallel (strict ordering)
Specifications are complete when:
This SKILL.md provides orchestration logic. Sub-skill details are in:
{baseDir}/adt-analyzer/SKILL.md{baseDir}/algebraic-structure-validator/SKILL.md{baseDir}/functor-generator/SKILL.md{baseDir}/natural-transformation-engine/SKILL.md{baseDir}/curry-howard-prover/SKILL.md{baseDir}/system-optimizer/SKILL.md{baseDir}/architecture-validator/SKILL.md{baseDir}/state-machine-validator/SKILL.md{baseDir}/version-compatibility-prover/SKILL.mdLoad sub-skills as needed during orchestration.