autoworkflow 3.8.4 → 3.9.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/.autoworkflow/memories/.gitkeep +2 -0
- package/.claude/.autoworkflow/memories/blockers.md +23 -0
- package/.claude/.autoworkflow/memories/decisions.md +23 -0
- package/.claude/.autoworkflow/memories/patterns.md +24 -0
- package/.claude/commands/audit.md +27 -29
- package/.claude/commands/init.md +5 -4
- package/.claude/hooks/blueprint-generator.sh +284 -22
- package/.claude/hooks/phase-transition.sh +200 -0
- package/.claude/hooks/pre-tool-router.sh +139 -1
- package/.claude/hooks/session-check.sh +74 -18
- package/.claude/settings.json +2 -2
- package/.claude/settings.local.json +7 -1
- package/CLAUDE.md +118 -8
- package/README.md +13 -13
- package/bin/cli.js +6 -6
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
.claude/settings.json → HOOK CONFIG + SYSTEM INSTRUCTIONS
|
|
31
31
|
.claude/.autoworkflow/ → STATE FILES (phase, iterations, etc.)
|
|
32
32
|
CLAUDE.md (this file) → WORKFLOW SUMMARY
|
|
33
|
-
instructions/ → AI_RULES.md +
|
|
33
|
+
instructions/ → AI_RULES.md + user's documentation
|
|
34
34
|
system/ → DETAILED REFERENCE (gates, loops, triggers, router)
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -42,7 +42,7 @@ system/ → DETAILED REFERENCE (gates, loops, triggers, router
|
|
|
42
42
|
|
|
43
43
|
| Event | Hook | Output to Claude |
|
|
44
44
|
|-------|------|------------------|
|
|
45
|
-
| User message | `session-check.sh` | "
|
|
45
|
+
| User message | `session-check.sh` | "Provide your project documentation" |
|
|
46
46
|
| After Write/Edit | `post-edit.sh` | Runs `npm run verify`, shows errors |
|
|
47
47
|
| Before git commit | `pre-tool-router.sh` | Runs all 7 gate checks, BLOCKS if fail |
|
|
48
48
|
|
|
@@ -58,14 +58,14 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
|
|
|
58
58
|
|
|
59
59
|
| Phase | What Claude Does |
|
|
60
60
|
|-------|------------------|
|
|
61
|
-
| ANALYZE | Read relevant files, check
|
|
61
|
+
| ANALYZE | Read relevant files, check user's documentation |
|
|
62
62
|
| PLAN | Design approach, show suggestions |
|
|
63
63
|
| CONFIRM | **Wait for user approval** |
|
|
64
64
|
| IMPLEMENT | Make changes (after approval only) |
|
|
65
65
|
| VERIFY | Run `npm run verify` - **AUTO-TRIGGERED** |
|
|
66
66
|
| AUDIT | Run `npm run audit:ui` + `audit:cycles` |
|
|
67
67
|
| COMMIT | Conventional commit format - **BLOCKED if checks fail** |
|
|
68
|
-
| UPDATE |
|
|
68
|
+
| UPDATE | Note changes in session context |
|
|
69
69
|
|
|
70
70
|
---
|
|
71
71
|
|
|
@@ -124,6 +124,72 @@ All state stored in `.claude/.autoworkflow/`:
|
|
|
124
124
|
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
+
## Memory System (Serena-inspired)
|
|
128
|
+
|
|
129
|
+
Persistent context that survives across sessions. Stored in `.claude/.autoworkflow/memories/`.
|
|
130
|
+
|
|
131
|
+
| File | Purpose |
|
|
132
|
+
|------|---------|
|
|
133
|
+
| `decisions.md` | Document architectural/implementation choices |
|
|
134
|
+
| `patterns.md` | Record discovered codebase patterns |
|
|
135
|
+
| `blockers.md` | Track known issues and workarounds |
|
|
136
|
+
| `context.md` | Session continuity (auto-generated) |
|
|
137
|
+
|
|
138
|
+
**Memory Commands:**
|
|
139
|
+
```bash
|
|
140
|
+
# Save a decision
|
|
141
|
+
.claude/hooks/phase-transition.sh memory-save decisions "auth-approach" "Chose JWT over sessions for stateless API"
|
|
142
|
+
|
|
143
|
+
# Read memories
|
|
144
|
+
.claude/hooks/phase-transition.sh memory-read decisions
|
|
145
|
+
|
|
146
|
+
# List all categories
|
|
147
|
+
.claude/hooks/phase-transition.sh memory-list
|
|
148
|
+
|
|
149
|
+
# Save context for next session
|
|
150
|
+
.claude/hooks/phase-transition.sh context-save "Implementing user auth"
|
|
151
|
+
|
|
152
|
+
# Load previous context
|
|
153
|
+
.claude/hooks/phase-transition.sh context-load
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Reflection Prompts (Serena-inspired)
|
|
159
|
+
|
|
160
|
+
Before each phase transition, Claude receives reflection prompts to self-assess:
|
|
161
|
+
|
|
162
|
+
| Phase | Reflection |
|
|
163
|
+
|-------|------------|
|
|
164
|
+
| PLAN | Have you read all relevant files? Understood existing patterns? |
|
|
165
|
+
| IMPLEMENT | Does this match the request? Considered all affected files? |
|
|
166
|
+
| VERIFY | Is implementation complete? Edge cases handled? |
|
|
167
|
+
| COMMIT | Would you be confident shipping this? |
|
|
168
|
+
|
|
169
|
+
**Manual reflection:**
|
|
170
|
+
```bash
|
|
171
|
+
.claude/hooks/phase-transition.sh reflect PLAN
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Mode Restrictions (Serena-inspired)
|
|
177
|
+
|
|
178
|
+
Task types have different allowed operations:
|
|
179
|
+
|
|
180
|
+
| Mode | Restrictions |
|
|
181
|
+
|------|--------------|
|
|
182
|
+
| `docs` | Warn on non-.md file creation |
|
|
183
|
+
| `fix` | Warn on new file creation, dependency changes |
|
|
184
|
+
| `refactor` | Warn on behavior-changing operations (migrations) |
|
|
185
|
+
| `query` | Warn on any modifications (read-only) |
|
|
186
|
+
|
|
187
|
+
Phase restrictions:
|
|
188
|
+
- `ANALYZE`/`PLAN` phases warn on file creation/dependency changes
|
|
189
|
+
- Must reach `IMPLEMENT` phase before making modifications
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
127
193
|
## Blocking Rules
|
|
128
194
|
|
|
129
195
|
- **No orphan features** - Backend must have UI
|
|
@@ -142,7 +208,7 @@ All state stored in `.claude/.autoworkflow/`:
|
|
|
142
208
|
| `/plan [task]` | Create implementation plan |
|
|
143
209
|
| `/verify` | Run TypeScript + ESLint |
|
|
144
210
|
| `/audit` | Run UI + cycle audits |
|
|
145
|
-
| `/audit project` | Full project scan →
|
|
211
|
+
| `/audit project` | Full project scan → technical context |
|
|
146
212
|
| `/commit [msg]` | Pre-commit gate + commit |
|
|
147
213
|
| `/init` | Set up AutoWorkflow files |
|
|
148
214
|
| `/fix` | Fix verification errors |
|
|
@@ -172,7 +238,51 @@ npm run format # Prettier
|
|
|
172
238
|
| `pre-commit-check.sh` | Before git commit | All 7 gate checks, BLOCKS |
|
|
173
239
|
| `phase-transition.sh` | Manual call | State management |
|
|
174
240
|
| `audit-runner.sh` | Manual call | Run UI + cycle audits |
|
|
175
|
-
| `blueprint-generator.sh` | Manual call |
|
|
241
|
+
| `blueprint-generator.sh` | Manual call | Enhanced project discovery (8 scans) |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Documentation Workflow
|
|
246
|
+
|
|
247
|
+
Your project documentation is the single source of truth:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
251
|
+
│ Session Start │
|
|
252
|
+
│ ↓ │
|
|
253
|
+
│ USER PROVIDES: PRD / Spec / Userflow / Implementation │
|
|
254
|
+
│ ↓ │
|
|
255
|
+
│ THAT DOCUMENT = SOURCE OF TRUTH │
|
|
256
|
+
│ ↓ │
|
|
257
|
+
│ Referenced for ALL tasks │
|
|
258
|
+
└─────────────────────────────────────────────────────────────┘
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**How it works:**
|
|
262
|
+
1. Provide your documentation (PRD, spec, userflow, implementation guide)
|
|
263
|
+
2. That document is used directly - no transformation or format conversion
|
|
264
|
+
3. All tasks reference your document as the single source of truth
|
|
265
|
+
|
|
266
|
+
**No BLUEPRINT.md generation.** Your document IS the blueprint.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Project Discovery (Serena-inspired)
|
|
271
|
+
|
|
272
|
+
`/audit project` runs 8 scans for technical context:
|
|
273
|
+
|
|
274
|
+
| Scan | What It Detects |
|
|
275
|
+
|------|-----------------|
|
|
276
|
+
| Architecture | Monorepo, microservices, modular, feature-based, layered |
|
|
277
|
+
| Essential Commands | npm scripts, Makefile targets, tool configs |
|
|
278
|
+
| Tech Stack | Framework, styling, database, state, testing |
|
|
279
|
+
| Structure | Source directories, organization |
|
|
280
|
+
| Routes | App Router, Pages Router, SPA routes |
|
|
281
|
+
| Components | React/Vue/Svelte components |
|
|
282
|
+
| API | REST endpoints, GraphQL |
|
|
283
|
+
| Environment | .env files, required variables, configs |
|
|
284
|
+
|
|
285
|
+
**Note:** Scans provide technical context. BLUEPRINT.md content comes from your documentation.
|
|
176
286
|
|
|
177
287
|
---
|
|
178
288
|
|
|
@@ -181,9 +291,9 @@ npm run format # Prettier
|
|
|
181
291
|
| File | Purpose |
|
|
182
292
|
|------|---------|
|
|
183
293
|
| `instructions/AI_RULES.md` | Your coding standards |
|
|
184
|
-
|
|
|
294
|
+
| User's documentation | Single source of truth (PRD/spec/userflow) |
|
|
185
295
|
|
|
186
|
-
If
|
|
296
|
+
If no documentation provided → Hook prompts user to provide it
|
|
187
297
|
|
|
188
298
|
---
|
|
189
299
|
|
package/README.md
CHANGED
|
@@ -31,13 +31,13 @@ The CLI tracks installed versions and preserves user customizations:
|
|
|
31
31
|
|
|
32
32
|
```
|
|
33
33
|
npx autoworkflow status # Check version and what would change
|
|
34
|
-
npx autoworkflow update # Update core files, preserve
|
|
34
|
+
npx autoworkflow update # Update core files, preserve user files
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
| File Category | On `init` | On `update` |
|
|
38
38
|
|---------------|-----------|-------------|
|
|
39
39
|
| **Core** (hooks, system, CLAUDE.md) | Installed | Updated |
|
|
40
|
-
| **User** (
|
|
40
|
+
| **User** (AI_RULES.md, your docs) | Created if missing | **Preserved** |
|
|
41
41
|
| **Commands/Skills** | Installed | Updated |
|
|
42
42
|
| **Optional** (.vscode, configs) | Only with `--all` | Skipped |
|
|
43
43
|
|
|
@@ -95,7 +95,7 @@ Auto-loaded knowledge for each command via `skills_required` in command frontmat
|
|
|
95
95
|
│ PostToolUse → post-edit.sh (Write/Edit) │
|
|
96
96
|
│ (multi-lang verification loop) │
|
|
97
97
|
│ → post-bash-router.sh (Bash) │
|
|
98
|
-
│ → post-commit.sh (
|
|
98
|
+
│ → post-commit.sh (commit summary) │
|
|
99
99
|
│ │
|
|
100
100
|
│ Hooks ENFORCE workflow - they physically block actions │
|
|
101
101
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -128,14 +128,14 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
|
|
|
128
128
|
|
|
129
129
|
| Phase | What Happens | Enforcement |
|
|
130
130
|
|-------|--------------|-------------|
|
|
131
|
-
| ANALYZE | Read relevant files, check
|
|
131
|
+
| ANALYZE | Read relevant files, check user's documentation | - |
|
|
132
132
|
| PLAN | Design approach, show 3-tier suggestions | - |
|
|
133
133
|
| CONFIRM | Wait for user approval | **pre-edit.sh BLOCKS edits** |
|
|
134
134
|
| IMPLEMENT | Make changes (after approval only) | Allowed after approval |
|
|
135
135
|
| VERIFY | Run `npm run verify` (max 10 iterations) | Auto-triggered by hook |
|
|
136
136
|
| AUDIT | Check orphan features + circular deps | Required for features |
|
|
137
137
|
| COMMIT | Conventional commit format | **pre-commit.sh BLOCKS bad commits** |
|
|
138
|
-
| UPDATE |
|
|
138
|
+
| UPDATE | Note changes in session context | **post-commit.sh reminder** |
|
|
139
139
|
|
|
140
140
|
---
|
|
141
141
|
|
|
@@ -143,16 +143,16 @@ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT → U
|
|
|
143
143
|
|
|
144
144
|
| Hook | Trigger | Action |
|
|
145
145
|
|------|---------|--------|
|
|
146
|
-
| `session-check.sh` | UserPromptSubmit | Resume session, reset turn counter, check
|
|
146
|
+
| `session-check.sh` | UserPromptSubmit | Resume session, reset turn counter, check docs |
|
|
147
147
|
| `pre-edit.sh` | PreToolUse (Write/Edit) | **BLOCK** if: no approval, no suggestions, or multiple fixes |
|
|
148
148
|
| `post-edit.sh` | PostToolUse (Write/Edit) | Detect project type, run verification |
|
|
149
149
|
| `pre-tool-router.sh` | PreToolUse (Bash) | Routes to pre-commit-check for git commits |
|
|
150
150
|
| `post-bash-router.sh` | PostToolUse (Bash) | Routes to post-commit for git commits |
|
|
151
151
|
| `pre-commit-check.sh` | Before git commit | **BLOCK** with 7 gate checks (TS, ESLint, TODO, etc.) |
|
|
152
|
-
| `post-commit.sh` | After git commit |
|
|
152
|
+
| `post-commit.sh` | After git commit | Commit summary |
|
|
153
153
|
| `phase-transition.sh` | Manual/internal | State management between workflow phases |
|
|
154
154
|
| `audit-runner.sh` | Manual/internal | Run UI enforcement + circular dep checks |
|
|
155
|
-
| `blueprint-generator.sh` | Manual/internal |
|
|
155
|
+
| `blueprint-generator.sh` | Manual/internal | Scan project structure |
|
|
156
156
|
|
|
157
157
|
---
|
|
158
158
|
|
|
@@ -186,22 +186,22 @@ project/
|
|
|
186
186
|
├── .claude/
|
|
187
187
|
│ ├── settings.json # Hooks + system prompt
|
|
188
188
|
│ ├── hooks/ # 10 enforcement scripts
|
|
189
|
-
│ │ ├── session-check.sh # Session init +
|
|
189
|
+
│ │ ├── session-check.sh # Session init + docs check
|
|
190
190
|
│ │ ├── pre-edit.sh # Plan approval gate (3 checks)
|
|
191
191
|
│ │ ├── post-edit.sh # Auto-verification loop
|
|
192
192
|
│ │ ├── pre-tool-router.sh # Routes Bash commands
|
|
193
193
|
│ │ ├── post-bash-router.sh # Routes post-Bash actions
|
|
194
194
|
│ │ ├── pre-commit-check.sh # 7 gate checks before commit
|
|
195
|
-
│ │ ├── post-commit.sh #
|
|
195
|
+
│ │ ├── post-commit.sh # Commit summary
|
|
196
196
|
│ │ ├── phase-transition.sh # State management
|
|
197
197
|
│ │ ├── audit-runner.sh # UI + cycle audits
|
|
198
|
-
│ │ └── blueprint-generator.sh #
|
|
198
|
+
│ │ └── blueprint-generator.sh # Scan project for technical context
|
|
199
199
|
│ ├── commands/ # 9 slash commands
|
|
200
200
|
│ └── skills/ # 106 knowledge files
|
|
201
201
|
│
|
|
202
202
|
├── instructions/
|
|
203
203
|
│ ├── AI_RULES.md # Your coding standards
|
|
204
|
-
│ └──
|
|
204
|
+
│ └── (user's documentation) # Single source of truth
|
|
205
205
|
│
|
|
206
206
|
├── system/ # Detailed reference
|
|
207
207
|
│ ├── gates.md # Blocking checkpoint definitions
|
|
@@ -240,7 +240,7 @@ npm run audit:all # Run all audits
|
|
|
240
240
|
| `/verify` | QA Engineer | Run verification loop |
|
|
241
241
|
| `/fix` | Debug Engineer | Fix verification errors |
|
|
242
242
|
| `/audit` | Code Reviewer | Security + quality audit |
|
|
243
|
-
| `/audit project` | Code Reviewer | Full scan →
|
|
243
|
+
| `/audit project` | Code Reviewer | Full scan → technical context |
|
|
244
244
|
| `/commit` | Git Specialist | Pre-commit check + commit |
|
|
245
245
|
|
|
246
246
|
---
|
package/bin/cli.js
CHANGED
|
@@ -402,10 +402,10 @@ function init(options = {}) {
|
|
|
402
402
|
currentContent.replace(/^#.*$/gm, '').replace(/\s+/g, ' ').trim().length < 200;
|
|
403
403
|
|
|
404
404
|
if (isTemplate) {
|
|
405
|
-
// Remove template
|
|
405
|
+
// Remove template - user will provide their own documentation
|
|
406
406
|
try {
|
|
407
407
|
unlinkSync(blueprintPath);
|
|
408
|
-
console.log(` ${colors.cyan('ℹ')} BLUEPRINT.md template removed (
|
|
408
|
+
console.log(` ${colors.cyan('ℹ')} BLUEPRINT.md template removed (provide your docs on first run)`);
|
|
409
409
|
} catch (e) {
|
|
410
410
|
// Ignore
|
|
411
411
|
}
|
|
@@ -413,7 +413,7 @@ function init(options = {}) {
|
|
|
413
413
|
console.log(` ${colors.cyan('★')} instructions/BLUEPRINT.md ${colors.dim('(content preserved)')}`);
|
|
414
414
|
}
|
|
415
415
|
} else {
|
|
416
|
-
console.log(` ${colors.cyan('ℹ')} BLUEPRINT.md will be
|
|
416
|
+
console.log(` ${colors.cyan('ℹ')} BLUEPRINT.md will be created from your documentation on first run`);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
// Make Claude hooks executable
|
|
@@ -446,9 +446,9 @@ function init(options = {}) {
|
|
|
446
446
|
|
|
447
447
|
console.log(`${colors.bold('Next steps:')}`);
|
|
448
448
|
console.log(` 1. Open VS Code with Claude Code extension`);
|
|
449
|
-
console.log(` 2.
|
|
450
|
-
console.log(` 3.
|
|
451
|
-
console.log(` 4.
|
|
449
|
+
console.log(` 2. Provide your documentation (PRD, spec, userflow)`);
|
|
450
|
+
console.log(` 3. Your document = ${colors.cyan('single source of truth')}`);
|
|
451
|
+
console.log(` 4. Claude references your docs for all tasks\n`);
|
|
452
452
|
|
|
453
453
|
console.log(`${colors.dim('Optional: Edit instructions/AI_RULES.md to customize coding standards')}\n`);
|
|
454
454
|
}
|