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.
- package/dist/chunk-VFN3BY56.js +120 -0
- package/dist/chunk-VFN3BY56.js.map +1 -0
- package/dist/chunk-X2NQJ2ZY.js +170 -0
- package/dist/chunk-X2NQJ2ZY.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1206 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +11 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/schema-CiJ4W7in.d.ts +97 -0
- package/dist/scripts/postinstall.d.ts +1 -0
- package/dist/scripts/postinstall.js +73 -0
- package/dist/scripts/postinstall.js.map +1 -0
- package/dist/validators/index.d.ts +16 -0
- package/dist/validators/index.js +17 -0
- package/dist/validators/index.js.map +1 -0
- package/package.json +80 -0
- package/templates/AGENT_EDITING_INSTRUCTIONS.md +887 -0
- package/templates/BRANCHING_STRATEGY.md +442 -0
- package/templates/COMPONENT_LIBRARY.md +611 -0
- package/templates/CUSTOM_SCOPE_TEMPLATE.md +228 -0
- package/templates/DEPLOYMENT_STRATEGY.md +509 -0
- package/templates/Guidelines.md +62 -0
- package/templates/LIBRARY_INVENTORY.md +615 -0
- package/templates/PROJECT_TEMPLATE_README.md +347 -0
- package/templates/SCOPE_CREATION_WORKFLOW.md +286 -0
- package/templates/SELF_IMPROVEMENT_MANDATE.md +298 -0
- package/templates/SINGLE_SOURCE_OF_TRUTH.md +492 -0
- package/templates/TESTING_STRATEGY.md +801 -0
- package/templates/_TEMPLATE_EXAMPLE.md +28 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# Custom Scope Package Template
|
|
2
|
+
|
|
3
|
+
This template provides boilerplate code for creating custom scope packages for the Workflow Agent.
|
|
4
|
+
|
|
5
|
+
## Package Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
scopes-{{scopeName}}/
|
|
9
|
+
├── package.json # Package metadata and dependencies
|
|
10
|
+
├── tsconfig.json # TypeScript configuration
|
|
11
|
+
├── tsup.config.ts # Build configuration
|
|
12
|
+
└── src/
|
|
13
|
+
├── index.ts # Scope definitions and preset export
|
|
14
|
+
└── index.test.ts # Test suite for scopes
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## package.json Template
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"name": "@workflow/scopes-{{scopeName}}",
|
|
22
|
+
"version": "{{packageVersion}}",
|
|
23
|
+
"description": "Scope preset for {{presetName}}",
|
|
24
|
+
"keywords": ["workflow", "scopes", "{{scopeName}}", "preset"],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/your-org/your-repo.git",
|
|
28
|
+
"directory": "{{packageDirectory}}"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "Your Name",
|
|
32
|
+
"type": "module",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": ["dist"],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup",
|
|
42
|
+
"dev": "tsup --watch",
|
|
43
|
+
"typecheck": "tsc --noEmit",
|
|
44
|
+
"test": "vitest run"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"@hawkinside_out/workflow-agent": "^1.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@hawkinside_out/workflow-agent": "^1.0.0",
|
|
51
|
+
"tsup": "^8.0.1",
|
|
52
|
+
"typescript": "^5.3.3",
|
|
53
|
+
"vitest": "^1.0.0"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## src/index.ts Template
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import type { Scope } from '@hawkinside_out/workflow-agent/config';
|
|
65
|
+
|
|
66
|
+
export const scopes: Scope[] = {{scopeDefinitions}};
|
|
67
|
+
|
|
68
|
+
export const preset = {
|
|
69
|
+
name: '{{presetName}}',
|
|
70
|
+
description: 'Scope configuration for {{presetName}}',
|
|
71
|
+
scopes,
|
|
72
|
+
version: '{{packageVersion}}',
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default preset;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## src/index.test.ts Template
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { describe, it, expect } from 'vitest';
|
|
82
|
+
import { scopes, preset } from './index.js';
|
|
83
|
+
import { ScopeSchema } from '@hawkinside_out/workflow-agent/config';
|
|
84
|
+
|
|
85
|
+
describe('{{presetName}} Scope Preset', () => {
|
|
86
|
+
it('should export valid scopes array', () => {
|
|
87
|
+
expect(scopes).toBeDefined();
|
|
88
|
+
expect(Array.isArray(scopes)).toBe(true);
|
|
89
|
+
expect(scopes.length).toBeGreaterThan(0);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('should have valid preset object', () => {
|
|
93
|
+
expect(preset).toBeDefined();
|
|
94
|
+
expect(preset.name).toBe('{{presetName}}');
|
|
95
|
+
expect(preset.scopes).toBe(scopes);
|
|
96
|
+
expect(preset.version).toBeDefined();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should have no duplicate scope names', () => {
|
|
100
|
+
const names = scopes.map(s => s.name);
|
|
101
|
+
const uniqueNames = new Set(names);
|
|
102
|
+
expect(uniqueNames.size).toBe(names.length);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should have all scopes match schema', () => {
|
|
106
|
+
scopes.forEach(scope => {
|
|
107
|
+
const result = ScopeSchema.safeParse(scope);
|
|
108
|
+
if (!result.success) {
|
|
109
|
+
console.error(\`Scope "\${scope.name}" failed validation:\`, result.error);
|
|
110
|
+
}
|
|
111
|
+
expect(result.success).toBe(true);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('should have descriptions for all scopes', () => {
|
|
116
|
+
scopes.forEach(scope => {
|
|
117
|
+
expect(scope.description).toBeDefined();
|
|
118
|
+
expect(scope.description.length).toBeGreaterThan(0);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## tsconfig.json Template
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"extends": "../../tsconfig.json",
|
|
129
|
+
"compilerOptions": {
|
|
130
|
+
"outDir": "./dist",
|
|
131
|
+
"rootDir": "./src"
|
|
132
|
+
},
|
|
133
|
+
"include": ["src/**/*"]
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## tsup.config.ts Template
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
import { defineConfig } from 'tsup';
|
|
141
|
+
|
|
142
|
+
export default defineConfig({
|
|
143
|
+
entry: ['src/index.ts'],
|
|
144
|
+
format: ['esm'],
|
|
145
|
+
dts: true,
|
|
146
|
+
clean: true,
|
|
147
|
+
sourcemap: true,
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Usage
|
|
152
|
+
|
|
153
|
+
To create a custom scope package using these templates:
|
|
154
|
+
|
|
155
|
+
1. **Use the CLI** (recommended):
|
|
156
|
+
```bash
|
|
157
|
+
workflow scope:create
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
2. **Manual creation** (advanced):
|
|
161
|
+
- Copy this template structure
|
|
162
|
+
- Replace all `{{variable}}` placeholders
|
|
163
|
+
- Run `pnpm install && pnpm build && pnpm test`
|
|
164
|
+
|
|
165
|
+
## Variables
|
|
166
|
+
|
|
167
|
+
- `{{scopeName}}` - Package name (lowercase, alphanumeric with hyphens)
|
|
168
|
+
- `{{presetName}}` - Display name for the preset
|
|
169
|
+
- `{{scopeDefinitions}}` - JSON array of scope objects
|
|
170
|
+
- `{{packageVersion}}` - Package version (default: "1.0.0")
|
|
171
|
+
- `{{packageDirectory}}` - Relative path in repository
|
|
172
|
+
- `{{isMonorepo}}` - "true" if in monorepo workspace
|
|
173
|
+
|
|
174
|
+
## Scope Object Schema
|
|
175
|
+
|
|
176
|
+
Each scope in `{{scopeDefinitions}}` must match:
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
{
|
|
180
|
+
name: string; // lowercase, alphanumeric, hyphens, max 32 chars
|
|
181
|
+
description: string; // min 10 characters
|
|
182
|
+
emoji?: string; // optional emoji
|
|
183
|
+
category?: 'auth' | 'features' | 'infrastructure' | 'documentation' |
|
|
184
|
+
'testing' | 'performance' | 'other';
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Example Scope Definitions
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
[
|
|
192
|
+
{
|
|
193
|
+
"name": "auth",
|
|
194
|
+
"description": "Authentication and authorization features",
|
|
195
|
+
"emoji": "🔐",
|
|
196
|
+
"category": "auth"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "billing",
|
|
200
|
+
"description": "Payment processing and subscription management",
|
|
201
|
+
"emoji": "💳",
|
|
202
|
+
"category": "features"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "analytics",
|
|
206
|
+
"description": "Usage tracking and reporting features",
|
|
207
|
+
"emoji": "📊",
|
|
208
|
+
"category": "features"
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Best Practices
|
|
214
|
+
|
|
215
|
+
1. **Scope Count**: Aim for 8-15 scopes per preset
|
|
216
|
+
2. **Naming**: Use clear, domain-specific names (avoid generic terms like "feature", "fix")
|
|
217
|
+
3. **Descriptions**: Be specific about what each scope covers (minimum 10 characters)
|
|
218
|
+
4. **Categories**: Use categories to group related scopes
|
|
219
|
+
5. **Emojis**: Add visual identifiers to improve readability (optional)
|
|
220
|
+
|
|
221
|
+
## Next Steps
|
|
222
|
+
|
|
223
|
+
After creating your package:
|
|
224
|
+
|
|
225
|
+
1. Build: `pnpm build`
|
|
226
|
+
2. Test: `pnpm test`
|
|
227
|
+
3. Publish: `pnpm publish --access public`
|
|
228
|
+
4. Use: `pnpm add @workflow/scopes-{{scopeName}}`
|