autoworkflow 2.2.2 → 3.0.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/CLAUDE.md CHANGED
@@ -1,344 +1,144 @@
1
- # AutoWorkflow - System Prompt Layer
1
+ # AutoWorkflow
2
2
 
3
- > **This file is the ENTRY POINT.** Claude MUST read this at the start of EVERY task.
3
+ > Automated workflow enforcement via hooks + system prompts.
4
4
 
5
- ---
6
-
7
- ## Session Start - FIRST THING
8
-
9
- **Before ANY work, run this check:**
5
+ ## Architecture
10
6
 
11
7
  ```
12
- 1. Check if instructions/BLUEPRINT.md exists
13
- 2. If NO Run ONE audit → Update BOTH AI_RULES.md & BLUEPRINT.md
14
- 3. If YES Read both files and proceed
8
+ .claude/hooks/ → AUTO-TRIGGERS (run on events)
9
+ .claude/settings.json → SYSTEM PROMPT (core instructions)
10
+ CLAUDE.md (this file) WORKFLOW SUMMARY
11
+ instructions/ → AI_RULES.md + BLUEPRINT.md
12
+ system/ → DETAILED REFERENCE (gates, loops, triggers, router)
15
13
  ```
16
14
 
17
- ### No Blueprint? Single AuditDual Output
18
-
19
- ```
20
- ⚠️ No BLUEPRINT.md found in this project.
21
-
22
- I'll run ONE audit to update TWO files:
23
-
24
- 📄 AI_RULES.md → Tech Stack & File Structure (HOW to code)
25
- 📘 BLUEPRINT.md → Features, Routes, APIs (WHAT exists)
15
+ **Priority:** Hooks settings.json This file system/*.md
26
16
 
27
- Running project audit now...
28
- ```
17
+ ---
29
18
 
30
- ### Single Audit Architecture
19
+ ## Workflow
31
20
 
32
21
  ```
33
- ┌─────────────────────────────────────────────────────────────┐
34
- │ ONE AUDIT SCAN │
35
- │ │
36
- │ $ cat package.json → Detect tech stack │
37
- │ $ find src -type d → Map file structure │
38
- │ $ ls src/pages/ → Discover routes │
39
- │ $ ls src/components/ → List components │
40
- │ $ find src/api/ → Find API endpoints │
41
- │ $ cat prisma/schema.prisma → Database models │
42
- │ $ grep -r "fetch\|/api/" → Map connections │
43
- │ │
44
- └─────────────────────────┬────────────────────────────────────┘
45
-
46
- ┌─────────────┴─────────────┐
47
- ▼ ▼
48
- ┌─────────────────┐ ┌─────────────────┐
49
- │ AI_RULES.md │ │ BLUEPRINT.md │
50
- │ (Update) │ │ (Generate) │
51
- │ │ │ │
52
- │ ## Tech Stack │ │ ## Features │
53
- │ - Framework: X │ │ - Feature 1 ✅ │
54
- │ - Styling: Y │ │ - Feature 2 ⚠️ │
55
- │ - Database: Z │ │ │
56
- │ │ │ ## Routes │
57
- │ ## File Struct │ │ - / → Home │
58
- │ src/ │ │ - /about → ... │
59
- │ ├── components │ │ │
60
- │ ├── pages │ │ ## APIs │
61
- │ └── ... │ │ - GET /api/x │
62
- └─────────────────┘ └─────────────────┘
63
- ```
64
-
65
- **This prevents double audit runs - ONE scan updates BOTH files.**
66
-
67
- ### Audit Output Format
68
-
69
- After scanning, present BOTH updates together:
70
-
22
+ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → UPDATE
71
23
  ```
72
- ## 🔍 Audit Complete - Proposed Updates
73
-
74
- ### 📄 AI_RULES.md Updates
75
-
76
- **Tech Stack** (will update):
77
- - Framework: [detected]
78
- - Styling: [detected]
79
- - Database: [detected]
80
24
 
81
- **File Structure** (will update):
82
- src/
83
- ├── [directories found]
84
- └── [file counts]
25
+ | Phase | Action |
26
+ |-------|--------|
27
+ | ANALYZE | Read relevant files, check BLUEPRINT.md |
28
+ | PLAN | Design approach, show suggestions |
29
+ | CONFIRM | **Wait for user approval** |
30
+ | IMPLEMENT | Make changes (after approval only) |
31
+ | VERIFY | Run `npm run verify` |
32
+ | AUDIT | Run `npm run audit:ui` + `audit:cycles` |
33
+ | COMMIT | Conventional commit format |
34
+ | UPDATE | Update BLUEPRINT.md if new feature/route/API |
85
35
 
86
36
  ---
87
37
 
88
- ### 📘 BLUEPRINT.md (will create)
38
+ ## Task Types
89
39
 
90
- **Features Discovered:**
91
- | Feature | Frontend | Backend | Route | Status |
92
- |---------|----------|---------|-------|--------|
93
- | Auth | LoginForm.tsx | /api/auth | /login | |
94
- | Dashboard | Dashboard.tsx | /api/stats | /dashboard | |
95
- | Settings | None | /api/settings | ❌ None | ⚠️ ORPHAN |
40
+ | Type | Workflow | Audit Required? |
41
+ |------|----------|-----------------|
42
+ | feature | Full 9 phases | Yes |
43
+ | fix | ANALYZE PLAN CONFIRM → IMPLEMENT → VERIFY → COMMIT | No |
44
+ | refactor | ANALYZE ... VERIFY → AUDIT → COMMIT | Yes |
45
+ | docs | ANALYZE IMPLEMENT COMMIT | No |
46
+ | query | ANALYZE → RESPOND | No |
96
47
 
97
- **⚠️ Issues Found:**
98
- - Orphan API: /api/settings (no UI)
48
+ See `system/router.md` for detailed task classification.
99
49
 
100
50
  ---
101
51
 
102
- **Should I save these updates?**
103
- - AI_RULES.md → Update Tech Stack & File Structure sections
104
- - BLUEPRINT.md → Create with discovered features
52
+ ## Blocking Gates
105
53
 
106
- (yes/no/edit first)
107
- ```
108
-
109
- See `system/triggers.md#on:blueprint_missing` for trigger details.
54
+ | Gate | Blocks If | Reference |
55
+ |------|-----------|-----------|
56
+ | Plan Approval | User hasn't approved | `system/gates.md` |
57
+ | Verify | TypeScript/ESLint errors | `system/gates.md` |
58
+ | Audit | Orphan features or circular deps | `system/gates.md` |
59
+ | Pre-Commit | TODO/FIXME, console.log, bad format | `system/gates.md` |
110
60
 
111
61
  ---
112
62
 
113
- ## System Architecture
63
+ ## Blocking Rules
114
64
 
115
- ```
116
- ┌─────────────────────────────────────────────────────────────┐
117
- │ THIS FILE (Entry Point) │
118
- │ Load on every task, route to system │
119
- └───────────────────────────┬─────────────────────────────────┘
120
-
121
-
122
- ┌─────────────────────────────────────────────────────────────┐
123
- │ system/ (Control Layer) │
124
- │ │
125
- │ triggers.md │ loops.md │ gates.md │ router.md │
126
- │ (events) │ (cycles) │ (blocks) │ (routing) │
127
- └───────────────────────────┬─────────────────────────────────┘
128
-
129
-
130
- ┌─────────────────────────────────────────────────────────────┐
131
- │ instructions/ (Content Layer) │
132
- │ │
133
- │ CLAUDE.md │ AI_RULES.md │ BLUEPRINT.md │
134
- │ (workflow) │ (standards) │ (project spec) │
135
- └─────────────────────────────────────────────────────────────┘
136
- ```
65
+ - **No orphan features** - Backend must have UI
66
+ - **No TODO/FIXME** - Complete the work
67
+ - **No console.log** - No debug logs
68
+ - **No circular deps** - Clean imports
69
+ - **Conventional commits** - `type(scope): description`
137
70
 
138
71
  ---
139
72
 
140
- ## On Task Start - MANDATORY
141
-
142
- When you receive ANY task, you MUST:
73
+ ## Auto-Triggers (Hooks)
143
74
 
144
- ### 1. Route the Task
145
- Read `system/router.md` to classify:
146
- - Is this a feature, fix, refactor, query, etc.?
147
- - What workflow applies?
148
- - What gates are required?
75
+ | Event | Hook | Action |
76
+ |-------|------|--------|
77
+ | User message | `session-check.sh` | Check BLUEPRINT.md exists |
78
+ | After Write/Edit | `post-edit.sh` | Remind to verify |
79
+ | Before git commit | `pre-commit-check.sh` | Block bad commits |
149
80
 
150
- ### 2. Load Control Systems
151
- - `system/triggers.md` - Event handling
152
- - `system/loops.md` - Verification cycles
153
- - `system/gates.md` - Blocking checkpoints
154
-
155
- ### 3. Load Instructions
156
- - `instructions/CLAUDE.md` - Workflow steps
157
- - `instructions/AI_RULES.md` - Coding standards
158
- - `instructions/BLUEPRINT.md` - Project requirements
81
+ See `system/triggers.md` for all trigger definitions.
159
82
 
160
83
  ---
161
84
 
162
- ## Workflow Overview
85
+ ## Verification Loop
163
86
 
164
87
  ```
165
- ANALYZEPLANCONFIRMIMPLEMENTVERIFYAUDITCOMMIT UPDATE
166
- │ │ │ │ │ │ │ │
167
- ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
168
- Read Design Wait for Write Run npm Check Create Update
169
- files approach approval code verify orphans commit BLUEPRINT
88
+ VERIFYFailed?FIXVERIFYFailed?FIX... (max 10 iterations)
170
89
  ```
171
90
 
172
- ### Conditional Flows
91
+ See `system/loops.md` for loop definitions.
173
92
 
174
- ```
175
- Session Start:
176
- ┌─────────────────────────────────────────────────┐
177
- │ Check BLUEPRINT.md exists? │
178
- ├─────────────────────────────────────────────────┤
179
- NO → Run /audit project → Generate both files │
180
- YES Read AI_RULES.md + BLUEPRINT.md → Proceed │
181
- └─────────────────────────────────────────────────┘
182
-
183
- After Commit:
184
- ┌─────────────────────────────────────────────────┐
185
- │ Was new feature/route/API added? │
186
- ├─────────────────────────────────────────────────┤
187
- │ YES → Prompt to update BLUEPRINT.md │
188
- │ NO → Skip update phase │
189
- └─────────────────────────────────────────────────┘
93
+ ---
94
+
95
+ ## Commands
96
+
97
+ ```bash
98
+ npm run verify # TypeScript + ESLint
99
+ npm run audit:ui # Check orphan features
100
+ npm run audit:cycles # Check circular deps
101
+ npm run format # Prettier
190
102
  ```
191
103
 
192
104
  ---
193
105
 
194
- ## Hard Rules (NEVER Bypass)
106
+ ## Required Reading
195
107
 
196
- ### Blocking Gates
197
- | Gate | When | Blocks If |
198
- |------|------|-----------|
199
- | `plan_approval_gate` | Before implement | User hasn't approved |
200
- | `verify_gate` | After implement | TypeScript/ESLint errors |
201
- | `audit_gate` | Before commit (features) | Orphan features or cycles |
202
- | `pre_commit_gate` | Before commit | TODO/FIXME, console.log, etc. |
108
+ | File | Purpose |
109
+ |------|---------|
110
+ | `instructions/AI_RULES.md` | Your coding standards |
111
+ | `instructions/BLUEPRINT.md` | Project specification |
203
112
 
204
- ### Blocking Rules
205
- - **No orphan features** - Backend MUST have UI
206
- - **No TODO/FIXME** - Complete the work
207
- - **No console.log** - No debug logs in code
208
- - **No circular deps** - Clean architecture
209
- - **Conventional commits** - type(scope): description
113
+ If BLUEPRINT.md is missing, the session-check hook will trigger an automatic audit.
210
114
 
211
115
  ---
212
116
 
213
- ## Available Commands
117
+ ## Detailed Reference
214
118
 
215
- | Command | Purpose |
216
- |---------|---------|
217
- | `/analyze [task]` | Analyze codebase for a task |
218
- | `/plan [task]` | Create implementation plan |
219
- | `/build [feature]` | Full workflow for features |
220
- | `/verify` | Run TypeScript + ESLint |
221
- | `/fix` | Fix verification errors |
222
- | `/audit` | Run UI + cycle audits |
223
- | `/audit project` | Full project scan → update BLUEPRINT.md |
224
- | `/suggest [task]` | Generate suggestions |
225
- | `/commit [msg]` | Pre-commit check + commit |
119
+ | File | Contains |
120
+ |------|----------|
121
+ | `system/triggers.md` | Event Action mappings |
122
+ | `system/gates.md` | Blocking checkpoint definitions |
123
+ | `system/loops.md` | Verify/fix cycle definitions |
124
+ | `system/router.md` | Task type classification |
125
+ | `instructions/CLAUDE.md` | Full 9-phase workflow details |
226
126
 
227
127
  ---
228
128
 
229
129
  ## Quick Reference
230
130
 
231
- ### Session Start
232
- ```
233
- Check BLUEPRINT.md exists?
234
- ├── NO → Run /audit project → Update AI_RULES.md + Create BLUEPRINT.md
235
- └── YES → Read both → Proceed
236
- ```
237
-
238
- ### For Features
131
+ **New feature:**
239
132
  ```
240
- /build [description]
241
- → Runs: ANALYZE → PLAN+SUGGEST → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → UPDATE
133
+ Analyze → Plan+Suggest → [approval] → Implement → Verify → Audit → Commit → Update Blueprint
242
134
  ```
243
135
 
244
- ### For Fixes
136
+ **Bug fix:**
245
137
  ```
246
- /analyze [issue] /plan → [approval] → implement/verify/commit
138
+ AnalyzePlan → [approval] → ImplementVerifyCommit
247
139
  ```
248
140
 
249
- ### For Questions
250
- ```
251
- /analyze [question]
252
- → Returns information, no implementation
253
- ```
254
-
255
- ---
256
-
257
- ## File Map
258
-
141
+ **Question:**
259
142
  ```
260
- @autoworkflow/
261
- ├── CLAUDE.md ← YOU ARE HERE (Entry Point)
262
-
263
- ├── system/ ← Control Layer
264
- │ ├── triggers.md Event → Action mappings
265
- │ ├── loops.md Repeat-until definitions
266
- │ ├── gates.md Blocking checkpoints
267
- │ └── router.md Task type routing
268
-
269
- ├── instructions/ ← Content Layer
270
- │ ├── CLAUDE.md Workflow steps
271
- │ ├── AI_RULES.md Coding standards
272
- │ └── BLUEPRINT.md Project specification
273
-
274
- ├── scripts/ ← Automation Scripts
275
- │ ├── setup.sh One-command project setup
276
- │ ├── autoworkflow.sh CLI orchestrator
277
- │ ├── run-verification.sh Verification with output
278
- │ ├── ensure-no-errors.sh Pre-commit check
279
- │ └── check-ui-enforcement.sh Orphan feature detection
280
-
281
- ├── hooks/ ← Git Hooks
282
- │ ├── pre-commit Blocks bad commits
283
- │ └── commit-msg Validates commit format
284
-
285
- ├── .claude/ ← Claude Code Integration
286
- │ ├── settings.json Settings + instructions
287
- │ └── commands/ Slash command definitions
288
- │ ├── analyze.md
289
- │ ├── plan.md
290
- │ ├── build.md
291
- │ ├── verify.md
292
- │ ├── fix.md
293
- │ ├── audit.md
294
- │ ├── suggest.md
295
- │ └── commit.md
296
-
297
- ├── .vscode/ ← VS Code Integration
298
- │ ├── settings.json Editor settings
299
- │ ├── tasks.json Runnable tasks
300
- │ └── extensions.json Recommended extensions
301
-
302
- ├── .prettierrc ← Prettier config
303
- ├── eslint.config.example.js ← ESLint reference
304
- └── tsconfig.example.json ← TypeScript reference
143
+ Analyze → Respond
305
144
  ```
306
-
307
- ---
308
-
309
- ## Enforcement Summary
310
-
311
- **Claude is the PRIMARY enforcement engine.** These files control behavior:
312
-
313
- 1. **system/triggers.md** - WHEN to act
314
- 2. **system/loops.md** - HOW to repeat until success
315
- 3. **system/gates.md** - WHAT blocks progress
316
- 4. **system/router.md** - WHERE to route tasks
317
- 5. **instructions/CLAUDE.md** - THE workflow to follow
318
- 6. **instructions/AI_RULES.md** - THE standards to meet
319
-
320
- **Backup enforcement via automation:**
321
-
322
- 7. **hooks/pre-commit** - Blocks commits with errors (git hook)
323
- 8. **hooks/commit-msg** - Validates commit format (git hook)
324
- 9. **scripts/check-ui-enforcement.sh** - Detects orphan features
325
- 10. **scripts/autoworkflow.sh** - CLI for manual workflow runs
326
-
327
- Claude follows the instructions. Hooks catch anything that slips through.
328
-
329
- ---
330
-
331
- ## Start Here
332
-
333
- For every task:
334
- 1. Read this file (done)
335
- 2. Check if `instructions/BLUEPRINT.md` exists
336
- - If NO → Run `/audit project` first
337
- - If YES → Read it and proceed
338
- 3. Read `system/router.md` to classify task
339
- 4. Follow the appropriate workflow
340
- 5. Never skip gates
341
- 6. Complete features fully
342
- 7. Update BLUEPRINT.md after adding features
343
-
344
- **VERIFY ALWAYS. CHECK BLUEPRINT. NO ORPHANS. ONE AUDIT → TWO FILES.**