workflow-agent-cli 1.1.2

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,347 @@
1
+ # Project Template README
2
+
3
+ > **Purpose**: This document provides guidance for using the ProjectHub guidelines as a template for new projects. It explains which files to copy, what to customize, and how to adapt the patterns to different tech stacks.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Overview](#overview)
10
+ 2. [Files to Copy](#files-to-copy)
11
+ 3. [Customization Guide](#customization-guide)
12
+ 4. [Tech Stack Adaptations](#tech-stack-adaptations)
13
+ 5. [Checklist for New Projects](#checklist-for-new-projects)
14
+
15
+ ---
16
+
17
+ ## Overview
18
+
19
+ The ProjectHub guidelines provide a comprehensive framework for:
20
+
21
+ - **Agent-assisted development** - Rules for AI coding assistants
22
+ - **Code organization** - Single source of truth patterns
23
+ - **Quality assurance** - Testing and review strategies
24
+ - **Workflow standardization** - Branching and deployment
25
+
26
+ These patterns are designed to be **tech-stack agnostic** at their core, with specific sections that need customization for each project.
27
+
28
+ ---
29
+
30
+ ## Files to Copy
31
+
32
+ ### Required Files (Copy These)
33
+
34
+ | File | Purpose | Customization Level |
35
+ | ------------------------------------------ | ---------------- | -------------------------- |
36
+ | `guidelines/AGENT_EDITING_INSTRUCTIONS.md` | AI editing rules | Medium - Update file paths |
37
+ | `guidelines/BRANCHING_STRATEGY.md` | Git workflow | Low - Update scopes list |
38
+ | `guidelines/TESTING_STRATEGY.md` | Testing patterns | High - Update tooling |
39
+ | `.github/PULL_REQUEST_TEMPLATE.md` | PR template | Low - Update scopes list |
40
+
41
+ ### Recommended Files (Create Fresh)
42
+
43
+ | File | Purpose | Why Create Fresh |
44
+ | -------------------------------------- | --------------- | ------------------------ |
45
+ | `guidelines/SINGLE_SOURCE_OF_TRUTH.md` | File locations | Unique to each project |
46
+ | `guidelines/LIBRARY_INVENTORY.md` | Dependencies | Different for each stack |
47
+ | `guidelines/DEPLOYMENT_STRATEGY.md` | Deployment flow | Platform-specific |
48
+
49
+ ### Directory Structure
50
+
51
+ ```
52
+ your-project/
53
+ ├── .github/
54
+ │ └── PULL_REQUEST_TEMPLATE.md # Copy from template
55
+ ├── guidelines/
56
+ │ ├── AGENT_EDITING_INSTRUCTIONS.md # Copy + customize
57
+ │ ├── BRANCHING_STRATEGY.md # Copy + update scopes
58
+ │ ├── TESTING_STRATEGY.md # Copy + update tools
59
+ │ ├── SINGLE_SOURCE_OF_TRUTH.md # Create fresh
60
+ │ ├── LIBRARY_INVENTORY.md # Create fresh
61
+ │ ├── DEPLOYMENT_STRATEGY.md # Create fresh
62
+ │ └── PROJECT_TEMPLATE_README.md # Optional meta-doc
63
+ └── ...
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Customization Guide
69
+
70
+ ### AGENT_EDITING_INSTRUCTIONS.md
71
+
72
+ #### Sections to Keep As-Is
73
+
74
+ - File analysis checklist format
75
+ - Library usage policy
76
+ - PR workflow structure
77
+ - Quality standards
78
+
79
+ #### Sections to Customize
80
+
81
+ | Section | What to Change |
82
+ | ------------------------ | ------------------------------------------------ |
83
+ | Required File Checklists | Update file paths for your project structure |
84
+ | Import Ordering | Adjust for your project's conventions |
85
+ | Architecture Rules | Update for your framework (not Next.js specific) |
86
+ | Data Flow | Document your auth/authorization patterns |
87
+
88
+ #### Example Adaptations
89
+
90
+ **For a Python/FastAPI Project:**
91
+
92
+ ```markdown
93
+ ## Required Files by Change Type
94
+
95
+ ### Adding API Endpoint
96
+
97
+ - [ ] Endpoint in `app/api/routes/`
98
+ - [ ] Schema in `app/schemas/`
99
+ - [ ] Tests in `tests/api/`
100
+ - [ ] Types in `app/models/`
101
+ ```
102
+
103
+ **For a React SPA (Vite):**
104
+
105
+ ```markdown
106
+ ## Required Files by Change Type
107
+
108
+ ### Adding Feature
109
+
110
+ - [ ] Component in `src/components/`
111
+ - [ ] Hook in `src/hooks/` (if stateful)
112
+ - [ ] Types in `src/types/`
113
+ - [ ] Tests in `src/__tests__/`
114
+ ```
115
+
116
+ ### BRANCHING_STRATEGY.md
117
+
118
+ #### Sections to Keep As-Is
119
+
120
+ - Branch naming format
121
+ - PR title format (conventional commits)
122
+ - Workflow steps
123
+ - Merge requirements structure
124
+
125
+ #### Sections to Customize
126
+
127
+ | Section | What to Change |
128
+ | ------------------- | ---------------------------------------- |
129
+ | Allowed Scopes | Define scopes for your project's domains |
130
+ | Review Requirements | Adjust for your team size |
131
+ | Hotfix Workflow | Update deployment references |
132
+
133
+ #### Defining Scopes
134
+
135
+ Choose scopes that match your project's domains:
136
+
137
+ **E-commerce Example:**
138
+
139
+ ```markdown
140
+ | Scope | Description |
141
+ | ---------- | ---------------------------- |
142
+ | `cart` | Shopping cart functionality |
143
+ | `checkout` | Payment and order processing |
144
+ | `products` | Product catalog, search |
145
+ | `users` | User accounts, profiles |
146
+ | `orders` | Order management |
147
+ | `admin` | Admin dashboard |
148
+ ```
149
+
150
+ **SaaS Example:**
151
+
152
+ ```markdown
153
+ | Scope | Description |
154
+ | -------------- | ------------------------ |
155
+ | `billing` | Subscriptions, payments |
156
+ | `dashboard` | Main dashboard |
157
+ | `reports` | Analytics and reporting |
158
+ | `integrations` | Third-party integrations |
159
+ | `teams` | Team management |
160
+ | `settings` | Configuration |
161
+ ```
162
+
163
+ ### TESTING_STRATEGY.md
164
+
165
+ #### Sections to Keep As-Is
166
+
167
+ - Testing pyramid concept
168
+ - Coverage requirements
169
+ - Pre-merge checklist structure
170
+
171
+ #### Sections to Customize
172
+
173
+ | Section | What to Change |
174
+ | ------------------- | ------------------------------------------ |
175
+ | Test Tooling | Update for your stack (Jest, pytest, etc.) |
176
+ | Test Patterns | Update examples for your framework |
177
+ | E2E Configuration | Update for your E2E tool |
178
+ | Test Infrastructure | Update setup files |
179
+
180
+ #### Tooling Adaptations
181
+
182
+ **For React + Jest:**
183
+
184
+ ```markdown
185
+ ## Unit Testing with Jest
186
+
187
+ ### Configuration
188
+
189
+ - Config: `jest.config.js`
190
+ - Setup: `src/setupTests.ts`
191
+ - Run: `npm test`
192
+ ```
193
+
194
+ **For Python + pytest:**
195
+
196
+ ```markdown
197
+ ## Unit Testing with pytest
198
+
199
+ ### Configuration
200
+
201
+ - Config: `pyproject.toml` or `pytest.ini`
202
+ - Fixtures: `tests/conftest.py`
203
+ - Run: `pytest`
204
+ ```
205
+
206
+ ### PULL_REQUEST_TEMPLATE.md
207
+
208
+ #### Sections to Keep As-Is
209
+
210
+ - Type of Change checkboxes
211
+ - Quality Checklist
212
+ - Breaking Changes section
213
+ - New Dependencies section
214
+
215
+ #### Sections to Customize
216
+
217
+ | Section | What to Change |
218
+ | ----------------------- | --------------------------- |
219
+ | Scope checkboxes | Update to match your scopes |
220
+ | Files Changed Checklist | Update file paths |
221
+ | Testing Performed | Update test commands |
222
+
223
+ ---
224
+
225
+ ## Tech Stack Adaptations
226
+
227
+ ### Next.js → Other React Frameworks
228
+
229
+ | Concept | Next.js | Vite/CRA | Remix |
230
+ | -------------- | -------------- | ------------- | ------------------ |
231
+ | Server Actions | `app/actions/` | N/A (use API) | `app/routes/*.tsx` |
232
+ | API Routes | `app/api/` | External API | Loaders/Actions |
233
+ | SSR | Automatic | Manual | Automatic |
234
+ | File routing | `app/` | React Router | `app/routes/` |
235
+
236
+ ### React → Vue/Svelte/Angular
237
+
238
+ | Concept | React | Vue | Svelte | Angular |
239
+ | ---------- | --------------- | -------------- | --------- | --------------- |
240
+ | Components | `.tsx` | `.vue` | `.svelte` | `.component.ts` |
241
+ | State | Context/Zustand | Pinia | Stores | Services |
242
+ | Hooks | `hooks/` | `composables/` | `stores/` | `services/` |
243
+ | Testing | Vitest/RTL | Vitest/VTU | Vitest | Karma/Jest |
244
+
245
+ ### Supabase → Other Backends
246
+
247
+ | Concept | Supabase | Firebase | Prisma + PostgreSQL |
248
+ | ---------- | ---------------------- | --------------- | -------------------- |
249
+ | Client | `lib/supabase/` | `lib/firebase/` | `lib/prisma/` |
250
+ | Auth | Supabase Auth | Firebase Auth | NextAuth/Clerk |
251
+ | Types | Generated | N/A | Generated |
252
+ | Migrations | `supabase/migrations/` | N/A | `prisma/migrations/` |
253
+
254
+ ### Vercel → Other Platforms
255
+
256
+ | Concept | Vercel | Netlify | Railway | AWS |
257
+ | -------------- | --------- | --------- | --------- | ----------- |
258
+ | Preview URLs | Automatic | Automatic | Manual | Manual |
259
+ | Env Variables | Dashboard | Dashboard | Dashboard | SSM |
260
+ | Rollback | Dashboard | Dashboard | CLI | CLI |
261
+ | Edge Functions | Yes | Yes | No | Lambda@Edge |
262
+
263
+ ---
264
+
265
+ ## Checklist for New Projects
266
+
267
+ ### Initial Setup
268
+
269
+ - [ ] Create `guidelines/` directory
270
+ - [ ] Copy `AGENT_EDITING_INSTRUCTIONS.md` and customize
271
+ - [ ] Copy `BRANCHING_STRATEGY.md` and update scopes
272
+ - [ ] Copy `TESTING_STRATEGY.md` and update tooling
273
+ - [ ] Copy `.github/PULL_REQUEST_TEMPLATE.md` and update scopes
274
+
275
+ ### Create Fresh Documents
276
+
277
+ - [ ] Create `SINGLE_SOURCE_OF_TRUTH.md` with your file locations
278
+ - [ ] Create `LIBRARY_INVENTORY.md` with your dependencies
279
+ - [ ] Create `DEPLOYMENT_STRATEGY.md` for your platform
280
+
281
+ ### Validation
282
+
283
+ - [ ] All file paths in guidelines match actual project structure
284
+ - [ ] Scopes list covers all major areas of the project
285
+ - [ ] Testing commands in guidelines actually work
286
+ - [ ] PR template scopes match branching strategy scopes
287
+
288
+ ### Team Onboarding
289
+
290
+ - [ ] Team has reviewed all guidelines
291
+ - [ ] Guidelines are linked from main README
292
+ - [ ] First few PRs use the new template
293
+ - [ ] Iterate based on team feedback
294
+
295
+ ---
296
+
297
+ ## Template Maintenance
298
+
299
+ ### When to Update Guidelines
300
+
301
+ - Adding major new feature area → Add new scope
302
+ - Changing tech stack → Update tooling sections
303
+ - New team members have questions → Clarify documentation
304
+ - Recurring review comments → Add to checklist
305
+
306
+ ### Version Control
307
+
308
+ Consider versioning your guidelines:
309
+
310
+ ```markdown
311
+ <!-- At top of each file -->
312
+
313
+ > **Version**: 1.0.0
314
+ > **Last Updated**: 2026-01-08
315
+ > **Changelog**: See bottom of document
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Quick Copy Commands
321
+
322
+ ```bash
323
+ # Create guidelines directory
324
+ mkdir -p guidelines
325
+
326
+ # Copy core files (adjust source path)
327
+ cp ~/templates/projecthub/guidelines/AGENT_EDITING_INSTRUCTIONS.md guidelines/
328
+ cp ~/templates/projecthub/guidelines/BRANCHING_STRATEGY.md guidelines/
329
+ cp ~/templates/projecthub/guidelines/TESTING_STRATEGY.md guidelines/
330
+ cp ~/templates/projecthub/.github/PULL_REQUEST_TEMPLATE.md .github/
331
+
332
+ # Create fresh files
333
+ touch guidelines/SINGLE_SOURCE_OF_TRUTH.md
334
+ touch guidelines/LIBRARY_INVENTORY.md
335
+ touch guidelines/DEPLOYMENT_STRATEGY.md
336
+ ```
337
+
338
+ ---
339
+
340
+ ## Related Documents
341
+
342
+ - [AGENT_EDITING_INSTRUCTIONS.md](AGENT_EDITING_INSTRUCTIONS.md) - Core editing rules
343
+ - [BRANCHING_STRATEGY.md](BRANCHING_STRATEGY.md) - Git workflow
344
+ - [TESTING_STRATEGY.md](TESTING_STRATEGY.md) - Testing patterns
345
+ - [SINGLE_SOURCE_OF_TRUTH.md](SINGLE_SOURCE_OF_TRUTH.md) - File locations
346
+ - [LIBRARY_INVENTORY.md](LIBRARY_INVENTORY.md) - Dependencies
347
+ - [DEPLOYMENT_STRATEGY.md](DEPLOYMENT_STRATEGY.md) - Deployment flow
@@ -0,0 +1,286 @@
1
+ # Scope Creation Workflow for AI Agents
2
+
3
+ This document provides a structured workflow for AI agents creating custom scope packages. **ALWAYS ASK before assuming** any details about the project.
4
+
5
+ ## Critical Rule: Zero-Assumption Principle
6
+
7
+ **Never assume or infer details about:**
8
+ - Project domain or industry
9
+ - Feature areas or scope names
10
+ - Naming conventions
11
+ - Technical stack or architecture
12
+ - Publishing intentions
13
+
14
+ **Always prompt the user explicitly for this information.**
15
+
16
+ ---
17
+
18
+ ## Required Prompts (Ask in Order)
19
+
20
+ ### 1. Project Domain Clarification
21
+
22
+ **Prompt:**
23
+ > "What is the primary domain or industry for this project? For example: fintech, healthcare, gaming, education, e-commerce, etc."
24
+
25
+ **Purpose:** Understand the context to suggest relevant scope categories.
26
+
27
+ **Expected Response:** Single domain/industry name or brief description.
28
+
29
+ ---
30
+
31
+ ### 2. Feature Area Enumeration
32
+
33
+ **Prompt:**
34
+ > "What are the main feature areas or functional components of your project? Please list them (aim for 8-15 areas). For example, for a SaaS app: authentication, user profiles, billing, notifications, analytics."
35
+
36
+ **Purpose:** Identify specific scopes that map to actual functionality.
37
+
38
+ **Expected Response:** List of feature areas (comma-separated or numbered).
39
+
40
+ **Follow-up:** If fewer than 8 or more than 20 features listed:
41
+ > "You listed [N] features. The recommended range is 8-15 scopes. Would you like to add more detail, consolidate some areas, or proceed as is?"
42
+
43
+ ---
44
+
45
+ ### 3. Naming Convention Preferences
46
+
47
+ **Prompt:**
48
+ > "What naming style do you prefer for your scopes? Examples:
49
+ > - Single words (auth, billing, users)
50
+ > - Kebab-case (user-management, api-endpoints)
51
+ > - Descriptive phrases (subscription-billing, email-notifications)
52
+ >
53
+ > Note: All scope names must be lowercase alphanumeric with hyphens only."
54
+
55
+ **Purpose:** Ensure consistent naming that matches team conventions.
56
+
57
+ **Expected Response:** Preference indication or examples.
58
+
59
+ ---
60
+
61
+ ### 4. Scope-to-Structure Mapping
62
+
63
+ **Prompt:**
64
+ > "Do your scopes map to:
65
+ > 1. **Folders/modules** in your codebase (e.g., src/auth, src/billing)
66
+ > 2. **Feature areas** regardless of folder structure
67
+ > 3. **Both** - they align with both features and folders
68
+ >
69
+ > This helps determine how granular the scopes should be."
70
+
71
+ **Purpose:** Align scopes with actual codebase organization.
72
+
73
+ **Expected Response:** Choice of 1, 2, or 3.
74
+
75
+ ---
76
+
77
+ ### 5. Migration vs. New Creation
78
+
79
+ **Prompt:**
80
+ > "Are you:
81
+ > 1. **Migrating** existing scopes from workflow.config.json to a package
82
+ > 2. **Creating** a new custom scope package from scratch
83
+ >
84
+ > If migrating, I can use your existing scope definitions. If creating new, we'll define them together."
85
+
86
+ **Purpose:** Determine whether to use existing data or start fresh.
87
+
88
+ **Expected Response:** "migrate" or "create new"
89
+
90
+ **Follow-up if "migrate":**
91
+ > "I found [N] scopes in your workflow.config.json:
92
+ > [List scopes]
93
+ >
94
+ > Should I use these as-is, or would you like to review/modify them first?"
95
+
96
+ ---
97
+
98
+ ### 6. Package Publishing Intent
99
+
100
+ **Prompt:**
101
+ > "Do you plan to:
102
+ > 1. **Publish** this scope package to npm for reuse across projects
103
+ > 2. **Keep it local** to this workspace only
104
+ > 3. **Undecided** - create it now, decide later
105
+ >
106
+ > This affects whether we include publishing configuration."
107
+
108
+ **Purpose:** Include appropriate publishing metadata and instructions.
109
+
110
+ **Expected Response:** Choice of 1, 2, or 3.
111
+
112
+ ---
113
+
114
+ ## Validation Checklist (Review Before Creating)
115
+
116
+ Before generating the package, confirm:
117
+
118
+ - [ ] All scope names are lowercase alphanumeric with hyphens
119
+ - [ ] All scope names are 32 characters or less
120
+ - [ ] No scope names match reserved words: init, create, build, test, config, docs, ci, deps
121
+ - [ ] All scope descriptions are at least 10 characters
122
+ - [ ] No duplicate scope names
123
+ - [ ] Scope count is between 8-15 (or user explicitly accepted otherwise)
124
+ - [ ] Package name is valid and doesn't conflict with existing packages
125
+
126
+ ---
127
+
128
+ ## Interactive Scope Definition (If Creating New)
129
+
130
+ For each scope, ask:
131
+
132
+ **Prompt:**
133
+ > "Scope #[N] - Name: (lowercase, alphanumeric, hyphens only)"
134
+
135
+ After name is provided:
136
+
137
+ **Prompt:**
138
+ > "Description for '[scope-name]': (minimum 10 characters, be specific)"
139
+
140
+ After description:
141
+
142
+ **Prompt:**
143
+ > "Emoji for '[scope-name]': (optional, press Enter to skip)"
144
+
145
+ After emoji:
146
+
147
+ **Prompt:**
148
+ > "Category for '[scope-name]':
149
+ > 1. auth - Authentication & Authorization
150
+ > 2. features - Features & Functionality
151
+ > 3. infrastructure - Infrastructure & DevOps
152
+ > 4. documentation - Documentation
153
+ > 5. testing - Testing & QA
154
+ > 6. performance - Performance & Optimization
155
+ > 7. other - Other
156
+ > 8. (none) - No category
157
+ >
158
+ > Choose 1-8:"
159
+
160
+ After each scope:
161
+
162
+ **Prompt:**
163
+ > "✓ Added scope: [scope-name]
164
+ >
165
+ > You have [N] scopes. Add another? (y/n)"
166
+
167
+ ---
168
+
169
+ ## Example Interaction Flow
170
+
171
+ ```
172
+ Agent: What is the primary domain or industry for this project?
173
+ User: Healthcare SaaS platform
174
+
175
+ Agent: What are the main feature areas of your healthcare SaaS?
176
+ (aim for 8-15 areas)
177
+ User: patient records, appointments, billing, insurance,
178
+ prescriptions, lab results, messaging, reports
179
+
180
+ Agent: What naming style do you prefer?
181
+ 1. Single words (patients, billing)
182
+ 2. Kebab-case (patient-records, lab-results)
183
+ 3. Descriptive (patient-record-management)
184
+ User: Option 2, kebab-case
185
+
186
+ Agent: Do your scopes map to folders, features, or both?
187
+ User: Both - they match our src/ folder structure
188
+
189
+ Agent: Are you migrating existing scopes or creating new?
190
+ User: Creating new
191
+
192
+ Agent: Scope #1 - Name:
193
+ User: patient-records
194
+
195
+ Agent: Description for 'patient-records':
196
+ User: Patient medical records and history management
197
+
198
+ Agent: Emoji for 'patient-records': (optional)
199
+ User: 📋
200
+
201
+ Agent: Category for 'patient-records':
202
+ User: 2 (features)
203
+
204
+ Agent: ✓ Added scope: patient-records
205
+ You have 1 scope. Add another? (y/n)
206
+ User: y
207
+
208
+ [Continue for remaining scopes...]
209
+ ```
210
+
211
+ ---
212
+
213
+ ## Error Handling
214
+
215
+ If user provides invalid input:
216
+
217
+ **For invalid scope name:**
218
+ > "The name '[name]' is invalid. Scope names must be:
219
+ > - Lowercase letters, numbers, and hyphens only
220
+ > - Maximum 32 characters
221
+ > - Not a reserved word (init, create, build, test, config, docs, ci, deps)
222
+ >
223
+ > Please provide a different name:"
224
+
225
+ **For short description:**
226
+ > "The description must be at least 10 characters to be meaningful.
227
+ > Please provide more detail about what '[scope-name]' covers:"
228
+
229
+ **For duplicate name:**
230
+ > "A scope named '[name]' already exists. Please choose a different name:"
231
+
232
+ ---
233
+
234
+ ## Post-Creation Instructions
235
+
236
+ After successfully creating the package, provide:
237
+
238
+ 1. **Location confirmation:**
239
+ > "✨ Custom scope package created at: [path]"
240
+
241
+ 2. **Next steps:**
242
+ > "Next steps:
243
+ > 1. cd [path]
244
+ > 2. pnpm install
245
+ > 3. pnpm build
246
+ > 4. pnpm test
247
+ > 5. Update repository URL in package.json"
248
+
249
+ 3. **Publishing instructions** (if user indicated intent):
250
+ > "To publish to npm:
251
+ > 1. npm login
252
+ > 2. Update version in package.json as needed
253
+ > 3. pnpm publish --access public"
254
+
255
+ 4. **Usage instructions:**
256
+ > "To use in other projects:
257
+ > pnpm add @workflow/scopes-[name]"
258
+
259
+ ---
260
+
261
+ ## Summary: Key Principles
262
+
263
+ 1. ✅ **Always ask** - never assume project details
264
+ 2. ✅ **Validate input** - check all constraints before proceeding
265
+ 3. ✅ **Provide examples** - show users what good input looks like
266
+ 4. ✅ **Confirm before creating** - review all scopes with user
267
+ 5. ✅ **Give clear next steps** - don't leave users wondering what to do next
268
+
269
+ ---
270
+
271
+ ## Automation Support
272
+
273
+ For non-interactive/CI environments, support these flags:
274
+
275
+ ```bash
276
+ workflow scope:create \
277
+ --name fintech \
278
+ --preset-name "FinTech Application" \
279
+ --scopes "auth:Authentication and security:🔐:auth,payments:Payment processing:💳:features,accounts:Account management:👤:features"
280
+ ```
281
+
282
+ Format: `name:description:emoji:category` (comma-separated)
283
+
284
+ ---
285
+
286
+ **Remember: The goal is to create scopes that genuinely reflect the user's project structure and workflow. Taking time to ask the right questions upfront leads to better, more useful scope packages.**