A specification system for creating complete, unambiguous requirements documents (MRD/PRD) that can be executed autonomously by AI development systems.
Dark Factory addresses the gap between human intent and AI execution by providing:
- Structured spec formats - Go types that generate JSON Schema for MRD, PRD, Constitution, and Roadmap documents
- Checkpoint system - Mid-execution validation points with discovery handling
- Uncertainty markers - Explicit flagging of unknowns in requirements
- Evaluation integration - GO/NO-GO gating via structured evaluation
- CLI tooling -
dfspecfor managing specs through their lifecycle
# Install the CLI
go install github.com/plexusone/dark-factory-project-spec/cmd/dfspec@latest
# Or build from source
git clone https://github.com/plexusone/dark-factory-project-spec.git
cd dark-factory-project-spec
make install-cli# Initialize a new feature in backlog
dfspec init user-authentication
# List all features
dfspec list
# Move feature to active when ready to work
dfspec move user-authentication active
# Validate specs
dfspec validate user-authentication
# Generate human-readable roadmap
dfspec generate roadmapspecs/
├── roadmap.json # Feature priorities and status
├── constitution.json # Organization-wide standards
├── active/ # Features being worked on
│ └── {feature}/
│ ├── mrd.json # Market Requirements Document
│ ├── prd.json # Product Requirements Document
│ └── evaluation.json
├── backlog/ # Planned features
├── completed/ # Shipped features
└── archived/ # Cancelled/superseded features
docs/
└── design/
└── {feature}/ # Human-readable docs per feature
Organization-wide source of truth for:
- Tech stack (languages, frameworks, databases)
- Architecture standards (patterns, principles, API design)
- File organization (specs/, docs/ structure)
- Quality standards (testing, code review)
- Security standards (auth, data protection)
- Process standards (branching, releases)
High-level business requirements:
- Problem statement (current state, desired state, impact)
- Target users (personas, needs, pain points)
- Success metrics (KPIs, measurement methods)
- High-level requirements (must-have, should-have, etc.)
- Constraints and non-goals
Detailed implementation requirements:
- Functional requirements with acceptance criteria
- Non-functional requirements (performance, security)
- Test hints for comprehensive coverage
- Checkpoint references for validation gates
- Uncertainty markers for unknowns
Feature tracking with status-based organization:
- Active - Currently being implemented
- Backlog - Planned, prioritized by importance
- Completed - Shipped and released
- Archived - Cancelled with reason
| Command | Description |
|---|---|
dfspec list [status] |
List features, optionally filtered by status |
dfspec init <feature> |
Create new feature in backlog with MRD template |
dfspec move <feature> <status> |
Move feature between statuses |
dfspec validate [feature] |
Validate specs against schemas |
dfspec generate roadmap |
Generate ROADMAP.md from roadmap.json |
dfspec generate index [feature] |
Generate index.md for feature docs |
Two Claude Code skills are provided:
Guides users through creating complete MRD/PRD specs interactively.
Executes approved PRD specs autonomously with checkpoint-based human oversight.
# Install the skills
make install-skill
# Use in Claude Code
/dfspec-guide # Create a new spec
/dfspec-exec # Execute an approved specThe skill provides:
- Interactive interview for gathering requirements
- Probing questions for edge cases and unknowns
- Draft generation in JSON format
- Evaluation against completeness rubric
- Human review gate before development
# Build
make build
# Test
make test
# Lint
make lint
# Generate JSON schemas from Go types
make generate-schema
# Validate examples against schemas
make validate-examplesGo types are the source of truth. JSON schemas are generated:
go run cmd/generate-schema/main.goSchemas are output to schemas/:
mrd.schema.jsonprd.schema.jsonconstitution.schema.jsonroadmap.schema.jsonevaluation.schema.json
Specs define validation points where execution pauses:
{
"checkpoints": [
{
"id": "CP-001",
"after_requirements": ["FR-001", "FR-002"],
"validation": "human_review",
"pause_on_discovery": true
}
]
}Requirements can flag unknowns explicitly:
{
"id": "FR-003",
"description": "Handle concurrent uploads",
"uncertainty": "high",
"uncertainty_reason": "Concurrency model not specified",
"discovery_prompt": "What happens when two users upload simultaneously?"
}Individual specs can override constitution defaults with justification:
{
"constitution_ref": "specs/constitution.json",
"constitution_overrides": {
"overrides": [
{
"path": "tech_stack.languages",
"original_value": "Go",
"override_value": "Rust",
"justification": "Performance-critical component requires Rust"
}
]
}
}MIT