@abdullah-alnahas/claude-sdd 0.5.0 → 0.6.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 +7 -3
- package/agents/critic.md +1 -5
- package/commands/sdd-adopt.md +0 -1
- package/commands/sdd-autopilot.md +2 -1
- package/commands/sdd-phase.md +11 -3
- package/commands/sdd-review.md +5 -4
- package/commands/sdd-yolo.md +0 -1
- package/hooks/hooks.json +2 -2
- package/hooks/scripts/post-edit-review.sh +18 -4
- package/hooks/scripts/session-init.sh +3 -1
- package/package.json +1 -1
- package/scripts/verify-commands.sh +5 -3
- package/scripts/verify-hooks.sh +19 -17
- package/scripts/verify-skills.sh +5 -3
- package/skills/architecture-aware/SKILL.md +13 -7
- package/skills/guardrails/SKILL.md +12 -9
- package/skills/iterative-execution/SKILL.md +10 -5
- package/skills/performance-optimization/SKILL.md +11 -5
- package/skills/spec-first/SKILL.md +6 -0
- package/skills/tdd-discipline/SKILL.md +11 -2
package/README.md
CHANGED
|
@@ -41,6 +41,9 @@ Red → Green → Refactor enforcement. Test traceability from behavior spec to
|
|
|
41
41
|
### Iterative Execution
|
|
42
42
|
Disciplined delivery loops: implement with TDD → verify against spec → fix gaps → repeat. TDD is the inner discipline (how you write code), iterative execution is the outer cycle (how you deliver features).
|
|
43
43
|
|
|
44
|
+
### Performance Optimization
|
|
45
|
+
Profile-first discipline for performance work. Defends against convenience bias (shallow, input-specific hacks), bottleneck mis-targeting, and correctness regressions during optimization.
|
|
46
|
+
|
|
44
47
|
## Commands
|
|
45
48
|
|
|
46
49
|
| Command | Purpose |
|
|
@@ -61,6 +64,7 @@ Disciplined delivery loops: implement with TDD → verify against spec → fix g
|
|
|
61
64
|
| **simplifier** | Complexity reducer — proposes simpler alternatives |
|
|
62
65
|
| **spec-compliance** | Spec adherence checker — verifies traceability (spec → test → code) |
|
|
63
66
|
| **security-reviewer** | Security analysis — OWASP Top 10, input validation, auth review |
|
|
67
|
+
| **performance-reviewer** | Performance optimization reviewer — validates patches for bottleneck targeting, convenience bias, measured improvement |
|
|
64
68
|
|
|
65
69
|
## Configuration
|
|
66
70
|
|
|
@@ -107,9 +111,9 @@ whitelist:
|
|
|
107
111
|
## Self-Test
|
|
108
112
|
|
|
109
113
|
```bash
|
|
110
|
-
bash
|
|
111
|
-
bash
|
|
112
|
-
bash
|
|
114
|
+
bash scripts/verify-hooks.sh
|
|
115
|
+
bash scripts/verify-skills.sh
|
|
116
|
+
bash scripts/verify-commands.sh
|
|
113
117
|
```
|
|
114
118
|
|
|
115
119
|
## Development Phases
|
package/agents/critic.md
CHANGED
|
@@ -70,8 +70,4 @@ You are an adversarial reviewer. Your job is to find what's wrong, not confirm w
|
|
|
70
70
|
|
|
71
71
|
## Performance Patch Review
|
|
72
72
|
|
|
73
|
-
When
|
|
74
|
-
- **Bottleneck targeting**: Does the patch address the actual bottleneck, or a convenient but less impactful location?
|
|
75
|
-
- **Convenience bias**: Is this a structural improvement (algorithm, data structure) or a shallow, input-specific hack that's fragile and hard to maintain?
|
|
76
|
-
- **Measured improvement**: Is the speedup quantified with before/after evidence, or just assumed?
|
|
77
|
-
- **Correctness preservation**: Do all existing tests still pass after the optimization?
|
|
73
|
+
When a patch includes performance changes, check for correctness regressions and logical errors as usual. For dedicated performance analysis (bottleneck targeting, convenience bias, measured speedup), defer to the **performance-reviewer** agent.
|
package/commands/sdd-adopt.md
CHANGED
|
@@ -75,7 +75,8 @@ Use the iterative execution outer loop: implement → verify → fix gaps → re
|
|
|
75
75
|
2. Invoke **spec-compliance agent** — compare implementation against behavior-spec.md
|
|
76
76
|
3. Invoke **critic agent** — find logical errors, assumption issues
|
|
77
77
|
4. Invoke **security-reviewer agent** — check for vulnerabilities
|
|
78
|
-
5.
|
|
78
|
+
5. If performance optimization was part of the spec, invoke **performance-reviewer agent**
|
|
79
|
+
6. Collect all findings
|
|
79
80
|
|
|
80
81
|
**Transition**: "Verify phase complete — N findings (X critical, Y high, Z medium). Entering Review phase."
|
|
81
82
|
|
package/commands/sdd-phase.md
CHANGED
|
@@ -45,7 +45,7 @@ Phase state is stored in `.sdd-phase` in the project root. This file contains a
|
|
|
45
45
|
- `design` → architecture-aware skill
|
|
46
46
|
- `implement` → TDD discipline + iterative execution skills
|
|
47
47
|
- `verify` → iterative execution (verification step)
|
|
48
|
-
- `review` → all agents (critic, simplifier, spec-compliance, security-reviewer)
|
|
48
|
+
- `review` → all agents (critic, simplifier, spec-compliance, security-reviewer, performance-reviewer)
|
|
49
49
|
|
|
50
50
|
## Output Format
|
|
51
51
|
|
|
@@ -54,6 +54,14 @@ SDD Phase: implement
|
|
|
54
54
|
─────────────────────
|
|
55
55
|
Focus: TDD cycles within iterative execution — write tests first, then minimal code to pass
|
|
56
56
|
|
|
57
|
-
Available skills: tdd-discipline, iterative-execution, guardrails
|
|
58
|
-
|
|
57
|
+
Available skills: tdd-discipline, iterative-execution, guardrails, performance-optimization
|
|
58
|
+
Recommended agents: critic, spec-compliance
|
|
59
|
+
All agents: critic, simplifier, spec-compliance, security-reviewer, performance-reviewer
|
|
59
60
|
```
|
|
61
|
+
|
|
62
|
+
Phase-specific agent recommendations:
|
|
63
|
+
- **specify**: spec-compliance (verify spec completeness)
|
|
64
|
+
- **design**: critic (architectural review), simplifier
|
|
65
|
+
- **implement**: spec-compliance (traceability), critic (logic review)
|
|
66
|
+
- **verify**: security-reviewer, performance-reviewer, spec-compliance
|
|
67
|
+
- **review**: all agents
|
package/commands/sdd-review.md
CHANGED
|
@@ -27,10 +27,11 @@ Trigger an on-demand review of recent work using the critic and simplifier agent
|
|
|
27
27
|
2. Run the **critic agent** — find logical errors, spec drift, assumption issues
|
|
28
28
|
3. Run the **simplifier agent** — find unnecessary complexity
|
|
29
29
|
4. If spec documents exist, run the **spec-compliance agent**
|
|
30
|
-
5.
|
|
31
|
-
6.
|
|
32
|
-
7.
|
|
33
|
-
8.
|
|
30
|
+
5. If the changes involve performance optimization, run the **performance-reviewer agent**
|
|
31
|
+
6. Present findings with severity levels
|
|
32
|
+
7. Offer to auto-fix issues found
|
|
33
|
+
8. If fixes are made (using TDD — write a test for the fix first), re-review
|
|
34
|
+
9. Repeat until no critical issues remain or max iterations reached
|
|
34
35
|
|
|
35
36
|
## Output Format
|
|
36
37
|
|
package/commands/sdd-yolo.md
CHANGED
package/hooks/hooks.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "bash $CLAUDE_PLUGIN_ROOT/hooks/scripts/session-init.sh",
|
|
9
|
+
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/session-init.sh\"",
|
|
10
10
|
"timeout": 10
|
|
11
11
|
}
|
|
12
12
|
]
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"hooks": [
|
|
30
30
|
{
|
|
31
31
|
"type": "command",
|
|
32
|
-
"command": "bash $CLAUDE_PLUGIN_ROOT/hooks/scripts/post-edit-review.sh",
|
|
32
|
+
"command": "bash \"$CLAUDE_PLUGIN_ROOT/hooks/scripts/post-edit-review.sh\"",
|
|
33
33
|
"timeout": 15
|
|
34
34
|
}
|
|
35
35
|
]
|
|
@@ -10,24 +10,38 @@ if [ "${GUARDRAILS_DISABLED:-false}" = "true" ]; then
|
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
12
|
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-.}"
|
|
13
|
+
# Resolve to absolute path to avoid relative vs absolute mismatch
|
|
14
|
+
if command -v realpath &>/dev/null; then
|
|
15
|
+
PROJECT_DIR=$(realpath "$PROJECT_DIR" 2>/dev/null || echo "$PROJECT_DIR")
|
|
16
|
+
fi
|
|
13
17
|
|
|
14
18
|
# Read tool input from stdin (JSON with file_path)
|
|
15
19
|
INPUT=$(cat)
|
|
16
20
|
|
|
17
21
|
# Use jq if available, fall back to sed
|
|
18
22
|
if command -v jq &>/dev/null; then
|
|
19
|
-
FILE_PATH=$(echo "$INPUT" | jq -r '.file_path // .filePath // empty' 2>/dev/null
|
|
23
|
+
FILE_PATH=$(echo "$INPUT" | jq -r '.file_path // .filePath // empty' 2>/dev/null)
|
|
24
|
+
if [ $? -ne 0 ] || [ -z "$FILE_PATH" ]; then
|
|
25
|
+
echo "SDD: post-edit-review skipped — could not parse file_path from hook input" >&2
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
20
28
|
else
|
|
21
|
-
FILE_PATH=$(echo "$INPUT" | sed -n 's/.*"file_path"\
|
|
29
|
+
FILE_PATH=$(echo "$INPUT" | sed -n 's/.*"file_path"[ \t]*:[ \t]*"\([^"]*\)".*/\1/p' | head -1)
|
|
22
30
|
if [ -z "$FILE_PATH" ]; then
|
|
23
|
-
FILE_PATH=$(echo "$INPUT" | sed -n 's/.*"filePath"\
|
|
31
|
+
FILE_PATH=$(echo "$INPUT" | sed -n 's/.*"filePath"[ \t]*:[ \t]*"\([^"]*\)".*/\1/p' | head -1)
|
|
24
32
|
fi
|
|
25
33
|
fi
|
|
26
34
|
|
|
27
35
|
if [ -z "$FILE_PATH" ]; then
|
|
36
|
+
echo "SDD: post-edit-review skipped — no file_path in hook input" >&2
|
|
28
37
|
exit 0
|
|
29
38
|
fi
|
|
30
39
|
|
|
40
|
+
# Resolve file path to absolute for consistent comparison
|
|
41
|
+
if command -v realpath &>/dev/null; then
|
|
42
|
+
FILE_PATH=$(realpath "$FILE_PATH" 2>/dev/null || echo "$FILE_PATH")
|
|
43
|
+
fi
|
|
44
|
+
|
|
31
45
|
# Check if inside project directory
|
|
32
46
|
case "$FILE_PATH" in
|
|
33
47
|
"$PROJECT_DIR/"*|"$PROJECT_DIR") ;; # Inside project, OK
|
|
@@ -39,7 +53,7 @@ esac
|
|
|
39
53
|
|
|
40
54
|
# Check git status for unrelated modifications
|
|
41
55
|
if command -v git &>/dev/null && [ -d "$PROJECT_DIR/.git" ]; then
|
|
42
|
-
MODIFIED_COUNT=$(cd "$PROJECT_DIR" && git diff --name-only 2>/dev/null | wc -l)
|
|
56
|
+
MODIFIED_COUNT=$(cd "$PROJECT_DIR" && git diff --name-only 2>/dev/null | wc -l | tr -d ' ')
|
|
43
57
|
if [ "$MODIFIED_COUNT" -gt 10 ]; then
|
|
44
58
|
echo "SDD SCOPE WARNING: $MODIFIED_COUNT files modified — possible scope creep. Review changes with 'git diff --stat'" >&2
|
|
45
59
|
exit 2
|
|
@@ -13,7 +13,9 @@ YOLO_FLAG="$PROJECT_DIR/.sdd-yolo"
|
|
|
13
13
|
if [ -f "$YOLO_FLAG" ]; then
|
|
14
14
|
echo "SDD: Previous YOLO mode detected — clearing flag, guardrails disabled for this session" >&2
|
|
15
15
|
# Remove yolo flag (auto-clears on session start)
|
|
16
|
-
rm -f "$YOLO_FLAG"
|
|
16
|
+
if ! rm -f "$YOLO_FLAG" 2>/dev/null; then
|
|
17
|
+
echo "SDD WARNING: Could not remove yolo flag at $YOLO_FLAG — guardrails may remain disabled next session" >&2
|
|
18
|
+
fi
|
|
17
19
|
if [ -n "$ENV_FILE" ]; then
|
|
18
20
|
echo "GUARDRAILS_DISABLED=true" >> "$ENV_FILE"
|
|
19
21
|
echo "SDD_YOLO_CLEARED=true" >> "$ENV_FILE"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abdullah-alnahas/claude-sdd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -9,11 +9,13 @@ FAIL=0
|
|
|
9
9
|
check() {
|
|
10
10
|
local desc="$1"
|
|
11
11
|
shift
|
|
12
|
-
|
|
12
|
+
local output
|
|
13
|
+
if output=$("$@" 2>&1); then
|
|
13
14
|
echo " ✓ $desc"
|
|
14
15
|
PASS=$((PASS + 1))
|
|
15
16
|
else
|
|
16
17
|
echo " ✗ $desc"
|
|
18
|
+
[ -n "$output" ] && echo " $output"
|
|
17
19
|
FAIL=$((FAIL + 1))
|
|
18
20
|
fi
|
|
19
21
|
}
|
|
@@ -29,7 +31,7 @@ for cmd in "${COMMANDS[@]}"; do
|
|
|
29
31
|
CMD_FILE="$PLUGIN_DIR/commands/$cmd.md"
|
|
30
32
|
|
|
31
33
|
check "File exists" test -f "$CMD_FILE"
|
|
32
|
-
check "Has frontmatter"
|
|
34
|
+
check "Has frontmatter" bash -c "sed -n '1p' \"$CMD_FILE\" | grep -q '^---'"
|
|
33
35
|
check "Has name field" grep -q "^name:" "$CMD_FILE"
|
|
34
36
|
check "Has description field" grep -q "^description:" "$CMD_FILE"
|
|
35
37
|
check "Is non-empty (>100 chars)" test "$(wc -c < "$CMD_FILE")" -gt 100
|
|
@@ -45,7 +47,7 @@ check "All command names are unique" test "$(echo "$NAMES" | wc -l)" -eq "$(echo
|
|
|
45
47
|
# Check agents referenced by commands exist
|
|
46
48
|
echo ""
|
|
47
49
|
echo "Agent references:"
|
|
48
|
-
AGENTS=("critic" "simplifier" "spec-compliance" "security-reviewer")
|
|
50
|
+
AGENTS=("critic" "simplifier" "spec-compliance" "security-reviewer" "performance-reviewer")
|
|
49
51
|
for agent in "${AGENTS[@]}"; do
|
|
50
52
|
check "Agent: $agent.md exists" test -f "$PLUGIN_DIR/agents/$agent.md"
|
|
51
53
|
done
|
package/scripts/verify-hooks.sh
CHANGED
|
@@ -9,11 +9,13 @@ FAIL=0
|
|
|
9
9
|
check() {
|
|
10
10
|
local desc="$1"
|
|
11
11
|
shift
|
|
12
|
-
|
|
12
|
+
local output
|
|
13
|
+
if output=$("$@" 2>&1); then
|
|
13
14
|
echo " ✓ $desc"
|
|
14
15
|
PASS=$((PASS + 1))
|
|
15
16
|
else
|
|
16
17
|
echo " ✗ $desc"
|
|
18
|
+
[ -n "$output" ] && echo " $output"
|
|
17
19
|
FAIL=$((FAIL + 1))
|
|
18
20
|
fi
|
|
19
21
|
}
|
|
@@ -25,32 +27,32 @@ echo "─────────────────────"
|
|
|
25
27
|
echo ""
|
|
26
28
|
echo "hooks.json:"
|
|
27
29
|
check "File exists" test -f "$PLUGIN_DIR/hooks/hooks.json"
|
|
28
|
-
check "Valid JSON" python3 -c "import json; json.load(open(
|
|
30
|
+
check "Valid JSON" python3 -c "import json, sys; json.load(open(sys.argv[1]))" "$PLUGIN_DIR/hooks/hooks.json"
|
|
29
31
|
check "Has hooks wrapper" python3 -c "
|
|
30
|
-
import json
|
|
31
|
-
d = json.load(open(
|
|
32
|
+
import json, sys
|
|
33
|
+
d = json.load(open(sys.argv[1]))
|
|
32
34
|
assert 'hooks' in d, 'Missing hooks key'
|
|
33
|
-
"
|
|
35
|
+
" "$PLUGIN_DIR/hooks/hooks.json"
|
|
34
36
|
check "Has SessionStart hook" python3 -c "
|
|
35
|
-
import json
|
|
36
|
-
d = json.load(open(
|
|
37
|
+
import json, sys
|
|
38
|
+
d = json.load(open(sys.argv[1]))
|
|
37
39
|
assert 'SessionStart' in d['hooks']
|
|
38
|
-
"
|
|
40
|
+
" "$PLUGIN_DIR/hooks/hooks.json"
|
|
39
41
|
check "Has UserPromptSubmit hook" python3 -c "
|
|
40
|
-
import json
|
|
41
|
-
d = json.load(open(
|
|
42
|
+
import json, sys
|
|
43
|
+
d = json.load(open(sys.argv[1]))
|
|
42
44
|
assert 'UserPromptSubmit' in d['hooks']
|
|
43
|
-
"
|
|
45
|
+
" "$PLUGIN_DIR/hooks/hooks.json"
|
|
44
46
|
check "Has PostToolUse hook" python3 -c "
|
|
45
|
-
import json
|
|
46
|
-
d = json.load(open(
|
|
47
|
+
import json, sys
|
|
48
|
+
d = json.load(open(sys.argv[1]))
|
|
47
49
|
assert 'PostToolUse' in d['hooks']
|
|
48
|
-
"
|
|
50
|
+
" "$PLUGIN_DIR/hooks/hooks.json"
|
|
49
51
|
check "Has Stop hook" python3 -c "
|
|
50
|
-
import json
|
|
51
|
-
d = json.load(open(
|
|
52
|
+
import json, sys
|
|
53
|
+
d = json.load(open(sys.argv[1]))
|
|
52
54
|
assert 'Stop' in d['hooks']
|
|
53
|
-
"
|
|
55
|
+
" "$PLUGIN_DIR/hooks/hooks.json"
|
|
54
56
|
|
|
55
57
|
# Check scripts exist and are executable
|
|
56
58
|
echo ""
|
package/scripts/verify-skills.sh
CHANGED
|
@@ -9,11 +9,13 @@ FAIL=0
|
|
|
9
9
|
check() {
|
|
10
10
|
local desc="$1"
|
|
11
11
|
shift
|
|
12
|
-
|
|
12
|
+
local output
|
|
13
|
+
if output=$("$@" 2>&1); then
|
|
13
14
|
echo " ✓ $desc"
|
|
14
15
|
PASS=$((PASS + 1))
|
|
15
16
|
else
|
|
16
17
|
echo " ✗ $desc"
|
|
18
|
+
[ -n "$output" ] && echo " $output"
|
|
17
19
|
FAIL=$((FAIL + 1))
|
|
18
20
|
fi
|
|
19
21
|
}
|
|
@@ -21,7 +23,7 @@ check() {
|
|
|
21
23
|
echo "SDD Skill Verification"
|
|
22
24
|
echo "──────────────────────"
|
|
23
25
|
|
|
24
|
-
SKILLS=("guardrails" "spec-first" "architecture-aware" "tdd-discipline" "iterative-execution")
|
|
26
|
+
SKILLS=("guardrails" "spec-first" "architecture-aware" "tdd-discipline" "iterative-execution" "performance-optimization")
|
|
25
27
|
|
|
26
28
|
for skill in "${SKILLS[@]}"; do
|
|
27
29
|
echo ""
|
|
@@ -30,7 +32,7 @@ for skill in "${SKILLS[@]}"; do
|
|
|
30
32
|
|
|
31
33
|
check "Directory exists" test -d "$SKILL_DIR"
|
|
32
34
|
check "SKILL.md exists" test -f "$SKILL_DIR/SKILL.md"
|
|
33
|
-
check "SKILL.md has frontmatter"
|
|
35
|
+
check "SKILL.md has frontmatter" bash -c "sed -n '1p' \"$SKILL_DIR/SKILL.md\" | grep -q '^---'"
|
|
34
36
|
check "SKILL.md has name field" grep -q "^name:" "$SKILL_DIR/SKILL.md"
|
|
35
37
|
check "SKILL.md has description field" grep -q "^description:" "$SKILL_DIR/SKILL.md"
|
|
36
38
|
|
|
@@ -4,7 +4,8 @@ description: >
|
|
|
4
4
|
This skill provides architecture consciousness during development, including integration patterns,
|
|
5
5
|
anti-patterns, and ADR guidance. It should be used when the user asks how to structure or organize code,
|
|
6
6
|
discusses architecture or design patterns, plans integrations between components, or asks
|
|
7
|
-
"how should I structure this?", "what pattern should I use?",
|
|
7
|
+
"how should I structure this?", "what pattern should I use?", "should I split this into services?",
|
|
8
|
+
"should I write an ADR?", or "document this decision."
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
# Architecture Awareness
|
|
@@ -22,13 +23,13 @@ Every pattern has trade-offs. State the specific benefit for THIS codebase, not
|
|
|
22
23
|
### Record Significant Decisions
|
|
23
24
|
If a decision is hard to reverse or affects multiple components, it deserves an ADR (Architecture Decision Record).
|
|
24
25
|
|
|
25
|
-
## When
|
|
26
|
+
## When an Architecture Question Arises
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
1. **Survey existing patterns** — read the codebase to understand current conventions, patterns, and structure
|
|
29
|
+
2. **Evaluate fit** — does the proposed approach align with or diverge from existing patterns? Divergence needs justification.
|
|
30
|
+
3. **State trade-offs explicitly** — every option has costs and benefits. Name them concretely for this codebase.
|
|
31
|
+
4. **Decide whether an ADR is warranted** — write one if the decision is hard to reverse or affects multiple components
|
|
32
|
+
5. **Document if yes** — use the ADR template from `references/adr-guide.md`
|
|
32
33
|
|
|
33
34
|
## What to Check
|
|
34
35
|
|
|
@@ -37,6 +38,11 @@ If a decision is hard to reverse or affects multiple components, it deserves an
|
|
|
37
38
|
3. **Coupling**: Are we creating tight coupling between components?
|
|
38
39
|
4. **Consistency**: Does this follow or violate established conventions?
|
|
39
40
|
|
|
41
|
+
## Related Skills
|
|
42
|
+
|
|
43
|
+
- **spec-first** — architecture decisions emerge during Stage 4 (Architecture)
|
|
44
|
+
- **guardrails** — enforces architectural consistency as part of scope discipline
|
|
45
|
+
|
|
40
46
|
## References
|
|
41
47
|
|
|
42
48
|
See: `references/integration-patterns.md`
|
|
@@ -51,14 +51,7 @@ Before writing ANY implementation code, you MUST:
|
|
|
51
51
|
|
|
52
52
|
## Performance Changes
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
1. **Profile first** — identify the actual bottleneck with evidence (timing, profiler output). Never guess.
|
|
57
|
-
2. **Verify correctness after every change** — run the full test suite. Any test regression invalidates the optimization.
|
|
58
|
-
3. **Measure improvement quantitatively** — compare before/after timings. No "it should be faster" — prove it.
|
|
59
|
-
4. **Prefer structural improvements** — algorithmic and data-structure changes over micro-optimizations or input-specific hacks.
|
|
60
|
-
5. **Never sacrifice correctness for speed** — a faster but broken program is not an optimization, it's a defect.
|
|
61
|
-
6. **Watch for convenience bias** — small, surface-level tweaks that are easy to produce but fragile and hard to maintain. Push for deeper fixes.
|
|
54
|
+
For performance optimization tasks, follow the **performance-optimization** skill for the full workflow (profile-first discipline, convenience bias detection, measured improvement). The core rule: never sacrifice correctness for speed.
|
|
62
55
|
|
|
63
56
|
## Completion Review
|
|
64
57
|
|
|
@@ -67,7 +60,7 @@ Before claiming work is done:
|
|
|
67
60
|
1. Re-read the original request
|
|
68
61
|
2. Verify every requirement is met
|
|
69
62
|
3. Check for dead code you introduced
|
|
70
|
-
4. Check function/file length
|
|
63
|
+
4. Check function/file length guidelines (aim for ~50/~500 lines — adapt to project conventions)
|
|
71
64
|
5. Verify no unrelated files were modified
|
|
72
65
|
6. Run available tests
|
|
73
66
|
|
|
@@ -75,5 +68,15 @@ Before claiming work is done:
|
|
|
75
68
|
|
|
76
69
|
Consult the failure patterns reference for detailed detection and response guidance for all 12 failure modes.
|
|
77
70
|
|
|
71
|
+
## Related Skills
|
|
72
|
+
|
|
73
|
+
- **spec-first** — for the pre-implementation spec check (step 6 above)
|
|
74
|
+
- **tdd-discipline** — for the TDD inner discipline during implementation
|
|
75
|
+
- **iterative-execution** — for the implement-verify-fix outer cycle
|
|
76
|
+
- **performance-optimization** — for performance-specific guardrails
|
|
77
|
+
- **architecture-aware** — for architectural consistency checks
|
|
78
|
+
|
|
79
|
+
## References
|
|
80
|
+
|
|
78
81
|
See: `references/failure-patterns.md`
|
|
79
82
|
See: `references/pushback-guide.md`
|
|
@@ -54,11 +54,7 @@ Use whatever is available, in order of preference:
|
|
|
54
54
|
|
|
55
55
|
## Performance Optimization Tasks
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
1. **Timing comparison** — measure before vs after on the actual workload. Quantify the speedup.
|
|
59
|
-
2. **Test suite pass** — correctness preserved. Any new test failure invalidates the optimization.
|
|
60
|
-
3. **Profile comparison** — confirm the bottleneck was actually addressed, not just masked or shifted elsewhere.
|
|
61
|
-
4. **Convenience bias check** — is this a structural improvement or a shallow, input-specific hack? If the latter, iterate.
|
|
57
|
+
For performance optimization tasks, the verification step must additionally include timing comparison, profile comparison, and convenience bias checks. Follow the **performance-optimization** skill for the full workflow.
|
|
62
58
|
|
|
63
59
|
## Honesty Rules
|
|
64
60
|
|
|
@@ -69,5 +65,14 @@ When the task is performance optimization, the verification step MUST include:
|
|
|
69
65
|
|
|
70
66
|
## References
|
|
71
67
|
|
|
68
|
+
## Related Skills
|
|
69
|
+
|
|
70
|
+
- **tdd-discipline** — the inner discipline used within each implementation step
|
|
71
|
+
- **spec-first** — produces the specs that define completion criteria
|
|
72
|
+
- **guardrails** — the overarching discipline layer
|
|
73
|
+
- **performance-optimization** — specialized verification for performance tasks
|
|
74
|
+
|
|
75
|
+
## References
|
|
76
|
+
|
|
72
77
|
See: `references/loop-patterns.md`
|
|
73
78
|
See: `references/completion-criteria.md`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Performance Optimization
|
|
3
3
|
description: >
|
|
4
4
|
This skill enforces disciplined performance optimization practices defending against convenience bias,
|
|
5
|
-
|
|
5
|
+
bottleneck mis-targeting, and correctness regressions. It should be used when the user asks to optimize,
|
|
6
6
|
speed up, improve performance, reduce runtime, or make code faster — any task where the goal is better
|
|
7
7
|
performance without breaking correctness.
|
|
8
8
|
---
|
|
@@ -49,10 +49,16 @@ Performance optimization is investigative work. You must understand the problem
|
|
|
49
49
|
## Convenience Bias Checklist
|
|
50
50
|
|
|
51
51
|
Before submitting a performance patch, verify it is NOT:
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
52
|
+
- An input-specific hack that only helps one case
|
|
53
|
+
- A micro-optimization with unmeasurable impact
|
|
54
|
+
- A change that trades correctness risk for speed
|
|
55
|
+
- A surface-level tweak when a deeper structural fix exists
|
|
56
|
+
|
|
57
|
+
## Related Skills
|
|
58
|
+
|
|
59
|
+
- **guardrails** — enforces correctness-first and verify-before-claiming during optimization
|
|
60
|
+
- **iterative-execution** — the outer verify-fix cycle for measuring and iterating on improvements
|
|
61
|
+
- **tdd-discipline** — ensures test suite is maintained through optimization changes
|
|
56
62
|
|
|
57
63
|
## References
|
|
58
64
|
|
|
@@ -60,6 +60,12 @@ For existing projects, use the adoption flow instead of starting from scratch. S
|
|
|
60
60
|
- **Documents are living**: Specs evolve. That's fine. But they must exist before code.
|
|
61
61
|
- **Lean templates**: The templates are starting points, not forms to fill out
|
|
62
62
|
|
|
63
|
+
## Related Skills
|
|
64
|
+
|
|
65
|
+
- **architecture-aware** — for deeper architectural guidance during Stage 4
|
|
66
|
+
- **tdd-discipline** — for test planning from behavior specs (use `references/templates/test-plan.md`)
|
|
67
|
+
- **guardrails** — enforces spec-first as a pre-implementation check
|
|
68
|
+
|
|
63
69
|
## References
|
|
64
70
|
|
|
65
71
|
See: `references/interactive-spec-process.md` — Detailed questioning flow
|
|
@@ -3,7 +3,8 @@ name: TDD Discipline
|
|
|
3
3
|
description: >
|
|
4
4
|
This skill enforces test-driven development discipline with the Red/Green/Refactor cycle and traceability
|
|
5
5
|
from behavior spec to test to code. It should be used when the user asks to write tests, add test coverage,
|
|
6
|
-
discuss testing strategy, or says "how should I test this?", "add tests for this,"
|
|
6
|
+
discuss testing strategy, fix a bug, or says "how should I test this?", "add tests for this," "write tests first,"
|
|
7
|
+
"fix this bug," or "debug this."
|
|
7
8
|
---
|
|
8
9
|
|
|
9
10
|
# TDD Discipline
|
|
@@ -20,7 +21,7 @@ This cycle applies at every level: unit, integration, e2e.
|
|
|
20
21
|
|
|
21
22
|
## Relationship to Iterative Execution
|
|
22
23
|
|
|
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.
|
|
24
|
+
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.
|
|
24
25
|
|
|
25
26
|
## When TDD Adds Value
|
|
26
27
|
|
|
@@ -51,5 +52,13 @@ This chain ensures nothing is built without a reason and nothing specified goes
|
|
|
51
52
|
|
|
52
53
|
## References
|
|
53
54
|
|
|
55
|
+
## Related Skills
|
|
56
|
+
|
|
57
|
+
- **iterative-execution** — the outer delivery cycle that uses TDD internally
|
|
58
|
+
- **spec-first** — produces behavior specs that drive test design (see `spec-first/references/templates/test-plan.md`)
|
|
59
|
+
- **guardrails** — enforces TDD during implementation
|
|
60
|
+
|
|
61
|
+
## References
|
|
62
|
+
|
|
54
63
|
See: `references/test-strategies.md`
|
|
55
64
|
See: `references/traceability.md`
|