devflow-kit 1.2.0 → 1.3.1
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/CHANGELOG.md +39 -2
- package/dist/cli.js +2 -0
- package/dist/commands/ambient.js +5 -4
- package/dist/commands/init.js +4 -2
- package/dist/commands/memory.js +4 -4
- package/dist/commands/skills.d.ts +11 -0
- package/dist/commands/skills.js +116 -0
- package/dist/commands/uninstall.js +11 -1
- package/dist/utils/installer.js +20 -2
- package/package.json +3 -2
- package/plugins/devflow-accessibility/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-ambient/.claude-plugin/plugin.json +4 -2
- package/plugins/devflow-ambient/README.md +8 -8
- package/plugins/devflow-ambient/commands/ambient.md +14 -14
- package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +15 -8
- package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +2 -2
- package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-code-review/.claude-plugin/plugin.json +13 -3
- package/plugins/devflow-code-review/skills/architecture-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/complexity-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/consistency-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/database-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/dependencies-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/documentation-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/performance-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/regression-patterns/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/review-methodology/SKILL.md +1 -1
- package/plugins/devflow-code-review/skills/security-patterns/SKILL.md +1 -1
- package/plugins/devflow-core-skills/.claude-plugin/plugin.json +9 -2
- package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +5 -8
- package/plugins/devflow-debug/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-go/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-implement/.claude-plugin/plugin.json +19 -3
- package/plugins/devflow-implement/skills/self-review/SKILL.md +1 -1
- package/plugins/devflow-java/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-python/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-react/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-resolve/.claude-plugin/plugin.json +13 -3
- package/plugins/devflow-resolve/skills/security-patterns/SKILL.md +1 -1
- package/plugins/devflow-rust/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -3
- package/plugins/devflow-self-review/skills/self-review/SKILL.md +1 -1
- package/plugins/devflow-specify/.claude-plugin/plugin.json +15 -4
- package/plugins/devflow-typescript/.claude-plugin/plugin.json +10 -3
- package/scripts/hooks/{ambient-prompt.sh → ambient-prompt} +4 -4
- package/scripts/hooks/{background-memory-update.sh → background-memory-update} +29 -9
- package/scripts/hooks/{ensure-memory-gitignore.sh → ensure-memory-gitignore} +1 -1
- package/scripts/hooks/{pre-compact-memory.sh → pre-compact-memory} +2 -2
- package/scripts/hooks/run-hook +23 -0
- package/scripts/hooks/session-start-memory +151 -0
- package/scripts/hooks/{stop-update-memory.sh → stop-update-memory} +4 -4
- package/shared/skills/ambient-router/SKILL.md +15 -8
- package/shared/skills/ambient-router/references/skill-catalog.md +2 -2
- package/shared/skills/architecture-patterns/SKILL.md +1 -1
- package/shared/skills/complexity-patterns/SKILL.md +1 -1
- package/shared/skills/consistency-patterns/SKILL.md +1 -1
- package/shared/skills/database-patterns/SKILL.md +1 -1
- package/shared/skills/dependencies-patterns/SKILL.md +1 -1
- package/shared/skills/documentation-patterns/SKILL.md +1 -1
- package/shared/skills/performance-patterns/SKILL.md +1 -1
- package/shared/skills/regression-patterns/SKILL.md +1 -1
- package/shared/skills/review-methodology/SKILL.md +1 -1
- package/shared/skills/security-patterns/SKILL.md +1 -1
- package/shared/skills/self-review/SKILL.md +1 -1
- package/shared/skills/test-driven-development/SKILL.md +5 -8
- package/src/templates/settings.json +3 -3
- package/scripts/hooks/session-start-memory.sh +0 -126
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# SessionStart Hook
|
|
4
|
+
# Injects working memory AND ambient skill content as additionalContext.
|
|
5
|
+
# Memory: restores .memory/WORKING-MEMORY.md + patterns + git state + compact recovery.
|
|
6
|
+
# Ambient: injects ambient-router SKILL.md so Claude has it in context (no Read call needed).
|
|
7
|
+
# Either section can fire independently — ambient works even without memory files.
|
|
8
|
+
|
|
9
|
+
set -e
|
|
10
|
+
|
|
11
|
+
# jq is required to parse hook input JSON — silently no-op if missing
|
|
12
|
+
if ! command -v jq &>/dev/null; then exit 0; fi
|
|
13
|
+
|
|
14
|
+
INPUT=$(cat)
|
|
15
|
+
|
|
16
|
+
CWD=$(echo "$INPUT" | jq -r '.cwd // ""' 2>/dev/null)
|
|
17
|
+
if [ -z "$CWD" ]; then
|
|
18
|
+
exit 0
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
CONTEXT=""
|
|
22
|
+
|
|
23
|
+
# --- Section 1: Working Memory ---
|
|
24
|
+
|
|
25
|
+
MEMORY_FILE="$CWD/.memory/WORKING-MEMORY.md"
|
|
26
|
+
|
|
27
|
+
if [ -f "$MEMORY_FILE" ]; then
|
|
28
|
+
MEMORY_CONTENT=$(cat "$MEMORY_FILE")
|
|
29
|
+
|
|
30
|
+
# Read accumulated patterns if they exist
|
|
31
|
+
PATTERNS_FILE="$CWD/.memory/PROJECT-PATTERNS.md"
|
|
32
|
+
PATTERNS_CONTENT=""
|
|
33
|
+
if [ -f "$PATTERNS_FILE" ]; then
|
|
34
|
+
PATTERNS_CONTENT=$(cat "$PATTERNS_FILE")
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Compute staleness warning
|
|
38
|
+
if stat --version &>/dev/null 2>&1; then
|
|
39
|
+
FILE_MTIME=$(stat -c %Y "$MEMORY_FILE")
|
|
40
|
+
else
|
|
41
|
+
FILE_MTIME=$(stat -f %m "$MEMORY_FILE")
|
|
42
|
+
fi
|
|
43
|
+
NOW=$(date +%s)
|
|
44
|
+
AGE=$(( NOW - FILE_MTIME ))
|
|
45
|
+
|
|
46
|
+
# Check for pre-compact memory snapshot (compaction recovery)
|
|
47
|
+
BACKUP_FILE="$CWD/.memory/backup.json"
|
|
48
|
+
COMPACT_NOTE=""
|
|
49
|
+
if [ -f "$BACKUP_FILE" ]; then
|
|
50
|
+
BACKUP_MEMORY=$(jq -r '.memory_snapshot // ""' "$BACKUP_FILE" 2>/dev/null)
|
|
51
|
+
if [ -n "$BACKUP_MEMORY" ]; then
|
|
52
|
+
BACKUP_TS=$(jq -r '.timestamp // ""' "$BACKUP_FILE" 2>/dev/null)
|
|
53
|
+
BACKUP_EPOCH=0
|
|
54
|
+
if [ -n "$BACKUP_TS" ]; then
|
|
55
|
+
BACKUP_EPOCH=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$BACKUP_TS" +%s 2>/dev/null \
|
|
56
|
+
|| date -d "$BACKUP_TS" +%s 2>/dev/null \
|
|
57
|
+
|| echo "0")
|
|
58
|
+
fi
|
|
59
|
+
if [ "$BACKUP_EPOCH" -gt "$FILE_MTIME" ]; then
|
|
60
|
+
COMPACT_NOTE="
|
|
61
|
+
--- PRE-COMPACT SNAPSHOT ($BACKUP_TS) ---
|
|
62
|
+
Context was compacted. This snapshot may contain decisions or progress not yet in working memory.
|
|
63
|
+
|
|
64
|
+
$BACKUP_MEMORY
|
|
65
|
+
"
|
|
66
|
+
fi
|
|
67
|
+
fi
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
STALE_WARNING=""
|
|
71
|
+
if [ "$AGE" -gt 3600 ]; then
|
|
72
|
+
HOURS=$(( AGE / 3600 ))
|
|
73
|
+
STALE_WARNING="⚠ This working memory is ${HOURS}h old. Verify before relying on it.
|
|
74
|
+
|
|
75
|
+
"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# Capture fresh git state
|
|
79
|
+
GIT_BRANCH=""
|
|
80
|
+
GIT_STATUS=""
|
|
81
|
+
GIT_LOG=""
|
|
82
|
+
|
|
83
|
+
if cd "$CWD" 2>/dev/null && git rev-parse --git-dir >/dev/null 2>&1; then
|
|
84
|
+
GIT_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
85
|
+
GIT_STATUS=$(git status --porcelain 2>/dev/null | head -20)
|
|
86
|
+
GIT_LOG=$(git log --oneline -5 2>/dev/null || echo "")
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# Build memory context
|
|
90
|
+
CONTEXT="${STALE_WARNING}--- WORKING MEMORY (from previous session) ---
|
|
91
|
+
|
|
92
|
+
${MEMORY_CONTENT}"
|
|
93
|
+
|
|
94
|
+
# Insert accumulated patterns between working memory and git state
|
|
95
|
+
if [ -n "$PATTERNS_CONTENT" ]; then
|
|
96
|
+
CONTEXT="${CONTEXT}
|
|
97
|
+
|
|
98
|
+
--- PROJECT PATTERNS (accumulated) ---
|
|
99
|
+
|
|
100
|
+
${PATTERNS_CONTENT}"
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
CONTEXT="${CONTEXT}
|
|
104
|
+
|
|
105
|
+
--- CURRENT GIT STATE ---
|
|
106
|
+
Branch: ${GIT_BRANCH}
|
|
107
|
+
Recent commits:
|
|
108
|
+
${GIT_LOG}"
|
|
109
|
+
|
|
110
|
+
if [ -n "$GIT_STATUS" ]; then
|
|
111
|
+
CONTEXT="${CONTEXT}
|
|
112
|
+
Uncommitted changes:
|
|
113
|
+
${GIT_STATUS}"
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
if [ -n "$COMPACT_NOTE" ]; then
|
|
117
|
+
CONTEXT="${CONTEXT}
|
|
118
|
+
${COMPACT_NOTE}"
|
|
119
|
+
fi
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# --- Section 2: Ambient Skill Injection ---
|
|
123
|
+
|
|
124
|
+
# Inject ambient-router SKILL.md directly into context so Claude doesn't need a Read call.
|
|
125
|
+
# Only injects when ambient mode is enabled (UserPromptSubmit hook present in settings).
|
|
126
|
+
AMBIENT_SKILL_PATH="$HOME/.claude/skills/ambient-router/SKILL.md"
|
|
127
|
+
[ ! -f "$AMBIENT_SKILL_PATH" ] && AMBIENT_SKILL_PATH="$CWD/.claude/skills/ambient-router/SKILL.md"
|
|
128
|
+
|
|
129
|
+
SETTINGS_FILE="$HOME/.claude/settings.json"
|
|
130
|
+
if [ -f "$AMBIENT_SKILL_PATH" ] && [ -f "$SETTINGS_FILE" ] && grep -q "ambient-prompt" "$SETTINGS_FILE" 2>/dev/null; then
|
|
131
|
+
AMBIENT_SKILL_CONTENT=$(cat "$AMBIENT_SKILL_PATH")
|
|
132
|
+
CONTEXT="${CONTEXT}
|
|
133
|
+
|
|
134
|
+
--- AMBIENT ROUTER (auto-loaded) ---
|
|
135
|
+
${AMBIENT_SKILL_CONTENT}"
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# --- Output ---
|
|
139
|
+
|
|
140
|
+
# Only output if we have something to inject
|
|
141
|
+
if [ -z "$CONTEXT" ]; then
|
|
142
|
+
exit 0
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
# Output as additionalContext JSON envelope (Claude sees it as system context, not user-visible)
|
|
146
|
+
jq -n --arg ctx "$CONTEXT" '{
|
|
147
|
+
"hookSpecificOutput": {
|
|
148
|
+
"hookEventName": "SessionStart",
|
|
149
|
+
"additionalContext": $ctx
|
|
150
|
+
}
|
|
151
|
+
}'
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
# The session ends immediately — no visible edit in the TUI.
|
|
6
6
|
# On failure: does nothing (stale memory is better than fake data).
|
|
7
7
|
|
|
8
|
-
set -
|
|
8
|
+
set -e
|
|
9
9
|
|
|
10
10
|
# Break feedback loop: background updater's headless session triggers stop hook on exit.
|
|
11
|
-
# DEVFLOW_BG_UPDATER is set by background-memory-update
|
|
11
|
+
# DEVFLOW_BG_UPDATER is set by background-memory-update before invoking claude.
|
|
12
12
|
if [ "${DEVFLOW_BG_UPDATER:-}" = "1" ]; then exit 0; fi
|
|
13
13
|
|
|
14
14
|
# jq is required to parse hook input JSON — silently no-op if missing
|
|
@@ -24,7 +24,7 @@ fi
|
|
|
24
24
|
|
|
25
25
|
# Auto-create .memory/ and ensure .gitignore entries (idempotent after first run)
|
|
26
26
|
SCRIPT_DIR_EARLY="$(cd "$(dirname "$0")" && pwd)"
|
|
27
|
-
source "$SCRIPT_DIR_EARLY/ensure-memory-gitignore
|
|
27
|
+
source "$SCRIPT_DIR_EARLY/ensure-memory-gitignore" "$CWD" || exit 0
|
|
28
28
|
|
|
29
29
|
# Logging (shared log file with background updater; [stop-hook] prefix distinguishes)
|
|
30
30
|
MEMORY_FILE="$CWD/.memory/WORKING-MEMORY.md"
|
|
@@ -65,7 +65,7 @@ fi
|
|
|
65
65
|
|
|
66
66
|
# Resolve the background updater script (same directory as this hook)
|
|
67
67
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
68
|
-
UPDATER="$SCRIPT_DIR/background-memory-update
|
|
68
|
+
UPDATER="$SCRIPT_DIR/background-memory-update"
|
|
69
69
|
if [ ! -x "$UPDATER" ]; then
|
|
70
70
|
log "Skipped: updater not found/not executable at $UPDATER"
|
|
71
71
|
exit 0
|
|
@@ -36,7 +36,7 @@ Determine what the user is trying to do from their prompt.
|
|
|
36
36
|
| **EXPLORE** | "what is", "where is", "find", "show me", "explain", "how does" | "where is the config?", "explain this function" |
|
|
37
37
|
| **CHAT** | greetings, meta-questions, confirmations, short responses | "thanks", "yes", "what can you do?" |
|
|
38
38
|
|
|
39
|
-
**Ambiguous prompts:** Default to the lowest-overhead classification. "Update the README" → BUILD/
|
|
39
|
+
**Ambiguous prompts:** Default to the lowest-overhead classification. "Update the README" → BUILD/GUIDED. Git operations like "commit this" → QUICK.
|
|
40
40
|
|
|
41
41
|
## Step 2: Classify Depth
|
|
42
42
|
|
|
@@ -45,10 +45,10 @@ Determine how much enforcement the prompt warrants.
|
|
|
45
45
|
| Depth | Criteria | Action |
|
|
46
46
|
|-------|----------|--------|
|
|
47
47
|
| **QUICK** | CHAT intent. EXPLORE with no analytical depth ("where is X?"). Git/devops operations (commit, push, merge, branch, pr, deploy, reinstall). Single-word continuations. | Respond normally. Zero overhead. Do not state classification. |
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
48
|
+
| **GUIDED** | BUILD/DEBUG/REVIEW/PLAN intent (any word count). EXPLORE with analytical depth ("analyze our X", "discuss how Y works"). | Read and apply 2-3 relevant skills from the selection matrix below. State classification briefly. |
|
|
49
|
+
| **ELEVATE** | Multi-file architectural change, system-wide scope, > 5 files. Detailed implementation plan (100+ words with plan structure). | Respond at best effort + recommend: "This looks like it would benefit from `/implement` for full lifecycle management." |
|
|
50
50
|
|
|
51
|
-
## Step 3: Select Skills (
|
|
51
|
+
## Step 3: Select Skills (GUIDED depth only)
|
|
52
52
|
|
|
53
53
|
Based on classified intent, read the following skills to inform your response.
|
|
54
54
|
|
|
@@ -65,19 +65,26 @@ See `references/skill-catalog.md` for the full skill-to-intent mapping with file
|
|
|
65
65
|
|
|
66
66
|
## Step 4: Apply
|
|
67
67
|
|
|
68
|
+
<IMPORTANT>
|
|
69
|
+
When classification is GUIDED or ELEVATE, skill application is NON-NEGOTIABLE.
|
|
70
|
+
Do not rationalize skipping skills. Do not respond without loading them first.
|
|
71
|
+
If test-driven-development is selected, you MUST write the failing test before ANY production code.
|
|
72
|
+
</IMPORTANT>
|
|
73
|
+
|
|
68
74
|
- **QUICK:** Respond directly. No preamble, no classification statement.
|
|
69
|
-
- **
|
|
70
|
-
- **
|
|
75
|
+
- **GUIDED:** State classification briefly: `Ambient: BUILD/GUIDED. Loading: test-driven-development, implementation-patterns.` Then read the selected skills and apply their patterns. No exceptions.
|
|
76
|
+
- **ELEVATE:** Respond with your best effort, then append: `> This task spans multiple files/systems. Consider \`/implement\` for full lifecycle.`
|
|
71
77
|
|
|
72
78
|
---
|
|
73
79
|
|
|
74
80
|
## Transparency Rules
|
|
75
81
|
|
|
76
82
|
1. **QUICK → silent.** No classification output.
|
|
77
|
-
2. **
|
|
78
|
-
3. **
|
|
83
|
+
2. **GUIDED → brief statement + full skill enforcement.** One line: intent, depth, skills loaded. Then follow every skill requirement without shortcuts.
|
|
84
|
+
3. **ELEVATE → recommendation.** Best-effort response + workflow nudge.
|
|
79
85
|
4. **Never lie about classification.** If uncertain, say so.
|
|
80
86
|
5. **Never over-classify.** When in doubt, go one tier lower.
|
|
87
|
+
6. **Never under-apply.** Rationalization is the enemy of quality. If a skill requires a step, do the step.
|
|
81
88
|
|
|
82
89
|
## Edge Cases
|
|
83
90
|
|
|
@@ -4,7 +4,7 @@ Full mapping of DevFlow skills to ambient intents and file-type triggers. The am
|
|
|
4
4
|
|
|
5
5
|
## Skills Available for Ambient Loading
|
|
6
6
|
|
|
7
|
-
These skills may be loaded during
|
|
7
|
+
These skills may be loaded during GUIDED-depth ambient routing.
|
|
8
8
|
|
|
9
9
|
### BUILD Intent
|
|
10
10
|
|
|
@@ -65,4 +65,4 @@ These skills are loaded only by explicit DevFlow commands (primarily `/code-revi
|
|
|
65
65
|
- **Maximum 3 skills** per ambient response (primary + up to 2 secondary)
|
|
66
66
|
- **Primary skills** are always loaded for the classified intent
|
|
67
67
|
- **Secondary skills** are loaded only when file patterns match conversation context
|
|
68
|
-
- If more than 3 skills seem relevant, this is an
|
|
68
|
+
- If more than 3 skills seem relevant, this is an ELEVATE signal
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: architecture-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing code for SOLID violations, tight coupling, or layering issues.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: complexity-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing code for high cyclomatic complexity, deep nesting, or long functions.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: consistency-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing code for naming convention violations, pattern deviations, or inconsistent API styles.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: database-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing database queries, migrations, indexes, or schema changes.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dependencies-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing dependency changes, lock files, or package additions.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: documentation-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing for documentation drift, missing API docs, or stale comments.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: performance-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing code for N+1 queries, memory leaks, or I/O bottlenecks.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: regression-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing changes that may remove exports, change signatures, or alter behavior.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review-methodology
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when performing a code review to apply the standard 6-step review process.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Bash
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when reviewing code for injection flaws, auth bypasses, or hardcoded secrets.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob
|
|
6
6
|
---
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: self-review
|
|
3
|
-
description:
|
|
3
|
+
description: This skill should be used when evaluating implementation quality before submission, checking correctness, security, and simplicity.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
allowed-tools: Read, Grep, Glob, Edit, Write, Bash
|
|
6
6
|
---
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-driven-development
|
|
3
|
-
description:
|
|
4
|
-
Enforce RED-GREEN-REFACTOR cycle during implementation. Write failing tests before
|
|
5
|
-
production code. Distinct from test-patterns (which reviews test quality) — this
|
|
6
|
-
skill enforces the TDD workflow during code generation.
|
|
3
|
+
description: This skill should be used when implementing new features, fixing bugs, or writing new code. Enforces RED-GREEN-REFACTOR.
|
|
7
4
|
user-invocable: false
|
|
8
5
|
allowed-tools: Read, Grep, Glob
|
|
9
6
|
activation:
|
|
@@ -94,7 +91,7 @@ See `references/rationalization-prevention.md` for extended examples with code.
|
|
|
94
91
|
|
|
95
92
|
## Process Enforcement
|
|
96
93
|
|
|
97
|
-
When implementing any feature under ambient BUILD/
|
|
94
|
+
When implementing any feature under ambient BUILD/GUIDED:
|
|
98
95
|
|
|
99
96
|
1. **Identify the first behavior** — What is the simplest thing this feature must do?
|
|
100
97
|
2. **Write the test** — Describe that behavior as a failing test
|
|
@@ -133,7 +130,7 @@ When skipping TDD, never rationalize. State clearly: "Skipping TDD because: [spe
|
|
|
133
130
|
|
|
134
131
|
## Integration with Ambient Mode
|
|
135
132
|
|
|
136
|
-
- **BUILD/
|
|
133
|
+
- **BUILD/GUIDED** → TDD enforced. Every new function/method gets test-first treatment.
|
|
137
134
|
- **BUILD/QUICK** → TDD skipped (trivial single-file edit).
|
|
138
|
-
- **BUILD/
|
|
139
|
-
- **DEBUG/
|
|
135
|
+
- **BUILD/ELEVATE** → TDD mentioned in nudge toward `/implement`.
|
|
136
|
+
- **DEBUG/GUIDED** → TDD applies to the fix: write a test that reproduces the bug first, then fix.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"hooks": [
|
|
10
10
|
{
|
|
11
11
|
"type": "command",
|
|
12
|
-
"command": "${DEVFLOW_DIR}/scripts/hooks/stop-update-memory
|
|
12
|
+
"command": "${DEVFLOW_DIR}/scripts/hooks/run-hook stop-update-memory",
|
|
13
13
|
"timeout": 10
|
|
14
14
|
}
|
|
15
15
|
]
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"hooks": [
|
|
21
21
|
{
|
|
22
22
|
"type": "command",
|
|
23
|
-
"command": "${DEVFLOW_DIR}/scripts/hooks/session-start-memory
|
|
23
|
+
"command": "${DEVFLOW_DIR}/scripts/hooks/run-hook session-start-memory",
|
|
24
24
|
"timeout": 10
|
|
25
25
|
}
|
|
26
26
|
]
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"hooks": [
|
|
32
32
|
{
|
|
33
33
|
"type": "command",
|
|
34
|
-
"command": "${DEVFLOW_DIR}/scripts/hooks/pre-compact-memory
|
|
34
|
+
"command": "${DEVFLOW_DIR}/scripts/hooks/run-hook pre-compact-memory",
|
|
35
35
|
"timeout": 10
|
|
36
36
|
}
|
|
37
37
|
]
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Working Memory: SessionStart Hook
|
|
4
|
-
# Reads .memory/WORKING-MEMORY.md and injects it as additionalContext for the new session.
|
|
5
|
-
# Also captures fresh git state so Claude knows what's changed since the memory was written.
|
|
6
|
-
# Adds staleness warning if memory is >1 hour old.
|
|
7
|
-
|
|
8
|
-
set -euo pipefail
|
|
9
|
-
|
|
10
|
-
# jq is required to parse hook input JSON — silently no-op if missing
|
|
11
|
-
if ! command -v jq &>/dev/null; then exit 0; fi
|
|
12
|
-
|
|
13
|
-
INPUT=$(cat)
|
|
14
|
-
|
|
15
|
-
CWD=$(echo "$INPUT" | jq -r '.cwd // ""' 2>/dev/null)
|
|
16
|
-
if [ -z "$CWD" ]; then
|
|
17
|
-
exit 0
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
MEMORY_FILE="$CWD/.memory/WORKING-MEMORY.md"
|
|
21
|
-
|
|
22
|
-
# No memory file = nothing to restore (fresh project or first session)
|
|
23
|
-
if [ ! -f "$MEMORY_FILE" ]; then
|
|
24
|
-
exit 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
MEMORY_CONTENT=$(cat "$MEMORY_FILE")
|
|
28
|
-
|
|
29
|
-
# Read accumulated patterns if they exist
|
|
30
|
-
PATTERNS_FILE="$CWD/.memory/PROJECT-PATTERNS.md"
|
|
31
|
-
PATTERNS_CONTENT=""
|
|
32
|
-
if [ -f "$PATTERNS_FILE" ]; then
|
|
33
|
-
PATTERNS_CONTENT=$(cat "$PATTERNS_FILE")
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# Compute staleness warning
|
|
37
|
-
if stat --version &>/dev/null 2>&1; then
|
|
38
|
-
FILE_MTIME=$(stat -c %Y "$MEMORY_FILE")
|
|
39
|
-
else
|
|
40
|
-
FILE_MTIME=$(stat -f %m "$MEMORY_FILE")
|
|
41
|
-
fi
|
|
42
|
-
NOW=$(date +%s)
|
|
43
|
-
AGE=$(( NOW - FILE_MTIME ))
|
|
44
|
-
|
|
45
|
-
# Check for pre-compact memory snapshot (compaction recovery)
|
|
46
|
-
BACKUP_FILE="$CWD/.memory/backup.json"
|
|
47
|
-
COMPACT_NOTE=""
|
|
48
|
-
if [ -f "$BACKUP_FILE" ]; then
|
|
49
|
-
BACKUP_MEMORY=$(jq -r '.memory_snapshot // ""' "$BACKUP_FILE" 2>/dev/null)
|
|
50
|
-
if [ -n "$BACKUP_MEMORY" ]; then
|
|
51
|
-
BACKUP_TS=$(jq -r '.timestamp // ""' "$BACKUP_FILE" 2>/dev/null)
|
|
52
|
-
BACKUP_EPOCH=0
|
|
53
|
-
if [ -n "$BACKUP_TS" ]; then
|
|
54
|
-
BACKUP_EPOCH=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$BACKUP_TS" +%s 2>/dev/null \
|
|
55
|
-
|| date -d "$BACKUP_TS" +%s 2>/dev/null \
|
|
56
|
-
|| echo "0")
|
|
57
|
-
fi
|
|
58
|
-
if [ "$BACKUP_EPOCH" -gt "$FILE_MTIME" ]; then
|
|
59
|
-
COMPACT_NOTE="
|
|
60
|
-
--- PRE-COMPACT SNAPSHOT ($BACKUP_TS) ---
|
|
61
|
-
Context was compacted. This snapshot may contain decisions or progress not yet in working memory.
|
|
62
|
-
|
|
63
|
-
$BACKUP_MEMORY
|
|
64
|
-
"
|
|
65
|
-
fi
|
|
66
|
-
fi
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
STALE_WARNING=""
|
|
70
|
-
if [ "$AGE" -gt 3600 ]; then
|
|
71
|
-
HOURS=$(( AGE / 3600 ))
|
|
72
|
-
STALE_WARNING="⚠ This working memory is ${HOURS}h old. Verify before relying on it.
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# Capture fresh git state
|
|
78
|
-
GIT_BRANCH=""
|
|
79
|
-
GIT_STATUS=""
|
|
80
|
-
GIT_LOG=""
|
|
81
|
-
|
|
82
|
-
if cd "$CWD" 2>/dev/null && git rev-parse --git-dir >/dev/null 2>&1; then
|
|
83
|
-
GIT_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
84
|
-
GIT_STATUS=$(git status --porcelain 2>/dev/null | head -20)
|
|
85
|
-
GIT_LOG=$(git log --oneline -5 2>/dev/null || echo "")
|
|
86
|
-
fi
|
|
87
|
-
|
|
88
|
-
# Build context string
|
|
89
|
-
CONTEXT="${STALE_WARNING}--- WORKING MEMORY (from previous session) ---
|
|
90
|
-
|
|
91
|
-
${MEMORY_CONTENT}"
|
|
92
|
-
|
|
93
|
-
# Insert accumulated patterns between working memory and git state
|
|
94
|
-
if [ -n "$PATTERNS_CONTENT" ]; then
|
|
95
|
-
CONTEXT="${CONTEXT}
|
|
96
|
-
|
|
97
|
-
--- PROJECT PATTERNS (accumulated) ---
|
|
98
|
-
|
|
99
|
-
${PATTERNS_CONTENT}"
|
|
100
|
-
fi
|
|
101
|
-
|
|
102
|
-
CONTEXT="${CONTEXT}
|
|
103
|
-
|
|
104
|
-
--- CURRENT GIT STATE ---
|
|
105
|
-
Branch: ${GIT_BRANCH}
|
|
106
|
-
Recent commits:
|
|
107
|
-
${GIT_LOG}"
|
|
108
|
-
|
|
109
|
-
if [ -n "$GIT_STATUS" ]; then
|
|
110
|
-
CONTEXT="${CONTEXT}
|
|
111
|
-
Uncommitted changes:
|
|
112
|
-
${GIT_STATUS}"
|
|
113
|
-
fi
|
|
114
|
-
|
|
115
|
-
if [ -n "$COMPACT_NOTE" ]; then
|
|
116
|
-
CONTEXT="${CONTEXT}
|
|
117
|
-
${COMPACT_NOTE}"
|
|
118
|
-
fi
|
|
119
|
-
|
|
120
|
-
# Output as additionalContext JSON envelope (Claude sees it as system context, not user-visible)
|
|
121
|
-
jq -n --arg ctx "$CONTEXT" '{
|
|
122
|
-
"hookSpecificOutput": {
|
|
123
|
-
"hookEventName": "SessionStart",
|
|
124
|
-
"additionalContext": $ctx
|
|
125
|
-
}
|
|
126
|
-
}'
|