workflow-agent-cli 1.1.3 → 1.1.4

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.
Files changed (2) hide show
  1. package/README.md +440 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,440 @@
1
+ # workflow-agent-cli
2
+
3
+ > A self-evolving workflow management system for AI-friendly development
4
+
5
+ [![npm version](https://img.shields.io/npm/v/workflow-agent-cli.svg)](https://www.npmjs.com/package/workflow-agent-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.3+-blue.svg)](https://www.typescriptlang.org/)
8
+ [![Node](https://img.shields.io/badge/Node-%3E%3D18-green.svg)](https://nodejs.org/)
9
+
10
+ **Workflow Agent** is a portable, framework-agnostic CLI tool that brings structure and consistency to your development workflow. It enforces branch naming conventions, validates commit messages, and includes a self-improvement system that learns from community feedback.
11
+
12
+ **🎯 Perfect for:**
13
+ - AI agent development with strict workflow requirements
14
+ - Teams maintaining multiple repositories
15
+ - Open source projects enforcing contribution guidelines
16
+ - Any project needing consistent branch/commit patterns
17
+
18
+ ---
19
+
20
+ ## ✨ Features
21
+
22
+ - 🎯 **Scope-based workflow** - Organize work with preset or custom scopes
23
+ - ✅ **Branch validation** - `<type>/<scope>/<description>` format enforcement
24
+ - 📝 **Commit validation** - Conventional commits: `type(scope): description`
25
+ - 🔍 **Smart suggestions** - Did-you-mean corrections for typos
26
+ - 🎨 **Framework detection** - Auto-detects Next.js, Vite, Remix, Astro, SvelteKit
27
+ - 📦 **5 preset libraries** - SaaS (17), Library (10), API (13), E-commerce (12), CMS (13)
28
+ - 🎨 **Custom scope builder** - Create domain-specific scope packages with `scope:create`
29
+ - 🔄 **Scope migration** - Convert inline scopes to reusable packages with `scope:migrate`
30
+ - 🚀 **Interactive CLI** - Beautiful prompts with @clack/prompts
31
+ - 🤖 **Non-interactive mode** - CI/CD friendly with `--preset --name --yes`
32
+
33
+ ---
34
+
35
+ ## 🚀 Installation
36
+
37
+ ### Global Installation
38
+
39
+ ```bash
40
+ # npm
41
+ npm install -g workflow-agent-cli
42
+
43
+ # pnpm
44
+ pnpm add -g workflow-agent-cli
45
+
46
+ # yarn
47
+ yarn global add workflow-agent-cli
48
+ ```
49
+
50
+ ### Local Installation (Per-Project)
51
+
52
+ ```bash
53
+ # npm
54
+ npm install -D workflow-agent-cli
55
+
56
+ # pnpm
57
+ pnpm add -D workflow-agent-cli
58
+
59
+ # yarn
60
+ yarn add -D workflow-agent-cli
61
+ ```
62
+
63
+ **Setup Scripts (Recommended):**
64
+
65
+ pnpm blocks postinstall scripts by default, so run the setup command after installation:
66
+
67
+ ```bash
68
+ # If using pnpm or npm locally:
69
+ pnpm workflow-agent setup
70
+ # or
71
+ npx workflow-agent setup
72
+
73
+ # If installed globally:
74
+ workflow-agent setup
75
+ ```
76
+
77
+ This adds these scripts to your `package.json`:
78
+
79
+ ```json
80
+ {
81
+ "scripts": {
82
+ "workflow:init": "workflow-agent init",
83
+ "workflow:validate": "workflow-agent validate",
84
+ "workflow:suggest": "workflow-agent suggest",
85
+ "workflow:doctor": "workflow-agent doctor"
86
+ }
87
+ }
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 📖 Quick Start
93
+
94
+ ### 1. Initialize Your Project
95
+
96
+ #### Interactive Mode
97
+ ```bash
98
+ # If installed globally:
99
+ workflow-agent init
100
+
101
+ # If installed locally:
102
+ pnpm workflow-agent init
103
+ # or
104
+ npx workflow-agent init
105
+ # or (after running setup):
106
+ pnpm run workflow:init
107
+ ```
108
+
109
+ Prompts you to:
110
+ 1. Enter project name
111
+ 2. Choose a preset (SaaS, Library, API, E-commerce, CMS, Custom)
112
+ 3. Generate guidelines (optional)
113
+
114
+ #### Non-Interactive Mode
115
+ ```bash
116
+ # Perfect for CI/CD or automation
117
+
118
+ # Global:
119
+ workflow-agent init --preset library --name my-project --yes
120
+
121
+ # Local:
122
+ pnpm workflow-agent init --preset library --name my-project --yes
123
+ ```
124
+
125
+ ### 2. Validate Your Work
126
+
127
+ ```bash
128
+ # Validate branch names
129
+ workflow-agent validate branch
130
+ workflow-agent validate branch "feature/auth/add-login"
131
+
132
+ # Validate commit messages
133
+ workflow-agent validate commit "feat(auth): add OAuth support"
134
+ ```
135
+
136
+ **Expected formats:**
137
+ - **Branch:** `<type>/<scope>/<description>`
138
+ - Types: `feature`, `bugfix`, `hotfix`, `chore`, `refactor`, `docs`, `test`
139
+ - Example: `feature/auth/implement-2fa`
140
+
141
+ - **Commit:** `<type>(<scope>): <description>`
142
+ - Types: `feat`, `fix`, `refactor`, `chore`, `docs`, `test`, `perf`, `style`, `ci`, `build`
143
+ - Example: `feat(auth): implement 2FA with TOTP`
144
+
145
+ ### 3. Create Custom Scopes
146
+
147
+ Build reusable scope packages for your domain:
148
+
149
+ ```bash
150
+ workflow-agent scope:create
151
+
152
+ # Follow the interactive prompts to:
153
+ # 1. Name your scope package (e.g., "medical", "finance", "gaming")
154
+ # 2. Define scopes (e.g., "patient", "appointment", "billing")
155
+ # 3. Add descriptions for each scope
156
+ # 4. Choose package location
157
+ ```
158
+
159
+ ### 4. Migrate Inline Scopes
160
+
161
+ Convert inline scopes to reusable packages:
162
+
163
+ ```bash
164
+ workflow-agent scope:migrate
165
+
166
+ # Extracts scopes from workflow.config.json
167
+ # Creates a new scope package
168
+ # Updates config to reference the package
169
+ ```
170
+
171
+ ---
172
+
173
+ ## 🛠️ Commands
174
+
175
+ | Command | Description |
176
+ |---------|-------------|
177
+ | `workflow-agent init` | Initialize project with interactive prompts |
178
+ | `workflow-agent validate branch [name]` | Validate branch name format |
179
+ | `workflow-agent validate commit [message]` | Validate commit message format |
180
+ | `workflow-agent config get [key]` | View configuration values |
181
+ | `workflow-agent config set <key> <value>` | Update configuration |
182
+ | `workflow-agent suggest <idea>` | Submit improvement suggestion |
183
+ | `workflow-agent doctor` | Run health checks and get optimization tips |
184
+ | `workflow-agent scope:create` | Create a custom scope package |
185
+ | `workflow-agent scope:migrate` | Migrate inline scopes to package |
186
+
187
+ ### Command Options
188
+
189
+ #### `init`
190
+ - `--preset <name>` - Skip preset selection (saas, library, api, ecommerce, cms, custom)
191
+ - `--name <name>` - Set project name without prompt
192
+ - `--yes` - Accept all defaults (non-interactive)
193
+
194
+ #### `validate`
195
+ - `--fix` - Apply automatic fixes (coming soon)
196
+ - `--json` - Output in JSON format
197
+
198
+ #### `suggest`
199
+ - `--category <type>` - Suggestion category (feature, bug, improvement, documentation)
200
+ - `--author <name>` - Your name or username
201
+
202
+ ---
203
+
204
+ ## 📦 Preset Scope Libraries
205
+
206
+ ### SaaS (17 scopes)
207
+ `auth`, `billing`, `analytics`, `notifications`, `teams`, `admin`, `api`, `integration`, `subscription`, `dashboard`, `onboarding`, `settings`, `payments`, `reports`, `support`, `webhooks`, `search`
208
+
209
+ ### Library (10 scopes)
210
+ `core`, `utils`, `types`, `config`, `cli`, `api`, `docs`, `examples`, `test`, `build`
211
+
212
+ ### API (13 scopes)
213
+ `routes`, `middleware`, `controllers`, `models`, `services`, `auth`, `validation`, `errors`, `logging`, `cache`, `queue`, `websocket`, `graphql`
214
+
215
+ ### E-commerce (12 scopes)
216
+ `products`, `cart`, `checkout`, `orders`, `payments`, `shipping`, `inventory`, `customers`, `reviews`, `discounts`, `recommendations`, `analytics`
217
+
218
+ ### CMS (13 scopes)
219
+ `content`, `media`, `pages`, `posts`, `categories`, `tags`, `users`, `comments`, `seo`, `templates`, `widgets`, `api`, `admin`
220
+
221
+ ---
222
+
223
+ ## 🎨 Custom Scopes
224
+
225
+ Create domain-specific scope packages:
226
+
227
+ ```bash
228
+ workflow-agent scope:create
229
+ ```
230
+
231
+ **Example: Medical Scope Package**
232
+
233
+ ```typescript
234
+ // packages/scopes-medical/src/index.ts
235
+ export default {
236
+ scopes: [
237
+ { name: 'patient', description: 'Patient records and profiles' },
238
+ { name: 'appointment', description: 'Scheduling and appointments' },
239
+ { name: 'billing', description: 'Medical billing and insurance' },
240
+ { name: 'prescription', description: 'Prescriptions and medications' },
241
+ { name: 'lab', description: 'Laboratory tests and results' }
242
+ ]
243
+ };
244
+ ```
245
+
246
+ **Use in workflow.config.json:**
247
+
248
+ ```json
249
+ {
250
+ "name": "medical-app",
251
+ "scopesSource": "packages/scopes-medical"
252
+ }
253
+ ```
254
+
255
+ For detailed instructions, see the [Custom Scopes Documentation](https://github.com/hawkinsideOut/workflow-agent/blob/main/docs/content/custom-scopes.mdx).
256
+
257
+ ---
258
+
259
+ ## 🐛 Troubleshooting
260
+
261
+ ### Installation Issues
262
+
263
+ #### pnpm Installation with Postinstall
264
+
265
+ If you're using pnpm, postinstall scripts are blocked by default. Run setup manually:
266
+
267
+ ```bash
268
+ pnpm add -D workflow-agent-cli
269
+ pnpm workflow-agent setup
270
+ ```
271
+
272
+ #### Permission Errors (Global Install)
273
+
274
+ ```bash
275
+ # Linux/macOS
276
+ sudo npm install -g workflow-agent-cli
277
+
278
+ # Or use nvm to avoid sudo
279
+ nvm use system
280
+ npm install -g workflow-agent-cli
281
+ ```
282
+
283
+ ### Publishing Issues (For Contributors)
284
+
285
+ #### npm Token Errors
286
+
287
+ **Error: "Access token expired or revoked" or "404 Not Found"**
288
+
289
+ This typically means your npm token doesn't have the correct permissions. To fix:
290
+
291
+ 1. **Create a Granular Access Token on npm:**
292
+ - Go to https://www.npmjs.com/ → Profile → Access Tokens
293
+ - Click "Generate New Token" → Select "Granular Access Token"
294
+ - Configure:
295
+ - **Packages and scopes**: Select **"All packages"** + **"Read and write"**
296
+ - **Organizations**: Leave **unchecked/empty** (unless publishing under an org)
297
+ - **Token type**: Should support automation/bypass 2FA
298
+ - Copy the token immediately
299
+
300
+ 2. **Test the token locally:**
301
+ ```bash
302
+ echo '//registry.npmjs.org/:_authToken=YOUR_TOKEN' > ~/.npmrc
303
+ npm whoami # Should show your npm username
304
+ cd packages/core
305
+ npm publish --access public --dry-run # Should succeed
306
+ ```
307
+
308
+ 3. **Update GitHub Secret:**
309
+ - Go to your repo → Settings → Secrets and variables → Actions
310
+ - Update `NPM_TOKEN` with the exact token that works locally
311
+
312
+ **Error: "This operation requires a one-time password (EOTP)"**
313
+
314
+ Your npm account has 2FA enabled. Options:
315
+
316
+ 1. **Use an Automation token** that bypasses 2FA (recommended)
317
+ 2. **Disable 2FA for publishing** (keeps it for login):
318
+ - Go to npm → Account Settings → Two-Factor Authentication
319
+ - Change from "Authorization and Publishing" to "Authorization only"
320
+
321
+ #### Package Name Conflicts
322
+
323
+ **Error: "must not have multiple workspaces with the same name"**
324
+
325
+ If you have workspace packages with duplicate names:
326
+
327
+ 1. **Check all package.json files** in `packages/*/package.json`
328
+ 2. **Rename conflicting packages:**
329
+ ```bash
330
+ # Example: rename vscode-extension to avoid conflict
331
+ # packages/vscode-extension/package.json
332
+ { "name": "workflow-agent-vscode" }
333
+ ```
334
+ 3. **Update imports** in dependent packages
335
+ 4. **Run `pnpm install`** to update lockfile
336
+
337
+ #### Lockfile Out of Sync
338
+
339
+ **Error: "Cannot install with frozen-lockfile because pnpm-lock.yaml is not up to date"**
340
+
341
+ After changing package dependencies:
342
+
343
+ ```bash
344
+ pnpm install # Update lockfile
345
+ git add pnpm-lock.yaml
346
+ git commit -m "chore: update lockfile"
347
+ ```
348
+
349
+ ### Build Issues
350
+
351
+ #### TypeScript Compilation Errors
352
+
353
+ **Error: "Cannot find module 'workflow-agent-cli/config'"**
354
+
355
+ This means the core package wasn't built before dependent packages:
356
+
357
+ ```bash
358
+ # Build core package first
359
+ pnpm --filter workflow-agent-cli run build
360
+
361
+ # Then build everything
362
+ pnpm build
363
+ ```
364
+
365
+ **Fix permanently** by updating the root `package.json`:
366
+
367
+ ```json
368
+ {
369
+ "scripts": {
370
+ "build": "pnpm --filter workflow-agent-cli run build && pnpm -r run build"
371
+ }
372
+ }
373
+ ```
374
+
375
+ ### Template Issues
376
+
377
+ **Error: Guidelines directory not created**
378
+
379
+ If templates aren't bundled with the npm package:
380
+
381
+ 1. **Ensure templates are in the package:**
382
+ ```json
383
+ // packages/core/package.json
384
+ {
385
+ "files": ["dist", "templates"]
386
+ }
387
+ ```
388
+
389
+ 2. **Copy templates to package directory:**
390
+ ```bash
391
+ cp -r templates packages/core/
392
+ ```
393
+
394
+ 3. **Update template paths** in code to use relative paths from the package
395
+
396
+ ---
397
+
398
+ ## 🤝 Contributing
399
+
400
+ Contributions are welcome! Please see our [Contributing Guide](https://github.com/hawkinsideOut/workflow-agent/blob/main/CONTRIBUTING.md).
401
+
402
+ ### Development Setup
403
+
404
+ ```bash
405
+ # Clone the repository
406
+ git clone https://github.com/hawkinsideOut/workflow-agent.git
407
+ cd workflow-agent
408
+
409
+ # Install dependencies
410
+ pnpm install
411
+
412
+ # Build all packages
413
+ pnpm build
414
+
415
+ # Run the CLI locally
416
+ node packages/core/dist/cli/index.js --help
417
+ ```
418
+
419
+ ---
420
+
421
+ ## 📄 License
422
+
423
+ MIT © Workflow Agent Team
424
+
425
+ See [LICENSE](https://github.com/hawkinsideOut/workflow-agent/blob/main/LICENSE) for details.
426
+
427
+ ---
428
+
429
+ ## 🔗 Links
430
+
431
+ - [GitHub Repository](https://github.com/hawkinsideOut/workflow-agent)
432
+ - [npm Package](https://www.npmjs.com/package/workflow-agent-cli)
433
+ - [Documentation](https://github.com/hawkinsideOut/workflow-agent/tree/main/docs)
434
+ - [Custom Scopes Guide](https://github.com/hawkinsideOut/workflow-agent/blob/main/docs/content/custom-scopes.mdx)
435
+ - [Issue Tracker](https://github.com/hawkinsideOut/workflow-agent/issues)
436
+ - [Changelog](https://github.com/hawkinsideOut/workflow-agent/blob/main/CHANGELOG.md)
437
+
438
+ ---
439
+
440
+ **Made with ❤️ for developers who value consistency and automation**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workflow-agent-cli",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "A self-evolving workflow management system for AI agent development",
5
5
  "keywords": [
6
6
  "workflow",
@@ -38,7 +38,8 @@
38
38
  },
39
39
  "files": [
40
40
  "dist",
41
- "templates"
41
+ "templates",
42
+ "README.md"
42
43
  ],
43
44
  "scripts": {
44
45
  "build": "tsup",