Skip to content

Commit d8d2930

Browse files
committed
docs(templates): update slash command instructions
1 parent 6af6e0c commit d8d2930

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

src/core/templates/slash-command-templates.ts

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
export type SlashCommandId = 'proposal' | 'apply' | 'archive';
22

33
const baseGuardrails = `**Guardrails**
4-
- Default to <100 lines of new code, single-file solutions, and avoid new frameworks unless OpenSpec data requires it.
5-
- Use pnpm for Node.js tooling and keep changes scoped to the requested outcome.`;
4+
- Favor straightforward, minimal implementations first and add complexity only when it is requested or clearly required.
5+
- Keep changes tightly scoped to the requested outcome.`;
66

7-
const proposalGuardrails = `${baseGuardrails}\n- Ask up to two clarifying questions if the request is ambiguous before editing files.`;
7+
const proposalGuardrails = `${baseGuardrails}\n- Identify any vague or ambiguous details and ask the necessary follow-up questions before editing files.`;
88

99
const proposalSteps = `**Steps**
10-
1. Review \`openspec/project.md\`, run \`openspec list\`, and \`openspec list --specs\` to understand current work and capabilities.
11-
2. Choose a unique verb-led \`change-id\` and scaffold \`proposal.md\`, \`tasks.md\`, and optional \`design.md\` under \`openspec/changes/<id>/\`.
12-
3. Draft spec deltas in \`changes/<id>/specs/\` using \`## ADDED|MODIFIED|REMOVED Requirements\` with at least one \`#### Scenario:\` per requirement.
13-
4. Validate with \`openspec validate <id> --strict\` and resolve every issue before sharing the proposal.`;
10+
1. Review \`openspec/project.md\`, run \`openspec list\` and \`openspec list --specs\`, and inspect related code or docs (e.g., via \`rg\`/\`ls\`) to ground the proposal in current behaviour; note any gaps that require clarification.
11+
2. Choose a unique verb-led \`change-id\` and scaffold \`proposal.md\`, \`tasks.md\`, and \`design.md\` (when needed) under \`openspec/changes/<id>/\`.
12+
3. Map the change into concrete capabilities or requirements, breaking multi-scope efforts into distinct spec deltas with clear relationships and sequencing.
13+
4. Capture architectural reasoning in \`design.md\` when the solution spans multiple systems, introduces new patterns, or demands trade-off discussion before committing to specs.
14+
5. Draft spec deltas in \`changes/<id>/specs/\` using \`## ADDED|MODIFIED|REMOVED Requirements\` with at least one \`#### Scenario:\` per requirement and cross-reference related capabilities when relevant.
15+
6. Draft \`tasks.md\` as an ordered list of small, verifiable work items that deliver user-visible progress, include validation (tests, tooling), and highlight dependencies or parallelizable work.
16+
7. Validate with \`openspec validate <id> --strict\` and resolve every issue before sharing the proposal.`;
1417

1518
const proposalReferences = `**Reference**
1619
- Use \`openspec show <id> --json --deltas-only\` or \`openspec show <spec> --type spec\` to inspect details when validation fails.
17-
- Search existing requirements with \`rg -n "Requirement:|Scenario:" openspec/specs\` before writing new ones.`;
20+
- Search existing requirements with \`rg -n "Requirement:|Scenario:" openspec/specs\` before writing new ones.
21+
- Explore the codebase with \`rg <keyword>\`, \`ls\`, or direct file reads so proposals align with current implementation realities.`;
1822

1923
const applySteps = `**Steps**
2024
1. Read \`changes/<id>/proposal.md\`, \`design.md\` (if present), and \`tasks.md\` to confirm scope and acceptance criteria.
@@ -26,13 +30,13 @@ const applyReferences = `**Reference**
2630
- Use \`openspec show <id> --json --deltas-only\` if you need additional context from the proposal while implementing.`;
2731

2832
const archiveSteps = `**Steps**
29-
1. Confirm deployment is complete, then move \`changes/<id>/\` to \`changes/archive/YYYY-MM-DD-<id>/\`.
30-
2. Update \`openspec/specs/\` to capture production behaviour, editing existing capabilities before creating new ones.
31-
3. Run \`openspec archive <id> --skip-specs\` only for tooling-only work; otherwise ensure spec deltas are committed.
32-
4. Re-run \`openspec validate --strict\` and review with \`openspec show <id>\` to verify archive changes.`;
33+
1. Identify the requested change ID (via the prompt or \`openspec list\`).
34+
2. Run \`openspec archive <id>\` to let the CLI move the change and apply spec updates (use \`--skip-specs\` only for tooling-only work).
35+
3. Review the command output to confirm the target specs were updated and the change landed in \`changes/archive/\`.
36+
4. Validate with \`openspec validate --strict\` and inspect with \`openspec show <id>\` if anything looks off.`;
3337

3438
const archiveReferences = `**Reference**
35-
- Cross-check capabilities with \`openspec list --specs\` and resolve any outstanding validation issues before finishing.`;
39+
- Inspect refreshed specs with \`openspec list --specs\` and address any validation issues before handing off.`;
3640

3741
export const slashCommandBodies: Record<SlashCommandId, string> = {
3842
proposal: [proposalGuardrails, proposalSteps, proposalReferences].join('\n\n'),

test/core/init.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ describe('InitCommand', () => {
110110

111111
const archiveContent = await fs.readFile(claudeArchive, 'utf-8');
112112
expect(archiveContent).toContain('name: OpenSpec: Archive');
113-
expect(archiveContent).toContain('openspec archive <id> --skip-specs');
113+
expect(archiveContent).toContain('openspec archive <id>');
114+
expect(archiveContent).toContain('`--skip-specs` only for tooling-only work');
114115
});
115116

116117
it('should create Cursor slash command files with templates', async () => {

0 commit comments

Comments
 (0)