4d-spec
Orchestrator that merges the 4D Paradigm with Spec-Driven Development (SDD). Classifies task complexity and activates SDD phases only when warranted. Use at the START of any implementation task to determine the right workflow depth.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 18
- Forks
- 6
01 前言 Front Matter
- name
- 4d-spec
- triggers
- [ "new feature", "implementation task", "build feature", "spec driven", "4d+s", "complex change" ]
- description
- Orchestrator that merges the 4D Paradigm with Spec-Driven Development (SDD). Classifies task complexity and activates SDD phases only when warranted. Use at the START of any implementation task to determine the right workflow depth.
02 资源文件 1
- 参考文档skill.json338 B
03 SKILL.md 正文
4D+S: Spec-Driven 4D Orchestrator
Merges the Octopus 4D Paradigm with SDD (Spec-Driven Development) to get the best of both worlds.
When to Activate
This skill activates at the START of any task that involves writing or modifying code. It classifies complexity and routes to the appropriate workflow depth.
Complexity Classifier
Assess the task against these criteria:
| Signal | Points |
|---|---|
| Touches 1-3 files | 0 |
| Touches 4-10 files | +2 |
| Touches 10+ files | +4 |
| New feature (not a fix) | +2 |
| Architectural decision required | +3 |
| Multiple modules/services affected | +2 |
| User explicitly requests spec | +5 |
| Database schema changes | +1 |
| New API endpoints | +1 |
Score → Workflow:
| Score | Level | Workflow |
|---|---|---|
| 0-2 | TRIVIAL | 4D only (Describe → Gate → Execute → Diligent → Disclose) |
| 3-5 | MEDIUM | 4D + plan.md (task checklist before Gate) |
| 6+ | LARGE | 4D + full SDD (feature.md + plan.md + analyze + implement ⇄ converge + review.md + archive) |
Workflow by Level
TRIVIAL (score 0-2)
Standard 4D: no SDD artifacts needed:
- 1D Describe: state what and why (1-3 sentences)
- 2D Delegate: run delegate-check
- 4D Gate: Change Manifest table
- Execute
- 3D Diligent: build/lint/test
- 4D Disclose: impact + side effects
MEDIUM (score 3-5)
4D + task checklist:
- 1D Describe: state what and why
- 2D Delegate: run delegate-check
- 2S Plan: generate
plan.mdwith numbered tasks (cap: 20 tasks max)- Use
/sdd-planformat but lighter: tasks need no[AC-##]brackets - Plan lives in working directory, deleted after completion
- Use
- 4D Gate: Change Manifest + plan.md summary
- Execute: follow plan tasks in order, mark done
- 3D Diligent: build/lint/test
- 4D Disclose: impact + side effects
- Clean up: delete plan.md (git tracks the actual changes)
LARGE (score 6+)
Full 4D+SDD. "Done" is a verdict computed against the spec by a pass that did not write the code, never a claim by the builder:
- 1D Describe + Spec:
/sdd-featureproduces an ears-1feature.md(EARS criteria, Glossary, at most 3 open markers)- Resolve markers with
/sdd-refine, one question at a time
- Resolve markers with
- 2D Delegate: run delegate-check (loads relevant agents/skills)
- 2S Plan:
/sdd-planrefuses while markers remain, then writesplan.mdin the task grammarT## [AC-##] <path>: <action> - 2S Analyze:
/sdd-analyzeas an independent verifier subagent.FIX-FIRSTsends you back to step 1 or 3 - 4D Gate: Change Manifest + spec summary + plan summary + analyze verdict
- Execute:
/sdd-implement(follows plan, verifies each layer, grades nothing) - 3D Converge:
/sdd-convergeas an independent verifier subagent.GAPSappends a Convergence section toplan.md; go back to step 6. Loop untilCONVERGED - 3D Review:
/sdd-review(7 quality dimensions, reads the converge verdict) - 4D Disclose: impact radius + converge and review verdicts
- Archive:
/sdd-archiverequiresCONVERGEDand updatesdocs/project.md; the spec stays in its directory
Integration with Existing 4D
| 4D Phase | SDD Enhancement | When |
|---|---|---|
| 1D Describe | Becomes feature.md with ACs and edge cases |
LARGE only |
| 2D Delegate | No change: delegate-check still runs | Always |
| 4D Gate | Manifest now INCLUDES plan.md task list | MEDIUM+ |
| 3D Diligent | Adds the converge loop (done = verdict) + 7-dimension quality review | LARGE only |
| 4D Disclose | Adds archive for institutional memory | LARGE only |
Key Adaptations for Solo Operator
- Max 20 planned tasks in any plan.md (tasks above the first
## Convergencesection): if SDD generates more, consolidate - No docs/project.md required: we already have
.claude/CLAUDE.mdper arm - A LARGE spec is born in
docs/specs/<yyyymmddHHMM>-<feature-name>/and never moves: the converge verdict and the receipt are keyed on that path - review.md is optional for MEDIUM: only mandatory for LARGE
/sdd-yolomaps to our "hazlo directo" exception: full pipeline with single gate
Output Format
At task start, always report:
4D+S Classification: [TRIVIAL/MEDIUM/LARGE] (score: N)
Signals: [list matched signals]
Workflow: [which phases activate]
SDD skills: [which /sdd-* commands will be used, or "none"]
Quick Reference
| Want to... | Command |
|---|---|
| Classify a task | Read this skill's classifier |
| Write a spec | /sdd-feature |
| Refine a spec | /sdd-refine |
| Generate plan | /sdd-plan |
| Check spec against plan | /sdd-analyze |
| Implement from plan | /sdd-implement |
| Decide whether it is done | /sdd-converge |
| Review code quality | /sdd-review |
| Archive completed work | /sdd-archive |
| Full pipeline (one gate) | /sdd-yolo |
04 同仓库更多 Skills
yeet
Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).
wrangler
Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
workspace-skill-discovery
Discover and include ALL skills across the workspace — not just global ones. Use at the start of every session or when the user asks about available skills. Ensures project-level skills (under .claude/skills/ or skills/ in any repo) are never missed.
workers-best-practices
Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.
winui-app
Create, build and design WinUI 3 desktop apps with C# and the Windows App SDK following Microsoft's official guidance and CommunityToolkit. Covers XAML, navigation, theming, accessibility and deployment.
windows-brain-script-portability
Scripts in ~/.claude/scripts/ that run on a Windows brain: use the python3.cmd shim and not bare python3, and reconfigure stdout to UTF-8 if you print symbols. Use it when writing a brain script or triaging a Windows-only crash.