@thiagodiogo/pscode 2.3.0 → 2.5.0

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.
Files changed (33) hide show
  1. package/dist/core/init.d.ts +0 -2
  2. package/dist/core/init.js +7 -77
  3. package/dist/core/profile-sync-drift.js +1 -15
  4. package/dist/core/profiles.d.ts +1 -1
  5. package/dist/core/profiles.js +0 -13
  6. package/dist/core/shared/index.d.ts +1 -0
  7. package/dist/core/shared/index.js +1 -0
  8. package/dist/core/shared/prune-orphans.d.ts +39 -0
  9. package/dist/core/shared/prune-orphans.js +149 -0
  10. package/dist/core/shared/skill-generation.js +2 -14
  11. package/dist/core/shared/tool-detection.d.ts +2 -2
  12. package/dist/core/shared/tool-detection.js +1 -13
  13. package/dist/core/templates/skill-templates.d.ts +1 -7
  14. package/dist/core/templates/skill-templates.js +1 -7
  15. package/dist/core/templates/workflows/apply-change.js +27 -2
  16. package/dist/core/templates/workflows/{archive-change.d.ts → complete-change.d.ts} +1 -1
  17. package/dist/core/templates/workflows/{archive-change.js → complete-change.js} +2 -2
  18. package/dist/core/templates/workflows/propose.js +56 -1
  19. package/dist/core/update.d.ts +0 -20
  20. package/dist/core/update.js +29 -115
  21. package/package.json +1 -1
  22. package/dist/core/templates/workflows/bulk-archive-change.d.ts +0 -10
  23. package/dist/core/templates/workflows/bulk-archive-change.js +0 -491
  24. package/dist/core/templates/workflows/continue-change.d.ts +0 -10
  25. package/dist/core/templates/workflows/continue-change.js +0 -233
  26. package/dist/core/templates/workflows/ff-change.d.ts +0 -10
  27. package/dist/core/templates/workflows/ff-change.js +0 -199
  28. package/dist/core/templates/workflows/new-change.d.ts +0 -10
  29. package/dist/core/templates/workflows/new-change.js +0 -142
  30. package/dist/core/templates/workflows/onboard.d.ts +0 -10
  31. package/dist/core/templates/workflows/onboard.js +0 -606
  32. package/dist/core/templates/workflows/verify-change.d.ts +0 -10
  33. package/dist/core/templates/workflows/verify-change.js +0 -337
@@ -1,233 +0,0 @@
1
- export function getContinueChangeSkillTemplate() {
2
- return {
3
- name: 'pscode-continue-change',
4
- description: 'Continue working on an Pscode change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.',
5
- instructions: `Continue working on a change by creating the next artifact.
6
-
7
- **Input**: Optionally specify a change name. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
8
-
9
- **Steps**
10
-
11
- 1. **If no change name provided, prompt for selection**
12
-
13
- Run \`pscode list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
14
-
15
- Present the top 3-4 most recently modified changes as options, showing:
16
- - Change name
17
- - Schema (from \`schema\` field if present, otherwise "spec-driven")
18
- - Status (e.g., "0/5 tasks", "complete", "no tasks")
19
- - How recently it was modified (from \`lastModified\` field)
20
-
21
- Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
22
-
23
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
24
-
25
- 2. **Check current status**
26
- \`\`\`bash
27
- pscode status --change "<name>" --json
28
- \`\`\`
29
- Parse the JSON to understand current state. The response includes:
30
- - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
31
- - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
32
- - \`isComplete\`: Boolean indicating if all artifacts are complete
33
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
34
-
35
- 3. **Act based on status**:
36
-
37
- ---
38
-
39
- **If all artifacts are complete (\`isComplete: true\`)**:
40
- - Congratulate the user
41
- - Show final status including the schema used
42
- - Suggest: "All artifacts created! You can now implement this change or archive it."
43
- - STOP
44
-
45
- ---
46
-
47
- **If artifacts are ready to create** (status shows artifacts with \`status: "ready"\`):
48
- - Pick the FIRST artifact with \`status: "ready"\` from the status output
49
- - Get its instructions:
50
- \`\`\`bash
51
- pscode instructions <artifact-id> --change "<name>" --json
52
- \`\`\`
53
- - Parse the JSON. The key fields are:
54
- - \`context\`: Project background (constraints for you - do NOT include in output)
55
- - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
56
- - \`template\`: The structure to use for your output file
57
- - \`instruction\`: Schema-specific guidance
58
- - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
59
- - \`dependencies\`: Completed artifacts to read for context
60
- - **Create the artifact file**:
61
- - Read any completed dependency files for context
62
- - Use \`template\` as the structure - fill in its sections
63
- - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
64
- - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and workspace planning context
65
- - Show what was created and what's now unlocked
66
- - STOP after creating ONE artifact
67
-
68
- ---
69
-
70
- **If no artifacts are ready (all blocked)**:
71
- - This shouldn't happen with a valid schema
72
- - Show status and suggest checking for issues
73
-
74
- 4. **After creating an artifact, show progress**
75
- \`\`\`bash
76
- pscode status --change "<name>"
77
- \`\`\`
78
-
79
- **Output**
80
-
81
- After each invocation, show:
82
- - Which artifact was created
83
- - Schema workflow being used
84
- - Current progress (N/M complete)
85
- - What artifacts are now unlocked
86
- - Prompt: "Want to continue? Just ask me to continue or tell me what to do next."
87
-
88
- **Artifact Creation Guidelines**
89
-
90
- The artifact types and their purpose depend on the schema. Use the \`instruction\` field from the instructions output to understand what to create.
91
-
92
- Common artifact patterns:
93
-
94
- **spec-driven schema** (proposal → specs → design → tasks):
95
- - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
96
- - The Capabilities section is critical - each capability listed will need a spec file.
97
- - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
98
- - **design.md**: Document technical decisions, architecture, and implementation approach.
99
- - **tasks.md**: Break down implementation into checkboxed tasks.
100
-
101
- For other schemas, follow the \`instruction\` field from the CLI output.
102
-
103
- **Guardrails**
104
- - Create ONE artifact per invocation
105
- - Always read dependency artifacts before creating a new one
106
- - Never skip artifacts or create out of order
107
- - If context is unclear, ask the user before creating
108
- - Verify the artifact file exists after writing before marking progress
109
- - Use the schema's artifact sequence, don't assume specific artifact names
110
- - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
111
- - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
112
- - These guide what you write, but should never appear in the output`,
113
- compatibility: 'Requires pscode CLI.',
114
- metadata: { author: 'pscode', version: '1.0' },
115
- };
116
- }
117
- export function getPsContinueCommandTemplate() {
118
- return {
119
- name: 'PS: Continue',
120
- description: 'Continue working on a change - create the next artifact (Experimental)',
121
- category: 'Workflow',
122
- tags: ['workflow', 'artifacts', 'experimental'],
123
- content: `Continue working on a change by creating the next artifact.
124
-
125
- **Input**: Optionally specify a change name after \`/ps:continue\` (e.g., \`/ps:continue add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
126
-
127
- **Steps**
128
-
129
- 1. **If no change name provided, prompt for selection**
130
-
131
- Run \`pscode list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to work on.
132
-
133
- Present the top 3-4 most recently modified changes as options, showing:
134
- - Change name
135
- - Schema (from \`schema\` field if present, otherwise "spec-driven")
136
- - Status (e.g., "0/5 tasks", "complete", "no tasks")
137
- - How recently it was modified (from \`lastModified\` field)
138
-
139
- Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to continue.
140
-
141
- **IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
142
-
143
- 2. **Check current status**
144
- \`\`\`bash
145
- pscode status --change "<name>" --json
146
- \`\`\`
147
- Parse the JSON to understand current state. The response includes:
148
- - \`schemaName\`: The workflow schema being used (e.g., "spec-driven")
149
- - \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked")
150
- - \`isComplete\`: Boolean indicating if all artifacts are complete
151
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
152
-
153
- 3. **Act based on status**:
154
-
155
- ---
156
-
157
- **If all artifacts are complete (\`isComplete: true\`)**:
158
- - Congratulate the user
159
- - Show final status including the schema used
160
- - Suggest: "All artifacts created! You can now implement this change with \`/ps:apply\` or archive it with \`/ps:archive\`."
161
- - STOP
162
-
163
- ---
164
-
165
- **If artifacts are ready to create** (status shows artifacts with \`status: "ready"\`):
166
- - Pick the FIRST artifact with \`status: "ready"\` from the status output
167
- - Get its instructions:
168
- \`\`\`bash
169
- pscode instructions <artifact-id> --change "<name>" --json
170
- \`\`\`
171
- - Parse the JSON. The key fields are:
172
- - \`context\`: Project background (constraints for you - do NOT include in output)
173
- - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
174
- - \`template\`: The structure to use for your output file
175
- - \`instruction\`: Schema-specific guidance
176
- - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
177
- - \`dependencies\`: Completed artifacts to read for context
178
- - **Create the artifact file**:
179
- - Read any completed dependency files for context
180
- - Use \`template\` as the structure - fill in its sections
181
- - Apply \`context\` and \`rules\` as constraints when writing - but do NOT copy them into the file
182
- - Write to the \`resolvedOutputPath\` specified in instructions. If it is a glob pattern, choose the concrete file path using the schema instruction and workspace planning context
183
- - Show what was created and what's now unlocked
184
- - STOP after creating ONE artifact
185
-
186
- ---
187
-
188
- **If no artifacts are ready (all blocked)**:
189
- - This shouldn't happen with a valid schema
190
- - Show status and suggest checking for issues
191
-
192
- 4. **After creating an artifact, show progress**
193
- \`\`\`bash
194
- pscode status --change "<name>"
195
- \`\`\`
196
-
197
- **Output**
198
-
199
- After each invocation, show:
200
- - Which artifact was created
201
- - Schema workflow being used
202
- - Current progress (N/M complete)
203
- - What artifacts are now unlocked
204
- - Prompt: "Run \`/ps:continue\` to create the next artifact"
205
-
206
- **Artifact Creation Guidelines**
207
-
208
- The artifact types and their purpose depend on the schema. Use the \`instruction\` field from the instructions output to understand what to create.
209
-
210
- Common artifact patterns:
211
-
212
- **spec-driven schema** (proposal → specs → design → tasks):
213
- - **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
214
- - The Capabilities section is critical - each capability listed will need a spec file.
215
- - **specs/<capability>/spec.md**: Create one spec per capability listed in the proposal's Capabilities section (use the capability name, not the change name).
216
- - **design.md**: Document technical decisions, architecture, and implementation approach.
217
- - **tasks.md**: Break down implementation into checkboxed tasks.
218
-
219
- For other schemas, follow the \`instruction\` field from the CLI output.
220
-
221
- **Guardrails**
222
- - Create ONE artifact per invocation
223
- - Always read dependency artifacts before creating a new one
224
- - Never skip artifacts or create out of order
225
- - If context is unclear, ask the user before creating
226
- - Verify the artifact file exists after writing before marking progress
227
- - Use the schema's artifact sequence, don't assume specific artifact names
228
- - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
229
- - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
230
- - These guide what you write, but should never appear in the output`
231
- };
232
- }
233
- //# sourceMappingURL=continue-change.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Skill Template Workflow Modules
3
- *
4
- * This file is generated by splitting the legacy monolithic
5
- * templates file into workflow-focused modules.
6
- */
7
- import type { SkillTemplate, CommandTemplate } from '../types.js';
8
- export declare function getFfChangeSkillTemplate(): SkillTemplate;
9
- export declare function getPsFfCommandTemplate(): CommandTemplate;
10
- //# sourceMappingURL=ff-change.d.ts.map
@@ -1,199 +0,0 @@
1
- export function getFfChangeSkillTemplate() {
2
- return {
3
- name: 'pscode-ff-change',
4
- description: 'Fast-forward through Pscode artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.',
5
- instructions: `Fast-forward through artifact creation - generate everything needed to start implementation in one go.
6
-
7
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
8
-
9
- **Steps**
10
-
11
- 1. **If no clear input provided, ask what they want to build**
12
-
13
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
14
- > "What change do you want to work on? Describe what you want to build or fix."
15
-
16
- From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
17
-
18
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
19
-
20
- 2. **Create the change directory**
21
- \`\`\`bash
22
- pscode new change "<name>"
23
- \`\`\`
24
- This creates a scaffolded change in the planning home resolved by the CLI.
25
-
26
- 3. **Get the artifact build order**
27
- \`\`\`bash
28
- pscode status --change "<name>" --json
29
- \`\`\`
30
- Parse the JSON to get:
31
- - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
32
- - \`artifacts\`: list of all artifacts with their status and dependencies
33
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
34
-
35
- 4. **Create artifacts in sequence until apply-ready**
36
-
37
- Use the **TodoWrite tool** to track progress through the artifacts.
38
-
39
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
40
-
41
- a. **For each artifact that is \`ready\` (dependencies satisfied)**:
42
- - Get instructions:
43
- \`\`\`bash
44
- pscode instructions <artifact-id> --change "<name>" --json
45
- \`\`\`
46
- - The instructions JSON includes:
47
- - \`context\`: Project background (constraints for you - do NOT include in output)
48
- - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
49
- - \`template\`: The structure to use for your output file
50
- - \`instruction\`: Schema-specific guidance for this artifact type
51
- - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
52
- - \`dependencies\`: Completed artifacts to read for context
53
- - Read any completed dependency files for context
54
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
55
- - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
56
- - Show brief progress: "✓ Created <artifact-id>"
57
-
58
- b. **Continue until all \`applyRequires\` artifacts are complete**
59
- - After creating each artifact, re-run \`pscode status --change "<name>" --json\`
60
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
61
- - Stop when all \`applyRequires\` artifacts are done
62
-
63
- c. **If an artifact requires user input** (unclear context):
64
- - Use **AskUserQuestion tool** to clarify
65
- - Then continue with creation
66
-
67
- 5. **Show final status**
68
- \`\`\`bash
69
- pscode status --change "<name>"
70
- \`\`\`
71
-
72
- **Output**
73
-
74
- After completing all artifacts, summarize:
75
- - Change name and location
76
- - List of artifacts created with brief descriptions
77
- - What's ready: "All artifacts created! Ready for implementation."
78
- - Prompt: "Run \`/ps:apply\` or ask me to implement to start working on the tasks."
79
-
80
- **Artifact Creation Guidelines**
81
-
82
- - Follow the \`instruction\` field from \`pscode instructions\` for each artifact type
83
- - The schema defines what each artifact should contain - follow it
84
- - Read dependency artifacts for context before creating new ones
85
- - Use \`template\` as the structure for your output file - fill in its sections
86
- - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
87
- - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
88
- - These guide what you write, but should never appear in the output
89
-
90
- **Guardrails**
91
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
92
- - Always read dependency artifacts before creating a new one
93
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
94
- - If a change with that name already exists, suggest continuing that change instead
95
- - Verify each artifact file exists after writing before proceeding to next`,
96
- compatibility: 'Requires pscode CLI.',
97
- metadata: { author: 'pscode', version: '1.0' },
98
- };
99
- }
100
- export function getPsFfCommandTemplate() {
101
- return {
102
- name: 'PS: Fast Forward',
103
- description: 'Create a change and generate all artifacts needed for implementation in one go',
104
- category: 'Workflow',
105
- tags: ['workflow', 'artifacts', 'experimental'],
106
- content: `Fast-forward through artifact creation - generate everything needed to start implementation.
107
-
108
- **Input**: The argument after \`/ps:ff\` is the change name (kebab-case), OR a description of what the user wants to build.
109
-
110
- **Steps**
111
-
112
- 1. **If no input provided, ask what they want to build**
113
-
114
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
115
- > "What change do you want to work on? Describe what you want to build or fix."
116
-
117
- From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
118
-
119
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
120
-
121
- 2. **Create the change directory**
122
- \`\`\`bash
123
- pscode new change "<name>"
124
- \`\`\`
125
- This creates a scaffolded change in the planning home resolved by the CLI.
126
-
127
- 3. **Get the artifact build order**
128
- \`\`\`bash
129
- pscode status --change "<name>" --json
130
- \`\`\`
131
- Parse the JSON to get:
132
- - \`applyRequires\`: array of artifact IDs needed before implementation (e.g., \`["tasks"]\`)
133
- - \`artifacts\`: list of all artifacts with their status and dependencies
134
- - \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
135
-
136
- 4. **Create artifacts in sequence until apply-ready**
137
-
138
- Use the **TodoWrite tool** to track progress through the artifacts.
139
-
140
- Loop through artifacts in dependency order (artifacts with no pending dependencies first):
141
-
142
- a. **For each artifact that is \`ready\` (dependencies satisfied)**:
143
- - Get instructions:
144
- \`\`\`bash
145
- pscode instructions <artifact-id> --change "<name>" --json
146
- \`\`\`
147
- - The instructions JSON includes:
148
- - \`context\`: Project background (constraints for you - do NOT include in output)
149
- - \`rules\`: Artifact-specific rules (constraints for you - do NOT include in output)
150
- - \`template\`: The structure to use for your output file
151
- - \`instruction\`: Schema-specific guidance for this artifact type
152
- - \`resolvedOutputPath\`: Resolved path or pattern to write the artifact
153
- - \`dependencies\`: Completed artifacts to read for context
154
- - Read any completed dependency files for context
155
- - Create the artifact file using \`template\` as the structure and write it to \`resolvedOutputPath\`
156
- - Apply \`context\` and \`rules\` as constraints - but do NOT copy them into the file
157
- - Show brief progress: "✓ Created <artifact-id>"
158
-
159
- b. **Continue until all \`applyRequires\` artifacts are complete**
160
- - After creating each artifact, re-run \`pscode status --change "<name>" --json\`
161
- - Check if every artifact ID in \`applyRequires\` has \`status: "done"\` in the artifacts array
162
- - Stop when all \`applyRequires\` artifacts are done
163
-
164
- c. **If an artifact requires user input** (unclear context):
165
- - Use **AskUserQuestion tool** to clarify
166
- - Then continue with creation
167
-
168
- 5. **Show final status**
169
- \`\`\`bash
170
- pscode status --change "<name>"
171
- \`\`\`
172
-
173
- **Output**
174
-
175
- After completing all artifacts, summarize:
176
- - Change name and location
177
- - List of artifacts created with brief descriptions
178
- - What's ready: "All artifacts created! Ready for implementation."
179
- - Prompt: "Run \`/ps:apply\` to start implementing."
180
-
181
- **Artifact Creation Guidelines**
182
-
183
- - Follow the \`instruction\` field from \`pscode instructions\` for each artifact type
184
- - The schema defines what each artifact should contain - follow it
185
- - Read dependency artifacts for context before creating new ones
186
- - Use \`template\` as the structure for your output file - fill in its sections
187
- - **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
188
- - Do NOT copy \`<context>\`, \`<rules>\`, \`<project_context>\` blocks into the artifact
189
- - These guide what you write, but should never appear in the output
190
-
191
- **Guardrails**
192
- - Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
193
- - Always read dependency artifacts before creating a new one
194
- - If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
195
- - If a change with that name already exists, ask if user wants to continue it or create a new one
196
- - Verify each artifact file exists after writing before proceeding to next`
197
- };
198
- }
199
- //# sourceMappingURL=ff-change.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Skill Template Workflow Modules
3
- *
4
- * This file is generated by splitting the legacy monolithic
5
- * templates file into workflow-focused modules.
6
- */
7
- import type { SkillTemplate, CommandTemplate } from '../types.js';
8
- export declare function getNewChangeSkillTemplate(): SkillTemplate;
9
- export declare function getPsNewCommandTemplate(): CommandTemplate;
10
- //# sourceMappingURL=new-change.d.ts.map
@@ -1,142 +0,0 @@
1
- export function getNewChangeSkillTemplate() {
2
- return {
3
- name: 'pscode-new-change',
4
- description: 'Start a new Pscode change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.',
5
- instructions: `Start a new change using the experimental artifact-driven approach.
6
-
7
- **Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
8
-
9
- **Steps**
10
-
11
- 1. **If no clear input provided, ask what they want to build**
12
-
13
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
14
- > "What change do you want to work on? Describe what you want to build or fix."
15
-
16
- From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
17
-
18
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
19
-
20
- 2. **Determine the workflow schema**
21
-
22
- Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
23
-
24
- **Use a different schema only if the user mentions:**
25
- - A specific schema name → use \`--schema <name>\`
26
- - "show workflows" or "what workflows" → run \`pscode schemas --json\` and let them choose
27
-
28
- **Otherwise**: Omit \`--schema\` to use the default.
29
-
30
- 3. **Create the change directory**
31
- \`\`\`bash
32
- pscode new change "<name>"
33
- \`\`\`
34
- Add \`--schema <name>\` only if the user requested a specific workflow.
35
- This creates a scaffolded change in the planning home resolved by the CLI.
36
-
37
- 4. **Show the artifact status**
38
- \`\`\`bash
39
- pscode status --change "<name>" --json
40
- \`\`\`
41
- Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
42
-
43
- 5. **Get instructions for the first artifact**
44
- The first artifact depends on the schema (e.g., \`proposal\` for spec-driven).
45
- Check the status output to find the first artifact with status "ready".
46
- \`\`\`bash
47
- pscode instructions <first-artifact-id> --change "<name>"
48
- \`\`\`
49
- This outputs the template and context for creating the first artifact.
50
-
51
- 6. **STOP and wait for user direction**
52
-
53
- **Output**
54
-
55
- After completing the steps, summarize:
56
- - Change name and location
57
- - Schema/workflow being used and its artifact sequence
58
- - Current status (0/N artifacts complete)
59
- - The template for the first artifact
60
- - Prompt: "Ready to create the first artifact? Just describe what this change is about and I'll draft it, or ask me to continue."
61
-
62
- **Guardrails**
63
- - Do NOT create any artifacts yet - just show the instructions
64
- - Do NOT advance beyond showing the first artifact template
65
- - If the name is invalid (not kebab-case), ask for a valid name
66
- - If a change with that name already exists, suggest continuing that change instead
67
- - Pass --schema if using a non-default workflow`,
68
- compatibility: 'Requires pscode CLI.',
69
- metadata: { author: 'pscode', version: '1.0' },
70
- };
71
- }
72
- export function getPsNewCommandTemplate() {
73
- return {
74
- name: 'PS: New',
75
- description: 'Start a new change using the experimental artifact workflow (OPSX)',
76
- category: 'Workflow',
77
- tags: ['workflow', 'artifacts', 'experimental'],
78
- content: `Start a new change using the experimental artifact-driven approach.
79
-
80
- **Input**: The argument after \`/ps:new\` is the change name (kebab-case), OR a description of what the user wants to build.
81
-
82
- **Steps**
83
-
84
- 1. **If no input provided, ask what they want to build**
85
-
86
- Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
87
- > "What change do you want to work on? Describe what you want to build or fix."
88
-
89
- From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
90
-
91
- **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
92
-
93
- 2. **Determine the workflow schema**
94
-
95
- Use the default schema (omit \`--schema\`) unless the user explicitly requests a different workflow.
96
-
97
- **Use a different schema only if the user mentions:**
98
- - A specific schema name → use \`--schema <name>\`
99
- - "show workflows" or "what workflows" → run \`pscode schemas --json\` and let them choose
100
-
101
- **Otherwise**: Omit \`--schema\` to use the default.
102
-
103
- 3. **Create the change directory**
104
- \`\`\`bash
105
- pscode new change "<name>"
106
- \`\`\`
107
- Add \`--schema <name>\` only if the user requested a specific workflow.
108
- This creates a scaffolded change in the planning home resolved by the CLI.
109
-
110
- 4. **Show the artifact status**
111
- \`\`\`bash
112
- pscode status --change "<name>" --json
113
- \`\`\`
114
- Use the returned \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`nextSteps\` instead of assuming repo-local paths.
115
-
116
- 5. **Get instructions for the first artifact**
117
- The first artifact depends on the schema. Check the status output to find the first artifact with status "ready".
118
- \`\`\`bash
119
- pscode instructions <first-artifact-id> --change "<name>"
120
- \`\`\`
121
- This outputs the template and context for creating the first artifact.
122
-
123
- 6. **STOP and wait for user direction**
124
-
125
- **Output**
126
-
127
- After completing the steps, summarize:
128
- - Change name and location
129
- - Schema/workflow being used and its artifact sequence
130
- - Current status (0/N artifacts complete)
131
- - The template for the first artifact
132
- - Prompt: "Ready to create the first artifact? Run \`/ps:continue\` or just describe what this change is about and I'll draft it."
133
-
134
- **Guardrails**
135
- - Do NOT create any artifacts yet - just show the instructions
136
- - Do NOT advance beyond showing the first artifact template
137
- - If the name is invalid (not kebab-case), ask for a valid name
138
- - If a change with that name already exists, suggest using \`/ps:continue\` instead
139
- - Pass --schema if using a non-default workflow`
140
- };
141
- }
142
- //# sourceMappingURL=new-change.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Skill Template Workflow Modules
3
- *
4
- * This file is generated by splitting the legacy monolithic
5
- * templates file into workflow-focused modules.
6
- */
7
- import type { SkillTemplate, CommandTemplate } from '../types.js';
8
- export declare function getOnboardSkillTemplate(): SkillTemplate;
9
- export declare function getPsOnboardCommandTemplate(): CommandTemplate;
10
- //# sourceMappingURL=onboard.d.ts.map