@abdullah-alnahas/claude-sdd 0.1.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.
Files changed (44) hide show
  1. package/.claude-plugin/plugin.json +5 -0
  2. package/README.md +127 -0
  3. package/agents/critic.md +49 -0
  4. package/agents/security-reviewer.md +61 -0
  5. package/agents/simplifier.md +54 -0
  6. package/agents/spec-compliance.md +55 -0
  7. package/commands/sdd-adopt.md +74 -0
  8. package/commands/sdd-autopilot.md +131 -0
  9. package/commands/sdd-execute.md +72 -0
  10. package/commands/sdd-guardrails.md +41 -0
  11. package/commands/sdd-phase.md +46 -0
  12. package/commands/sdd-review.md +52 -0
  13. package/commands/sdd-yolo.md +40 -0
  14. package/hooks/hooks.json +50 -0
  15. package/hooks/scripts/post-edit-review.sh +45 -0
  16. package/hooks/scripts/session-init.sh +44 -0
  17. package/package.json +20 -0
  18. package/scripts/verify-commands.sh +59 -0
  19. package/scripts/verify-hooks.sh +74 -0
  20. package/scripts/verify-skills.sh +72 -0
  21. package/skills/architecture-aware/SKILL.md +43 -0
  22. package/skills/architecture-aware/references/adr-guide.md +53 -0
  23. package/skills/architecture-aware/references/anti-patterns.md +41 -0
  24. package/skills/architecture-aware/references/integration-patterns.md +42 -0
  25. package/skills/guardrails/SKILL.md +68 -0
  26. package/skills/guardrails/references/failure-patterns.md +63 -0
  27. package/skills/guardrails/references/pushback-guide.md +53 -0
  28. package/skills/iterative-execution/SKILL.md +65 -0
  29. package/skills/iterative-execution/references/completion-criteria.md +62 -0
  30. package/skills/iterative-execution/references/loop-patterns.md +47 -0
  31. package/skills/spec-first/SKILL.md +68 -0
  32. package/skills/spec-first/references/foundation-docs-guide.md +55 -0
  33. package/skills/spec-first/references/interactive-spec-process.md +85 -0
  34. package/skills/spec-first/references/project-adoption.md +58 -0
  35. package/skills/spec-first/references/templates/app-description.md +22 -0
  36. package/skills/spec-first/references/templates/architecture.md +26 -0
  37. package/skills/spec-first/references/templates/behavior-spec.md +28 -0
  38. package/skills/spec-first/references/templates/retrospective.md +19 -0
  39. package/skills/spec-first/references/templates/roadmap.md +23 -0
  40. package/skills/spec-first/references/templates/stack.md +27 -0
  41. package/skills/spec-first/references/templates/test-plan.md +25 -0
  42. package/skills/tdd-discipline/SKILL.md +55 -0
  43. package/skills/tdd-discipline/references/test-strategies.md +36 -0
  44. package/skills/tdd-discipline/references/traceability.md +53 -0
@@ -0,0 +1,22 @@
1
+ # App Description: [Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## Problem Statement
7
+ [What problem does this solve? Who has this problem?]
8
+
9
+ ## Users
10
+ [Who are the primary users? Secondary users?]
11
+
12
+ ## Core Value Proposition
13
+ [In one sentence, why does this exist?]
14
+
15
+ ## Success Criteria
16
+ [How do we know this is working? Measurable outcomes.]
17
+
18
+ ## Non-Goals
19
+ [What this explicitly does NOT do.]
20
+
21
+ ## Constraints
22
+ [Deadlines, budget, technical limitations, regulatory requirements.]
@@ -0,0 +1,26 @@
1
+ # Architecture: [Project Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## System Overview
7
+ [High-level description of how the system is structured.]
8
+
9
+ ## Components
10
+ [List major components and their responsibilities.]
11
+
12
+ | Component | Responsibility | Communication |
13
+ |-----------|---------------|---------------|
14
+ | [Name] | [What it does] | [How it talks to others] |
15
+
16
+ ## Patterns
17
+ [What architectural patterns are used and why.]
18
+
19
+ ## Integration Points
20
+ [External systems, APIs, databases this connects to.]
21
+
22
+ ## Data Flow
23
+ [How data moves through the system.]
24
+
25
+ ## Key Decisions
26
+ [Link to ADRs or list critical architectural decisions with rationale.]
@@ -0,0 +1,28 @@
1
+ # Behavior Spec: [Feature Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## Overview
7
+ [Brief description of the feature/behavior being specified.]
8
+
9
+ ## Acceptance Criteria
10
+
11
+ ### [Scenario Name]
12
+ **Given** [precondition]
13
+ **When** [action]
14
+ **Then** [expected result]
15
+
16
+ ### [Scenario Name]
17
+ **Given** [precondition]
18
+ **When** [action]
19
+ **Then** [expected result]
20
+
21
+ ## Non-Goals
22
+ [What this feature explicitly does NOT do.]
23
+
24
+ ## Edge Cases
25
+ [Known edge cases and expected behavior.]
26
+
27
+ ## Error Handling
28
+ [What happens when things go wrong.]
@@ -0,0 +1,19 @@
1
+ # Retrospective: [Feature/Project Name]
2
+
3
+ **Date**: [Date]
4
+ **Duration**: [How long did this take]
5
+
6
+ ## What Went Well
7
+ - [Thing that worked]
8
+
9
+ ## What Didn't Go Well
10
+ - [Thing that was painful or failed]
11
+
12
+ ## What We Learned
13
+ - [Insight for next time]
14
+
15
+ ## Action Items
16
+ - [ ] [Concrete improvement to make]
17
+
18
+ ## Spec Accuracy
19
+ [How well did the spec predict the actual implementation? What was missing or wrong?]
@@ -0,0 +1,23 @@
1
+ # Roadmap: [Project Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## Phase 1: MVP
7
+ **Goal**: [What ships first and why]
8
+
9
+ - [ ] [Feature/task]
10
+ - [ ] [Feature/task]
11
+
12
+ ## Phase 2: [Name]
13
+ **Goal**: [What this phase delivers]
14
+ **Depends on**: Phase 1
15
+
16
+ - [ ] [Feature/task]
17
+ - [ ] [Feature/task]
18
+
19
+ ## Deferred
20
+ [Things explicitly not in scope for now, with rationale.]
21
+
22
+ ## Risks
23
+ [What could block progress. Dependencies, unknowns, technical risk.]
@@ -0,0 +1,27 @@
1
+ # Stack: [Project Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## Language
7
+ [Primary language and version. Rationale.]
8
+
9
+ ## Framework
10
+ [Framework and version. Why this one.]
11
+
12
+ ## Build & Tooling
13
+ [Build system, linter, formatter, bundler.]
14
+
15
+ ## Testing
16
+ [Test framework, coverage tool, testing strategy.]
17
+
18
+ ## Storage
19
+ [Database, cache, file storage. Why these choices.]
20
+
21
+ ## Deployment
22
+ [Where and how this runs. CI/CD pipeline.]
23
+
24
+ ## Key Dependencies
25
+ | Dependency | Purpose | Version |
26
+ |-----------|---------|---------|
27
+ | [name] | [why] | [version] |
@@ -0,0 +1,25 @@
1
+ # Test Plan: [Feature Name]
2
+
3
+ **Version**: 0.1
4
+ **Date**: [Date]
5
+
6
+ ## Strategy
7
+ [Unit, integration, e2e — what level of testing and why.]
8
+
9
+ ## Coverage Goals
10
+ [What percentage/areas must be covered.]
11
+
12
+ ## Test Cases
13
+
14
+ ### Unit Tests
15
+ | Test | Input | Expected Output | Traces to |
16
+ |------|-------|-----------------|-----------|
17
+ | [name] | [input] | [output] | [spec criterion] |
18
+
19
+ ### Integration Tests
20
+ | Test | Components | Expected Behavior | Traces to |
21
+ |------|-----------|-------------------|-----------|
22
+ | [name] | [components] | [behavior] | [spec criterion] |
23
+
24
+ ## Not Tested
25
+ [What's explicitly not tested and why.]
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: TDD Discipline
3
+ description: >
4
+ Test-driven development enforcement — Red/Green/Refactor cycle, test co-location, traceability from behavior spec to test to code.
5
+ Use when writing tests, discussing TDD, coverage, verification, or validation.
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # TDD Discipline
10
+
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.
12
+
13
+ ## Red → Green → Refactor
14
+
15
+ 1. **Red**: Write a failing test that describes the desired behavior
16
+ 2. **Green**: Write the minimum code to make the test pass
17
+ 3. **Refactor**: Clean up without changing behavior (tests still pass)
18
+
19
+ This cycle applies at every level: unit, integration, e2e.
20
+
21
+ ## Relationship to Iterative Execution
22
+
23
+ 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. Every "implement" step in the iterative execution cycle uses TDD internally. They are complementary: TDD ensures code correctness at the unit level; iterative execution ensures spec satisfaction at the feature level.
24
+
25
+ ## When TDD Adds Value
26
+
27
+ - Business logic with clear inputs/outputs
28
+ - Data transformations
29
+ - State machines
30
+ - API contracts
31
+ - Bug fixes (write a test that reproduces the bug first)
32
+
33
+ ## When TDD Is Overhead
34
+
35
+ - UI layout/styling (use visual testing instead)
36
+ - Prototype/spike code (throw-away by definition)
37
+ - Simple CRUD with no logic (test the framework, not your code)
38
+ - One-off scripts
39
+
40
+ ## Traceability
41
+
42
+ Every test should trace back to a behavior spec criterion:
43
+
44
+ ```
45
+ Spec: "Given a logged-in user, when they submit a form, then data is saved"
46
+ Test: test_submit_form_saves_data()
47
+ Code: FormHandler.submit()
48
+ ```
49
+
50
+ This chain ensures nothing is built without a reason and nothing specified goes untested.
51
+
52
+ ## References
53
+
54
+ See: `references/test-strategies.md`
55
+ See: `references/traceability.md`
@@ -0,0 +1,36 @@
1
+ # Test Strategies
2
+
3
+ ## Unit Tests
4
+ **Scope**: Single function or class in isolation.
5
+ **Speed**: Fast (milliseconds).
6
+ **Dependencies**: Mocked/stubbed.
7
+ **Use for**: Pure logic, calculations, transformations, validation rules.
8
+
9
+ ## Integration Tests
10
+ **Scope**: Multiple components working together.
11
+ **Speed**: Medium (seconds).
12
+ **Dependencies**: Real (or realistic fakes).
13
+ **Use for**: API endpoints, database queries, service interactions, middleware chains.
14
+
15
+ ## End-to-End Tests
16
+ **Scope**: Full system from user perspective.
17
+ **Speed**: Slow (seconds to minutes).
18
+ **Dependencies**: All real.
19
+ **Use for**: Critical user journeys, smoke tests, deployment verification.
20
+
21
+ ## Test Doubles
22
+
23
+ | Type | What it does | When to use |
24
+ |------|-------------|-------------|
25
+ | **Stub** | Returns canned data | When you need predictable input |
26
+ | **Mock** | Verifies interactions | When you need to verify a call was made |
27
+ | **Fake** | Working implementation (simplified) | When stubs are too limited (e.g., in-memory DB) |
28
+ | **Spy** | Records calls for later assertion | When you want to observe without controlling |
29
+
30
+ ## Guidance
31
+
32
+ - Prefer stubs over mocks — test behavior, not implementation
33
+ - One assertion per test (or one logical assertion)
34
+ - Test names describe the behavior, not the method: `test_expired_token_returns_401` not `test_validateToken`
35
+ - Co-locate tests with source when possible (`foo.ts` → `foo.test.ts`)
36
+ - Don't test private methods — test through the public interface
@@ -0,0 +1,53 @@
1
+ # Traceability — Behavior → Test → Code
2
+
3
+ ## Purpose
4
+
5
+ Every line of code should trace back to a reason. Traceability ensures:
6
+ - Nothing is built without a spec
7
+ - Nothing specified goes untested
8
+ - Nothing tested lacks implementation
9
+ - Changes can be assessed for impact
10
+
11
+ ## The Trace Chain
12
+
13
+ ```
14
+ Behavior Spec Criterion → Test Case → Implementation Code
15
+ ```
16
+
17
+ Example:
18
+ ```
19
+ Spec: "Users can reset their password via email"
20
+
21
+ Test: test_password_reset_sends_email()
22
+ Test: test_password_reset_with_invalid_email_returns_error()
23
+ Test: test_password_reset_token_expires_after_1_hour()
24
+
25
+ Code: PasswordResetService.initiate()
26
+ Code: PasswordResetService.validateToken()
27
+ ```
28
+
29
+ ## Trace Matrix
30
+
31
+ For critical features, maintain a trace matrix:
32
+
33
+ | Spec Criterion | Test(s) | Implementation | Status |
34
+ |---------------|---------|----------------|--------|
35
+ | User can reset password | `test_password_reset_*` | `PasswordResetService` | Complete |
36
+ | Reset token expires in 1h | `test_token_expiry` | `TokenValidator.isValid()` | Complete |
37
+ | Invalid email returns error | `test_invalid_email_error` | `PasswordResetService.initiate()` | Complete |
38
+
39
+ ## When to Use Full Traceability
40
+
41
+ - Safety-critical systems
42
+ - Regulatory requirements
43
+ - Complex business logic
44
+ - Anything where "did we build what was specified?" is a real question
45
+
46
+ ## When Lightweight Tracing Is Fine
47
+
48
+ - Internal tools
49
+ - Prototypes
50
+ - Simple CRUD
51
+ - Well-understood domains
52
+
53
+ For lightweight: just ensure test names reference the behavior they verify.