agents-templated 2.2.10 → 2.2.12
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 +100 -86
- package/agents/commands/README.md +64 -0
- package/agents/commands/SCHEMA.md +22 -0
- package/agents/commands/arch-check.md +58 -0
- package/agents/commands/audit.md +58 -0
- package/agents/commands/debug-track.md +58 -0
- package/agents/commands/docs.md +58 -0
- package/agents/commands/fix.md +58 -0
- package/agents/commands/learn-loop.md +58 -0
- package/agents/commands/perf.md +58 -0
- package/agents/commands/plan.md +58 -0
- package/agents/commands/pr.md +58 -0
- package/agents/commands/problem-map.md +58 -0
- package/agents/commands/release-ready.md +58 -0
- package/agents/commands/release.md +58 -0
- package/agents/commands/risk-review.md +58 -0
- package/agents/commands/scope-shape.md +58 -0
- package/agents/commands/task.md +58 -0
- package/agents/commands/test.md +58 -0
- package/agents/commands/ux-bar.md +58 -0
- package/agents/rules/planning.mdc +69 -0
- package/bin/cli.js +116 -4
- package/index.js +12 -1
- package/lib/workflow.js +177 -0
- package/package.json +2 -1
- package/templates/CLAUDE.md +5 -0
- package/templates/README.md +103 -61
- package/templates/agents/commands/README.md +43 -3
- package/templates/agents/commands/arch-check.md +58 -0
- package/templates/agents/commands/audit.md +58 -38
- package/templates/agents/commands/debug-track.md +58 -0
- package/templates/agents/commands/docs.md +58 -34
- package/templates/agents/commands/fix.md +58 -34
- package/templates/agents/commands/learn-loop.md +58 -0
- package/templates/agents/commands/perf.md +58 -34
- package/templates/agents/commands/plan.md +58 -34
- package/templates/agents/commands/pr.md +58 -35
- package/templates/agents/commands/problem-map.md +58 -0
- package/templates/agents/commands/release-ready.md +58 -0
- package/templates/agents/commands/release.md +58 -39
- package/templates/agents/commands/risk-review.md +58 -0
- package/templates/agents/commands/scope-shape.md +58 -0
- package/templates/agents/commands/task.md +58 -35
- package/templates/agents/commands/test.md +58 -34
- package/templates/agents/commands/ux-bar.md +58 -0
- package/templates/agents/skills/README.md +15 -0
- package/templates/agents/skills/debug-skill/SKILL.md +39 -0
- package/templates/agents/skills/emilkowalski-skill/SKILL.md +51 -0
- package/templates/agents/skills/feature-forge/SKILL.md +39 -0
- package/templates/agents/skills/raphaelsalaja-userinterface-wiki/SKILL.md +51 -0
- package/templates/agents/skills/secure-code-guardian/SKILL.md +39 -0
- package/templates/agents/commands/refactor.md +0 -34
- package/templates/agents/commands/scaffold.md +0 -34
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# /test
|
|
2
|
+
|
|
3
|
+
## A. Intent
|
|
4
|
+
Run deterministic validation and gate release readiness based on test evidence.
|
|
5
|
+
|
|
6
|
+
## B. When to Use
|
|
7
|
+
- Use when validating behavior after implementation or before merge/release.
|
|
8
|
+
- This command now includes quality-gate behavior; do not use /quality-gate.
|
|
9
|
+
|
|
10
|
+
## C. Context Assumptions
|
|
11
|
+
- Test targets are defined.
|
|
12
|
+
- Required environments are available.
|
|
13
|
+
- Pass/fail criteria are explicit.
|
|
14
|
+
|
|
15
|
+
## D. Required Inputs
|
|
16
|
+
| Input | Type | Example |
|
|
17
|
+
|---------------------|------------|----------------------------------|
|
|
18
|
+
| `test_scope` | string | "api regression" |
|
|
19
|
+
| `test_suites` | string[] | ["unit", "integration", "critical-flow"] |
|
|
20
|
+
| `evidence_artifact` | artifact | test report path or CI run URL |
|
|
21
|
+
|
|
22
|
+
## E. Pre-Execution Guards <- fail fast, check ALL before running
|
|
23
|
+
- [ ] test scope is non-empty
|
|
24
|
+
- [ ] critical test suites are executable
|
|
25
|
+
- [ ] pass criteria are declared
|
|
26
|
+
|
|
27
|
+
## F. Execution Flow
|
|
28
|
+
1. Collect test targets and runtime config.
|
|
29
|
+
2. Execute suites in deterministic order.
|
|
30
|
+
3. Aggregate results and failures.
|
|
31
|
+
4. Decision point ->
|
|
32
|
+
- condition A -> critical failures present -> gate = blocked
|
|
33
|
+
- condition B -> no critical failures -> gate = pass.
|
|
34
|
+
5. Build validation evidence and remediation list.
|
|
35
|
+
6. Emit test and gate report.
|
|
36
|
+
|
|
37
|
+
## G. Output Schema
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"test_run_id": "string",
|
|
42
|
+
"results": ["array","of","strings"],
|
|
43
|
+
"gate_status": "low | medium | high",
|
|
44
|
+
"blocker": "string | null"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## H. Output Target
|
|
49
|
+
- Default delivery: stdout
|
|
50
|
+
- Override flag: --output=<target>
|
|
51
|
+
|
|
52
|
+
## I. Stop Conditions <- abort with error message, never emit partial output
|
|
53
|
+
- critical test suite cannot run
|
|
54
|
+
- result schema cannot be produced
|
|
55
|
+
|
|
56
|
+
## J. Safety Constraints
|
|
57
|
+
- Hard block: hard block when critical flow tests fail
|
|
58
|
+
- Warn only: warn when flaky tests are excluded with justification
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# /ux-bar
|
|
2
|
+
|
|
3
|
+
## A. Intent
|
|
4
|
+
Assess UX quality bar and guarantee core interaction states are defined before build.
|
|
5
|
+
|
|
6
|
+
## B. When to Use
|
|
7
|
+
- Use when UX quality and accessibility need pre-implementation validation.
|
|
8
|
+
- Do not use as a replacement for visual design exploration.
|
|
9
|
+
|
|
10
|
+
## C. Context Assumptions
|
|
11
|
+
- Scope and architecture are available.
|
|
12
|
+
- Primary user flows are identified.
|
|
13
|
+
- Design references exist.
|
|
14
|
+
|
|
15
|
+
## D. Required Inputs
|
|
16
|
+
| Input | Type | Example |
|
|
17
|
+
|---------------------|------------|----------------------------------|
|
|
18
|
+
| `ux_goal` | string | "reduce checkout friction" |
|
|
19
|
+
| `flows` | string[] | ["cart", "payment", "confirmation"] |
|
|
20
|
+
| `design_artifact` | artifact | wireframes, Figma link, screenshots |
|
|
21
|
+
|
|
22
|
+
## E. Pre-Execution Guards <- fail fast, check ALL before running
|
|
23
|
+
- [ ] critical flows are enumerated
|
|
24
|
+
- [ ] interaction states include loading/error/empty
|
|
25
|
+
- [ ] accessibility checks are defined
|
|
26
|
+
|
|
27
|
+
## F. Execution Flow
|
|
28
|
+
1. Review flows and interaction states.
|
|
29
|
+
2. Evaluate accessibility and usability risks.
|
|
30
|
+
3. Score UX gaps by severity.
|
|
31
|
+
4. Decision point ->
|
|
32
|
+
- condition A -> critical UX gap -> block readiness
|
|
33
|
+
- condition B -> manageable gaps -> continue.
|
|
34
|
+
5. Build prioritized improvement list.
|
|
35
|
+
6. Emit UX quality package.
|
|
36
|
+
|
|
37
|
+
## G. Output Schema
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"ux_review_id": "string",
|
|
42
|
+
"ux_gaps": ["array","of","strings"],
|
|
43
|
+
"severity": "low | medium | high",
|
|
44
|
+
"blocker": "string | null"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## H. Output Target
|
|
49
|
+
- Default delivery: stdout
|
|
50
|
+
- Override flag: --output=<target>
|
|
51
|
+
|
|
52
|
+
## I. Stop Conditions <- abort with error message, never emit partial output
|
|
53
|
+
- critical flow lacks defined interaction states
|
|
54
|
+
- accessibility baseline is not addressed
|
|
55
|
+
|
|
56
|
+
## J. Safety Constraints
|
|
57
|
+
- Hard block: hard block on unaddressed critical accessibility failures
|
|
58
|
+
- Warn only: warn when medium UX issues are deferred
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Planning Discipline"
|
|
3
|
+
description: "Every feature discussion or implementation must produce a reusable prompt plan file in .github/prompts/"
|
|
4
|
+
version: "1.0.0"
|
|
5
|
+
tags: ["planning", "workflow", "documentation", "prompts"]
|
|
6
|
+
alwaysApply: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Ensure every feature discussion, design decision, or implementation produces a reusable prompt plan stored in `.github/prompts/`. Plans persist across sessions and serve as living context for future work — they are never discarded.
|
|
12
|
+
|
|
13
|
+
## When to Apply
|
|
14
|
+
|
|
15
|
+
This rule is always active. Trigger when:
|
|
16
|
+
|
|
17
|
+
- User asks to implement a new feature
|
|
18
|
+
- A design or architecture decision is being made
|
|
19
|
+
- A significant refactor is planned
|
|
20
|
+
- A bug fix requires non-trivial investigation or systemic changes
|
|
21
|
+
- A discussion produces decisions that affect future work
|
|
22
|
+
|
|
23
|
+
## Plan File Convention
|
|
24
|
+
|
|
25
|
+
**Location:** `.github/prompts/`
|
|
26
|
+
**Filename:** `YYYY-MM-DD-{feature-slug}.prompt.md`
|
|
27
|
+
**Format:** VS Code reusable prompt (`.prompt.md` — usable as an `@workspace` prompt in Copilot Chat)
|
|
28
|
+
|
|
29
|
+
## Required Sections
|
|
30
|
+
|
|
31
|
+
Each plan file must contain:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
---
|
|
35
|
+
agent: agent
|
|
36
|
+
description: One-line summary of what this plan covers.
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Context
|
|
40
|
+
Brief background — what problem are we solving and why now.
|
|
41
|
+
|
|
42
|
+
## Decision
|
|
43
|
+
What we decided to do and the reasoning behind it (not just what, but why).
|
|
44
|
+
|
|
45
|
+
## Steps
|
|
46
|
+
Numbered implementation steps in dependency order.
|
|
47
|
+
|
|
48
|
+
## Acceptance Criteria
|
|
49
|
+
Concrete, testable outcomes that define "done".
|
|
50
|
+
|
|
51
|
+
## Status
|
|
52
|
+
- [ ] Not started / [ ] In progress / [x] Complete
|
|
53
|
+
Blockers (if any):
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Workflow
|
|
57
|
+
|
|
58
|
+
1. At the start of any feature discussion or implementation, create the plan file immediately.
|
|
59
|
+
2. Use the filename convention: `YYYY-MM-DD-{feature-slug}.prompt.md`.
|
|
60
|
+
3. Fill out **Context**, **Decision**, and **Steps** before starting implementation.
|
|
61
|
+
4. Update **Status** and **Acceptance Criteria** incrementally as work progresses.
|
|
62
|
+
5. Mark the plan complete when implementation is verified and accepted.
|
|
63
|
+
|
|
64
|
+
## Guardrails
|
|
65
|
+
|
|
66
|
+
- Do not skip plan creation for "small" features — small decisions accumulate into undocumented technical debt.
|
|
67
|
+
- Plans are never deleted — they form a historical record of architectural decisions.
|
|
68
|
+
- Plan files must not contain secrets, credentials, or PII.
|
|
69
|
+
- If a plan changes significantly mid-implementation, update it in place rather than creating a new one.
|
package/bin/cli.js
CHANGED
|
@@ -23,6 +23,13 @@ const {
|
|
|
23
23
|
scaffoldRule,
|
|
24
24
|
scaffoldSubagent
|
|
25
25
|
} = require('../lib/instructions');
|
|
26
|
+
const {
|
|
27
|
+
WORKFLOW_COMMANDS,
|
|
28
|
+
CONTRACT_FILES,
|
|
29
|
+
SPECIALIST_CONTRACT_FILES,
|
|
30
|
+
formatWorkflowOutput,
|
|
31
|
+
validateWorkflowDefinitions
|
|
32
|
+
} = require('../lib/workflow');
|
|
26
33
|
|
|
27
34
|
// Resolve the templates directory - works in both dev and installed contexts
|
|
28
35
|
const getTemplatesDir = () => {
|
|
@@ -40,6 +47,15 @@ const getTemplatesDir = () => {
|
|
|
40
47
|
};
|
|
41
48
|
|
|
42
49
|
const program = new Command();
|
|
50
|
+
const workflowValidationIssues = validateWorkflowDefinitions();
|
|
51
|
+
|
|
52
|
+
if (workflowValidationIssues.length > 0) {
|
|
53
|
+
console.error(chalk.red('Invalid workflow command definitions detected:'));
|
|
54
|
+
workflowValidationIssues.forEach((issue) => {
|
|
55
|
+
console.error(chalk.red(` - ${issue}`));
|
|
56
|
+
});
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
43
59
|
|
|
44
60
|
program
|
|
45
61
|
.name('agents-templated')
|
|
@@ -53,6 +69,7 @@ program
|
|
|
53
69
|
.option('-d, --docs', 'Install documentation files only')
|
|
54
70
|
.option('-r, --rules', 'Install agent rules only')
|
|
55
71
|
.option('-s, --skills', 'Install skills only')
|
|
72
|
+
.option('-C, --commands', 'Install deterministic command contracts only')
|
|
56
73
|
.option('-g, --github', 'Install GitHub Copilot instructions')
|
|
57
74
|
.option('-S, --subagents', 'Install agent subagents only')
|
|
58
75
|
.option('-p, --preset <name>', 'Use a preset configuration (nextjs, django-react, express-api, fastapi, go-api)')
|
|
@@ -113,7 +130,7 @@ program
|
|
|
113
130
|
let choices = [];
|
|
114
131
|
|
|
115
132
|
// If no specific options provided, prompt user
|
|
116
|
-
if (!options.all && !options.docs && !options.rules && !options.skills && !options.github) {
|
|
133
|
+
if (!options.all && !options.docs && !options.rules && !options.skills && !options.commands && !options.github) {
|
|
117
134
|
const answers = await inquirer.prompt([
|
|
118
135
|
{
|
|
119
136
|
type: 'checkbox',
|
|
@@ -124,6 +141,7 @@ program
|
|
|
124
141
|
{ name: 'Documentation files (agent-docs/)', value: 'docs' },
|
|
125
142
|
{ name: 'Agent rules (.claude/rules/*.md)', value: 'rules' },
|
|
126
143
|
{ name: 'Skills (.github/skills/*)', value: 'skills' },
|
|
144
|
+
{ name: 'Command contracts (agents/commands/*.md)', value: 'commands' },
|
|
127
145
|
{ name: 'AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)', value: 'github' },
|
|
128
146
|
{ name: 'Agent subagents (.claude/agents/*.md)', value: 'subagents' }
|
|
129
147
|
],
|
|
@@ -146,6 +164,7 @@ program
|
|
|
146
164
|
if (options.docs) choices.push('docs');
|
|
147
165
|
if (options.rules) choices.push('rules');
|
|
148
166
|
if (options.skills) choices.push('skills');
|
|
167
|
+
if (options.commands) choices.push('commands');
|
|
149
168
|
if (options.github) choices.push('github');
|
|
150
169
|
if (options.subagents) choices.push('subagents');
|
|
151
170
|
}
|
|
@@ -183,6 +202,17 @@ program
|
|
|
183
202
|
);
|
|
184
203
|
}
|
|
185
204
|
|
|
205
|
+
// Install deterministic command contracts
|
|
206
|
+
if (installAll || choices.includes('commands')) {
|
|
207
|
+
console.log(chalk.yellow('Installing command contracts...'));
|
|
208
|
+
await fs.ensureDir(path.join(targetDir, 'agents', 'commands'));
|
|
209
|
+
await copyDirectory(
|
|
210
|
+
path.join(templateDir, 'agents', 'commands'),
|
|
211
|
+
path.join(targetDir, 'agents', 'commands'),
|
|
212
|
+
options.force
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
186
216
|
// Install AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)
|
|
187
217
|
if (installAll || choices.includes('github')) {
|
|
188
218
|
console.log(chalk.yellow('Installing AI agent instructions...'));
|
|
@@ -256,6 +286,7 @@ program
|
|
|
256
286
|
{ name: 'Documentation (agent-docs/)', value: 'docs' },
|
|
257
287
|
{ name: 'Agent Rules (security, testing, database, etc.)', value: 'rules' },
|
|
258
288
|
{ name: 'Skills (reusable agent capabilities)', value: 'skills' },
|
|
289
|
+
{ name: 'Command contracts (agents/commands/*.md)', value: 'commands' },
|
|
259
290
|
{ name: 'AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)', value: 'github' },
|
|
260
291
|
{ name: 'Agent subagents (.claude/agents/*.md)', value: 'subagents' }
|
|
261
292
|
],
|
|
@@ -293,6 +324,7 @@ program
|
|
|
293
324
|
{ name: 'Documentation (agent-docs/)', value: 'docs', checked: true },
|
|
294
325
|
{ name: 'Agent Rules (security, testing, database, etc.)', value: 'rules', checked: true },
|
|
295
326
|
{ name: 'Skills (reusable agent capabilities)', value: 'skills', checked: true },
|
|
327
|
+
{ name: 'Command contracts (agents/commands/*.md)', value: 'commands', checked: true },
|
|
296
328
|
{ name: 'AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)', value: 'github', checked: true },
|
|
297
329
|
{ name: 'Agent subagents (.claude/agents/*.md)', value: 'subagents', checked: true }
|
|
298
330
|
],
|
|
@@ -319,6 +351,7 @@ program
|
|
|
319
351
|
docs: componentAnswers.components.includes('docs'),
|
|
320
352
|
rules: componentAnswers.components.includes('rules'),
|
|
321
353
|
skills: componentAnswers.components.includes('skills'),
|
|
354
|
+
commands: componentAnswers.components.includes('commands'),
|
|
322
355
|
github: componentAnswers.components.includes('github'),
|
|
323
356
|
subagents: componentAnswers.components.includes('subagents')
|
|
324
357
|
};
|
|
@@ -354,6 +387,17 @@ program
|
|
|
354
387
|
);
|
|
355
388
|
}
|
|
356
389
|
|
|
390
|
+
// Install deterministic command contracts
|
|
391
|
+
if (options.commands) {
|
|
392
|
+
console.log(chalk.yellow('Installing command contracts...'));
|
|
393
|
+
await fs.ensureDir(path.join(targetDir, 'agents', 'commands'));
|
|
394
|
+
await copyDirectory(
|
|
395
|
+
path.join(templateDir, 'agents', 'commands'),
|
|
396
|
+
path.join(targetDir, 'agents', 'commands'),
|
|
397
|
+
options.force
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
|
|
357
401
|
// Install AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)
|
|
358
402
|
if (options.github) {
|
|
359
403
|
console.log(chalk.yellow('Installing AI agent instructions...'));
|
|
@@ -403,9 +447,15 @@ program
|
|
|
403
447
|
console.log(chalk.yellow('docs') + ' - Documentation files (agent-docs/ directory)');
|
|
404
448
|
console.log(chalk.yellow('rules') + ' - Agent rules (.claude/rules/*.md)');
|
|
405
449
|
console.log(chalk.yellow('skills') + ' - Agent skills (.github/skills/*)');
|
|
450
|
+
console.log(chalk.yellow('commands') + ' - Deterministic command contracts (agents/commands/*.md)');
|
|
406
451
|
console.log(chalk.yellow('github') + ' - AI Agent instructions (Cursor, Copilot, Claude, Generic AGENTS)');
|
|
407
452
|
console.log(chalk.yellow('subagents') + ' - Agent subagents (.claude/agents/*.md)');
|
|
408
453
|
console.log(chalk.yellow('all') + ' - All components');
|
|
454
|
+
|
|
455
|
+
console.log(chalk.blue.bold('\n\nWorkflow Commands:\n'));
|
|
456
|
+
WORKFLOW_COMMANDS.forEach(({ cli, specialist, description }) => {
|
|
457
|
+
console.log(chalk.cyan(cli) + ` - ${specialist}: ${description}`);
|
|
458
|
+
});
|
|
409
459
|
|
|
410
460
|
console.log(chalk.blue.bold('\n\nAvailable Presets:\n'));
|
|
411
461
|
console.log(chalk.cyan('nextjs') + ' - Next.js with TypeScript, React, and Tailwind CSS');
|
|
@@ -492,6 +542,29 @@ program
|
|
|
492
542
|
warnings.push(`⚠ ${LAYOUT.canonical.skillsDir} directory missing - run 'agents-templated init --skills'`);
|
|
493
543
|
}
|
|
494
544
|
|
|
545
|
+
const commandsDir = path.join(targetDir, 'agents', 'commands');
|
|
546
|
+
if (await fs.pathExists(commandsDir)) {
|
|
547
|
+
for (const contractFile of CONTRACT_FILES) {
|
|
548
|
+
const contractPath = path.join(commandsDir, contractFile);
|
|
549
|
+
if (await fs.pathExists(contractPath)) {
|
|
550
|
+
passed.push(`✓ agents/commands/${contractFile} found`);
|
|
551
|
+
} else {
|
|
552
|
+
warnings.push(`⚠ agents/commands/${contractFile} missing`);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
for (const contractFile of SPECIALIST_CONTRACT_FILES) {
|
|
557
|
+
const contractPath = path.join(commandsDir, contractFile);
|
|
558
|
+
if (await fs.pathExists(contractPath)) {
|
|
559
|
+
passed.push(`✓ agents/commands/${contractFile} found`);
|
|
560
|
+
} else {
|
|
561
|
+
warnings.push(`⚠ agents/commands/${contractFile} missing`);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
} else {
|
|
565
|
+
warnings.push(`⚠ agents/commands directory missing - run 'agents-templated init --commands'`);
|
|
566
|
+
}
|
|
567
|
+
|
|
495
568
|
// Check subagents
|
|
496
569
|
const subagentsDir = path.join(targetDir, LAYOUT.canonical.subagentsDir);
|
|
497
570
|
if (await fs.pathExists(subagentsDir)) {
|
|
@@ -678,7 +751,7 @@ async function cleanupLegacyInstructionFiles(targetDir) {
|
|
|
678
751
|
|
|
679
752
|
async function updateSelectedComponents(targetDir, templateDir, selectedComponents, overwrite = true) {
|
|
680
753
|
const components = selectedComponents.includes('all')
|
|
681
|
-
? ['docs', 'rules', 'skills', 'github', 'subagents']
|
|
754
|
+
? ['docs', 'rules', 'skills', 'commands', 'github', 'subagents']
|
|
682
755
|
: selectedComponents;
|
|
683
756
|
|
|
684
757
|
if (components.includes('docs')) {
|
|
@@ -711,6 +784,16 @@ async function updateSelectedComponents(targetDir, templateDir, selectedComponen
|
|
|
711
784
|
);
|
|
712
785
|
}
|
|
713
786
|
|
|
787
|
+
if (components.includes('commands')) {
|
|
788
|
+
console.log(chalk.yellow('Updating command contracts...'));
|
|
789
|
+
await fs.ensureDir(path.join(targetDir, 'agents', 'commands'));
|
|
790
|
+
await copyDirectory(
|
|
791
|
+
path.join(templateDir, 'agents', 'commands'),
|
|
792
|
+
path.join(targetDir, 'agents', 'commands'),
|
|
793
|
+
overwrite
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
714
797
|
if (components.includes('github')) {
|
|
715
798
|
console.log(chalk.yellow('Updating AI agent instructions...'));
|
|
716
799
|
await writeGeneratedInstructions(targetDir, templateDir, overwrite);
|
|
@@ -760,6 +843,7 @@ program
|
|
|
760
843
|
.option('-d, --docs', 'Update documentation files only')
|
|
761
844
|
.option('-r, --rules', 'Update agent rules only')
|
|
762
845
|
.option('-s, --skills', 'Update skills only')
|
|
846
|
+
.option('-C, --commands', 'Update deterministic command contracts only')
|
|
763
847
|
.option('-g, --github', 'Update AI agent instruction files only')
|
|
764
848
|
.option('-S, --subagents', 'Update agent subagents only')
|
|
765
849
|
.option('-c, --check-only', 'Only check for updates, don\'t install')
|
|
@@ -812,7 +896,7 @@ program
|
|
|
812
896
|
console.log(chalk.green('✓ Legacy layout migration completed.\n'));
|
|
813
897
|
}
|
|
814
898
|
|
|
815
|
-
const hasComponentSelection = options.all || options.docs || options.rules || options.skills || options.github;
|
|
899
|
+
const hasComponentSelection = options.all || options.docs || options.rules || options.skills || options.commands || options.github || options.subagents;
|
|
816
900
|
|
|
817
901
|
// Component refresh mode: update selected parts directly without stack/wizard prompts
|
|
818
902
|
if (hasComponentSelection) {
|
|
@@ -820,6 +904,7 @@ program
|
|
|
820
904
|
if (options.all || options.docs) selectedComponents.push('docs');
|
|
821
905
|
if (options.all || options.rules) selectedComponents.push('rules');
|
|
822
906
|
if (options.all || options.skills) selectedComponents.push('skills');
|
|
907
|
+
if (options.all || options.commands) selectedComponents.push('commands');
|
|
823
908
|
if (options.all || options.github) selectedComponents.push('github');
|
|
824
909
|
if (options.all || options.subagents) selectedComponents.push('subagents');
|
|
825
910
|
|
|
@@ -844,7 +929,9 @@ program
|
|
|
844
929
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/find-skills/SKILL.md`, templateFile: 'agents/skills/find-skills/SKILL.md', component: 'skills' },
|
|
845
930
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/error-patterns/SKILL.md`, templateFile: 'agents/skills/error-patterns/SKILL.md', component: 'skills' },
|
|
846
931
|
{ targetFile: `${LAYOUT.canonical.skillsDir}/ui-ux-pro-max/SKILL.md`, templateFile: 'agents/skills/ui-ux-pro-max/SKILL.md', component: 'skills' },
|
|
847
|
-
{ targetFile: `${LAYOUT.canonical.skillsDir}/shadcn-ui/SKILL.md`, templateFile: 'agents/skills/shadcn-ui/SKILL.md', component: 'skills' }
|
|
932
|
+
{ targetFile: `${LAYOUT.canonical.skillsDir}/shadcn-ui/SKILL.md`, templateFile: 'agents/skills/shadcn-ui/SKILL.md', component: 'skills' },
|
|
933
|
+
{ targetFile: 'agents/commands/SCHEMA.md', templateFile: 'agents/commands/SCHEMA.md', component: 'commands' },
|
|
934
|
+
{ targetFile: 'agents/commands/README.md', templateFile: 'agents/commands/README.md', component: 'commands' }
|
|
848
935
|
];
|
|
849
936
|
|
|
850
937
|
for (const {targetFile, templateFile, component} of checkFiles) {
|
|
@@ -1007,6 +1094,31 @@ program
|
|
|
1007
1094
|
}
|
|
1008
1095
|
});
|
|
1009
1096
|
|
|
1097
|
+
program
|
|
1098
|
+
.command('workflow')
|
|
1099
|
+
.description('Show the lifecycle workflow and specialist commands')
|
|
1100
|
+
.alias('sprint')
|
|
1101
|
+
.action(() => {
|
|
1102
|
+
console.log(chalk.blue.bold('\nWorkflow Lifecycle\n'));
|
|
1103
|
+
console.log(chalk.white('Think -> Plan -> Build -> Review -> Test -> Ship -> Reflect\n'));
|
|
1104
|
+
WORKFLOW_COMMANDS.forEach(({ cli, specialist, slash, description }) => {
|
|
1105
|
+
console.log(chalk.cyan(cli) + ` (${slash})`);
|
|
1106
|
+
console.log(chalk.gray(` ${specialist} - ${description}`));
|
|
1107
|
+
});
|
|
1108
|
+
console.log(chalk.gray('\nRun any workflow command with an objective, for example:'));
|
|
1109
|
+
console.log(chalk.white(' agents-templated problem-map "daily briefing app for founders"\n'));
|
|
1110
|
+
});
|
|
1111
|
+
|
|
1112
|
+
for (const workflow of WORKFLOW_COMMANDS) {
|
|
1113
|
+
program
|
|
1114
|
+
.command(`${workflow.cli} [objective...]`)
|
|
1115
|
+
.description(`${workflow.specialist}: ${workflow.description}`)
|
|
1116
|
+
.action((objective) => {
|
|
1117
|
+
const objectiveText = Array.isArray(objective) ? objective.join(' ') : '';
|
|
1118
|
+
process.stdout.write(formatWorkflowOutput(workflow, objectiveText));
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1010
1122
|
program
|
|
1011
1123
|
.command('new-skill <name>')
|
|
1012
1124
|
.description('Scaffold a new skill in .github/skills/<name>/SKILL.md')
|
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const { CANONICAL_INSTRUCTION_FILE, writeGeneratedInstructions } = require('./li
|
|
|
15
15
|
* @param {boolean} options.docs - Install documentation files
|
|
16
16
|
* @param {boolean} options.rules - Install agent rules
|
|
17
17
|
* @param {boolean} options.skills - Install skills
|
|
18
|
+
* @param {boolean} options.commands - Install deterministic command contracts
|
|
18
19
|
* @param {boolean} options.github - Install GitHub Copilot instructions
|
|
19
20
|
* @param {boolean} options.subagents - Install agent subagents
|
|
20
21
|
* @param {boolean} options.force - Overwrite existing files
|
|
@@ -22,7 +23,7 @@ const { CANONICAL_INSTRUCTION_FILE, writeGeneratedInstructions } = require('./li
|
|
|
22
23
|
*/
|
|
23
24
|
async function install(targetDir, options = {}) {
|
|
24
25
|
const templateDir = path.join(__dirname, 'templates');
|
|
25
|
-
const installAll = !options.docs && !options.rules && !options.skills && !options.github && !options.subagents;
|
|
26
|
+
const installAll = !options.docs && !options.rules && !options.skills && !options.commands && !options.github && !options.subagents;
|
|
26
27
|
|
|
27
28
|
const files = [];
|
|
28
29
|
|
|
@@ -69,6 +70,16 @@ async function install(targetDir, options = {}) {
|
|
|
69
70
|
);
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
// Deterministic command contracts
|
|
74
|
+
if (installAll || options.commands) {
|
|
75
|
+
await fs.ensureDir(path.join(targetDir, 'agents', 'commands'));
|
|
76
|
+
await copyDirectory(
|
|
77
|
+
path.join(templateDir, 'agents', 'commands'),
|
|
78
|
+
path.join(targetDir, 'agents', 'commands'),
|
|
79
|
+
options.force
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
// AI Agent instructions (Cursor, Copilot, Claude)
|
|
73
84
|
if (installAll || options.github) {
|
|
74
85
|
await writeGeneratedInstructions(targetDir, templateDir, options.force);
|
package/lib/workflow.js
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
const WORKFLOW_COMMANDS = [
|
|
2
|
+
{
|
|
3
|
+
cli: 'problem-map',
|
|
4
|
+
slash: '/problem-map',
|
|
5
|
+
purpose: 'problem-framing',
|
|
6
|
+
specialist: 'Problem Strategist',
|
|
7
|
+
contract: 'plan.md',
|
|
8
|
+
description: 'Clarify user pain and define the real problem before implementation.'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
cli: 'scope-shape',
|
|
12
|
+
slash: '/scope-shape',
|
|
13
|
+
purpose: 'scope-decision',
|
|
14
|
+
specialist: 'Scope Director',
|
|
15
|
+
contract: 'plan.md',
|
|
16
|
+
description: 'Challenge scope and lock the highest-leverage direction.'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
cli: 'arch-check',
|
|
20
|
+
slash: '/arch-check',
|
|
21
|
+
purpose: 'architecture-readiness',
|
|
22
|
+
specialist: 'Architecture Reviewer',
|
|
23
|
+
contract: 'plan.md',
|
|
24
|
+
description: 'Lock architecture, edge cases, and test strategy before build.'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
cli: 'ux-bar',
|
|
28
|
+
slash: '/ux-bar',
|
|
29
|
+
purpose: 'ux-quality-readiness',
|
|
30
|
+
specialist: 'Design Quality Lead',
|
|
31
|
+
contract: 'plan.md',
|
|
32
|
+
description: 'Assess UX quality and close design gaps before implementation.'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
cli: 'debug-track',
|
|
36
|
+
slash: '/debug-track',
|
|
37
|
+
purpose: 'root-cause-investigation',
|
|
38
|
+
specialist: 'Root-Cause Investigator',
|
|
39
|
+
contract: 'fix.md',
|
|
40
|
+
description: 'Reproduce issues and isolate root cause before applying fixes.'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
cli: 'risk-review',
|
|
44
|
+
slash: '/risk-review',
|
|
45
|
+
purpose: 'release-risk-assessment',
|
|
46
|
+
specialist: 'Release Risk Reviewer',
|
|
47
|
+
contract: 'audit.md',
|
|
48
|
+
description: 'Run a production-risk review on active changes.'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
cli: 'perf',
|
|
52
|
+
slash: '/perf',
|
|
53
|
+
purpose: 'performance-optimization-and-regression-check',
|
|
54
|
+
specialist: 'Performance Analyst',
|
|
55
|
+
contract: 'perf.md',
|
|
56
|
+
description: 'Optimize performance and validate baseline-vs-candidate regression safety.'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
cli: 'release-ready',
|
|
60
|
+
slash: '/release-ready',
|
|
61
|
+
purpose: 'release-readiness',
|
|
62
|
+
specialist: 'Release Coordinator',
|
|
63
|
+
contract: 'release.md',
|
|
64
|
+
description: 'Prepare release branch, tests, and release checklist artifacts.'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
cli: 'docs',
|
|
68
|
+
slash: '/docs',
|
|
69
|
+
purpose: 'documentation-update-and-synchronization',
|
|
70
|
+
specialist: 'Documentation Engineer',
|
|
71
|
+
contract: 'docs.md',
|
|
72
|
+
description: 'Update and synchronize README and architecture docs to match shipped behavior.'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
cli: 'learn-loop',
|
|
76
|
+
slash: '/learn-loop',
|
|
77
|
+
purpose: 'retrospective-action-loop',
|
|
78
|
+
specialist: 'Iteration Lead',
|
|
79
|
+
contract: 'task.md',
|
|
80
|
+
description: 'Capture wins, misses, and next-cycle improvements.'
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
const CONTRACT_FILES = [
|
|
85
|
+
'SCHEMA.md',
|
|
86
|
+
'README.md',
|
|
87
|
+
'plan.md',
|
|
88
|
+
'task.md',
|
|
89
|
+
'fix.md',
|
|
90
|
+
'audit.md',
|
|
91
|
+
'perf.md',
|
|
92
|
+
'test.md',
|
|
93
|
+
'pr.md',
|
|
94
|
+
'release.md',
|
|
95
|
+
'docs.md'
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
const SPECIALIST_CONTRACT_FILES = [
|
|
99
|
+
'problem-map.md',
|
|
100
|
+
'scope-shape.md',
|
|
101
|
+
'arch-check.md',
|
|
102
|
+
'ux-bar.md',
|
|
103
|
+
'debug-track.md',
|
|
104
|
+
'risk-review.md',
|
|
105
|
+
'release-ready.md',
|
|
106
|
+
'learn-loop.md'
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const DEPRECATED_COMMAND_ALIASES = [];
|
|
110
|
+
|
|
111
|
+
function formatWorkflowOutput(workflow, objective) {
|
|
112
|
+
const trimmedObjective = (objective || '').trim();
|
|
113
|
+
const goal = trimmedObjective.length > 0 ? trimmedObjective : 'No explicit objective provided';
|
|
114
|
+
|
|
115
|
+
return [
|
|
116
|
+
'',
|
|
117
|
+
'Workflow command',
|
|
118
|
+
` Command: ${workflow.cli}`,
|
|
119
|
+
` Slash contract: ${workflow.slash}`,
|
|
120
|
+
` Specialist: ${workflow.specialist}`,
|
|
121
|
+
` Objective: ${goal}`,
|
|
122
|
+
'',
|
|
123
|
+
'Execution contract',
|
|
124
|
+
` Template file: agents/commands/${workflow.contract}`,
|
|
125
|
+
' Mode: deterministic structured output only',
|
|
126
|
+
' Safety: destructive actions require CONFIRM-DESTRUCTIVE:<target>',
|
|
127
|
+
'',
|
|
128
|
+
'Recommended next actions',
|
|
129
|
+
' 1. Ensure command contracts are installed: agents-templated init --commands',
|
|
130
|
+
' 2. Open agents/commands/README.md and follow the contract sections',
|
|
131
|
+
' 3. Use agents-templated workflow to see the full sprint sequence',
|
|
132
|
+
''
|
|
133
|
+
].join('\n');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function validateWorkflowDefinitions() {
|
|
137
|
+
const seenCli = new Set();
|
|
138
|
+
const seenSlash = new Set();
|
|
139
|
+
const seenPurpose = new Set();
|
|
140
|
+
const issues = [];
|
|
141
|
+
|
|
142
|
+
for (const workflow of WORKFLOW_COMMANDS) {
|
|
143
|
+
if (seenCli.has(workflow.cli)) {
|
|
144
|
+
issues.push(`Duplicate cli command: ${workflow.cli}`);
|
|
145
|
+
}
|
|
146
|
+
seenCli.add(workflow.cli);
|
|
147
|
+
|
|
148
|
+
if (seenSlash.has(workflow.slash)) {
|
|
149
|
+
issues.push(`Duplicate slash command: ${workflow.slash}`);
|
|
150
|
+
}
|
|
151
|
+
seenSlash.add(workflow.slash);
|
|
152
|
+
|
|
153
|
+
if (!workflow.purpose) {
|
|
154
|
+
issues.push(`Missing purpose for command: ${workflow.cli}`);
|
|
155
|
+
} else if (seenPurpose.has(workflow.purpose)) {
|
|
156
|
+
issues.push(`Duplicate command purpose: ${workflow.purpose}`);
|
|
157
|
+
}
|
|
158
|
+
seenPurpose.add(workflow.purpose);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
for (const alias of DEPRECATED_COMMAND_ALIASES) {
|
|
162
|
+
if (seenCli.has(alias.from)) {
|
|
163
|
+
issues.push(`Alias conflicts with active command name: ${alias.from}`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return issues;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
module.exports = {
|
|
171
|
+
WORKFLOW_COMMANDS,
|
|
172
|
+
CONTRACT_FILES,
|
|
173
|
+
SPECIALIST_CONTRACT_FILES,
|
|
174
|
+
DEPRECATED_COMMAND_ALIASES,
|
|
175
|
+
formatWorkflowOutput,
|
|
176
|
+
validateWorkflowDefinitions
|
|
177
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agents-templated",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.12",
|
|
4
4
|
"description": "Technology-agnostic development template with multi-AI agent support (Cursor, Copilot, VSCode, Gemini), security-first patterns, and comprehensive testing guidelines",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"bin",
|
|
39
39
|
"lib",
|
|
40
|
+
"agents",
|
|
40
41
|
"templates",
|
|
41
42
|
"templates/presets",
|
|
42
43
|
"index.js",
|