@abdullah-alnahas/claude-sdd 0.3.0 → 0.4.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.
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "claude-sdd",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Spec-Driven Development discipline system — behavioral guardrails, spec-first development, architecture awareness, TDD enforcement, iterative execution loops"
5
5
  }
package/agents/critic.md CHANGED
@@ -32,7 +32,7 @@ allowed-tools:
32
32
 
33
33
  # Critic Agent
34
34
 
35
- You are an adversarial reviewer. Your job is to find what's wrong, not confirm what's right.
35
+ You are an adversarial reviewer. Your job is to find what's wrong, not confirm what's right. Report findings only — do not modify code directly.
36
36
 
37
37
  ## Review Process
38
38
 
@@ -41,7 +41,7 @@ You review code through a security lens. Focus on high-impact issues, not theore
41
41
  3. **Check auth/authz**: Are protected resources properly gated?
42
42
  4. **Check injection surfaces**: SQL, command, XSS, path traversal, template injection
43
43
  5. **Check secrets**: Hardcoded credentials, API keys, tokens in code or config
44
- 6. **Check dependencies**: Known vulnerable versions (if dependency info available)
44
+ 6. **Check dependencies**: Known vulnerable versions — run available audit tools (`npm audit`, `pip-audit`, `cargo audit`) when dependency files are present
45
45
 
46
46
  ## Priority Order
47
47
 
@@ -32,7 +32,7 @@ allowed-tools:
32
32
 
33
33
  # Simplifier Agent
34
34
 
35
- You ask one question: "Could this be done with less?" Your job is to reduce complexity while preserving correctness and test coverage.
35
+ You ask one question: "Could this be done with less?" Your job is to identify complexity and propose simpler alternatives. Report findings only — do not modify code directly.
36
36
 
37
37
  ## Review Process
38
38
 
@@ -26,12 +26,28 @@ Show the current state of all SDD guardrails and optionally toggle them.
26
26
  | `scope-guard` | PostToolUse (Write/Edit) | Detect unrelated file modifications |
27
27
  | `completion-review` | Stop | Spec adherence, test coverage, complexity audit, dead code check |
28
28
 
29
+ ## Persistence
30
+
31
+ Guardrail state is stored in `.sdd.yaml` under the `guardrails` key. Each guardrail has an `enabled` boolean:
32
+
33
+ ```yaml
34
+ guardrails:
35
+ pre-implementation:
36
+ enabled: true
37
+ scope-guard:
38
+ enabled: true
39
+ completion-review:
40
+ enabled: true
41
+ ```
42
+
43
+ When toggling a guardrail, read `.sdd.yaml`, update the relevant `enabled` value, and write it back. If `.sdd.yaml` does not exist, create it with defaults (all enabled).
44
+
29
45
  ## Behavior
30
46
 
31
47
  1. Check if `.sdd.yaml` exists in project root — if so, read guardrail config from it
32
48
  2. Check if `GUARDRAILS_DISABLED=true` (set by `/sdd-yolo`) — if so, report all disabled
33
49
  3. Display each guardrail with its enabled/disabled status
34
- 4. If an argument is provided, toggle the specified guardrail
50
+ 4. If an argument is provided, toggle the specified guardrail in `.sdd.yaml`
35
51
 
36
52
  ## Output Format
37
53
 
@@ -27,10 +27,18 @@ Display or change the current SDD development phase. Phases provide context that
27
27
  | **verify** | Verification | Running full verification suite, spec-compliance checks, security review |
28
28
  | **review** | Review | Critic + simplifier agents, retrospective |
29
29
 
30
+ ## Persistence
31
+
32
+ Phase state is stored in `.sdd-phase` in the project root. This file contains a single word (the phase name). If the file does not exist, phase is "none".
33
+
34
+ - **Set phase**: Write the phase name to `.sdd-phase`
35
+ - **Show phase**: Read `.sdd-phase` (or report "none" if missing)
36
+ - **Clear phase**: Delete `.sdd-phase`
37
+
30
38
  ## Behavior
31
39
 
32
- 1. Display the current phase (or "none" if not set)
33
- 2. If a phase name is provided, set it
40
+ 1. Read `.sdd-phase` to display the current phase (or "none" if not found)
41
+ 2. If a phase name is provided, validate it against the known phases and write to `.sdd-phase`
34
42
  3. Phase context is available to subsequent prompts and skills
35
43
  4. Phase affects which skills are most relevant:
36
44
  - `specify` → spec-first skill
package/hooks/hooks.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "hooks": [
19
19
  {
20
20
  "type": "prompt",
21
- "prompt": "If this message is a trivial acknowledgment (e.g. 'yes', 'no', 'thanks', 'ok', 'continue'), skip the checkpoint and respond normally.\n\nOtherwise, BEFORE responding to this request, apply the SDD pre-implementation checkpoint:\n\n1. **Enumerate Assumptions**: List every assumption you're making about the user's intent, the codebase, and the approach. Flag any that are uncertain.\n\n2. **Flag Ambiguity**: If the request is unclear, underspecified, or could be interpreted multiple ways, ASK for clarification before proceeding. Do not guess.\n\n3. **Surface Alternatives**: Identify at least 2 alternative approaches. Briefly note trade-offs. If the user's suggested approach has significant downsides, say so.\n\n4. **Push Back on Bad Ideas**: If the request involves overengineering, premature abstraction, unnecessary complexity, or architectural anti-patterns, respectfully push back with a simpler alternative.\n\n5. **Define Scope**: State explicitly what you WILL and WILL NOT change. Any file not directly related to the request is out of scope.\n\n6. **Check for Spec**: If this is a non-trivial feature and no spec exists, suggest creating one first (spec-first principle).\n\n7. **Plan TDD Approach**: Identify what tests should be written first. Implementation follows tests, not the reverse.\n\nOnly after completing this checkpoint should you proceed with implementation. If GUARDRAILS_DISABLED=true is set, skip this checkpoint."
21
+ "prompt": "If this message is a trivial acknowledgment (e.g. 'yes', 'no', 'thanks', 'ok', 'continue'), skip and respond normally. Otherwise, apply the SDD pre-implementation checkpoint from the guardrails skill (enumerate assumptions, flag ambiguity, surface alternatives, push back on bad ideas, define scope, check for spec, plan TDD approach) before proceeding. If GUARDRAILS_DISABLED=true, skip."
22
22
  }
23
23
  ]
24
24
  }
@@ -41,7 +41,7 @@
41
41
  "hooks": [
42
42
  {
43
43
  "type": "prompt",
44
- "prompt": "Before finalizing, perform the SDD completion review:\n\n1. **Spec Adherence**: If a spec exists, verify every acceptance criterion is met. List any gaps.\n\n2. **Test Coverage**: Were tests written before implementation (TDD)? Do they trace back to spec criteria? Any untested acceptance criteria?\n\n3. **Complexity Audit**: Check for unnecessary abstractions, overengineered patterns, or premature generalization. Every function should be under 50 lines. Every file should be under 500 lines.\n\n4. **Dead Code Check**: Ensure no unused imports, variables, functions, or files were introduced.\n\n5. **Scope Creep Check**: Verify only files directly related to the task were modified. Flag any unrelated changes.\n\n6. **Conceptual Error Scan**: Re-read the core logic. Does it actually solve the problem correctly? Are there off-by-one errors, race conditions, or logical gaps?\n\nReport findings concisely. If GUARDRAILS_DISABLED=true is set, skip this review."
44
+ "prompt": "Before finalizing, perform the SDD completion review from the guardrails skill (spec adherence, test coverage, complexity audit, dead code check, scope creep check, conceptual error scan). Report findings concisely. If GUARDRAILS_DISABLED=true, skip."
45
45
  }
46
46
  ]
47
47
  }
@@ -30,7 +30,7 @@ fi
30
30
 
31
31
  # Check if inside project directory
32
32
  case "$FILE_PATH" in
33
- "$PROJECT_DIR"*) ;; # Inside project, OK
33
+ "$PROJECT_DIR/"*|"$PROJECT_DIR") ;; # Inside project, OK
34
34
  /*)
35
35
  echo "SDD SCOPE WARNING: Edit to file outside project directory: $FILE_PATH" >&2
36
36
  exit 2
@@ -11,7 +11,7 @@ YOLO_FLAG="$PROJECT_DIR/.sdd-yolo"
11
11
 
12
12
  # Check for yolo mode
13
13
  if [ -f "$YOLO_FLAG" ]; then
14
- echo "SDD: YOLO mode activeall guardrails disabled" >&2
14
+ echo "SDD: Previous YOLO mode detectedclearing flag, guardrails disabled for this session" >&2
15
15
  # Remove yolo flag (auto-clears on session start)
16
16
  rm -f "$YOLO_FLAG"
17
17
  if [ -n "$ENV_FILE" ]; then
@@ -29,7 +29,7 @@ fi
29
29
 
30
30
  # Check for config file
31
31
  if [ -f "$CONFIG_FILE" ]; then
32
- echo "SDD: Config loaded from $CONFIG_FILE" >&2
32
+ echo "SDD: Config file found at $CONFIG_FILE" >&2
33
33
  if [ -n "$ENV_FILE" ]; then
34
34
  echo "SDD_CONFIG_FOUND=true" >> "$ENV_FILE"
35
35
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abdullah-alnahas/claude-sdd",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Spec-Driven Development discipline system for Claude Code — behavioral guardrails, spec-first development, architecture awareness, TDD enforcement, iterative execution loops",
5
5
  "keywords": [
6
6
  "claude-code-plugin",
@@ -41,8 +41,8 @@ Before writing ANY implementation code, you MUST:
41
41
 
42
42
  ## During Implementation
43
43
 
44
- - Follow TDD: write a failing test first, then the minimum code to pass it, then refactor
45
- - Use iterative execution: implement → verify against spec → fix gaps → repeat
44
+ - Follow TDD: write a failing test first, then the minimum code to pass it, then refactor (see the tdd-discipline skill for detailed workflow)
45
+ - Use iterative execution: implement → verify against spec → fix gaps → repeat (see the iterative-execution skill for the full cycle)
46
46
  - Do not refactor surrounding code unless asked
47
47
  - Do not add error handling for impossible scenarios
48
48
  - Do not add comments explaining obvious code
@@ -47,11 +47,10 @@ Good completion criteria are:
47
47
 
48
48
  Use whatever is available, in order of preference:
49
49
  1. **Automated tests** (test runners, linters, type checkers)
50
- 2. **Plugin agents** (critic, spec-compliance, security-reviewer)
51
- 3. **Plugin skills** (guardrails, architecture-aware)
52
- 4. **External MCP servers** (if user has configured any)
53
- 5. **External plugin agents/skills** (if other plugins are installed)
54
- 6. **Manual inspection** (read the code, trace the logic)
50
+ 2. **Available review agents** (e.g., critic, spec-compliance, security-reviewer)
51
+ 3. **Available analysis skills** (e.g., guardrails, architecture-aware)
52
+ 4. **External tools** (MCP servers, other plugins the user has configured)
53
+ 5. **Manual inspection** (read the code, trace the logic)
55
54
 
56
55
  ## Honesty Rules
57
56
 
@@ -47,7 +47,7 @@ Test: test_submit_form_saves_data()
47
47
  Code: FormHandler.submit()
48
48
  ```
49
49
 
50
- This chain ensures nothing is built without a reason and nothing specified goes untested.
50
+ 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.
51
51
 
52
52
  ## References
53
53