spets 0.1.2 → 0.1.3
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/index.js +64 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,12 +38,14 @@ async function initCommand(options) {
|
|
|
38
38
|
const templatesDir = join(__dirname, "..", "templates");
|
|
39
39
|
writeFileSync(join(spetsDir, "config.yml"), getDefaultConfig());
|
|
40
40
|
createDefaultSteps(spetsDir);
|
|
41
|
+
createClaudeCommand(cwd);
|
|
41
42
|
console.log("Initialized spets in .spets/");
|
|
42
43
|
console.log("");
|
|
43
44
|
console.log("Created:");
|
|
44
|
-
console.log(" .spets/config.yml
|
|
45
|
-
console.log(" .spets/steps/01-plan/
|
|
46
|
-
console.log(" .spets/steps/02-implement/
|
|
45
|
+
console.log(" .spets/config.yml - Workflow configuration");
|
|
46
|
+
console.log(" .spets/steps/01-plan/ - Planning step");
|
|
47
|
+
console.log(" .spets/steps/02-implement/ - Implementation step");
|
|
48
|
+
console.log(" .claude/commands/spets.md - Claude Code command");
|
|
47
49
|
if (options.github) {
|
|
48
50
|
createGitHubWorkflow(cwd);
|
|
49
51
|
console.log(" .github/workflows/spets.yml - GitHub Actions workflow");
|
|
@@ -237,6 +239,65 @@ None / List any deviations with justification.
|
|
|
237
239
|
- Follow-up task 2
|
|
238
240
|
`;
|
|
239
241
|
}
|
|
242
|
+
function createClaudeCommand(cwd) {
|
|
243
|
+
const commandDir = join(cwd, ".claude", "commands");
|
|
244
|
+
mkdirSync(commandDir, { recursive: true });
|
|
245
|
+
writeFileSync(join(commandDir, "spets.md"), getClaudeCommand());
|
|
246
|
+
}
|
|
247
|
+
function getClaudeCommand() {
|
|
248
|
+
return `# Spets - Spec Driven Development
|
|
249
|
+
|
|
250
|
+
Run spets workflows from Claude Code.
|
|
251
|
+
|
|
252
|
+
## Usage
|
|
253
|
+
|
|
254
|
+
\`\`\`
|
|
255
|
+
/spets start "task description" - Start a new workflow
|
|
256
|
+
/spets status - Show workflow status
|
|
257
|
+
/spets resume - Resume paused workflow
|
|
258
|
+
\`\`\`
|
|
259
|
+
|
|
260
|
+
## Instructions
|
|
261
|
+
|
|
262
|
+
When the user invokes this command:
|
|
263
|
+
|
|
264
|
+
1. Parse the subcommand (start, status, resume)
|
|
265
|
+
2. Execute the appropriate spets CLI command using Bash
|
|
266
|
+
3. For 'start', read the generated documents and help iterate
|
|
267
|
+
|
|
268
|
+
### Start Flow
|
|
269
|
+
|
|
270
|
+
1. Run: \`npx spets start "<query>"\`
|
|
271
|
+
2. Read the generated plan document from .spets/outputs/<taskId>/
|
|
272
|
+
3. Present the plan to the user
|
|
273
|
+
4. If user approves, continue. If they want changes, provide feedback.
|
|
274
|
+
|
|
275
|
+
### Status Flow
|
|
276
|
+
|
|
277
|
+
1. Run: \`npx spets status\`
|
|
278
|
+
2. Present the current workflow state
|
|
279
|
+
|
|
280
|
+
### Resume Flow
|
|
281
|
+
|
|
282
|
+
1. Run: \`npx spets resume\`
|
|
283
|
+
2. Continue the workflow from where it paused
|
|
284
|
+
|
|
285
|
+
## Example Session
|
|
286
|
+
|
|
287
|
+
User: /spets start "Create a REST API for user management"
|
|
288
|
+
|
|
289
|
+
Claude:
|
|
290
|
+
1. Runs \`npx spets start "Create a REST API for user management"\`
|
|
291
|
+
2. Reads the generated plan
|
|
292
|
+
3. Asks user: "Here's the plan. [shows plan] Would you like to approve or revise?"
|
|
293
|
+
4. On approve: \`npx spets resume --approve\`
|
|
294
|
+
5. On revise: \`npx spets resume --revise "user feedback"\`
|
|
295
|
+
|
|
296
|
+
$ARGUMENTS
|
|
297
|
+
command: The spets command to run (start, status, resume)
|
|
298
|
+
args: Additional arguments for the command
|
|
299
|
+
`;
|
|
300
|
+
}
|
|
240
301
|
function createGitHubWorkflow(cwd) {
|
|
241
302
|
const workflowDir = join(cwd, ".github", "workflows");
|
|
242
303
|
mkdirSync(workflowDir, { recursive: true });
|