opensddrag 0.1.2 → 0.2.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.
@@ -1,387 +1,72 @@
1
- export function getOpenCodeSkills(slug, _serverUrl) {
2
- const note = `> **project_slug for every call:** \`${slug}\`\n\n`;
3
-
4
- const fm = (name, description) => `---\nname: ${name}\ndescription: ${description}\n---\n\n`;
5
-
6
- return [
7
- {
8
- name: "opensddrag-propose",
9
- content: `${fm("opensddrag-propose", "Create a named change proposal — entry point for every feature or bugfix")}# OpenSddRag Propose
10
- ${note}Creates a named **change** with a proposal artifact: Why, What Changes, Capabilities, Impact.
11
- Entry point for every new feature or bugfix. No code is written here.
12
- After this, /opsr:spec and /opsr:design become available.
13
-
14
- **Run:** \`/opsr:propose <change-name or description>\`
15
-
16
- **Creates:** \`<change-name>-proposal\` artifact in database.
17
- **Unlocks:** /opsr:spec, /opsr:design
18
- `,
19
- },
20
- {
21
- name: "opensddrag-spec",
22
- content: `${fm("opensddrag-spec", "Write capability specs with SHALL/MUST requirements and WHEN/THEN scenarios")}# OpenSddRag — Spec
23
- ${note}Creates spec artifacts for each capability listed in the proposal.
24
- Uses SHALL/MUST language. Each requirement MUST have Scenarios with WHEN/THEN format.
25
-
26
- **New capability** → full spec (Purpose + Requirements + Scenarios)
27
- **Modified capability** delta spec (ADDED / MODIFIED / REMOVED / RENAMED sections)
28
-
29
- **Run:** \`/opsr:spec <change-name>\`
30
-
31
- **Requires:** proposal artifact in database.
32
- **Creates:** \`<change-name>-<capability>-spec\` artifact(s) in database.
33
- **Unlocks:** /opsr:design (when all capabilities have specs)
34
- `,
35
- },
36
- {
37
- name: "opensddrag-design",
38
- content: `${fm("opensddrag-design", "Document technical decisions, architecture, and trade-offs for a change")}# OpenSddRag — Design
39
- ${note}Creates a design document: Context, Goals, Decisions (with alternatives), Architecture, Risks, Migration.
40
- Must read proposal and all specs from the database as context.
41
-
42
- **Run:** \`/opsr:design <change-name>\`
43
-
44
- **Requires:** proposal + specs in database.
45
- **Creates:** \`<change-name>-design\` artifact in database.
46
- **Unlocks:** /opsr:tasks
47
- `,
48
- },
49
- {
50
- name: "opensddrag-tasks",
51
- content: `${fm("opensddrag-tasks", "Break a design into atomic, verifiable implementation tasks")}# OpenSddRag — Tasks
52
- ${note}Decomposes specs + design into atomic task artifacts, each < 4 hours.
53
- Each task has: Goal, Acceptance criteria (referencing REQ-NNN), Dependencies.
54
- Tasks are individual database artifacts — NOT a single markdown file.
55
-
56
- **Run:** \`/opsr:tasks <change-name>\`
57
-
58
- **Requires:** proposal + specs + design in database.
59
- **Creates:** \`<change-name>-task-<N>\` artifacts in database.
60
- **Unlocks:** /opsr:apply
61
- `,
62
- },
63
- {
64
- name: "opensddrag-apply",
65
- content: `${fm("opensddrag-apply", "Implement the next pending task against spec acceptance criteria")}# OpenSddRag — Apply
66
- ${note}Implements tasks one at a time, reading ALL planning artifacts (proposal + specs + design) as context.
67
- Marks tasks active → archived in the database after implementation.
68
- Must validate each task against spec acceptance criteria before marking done.
69
-
70
- **Run:** \`/opsr:apply <change-name>\`
71
-
72
- **Requires:** all planning artifacts + pending tasks in database.
73
- **Updates:** task status in database (draft → active → archived).
74
- **After all tasks:** run /opsr:verify then /opsr:archive.
75
- `,
76
- },
77
- {
78
- name: "opensddrag-verify",
79
- content: `${fm("opensddrag-verify", "Validate implementation against spec requirements and design decisions")}# OpenSddRag — Verify
80
- ${note}Read-only validation of the implementation against spec requirements and design decisions.
81
- Produces a report with CRITICAL / WARNING / SUGGESTION severity levels.
82
-
83
- Checks:
84
- - **Completeness**: all tasks done, all REQ-NNN implemented
85
- - **Correctness**: all spec scenarios covered
86
- - **Coherence**: implementation follows design decisions
87
-
88
- **Run:** \`/opsr:verify <change-name>\`
89
-
90
- **Requires:** all artifacts in database + implementation in codebase.
91
- **Output:** verification report (no artifacts modified).
92
- `,
93
- },
94
- {
95
- name: "opensddrag-sync",
96
- content: `${fm("opensddrag-sync", "Merge delta specs back into main capability specs")}# OpenSddRag — Sync
97
- ${note}Merges delta specs (ADDED/MODIFIED/REMOVED/RENAMED) into main specs stored in the database.
98
- Called automatically during /opsr:archive when delta specs exist.
99
-
100
- Delta operations:
101
- - **ADDED** → append new requirement to main spec
102
- - **MODIFIED** → apply partial updates (not wholesale replace)
103
- - **REMOVED** → delete requirement + add Reason/Migration note
104
- - **RENAMED** → rename requirement heading
105
-
106
- **Run:** \`/opsr:sync <change-name>\`
107
-
108
- **Requires:** delta specs + main specs in database.
109
- **Updates:** main spec artifacts in database.
110
- `,
111
- },
112
- {
113
- name: "opensddrag-archive",
114
- content: `${fm("opensddrag-archive", "Finalize a completed change by archiving all its artifacts")}# OpenSddRag — Archive
115
- ${note}Finalizes a completed change: validates, syncs delta specs, archives all artifacts.
116
-
117
- Steps:
118
- 1. Validate artifact and task completion (warns if incomplete)
119
- 2. Sync delta specs to main specs (if any)
120
- 3. Mark all change artifacts as archived in database
121
-
122
- **Run:** \`/opsr:archive <change-name>\`
123
-
124
- **Requires:** all tasks completed (or user confirmation to archive anyway).
125
- **Updates:** all change artifacts to status=archived in database.
126
- `,
127
- },
128
- {
129
- name: "opensddrag-explore",
130
- content: `${fm("opensddrag-explore", "Investigate a problem or idea without writing any code")}# OpenSddRag — Explore
131
- ${note}Thinking mode — investigates ideas WITHOUT implementing any code.
132
- Reads existing specs and codebase for context. Can create artifacts to capture insights.
133
-
134
- Rules:
135
- - NEVER write application code
136
- - NEVER create implementation files
137
- - MAY create/update OpenSddRag artifacts to capture decisions
138
-
139
- Use when: thinking through options, investigating feasibility, comparing approaches.
140
- Transition: when ready → /opsr:propose <name>
141
-
142
- **Run:** \`/opsr:explore <topic or question>\`
143
- `,
144
- },
145
- {
146
- name: "opensddrag-continue",
147
- content: `${fm("opensddrag-continue", "Create the next single artifact in the SDD dependency chain")}# OpenSddRag — Continue
148
- ${note}Creates the NEXT SINGLE artifact in the dependency chain and stops.
149
- Unlike /opsr:flow, creates one artifact per invocation.
150
-
151
- Dependency order: proposal → specs → design → tasks
152
-
153
- Use when: stepping through the SDD flow one artifact at a time.
154
-
155
- **Run:** \`/opsr:continue <change-name>\`
156
- `,
157
- },
158
- {
159
- name: "opensddrag-status",
160
- content: `${fm("opensddrag-status", "Show current state of all in-progress changes")}# OpenSddRag — Status
161
- ${note}Shows current state of all in-progress changes: artifact completion, task progress, recent activity.
162
-
163
- Reads from MCP server — no local files.
164
-
165
- **Run:** \`/opsr:status\` or \`/opsr:status <change-name>\`
166
- `,
167
- },
168
- {
169
- name: "opensddrag-flow",
170
- content: `${fm("opensddrag-flow", "Run the complete SDD flow end-to-end in one session")}# OpenSddRag — Flow
171
- ${note}Runs the complete SDD flow end-to-end: propose → spec → design → tasks → apply → archive.
172
- ALL artifacts saved to database via MCP — no local files created.
173
-
174
- Use when: implementing a feature from scratch in a single session.
175
-
176
- **Run:** \`/opsr:flow <feature description>\`
177
- `,
178
- },
179
- {
180
- name: "opensddrag-search",
181
- content: `${fm("opensddrag-search", "Semantic search over specs, tasks, and past agent actions")}# OpenSddRag — Search
182
- ${note}Semantic search over the SDD knowledge base using pgvector similarity.
183
- Always run this BEFORE starting new work to find existing specs and decisions.
184
-
185
- Searches: this project first, then all projects if no results.
186
- Also recalls past agent actions (episodic memory).
187
-
188
- **Run:** \`/opsr:search <natural language query>\`
189
- `,
190
- },
191
- ];
192
- }
193
-
1
+ /**
2
+ * OpenSddRag skill templates aggregator.
3
+ *
4
+ * Each of the 13 SDD skills lives in its own module exporting
5
+ * { name, description, body(slug, note) }. This file wraps every body with the
6
+ * Claude Code or OpenCode header (`note`) plus YAML frontmatter, so the workflow
7
+ * is authored once per skill and the CC/OC pair is always in sync
8
+ * (command-skill-separation-contract REQ-001). The public API —
9
+ * getSkills(slug, serverUrl) and getOpenCodeSkills(slug, serverUrl) — is
10
+ * unchanged, so client/src/commands/init.js needs no edits.
11
+ */
12
+
13
+ import { proposeSkill } from "./propose.js";
14
+ import { specSkill } from "./spec.js";
15
+ import { designSkill } from "./design.js";
16
+ import { tasksSkill } from "./tasks.js";
17
+ import { applySkill } from "./apply.js";
18
+ import { verifySkill } from "./verify.js";
19
+ import { syncSkill } from "./sync.js";
20
+ import { archiveSkill } from "./archive.js";
21
+ import { exploreSkill } from "./explore.js";
22
+ import { continueSkill } from "./continue.js";
23
+ import { statusSkill } from "./status.js";
24
+ import { flowSkill } from "./flow.js";
25
+ import { searchSkill } from "./search.js";
26
+
27
+ const SKILLS = [
28
+ proposeSkill,
29
+ specSkill,
30
+ designSkill,
31
+ tasksSkill,
32
+ applySkill,
33
+ verifySkill,
34
+ syncSkill,
35
+ archiveSkill,
36
+ exploreSkill,
37
+ continueSkill,
38
+ statusSkill,
39
+ flowSkill,
40
+ searchSkill,
41
+ ];
42
+
43
+ const frontmatter = (name, description) =>
44
+ `---\nname: ${name}\ndescription: ${description}\n---\n\n`;
45
+
46
+ /**
47
+ * Claude Code skills — installed to .claude/skills/ and .agents/skills/.
48
+ * Header advertises the MCP server + tool list and the STOP-if-not-connected rule.
49
+ */
194
50
  export function getSkills(slug, serverUrl) {
195
51
  const note = `> **MCP server:** \`opensddrag\` (${serverUrl}) | **project_slug:** \`${slug}\`
196
- > **Available tools:** \`create_artifact\`, \`read_artifact\`, \`list_artifacts\`, \`update_artifact\`, \`validate_artifact\`, \`link_artifacts\`, \`get_relationships\`, \`search_semantic\`, \`recall_episodes\`, \`get_working_context\`, \`update_working_context\`, \`record_trace\`
52
+ > **Available tools:** \`create_artifact\`, \`read_artifact\`, \`list_artifacts\`, \`read_change_bundle\`, \`update_artifact\`, \`validate_artifact\`, \`link_artifacts\`, \`get_relationships\`, \`search_semantic\`, \`recall_episodes\`, \`get_working_context\`, \`update_working_context\`, \`record_trace\`, \`get_harness_checklist\`
197
53
  > If these tools are not in your active tool list, the \`opensddrag\` MCP server is not connected — STOP and inform the user.\n\n`;
198
54
 
199
- const fm = (name, description) => `---\nname: ${name}\ndescription: ${description}\n---\n\n`;
200
-
201
- return [
202
- {
203
- name: "opensddrag-propose",
204
- content: `${fm("opensddrag-propose", "Create a named change proposal — entry point for every feature or bugfix")}# OpenSddRag — Propose
205
- ${note}Creates a named **change** with a proposal artifact: Why, What Changes, Capabilities, Impact.
206
- Entry point for every new feature or bugfix. No code is written here.
207
- After this, /opsr:spec and /opsr:design become available.
208
-
209
- **Run:** \`/opsr:propose <change-name or description>\`
210
-
211
- **Creates:** \`<change-name>-proposal\` artifact in database.
212
- **Unlocks:** /opsr:spec, /opsr:design
213
- `,
214
- },
215
- {
216
- name: "opensddrag-spec",
217
- content: `${fm("opensddrag-spec", "Write capability specs with SHALL/MUST requirements and WHEN/THEN scenarios")}# OpenSddRag — Spec
218
- ${note}Creates spec artifacts for each capability listed in the proposal.
219
- Uses SHALL/MUST language. Each requirement MUST have Scenarios with WHEN/THEN format.
220
-
221
- **New capability** → full spec (Purpose + Requirements + Scenarios)
222
- **Modified capability** → delta spec (ADDED / MODIFIED / REMOVED / RENAMED sections)
223
-
224
- **Run:** \`/opsr:spec <change-name>\`
225
-
226
- **Requires:** proposal artifact in database.
227
- **Creates:** \`<change-name>-<capability>-spec\` artifact(s) in database.
228
- **Unlocks:** /opsr:design (when all capabilities have specs)
229
- `,
230
- },
231
- {
232
- name: "opensddrag-design",
233
- content: `${fm("opensddrag-design", "Document technical decisions, architecture, and trade-offs for a change")}# OpenSddRag — Design
234
- ${note}Creates a design document: Context, Goals, Decisions (with alternatives), Architecture, Risks, Migration.
235
- Must read proposal and all specs from the database as context.
236
-
237
- **Run:** \`/opsr:design <change-name>\`
238
-
239
- **Requires:** proposal + specs in database.
240
- **Creates:** \`<change-name>-design\` artifact in database.
241
- **Unlocks:** /opsr:tasks
242
- `,
243
- },
244
- {
245
- name: "opensddrag-tasks",
246
- content: `${fm("opensddrag-tasks", "Break a design into atomic, verifiable implementation tasks")}# OpenSddRag — Tasks
247
- ${note}Decomposes specs + design into atomic task artifacts, each < 4 hours.
248
- Each task has: Goal, Acceptance criteria (referencing REQ-NNN), Dependencies.
249
- Tasks are individual database artifacts — NOT a single markdown file.
250
-
251
- **Run:** \`/opsr:tasks <change-name>\`
252
-
253
- **Requires:** proposal + specs + design in database.
254
- **Creates:** \`<change-name>-task-<N>\` artifacts in database.
255
- **Unlocks:** /opsr:apply
256
- `,
257
- },
258
- {
259
- name: "opensddrag-apply",
260
- content: `${fm("opensddrag-apply", "Implement the next pending task against spec acceptance criteria")}# OpenSddRag — Apply
261
- ${note}Implements tasks one at a time, reading ALL planning artifacts (proposal + specs + design) as context.
262
- Marks tasks active → archived in the database after implementation.
263
- Must validate each task against spec acceptance criteria before marking done.
264
-
265
- **Run:** \`/opsr:apply <change-name>\`
266
-
267
- **Requires:** all planning artifacts + pending tasks in database.
268
- **Updates:** task status in database (draft → active → archived).
269
- **After all tasks:** run /opsr:verify then /opsr:archive.
270
- `,
271
- },
272
- {
273
- name: "opensddrag-verify",
274
- content: `${fm("opensddrag-verify", "Validate implementation against spec requirements and design decisions")}# OpenSddRag — Verify
275
- ${note}Read-only validation of the implementation against spec requirements and design decisions.
276
- Produces a report with CRITICAL / WARNING / SUGGESTION severity levels.
277
-
278
- Checks:
279
- - **Completeness**: all tasks done, all REQ-NNN implemented
280
- - **Correctness**: all spec scenarios covered
281
- - **Coherence**: implementation follows design decisions
282
-
283
- **Run:** \`/opsr:verify <change-name>\`
284
-
285
- **Requires:** all artifacts in database + implementation in codebase.
286
- **Output:** verification report (no artifacts modified).
287
- `,
288
- },
289
- {
290
- name: "opensddrag-sync",
291
- content: `${fm("opensddrag-sync", "Merge delta specs back into main capability specs")}# OpenSddRag — Sync
292
- ${note}Merges delta specs (ADDED/MODIFIED/REMOVED/RENAMED) into main specs stored in the database.
293
- Called automatically during /opsr:archive when delta specs exist.
294
-
295
- Delta operations:
296
- - **ADDED** → append new requirement to main spec
297
- - **MODIFIED** → apply partial updates (not wholesale replace)
298
- - **REMOVED** → delete requirement + add Reason/Migration note
299
- - **RENAMED** → rename requirement heading
300
-
301
- **Run:** \`/opsr:sync <change-name>\`
302
-
303
- **Requires:** delta specs + main specs in database.
304
- **Updates:** main spec artifacts in database.
305
- `,
306
- },
307
- {
308
- name: "opensddrag-archive",
309
- content: `${fm("opensddrag-archive", "Finalize a completed change by archiving all its artifacts")}# OpenSddRag — Archive
310
- ${note}Finalizes a completed change: validates, syncs delta specs, archives all artifacts.
311
-
312
- Steps:
313
- 1. Validate artifact and task completion (warns if incomplete)
314
- 2. Sync delta specs to main specs (if any)
315
- 3. Mark all change artifacts as archived in database
316
-
317
- **Run:** \`/opsr:archive <change-name>\`
318
-
319
- **Requires:** all tasks completed (or user confirmation to archive anyway).
320
- **Updates:** all change artifacts to status=archived in database.
321
- `,
322
- },
323
- {
324
- name: "opensddrag-explore",
325
- content: `${fm("opensddrag-explore", "Investigate a problem or idea without writing any code")}# OpenSddRag — Explore
326
- ${note}Thinking mode — investigates ideas WITHOUT implementing any code.
327
- Reads existing specs and codebase for context. Can create artifacts to capture insights.
328
-
329
- Rules:
330
- - NEVER write application code
331
- - NEVER create implementation files
332
- - MAY create/update OpenSddRag artifacts to capture decisions
333
-
334
- Use when: thinking through options, investigating feasibility, comparing approaches.
335
- Transition: when ready → /opsr:propose <name>
336
-
337
- **Run:** \`/opsr:explore <topic or question>\`
338
- `,
339
- },
340
- {
341
- name: "opensddrag-continue",
342
- content: `${fm("opensddrag-continue", "Create the next single artifact in the SDD dependency chain")}# OpenSddRag — Continue
343
- ${note}Creates the NEXT SINGLE artifact in the dependency chain and stops.
344
- Unlike /opsr:flow, creates one artifact per invocation.
345
-
346
- Dependency order: proposal → specs → design → tasks
347
-
348
- Use when: stepping through the SDD flow one artifact at a time.
349
-
350
- **Run:** \`/opsr:continue <change-name>\`
351
- `,
352
- },
353
- {
354
- name: "opensddrag-status",
355
- content: `${fm("opensddrag-status", "Show current state of all in-progress changes")}# OpenSddRag — Status
356
- ${note}Shows current state of all in-progress changes: artifact completion, task progress, recent activity.
357
-
358
- Reads from MCP server — no local files.
359
-
360
- **Run:** \`/opsr:status\` or \`/opsr:status <change-name>\`
361
- `,
362
- },
363
- {
364
- name: "opensddrag-flow",
365
- content: `${fm("opensddrag-flow", "Run the complete SDD flow end-to-end in one session")}# OpenSddRag — Flow
366
- ${note}Runs the complete SDD flow end-to-end: propose → spec → design → tasks → apply → archive.
367
- ALL artifacts saved to database via MCP — no local files created.
368
-
369
- Use when: implementing a feature from scratch in a single session.
370
-
371
- **Run:** \`/opsr:flow <feature description>\`
372
- `,
373
- },
374
- {
375
- name: "opensddrag-search",
376
- content: `${fm("opensddrag-search", "Semantic search over specs, tasks, and past agent actions")}# OpenSddRag — Search
377
- ${note}Semantic search over the SDD knowledge base using pgvector similarity.
378
- Always run this BEFORE starting new work to find existing specs and decisions.
55
+ return SKILLS.map((skill) => ({
56
+ name: skill.name,
57
+ content: `${frontmatter(skill.name, skill.description)}${skill.body(slug, note)}`,
58
+ }));
59
+ }
379
60
 
380
- Searches: this project first, then all projects if no results.
381
- Also recalls past agent actions (episodic memory).
61
+ /**
62
+ * OpenCode skills installed to .opencode/skills/.
63
+ * Compact header (project_slug only); MCP tools are auto-available in OpenCode.
64
+ */
65
+ export function getOpenCodeSkills(slug, _serverUrl) {
66
+ const note = `> **project_slug for every call:** \`${slug}\`\n\n`;
382
67
 
383
- **Run:** \`/opsr:search <natural language query>\`
384
- `,
385
- },
386
- ];
68
+ return SKILLS.map((skill) => ({
69
+ name: skill.name,
70
+ content: `${frontmatter(skill.name, skill.description)}${skill.body(slug, note)}`,
71
+ }));
387
72
  }
@@ -0,0 +1,74 @@
1
+ export const proposeSkill = {
2
+ name: "opensddrag-propose",
3
+ description:
4
+ "Create a named change proposal — entry point for every feature or bugfix",
5
+ body: (slug, note) => `# OpenSddRag — Propose
6
+ ${note}## When to use
7
+ Run this as the entry point for every new feature or bugfix, before any code is written.
8
+ It creates a named **change** with a proposal artifact defining WHY, WHAT changes, WHICH
9
+ capabilities are affected, and the IMPACT. After it, /opsr:spec and /opsr:design unlock.
10
+
11
+ ## Inputs
12
+ $ARGUMENTS = change name (kebab-case) or a plain description. If a plain description, derive a kebab-case name.
13
+
14
+ ## Workflow
15
+
16
+ ### Step 1 — Derive the change name
17
+ If $ARGUMENTS is a plain description (contains spaces), convert it to kebab-case.
18
+ Example: "add user authentication" → "add-user-authentication".
19
+
20
+ ### Step 2 — Search for existing work (avoid duplication)
21
+ \`search_semantic(query="$ARGUMENTS", project_slug="${slug}", limit=5)\`
22
+ If relevant artifacts are found, show them and ask the user to confirm this is genuinely new work.
23
+
24
+ ### Step 3 — Write the proposal content
25
+ Compose this structure — do NOT skip any section:
26
+
27
+ \`\`\`markdown
28
+ # <change-name>
29
+
30
+ ## Why
31
+ [1-2 sentences on the problem or opportunity being addressed]
32
+
33
+ ## What Changes
34
+ - [Specific change 1]
35
+ - [Specific change 2]
36
+ - **BREAKING** [Breaking change if any]
37
+
38
+ ## Capabilities
39
+ ### New Capabilities
40
+ - [capability-name] — brief description
41
+
42
+ ### Modified Capabilities
43
+ - [existing-capability] — what changes
44
+
45
+ ## Impact
46
+ [Affected code, APIs, dependencies, systems]
47
+ \`\`\`
48
+
49
+ ### Step 4 — Save the proposal
50
+ \`create_artifact(name="<change-name>-proposal", type="proposal", content="<full proposal markdown>", metadata={"change_name": "<change-name>", "status_phase": "planning"}, project_slug="${slug}")\`
51
+ Note the returned artifact ID.
52
+
53
+ ### Step 5 — Create spec drafts for each capability
54
+ Parse "## Capabilities". For each capability in "New Capabilities" or "Modified Capabilities":
55
+ 1. Check if a spec already exists: \`read_artifact(name="<change-name>-<capability>-spec", project_slug="${slug}")\`. If it exists and is non-empty, skip.
56
+ 2. Otherwise create a draft spec scaffold:
57
+ \`create_artifact(name="<change-name>-<capability>-spec", type="spec", status="draft", content="# <capability> Specification\\n\\n## Purpose\\n[TODO]\\n\\n## Requirements\\n\\n### Requirement: REQ-001\\n[TODO SHALL/MUST]\\n\\n#### Scenario: <Name>\\n- **WHEN** [condition]\\n- **THEN** [outcome]", metadata={"change_name": "<change-name>", "capability": "<capability>", "is_delta": true}, project_slug="${slug}")\`
58
+
59
+ ### Step 6 — Create a design skeleton
60
+ \`create_artifact(name="<change-name>-design", type="design", status="draft", content="# Design: <change-name>\\n\\n## Context\\n[TODO]\\n\\n## Goals / Non-Goals\\n\\n## Decisions\\n\\n## Architecture\\n\\n## Risks / Trade-offs\\n\\n## Open Questions", metadata={"change_name": "<change-name>"}, project_slug="${slug}")\`
61
+
62
+ ### Step 7 — Record the action
63
+ \`record_trace(action="propose", result_summary="Created proposal: <change-name>-proposal", project_slug="${slug}")\`
64
+
65
+ ## Output
66
+ - A \`<change-name>-proposal\` artifact (plus draft spec/design scaffolds) in the database.
67
+ - **Unlocks:** /opsr:spec, /opsr:design, or /opsr:flow to continue automatically.
68
+
69
+ ## Important rules
70
+ - NEVER write application code in this phase.
71
+ - DO NOT create local markdown files — all artifacts live in the database.
72
+ - If $ARGUMENTS is empty, ask the user for a change name or description before proceeding.
73
+ `,
74
+ };
@@ -0,0 +1,60 @@
1
+ export const searchSkill = {
2
+ name: "opensddrag-search",
3
+ description: "Semantic search over specs, tasks, and past agent actions",
4
+ body: (slug, note) => `# OpenSddRag — Search
5
+ ${note}## When to use
6
+ To search the SDD knowledge base by semantic similarity (pgvector). Run this BEFORE starting any
7
+ new work to find existing specs, decisions, and past implementations.
8
+
9
+ ## Inputs
10
+ $ARGUMENTS = natural language search query.
11
+
12
+ ## Workflow
13
+
14
+ ### Step 1 — Search this project
15
+ \`search_semantic(query="$ARGUMENTS", project_slug="${slug}", limit=5)\`
16
+
17
+ ### Step 2 — If no relevant results, search all projects
18
+ \`search_semantic(query="$ARGUMENTS", project_slug="*", limit=5)\`
19
+
20
+ ### Step 3 — Recall past actions related to the query
21
+ \`recall_episodes(query="$ARGUMENTS", project_slug="${slug}", limit=3)\`
22
+
23
+ ### Step 4 — Present the results clearly
24
+ For each result: name, type, status, and a content excerpt (first ~200 chars).
25
+ Group by: this project / other projects / past actions.
26
+
27
+ ### Step 5 — Offer to read a full artifact
28
+ \`read_artifact(name="<artifact-name>", project_slug="${slug}")\`
29
+
30
+ ### Step 6 — Optionally filter by artifact type
31
+ When the user is only interested in one kind of artifact, narrow the search:
32
+ \`search_semantic(query="$ARGUMENTS", project_slug="${slug}", type="spec", limit=5)\`
33
+ Valid \`type\` values: \`proposal\`, \`spec\`, \`design\`, \`task\`.
34
+
35
+ ## Examples
36
+ - "How do we handle delta specs?" → finds the spec/sync capability artifacts.
37
+ - "auth token refresh" → finds proposals/specs/designs touching authentication.
38
+ - "what did we decide about embeddings" → combine with \`recall_episodes\` for past decisions.
39
+
40
+ A good presentation block looks like:
41
+ \`\`\`
42
+ ### This project
43
+ - [spec] opensddrag-sync-spec (active) — "Merges delta specs (ADDED/MODIFIED/REMOVED…)"
44
+ ### Other projects
45
+ - (none)
46
+ ### Past actions
47
+ - design (2026-06-22) — "Created design: refactor-commands-skills-separation-design"
48
+ \`\`\`
49
+
50
+ ## Output
51
+ - A grouped list of semantically relevant artifacts and past actions, with an offer to open any.
52
+
53
+ ## Important rules
54
+ - Read-only — search never creates or modifies artifacts.
55
+ - Fall back to cross-project search (project_slug="*") only when the local search is empty.
56
+ - Surface episodic recall alongside artifacts so prior decisions are not missed.
57
+ - Prefer specific, noun-rich queries; vague one-word queries return weak matches.
58
+ - Always run search BEFORE /opsr:propose to avoid creating duplicate changes.
59
+ `,
60
+ };