autoworkflow 2.0.0 → 2.1.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.
@@ -0,0 +1,142 @@
1
+ # /init - Initialize AutoWorkflow
2
+
3
+ Set up AutoWorkflow files in the current project.
4
+
5
+ ## Trigger
6
+ - User invokes `/init`
7
+ - User invokes `/init autoworkflow`
8
+ - User says "set up autoworkflow" or "initialize workflow"
9
+
10
+ ## Purpose
11
+ Copy AutoWorkflow files from `node_modules/autoworkflow/` to the project root.
12
+
13
+ ## Workflow
14
+
15
+ ### Step 1: Check if autoworkflow is installed
16
+ ```bash
17
+ [ -d node_modules/autoworkflow ] && echo "Found" || echo "Not found"
18
+ ```
19
+
20
+ If not found:
21
+ ```
22
+ ⚠️ autoworkflow not found in node_modules.
23
+
24
+ Run this first:
25
+ npm install autoworkflow
26
+
27
+ Then run /init again.
28
+ ```
29
+
30
+ ### Step 2: Check what's already set up
31
+ ```bash
32
+ [ -f CLAUDE.md ] && echo "CLAUDE.md exists"
33
+ [ -d system ] && echo "system/ exists"
34
+ [ -d instructions ] && echo "instructions/ exists"
35
+ [ -d .claude ] && echo ".claude/ exists"
36
+ [ -d scripts ] && echo "scripts/ exists"
37
+ [ -d hooks ] && echo "hooks/ exists"
38
+ ```
39
+
40
+ ### Step 3: Present setup options
41
+ ```
42
+ ## AutoWorkflow Setup
43
+
44
+ **Source:** node_modules/autoworkflow/
45
+
46
+ ### Required Files
47
+ | File/Folder | Status | Action |
48
+ |-------------|--------|--------|
49
+ | CLAUDE.md | ❌ Missing | Will copy |
50
+ | system/ | ❌ Missing | Will copy |
51
+ | instructions/ | ❌ Missing | Will copy |
52
+ | .claude/ | ❌ Missing | Will copy |
53
+
54
+ ### Recommended Files
55
+ | File/Folder | Status | Action |
56
+ |-------------|--------|--------|
57
+ | scripts/ | ❌ Missing | Will copy |
58
+ | hooks/ | ❌ Missing | Will copy |
59
+
60
+ ### Optional Files
61
+ | File/Folder | Status | Action |
62
+ |-------------|--------|--------|
63
+ | .vscode/ | ❌ Missing | Skip (add with --vscode) |
64
+ | .prettierrc | ❌ Missing | Skip (add with --configs) |
65
+ | eslint.config.js | ❌ Missing | Skip (add with --configs) |
66
+ | tsconfig.json | ❌ Missing | Skip (add with --configs) |
67
+
68
+ ---
69
+
70
+ **Should I set up AutoWorkflow?**
71
+ Options:
72
+ - `yes` - Copy required + recommended
73
+ - `all` - Copy everything including optional
74
+ - `minimal` - Copy required only
75
+ ```
76
+
77
+ ### Step 4: Copy files after approval
78
+ ```bash
79
+ # Required
80
+ cp node_modules/autoworkflow/CLAUDE.md .
81
+ cp -r node_modules/autoworkflow/system ./system
82
+ cp -r node_modules/autoworkflow/instructions ./instructions
83
+ cp -r node_modules/autoworkflow/.claude ./.claude
84
+
85
+ # Recommended
86
+ cp -r node_modules/autoworkflow/scripts ./scripts
87
+ cp -r node_modules/autoworkflow/hooks ./hooks
88
+
89
+ # Optional (if requested)
90
+ cp -r node_modules/autoworkflow/.vscode ./.vscode
91
+ cp node_modules/autoworkflow/.prettierrc .
92
+ cp node_modules/autoworkflow/eslint.config.example.js ./eslint.config.js
93
+ cp node_modules/autoworkflow/tsconfig.example.json ./tsconfig.json
94
+ ```
95
+
96
+ ### Step 5: Set up git hooks
97
+ ```bash
98
+ npm run setup:hooks
99
+ ```
100
+
101
+ ### Step 6: Confirm setup
102
+ ```
103
+ ## ✅ AutoWorkflow Initialized
104
+
105
+ **Files copied:**
106
+ - CLAUDE.md (entry point)
107
+ - system/ (triggers, loops, gates, router)
108
+ - instructions/ (workflow, AI rules, blueprint)
109
+ - .claude/ (settings, commands)
110
+ - scripts/ (automation)
111
+ - hooks/ (git hooks)
112
+
113
+ **Git hooks installed:**
114
+ - pre-commit
115
+ - commit-msg
116
+
117
+ **Next steps:**
118
+ 1. Edit `instructions/AI_RULES.md` with your coding standards
119
+ 2. Edit `instructions/BLUEPRINT.md` with your project spec
120
+ 3. Start using Claude Code - it will follow the workflow!
121
+
122
+ Run `/audit project` to auto-generate BLUEPRINT.md from your codebase.
123
+ ```
124
+
125
+ ## Arguments
126
+ - `/init` - Standard setup (required + recommended)
127
+ - `/init --all` - Include optional files (.vscode, configs)
128
+ - `/init --minimal` - Required files only
129
+ - `/init --vscode` - Include .vscode settings
130
+ - `/init --configs` - Include config templates
131
+
132
+ ## Examples
133
+ ```
134
+ User: /init
135
+ → Sets up required + recommended files
136
+
137
+ User: /init --all
138
+ → Sets up everything including .vscode and configs
139
+
140
+ User: set up autoworkflow
141
+ → Same as /init
142
+ ```
@@ -5,6 +5,7 @@
5
5
  "description": "System prompt layer that controls Claude's workflow with triggers, loops, and gates",
6
6
 
7
7
  "instructions": [
8
+ "IF autoworkflow in node_modules but CLAUDE.md missing: suggest running /init",
8
9
  "ALWAYS read CLAUDE.md (entry point) at the start of EVERY task",
9
10
  "ALWAYS check if instructions/BLUEPRINT.md exists at session start",
10
11
  "IF BLUEPRINT.md missing: run /audit project to generate it",
@@ -81,7 +82,8 @@
81
82
  },
82
83
 
83
84
  "triggers": {
84
- "on_conversation_start": ["Read CLAUDE.md", "Check BLUEPRINT.md exists", "Route via system/router.md"],
85
+ "on_conversation_start": ["Check if /init needed", "Read CLAUDE.md", "Check BLUEPRINT.md exists", "Route via system/router.md"],
86
+ "on_init_needed": ["Notify autoworkflow detected", "Suggest running /init"],
85
87
  "on_blueprint_missing": ["Run project audit", "Generate AI_RULES.md + BLUEPRINT.md", "Present for approval"],
86
88
  "on_task_start": ["Read CLAUDE.md", "Route via system/router.md"],
87
89
  "on_implementation_complete": ["Enter VERIFY phase", "Run verify_loop"],
package/README.md CHANGED
@@ -1,8 +1,53 @@
1
1
  # AutoWorkflow - System Prompt Layer for Claude Code
2
2
 
3
- > **Claude is the enforcement engine.** No scripts, no git hooks - just instructions that Claude follows.
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 will automatically follow a structured workflow for all coding tasks.
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 ask Claude to set it up:
18
+
19
+ ```
20
+ /init
21
+ ```
22
+
23
+ Claude will copy all necessary files from `node_modules/autoworkflow/` to your project root.
24
+
25
+ **Or copy manually:**
26
+
27
+ ```bash
28
+ # Copy all workflow files
29
+ cp -r node_modules/autoworkflow/CLAUDE.md .
30
+ cp -r node_modules/autoworkflow/system ./system
31
+ cp -r node_modules/autoworkflow/instructions ./instructions
32
+ cp -r node_modules/autoworkflow/.claude ./.claude
33
+ cp -r node_modules/autoworkflow/scripts ./scripts
34
+ cp -r node_modules/autoworkflow/hooks ./hooks
35
+
36
+ # Optional: Copy VS Code settings
37
+ cp -r node_modules/autoworkflow/.vscode ./.vscode
38
+
39
+ # Optional: Copy config examples
40
+ cp node_modules/autoworkflow/.prettierrc .
41
+ cp node_modules/autoworkflow/eslint.config.example.js ./eslint.config.js
42
+ cp node_modules/autoworkflow/tsconfig.example.json ./tsconfig.json
43
+
44
+ # Setup git hooks
45
+ npm run setup:hooks
46
+ ```
47
+
48
+ ### Manual Installation
49
+
50
+ Clone or download this repository and copy the files to your project.
6
51
 
7
52
  ---
8
53
 
@@ -29,60 +74,45 @@ A system prompt architecture that controls Claude Code's behavior through trigge
29
74
  │ │
30
75
  │ CLAUDE.md │ AI_RULES.md │ BLUEPRINT.md │
31
76
  │ Workflow │ Standards │ Project spec │
77
+ └───────────────────────────┬─────────────────────────────────┘
78
+
79
+
80
+ ┌─────────────────────────────────────────────────────────────┐
81
+ │ Backup Enforcement (Runtime Layer) │
82
+ │ │
83
+ │ scripts/ │ hooks/ │ npm scripts │
84
+ │ Automation │ Git hooks │ Verification │
32
85
  └─────────────────────────────────────────────────────────────┘
33
86
  ```
34
87
 
35
88
  ---
36
89
 
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
90
  ## The Workflow
70
91
 
71
- When you ask Claude to do something, it follows this workflow:
92
+ When you ask Claude to do something, it follows this 9-phase workflow:
72
93
 
73
94
  ```
74
- ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → AUDIT → COMMIT
95
+ ANALYZE → PLAN → CONFIRM → IMPLEMENT → VERIFY → FIX → AUDIT → COMMIT → UPDATE
75
96
  ```
76
97
 
77
98
  | Phase | What Claude Does |
78
99
  |-------|------------------|
79
- | **ANALYZE** | Reads relevant files, understands context |
80
- | **PLAN** | Designs approach, shows suggestions |
100
+ | **ANALYZE** | Reads relevant files, checks BLUEPRINT.md |
101
+ | **PLAN** | Designs approach, shows categorized suggestions |
81
102
  | **CONFIRM** | Waits for your approval |
82
103
  | **IMPLEMENT** | Makes changes (only after approval) |
83
104
  | **VERIFY** | Runs `npm run verify` (typecheck + lint) |
105
+ | **FIX** | Fixes errors, loops back to VERIFY |
84
106
  | **AUDIT** | Checks for orphan features, circular deps |
85
107
  | **COMMIT** | Creates conventional commit (after approval) |
108
+ | **UPDATE** | Updates BLUEPRINT.md if new feature/route/API added |
109
+
110
+ ### Session Start
111
+
112
+ At the start of every session, Claude:
113
+ 1. Checks if `instructions/BLUEPRINT.md` exists
114
+ 2. If missing → Runs `/audit project` to generate it
115
+ 3. If exists → Reads AI_RULES.md + BLUEPRINT.md and proceeds
86
116
 
87
117
  ---
88
118
 
@@ -103,12 +133,14 @@ Claude will STOP and cannot proceed if:
103
133
 
104
134
  | Command | Purpose |
105
135
  |---------|---------|
136
+ | `/init` | Set up AutoWorkflow files from node_modules |
106
137
  | `/analyze [task]` | Analyze codebase for a task |
107
138
  | `/plan [task]` | Create implementation plan |
108
139
  | `/build [feature]` | Full workflow for features |
109
140
  | `/verify` | Run TypeScript + ESLint |
110
141
  | `/fix` | Fix verification errors |
111
142
  | `/audit` | Run UI + cycle audits |
143
+ | `/audit project` | Full project scan → generates BLUEPRINT.md |
112
144
  | `/suggest [task]` | Generate suggestions |
113
145
  | `/commit [msg]` | Pre-commit check + commit |
114
146
 
@@ -126,10 +158,42 @@ Claude enforces these automatically:
126
158
 
127
159
  ---
128
160
 
161
+ ## npm Scripts
162
+
163
+ ### Verification
164
+ ```bash
165
+ npm run verify # TypeScript + ESLint
166
+ npm run typecheck # TypeScript only
167
+ npm run lint # ESLint only
168
+ npm run format # Prettier format
169
+ ```
170
+
171
+ ### Audits
172
+ ```bash
173
+ npm run audit:ui # Check orphan features (BLOCKING)
174
+ npm run audit:cycles # Check circular deps (BLOCKING)
175
+ npm run audit:all # Run all audits
176
+ ```
177
+
178
+ ### Workflow Automation
179
+ ```bash
180
+ npm run dyad:status # Show workflow status
181
+ npm run dyad:verify # Run verification
182
+ npm run dyad:commit # Commit with checks
183
+ npm run dyad:full # Full workflow
184
+ ```
185
+
186
+ ### Setup
187
+ ```bash
188
+ npm run setup:hooks # Install git hooks
189
+ ```
190
+
191
+ ---
192
+
129
193
  ## File Structure
130
194
 
131
195
  ```
132
- @autoworkflow/
196
+ autoworkflow/
133
197
  ├── CLAUDE.md # Entry point (Claude reads this first)
134
198
 
135
199
  ├── system/ # Control Layer
@@ -139,13 +203,14 @@ Claude enforces these automatically:
139
203
  │ └── router.md # Task type routing
140
204
 
141
205
  ├── instructions/ # Content Layer
142
- │ ├── CLAUDE.md # Workflow steps
206
+ │ ├── CLAUDE.md # Workflow steps (9 phases)
143
207
  │ ├── AI_RULES.md # Coding standards
144
208
  │ └── BLUEPRINT.md # Project specification
145
209
 
146
210
  ├── .claude/ # Claude Code Integration
147
211
  │ ├── settings.json # Settings + hard rules
148
212
  │ └── commands/ # Slash command definitions
213
+ │ ├── init.md
149
214
  │ ├── analyze.md
150
215
  │ ├── plan.md
151
216
  │ ├── build.md
@@ -155,32 +220,55 @@ Claude enforces these automatically:
155
220
  │ ├── suggest.md
156
221
  │ └── commit.md
157
222
 
158
- └── .vscode/ # VS Code Integration
159
- ├── settings.json # Editor settings
160
- ├── tasks.json # Runnable tasks
161
- └── extensions.json # Recommended extensions
223
+ ├── scripts/ # Automation Scripts
224
+ ├── setup.sh # Initial setup
225
+ ├── autoworkflow.sh # Workflow automation
226
+ │ ├── check-ui-enforcement.sh
227
+ │ ├── run-verification.sh
228
+ │ └── ensure-no-errors.sh
229
+
230
+ ├── hooks/ # Git Hooks (backup enforcement)
231
+ │ ├── pre-commit # Blocks bad commits
232
+ │ └── commit-msg # Validates commit messages
233
+
234
+ ├── .vscode/ # VS Code Integration (optional)
235
+ │ ├── settings.json # Editor settings
236
+ │ ├── tasks.json # Runnable tasks
237
+ │ └── extensions.json # Recommended extensions
238
+
239
+ ├── .prettierrc # Prettier config
240
+ ├── eslint.config.example.js # ESLint config template
241
+ └── tsconfig.example.json # TypeScript config template
162
242
  ```
163
243
 
164
244
  ---
165
245
 
166
246
  ## Why This Approach?
167
247
 
168
- ### Traditional Enforcement
169
- - Git hooks run scripts
170
- - Scripts check code
171
- - Blocks commit on failure
248
+ ### Dual Enforcement Strategy
172
249
 
173
- ### AutoWorkflow (This Approach)
174
- - Claude reads instructions
175
- - Claude follows the workflow
176
- - Claude enforces rules as it works
177
-
178
- **Benefits:**
179
- - No runtime code to maintain
180
- - Works in any project (just copy files)
250
+ **Primary: Claude as Enforcement Engine**
251
+ - Claude reads instructions from system prompts
252
+ - Claude follows the 9-phase workflow
253
+ - Claude enforces rules proactively as it works
181
254
  - Claude explains what's happening
182
- - Flexible - Claude can adapt to context
183
- - Suggestions improve code quality proactively
255
+
256
+ **Backup: Scripts & Git Hooks**
257
+ - Git hooks catch anything Claude misses
258
+ - Scripts automate verification
259
+ - Pre-commit blocks bad code from reaching the repo
260
+
261
+ ### Benefits
262
+
263
+ | Feature | Benefit |
264
+ |---------|---------|
265
+ | System prompts | No runtime code to maintain |
266
+ | Portable | Just copy files to any project |
267
+ | Transparent | Claude explains the workflow |
268
+ | Flexible | Claude adapts to context |
269
+ | Suggestions | Proactively improves code quality |
270
+ | Git hooks | Backup enforcement layer |
271
+ | npm scripts | Easy automation |
184
272
 
185
273
  ---
186
274
 
@@ -223,11 +311,25 @@ Edit `system/loops.md` to change retry behavior.
223
311
  ## Requirements
224
312
 
225
313
  - VS Code with Claude Code extension
226
- - That's it! No npm install needed for the workflow itself.
314
+ - Node.js 18+ (for npm scripts)
315
+ - TypeScript, ESLint, Prettier (for verification)
316
+
317
+ ---
318
+
319
+ ## What Gets Copied
320
+
321
+ When you install via npm, these files are available to copy:
227
322
 
228
- If you want the verification commands (`npm run verify`, etc.) to work, you'll need:
229
- - Node.js 18+
230
- - TypeScript, ESLint, etc. in your project
323
+ | Category | Files | Required? |
324
+ |----------|-------|-----------|
325
+ | Entry point | `CLAUDE.md` | Yes |
326
+ | Control layer | `system/` | ✅ Yes |
327
+ | Content layer | `instructions/` | ✅ Yes |
328
+ | Claude integration | `.claude/` | ✅ Yes |
329
+ | Automation | `scripts/` | Recommended |
330
+ | Git hooks | `hooks/` | Recommended |
331
+ | VS Code | `.vscode/` | Optional |
332
+ | Configs | `.prettierrc`, `*.example.*` | Optional |
231
333
 
232
334
  ---
233
335
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoworkflow",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "System prompt layer that controls Claude Code's workflow with triggers, loops, and gates",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -11,16 +11,19 @@
11
11
 
12
12
  **When:** Claude begins a new conversation or task
13
13
  **Action:**
14
- 1. Read root `CLAUDE.md` (entry point)
15
- 2. Check if `instructions/BLUEPRINT.md` exists
16
- 3. If NO → Trigger `on:blueprint_missing`
17
- 4. If YESLoad blueprint and proceed
18
- 5. Load `system/router.md` to determine task type
19
- 6. Load `system/gates.md` for blocking rules
20
- 7. Await user request
14
+ 1. Check if autoworkflow needs initialization
15
+ 2. Read root `CLAUDE.md` (entry point)
16
+ 3. Check if `instructions/BLUEPRINT.md` exists
17
+ 4. If NOTrigger `on:blueprint_missing`
18
+ 5. If YES Load blueprint and proceed
19
+ 6. Load `system/router.md` to determine task type
20
+ 7. Load `system/gates.md` for blocking rules
21
+ 8. Await user request
21
22
 
22
23
  ```
23
24
  TRIGGER: conversation_start
25
+ ├── Check: node_modules/autoworkflow exists AND CLAUDE.md missing?
26
+ │ └── YES → Trigger: on:init_needed
24
27
  ├── Read: CLAUDE.md
25
28
  ├── Check: instructions/BLUEPRINT.md exists?
26
29
  │ ├── NO → Trigger: on:blueprint_missing
@@ -32,6 +35,39 @@ TRIGGER: conversation_start
32
35
 
33
36
  ---
34
37
 
38
+ ### `on:init_needed`
39
+
40
+ **When:** autoworkflow is in node_modules but CLAUDE.md is missing
41
+ **Action:**
42
+ 1. Notify user that autoworkflow needs setup
43
+ 2. Suggest running /init command
44
+
45
+ ```
46
+ TRIGGER: init_needed
47
+ ├── Notify: "AutoWorkflow detected but not initialized"
48
+ ├── Suggest: "Run /init to set up workflow files"
49
+ └── Await: user response
50
+ ```
51
+
52
+ **Output Format:**
53
+ ```
54
+ 📦 **AutoWorkflow detected in node_modules**
55
+
56
+ The workflow files haven't been copied to your project yet.
57
+
58
+ Run `/init` to set up:
59
+ - CLAUDE.md (entry point)
60
+ - system/ (triggers, loops, gates)
61
+ - instructions/ (workflow, rules, blueprint)
62
+ - .claude/ (commands)
63
+ - scripts/ (automation)
64
+ - hooks/ (git hooks)
65
+
66
+ Or run `/init --all` to include .vscode and config templates.
67
+ ```
68
+
69
+ ---
70
+
35
71
  ### `on:blueprint_missing`
36
72
 
37
73
  **When:** BLUEPRINT.md does not exist at session start