autoworkflow 3.1.5 → 3.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/commands/analyze.md +19 -0
- package/.claude/commands/audit.md +26 -0
- package/.claude/commands/build.md +39 -0
- package/.claude/commands/commit.md +25 -0
- package/.claude/commands/fix.md +23 -0
- package/.claude/commands/plan.md +18 -0
- package/.claude/commands/suggest.md +23 -0
- package/.claude/commands/verify.md +18 -0
- package/.claude/hooks/post-bash-router.sh +20 -0
- package/.claude/hooks/post-commit.sh +140 -0
- package/.claude/hooks/post-edit.sh +190 -17
- package/.claude/hooks/pre-edit.sh +221 -0
- package/.claude/hooks/session-check.sh +90 -0
- package/.claude/settings.json +56 -6
- package/.claude/settings.local.json +5 -1
- package/.claude/skills/actix.md +337 -0
- package/.claude/skills/alembic.md +504 -0
- package/.claude/skills/angular.md +237 -0
- package/.claude/skills/api-design.md +187 -0
- package/.claude/skills/aspnet-core.md +377 -0
- package/.claude/skills/astro.md +245 -0
- package/.claude/skills/auth-clerk.md +327 -0
- package/.claude/skills/auth-firebase.md +367 -0
- package/.claude/skills/auth-nextauth.md +359 -0
- package/.claude/skills/auth-supabase.md +368 -0
- package/.claude/skills/axum.md +386 -0
- package/.claude/skills/blazor.md +456 -0
- package/.claude/skills/chi.md +348 -0
- package/.claude/skills/code-review.md +133 -0
- package/.claude/skills/csharp.md +296 -0
- package/.claude/skills/css-modules.md +325 -0
- package/.claude/skills/cypress.md +343 -0
- package/.claude/skills/debugging.md +133 -0
- package/.claude/skills/diesel.md +392 -0
- package/.claude/skills/django.md +301 -0
- package/.claude/skills/docker.md +319 -0
- package/.claude/skills/doctrine.md +473 -0
- package/.claude/skills/documentation.md +182 -0
- package/.claude/skills/dotnet.md +409 -0
- package/.claude/skills/drizzle.md +293 -0
- package/.claude/skills/echo.md +321 -0
- package/.claude/skills/eloquent.md +256 -0
- package/.claude/skills/emotion.md +426 -0
- package/.claude/skills/entity-framework.md +370 -0
- package/.claude/skills/express.md +316 -0
- package/.claude/skills/fastapi.md +329 -0
- package/.claude/skills/fastify.md +299 -0
- package/.claude/skills/fiber.md +315 -0
- package/.claude/skills/flask.md +322 -0
- package/.claude/skills/gin.md +342 -0
- package/.claude/skills/git.md +116 -0
- package/.claude/skills/github-actions.md +353 -0
- package/.claude/skills/go.md +377 -0
- package/.claude/skills/gorm.md +409 -0
- package/.claude/skills/graphql.md +478 -0
- package/.claude/skills/hibernate.md +379 -0
- package/.claude/skills/hono.md +306 -0
- package/.claude/skills/java.md +400 -0
- package/.claude/skills/jest.md +313 -0
- package/.claude/skills/jpa.md +282 -0
- package/.claude/skills/kotlin.md +347 -0
- package/.claude/skills/kubernetes.md +363 -0
- package/.claude/skills/laravel.md +414 -0
- package/.claude/skills/mcp-browser.md +320 -0
- package/.claude/skills/mcp-database.md +219 -0
- package/.claude/skills/mcp-fetch.md +241 -0
- package/.claude/skills/mcp-filesystem.md +204 -0
- package/.claude/skills/mcp-github.md +217 -0
- package/.claude/skills/mcp-memory.md +240 -0
- package/.claude/skills/mcp-search.md +218 -0
- package/.claude/skills/mcp-slack.md +262 -0
- package/.claude/skills/micronaut.md +388 -0
- package/.claude/skills/mongodb.md +319 -0
- package/.claude/skills/mongoose.md +355 -0
- package/.claude/skills/mysql.md +281 -0
- package/.claude/skills/nestjs.md +335 -0
- package/.claude/skills/nextjs-app-router.md +260 -0
- package/.claude/skills/nextjs-pages.md +172 -0
- package/.claude/skills/nuxt.md +202 -0
- package/.claude/skills/openapi.md +489 -0
- package/.claude/skills/performance.md +199 -0
- package/.claude/skills/php.md +398 -0
- package/.claude/skills/playwright.md +371 -0
- package/.claude/skills/postgresql.md +257 -0
- package/.claude/skills/prisma.md +293 -0
- package/.claude/skills/pydantic.md +304 -0
- package/.claude/skills/pytest.md +313 -0
- package/.claude/skills/python.md +272 -0
- package/.claude/skills/quarkus.md +377 -0
- package/.claude/skills/react.md +230 -0
- package/.claude/skills/redis.md +391 -0
- package/.claude/skills/refactoring.md +143 -0
- package/.claude/skills/remix.md +246 -0
- package/.claude/skills/rest-api.md +490 -0
- package/.claude/skills/rocket.md +366 -0
- package/.claude/skills/rust.md +341 -0
- package/.claude/skills/sass.md +380 -0
- package/.claude/skills/sea-orm.md +382 -0
- package/.claude/skills/security.md +167 -0
- package/.claude/skills/sequelize.md +395 -0
- package/.claude/skills/spring-boot.md +416 -0
- package/.claude/skills/sqlalchemy.md +269 -0
- package/.claude/skills/sqlx-rust.md +408 -0
- package/.claude/skills/state-jotai.md +346 -0
- package/.claude/skills/state-mobx.md +353 -0
- package/.claude/skills/state-pinia.md +431 -0
- package/.claude/skills/state-redux.md +337 -0
- package/.claude/skills/state-tanstack-query.md +434 -0
- package/.claude/skills/state-zustand.md +340 -0
- package/.claude/skills/styled-components.md +403 -0
- package/.claude/skills/svelte.md +238 -0
- package/.claude/skills/sveltekit.md +207 -0
- package/.claude/skills/symfony.md +437 -0
- package/.claude/skills/tailwind.md +279 -0
- package/.claude/skills/terraform.md +394 -0
- package/.claude/skills/testing-library.md +371 -0
- package/.claude/skills/trpc.md +426 -0
- package/.claude/skills/typeorm.md +368 -0
- package/.claude/skills/vitest.md +330 -0
- package/.claude/skills/vue.md +202 -0
- package/.claude/skills/warp.md +365 -0
- package/README.md +163 -52
- package/package.json +1 -1
- package/system/triggers.md +256 -17
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
|
-
|
|
5
|
+
**v3.6.0** - Multi-language support, one-fix-at-a-time enforcement, suggestions gate.
|
|
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,94 @@ Options:
|
|
|
19
21
|
|
|
20
22
|
---
|
|
21
23
|
|
|
24
|
+
## What's New in v3.6.0
|
|
25
|
+
|
|
26
|
+
### Multi-Language Project Support
|
|
27
|
+
Automatic verification for any project type:
|
|
28
|
+
|
|
29
|
+
| Project Type | Detection | Verification |
|
|
30
|
+
|--------------|-----------|--------------|
|
|
31
|
+
| Node.js | `package.json` | TypeScript + ESLint |
|
|
32
|
+
| PHP | `composer.json` | PHPStan, PHP-CS-Fixer |
|
|
33
|
+
| Python | `pyproject.toml` | mypy, ruff, flake8 |
|
|
34
|
+
| Rust | `Cargo.toml` | cargo check + clippy |
|
|
35
|
+
| Go | `go.mod` | go vet + golangci-lint |
|
|
36
|
+
|
|
37
|
+
### One-Fix-At-A-Time Enforcement
|
|
38
|
+
Claude MUST fix issues incrementally:
|
|
39
|
+
- ❌ "I found 14 issues, fixing them all now..."
|
|
40
|
+
- ✅ "I found 14 issues. Here are my suggestions. Which first?"
|
|
41
|
+
|
|
42
|
+
### 3-Tier Suggestions Gate
|
|
43
|
+
For feature tasks, Claude MUST show categorized suggestions:
|
|
44
|
+
- 🔴 **Required** - Must implement
|
|
45
|
+
- 🟡 **Recommended** - Should implement
|
|
46
|
+
- 🟢 **Optional** - Nice to have
|
|
47
|
+
|
|
48
|
+
Hook blocks implementation until suggestions are shown and user selects items.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What's New in v3.5.0
|
|
53
|
+
|
|
54
|
+
### Hook-Based Enforcement (Not Just Instructions)
|
|
55
|
+
|
|
56
|
+
| Hook | Event | Enforcement |
|
|
57
|
+
|------|-------|-------------|
|
|
58
|
+
| `pre-edit.sh` | PreToolUse (Write/Edit) | **BLOCKS** edits without plan approval |
|
|
59
|
+
| `post-commit.sh` | PostToolUse (Bash) | Auto-triggers BLUEPRINT update reminder |
|
|
60
|
+
| `session-check.sh` | UserPromptSubmit | Session resume with state display |
|
|
61
|
+
|
|
62
|
+
### 106 Skills Library
|
|
63
|
+
Claude loads relevant skills for each command:
|
|
64
|
+
- Security patterns, debugging techniques, code review checklists
|
|
65
|
+
- Framework-specific knowledge (React, Next.js, etc.)
|
|
66
|
+
- Auto-loaded via `skills_required` in command frontmatter
|
|
67
|
+
|
|
68
|
+
### Agent-Structured Commands
|
|
69
|
+
Each command has a role, output schema, and guardrails:
|
|
70
|
+
```yaml
|
|
71
|
+
---
|
|
72
|
+
role: Senior Code Reviewer
|
|
73
|
+
skills_required:
|
|
74
|
+
- security.md
|
|
75
|
+
- code-review.md
|
|
76
|
+
output_schema:
|
|
77
|
+
issues: [{severity, file, line, message}]
|
|
78
|
+
guardrails:
|
|
79
|
+
- Prioritize security issues above all else
|
|
80
|
+
---
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
22
85
|
## How It Works
|
|
23
86
|
|
|
24
87
|
```
|
|
25
88
|
┌─────────────────────────────────────────────────────────────┐
|
|
26
89
|
│ HOOKS (Automatic) │
|
|
27
90
|
│ │
|
|
28
|
-
│ UserPromptSubmit → session-check.sh
|
|
29
|
-
│
|
|
30
|
-
│ PreToolUse → pre-commit-check.sh (
|
|
91
|
+
│ UserPromptSubmit → session-check.sh (resume, blueprint) │
|
|
92
|
+
│ PreToolUse → pre-edit.sh (BLOCKS without approval) │
|
|
93
|
+
│ PreToolUse → pre-commit-check.sh (BLOCKS bad code) │
|
|
94
|
+
│ PostToolUse → post-edit.sh (verification loop) │
|
|
95
|
+
│ PostToolUse → post-commit.sh (BLUEPRINT reminder) │
|
|
31
96
|
│ │
|
|
32
|
-
│ Hooks
|
|
97
|
+
│ Hooks ENFORCE workflow - they physically block actions │
|
|
33
98
|
└─────────────────────────────────────────────────────────────┘
|
|
34
99
|
│
|
|
35
100
|
▼
|
|
36
101
|
┌─────────────────────────────────────────────────────────────┐
|
|
37
102
|
│ settings.json (System Prompt) │
|
|
38
103
|
│ │
|
|
39
|
-
│
|
|
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
|
-
│ ] │
|
|
104
|
+
│ Workflow instructions + skill loading + task types │
|
|
44
105
|
└─────────────────────────────────────────────────────────────┘
|
|
45
106
|
│
|
|
46
107
|
▼
|
|
47
108
|
┌─────────────────────────────────────────────────────────────┐
|
|
48
|
-
│
|
|
109
|
+
│ .claude/skills/ (106 Knowledge Files) │
|
|
49
110
|
│ │
|
|
50
|
-
│
|
|
111
|
+
│ Security, debugging, frameworks, patterns, best practices │
|
|
51
112
|
└─────────────────────────────────────────────────────────────┘
|
|
52
113
|
```
|
|
53
114
|
|
|
@@ -57,18 +118,21 @@ Options:
|
|
|
57
118
|
|
|
58
119
|
```
|
|
59
120
|
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → UPDATE
|
|
121
|
+
↑ ↑ ↑
|
|
122
|
+
BLOCKING BLOCKING BLOCKING
|
|
123
|
+
GATE GATE GATE
|
|
60
124
|
```
|
|
61
125
|
|
|
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` (
|
|
69
|
-
| AUDIT | Check orphan features + circular deps |
|
|
70
|
-
| COMMIT | Conventional commit format |
|
|
71
|
-
| UPDATE | Update BLUEPRINT.md if needed |
|
|
126
|
+
| Phase | What Happens | Enforcement |
|
|
127
|
+
|-------|--------------|-------------|
|
|
128
|
+
| ANALYZE | Read relevant files, check BLUEPRINT.md | - |
|
|
129
|
+
| PLAN | Design approach, show 3-tier suggestions | - |
|
|
130
|
+
| CONFIRM | Wait for user approval | **pre-edit.sh BLOCKS edits** |
|
|
131
|
+
| IMPLEMENT | Make changes (after approval only) | Allowed after approval |
|
|
132
|
+
| VERIFY | Run `npm run verify` (max 10 iterations) | Auto-triggered by hook |
|
|
133
|
+
| AUDIT | Check orphan features + circular deps | Required for features |
|
|
134
|
+
| COMMIT | Conventional commit format | **pre-commit.sh BLOCKS bad commits** |
|
|
135
|
+
| UPDATE | Update BLUEPRINT.md if needed | **post-commit.sh reminder** |
|
|
72
136
|
|
|
73
137
|
---
|
|
74
138
|
|
|
@@ -76,20 +140,55 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
|
|
|
76
140
|
|
|
77
141
|
| Hook | Trigger | Action |
|
|
78
142
|
|------|---------|--------|
|
|
79
|
-
| `session-check.sh` | Every user message |
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
143
|
+
| `session-check.sh` | Every user message | Resume previous session, check BLUEPRINT.md |
|
|
144
|
+
| `pre-edit.sh` | Before Write/Edit | **BLOCK if plan not approved** |
|
|
145
|
+
| `post-edit.sh` | After Write/Edit | Run verification loop (max 10 iterations) |
|
|
146
|
+
| `pre-commit-check.sh` | Before git commit | **BLOCK if TODO/console.log/errors** |
|
|
147
|
+
| `post-commit.sh` | After git commit | Remind to update BLUEPRINT.md |
|
|
82
148
|
|
|
83
149
|
---
|
|
84
150
|
|
|
85
151
|
## Blocking Gates
|
|
86
152
|
|
|
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
|
|
153
|
+
| Gate | Blocks If | Enforced By |
|
|
154
|
+
|------|-----------|-------------|
|
|
155
|
+
| Plan Approval | User hasn't approved the plan | `pre-edit.sh` (exit 1) |
|
|
156
|
+
| Verify | TypeScript or ESLint errors exist | `post-edit.sh` loop |
|
|
157
|
+
| Audit | Orphan features or circular dependencies | Required before commit |
|
|
158
|
+
| Pre-Commit | TODO/FIXME, console.log, bad format | `pre-commit-check.sh` (exit 1) |
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 3-Tier Suggestions
|
|
163
|
+
|
|
164
|
+
For feature tasks, Claude provides categorized suggestions:
|
|
165
|
+
|
|
166
|
+
| Tier | Priority | Examples |
|
|
167
|
+
|------|----------|----------|
|
|
168
|
+
| 🔴 Required | Must implement | Error handling, loading states, validation |
|
|
169
|
+
| 🟡 Recommended | Improves quality | Empty states, keyboard navigation |
|
|
170
|
+
| 🟢 Optional | Nice to have | Unit tests, analytics, optimizations |
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Session Resume
|
|
175
|
+
|
|
176
|
+
When returning to an interrupted session:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
180
|
+
📍 AUTOWORKFLOW: SESSION RESUME
|
|
181
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
182
|
+
|
|
183
|
+
Previous session state detected:
|
|
184
|
+
|
|
185
|
+
Phase: IMPLEMENT
|
|
186
|
+
Task type: feature
|
|
187
|
+
Plan approved: true
|
|
188
|
+
Verify attempts: 2/10
|
|
189
|
+
|
|
190
|
+
Continue from IMPLEMENT phase, or start fresh?
|
|
191
|
+
```
|
|
93
192
|
|
|
94
193
|
---
|
|
95
194
|
|
|
@@ -97,23 +196,30 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
|
|
|
97
196
|
|
|
98
197
|
```
|
|
99
198
|
project/
|
|
100
|
-
├── CLAUDE.md # Workflow
|
|
199
|
+
├── CLAUDE.md # Workflow summary (auto-read)
|
|
101
200
|
│
|
|
102
201
|
├── .claude/
|
|
103
|
-
│ ├── settings.json #
|
|
104
|
-
│ ├── hooks/ #
|
|
105
|
-
│ │ ├── session-check.sh
|
|
106
|
-
│ │ ├──
|
|
107
|
-
│ │
|
|
108
|
-
│
|
|
202
|
+
│ ├── settings.json # Hooks + system prompt
|
|
203
|
+
│ ├── hooks/ # Enforcement scripts
|
|
204
|
+
│ │ ├── session-check.sh # Resume + blueprint check
|
|
205
|
+
│ │ ├── pre-edit.sh # Plan approval gate
|
|
206
|
+
│ │ ├── post-edit.sh # Verification loop
|
|
207
|
+
│ │ ├── pre-commit-check.sh
|
|
208
|
+
│ │ └── post-commit.sh # BLUEPRINT reminder
|
|
209
|
+
│ ├── commands/ # Slash commands (with agent structure)
|
|
210
|
+
│ └── skills/ # 106 knowledge files
|
|
109
211
|
│
|
|
110
212
|
├── instructions/
|
|
111
213
|
│ ├── AI_RULES.md # Your coding standards
|
|
112
214
|
│ └── BLUEPRINT.md # Project spec (auto-generated)
|
|
113
215
|
│
|
|
114
|
-
├──
|
|
115
|
-
├──
|
|
116
|
-
|
|
216
|
+
├── system/ # Detailed reference
|
|
217
|
+
│ ├── gates.md # Blocking checkpoint definitions
|
|
218
|
+
│ ├── loops.md # Verify/fix cycle definitions
|
|
219
|
+
│ ├── triggers.md # Event → action mappings
|
|
220
|
+
│ └── router.md # Task type classification
|
|
221
|
+
│
|
|
222
|
+
└── scripts/ # Automation scripts
|
|
117
223
|
```
|
|
118
224
|
|
|
119
225
|
---
|
|
@@ -135,15 +241,17 @@ npm run audit:all # Run all audits
|
|
|
135
241
|
```
|
|
136
242
|
|
|
137
243
|
### Slash Commands
|
|
138
|
-
| Command | Purpose |
|
|
139
|
-
|
|
140
|
-
| `/analyze [task]` | Analyze codebase |
|
|
141
|
-
| `/plan [task]` | Create implementation plan |
|
|
142
|
-
| `/
|
|
143
|
-
| `/
|
|
144
|
-
| `/
|
|
145
|
-
| `/
|
|
146
|
-
| `/
|
|
244
|
+
| Command | Role | Purpose |
|
|
245
|
+
|---------|------|---------|
|
|
246
|
+
| `/analyze [task]` | Technical Analyst | Analyze codebase, classify task |
|
|
247
|
+
| `/plan [task]` | Project Manager | Create implementation plan |
|
|
248
|
+
| `/suggest [task]` | Technical Advisor | Generate 3-tier suggestions |
|
|
249
|
+
| `/build [feature]` | Full-Stack Engineer | Full workflow with tech detection |
|
|
250
|
+
| `/verify` | QA Engineer | Run verification loop |
|
|
251
|
+
| `/fix` | Debug Engineer | Fix verification errors |
|
|
252
|
+
| `/audit` | Code Reviewer | Security + quality audit |
|
|
253
|
+
| `/audit project` | Code Reviewer | Full scan → generate BLUEPRINT.md |
|
|
254
|
+
| `/commit` | Git Specialist | Pre-commit check + commit |
|
|
147
255
|
|
|
148
256
|
---
|
|
149
257
|
|
|
@@ -165,13 +273,16 @@ Edit `instructions/AI_RULES.md`:
|
|
|
165
273
|
Edit `.claude/settings.json` gates section.
|
|
166
274
|
|
|
167
275
|
### Modify Hooks
|
|
168
|
-
Edit files in `.claude/hooks/` to change
|
|
276
|
+
Edit files in `.claude/hooks/` to change enforcement behavior.
|
|
277
|
+
|
|
278
|
+
### Add Skills
|
|
279
|
+
Add `.md` files to `.claude/skills/` and reference in command frontmatter.
|
|
169
280
|
|
|
170
281
|
---
|
|
171
282
|
|
|
172
283
|
## Requirements
|
|
173
284
|
|
|
174
|
-
- VS Code with Claude Code extension
|
|
285
|
+
- VS Code with Claude Code extension (or Claude Code CLI)
|
|
175
286
|
- Node.js 18+ (for npm scripts)
|
|
176
287
|
- TypeScript, ESLint, Prettier (for verification)
|
|
177
288
|
|
package/package.json
CHANGED
package/system/triggers.md
CHANGED
|
@@ -12,14 +12,20 @@
|
|
|
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 |
|
|
16
|
+
| `on:turn_start` | `session-check.sh` | UserPromptSubmit |
|
|
15
17
|
| `on:blueprint_missing` | `session-check.sh` + `blueprint-generator.sh` | UserPromptSubmit |
|
|
16
18
|
| `on:init_needed` | `session-check.sh` | UserPromptSubmit |
|
|
17
19
|
| `on:task_received` | `session-check.sh` | UserPromptSubmit |
|
|
18
20
|
| `on:phase_transition` | `phase-transition.sh` | Manual call |
|
|
21
|
+
| `on:pre_implementation_check` | `pre-edit.sh` | PreToolUse (Write\|Edit) |
|
|
22
|
+
| `on:suggestions_required` | `pre-edit.sh` | PreToolUse (Write\|Edit) |
|
|
23
|
+
| `on:one_fix_at_a_time` | `pre-edit.sh` | PreToolUse (Write\|Edit) |
|
|
19
24
|
| `on:implementation_complete` | `post-edit.sh` | PostToolUse (Write\|Edit) |
|
|
20
25
|
| `on:verification_failed` | `post-edit.sh` | PostToolUse (Write\|Edit) |
|
|
21
26
|
| `on:verification_passed` | `post-edit.sh` | PostToolUse (Write\|Edit) |
|
|
22
27
|
| `on:commit_requested` | `pre-tool-router.sh` → `pre-commit-check.sh` | PreToolUse (Bash) |
|
|
28
|
+
| `on:feature_complete` | `post-bash-router.sh` → `post-commit.sh` | PostToolUse (Bash) |
|
|
23
29
|
|
|
24
30
|
---
|
|
25
31
|
|
|
@@ -38,9 +44,13 @@ All workflow state is stored in `.claude/.autoworkflow/`:
|
|
|
38
44
|
├── audit-status # PASSED/FAILED/BLOCKED
|
|
39
45
|
├── gate-status # Last gate check result
|
|
40
46
|
├── gate-errors # Number of gate errors
|
|
41
|
-
├── plan-approved # Plan approval status
|
|
47
|
+
├── plan-approved # Plan approval status (true/false)
|
|
42
48
|
├── changed-files # List of modified files
|
|
43
|
-
|
|
49
|
+
├── blueprint-checked # Blueprint check done flag
|
|
50
|
+
├── session-resumed # Session resume prompt shown flag
|
|
51
|
+
├── suggestions-shown # 3-tier suggestions displayed (true/false)
|
|
52
|
+
├── current-turn-edits # Number of edits in current user turn
|
|
53
|
+
└── selected-items # User-selected items to implement
|
|
44
54
|
```
|
|
45
55
|
|
|
46
56
|
---
|
|
@@ -81,6 +91,170 @@ All workflow state is stored in `.claude/.autoworkflow/`:
|
|
|
81
91
|
|
|
82
92
|
---
|
|
83
93
|
|
|
94
|
+
### `on:session_resume`
|
|
95
|
+
|
|
96
|
+
**When:** Existing session state detected (non-IDLE phase)
|
|
97
|
+
**Hook:** `.claude/hooks/session-check.sh`
|
|
98
|
+
**Function:** `check_session_resume()`
|
|
99
|
+
**Event:** `UserPromptSubmit`
|
|
100
|
+
|
|
101
|
+
**Trigger Condition:** Previous session has active state (phase != IDLE)
|
|
102
|
+
|
|
103
|
+
**Actions:**
|
|
104
|
+
1. Detect previous session state
|
|
105
|
+
2. Show resume prompt with context:
|
|
106
|
+
- Current phase
|
|
107
|
+
- Task type
|
|
108
|
+
- Plan approval status
|
|
109
|
+
- Verify iteration count
|
|
110
|
+
- Changed files (if any)
|
|
111
|
+
3. Offer to continue or start fresh
|
|
112
|
+
4. Mark resume prompt as shown (only show once)
|
|
113
|
+
|
|
114
|
+
**Output:**
|
|
115
|
+
```
|
|
116
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
117
|
+
📍 AUTOWORKFLOW: SESSION RESUME
|
|
118
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
119
|
+
|
|
120
|
+
Previous session state detected:
|
|
121
|
+
|
|
122
|
+
Phase: IMPLEMENT
|
|
123
|
+
Task type: feature
|
|
124
|
+
Plan approved: true
|
|
125
|
+
Verify attempts: 2/10
|
|
126
|
+
|
|
127
|
+
Pending changes:
|
|
128
|
+
- src/components/Button.tsx
|
|
129
|
+
- src/hooks/useAuth.ts
|
|
130
|
+
|
|
131
|
+
Workflow: ANALYZE → PLAN → CONFIRM → IMPLEMENT → ...
|
|
132
|
+
↑ Current: IMPLEMENT
|
|
133
|
+
|
|
134
|
+
Continue from IMPLEMENT phase, or start fresh?
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
### `on:pre_implementation_check`
|
|
140
|
+
|
|
141
|
+
**When:** Claude attempts to Write/Edit a file
|
|
142
|
+
**Hook:** `.claude/hooks/pre-edit.sh`
|
|
143
|
+
**Event:** `PreToolUse` for `Write|Edit`
|
|
144
|
+
|
|
145
|
+
**Purpose:** ENFORCE plan approval before any code changes
|
|
146
|
+
|
|
147
|
+
**Gate Check:**
|
|
148
|
+
1. Get current phase from state
|
|
149
|
+
2. Get task type from state
|
|
150
|
+
3. Check if task requires approval (feature/fix/refactor)
|
|
151
|
+
4. If in ANALYZE or PLAN phase AND approval required:
|
|
152
|
+
- Check if `plan-approved` is set to "true"
|
|
153
|
+
- If NOT → **BLOCK the edit** (exit code 1)
|
|
154
|
+
- If YES → Allow the edit
|
|
155
|
+
|
|
156
|
+
**Output on BLOCK:**
|
|
157
|
+
```
|
|
158
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
159
|
+
⛔ AUTOWORKFLOW: PLAN APPROVAL REQUIRED
|
|
160
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
161
|
+
|
|
162
|
+
Current Phase: PLAN
|
|
163
|
+
Task Type: feature
|
|
164
|
+
Plan Approved: NO
|
|
165
|
+
|
|
166
|
+
Cannot edit files before plan approval.
|
|
167
|
+
|
|
168
|
+
Required workflow:
|
|
169
|
+
1. Complete ANALYZE phase (read relevant files)
|
|
170
|
+
2. Present PLAN with suggestions
|
|
171
|
+
3. Wait for user approval
|
|
172
|
+
4. THEN implement
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Bypass conditions:**
|
|
176
|
+
- Task type is `docs`, `style`, `config`, or `query`
|
|
177
|
+
- Phase is already IMPLEMENT or later
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
### `on:suggestions_required`
|
|
182
|
+
|
|
183
|
+
**When:** Claude attempts to implement a feature without showing suggestions
|
|
184
|
+
**Hook:** `.claude/hooks/pre-edit.sh`
|
|
185
|
+
**Event:** `PreToolUse` for `Write|Edit`
|
|
186
|
+
|
|
187
|
+
**Purpose:** ENFORCE 3-tier suggestions for feature tasks
|
|
188
|
+
|
|
189
|
+
**Gate Check:**
|
|
190
|
+
1. Check if task type is `feature`
|
|
191
|
+
2. Check if phase is `IMPLEMENT`
|
|
192
|
+
3. Check if `suggestions-shown` is "true"
|
|
193
|
+
4. If NOT → **BLOCK the edit** (exit code 1)
|
|
194
|
+
|
|
195
|
+
**Output on BLOCK:**
|
|
196
|
+
```
|
|
197
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
198
|
+
⛔ AUTOWORKFLOW: SUGGESTIONS REQUIRED
|
|
199
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
200
|
+
|
|
201
|
+
Task Type: feature
|
|
202
|
+
|
|
203
|
+
For feature tasks, you MUST show 3-tier suggestions first:
|
|
204
|
+
|
|
205
|
+
🔴 Required - Must implement
|
|
206
|
+
🟡 Recommended - Should implement
|
|
207
|
+
🟢 Optional - Nice to have
|
|
208
|
+
|
|
209
|
+
Show suggestions, let user select items, THEN implement.
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Required Workflow:**
|
|
213
|
+
1. Analyze codebase and identify issues/improvements
|
|
214
|
+
2. Show categorized suggestions (Required/Recommended/Optional)
|
|
215
|
+
3. Wait for user to select items
|
|
216
|
+
4. Set `suggestions-shown` to "true"
|
|
217
|
+
5. THEN implement ONE item at a time
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### `on:one_fix_at_a_time`
|
|
222
|
+
|
|
223
|
+
**When:** Claude attempts multiple edits in FIX phase during single turn
|
|
224
|
+
**Hook:** `.claude/hooks/pre-edit.sh`
|
|
225
|
+
**Event:** `PreToolUse` for `Write|Edit`
|
|
226
|
+
|
|
227
|
+
**Purpose:** ENFORCE one fix per turn
|
|
228
|
+
|
|
229
|
+
**Gate Check:**
|
|
230
|
+
1. Check if phase is `FIX`
|
|
231
|
+
2. Check `current-turn-edits` count
|
|
232
|
+
3. If count >= 1 → **BLOCK additional edits** (exit code 1)
|
|
233
|
+
4. If count < 1 → Increment counter, allow edit
|
|
234
|
+
|
|
235
|
+
**Output on BLOCK:**
|
|
236
|
+
```
|
|
237
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
238
|
+
⚠ AUTOWORKFLOW: ONE FIX AT A TIME
|
|
239
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
240
|
+
|
|
241
|
+
Edits this turn: 1
|
|
242
|
+
|
|
243
|
+
Fix ONE issue at a time, then verify.
|
|
244
|
+
|
|
245
|
+
This ensures:
|
|
246
|
+
1. Easier to track what changed
|
|
247
|
+
2. Errors caught early
|
|
248
|
+
3. User can review incrementally
|
|
249
|
+
|
|
250
|
+
Wait for verification to complete before next fix.
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Reset Condition:**
|
|
254
|
+
- Counter resets on each new UserPromptSubmit (session-check.sh)
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
84
258
|
### `on:blueprint_missing`
|
|
85
259
|
|
|
86
260
|
**When:** BLUEPRINT.md does not exist at session start
|
|
@@ -177,11 +351,24 @@ All workflow state is stored in `.claude/.autoworkflow/`:
|
|
|
177
351
|
**Event:** `PostToolUse` for `Write|Edit`
|
|
178
352
|
|
|
179
353
|
**Actions:**
|
|
180
|
-
1.
|
|
181
|
-
2.
|
|
182
|
-
3.
|
|
183
|
-
4.
|
|
184
|
-
5. If
|
|
354
|
+
1. Detect project type (multi-language support)
|
|
355
|
+
2. Enter VERIFY phase automatically
|
|
356
|
+
3. Run appropriate verification commands
|
|
357
|
+
4. Track iteration count (max 10)
|
|
358
|
+
5. If PASS → Reset counter, proceed to AUDIT or COMMIT
|
|
359
|
+
6. If FAIL → Enter FIX phase, report errors
|
|
360
|
+
|
|
361
|
+
**Multi-Language Support:**
|
|
362
|
+
|
|
363
|
+
| Project Type | Detection | Verification Commands |
|
|
364
|
+
|--------------|-----------|----------------------|
|
|
365
|
+
| Node.js | `package.json` | `npm run verify` or `npm run typecheck && npm run lint` |
|
|
366
|
+
| PHP | `composer.json` | PHPStan, PHP-CS-Fixer, PHPCS |
|
|
367
|
+
| Python | `pyproject.toml`, `requirements.txt` | mypy, ruff, flake8 |
|
|
368
|
+
| Rust | `Cargo.toml` | `cargo check`, `cargo clippy` |
|
|
369
|
+
| Go | `go.mod` | `go build`, `go vet`, golangci-lint |
|
|
370
|
+
| Ruby | `Gemfile` | Rubocop |
|
|
371
|
+
| Java | `build.gradle`, `pom.xml` | Checkstyle, SpotBugs |
|
|
185
372
|
|
|
186
373
|
**Output:**
|
|
187
374
|
```
|
|
@@ -189,7 +376,9 @@ All workflow state is stored in `.claude/.autoworkflow/`:
|
|
|
189
376
|
AUTOWORKFLOW: VERIFY LOOP (Iteration 1/10)
|
|
190
377
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
191
378
|
|
|
192
|
-
|
|
379
|
+
Detected project type: php
|
|
380
|
+
|
|
381
|
+
Running: ./vendor/bin/phpstan analyse
|
|
193
382
|
|
|
194
383
|
✅ VERIFICATION PASSED
|
|
195
384
|
```
|
|
@@ -314,13 +503,49 @@ AUTOWORKFLOW: PRE-COMMIT GATE
|
|
|
314
503
|
|
|
315
504
|
### `on:feature_complete`
|
|
316
505
|
|
|
317
|
-
**When:** A
|
|
318
|
-
**
|
|
506
|
+
**When:** A git commit is successfully executed (detected by post-bash-router)
|
|
507
|
+
**Hook:** `.claude/hooks/post-bash-router.sh` → `.claude/hooks/post-commit.sh`
|
|
508
|
+
**Event:** `PostToolUse` for `Bash` (git commit commands)
|
|
509
|
+
|
|
510
|
+
**Behavior:** AUTOMATIC after every git commit
|
|
319
511
|
|
|
320
512
|
**Actions:**
|
|
321
|
-
1.
|
|
322
|
-
2.
|
|
323
|
-
3.
|
|
513
|
+
1. Display commit summary (hash, message, files)
|
|
514
|
+
2. Check if commit type is `feat` or `refactor`
|
|
515
|
+
3. If yes → Show UPDATE phase reminder:
|
|
516
|
+
- List potential new routes
|
|
517
|
+
- List potential new APIs
|
|
518
|
+
- List potential new components
|
|
519
|
+
4. Remind to update BLUEPRINT.md if needed
|
|
520
|
+
5. Reset workflow state to IDLE
|
|
521
|
+
|
|
522
|
+
**Output:**
|
|
523
|
+
```
|
|
524
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
525
|
+
✅ AUTOWORKFLOW: COMMIT COMPLETE
|
|
526
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
527
|
+
|
|
528
|
+
Hash: abc1234
|
|
529
|
+
Message: feat(auth): add login page
|
|
530
|
+
Files: 3 changed
|
|
531
|
+
|
|
532
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
533
|
+
📘 AUTOWORKFLOW: UPDATE PHASE
|
|
534
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
535
|
+
|
|
536
|
+
This commit may have added new features/routes/APIs.
|
|
537
|
+
|
|
538
|
+
Check if BLUEPRINT.md needs updating:
|
|
539
|
+
|
|
540
|
+
1. New routes/pages added?
|
|
541
|
+
2. New API endpoints added?
|
|
542
|
+
3. New features/components added?
|
|
543
|
+
|
|
544
|
+
Potential new routes:
|
|
545
|
+
- src/pages/Login.tsx
|
|
546
|
+
|
|
547
|
+
Action: Review and update instructions/BLUEPRINT.md if needed.
|
|
548
|
+
```
|
|
324
549
|
|
|
325
550
|
---
|
|
326
551
|
|
|
@@ -399,21 +624,35 @@ All hooks are configured in `.claude/settings.json`:
|
|
|
399
624
|
}]
|
|
400
625
|
}
|
|
401
626
|
],
|
|
402
|
-
"
|
|
627
|
+
"PreToolUse": [
|
|
403
628
|
{
|
|
404
629
|
"matcher": "Write|Edit",
|
|
405
630
|
"hooks": [{
|
|
406
631
|
"type": "command",
|
|
407
|
-
"command": "./.claude/hooks/
|
|
632
|
+
"command": "./.claude/hooks/pre-edit.sh"
|
|
633
|
+
}]
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
"matcher": "Bash",
|
|
637
|
+
"hooks": [{
|
|
638
|
+
"type": "command",
|
|
639
|
+
"command": "./.claude/hooks/pre-tool-router.sh \"$TOOL_INPUT\""
|
|
408
640
|
}]
|
|
409
641
|
}
|
|
410
642
|
],
|
|
411
|
-
"
|
|
643
|
+
"PostToolUse": [
|
|
644
|
+
{
|
|
645
|
+
"matcher": "Write|Edit",
|
|
646
|
+
"hooks": [{
|
|
647
|
+
"type": "command",
|
|
648
|
+
"command": "./.claude/hooks/post-edit.sh"
|
|
649
|
+
}]
|
|
650
|
+
},
|
|
412
651
|
{
|
|
413
652
|
"matcher": "Bash",
|
|
414
653
|
"hooks": [{
|
|
415
654
|
"type": "command",
|
|
416
|
-
"command": "./.claude/hooks/
|
|
655
|
+
"command": "./.claude/hooks/post-bash-router.sh \"$TOOL_INPUT\""
|
|
417
656
|
}]
|
|
418
657
|
}
|
|
419
658
|
]
|