autoworkflow 3.1.4 → 3.5.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 (123) hide show
  1. package/.claude/commands/analyze.md +19 -0
  2. package/.claude/commands/audit.md +174 -11
  3. package/.claude/commands/build.md +39 -0
  4. package/.claude/commands/commit.md +25 -0
  5. package/.claude/commands/fix.md +23 -0
  6. package/.claude/commands/plan.md +18 -0
  7. package/.claude/commands/suggest.md +23 -0
  8. package/.claude/commands/verify.md +18 -0
  9. package/.claude/hooks/post-bash-router.sh +20 -0
  10. package/.claude/hooks/post-commit.sh +140 -0
  11. package/.claude/hooks/pre-edit.sh +129 -0
  12. package/.claude/hooks/session-check.sh +79 -0
  13. package/.claude/settings.json +40 -6
  14. package/.claude/settings.local.json +3 -1
  15. package/.claude/skills/actix.md +337 -0
  16. package/.claude/skills/alembic.md +504 -0
  17. package/.claude/skills/angular.md +237 -0
  18. package/.claude/skills/api-design.md +187 -0
  19. package/.claude/skills/aspnet-core.md +377 -0
  20. package/.claude/skills/astro.md +245 -0
  21. package/.claude/skills/auth-clerk.md +327 -0
  22. package/.claude/skills/auth-firebase.md +367 -0
  23. package/.claude/skills/auth-nextauth.md +359 -0
  24. package/.claude/skills/auth-supabase.md +368 -0
  25. package/.claude/skills/axum.md +386 -0
  26. package/.claude/skills/blazor.md +456 -0
  27. package/.claude/skills/chi.md +348 -0
  28. package/.claude/skills/code-review.md +133 -0
  29. package/.claude/skills/csharp.md +296 -0
  30. package/.claude/skills/css-modules.md +325 -0
  31. package/.claude/skills/cypress.md +343 -0
  32. package/.claude/skills/debugging.md +133 -0
  33. package/.claude/skills/diesel.md +392 -0
  34. package/.claude/skills/django.md +301 -0
  35. package/.claude/skills/docker.md +319 -0
  36. package/.claude/skills/doctrine.md +473 -0
  37. package/.claude/skills/documentation.md +182 -0
  38. package/.claude/skills/dotnet.md +409 -0
  39. package/.claude/skills/drizzle.md +293 -0
  40. package/.claude/skills/echo.md +321 -0
  41. package/.claude/skills/eloquent.md +256 -0
  42. package/.claude/skills/emotion.md +426 -0
  43. package/.claude/skills/entity-framework.md +370 -0
  44. package/.claude/skills/express.md +316 -0
  45. package/.claude/skills/fastapi.md +329 -0
  46. package/.claude/skills/fastify.md +299 -0
  47. package/.claude/skills/fiber.md +315 -0
  48. package/.claude/skills/flask.md +322 -0
  49. package/.claude/skills/gin.md +342 -0
  50. package/.claude/skills/git.md +116 -0
  51. package/.claude/skills/github-actions.md +353 -0
  52. package/.claude/skills/go.md +377 -0
  53. package/.claude/skills/gorm.md +409 -0
  54. package/.claude/skills/graphql.md +478 -0
  55. package/.claude/skills/hibernate.md +379 -0
  56. package/.claude/skills/hono.md +306 -0
  57. package/.claude/skills/java.md +400 -0
  58. package/.claude/skills/jest.md +313 -0
  59. package/.claude/skills/jpa.md +282 -0
  60. package/.claude/skills/kotlin.md +347 -0
  61. package/.claude/skills/kubernetes.md +363 -0
  62. package/.claude/skills/laravel.md +414 -0
  63. package/.claude/skills/mcp-browser.md +320 -0
  64. package/.claude/skills/mcp-database.md +219 -0
  65. package/.claude/skills/mcp-fetch.md +241 -0
  66. package/.claude/skills/mcp-filesystem.md +204 -0
  67. package/.claude/skills/mcp-github.md +217 -0
  68. package/.claude/skills/mcp-memory.md +240 -0
  69. package/.claude/skills/mcp-search.md +218 -0
  70. package/.claude/skills/mcp-slack.md +262 -0
  71. package/.claude/skills/micronaut.md +388 -0
  72. package/.claude/skills/mongodb.md +319 -0
  73. package/.claude/skills/mongoose.md +355 -0
  74. package/.claude/skills/mysql.md +281 -0
  75. package/.claude/skills/nestjs.md +335 -0
  76. package/.claude/skills/nextjs-app-router.md +260 -0
  77. package/.claude/skills/nextjs-pages.md +172 -0
  78. package/.claude/skills/nuxt.md +202 -0
  79. package/.claude/skills/openapi.md +489 -0
  80. package/.claude/skills/performance.md +199 -0
  81. package/.claude/skills/php.md +398 -0
  82. package/.claude/skills/playwright.md +371 -0
  83. package/.claude/skills/postgresql.md +257 -0
  84. package/.claude/skills/prisma.md +293 -0
  85. package/.claude/skills/pydantic.md +304 -0
  86. package/.claude/skills/pytest.md +313 -0
  87. package/.claude/skills/python.md +272 -0
  88. package/.claude/skills/quarkus.md +377 -0
  89. package/.claude/skills/react.md +230 -0
  90. package/.claude/skills/redis.md +391 -0
  91. package/.claude/skills/refactoring.md +143 -0
  92. package/.claude/skills/remix.md +246 -0
  93. package/.claude/skills/rest-api.md +490 -0
  94. package/.claude/skills/rocket.md +366 -0
  95. package/.claude/skills/rust.md +341 -0
  96. package/.claude/skills/sass.md +380 -0
  97. package/.claude/skills/sea-orm.md +382 -0
  98. package/.claude/skills/security.md +167 -0
  99. package/.claude/skills/sequelize.md +395 -0
  100. package/.claude/skills/spring-boot.md +416 -0
  101. package/.claude/skills/sqlalchemy.md +269 -0
  102. package/.claude/skills/sqlx-rust.md +408 -0
  103. package/.claude/skills/state-jotai.md +346 -0
  104. package/.claude/skills/state-mobx.md +353 -0
  105. package/.claude/skills/state-pinia.md +431 -0
  106. package/.claude/skills/state-redux.md +337 -0
  107. package/.claude/skills/state-tanstack-query.md +434 -0
  108. package/.claude/skills/state-zustand.md +340 -0
  109. package/.claude/skills/styled-components.md +403 -0
  110. package/.claude/skills/svelte.md +238 -0
  111. package/.claude/skills/sveltekit.md +207 -0
  112. package/.claude/skills/symfony.md +437 -0
  113. package/.claude/skills/tailwind.md +279 -0
  114. package/.claude/skills/terraform.md +394 -0
  115. package/.claude/skills/testing-library.md +371 -0
  116. package/.claude/skills/trpc.md +426 -0
  117. package/.claude/skills/typeorm.md +368 -0
  118. package/.claude/skills/vitest.md +330 -0
  119. package/.claude/skills/vue.md +202 -0
  120. package/.claude/skills/warp.md +365 -0
  121. package/README.md +135 -52
  122. package/package.json +1 -1
  123. package/system/triggers.md +152 -11
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  > Automated workflow enforcement for Claude Code via hooks and system prompts.
4
4
 
5
- When you use Claude Code with AutoWorkflow, hooks automatically trigger checks and Claude follows a structured workflow for all coding tasks.
5
+ **v3.5.0** - Full hook enforcement, 106 skills library, agent-structured commands.
6
+
7
+ When you use Claude Code with AutoWorkflow, hooks automatically enforce workflow phases, block unauthorized edits, and guide Claude through a structured process for all coding tasks.
6
8
 
7
9
  ---
8
10
 
@@ -19,35 +21,66 @@ Options:
19
21
 
20
22
  ---
21
23
 
24
+ ## What's New in v3.5.0
25
+
26
+ ### Hook-Based Enforcement (Not Just Instructions)
27
+
28
+ | Hook | Event | Enforcement |
29
+ |------|-------|-------------|
30
+ | `pre-edit.sh` | PreToolUse (Write/Edit) | **BLOCKS** edits without plan approval |
31
+ | `post-commit.sh` | PostToolUse (Bash) | Auto-triggers BLUEPRINT update reminder |
32
+ | `session-check.sh` | UserPromptSubmit | Session resume with state display |
33
+
34
+ ### 106 Skills Library
35
+ Claude loads relevant skills for each command:
36
+ - Security patterns, debugging techniques, code review checklists
37
+ - Framework-specific knowledge (React, Next.js, etc.)
38
+ - Auto-loaded via `skills_required` in command frontmatter
39
+
40
+ ### Agent-Structured Commands
41
+ Each command has a role, output schema, and guardrails:
42
+ ```yaml
43
+ ---
44
+ role: Senior Code Reviewer
45
+ skills_required:
46
+ - security.md
47
+ - code-review.md
48
+ output_schema:
49
+ issues: [{severity, file, line, message}]
50
+ guardrails:
51
+ - Prioritize security issues above all else
52
+ ---
53
+ ```
54
+
55
+ ---
56
+
22
57
  ## How It Works
23
58
 
24
59
  ```
25
60
  ┌─────────────────────────────────────────────────────────────┐
26
61
  │ HOOKS (Automatic) │
27
62
  │ │
28
- │ UserPromptSubmit → session-check.sh
29
- PostToolUse post-edit.sh (after Write/Edit)
30
- │ PreToolUse → pre-commit-check.sh (before git)
63
+ │ UserPromptSubmit → session-check.sh (resume, blueprint)
64
+ PreToolUse pre-edit.sh (BLOCKS without approval)
65
+ │ PreToolUse → pre-commit-check.sh (BLOCKS bad code)
66
+ │ PostToolUse → post-edit.sh (verification loop) │
67
+ │ PostToolUse → post-commit.sh (BLUEPRINT reminder) │
31
68
  │ │
32
- │ Hooks output messages that Claude sees as instructions
69
+ │ Hooks ENFORCE workflow - they physically block actions
33
70
  └─────────────────────────────────────────────────────────────┘
34
71
 
35
72
 
36
73
  ┌─────────────────────────────────────────────────────────────┐
37
74
  │ settings.json (System Prompt) │
38
75
  │ │
39
- "instructions": [
40
- │ "SESSION START: If BLUEPRINT.md missing, scan codebase" │
41
- │ "AFTER CODE CHANGES: Run npm run verify" │
42
- │ "BEFORE COMMIT: Block if TODO/console.log found" │
43
- │ ] │
76
+ Workflow instructions + skill loading + task types
44
77
  └─────────────────────────────────────────────────────────────┘
45
78
 
46
79
 
47
80
  ┌─────────────────────────────────────────────────────────────┐
48
- CLAUDE.md + instructions/
81
+ .claude/skills/ (106 Knowledge Files)
49
82
  │ │
50
- Workflow details, gates, task types, coding standards
83
+ Security, debugging, frameworks, patterns, best practices
51
84
  └─────────────────────────────────────────────────────────────┘
52
85
  ```
53
86
 
@@ -57,18 +90,21 @@ Options:
57
90
 
58
91
  ```
59
92
  ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → UPDATE
93
+ ↑ ↑ ↑
94
+ BLOCKING BLOCKING BLOCKING
95
+ GATE GATE GATE
60
96
  ```
61
97
 
62
- | Phase | What Happens |
63
- |-------|--------------|
64
- | ANALYZE | Read relevant files, check BLUEPRINT.md |
65
- | PLAN | Design approach, show suggestions |
66
- | CONFIRM | Wait for user approval |
67
- | IMPLEMENT | Make changes (after approval only) |
68
- | VERIFY | Run `npm run verify` (auto-triggered by hook) |
69
- | AUDIT | Check orphan features + circular deps |
70
- | COMMIT | Conventional commit format |
71
- | UPDATE | Update BLUEPRINT.md if needed |
98
+ | Phase | What Happens | Enforcement |
99
+ |-------|--------------|-------------|
100
+ | ANALYZE | Read relevant files, check BLUEPRINT.md | - |
101
+ | PLAN | Design approach, show 3-tier suggestions | - |
102
+ | CONFIRM | Wait for user approval | **pre-edit.sh BLOCKS edits** |
103
+ | IMPLEMENT | Make changes (after approval only) | Allowed after approval |
104
+ | VERIFY | Run `npm run verify` (max 10 iterations) | Auto-triggered by hook |
105
+ | AUDIT | Check orphan features + circular deps | Required for features |
106
+ | COMMIT | Conventional commit format | **pre-commit.sh BLOCKS bad commits** |
107
+ | UPDATE | Update BLUEPRINT.md if needed | **post-commit.sh reminder** |
72
108
 
73
109
  ---
74
110
 
@@ -76,20 +112,55 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
76
112
 
77
113
  | Hook | Trigger | Action |
78
114
  |------|---------|--------|
79
- | `session-check.sh` | Every user message | Check if BLUEPRINT.md exists, prompt audit if missing |
80
- | `post-edit.sh` | After Write/Edit | Remind to run verification |
81
- | `pre-commit-check.sh` | Before git commit | Block if TODO/FIXME/console.log found |
115
+ | `session-check.sh` | Every user message | Resume previous session, check BLUEPRINT.md |
116
+ | `pre-edit.sh` | Before Write/Edit | **BLOCK if plan not approved** |
117
+ | `post-edit.sh` | After Write/Edit | Run verification loop (max 10 iterations) |
118
+ | `pre-commit-check.sh` | Before git commit | **BLOCK if TODO/console.log/errors** |
119
+ | `post-commit.sh` | After git commit | Remind to update BLUEPRINT.md |
82
120
 
83
121
  ---
84
122
 
85
123
  ## Blocking Gates
86
124
 
87
- | Gate | Blocks If |
88
- |------|-----------|
89
- | Plan Approval | User hasn't approved the plan |
90
- | Verify | TypeScript or ESLint errors exist |
91
- | Audit | Orphan features or circular dependencies |
92
- | Pre-Commit | TODO/FIXME, console.log, bad commit format |
125
+ | Gate | Blocks If | Enforced By |
126
+ |------|-----------|-------------|
127
+ | Plan Approval | User hasn't approved the plan | `pre-edit.sh` (exit 1) |
128
+ | Verify | TypeScript or ESLint errors exist | `post-edit.sh` loop |
129
+ | Audit | Orphan features or circular dependencies | Required before commit |
130
+ | Pre-Commit | TODO/FIXME, console.log, bad format | `pre-commit-check.sh` (exit 1) |
131
+
132
+ ---
133
+
134
+ ## 3-Tier Suggestions
135
+
136
+ For feature tasks, Claude provides categorized suggestions:
137
+
138
+ | Tier | Priority | Examples |
139
+ |------|----------|----------|
140
+ | 🔴 Required | Must implement | Error handling, loading states, validation |
141
+ | 🟡 Recommended | Improves quality | Empty states, keyboard navigation |
142
+ | 🟢 Optional | Nice to have | Unit tests, analytics, optimizations |
143
+
144
+ ---
145
+
146
+ ## Session Resume
147
+
148
+ When returning to an interrupted session:
149
+
150
+ ```
151
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
152
+ 📍 AUTOWORKFLOW: SESSION RESUME
153
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
154
+
155
+ Previous session state detected:
156
+
157
+ Phase: IMPLEMENT
158
+ Task type: feature
159
+ Plan approved: true
160
+ Verify attempts: 2/10
161
+
162
+ Continue from IMPLEMENT phase, or start fresh?
163
+ ```
93
164
 
94
165
  ---
95
166
 
@@ -97,23 +168,30 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
97
168
 
98
169
  ```
99
170
  project/
100
- ├── CLAUDE.md # Workflow + gates (auto-read)
171
+ ├── CLAUDE.md # Workflow summary (auto-read)
101
172
 
102
173
  ├── .claude/
103
- │ ├── settings.json # System prompt + hooks config
104
- │ ├── hooks/ # Auto-trigger scripts
105
- │ │ ├── session-check.sh
106
- │ │ ├── post-edit.sh
107
- │ │ └── pre-commit-check.sh
108
- └── commands/ # Slash commands
174
+ │ ├── settings.json # Hooks + system prompt
175
+ │ ├── hooks/ # Enforcement scripts
176
+ │ │ ├── session-check.sh # Resume + blueprint check
177
+ │ │ ├── pre-edit.sh # Plan approval gate
178
+ │ │ ├── post-edit.sh # Verification loop
179
+ │ ├── pre-commit-check.sh
180
+ │ │ └── post-commit.sh # BLUEPRINT reminder
181
+ │ ├── commands/ # Slash commands (with agent structure)
182
+ │ └── skills/ # 106 knowledge files
109
183
 
110
184
  ├── instructions/
111
185
  │ ├── AI_RULES.md # Your coding standards
112
186
  │ └── BLUEPRINT.md # Project spec (auto-generated)
113
187
 
114
- ├── scripts/ # Automation scripts
115
- ├── hooks/ # Git hooks (backup enforcement)
116
- └── .vscode/ # VS Code settings (optional)
188
+ ├── system/ # Detailed reference
189
+ ├── gates.md # Blocking checkpoint definitions
190
+ │ ├── loops.md # Verify/fix cycle definitions
191
+ │ ├── triggers.md # Event → action mappings
192
+ │ └── router.md # Task type classification
193
+
194
+ └── scripts/ # Automation scripts
117
195
  ```
118
196
 
119
197
  ---
@@ -135,15 +213,17 @@ npm run audit:all # Run all audits
135
213
  ```
136
214
 
137
215
  ### Slash Commands
138
- | Command | Purpose |
139
- |---------|---------|
140
- | `/analyze [task]` | Analyze codebase |
141
- | `/plan [task]` | Create implementation plan |
142
- | `/build [feature]` | Full workflow |
143
- | `/verify` | Run verification |
144
- | `/audit` | Run audits |
145
- | `/audit project` | Full scan generate BLUEPRINT.md |
146
- | `/commit` | Pre-commit check + commit |
216
+ | Command | Role | Purpose |
217
+ |---------|------|---------|
218
+ | `/analyze [task]` | Technical Analyst | Analyze codebase, classify task |
219
+ | `/plan [task]` | Project Manager | Create implementation plan |
220
+ | `/suggest [task]` | Technical Advisor | Generate 3-tier suggestions |
221
+ | `/build [feature]` | Full-Stack Engineer | Full workflow with tech detection |
222
+ | `/verify` | QA Engineer | Run verification loop |
223
+ | `/fix` | Debug Engineer | Fix verification errors |
224
+ | `/audit` | Code Reviewer | Security + quality audit |
225
+ | `/audit project` | Code Reviewer | Full scan → generate BLUEPRINT.md |
226
+ | `/commit` | Git Specialist | Pre-commit check + commit |
147
227
 
148
228
  ---
149
229
 
@@ -165,13 +245,16 @@ Edit `instructions/AI_RULES.md`:
165
245
  Edit `.claude/settings.json` gates section.
166
246
 
167
247
  ### Modify Hooks
168
- Edit files in `.claude/hooks/` to change auto-trigger behavior.
248
+ Edit files in `.claude/hooks/` to change enforcement behavior.
249
+
250
+ ### Add Skills
251
+ Add `.md` files to `.claude/skills/` and reference in command frontmatter.
169
252
 
170
253
  ---
171
254
 
172
255
  ## Requirements
173
256
 
174
- - VS Code with Claude Code extension
257
+ - VS Code with Claude Code extension (or Claude Code CLI)
175
258
  - Node.js 18+ (for npm scripts)
176
259
  - TypeScript, ESLint, Prettier (for verification)
177
260
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoworkflow",
3
- "version": "3.1.4",
3
+ "version": "3.5.0",
4
4
  "description": "Automated workflow enforcement for Claude Code via hooks and system prompts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,14 +12,17 @@
12
12
  | Trigger | Hook Script | Event |
13
13
  |---------|-------------|-------|
14
14
  | `on:conversation_start` | `session-check.sh` | UserPromptSubmit |
15
+ | `on:session_resume` | `session-check.sh` | UserPromptSubmit |
15
16
  | `on:blueprint_missing` | `session-check.sh` + `blueprint-generator.sh` | UserPromptSubmit |
16
17
  | `on:init_needed` | `session-check.sh` | UserPromptSubmit |
17
18
  | `on:task_received` | `session-check.sh` | UserPromptSubmit |
18
19
  | `on:phase_transition` | `phase-transition.sh` | Manual call |
20
+ | `on:pre_implementation_check` | `pre-edit.sh` | PreToolUse (Write\|Edit) |
19
21
  | `on:implementation_complete` | `post-edit.sh` | PostToolUse (Write\|Edit) |
20
22
  | `on:verification_failed` | `post-edit.sh` | PostToolUse (Write\|Edit) |
21
23
  | `on:verification_passed` | `post-edit.sh` | PostToolUse (Write\|Edit) |
22
24
  | `on:commit_requested` | `pre-tool-router.sh` → `pre-commit-check.sh` | PreToolUse (Bash) |
25
+ | `on:feature_complete` | `post-bash-router.sh` → `post-commit.sh` | PostToolUse (Bash) |
23
26
 
24
27
  ---
25
28
 
@@ -38,9 +41,10 @@ All workflow state is stored in `.claude/.autoworkflow/`:
38
41
  ├── audit-status # PASSED/FAILED/BLOCKED
39
42
  ├── gate-status # Last gate check result
40
43
  ├── gate-errors # Number of gate errors
41
- ├── plan-approved # Plan approval status
44
+ ├── plan-approved # Plan approval status (true/false)
42
45
  ├── changed-files # List of modified files
43
- └── blueprint-checked # Blueprint check done flag
46
+ ├── blueprint-checked # Blueprint check done flag
47
+ └── session-resumed # Session resume prompt shown flag
44
48
  ```
45
49
 
46
50
  ---
@@ -81,6 +85,93 @@ All workflow state is stored in `.claude/.autoworkflow/`:
81
85
 
82
86
  ---
83
87
 
88
+ ### `on:session_resume`
89
+
90
+ **When:** Existing session state detected (non-IDLE phase)
91
+ **Hook:** `.claude/hooks/session-check.sh`
92
+ **Function:** `check_session_resume()`
93
+ **Event:** `UserPromptSubmit`
94
+
95
+ **Trigger Condition:** Previous session has active state (phase != IDLE)
96
+
97
+ **Actions:**
98
+ 1. Detect previous session state
99
+ 2. Show resume prompt with context:
100
+ - Current phase
101
+ - Task type
102
+ - Plan approval status
103
+ - Verify iteration count
104
+ - Changed files (if any)
105
+ 3. Offer to continue or start fresh
106
+ 4. Mark resume prompt as shown (only show once)
107
+
108
+ **Output:**
109
+ ```
110
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
111
+ 📍 AUTOWORKFLOW: SESSION RESUME
112
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
113
+
114
+ Previous session state detected:
115
+
116
+ Phase: IMPLEMENT
117
+ Task type: feature
118
+ Plan approved: true
119
+ Verify attempts: 2/10
120
+
121
+ Pending changes:
122
+ - src/components/Button.tsx
123
+ - src/hooks/useAuth.ts
124
+
125
+ Workflow: ANALYZE → PLAN → CONFIRM → IMPLEMENT → ...
126
+ ↑ Current: IMPLEMENT
127
+
128
+ Continue from IMPLEMENT phase, or start fresh?
129
+ ```
130
+
131
+ ---
132
+
133
+ ### `on:pre_implementation_check`
134
+
135
+ **When:** Claude attempts to Write/Edit a file
136
+ **Hook:** `.claude/hooks/pre-edit.sh`
137
+ **Event:** `PreToolUse` for `Write|Edit`
138
+
139
+ **Purpose:** ENFORCE plan approval before any code changes
140
+
141
+ **Gate Check:**
142
+ 1. Get current phase from state
143
+ 2. Get task type from state
144
+ 3. Check if task requires approval (feature/fix/refactor)
145
+ 4. If in ANALYZE or PLAN phase AND approval required:
146
+ - Check if `plan-approved` is set to "true"
147
+ - If NOT → **BLOCK the edit** (exit code 1)
148
+ - If YES → Allow the edit
149
+
150
+ **Output on BLOCK:**
151
+ ```
152
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153
+ ⛔ AUTOWORKFLOW: PLAN APPROVAL REQUIRED
154
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
155
+
156
+ Current Phase: PLAN
157
+ Task Type: feature
158
+ Plan Approved: NO
159
+
160
+ Cannot edit files before plan approval.
161
+
162
+ Required workflow:
163
+ 1. Complete ANALYZE phase (read relevant files)
164
+ 2. Present PLAN with suggestions
165
+ 3. Wait for user approval
166
+ 4. THEN implement
167
+ ```
168
+
169
+ **Bypass conditions:**
170
+ - Task type is `docs`, `style`, `config`, or `query`
171
+ - Phase is already IMPLEMENT or later
172
+
173
+ ---
174
+
84
175
  ### `on:blueprint_missing`
85
176
 
86
177
  **When:** BLUEPRINT.md does not exist at session start
@@ -314,13 +405,49 @@ AUTOWORKFLOW: PRE-COMMIT GATE
314
405
 
315
406
  ### `on:feature_complete`
316
407
 
317
- **When:** A new feature, route, or API is successfully committed
318
- **Handling:** Manual check after commit
408
+ **When:** A git commit is successfully executed (detected by post-bash-router)
409
+ **Hook:** `.claude/hooks/post-bash-router.sh` `.claude/hooks/post-commit.sh`
410
+ **Event:** `PostToolUse` for `Bash` (git commit commands)
411
+
412
+ **Behavior:** AUTOMATIC after every git commit
319
413
 
320
414
  **Actions:**
321
- 1. Check if BLUEPRINT.md needs updating
322
- 2. Present proposed updates
323
- 3. Update after approval
415
+ 1. Display commit summary (hash, message, files)
416
+ 2. Check if commit type is `feat` or `refactor`
417
+ 3. If yes → Show UPDATE phase reminder:
418
+ - List potential new routes
419
+ - List potential new APIs
420
+ - List potential new components
421
+ 4. Remind to update BLUEPRINT.md if needed
422
+ 5. Reset workflow state to IDLE
423
+
424
+ **Output:**
425
+ ```
426
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
427
+ ✅ AUTOWORKFLOW: COMMIT COMPLETE
428
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
429
+
430
+ Hash: abc1234
431
+ Message: feat(auth): add login page
432
+ Files: 3 changed
433
+
434
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
435
+ 📘 AUTOWORKFLOW: UPDATE PHASE
436
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
437
+
438
+ This commit may have added new features/routes/APIs.
439
+
440
+ Check if BLUEPRINT.md needs updating:
441
+
442
+ 1. New routes/pages added?
443
+ 2. New API endpoints added?
444
+ 3. New features/components added?
445
+
446
+ Potential new routes:
447
+ - src/pages/Login.tsx
448
+
449
+ Action: Review and update instructions/BLUEPRINT.md if needed.
450
+ ```
324
451
 
325
452
  ---
326
453
 
@@ -399,21 +526,35 @@ All hooks are configured in `.claude/settings.json`:
399
526
  }]
400
527
  }
401
528
  ],
402
- "PostToolUse": [
529
+ "PreToolUse": [
403
530
  {
404
531
  "matcher": "Write|Edit",
405
532
  "hooks": [{
406
533
  "type": "command",
407
- "command": "./.claude/hooks/post-edit.sh"
534
+ "command": "./.claude/hooks/pre-edit.sh"
535
+ }]
536
+ },
537
+ {
538
+ "matcher": "Bash",
539
+ "hooks": [{
540
+ "type": "command",
541
+ "command": "./.claude/hooks/pre-tool-router.sh \"$TOOL_INPUT\""
408
542
  }]
409
543
  }
410
544
  ],
411
- "PreToolUse": [
545
+ "PostToolUse": [
546
+ {
547
+ "matcher": "Write|Edit",
548
+ "hooks": [{
549
+ "type": "command",
550
+ "command": "./.claude/hooks/post-edit.sh"
551
+ }]
552
+ },
412
553
  {
413
554
  "matcher": "Bash",
414
555
  "hooks": [{
415
556
  "type": "command",
416
- "command": "./.claude/hooks/pre-tool-router.sh \"$TOOL_INPUT\""
557
+ "command": "./.claude/hooks/post-bash-router.sh \"$TOOL_INPUT\""
417
558
  }]
418
559
  }
419
560
  ]