@abdullah-alnahas/claude-sdd 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +23 -1
- package/agents/planner.md +78 -0
- package/commands/sdd-autopilot.md +19 -7
- package/commands/sdd-execute.md +18 -0
- package/commands/sdd-mode.md +42 -0
- package/commands/sdd-orchestrate.md +103 -0
- package/commands/sdd-phase.md +1 -1
- package/commands/sdd-review.md +52 -18
- package/commands/sdd-verify.md +87 -0
- package/contexts/dev.md +25 -0
- package/contexts/research.md +26 -0
- package/contexts/review.md +25 -0
- package/hooks/hooks.json +14 -3
- package/hooks/scripts/compaction-counter.sh +31 -0
- package/hooks/scripts/post-edit-review.sh +11 -4
- package/hooks/scripts/session-init.sh +44 -3
- package/package.json +1 -1
- package/scripts/verify-commands.sh +2 -2
- package/scripts/verify-hooks.sh +30 -8
- package/scripts/verify-skills.sh +1 -1
- package/skills/architecture-aware/SKILL.md +4 -5
- package/skills/guardrails/SKILL.md +51 -5
- package/skills/guardrails/references/failure-patterns.md +5 -0
- package/skills/iterative-execution/SKILL.md +21 -6
- package/skills/iterative-execution/references/retrieval-pattern.md +65 -0
- package/skills/iterative-execution/references/review-prompts.md +69 -0
- package/skills/performance-optimization/SKILL.md +5 -4
- package/skills/spec-first/SKILL.md +4 -4
- package/skills/tdd-discipline/SKILL.md +23 -6
- package/skills/using-sdd/SKILL.md +82 -0
- package/skills/using-sdd/references/skill-creation-process.md +54 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: Spec-First Development
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
plan this out," "write a spec for this," or "let's design this first."
|
|
4
|
+
Use when starting a new project or feature, creating specs or plans, adopting an existing project,
|
|
5
|
+
or when the user says "I want to build something," "let's plan this out," "write a spec," or
|
|
6
|
+
"let's design this first." Use before any non-trivial implementation that lacks a spec.
|
|
8
7
|
---
|
|
9
8
|
|
|
10
9
|
# Spec-First Development
|
|
@@ -64,6 +63,7 @@ For existing projects, use the adoption flow instead of starting from scratch. S
|
|
|
64
63
|
|
|
65
64
|
- **architecture-aware** — for deeper architectural guidance during Stage 4
|
|
66
65
|
- **tdd-discipline** — for test planning from behavior specs (use `references/templates/test-plan.md`)
|
|
66
|
+
- **iterative-execution** — delivers features against the specs produced here
|
|
67
67
|
- **guardrails** — enforces spec-first as a pre-implementation check
|
|
68
68
|
|
|
69
69
|
## References
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: TDD Discipline
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"fix this bug," or "debug this."
|
|
4
|
+
Use when writing tests, adding test coverage, fixing bugs, debugging, or when any new code needs
|
|
5
|
+
to be written. Use when the user says "write tests," "add tests," "fix this bug," "debug this,"
|
|
6
|
+
or "how should I test this?"
|
|
8
7
|
---
|
|
9
8
|
|
|
10
9
|
# TDD Discipline
|
|
11
10
|
|
|
12
11
|
Tests are not an afterthought — they are the first expression of intent. Write the test that describes the behavior, watch it fail, then write the minimum code to make it pass.
|
|
13
12
|
|
|
13
|
+
## Spirit vs. Letter
|
|
14
|
+
|
|
15
|
+
The spirit of TDD is: **know what correct behavior looks like before writing the code.** The Red/Green/Refactor cycle is the mechanism, but the principle is that you define "done" before you start. If a situation genuinely doesn't benefit from a test-first approach (see "When TDD Is Overhead" below), skip the mechanism — but never skip the principle of defining expected behavior first.
|
|
16
|
+
|
|
14
17
|
## Red → Green → Refactor
|
|
15
18
|
|
|
16
19
|
1. **Red**: Write a failing test that describes the desired behavior
|
|
@@ -19,6 +22,21 @@ Tests are not an afterthought — they are the first expression of intent. Write
|
|
|
19
22
|
|
|
20
23
|
This cycle applies at every level: unit, integration, e2e.
|
|
21
24
|
|
|
25
|
+
## Rationalization Red Flags
|
|
26
|
+
|
|
27
|
+
These thoughts mean STOP — you're about to skip TDD:
|
|
28
|
+
|
|
29
|
+
| Thought | Reality |
|
|
30
|
+
|---------|---------|
|
|
31
|
+
| "I'll write tests after the code works" | That's test-after, not TDD. Write the test first. |
|
|
32
|
+
| "This is too simple to need a test" | Simple code with no test becomes complex code with no test. |
|
|
33
|
+
| "I know this works, I'll just verify manually" | Manual verification doesn't persist. Tests do. |
|
|
34
|
+
| "The test is obvious, I'll skip to code" | If it's obvious, it takes 30 seconds to write. Do it. |
|
|
35
|
+
| "I need to see the code structure first" | Write the test to discover the structure. That's the point. |
|
|
36
|
+
| "This is just a refactor, tests already pass" | Run the tests. Confirm they pass. Then refactor. |
|
|
37
|
+
| "Writing a test for this would be too complex" | If you can't test it, you can't verify it. Simplify the design. |
|
|
38
|
+
| "I'll add tests in the next iteration" | Next iteration never comes. Write them now. |
|
|
39
|
+
|
|
22
40
|
## Relationship to Iterative Execution
|
|
23
41
|
|
|
24
42
|
TDD is the **inner discipline** — how you write each piece of code. Iterative execution is the **outer cycle** — how you deliver a complete feature against a spec. They are complementary: TDD ensures correctness at the unit level; iterative execution ensures spec satisfaction at the feature level. See the **iterative-execution** skill for the full outer cycle.
|
|
@@ -50,13 +68,12 @@ Code: FormHandler.submit()
|
|
|
50
68
|
|
|
51
69
|
This chain ensures nothing is built without a reason and nothing specified goes untested. If a test has no spec criterion, either add the criterion to the spec or question whether the test is needed. If a spec criterion has no test, that is a finding — even if the code works.
|
|
52
70
|
|
|
53
|
-
## References
|
|
54
|
-
|
|
55
71
|
## Related Skills
|
|
56
72
|
|
|
57
73
|
- **iterative-execution** — the outer delivery cycle that uses TDD internally
|
|
58
74
|
- **spec-first** — produces behavior specs that drive test design (see `spec-first/references/templates/test-plan.md`)
|
|
59
75
|
- **guardrails** — enforces TDD during implementation
|
|
76
|
+
- **performance-optimization** — uses TDD to preserve correctness during optimization
|
|
60
77
|
|
|
61
78
|
## References
|
|
62
79
|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Using SDD
|
|
3
|
+
description: >
|
|
4
|
+
Use at the start of every session and before every response to determine which SDD skills apply.
|
|
5
|
+
This is the meta-skill — it teaches skill discovery and invocation discipline.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Using SDD Skills
|
|
9
|
+
|
|
10
|
+
You have access to SDD (Spec-Driven Development) skills that enforce development discipline. **Check for applicable skills before every response.**
|
|
11
|
+
|
|
12
|
+
## The Rule
|
|
13
|
+
|
|
14
|
+
**Invoke relevant skills BEFORE any response or action.** Even a 1% chance a skill might apply means you should check. If it turns out to be wrong for the situation, you don't need to use it.
|
|
15
|
+
|
|
16
|
+
## Available Skills
|
|
17
|
+
|
|
18
|
+
| Skill | When to Use |
|
|
19
|
+
|-------|-------------|
|
|
20
|
+
| **guardrails** | ANY coding task — implement, build, fix, refactor, add, change, modify |
|
|
21
|
+
| **spec-first** | New project/feature, creating specs/plans, adopting a project |
|
|
22
|
+
| **tdd-discipline** | Writing tests, adding coverage, fixing bugs, debugging |
|
|
23
|
+
| **iterative-execution** | Implementing a feature from spec, iterating to match requirements |
|
|
24
|
+
| **architecture-aware** | Structuring code, design patterns, component integration, ADRs |
|
|
25
|
+
| **performance-optimization** | Optimizing, profiling, speeding up, reducing resource usage |
|
|
26
|
+
|
|
27
|
+
## Skill Priority Order
|
|
28
|
+
|
|
29
|
+
When multiple skills apply, use this order:
|
|
30
|
+
|
|
31
|
+
1. **Guardrails first** — always active for any coding task. This is the discipline layer.
|
|
32
|
+
2. **Process skills second** (spec-first, tdd-discipline, iterative-execution) — these determine HOW to approach the task.
|
|
33
|
+
3. **Domain skills third** (architecture-aware, performance-optimization) — these provide specialized guidance.
|
|
34
|
+
|
|
35
|
+
## Rationalization Red Flags
|
|
36
|
+
|
|
37
|
+
These thoughts mean STOP — you're rationalizing skipping a skill:
|
|
38
|
+
|
|
39
|
+
| Thought | Reality |
|
|
40
|
+
|---------|---------|
|
|
41
|
+
| "This is just a simple question" | Questions about code are tasks. Check guardrails. |
|
|
42
|
+
| "I need more context first" | Skill check comes BEFORE exploration. |
|
|
43
|
+
| "Let me explore the codebase first" | Skills tell you HOW to explore. Check first. |
|
|
44
|
+
| "I can just do this quickly" | Quick work is where discipline matters most. |
|
|
45
|
+
| "This doesn't need a formal skill" | If a skill exists for this task type, use it. |
|
|
46
|
+
| "I remember the skill" | Skills evolve. Read the current version. |
|
|
47
|
+
| "This doesn't count as implementation" | If you're changing code, guardrails apply. |
|
|
48
|
+
| "The skill is overkill" | Simple things become complex. Use it. |
|
|
49
|
+
| "I'll just do this one thing first" | Check BEFORE doing anything. |
|
|
50
|
+
| "This feels productive" | Undisciplined action wastes time. Skills prevent this. |
|
|
51
|
+
| "The user said to skip guardrails" | Only `/sdd-yolo` disables guardrails. Verbal requests don't count. |
|
|
52
|
+
| "I already know what to do" | Knowing the task ≠ following the discipline. |
|
|
53
|
+
|
|
54
|
+
## Context Modes
|
|
55
|
+
|
|
56
|
+
SDD supports three context modes that adjust which guardrails are active. Switch with `/sdd-mode <mode>`.
|
|
57
|
+
|
|
58
|
+
| Mode | Pre-Implementation | Completion Review | Scope Guard | Use For |
|
|
59
|
+
|------|-------------------|-------------------|-------------|---------|
|
|
60
|
+
| **dev** (default) | Active | Active | Strict | Building, implementing, fixing |
|
|
61
|
+
| **review** | Skipped | Active | Normal | Code review, auditing, verification |
|
|
62
|
+
| **research** | Skipped | Skipped | Relaxed | Exploring, investigating, prototyping |
|
|
63
|
+
|
|
64
|
+
## Skill Classification
|
|
65
|
+
|
|
66
|
+
**Rigid skills** (follow exactly, don't adapt away discipline):
|
|
67
|
+
- guardrails
|
|
68
|
+
- tdd-discipline
|
|
69
|
+
|
|
70
|
+
**Flexible skills** (adapt principles to context):
|
|
71
|
+
- spec-first
|
|
72
|
+
- architecture-aware
|
|
73
|
+
- iterative-execution
|
|
74
|
+
- performance-optimization
|
|
75
|
+
|
|
76
|
+
## Spirit vs. Letter
|
|
77
|
+
|
|
78
|
+
Follow the **spirit** of each skill, not just its checklist. The goal is disciplined development that produces correct, simple, spec-compliant code. If following a checklist item mechanically would produce worse results than thoughtful application of the principle behind it, follow the principle. But this is never an excuse to skip steps — it's a reason to apply them thoughtfully.
|
|
79
|
+
|
|
80
|
+
## References
|
|
81
|
+
|
|
82
|
+
See: `references/skill-creation-process.md`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Skill Creation Process
|
|
2
|
+
|
|
3
|
+
Creating new SDD skills follows a RED/GREEN/REFACTOR approach — the same TDD discipline applied to the skills themselves.
|
|
4
|
+
|
|
5
|
+
## RED: Identify the Failure
|
|
6
|
+
|
|
7
|
+
Before writing a skill, you need evidence of a failure pattern:
|
|
8
|
+
|
|
9
|
+
1. **Observe the failure** — identify a specific, repeatable behavior problem (e.g., the agent skips verification, over-engineers, ignores specs)
|
|
10
|
+
2. **Document the failure** — write down exactly what went wrong, with concrete examples
|
|
11
|
+
3. **Pressure test** — verify this isn't a one-off. Does it happen across different tasks, projects, or prompts?
|
|
12
|
+
|
|
13
|
+
If you can't reproduce the failure consistently, you don't need a skill yet. You need more data.
|
|
14
|
+
|
|
15
|
+
## GREEN: Write the Minimal Skill
|
|
16
|
+
|
|
17
|
+
Write the smallest skill that addresses the failure:
|
|
18
|
+
|
|
19
|
+
1. **Frontmatter** — name + CSO-format description ("Use when..." with trigger conditions only)
|
|
20
|
+
2. **One core principle** — the single behavioral change needed
|
|
21
|
+
3. **Detection** — how the agent recognizes it's about to fail
|
|
22
|
+
4. **Response** — what the agent should do instead
|
|
23
|
+
5. **Rationalization table** — 4-8 entries mapping excuses to counters
|
|
24
|
+
|
|
25
|
+
The skill should be under 500 words at this stage. If it's longer, you're solving too many problems at once.
|
|
26
|
+
|
|
27
|
+
## REFACTOR: Plug Loopholes
|
|
28
|
+
|
|
29
|
+
Deploy the minimal skill and observe:
|
|
30
|
+
|
|
31
|
+
1. **Does the agent follow it?** If not, the trigger conditions in the description may be wrong — fix them.
|
|
32
|
+
2. **Does the agent rationalize around it?** Add entries to the rationalization table for each observed excuse.
|
|
33
|
+
3. **Does it create new problems?** If the skill causes over-correction (e.g., too rigid in cases where flexibility is needed), add "When This Skill Is Overhead" section.
|
|
34
|
+
4. **Is it too broad?** Split into focused skills. One skill should address one failure pattern cluster.
|
|
35
|
+
|
|
36
|
+
## Checklist
|
|
37
|
+
|
|
38
|
+
Before shipping a new skill:
|
|
39
|
+
|
|
40
|
+
- [ ] Failure pattern documented with 3+ examples
|
|
41
|
+
- [ ] Description uses "Use when..." CSO format
|
|
42
|
+
- [ ] Rationalization table has 4+ entries
|
|
43
|
+
- [ ] Skill body under 3000 words
|
|
44
|
+
- [ ] References directory exists (even if empty initially)
|
|
45
|
+
- [ ] Added to `using-sdd` skill table
|
|
46
|
+
- [ ] Added to `scripts/verify-skills.sh` SKILLS array
|
|
47
|
+
- [ ] Rigid vs. flexible classification documented in `using-sdd`
|
|
48
|
+
|
|
49
|
+
## Anti-Patterns
|
|
50
|
+
|
|
51
|
+
- **Speculative skills**: Writing a skill for a problem you haven't observed yet
|
|
52
|
+
- **Kitchen-sink skills**: Cramming multiple unrelated concerns into one skill
|
|
53
|
+
- **Checklist-only skills**: Lists of rules without detection/response guidance
|
|
54
|
+
- **Aspirational skills**: Describing ideal behavior without addressing the specific failure that motivated the skill
|