autoworkflow 2.0.0 → 2.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/README.md +154 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,45 @@
|
|
|
1
1
|
# AutoWorkflow - System Prompt Layer for Claude Code
|
|
2
2
|
|
|
3
|
-
> **Claude is the enforcement engine.**
|
|
3
|
+
> **Claude is the enforcement engine.** System prompts control the workflow. Scripts and hooks provide backup enforcement.
|
|
4
4
|
|
|
5
|
-
A system prompt architecture that controls Claude Code's behavior through triggers, loops, gates, and routing. When you use Claude Code in VS Code with this project, Claude
|
|
5
|
+
A system prompt architecture that controls Claude Code's behavior through triggers, loops, gates, and routing. When you use Claude Code in VS Code with this project, Claude automatically follows a structured 9-phase workflow for all coding tasks.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### Via npm (Recommended)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install autoworkflow
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then copy files to your project:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Copy all workflow files
|
|
21
|
+
cp -r node_modules/autoworkflow/CLAUDE.md .
|
|
22
|
+
cp -r node_modules/autoworkflow/system ./system
|
|
23
|
+
cp -r node_modules/autoworkflow/instructions ./instructions
|
|
24
|
+
cp -r node_modules/autoworkflow/.claude ./.claude
|
|
25
|
+
cp -r node_modules/autoworkflow/scripts ./scripts
|
|
26
|
+
cp -r node_modules/autoworkflow/hooks ./hooks
|
|
27
|
+
|
|
28
|
+
# Optional: Copy VS Code settings
|
|
29
|
+
cp -r node_modules/autoworkflow/.vscode ./.vscode
|
|
30
|
+
|
|
31
|
+
# Optional: Copy config examples
|
|
32
|
+
cp node_modules/autoworkflow/.prettierrc .
|
|
33
|
+
cp node_modules/autoworkflow/eslint.config.example.js ./eslint.config.js
|
|
34
|
+
cp node_modules/autoworkflow/tsconfig.example.json ./tsconfig.json
|
|
35
|
+
|
|
36
|
+
# Setup git hooks
|
|
37
|
+
npm run setup:hooks
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Manual Installation
|
|
41
|
+
|
|
42
|
+
Clone or download this repository and copy the files to your project.
|
|
6
43
|
|
|
7
44
|
---
|
|
8
45
|
|
|
@@ -29,60 +66,45 @@ A system prompt architecture that controls Claude Code's behavior through trigge
|
|
|
29
66
|
│ │
|
|
30
67
|
│ CLAUDE.md │ AI_RULES.md │ BLUEPRINT.md │
|
|
31
68
|
│ Workflow │ Standards │ Project spec │
|
|
69
|
+
└───────────────────────────┬─────────────────────────────────┘
|
|
70
|
+
│
|
|
71
|
+
▼
|
|
72
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
73
|
+
│ Backup Enforcement (Runtime Layer) │
|
|
74
|
+
│ │
|
|
75
|
+
│ scripts/ │ hooks/ │ npm scripts │
|
|
76
|
+
│ Automation │ Git hooks │ Verification │
|
|
32
77
|
└─────────────────────────────────────────────────────────────┘
|
|
33
78
|
```
|
|
34
79
|
|
|
35
80
|
---
|
|
36
81
|
|
|
37
|
-
## Quick Start
|
|
38
|
-
|
|
39
|
-
1. **Copy this structure** into your project:
|
|
40
|
-
```
|
|
41
|
-
your-project/
|
|
42
|
-
├── CLAUDE.md # Entry point
|
|
43
|
-
├── system/ # Control layer
|
|
44
|
-
│ ├── triggers.md
|
|
45
|
-
│ ├── loops.md
|
|
46
|
-
│ ├── gates.md
|
|
47
|
-
│ └── router.md
|
|
48
|
-
├── instructions/ # Content layer
|
|
49
|
-
│ ├── CLAUDE.md
|
|
50
|
-
│ ├── AI_RULES.md
|
|
51
|
-
│ └── BLUEPRINT.md
|
|
52
|
-
├── .claude/ # Claude Code integration
|
|
53
|
-
│ ├── settings.json
|
|
54
|
-
│ └── commands/
|
|
55
|
-
└── .vscode/ # VS Code integration
|
|
56
|
-
├── settings.json
|
|
57
|
-
├── tasks.json
|
|
58
|
-
└── extensions.json
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
2. **Customize the instructions**:
|
|
62
|
-
- Edit `instructions/AI_RULES.md` with your coding standards
|
|
63
|
-
- Edit `instructions/BLUEPRINT.md` with your project spec
|
|
64
|
-
|
|
65
|
-
3. **Use Claude Code** - Claude will automatically follow the workflow!
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
82
|
## The Workflow
|
|
70
83
|
|
|
71
|
-
When you ask Claude to do something, it follows this workflow:
|
|
84
|
+
When you ask Claude to do something, it follows this 9-phase workflow:
|
|
72
85
|
|
|
73
86
|
```
|
|
74
|
-
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
|
|
87
|
+
ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → FIX → AUDIT → COMMIT → UPDATE
|
|
75
88
|
```
|
|
76
89
|
|
|
77
90
|
| Phase | What Claude Does |
|
|
78
91
|
|-------|------------------|
|
|
79
|
-
| **ANALYZE** | Reads relevant files,
|
|
80
|
-
| **PLAN** | Designs approach, shows suggestions |
|
|
92
|
+
| **ANALYZE** | Reads relevant files, checks BLUEPRINT.md |
|
|
93
|
+
| **PLAN** | Designs approach, shows categorized suggestions |
|
|
81
94
|
| **CONFIRM** | Waits for your approval |
|
|
82
95
|
| **IMPLEMENT** | Makes changes (only after approval) |
|
|
83
96
|
| **VERIFY** | Runs `npm run verify` (typecheck + lint) |
|
|
97
|
+
| **FIX** | Fixes errors, loops back to VERIFY |
|
|
84
98
|
| **AUDIT** | Checks for orphan features, circular deps |
|
|
85
99
|
| **COMMIT** | Creates conventional commit (after approval) |
|
|
100
|
+
| **UPDATE** | Updates BLUEPRINT.md if new feature/route/API added |
|
|
101
|
+
|
|
102
|
+
### Session Start
|
|
103
|
+
|
|
104
|
+
At the start of every session, Claude:
|
|
105
|
+
1. Checks if `instructions/BLUEPRINT.md` exists
|
|
106
|
+
2. If missing → Runs `/audit project` to generate it
|
|
107
|
+
3. If exists → Reads AI_RULES.md + BLUEPRINT.md and proceeds
|
|
86
108
|
|
|
87
109
|
---
|
|
88
110
|
|
|
@@ -109,6 +131,7 @@ Claude will STOP and cannot proceed if:
|
|
|
109
131
|
| `/verify` | Run TypeScript + ESLint |
|
|
110
132
|
| `/fix` | Fix verification errors |
|
|
111
133
|
| `/audit` | Run UI + cycle audits |
|
|
134
|
+
| `/audit project` | Full project scan → generates BLUEPRINT.md |
|
|
112
135
|
| `/suggest [task]` | Generate suggestions |
|
|
113
136
|
| `/commit [msg]` | Pre-commit check + commit |
|
|
114
137
|
|
|
@@ -126,10 +149,42 @@ Claude enforces these automatically:
|
|
|
126
149
|
|
|
127
150
|
---
|
|
128
151
|
|
|
152
|
+
## npm Scripts
|
|
153
|
+
|
|
154
|
+
### Verification
|
|
155
|
+
```bash
|
|
156
|
+
npm run verify # TypeScript + ESLint
|
|
157
|
+
npm run typecheck # TypeScript only
|
|
158
|
+
npm run lint # ESLint only
|
|
159
|
+
npm run format # Prettier format
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Audits
|
|
163
|
+
```bash
|
|
164
|
+
npm run audit:ui # Check orphan features (BLOCKING)
|
|
165
|
+
npm run audit:cycles # Check circular deps (BLOCKING)
|
|
166
|
+
npm run audit:all # Run all audits
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Workflow Automation
|
|
170
|
+
```bash
|
|
171
|
+
npm run dyad:status # Show workflow status
|
|
172
|
+
npm run dyad:verify # Run verification
|
|
173
|
+
npm run dyad:commit # Commit with checks
|
|
174
|
+
npm run dyad:full # Full workflow
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Setup
|
|
178
|
+
```bash
|
|
179
|
+
npm run setup:hooks # Install git hooks
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
129
184
|
## File Structure
|
|
130
185
|
|
|
131
186
|
```
|
|
132
|
-
|
|
187
|
+
autoworkflow/
|
|
133
188
|
├── CLAUDE.md # Entry point (Claude reads this first)
|
|
134
189
|
│
|
|
135
190
|
├── system/ # Control Layer
|
|
@@ -139,7 +194,7 @@ Claude enforces these automatically:
|
|
|
139
194
|
│ └── router.md # Task type routing
|
|
140
195
|
│
|
|
141
196
|
├── instructions/ # Content Layer
|
|
142
|
-
│ ├── CLAUDE.md # Workflow steps
|
|
197
|
+
│ ├── CLAUDE.md # Workflow steps (9 phases)
|
|
143
198
|
│ ├── AI_RULES.md # Coding standards
|
|
144
199
|
│ └── BLUEPRINT.md # Project specification
|
|
145
200
|
│
|
|
@@ -155,32 +210,55 @@ Claude enforces these automatically:
|
|
|
155
210
|
│ ├── suggest.md
|
|
156
211
|
│ └── commit.md
|
|
157
212
|
│
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
213
|
+
├── scripts/ # Automation Scripts
|
|
214
|
+
│ ├── setup.sh # Initial setup
|
|
215
|
+
│ ├── autoworkflow.sh # Workflow automation
|
|
216
|
+
│ ├── check-ui-enforcement.sh
|
|
217
|
+
│ ├── run-verification.sh
|
|
218
|
+
│ └── ensure-no-errors.sh
|
|
219
|
+
│
|
|
220
|
+
├── hooks/ # Git Hooks (backup enforcement)
|
|
221
|
+
│ ├── pre-commit # Blocks bad commits
|
|
222
|
+
│ └── commit-msg # Validates commit messages
|
|
223
|
+
│
|
|
224
|
+
├── .vscode/ # VS Code Integration (optional)
|
|
225
|
+
│ ├── settings.json # Editor settings
|
|
226
|
+
│ ├── tasks.json # Runnable tasks
|
|
227
|
+
│ └── extensions.json # Recommended extensions
|
|
228
|
+
│
|
|
229
|
+
├── .prettierrc # Prettier config
|
|
230
|
+
├── eslint.config.example.js # ESLint config template
|
|
231
|
+
└── tsconfig.example.json # TypeScript config template
|
|
162
232
|
```
|
|
163
233
|
|
|
164
234
|
---
|
|
165
235
|
|
|
166
236
|
## Why This Approach?
|
|
167
237
|
|
|
168
|
-
###
|
|
169
|
-
- Git hooks run scripts
|
|
170
|
-
- Scripts check code
|
|
171
|
-
- Blocks commit on failure
|
|
172
|
-
|
|
173
|
-
### AutoWorkflow (This Approach)
|
|
174
|
-
- Claude reads instructions
|
|
175
|
-
- Claude follows the workflow
|
|
176
|
-
- Claude enforces rules as it works
|
|
238
|
+
### Dual Enforcement Strategy
|
|
177
239
|
|
|
178
|
-
**
|
|
179
|
-
-
|
|
180
|
-
-
|
|
240
|
+
**Primary: Claude as Enforcement Engine**
|
|
241
|
+
- Claude reads instructions from system prompts
|
|
242
|
+
- Claude follows the 9-phase workflow
|
|
243
|
+
- Claude enforces rules proactively as it works
|
|
181
244
|
- Claude explains what's happening
|
|
182
|
-
|
|
183
|
-
|
|
245
|
+
|
|
246
|
+
**Backup: Scripts & Git Hooks**
|
|
247
|
+
- Git hooks catch anything Claude misses
|
|
248
|
+
- Scripts automate verification
|
|
249
|
+
- Pre-commit blocks bad code from reaching the repo
|
|
250
|
+
|
|
251
|
+
### Benefits
|
|
252
|
+
|
|
253
|
+
| Feature | Benefit |
|
|
254
|
+
|---------|---------|
|
|
255
|
+
| System prompts | No runtime code to maintain |
|
|
256
|
+
| Portable | Just copy files to any project |
|
|
257
|
+
| Transparent | Claude explains the workflow |
|
|
258
|
+
| Flexible | Claude adapts to context |
|
|
259
|
+
| Suggestions | Proactively improves code quality |
|
|
260
|
+
| Git hooks | Backup enforcement layer |
|
|
261
|
+
| npm scripts | Easy automation |
|
|
184
262
|
|
|
185
263
|
---
|
|
186
264
|
|
|
@@ -223,11 +301,25 @@ Edit `system/loops.md` to change retry behavior.
|
|
|
223
301
|
## Requirements
|
|
224
302
|
|
|
225
303
|
- VS Code with Claude Code extension
|
|
226
|
-
-
|
|
304
|
+
- Node.js 18+ (for npm scripts)
|
|
305
|
+
- TypeScript, ESLint, Prettier (for verification)
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## What Gets Copied
|
|
310
|
+
|
|
311
|
+
When you install via npm, these files are available to copy:
|
|
227
312
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
313
|
+
| Category | Files | Required? |
|
|
314
|
+
|----------|-------|-----------|
|
|
315
|
+
| Entry point | `CLAUDE.md` | ✅ Yes |
|
|
316
|
+
| Control layer | `system/` | ✅ Yes |
|
|
317
|
+
| Content layer | `instructions/` | ✅ Yes |
|
|
318
|
+
| Claude integration | `.claude/` | ✅ Yes |
|
|
319
|
+
| Automation | `scripts/` | Recommended |
|
|
320
|
+
| Git hooks | `hooks/` | Recommended |
|
|
321
|
+
| VS Code | `.vscode/` | Optional |
|
|
322
|
+
| Configs | `.prettierrc`, `*.example.*` | Optional |
|
|
231
323
|
|
|
232
324
|
---
|
|
233
325
|
|