autoworkflow 1.1.0 → 2.0.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 +77 -0
- package/.claude/commands/audit.md +220 -0
- package/.claude/commands/build.md +159 -0
- package/.claude/commands/commit.md +165 -0
- package/.claude/commands/fix.md +119 -0
- package/.claude/commands/plan.md +101 -0
- package/.claude/commands/suggest.md +195 -0
- package/.claude/commands/verify.md +113 -0
- package/.claude/settings.json +129 -0
- package/.claude/settings.local.json +9 -0
- package/.prettierrc +11 -0
- package/.vscode/extensions.json +27 -0
- package/.vscode/settings.json +69 -0
- package/.vscode/tasks.json +161 -0
- package/CLAUDE.md +344 -0
- package/README.md +180 -195
- package/eslint.config.example.js +83 -0
- package/hooks/commit-msg +137 -0
- package/hooks/pre-commit +152 -0
- package/instructions/AI_RULES.md +284 -0
- package/instructions/BLUEPRINT.md +170 -0
- package/instructions/CLAUDE.md +472 -0
- package/package.json +45 -45
- package/scripts/autoworkflow.sh +324 -0
- package/scripts/check-ui-enforcement.sh +177 -0
- package/scripts/ensure-no-errors.sh +116 -0
- package/scripts/run-verification.sh +112 -0
- package/scripts/setup.sh +201 -0
- package/system/gates.md +390 -0
- package/system/loops.md +348 -0
- package/system/router.md +415 -0
- package/system/triggers.md +369 -0
- package/tsconfig.example.json +52 -0
- package/bin/cli.js +0 -299
- package/lib/index.js +0 -9
- package/lib/install.js +0 -600
package/system/router.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# System Router
|
|
2
|
+
|
|
3
|
+
> Routes incoming tasks to appropriate workflows based on task type.
|
|
4
|
+
> Determines which phases, gates, and loops apply to each task.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Task Classification
|
|
9
|
+
|
|
10
|
+
When Claude receives a task, it MUST classify it before proceeding.
|
|
11
|
+
|
|
12
|
+
### Classification Process
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
INPUT: User request
|
|
16
|
+
│
|
|
17
|
+
▼
|
|
18
|
+
┌─────────────────────────────────┐
|
|
19
|
+
│ 1. Parse request for keywords │
|
|
20
|
+
│ 2. Identify task indicators │
|
|
21
|
+
│ 3. Match to task type │
|
|
22
|
+
│ 4. Load appropriate workflow │
|
|
23
|
+
└─────────────────────────────────┘
|
|
24
|
+
│
|
|
25
|
+
▼
|
|
26
|
+
OUTPUT: task_type + workflow
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Task Types
|
|
32
|
+
|
|
33
|
+
### `feature` - New Feature Implementation
|
|
34
|
+
|
|
35
|
+
**Indicators:**
|
|
36
|
+
- "add", "create", "implement", "build", "new"
|
|
37
|
+
- "feature", "functionality", "capability"
|
|
38
|
+
- Adding new files, components, pages, APIs
|
|
39
|
+
|
|
40
|
+
**Workflow:**
|
|
41
|
+
```
|
|
42
|
+
ANALYZE → PLAN+SUGGEST → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Required Gates:**
|
|
46
|
+
- `plan_approval_gate`
|
|
47
|
+
- `verify_gate`
|
|
48
|
+
- `audit_gate` (UI enforcement)
|
|
49
|
+
- `pre_commit_gate`
|
|
50
|
+
|
|
51
|
+
**Suggestions:** Required
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### `fix` - Bug Fix
|
|
56
|
+
|
|
57
|
+
**Indicators:**
|
|
58
|
+
- "fix", "bug", "broken", "doesn't work", "error"
|
|
59
|
+
- "issue", "problem", "wrong"
|
|
60
|
+
- Correcting existing behavior
|
|
61
|
+
|
|
62
|
+
**Workflow:**
|
|
63
|
+
```
|
|
64
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → COMMIT
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Required Gates:**
|
|
68
|
+
- `plan_approval_gate`
|
|
69
|
+
- `verify_gate`
|
|
70
|
+
- `pre_commit_gate`
|
|
71
|
+
|
|
72
|
+
**Suggestions:** Only if fix reveals missing handling
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### `refactor` - Code Refactoring
|
|
77
|
+
|
|
78
|
+
**Indicators:**
|
|
79
|
+
- "refactor", "clean up", "restructure", "reorganize"
|
|
80
|
+
- "extract", "split", "merge", "rename"
|
|
81
|
+
- Improving code without changing behavior
|
|
82
|
+
|
|
83
|
+
**Workflow:**
|
|
84
|
+
```
|
|
85
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Required Gates:**
|
|
89
|
+
- `plan_approval_gate`
|
|
90
|
+
- `verify_gate`
|
|
91
|
+
- `audit_gate` (check for cycles)
|
|
92
|
+
- `pre_commit_gate`
|
|
93
|
+
|
|
94
|
+
**Suggestions:** Only if scope expands
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### `style` - Styling/UI Changes
|
|
99
|
+
|
|
100
|
+
**Indicators:**
|
|
101
|
+
- "style", "css", "color", "layout", "design"
|
|
102
|
+
- "spacing", "font", "responsive", "mobile"
|
|
103
|
+
- Visual changes only
|
|
104
|
+
|
|
105
|
+
**Workflow:**
|
|
106
|
+
```
|
|
107
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → COMMIT
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Required Gates:**
|
|
111
|
+
- `plan_approval_gate`
|
|
112
|
+
- `verify_gate`
|
|
113
|
+
- `pre_commit_gate`
|
|
114
|
+
|
|
115
|
+
**Suggestions:** Skip
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### `docs` - Documentation
|
|
120
|
+
|
|
121
|
+
**Indicators:**
|
|
122
|
+
- "document", "readme", "comment", "jsdoc"
|
|
123
|
+
- "explain", "describe"
|
|
124
|
+
- Documentation changes only
|
|
125
|
+
|
|
126
|
+
**Workflow:**
|
|
127
|
+
```
|
|
128
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → COMMIT
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Required Gates:**
|
|
132
|
+
- `plan_approval_gate`
|
|
133
|
+
- `verify_gate`
|
|
134
|
+
- `pre_commit_gate`
|
|
135
|
+
|
|
136
|
+
**Suggestions:** Skip
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### `test` - Test Implementation
|
|
141
|
+
|
|
142
|
+
**Indicators:**
|
|
143
|
+
- "test", "spec", "coverage", "unit test"
|
|
144
|
+
- "integration test", "e2e"
|
|
145
|
+
- Adding or modifying tests
|
|
146
|
+
|
|
147
|
+
**Workflow:**
|
|
148
|
+
```
|
|
149
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → RUN_TESTS → COMMIT
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Required Gates:**
|
|
153
|
+
- `plan_approval_gate`
|
|
154
|
+
- `verify_gate`
|
|
155
|
+
- `test_gate` (tests must pass)
|
|
156
|
+
- `pre_commit_gate`
|
|
157
|
+
|
|
158
|
+
**Suggestions:** Only for test completeness
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### `config` - Configuration Changes
|
|
163
|
+
|
|
164
|
+
**Indicators:**
|
|
165
|
+
- "config", "setting", "environment", "env"
|
|
166
|
+
- "setup", "install", "dependency"
|
|
167
|
+
- Configuration file changes
|
|
168
|
+
|
|
169
|
+
**Workflow:**
|
|
170
|
+
```
|
|
171
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → COMMIT
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Required Gates:**
|
|
175
|
+
- `plan_approval_gate`
|
|
176
|
+
- `verify_gate`
|
|
177
|
+
- `pre_commit_gate`
|
|
178
|
+
|
|
179
|
+
**Suggestions:** Skip
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### `perf` - Performance Optimization
|
|
184
|
+
|
|
185
|
+
**Indicators:**
|
|
186
|
+
- "performance", "optimize", "speed", "fast"
|
|
187
|
+
- "slow", "lag", "memory", "bundle size"
|
|
188
|
+
- Performance improvements
|
|
189
|
+
|
|
190
|
+
**Workflow:**
|
|
191
|
+
```
|
|
192
|
+
ANALYZE → PLAN+SUGGEST → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Required Gates:**
|
|
196
|
+
- `plan_approval_gate`
|
|
197
|
+
- `verify_gate`
|
|
198
|
+
- `audit_gate`
|
|
199
|
+
- `pre_commit_gate`
|
|
200
|
+
|
|
201
|
+
**Suggestions:** Required (perf trade-offs)
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
### `security` - Security Updates
|
|
206
|
+
|
|
207
|
+
**Indicators:**
|
|
208
|
+
- "security", "vulnerability", "auth", "permission"
|
|
209
|
+
- "sanitize", "validate", "escape", "encrypt"
|
|
210
|
+
- Security-related changes
|
|
211
|
+
|
|
212
|
+
**Workflow:**
|
|
213
|
+
```
|
|
214
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → SECURITY_REVIEW → COMMIT
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
**Required Gates:**
|
|
218
|
+
- `plan_approval_gate`
|
|
219
|
+
- `verify_gate`
|
|
220
|
+
- `security_gate`
|
|
221
|
+
- `pre_commit_gate`
|
|
222
|
+
|
|
223
|
+
**Suggestions:** Required (security considerations)
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
### `query` - Information Request
|
|
228
|
+
|
|
229
|
+
**Indicators:**
|
|
230
|
+
- "what", "how", "why", "where", "explain"
|
|
231
|
+
- "show me", "find", "search", "list"
|
|
232
|
+
- Questions, not modifications
|
|
233
|
+
|
|
234
|
+
**Workflow:**
|
|
235
|
+
```
|
|
236
|
+
ANALYZE → RESPOND
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Required Gates:** None
|
|
240
|
+
|
|
241
|
+
**Suggestions:** Skip
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Routing Decision Tree
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
Is this a question/query?
|
|
249
|
+
├── YES → task_type: query
|
|
250
|
+
│ workflow: ANALYZE → RESPOND
|
|
251
|
+
│
|
|
252
|
+
└── NO → Does it add new functionality?
|
|
253
|
+
├── YES → task_type: feature
|
|
254
|
+
│ workflow: full with AUDIT
|
|
255
|
+
│
|
|
256
|
+
└── NO → Does it fix a bug?
|
|
257
|
+
├── YES → task_type: fix
|
|
258
|
+
│ workflow: standard
|
|
259
|
+
│
|
|
260
|
+
└── NO → Does it restructure code?
|
|
261
|
+
├── YES → task_type: refactor
|
|
262
|
+
│ workflow: with AUDIT
|
|
263
|
+
│
|
|
264
|
+
└── NO → Is it visual only?
|
|
265
|
+
├── YES → task_type: style
|
|
266
|
+
│ workflow: simple
|
|
267
|
+
│
|
|
268
|
+
└── NO → [continue classification]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Workflow Definitions
|
|
274
|
+
|
|
275
|
+
### Full Workflow (Features)
|
|
276
|
+
```
|
|
277
|
+
┌─────────┐ ┌──────┐ ┌─────────┐ ┌───────────┐
|
|
278
|
+
│ ANALYZE │→ │ PLAN │→ │ CONFIRM │→ │ IMPLEMENT │
|
|
279
|
+
└─────────┘ └──────┘ └─────────┘ └───────────┘
|
|
280
|
+
│
|
|
281
|
+
▼
|
|
282
|
+
┌────────┐ ┌───────┐ ┌────────┐ ┌──────────┐
|
|
283
|
+
│ COMMIT │← │ AUDIT │← │ VERIFY │← │ FIX │
|
|
284
|
+
└────────┘ └───────┘ └────────┘ └──────────┘
|
|
285
|
+
↑ │
|
|
286
|
+
└──────────┘ (if errors)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Standard Workflow (Fixes, Styles, Docs)
|
|
290
|
+
```
|
|
291
|
+
┌─────────┐ ┌──────┐ ┌─────────┐ ┌───────────┐
|
|
292
|
+
│ ANALYZE │→ │ PLAN │→ │ CONFIRM │→ │ IMPLEMENT │
|
|
293
|
+
└─────────┘ └──────┘ └─────────┘ └───────────┘
|
|
294
|
+
│
|
|
295
|
+
▼
|
|
296
|
+
┌────────┐ ┌────────┐ ┌──────────┐
|
|
297
|
+
│ COMMIT │← │ VERIFY │← │ FIX │
|
|
298
|
+
└────────┘ └────────┘ └──────────┘
|
|
299
|
+
↑ │
|
|
300
|
+
└──────────┘ (if errors)
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Query Workflow
|
|
304
|
+
```
|
|
305
|
+
┌─────────┐ ┌─────────┐
|
|
306
|
+
│ ANALYZE │→ │ RESPOND │
|
|
307
|
+
└─────────┘ └─────────┘
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Phase Definitions
|
|
313
|
+
|
|
314
|
+
| Phase | Purpose | Output |
|
|
315
|
+
|-------|---------|--------|
|
|
316
|
+
| ANALYZE | Understand codebase and requirements | Findings summary |
|
|
317
|
+
| PLAN | Design implementation approach | Proposed changes |
|
|
318
|
+
| SUGGEST | Offer completeness improvements | Categorized suggestions |
|
|
319
|
+
| CONFIRM | Get user approval | Approval or revision |
|
|
320
|
+
| IMPLEMENT | Write/modify code | Changed files |
|
|
321
|
+
| VERIFY | Run typecheck + lint | Pass/fail status |
|
|
322
|
+
| FIX | Correct errors | Fixed code |
|
|
323
|
+
| AUDIT | Check UI enforcement + cycles | Pass/fail status |
|
|
324
|
+
| COMMIT | Create git commit | Commit hash |
|
|
325
|
+
| RESPOND | Answer query | Information |
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Routing Output Format
|
|
330
|
+
|
|
331
|
+
After classifying a task, Claude MUST report:
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
## Task Classification
|
|
335
|
+
|
|
336
|
+
**Request:** "[user's request]"
|
|
337
|
+
**Type:** feature | fix | refactor | style | docs | test | config | perf | security | query
|
|
338
|
+
**Workflow:** ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → [AUDIT] → COMMIT
|
|
339
|
+
|
|
340
|
+
**Required Gates:**
|
|
341
|
+
- [ ] plan_approval_gate
|
|
342
|
+
- [ ] verify_gate
|
|
343
|
+
- [ ] audit_gate (if applicable)
|
|
344
|
+
- [ ] pre_commit_gate
|
|
345
|
+
|
|
346
|
+
**Suggestions:** Required | Conditional | Skip
|
|
347
|
+
|
|
348
|
+
Proceeding with ANALYZE phase...
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## Multi-Task Handling
|
|
354
|
+
|
|
355
|
+
If user provides multiple tasks:
|
|
356
|
+
|
|
357
|
+
1. **Classify each task separately**
|
|
358
|
+
2. **Present all classifications to user**
|
|
359
|
+
3. **Ask: "Should I handle these in order, or would you like to prioritize?"**
|
|
360
|
+
4. **Process one task at a time** (per rules)
|
|
361
|
+
5. **Complete each task fully before starting next**
|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
## Multiple Tasks Detected
|
|
365
|
+
|
|
366
|
+
1. [Task 1] → type: feature
|
|
367
|
+
2. [Task 2] → type: fix
|
|
368
|
+
3. [Task 3] → type: style
|
|
369
|
+
|
|
370
|
+
Recommended order: 2, 1, 3 (fix first, then feature, then style)
|
|
371
|
+
|
|
372
|
+
Should I proceed in this order?
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Unknown Task Type
|
|
378
|
+
|
|
379
|
+
If task cannot be classified:
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
## Task Classification
|
|
383
|
+
|
|
384
|
+
**Request:** "[user's request]"
|
|
385
|
+
**Type:** UNCLEAR
|
|
386
|
+
|
|
387
|
+
I need clarification to proceed correctly:
|
|
388
|
+
|
|
389
|
+
Are you asking me to:
|
|
390
|
+
1. Add new functionality (feature)
|
|
391
|
+
2. Fix something broken (fix)
|
|
392
|
+
3. Improve existing code (refactor)
|
|
393
|
+
4. Just answer a question (query)
|
|
394
|
+
|
|
395
|
+
Please clarify so I can follow the appropriate workflow.
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Quick Reference
|
|
401
|
+
|
|
402
|
+
| Task Type | Workflow | Audit? | Suggestions? |
|
|
403
|
+
|-----------|----------|--------|--------------|
|
|
404
|
+
| feature | Full | Yes | Required |
|
|
405
|
+
| fix | Standard | No | Conditional |
|
|
406
|
+
| refactor | Full | Yes | Conditional |
|
|
407
|
+
| style | Simple | No | Skip |
|
|
408
|
+
| docs | Simple | No | Skip |
|
|
409
|
+
| test | Standard+ | No | Conditional |
|
|
410
|
+
| config | Simple | No | Skip |
|
|
411
|
+
| perf | Full | Yes | Required |
|
|
412
|
+
| security | Full+ | No | Required |
|
|
413
|
+
| query | Respond | No | Skip |
|
|
414
|
+
|
|
415
|
+
**Always classify before proceeding. Workflow depends on task type.**
|