@thiagodiogo/pscode 1.0.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.
- package/LICENSE +22 -0
- package/README.md +142 -0
- package/bin/pscode.js +5 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.js +526 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +264 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +611 -0
- package/dist/commands/context-store.d.ts +3 -0
- package/dist/commands/context-store.js +282 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/initiative.d.ts +13 -0
- package/dist/commands/initiative.js +318 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +869 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/commands/workflow/index.d.ts +19 -0
- package/dist/commands/workflow/index.js +13 -0
- package/dist/commands/workflow/initiative-link.d.ts +24 -0
- package/dist/commands/workflow/initiative-link.js +47 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +344 -0
- package/dist/commands/workflow/new-change.d.ts +17 -0
- package/dist/commands/workflow/new-change.js +141 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/set-change.d.ts +13 -0
- package/dist/commands/workflow/set-change.js +87 -0
- package/dist/commands/workflow/shared.d.ts +59 -0
- package/dist/commands/workflow/shared.js +116 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +90 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +69 -0
- package/dist/commands/workspace/context-status.d.ts +4 -0
- package/dist/commands/workspace/context-status.js +59 -0
- package/dist/commands/workspace/open-view.d.ts +62 -0
- package/dist/commands/workspace/open-view.js +228 -0
- package/dist/commands/workspace/open.d.ts +37 -0
- package/dist/commands/workspace/open.js +102 -0
- package/dist/commands/workspace/opener-selection.d.ts +11 -0
- package/dist/commands/workspace/opener-selection.js +93 -0
- package/dist/commands/workspace/operations.d.ts +28 -0
- package/dist/commands/workspace/operations.js +543 -0
- package/dist/commands/workspace/prompt-theme.d.ts +29 -0
- package/dist/commands/workspace/prompt-theme.js +24 -0
- package/dist/commands/workspace/registration.d.ts +13 -0
- package/dist/commands/workspace/registration.js +84 -0
- package/dist/commands/workspace/selection.d.ts +6 -0
- package/dist/commands/workspace/selection.js +122 -0
- package/dist/commands/workspace/types.d.ts +103 -0
- package/dist/commands/workspace/types.js +36 -0
- package/dist/commands/workspace.d.ts +6 -0
- package/dist/commands/workspace.js +678 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +318 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +183 -0
- package/dist/core/artifact-graph/instruction-loader.js +256 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/types.d.ts +40 -0
- package/dist/core/artifact-graph/types.js +29 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/schema.d.ts +18 -0
- package/dist/core/change-metadata/schema.js +28 -0
- package/dist/core/change-status-policy.d.ts +50 -0
- package/dist/core/change-status-policy.js +70 -0
- package/dist/core/collections/index.d.ts +3 -0
- package/dist/core/collections/index.js +3 -0
- package/dist/core/collections/initiatives/collection.d.ts +4 -0
- package/dist/core/collections/initiatives/collection.js +17 -0
- package/dist/core/collections/initiatives/index.d.ts +6 -0
- package/dist/core/collections/initiatives/index.js +6 -0
- package/dist/core/collections/initiatives/operations.d.ts +49 -0
- package/dist/core/collections/initiatives/operations.js +175 -0
- package/dist/core/collections/initiatives/resolution.d.ts +87 -0
- package/dist/core/collections/initiatives/resolution.js +374 -0
- package/dist/core/collections/initiatives/schema.d.ts +41 -0
- package/dist/core/collections/initiatives/schema.js +134 -0
- package/dist/core/collections/initiatives/templates.d.ts +12 -0
- package/dist/core/collections/initiatives/templates.js +90 -0
- package/dist/core/collections/runtime.d.ts +46 -0
- package/dist/core/collections/runtime.js +194 -0
- package/dist/core/command-generation/adapters/claude.d.ts +13 -0
- package/dist/core/command-generation/adapters/claude.js +50 -0
- package/dist/core/command-generation/adapters/codex.d.ts +16 -0
- package/dist/core/command-generation/adapters/codex.js +39 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.js +44 -0
- package/dist/core/command-generation/adapters/gemini.d.ts +13 -0
- package/dist/core/command-generation/adapters/gemini.js +26 -0
- package/dist/core/command-generation/adapters/github-copilot.d.ts +13 -0
- package/dist/core/command-generation/adapters/github-copilot.js +26 -0
- package/dist/core/command-generation/adapters/index.d.ts +11 -0
- package/dist/core/command-generation/adapters/index.js +11 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/registry.d.ts +35 -0
- package/dist/core/command-generation/registry.js +55 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/completions/command-registry.d.ts +3 -0
- package/dist/core/completions/command-registry.js +939 -0
- package/dist/core/completions/completion-provider.d.ts +71 -0
- package/dist/core/completions/completion-provider.js +129 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +35 -0
- package/dist/core/completions/generators/bash-generator.js +230 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +160 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +36 -0
- package/dist/core/completions/generators/powershell-generator.js +266 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +47 -0
- package/dist/core/completions/generators/zsh-generator.js +274 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +102 -0
- package/dist/core/completions/installers/powershell-installer.js +387 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +117 -0
- package/dist/core/completions/installers/zsh-installer.js +421 -0
- package/dist/core/completions/shared-flags.d.ts +12 -0
- package/dist/core/completions/shared-flags.js +28 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +30 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +45 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +34 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +45 -0
- package/dist/core/completions/types.d.ts +101 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +86 -0
- package/dist/core/config-schema.js +213 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.js +13 -0
- package/dist/core/context-store/binding.d.ts +53 -0
- package/dist/core/context-store/binding.js +197 -0
- package/dist/core/context-store/errors.d.ts +20 -0
- package/dist/core/context-store/errors.js +22 -0
- package/dist/core/context-store/foundation.d.ts +54 -0
- package/dist/core/context-store/foundation.js +318 -0
- package/dist/core/context-store/index.d.ts +6 -0
- package/dist/core/context-store/index.js +6 -0
- package/dist/core/context-store/operations.d.ts +62 -0
- package/dist/core/context-store/operations.js +352 -0
- package/dist/core/context-store/registry.d.ts +35 -0
- package/dist/core/context-store/registry.js +158 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +49 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +7 -0
- package/dist/core/init.d.ts +40 -0
- package/dist/core/init.js +676 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +489 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/openspec-migration.d.ts +71 -0
- package/dist/core/openspec-migration.js +320 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +197 -0
- package/dist/core/parsers/markdown-parser.d.ts +26 -0
- package/dist/core/parsers/markdown-parser.js +227 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/planning-home.d.ts +21 -0
- package/dist/core/planning-home.js +108 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +203 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +43 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/skill-generation.d.ts +49 -0
- package/dist/core/shared/skill-generation.js +102 -0
- package/dist/core/shared/tool-detection.d.ts +71 -0
- package/dist/core/shared/tool-detection.js +158 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +392 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/skill-templates.d.ts +21 -0
- package/dist/core/templates/skill-templates.js +21 -0
- package/dist/core/templates/types.d.ts +19 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/workflows/apply-change.d.ts +10 -0
- package/dist/core/templates/workflows/apply-change.js +287 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +227 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +492 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +234 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +755 -0
- package/dist/core/templates/workflows/feedback.d.ts +9 -0
- package/dist/core/templates/workflows/feedback.js +108 -0
- package/dist/core/templates/workflows/ff-change.d.ts +10 -0
- package/dist/core/templates/workflows/ff-change.js +200 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +143 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +607 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +347 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +290 -0
- package/dist/core/templates/workflows/trello-draft.d.ts +12 -0
- package/dist/core/templates/workflows/trello-draft.js +217 -0
- package/dist/core/templates/workflows/trello-setup.d.ts +12 -0
- package/dist/core/templates/workflows/trello-setup.js +315 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +338 -0
- package/dist/core/trello-config.d.ts +90 -0
- package/dist/core/trello-config.js +86 -0
- package/dist/core/trello-init-prompt.d.ts +61 -0
- package/dist/core/trello-init-prompt.js +180 -0
- package/dist/core/update.d.ts +82 -0
- package/dist/core/update.js +560 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +418 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/core/workspace/foundation.d.ts +62 -0
- package/dist/core/workspace/foundation.js +274 -0
- package/dist/core/workspace/index.d.ts +8 -0
- package/dist/core/workspace/index.js +8 -0
- package/dist/core/workspace/legacy-state.d.ts +28 -0
- package/dist/core/workspace/legacy-state.js +200 -0
- package/dist/core/workspace/link-input.d.ts +9 -0
- package/dist/core/workspace/link-input.js +32 -0
- package/dist/core/workspace/open-surface.d.ts +43 -0
- package/dist/core/workspace/open-surface.js +214 -0
- package/dist/core/workspace/openers.d.ts +21 -0
- package/dist/core/workspace/openers.js +119 -0
- package/dist/core/workspace/registry.d.ts +24 -0
- package/dist/core/workspace/registry.js +146 -0
- package/dist/core/workspace/skills.d.ts +57 -0
- package/dist/core/workspace/skills.js +334 -0
- package/dist/core/workspace/state-io.d.ts +10 -0
- package/dist/core/workspace/state-io.js +119 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.js +159 -0
- package/dist/telemetry/config.d.ts +38 -0
- package/dist/telemetry/config.js +136 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +164 -0
- package/dist/ui/ascii-patterns.d.ts +16 -0
- package/dist/ui/ascii-patterns.js +133 -0
- package/dist/ui/welcome-screen.d.ts +10 -0
- package/dist/ui/welcome-screen.js +146 -0
- package/dist/utils/change-metadata.d.ts +54 -0
- package/dist/utils/change-metadata.js +141 -0
- package/dist/utils/change-utils.d.ts +71 -0
- package/dist/utils/change-utils.js +123 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.js +301 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +84 -0
- package/schemas/spec-driven/schema.yaml +153 -0
- package/schemas/spec-driven/templates/design.md +19 -0
- package/schemas/spec-driven/templates/proposal.md +23 -0
- package/schemas/spec-driven/templates/spec.md +8 -0
- package/schemas/spec-driven/templates/tasks.md +9 -0
- package/schemas/workspace-planning/schema.yaml +72 -0
- package/schemas/workspace-planning/templates/design.md +33 -0
- package/schemas/workspace-planning/templates/proposal.md +28 -0
- package/schemas/workspace-planning/templates/spec.md +9 -0
- package/schemas/workspace-planning/templates/tasks.md +15 -0
- package/scripts/postinstall.js +83 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
export function getProposeSkillTemplate() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'pscode-propose',
|
|
4
|
+
description: 'Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.',
|
|
5
|
+
instructions: getProposeInstructions(),
|
|
6
|
+
license: 'MIT',
|
|
7
|
+
compatibility: 'Requires pscode CLI.',
|
|
8
|
+
metadata: { author: 'pscode', version: '1.0' },
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function getPsProposeCommandTemplate() {
|
|
12
|
+
return {
|
|
13
|
+
name: 'PS: Propose',
|
|
14
|
+
description: 'Propose a new change - create it and generate all artifacts in one step',
|
|
15
|
+
category: 'Workflow',
|
|
16
|
+
tags: ['workflow', 'artifacts', 'propose'],
|
|
17
|
+
content: getProposeInstructions(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getProposeInstructions() {
|
|
21
|
+
return `Propose a new change - create the change and generate all artifacts in one step.
|
|
22
|
+
|
|
23
|
+
I'll create a change with artifacts:
|
|
24
|
+
- proposal.md (what & why)
|
|
25
|
+
- design.md (how)
|
|
26
|
+
- tasks.md (implementation steps)
|
|
27
|
+
|
|
28
|
+
After artifacts are created, a **refinement validation loop** runs: the user reviews the plan, gives feedback, and when satisfied the Trello card is moved to Ready to Dev.
|
|
29
|
+
|
|
30
|
+
When ready to implement, run /ps:apply
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
|
|
35
|
+
|
|
36
|
+
**Steps**
|
|
37
|
+
|
|
38
|
+
1. **If no clear input provided, ask what they want to build**
|
|
39
|
+
|
|
40
|
+
Use the **AskUserQuestion tool** (open-ended, no preset options) to ask:
|
|
41
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
42
|
+
|
|
43
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → \`add-user-auth\`).
|
|
44
|
+
|
|
45
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
46
|
+
|
|
47
|
+
2. **Create the change directory**
|
|
48
|
+
\`\`\`bash
|
|
49
|
+
pscode new change "<name>"
|
|
50
|
+
\`\`\`
|
|
51
|
+
This creates a scaffolded change in the planning home resolved by the CLI with \`.pscode.yaml\`.
|
|
52
|
+
|
|
53
|
+
3. **Trello Integration (optional)**
|
|
54
|
+
|
|
55
|
+
Use the **Read tool** (NOT a shell command) to read \`pscode/trello.yaml\` from the current working directory.
|
|
56
|
+
The Read tool is cross-platform and works on Windows, macOS, and Linux — never use \`cat\` or shell commands to read this file.
|
|
57
|
+
If the Read tool returns an error (file not found), skip all Trello steps and continue to Step 4.
|
|
58
|
+
|
|
59
|
+
Otherwise, parse the YAML and extract \`boardId\`, \`lists.backlog\`, \`lists.refining\`, \`lists.ready\`, and \`labels\`.
|
|
60
|
+
|
|
61
|
+
**3a. Detect label (if labels enabled)**
|
|
62
|
+
|
|
63
|
+
If \`labels.enabled = true\` and \`labels.items\` is present, determine which label to apply based on the change description provided by the user.
|
|
64
|
+
Use these classification rules:
|
|
65
|
+
|
|
66
|
+
| Label | Quando usar |
|
|
67
|
+
|-----------------|------------------------------------------------------------------------------|
|
|
68
|
+
| 🐛 BUG | Menciona erro, falha, bug, quebrado, não funciona, comportamento incorreto |
|
|
69
|
+
| ⚙️ IMPLEMENTAÇÃO | Nova feature, adicionar, criar, implementar algo que não existe ainda |
|
|
70
|
+
| ✨ MELHORIA | Melhorar, otimizar, refinar, aprimorar, performance de algo que já existe |
|
|
71
|
+
| 💳 DÉBITO TÉCNICO | Refatorar, limpar, reorganizar, remover código legado, dívida técnica |
|
|
72
|
+
|
|
73
|
+
- If the change clearly matches one label (>80% confidence) → use it silently, without asking.
|
|
74
|
+
- If ambiguous → use **AskUserQuestion**:
|
|
75
|
+
> "Que tipo de change é essa?"
|
|
76
|
+
> - 🐛 BUG — Erro ou comportamento incorreto
|
|
77
|
+
> - ⚙️ IMPLEMENTAÇÃO — Nova funcionalidade
|
|
78
|
+
> - ✨ MELHORIA — Aperfeiçoamento de algo existente
|
|
79
|
+
> - 💳 DÉBITO TÉCNICO — Refatoração e limpeza de código
|
|
80
|
+
> - Sem label — Não categorizar
|
|
81
|
+
- Save as \`chosenLabel\` (or \`null\`). Only use label keys present in \`labels.items\`.
|
|
82
|
+
|
|
83
|
+
**3b. Sync Trello card:**
|
|
84
|
+
|
|
85
|
+
a. If \`lists.backlog\` is configured, search for an existing card by name (case-insensitive, partial match):
|
|
86
|
+
\`\`\`tool
|
|
87
|
+
mcp__claude_ai_Trello_Custom__get_cards { list_id: "<lists.backlog.id>" }
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
b. **If card found in backlog AND \`lists.refining\` is configured:**
|
|
91
|
+
Move it to the refining list:
|
|
92
|
+
\`\`\`tool
|
|
93
|
+
mcp__claude_ai_Trello_Custom__update_card { card_id: "<id>", list_id: "<lists.refining.id>" }
|
|
94
|
+
\`\`\`
|
|
95
|
+
Save \`cardId\`.
|
|
96
|
+
|
|
97
|
+
c. **If card found but no refining list configured:** keep card in backlog, save \`cardId\`.
|
|
98
|
+
|
|
99
|
+
d. **If no card found AND \`lists.refining\` is configured:**
|
|
100
|
+
Create a new card directly in the refining list:
|
|
101
|
+
\`\`\`tool
|
|
102
|
+
mcp__claude_ai_Trello_Custom__create_card
|
|
103
|
+
list_id: "<lists.refining.id>"
|
|
104
|
+
name: "<human-readable change name in Portuguese>"
|
|
105
|
+
desc: "Change iniciada via /ps:propose"
|
|
106
|
+
\`\`\`
|
|
107
|
+
Save \`cardId\`.
|
|
108
|
+
|
|
109
|
+
e. **If no card found and no refining list:** create in backlog. Save \`cardId\`.
|
|
110
|
+
|
|
111
|
+
f. **Apply label (if resolved):**
|
|
112
|
+
If \`chosenLabel\` is not null and \`cardId\` is saved:
|
|
113
|
+
\`\`\`tool
|
|
114
|
+
mcp__claude_ai_Trello_Custom__add_label_to_card
|
|
115
|
+
card_id: "<cardId>"
|
|
116
|
+
label_id: "<chosenLabel.id>"
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
g. **Assign the current user:**
|
|
120
|
+
\`\`\`tool
|
|
121
|
+
mcp__claude_ai_Trello_Custom__get_me
|
|
122
|
+
mcp__claude_ai_Trello_Custom__add_card_member { card_id: "<cardId>", member_id: "<me.id>" }
|
|
123
|
+
\`\`\`
|
|
124
|
+
|
|
125
|
+
If any Trello call fails, log the error and continue — Trello is auxiliary, never blocking.
|
|
126
|
+
|
|
127
|
+
4. **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
|
|
133
|
+
- \`artifacts\`: list of all artifacts with their status and dependencies
|
|
134
|
+
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context
|
|
135
|
+
|
|
136
|
+
5. **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:
|
|
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 — 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"\`
|
|
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
|
+
6. **Show final status**
|
|
169
|
+
\`\`\`bash
|
|
170
|
+
pscode status --change "<name>"
|
|
171
|
+
\`\`\`
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Refinement Validation Loop
|
|
176
|
+
|
|
177
|
+
After all artifacts are created, enter the **refinement validation loop**. This loop runs until the user approves the plan or explicitly cancels.
|
|
178
|
+
|
|
179
|
+
### Step R1 — Show Refinement Summary
|
|
180
|
+
|
|
181
|
+
Present the following structured summary to the user. Read \`proposal.md\`, \`design.md\`, and \`tasks.md\` from the change directory to extract the relevant information.
|
|
182
|
+
|
|
183
|
+
\`\`\`markdown
|
|
184
|
+
## 🔍 Refinamento da Proposta — <name>
|
|
185
|
+
|
|
186
|
+
**Objetivo:** <1-2 sentences summarizing what will be built, from proposal.md>
|
|
187
|
+
|
|
188
|
+
### O que será implementado
|
|
189
|
+
<3-5 bullet points extracted from design.md / tasks.md describing the main implementation steps>
|
|
190
|
+
|
|
191
|
+
### Escopo e decisões técnicas
|
|
192
|
+
<2-3 key technical decisions or constraints from design.md>
|
|
193
|
+
|
|
194
|
+
### Tarefas geradas
|
|
195
|
+
<numbered list of tasks from tasks.md (brief, one line each)>
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
Para iniciar a implementação quando aprovado:
|
|
199
|
+
\`\`\`
|
|
200
|
+
/ps:apply <name>
|
|
201
|
+
\`\`\`
|
|
202
|
+
\`\`\`
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### Step R2 — Ask for user approval
|
|
207
|
+
|
|
208
|
+
Use **AskUserQuestion** to ask:
|
|
209
|
+
|
|
210
|
+
> "A implementação e o planejamento estão de acordo com o esperado?"
|
|
211
|
+
|
|
212
|
+
Options:
|
|
213
|
+
- ✅ Sim, está refinada — mover para Ready to Dev
|
|
214
|
+
- 🔄 Não, quero ajustar o plano
|
|
215
|
+
- ❌ Cancelar (manter em refinamento)
|
|
216
|
+
|
|
217
|
+
**Do NOT update the Trello card description or add any comment before the user approves.**
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Step R2a — If APPROVED (Sim, está refinada)
|
|
222
|
+
|
|
223
|
+
1. **Update Trello card description** (if \`cardId\` exists):
|
|
224
|
+
Build the description from the artifacts already read in Step R1:
|
|
225
|
+
\`\`\`tool
|
|
226
|
+
mcp__claude_ai_Trello_Custom__update_card
|
|
227
|
+
card_id: "<cardId>"
|
|
228
|
+
desc: |
|
|
229
|
+
**Objetivo:** <summary from proposal.md>
|
|
230
|
+
|
|
231
|
+
**O que será implementado:**
|
|
232
|
+
<bullet list from design.md / tasks.md>
|
|
233
|
+
|
|
234
|
+
**Decisões técnicas:**
|
|
235
|
+
<key decisions from design.md>
|
|
236
|
+
|
|
237
|
+
**Artefatos:** pscode/changes/<name>/
|
|
238
|
+
\`\`\`
|
|
239
|
+
|
|
240
|
+
2. **Add a comment** in Portuguese (if \`cardId\` exists):
|
|
241
|
+
\`\`\`tool
|
|
242
|
+
mcp__claude_ai_Trello_Custom__add_comment
|
|
243
|
+
card_id: "<cardId>"
|
|
244
|
+
text: |
|
|
245
|
+
## Proposta refinada ✓
|
|
246
|
+
|
|
247
|
+
**Change:** \`<name>\`
|
|
248
|
+
**Artefatos gerados:** proposal.md · design.md · tasks.md
|
|
249
|
+
|
|
250
|
+
### Resumo
|
|
251
|
+
<2-3 line summary of what will be built>
|
|
252
|
+
|
|
253
|
+
### Para iniciar a implementação
|
|
254
|
+
\`\`\`
|
|
255
|
+
/ps:apply <name>
|
|
256
|
+
\`\`\`
|
|
257
|
+
|
|
258
|
+
_Aguardando aprovação para mover para Ready to Dev._
|
|
259
|
+
\`\`\`
|
|
260
|
+
|
|
261
|
+
3. **Move the Trello card to the ready list** (if \`lists.ready\` is configured and \`cardId\` exists):
|
|
262
|
+
\`\`\`tool
|
|
263
|
+
mcp__claude_ai_Trello_Custom__update_card
|
|
264
|
+
card_id: "<cardId>"
|
|
265
|
+
list_id: "<lists.ready.id>"
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
4. **Add a final Trello comment** (if cardId exists):
|
|
269
|
+
\`\`\`tool
|
|
270
|
+
mcp__claude_ai_Trello_Custom__add_comment
|
|
271
|
+
card_id: "<cardId>"
|
|
272
|
+
text: |
|
|
273
|
+
## ✅ Aprovado para Ready to Dev
|
|
274
|
+
|
|
275
|
+
O planejamento foi revisado e aprovado.
|
|
276
|
+
|
|
277
|
+
### Próximo passo
|
|
278
|
+
\`\`\`
|
|
279
|
+
/ps:apply <name>
|
|
280
|
+
\`\`\`
|
|
281
|
+
\`\`\`
|
|
282
|
+
|
|
283
|
+
5. **Show success message:**
|
|
284
|
+
\`\`\`markdown
|
|
285
|
+
## ✅ Pronto para desenvolvimento!
|
|
286
|
+
|
|
287
|
+
**Change:** <name>
|
|
288
|
+
**Card movido para:** <lists.ready.name>
|
|
289
|
+
|
|
290
|
+
Quando quiser iniciar a implementação:
|
|
291
|
+
\`\`\`
|
|
292
|
+
/ps:apply <name>
|
|
293
|
+
\`\`\`
|
|
294
|
+
\`\`\`
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### Step R2b — If NOT APPROVED (Quero ajustar o plano)
|
|
299
|
+
|
|
300
|
+
1. **Ask what needs to change** using **AskUserQuestion**:
|
|
301
|
+
> "O que você gostaria de ajustar no plano? Descreva as mudanças necessárias."
|
|
302
|
+
|
|
303
|
+
2. **Apply the requested changes** to the relevant artifacts:
|
|
304
|
+
- Changes to scope or requirements → update \`proposal.md\`
|
|
305
|
+
- Changes to technical approach → update \`design.md\`
|
|
306
|
+
- Changes to tasks → update \`tasks.md\`
|
|
307
|
+
|
|
308
|
+
3. **Go back to Step R1** and show the updated refinement summary.
|
|
309
|
+
Keep looping until the user approves or cancels.
|
|
310
|
+
**Do NOT update the Trello description or add comments until the user approves.**
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
### Step R2c — If CANCELLED
|
|
315
|
+
|
|
316
|
+
Show:
|
|
317
|
+
\`\`\`markdown
|
|
318
|
+
## ⏸ Refinamento pausado
|
|
319
|
+
|
|
320
|
+
O card permanece em **<current list name>**.
|
|
321
|
+
Retome o refinamento quando quiser com \`/ps:explore <name>\`.
|
|
322
|
+
\`\`\`
|
|
323
|
+
|
|
324
|
+
Do NOT move the card. Stop the loop.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
**Artifact Creation Guidelines**
|
|
329
|
+
|
|
330
|
+
- Follow the \`instruction\` field from \`pscode instructions\` for each artifact type
|
|
331
|
+
- Read dependency artifacts for context before creating new ones
|
|
332
|
+
- Use \`template\` as the structure — fill in its sections
|
|
333
|
+
- **IMPORTANT**: \`context\` and \`rules\` are constraints for YOU, not content for the file
|
|
334
|
+
|
|
335
|
+
**Guardrails**
|
|
336
|
+
- Create ALL artifacts needed for implementation (as defined by schema's \`apply.requires\`)
|
|
337
|
+
- Always read dependency artifacts before creating a new one
|
|
338
|
+
- If context is critically unclear, ask the user — but prefer reasonable decisions to keep momentum
|
|
339
|
+
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
|
340
|
+
- Verify each artifact file exists after writing before proceeding to next
|
|
341
|
+
- If Trello tools fail, continue normally — Trello is auxiliary, not blocking
|
|
342
|
+
- All content written to Trello must be in Portuguese
|
|
343
|
+
- **The refinement loop is mandatory** — never skip it even if the user didn't mention Trello; the approval question must always be asked
|
|
344
|
+
- **Preserve the loop** — do not exit until the user explicitly approves (moves to Ready to Dev) or cancels
|
|
345
|
+
`;
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=propose.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
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 getSyncSpecsSkillTemplate(): SkillTemplate;
|
|
9
|
+
export declare function getPsSyncCommandTemplate(): CommandTemplate;
|
|
10
|
+
//# sourceMappingURL=sync-specs.d.ts.map
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
export function getSyncSpecsSkillTemplate() {
|
|
2
|
+
return {
|
|
3
|
+
name: 'pscode-sync-specs',
|
|
4
|
+
description: 'Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.',
|
|
5
|
+
instructions: `Sync delta specs from a change to main specs.
|
|
6
|
+
|
|
7
|
+
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
|
8
|
+
|
|
9
|
+
**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.
|
|
10
|
+
|
|
11
|
+
**Steps**
|
|
12
|
+
|
|
13
|
+
1. **If no change name provided, prompt for selection**
|
|
14
|
+
|
|
15
|
+
Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
16
|
+
|
|
17
|
+
Show changes that have delta specs (under \`specs/\` directory).
|
|
18
|
+
|
|
19
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
20
|
+
|
|
21
|
+
2. **Resolve change context**
|
|
22
|
+
|
|
23
|
+
Run:
|
|
24
|
+
\`\`\`bash
|
|
25
|
+
pscode status --change "<name>" --json
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
|
|
29
|
+
|
|
30
|
+
3. **Find delta specs**
|
|
31
|
+
|
|
32
|
+
Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
|
|
33
|
+
|
|
34
|
+
Each delta spec file contains sections like:
|
|
35
|
+
- \`## ADDED Requirements\` - New requirements to add
|
|
36
|
+
- \`## MODIFIED Requirements\` - Changes to existing requirements
|
|
37
|
+
- \`## REMOVED Requirements\` - Requirements to remove
|
|
38
|
+
- \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
|
|
39
|
+
|
|
40
|
+
If no delta specs found, inform user and stop.
|
|
41
|
+
|
|
42
|
+
4. **For each delta spec, apply changes to main specs**
|
|
43
|
+
|
|
44
|
+
For each repo-local capability delta spec path returned by the CLI:
|
|
45
|
+
|
|
46
|
+
a. **Read the delta spec** to understand the intended changes
|
|
47
|
+
|
|
48
|
+
b. **Read the main spec** at \`pscode/specs/<capability>/spec.md\` (may not exist yet)
|
|
49
|
+
|
|
50
|
+
c. **Apply changes intelligently**:
|
|
51
|
+
|
|
52
|
+
**ADDED Requirements:**
|
|
53
|
+
- If requirement doesn't exist in main spec → add it
|
|
54
|
+
- If requirement already exists → update it to match (treat as implicit MODIFIED)
|
|
55
|
+
|
|
56
|
+
**MODIFIED Requirements:**
|
|
57
|
+
- Find the requirement in main spec
|
|
58
|
+
- Apply the changes - this can be:
|
|
59
|
+
- Adding new scenarios (don't need to copy existing ones)
|
|
60
|
+
- Modifying existing scenarios
|
|
61
|
+
- Changing the requirement description
|
|
62
|
+
- Preserve scenarios/content not mentioned in the delta
|
|
63
|
+
|
|
64
|
+
**REMOVED Requirements:**
|
|
65
|
+
- Remove the entire requirement block from main spec
|
|
66
|
+
|
|
67
|
+
**RENAMED Requirements:**
|
|
68
|
+
- Find the FROM requirement, rename to TO
|
|
69
|
+
|
|
70
|
+
d. **Create new main spec** if capability doesn't exist yet:
|
|
71
|
+
- Create \`pscode/specs/<capability>/spec.md\`
|
|
72
|
+
- Add Purpose section (can be brief, mark as TBD)
|
|
73
|
+
- Add Requirements section with the ADDED requirements
|
|
74
|
+
|
|
75
|
+
5. **Show summary**
|
|
76
|
+
|
|
77
|
+
After applying all changes, summarize:
|
|
78
|
+
- Which capabilities were updated
|
|
79
|
+
- What changes were made (requirements added/modified/removed/renamed)
|
|
80
|
+
|
|
81
|
+
**Delta Spec Format Reference**
|
|
82
|
+
|
|
83
|
+
\`\`\`markdown
|
|
84
|
+
## ADDED Requirements
|
|
85
|
+
|
|
86
|
+
### Requirement: New Feature
|
|
87
|
+
The system SHALL do something new.
|
|
88
|
+
|
|
89
|
+
#### Scenario: Basic case
|
|
90
|
+
- **WHEN** user does X
|
|
91
|
+
- **THEN** system does Y
|
|
92
|
+
|
|
93
|
+
## MODIFIED Requirements
|
|
94
|
+
|
|
95
|
+
### Requirement: Existing Feature
|
|
96
|
+
#### Scenario: New scenario to add
|
|
97
|
+
- **WHEN** user does A
|
|
98
|
+
- **THEN** system does B
|
|
99
|
+
|
|
100
|
+
## REMOVED Requirements
|
|
101
|
+
|
|
102
|
+
### Requirement: Deprecated Feature
|
|
103
|
+
|
|
104
|
+
## RENAMED Requirements
|
|
105
|
+
|
|
106
|
+
- FROM: \`### Requirement: Old Name\`
|
|
107
|
+
- TO: \`### Requirement: New Name\`
|
|
108
|
+
\`\`\`
|
|
109
|
+
|
|
110
|
+
**Key Principle: Intelligent Merging**
|
|
111
|
+
|
|
112
|
+
Unlike programmatic merging, you can apply **partial updates**:
|
|
113
|
+
- To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
|
|
114
|
+
- The delta represents *intent*, not a wholesale replacement
|
|
115
|
+
- Use your judgment to merge changes sensibly
|
|
116
|
+
|
|
117
|
+
**Output On Success**
|
|
118
|
+
|
|
119
|
+
\`\`\`
|
|
120
|
+
## Specs Synced: <change-name>
|
|
121
|
+
|
|
122
|
+
Updated main specs:
|
|
123
|
+
|
|
124
|
+
**<capability-1>**:
|
|
125
|
+
- Added requirement: "New Feature"
|
|
126
|
+
- Modified requirement: "Existing Feature" (added 1 scenario)
|
|
127
|
+
|
|
128
|
+
**<capability-2>**:
|
|
129
|
+
- Created new spec file
|
|
130
|
+
- Added requirement: "Another Feature"
|
|
131
|
+
|
|
132
|
+
Main specs are now updated. The change remains active - archive when implementation is complete.
|
|
133
|
+
\`\`\`
|
|
134
|
+
|
|
135
|
+
**Guardrails**
|
|
136
|
+
- Read both delta and main specs before making changes
|
|
137
|
+
- Preserve existing content not mentioned in delta
|
|
138
|
+
- If something is unclear, ask for clarification
|
|
139
|
+
- Show what you're changing as you go
|
|
140
|
+
- The operation should be idempotent - running twice should give same result`,
|
|
141
|
+
license: 'MIT',
|
|
142
|
+
compatibility: 'Requires pscode CLI.',
|
|
143
|
+
metadata: { author: 'pscode', version: '1.0' },
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export function getPsSyncCommandTemplate() {
|
|
147
|
+
return {
|
|
148
|
+
name: 'PS: Sync',
|
|
149
|
+
description: 'Sync delta specs from a change to main specs',
|
|
150
|
+
category: 'Workflow',
|
|
151
|
+
tags: ['workflow', 'specs', 'experimental'],
|
|
152
|
+
content: `Sync delta specs from a change to main specs.
|
|
153
|
+
|
|
154
|
+
This is an **agent-driven** operation - you will read delta specs and directly edit main specs to apply the changes. This allows intelligent merging (e.g., adding a scenario without copying the entire requirement).
|
|
155
|
+
|
|
156
|
+
**Input**: Optionally specify a change name after \`/ps:sync\` (e.g., \`/ps:sync add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
157
|
+
|
|
158
|
+
**Steps**
|
|
159
|
+
|
|
160
|
+
1. **If no change name provided, prompt for selection**
|
|
161
|
+
|
|
162
|
+
Run \`pscode list --json\` to get available changes. Use the **AskUserQuestion tool** to let the user select.
|
|
163
|
+
|
|
164
|
+
Show changes that have delta specs (under \`specs/\` directory).
|
|
165
|
+
|
|
166
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
167
|
+
|
|
168
|
+
2. **Resolve change context**
|
|
169
|
+
|
|
170
|
+
Run:
|
|
171
|
+
\`\`\`bash
|
|
172
|
+
pscode status --change "<name>" --json
|
|
173
|
+
\`\`\`
|
|
174
|
+
|
|
175
|
+
If status reports \`actionContext.mode: "workspace-planning"\`, explain that workspace spec sync is not supported in this slice and STOP. Do not fall back to repo-local paths or edit linked repos.
|
|
176
|
+
|
|
177
|
+
3. **Find delta specs**
|
|
178
|
+
|
|
179
|
+
Use \`artifactPaths.specs.existingOutputPaths\` from the status JSON as the list of delta spec files.
|
|
180
|
+
|
|
181
|
+
Each delta spec file contains sections like:
|
|
182
|
+
- \`## ADDED Requirements\` - New requirements to add
|
|
183
|
+
- \`## MODIFIED Requirements\` - Changes to existing requirements
|
|
184
|
+
- \`## REMOVED Requirements\` - Requirements to remove
|
|
185
|
+
- \`## RENAMED Requirements\` - Requirements to rename (FROM:/TO: format)
|
|
186
|
+
|
|
187
|
+
If no delta specs found, inform user and stop.
|
|
188
|
+
|
|
189
|
+
4. **For each delta spec, apply changes to main specs**
|
|
190
|
+
|
|
191
|
+
For each repo-local capability delta spec path returned by the CLI:
|
|
192
|
+
|
|
193
|
+
a. **Read the delta spec** to understand the intended changes
|
|
194
|
+
|
|
195
|
+
b. **Read the main spec** at \`pscode/specs/<capability>/spec.md\` (may not exist yet)
|
|
196
|
+
|
|
197
|
+
c. **Apply changes intelligently**:
|
|
198
|
+
|
|
199
|
+
**ADDED Requirements:**
|
|
200
|
+
- If requirement doesn't exist in main spec → add it
|
|
201
|
+
- If requirement already exists → update it to match (treat as implicit MODIFIED)
|
|
202
|
+
|
|
203
|
+
**MODIFIED Requirements:**
|
|
204
|
+
- Find the requirement in main spec
|
|
205
|
+
- Apply the changes - this can be:
|
|
206
|
+
- Adding new scenarios (don't need to copy existing ones)
|
|
207
|
+
- Modifying existing scenarios
|
|
208
|
+
- Changing the requirement description
|
|
209
|
+
- Preserve scenarios/content not mentioned in the delta
|
|
210
|
+
|
|
211
|
+
**REMOVED Requirements:**
|
|
212
|
+
- Remove the entire requirement block from main spec
|
|
213
|
+
|
|
214
|
+
**RENAMED Requirements:**
|
|
215
|
+
- Find the FROM requirement, rename to TO
|
|
216
|
+
|
|
217
|
+
d. **Create new main spec** if capability doesn't exist yet:
|
|
218
|
+
- Create \`pscode/specs/<capability>/spec.md\`
|
|
219
|
+
- Add Purpose section (can be brief, mark as TBD)
|
|
220
|
+
- Add Requirements section with the ADDED requirements
|
|
221
|
+
|
|
222
|
+
5. **Show summary**
|
|
223
|
+
|
|
224
|
+
After applying all changes, summarize:
|
|
225
|
+
- Which capabilities were updated
|
|
226
|
+
- What changes were made (requirements added/modified/removed/renamed)
|
|
227
|
+
|
|
228
|
+
**Delta Spec Format Reference**
|
|
229
|
+
|
|
230
|
+
\`\`\`markdown
|
|
231
|
+
## ADDED Requirements
|
|
232
|
+
|
|
233
|
+
### Requirement: New Feature
|
|
234
|
+
The system SHALL do something new.
|
|
235
|
+
|
|
236
|
+
#### Scenario: Basic case
|
|
237
|
+
- **WHEN** user does X
|
|
238
|
+
- **THEN** system does Y
|
|
239
|
+
|
|
240
|
+
## MODIFIED Requirements
|
|
241
|
+
|
|
242
|
+
### Requirement: Existing Feature
|
|
243
|
+
#### Scenario: New scenario to add
|
|
244
|
+
- **WHEN** user does A
|
|
245
|
+
- **THEN** system does B
|
|
246
|
+
|
|
247
|
+
## REMOVED Requirements
|
|
248
|
+
|
|
249
|
+
### Requirement: Deprecated Feature
|
|
250
|
+
|
|
251
|
+
## RENAMED Requirements
|
|
252
|
+
|
|
253
|
+
- FROM: \`### Requirement: Old Name\`
|
|
254
|
+
- TO: \`### Requirement: New Name\`
|
|
255
|
+
\`\`\`
|
|
256
|
+
|
|
257
|
+
**Key Principle: Intelligent Merging**
|
|
258
|
+
|
|
259
|
+
Unlike programmatic merging, you can apply **partial updates**:
|
|
260
|
+
- To add a scenario, just include that scenario under MODIFIED - don't copy existing scenarios
|
|
261
|
+
- The delta represents *intent*, not a wholesale replacement
|
|
262
|
+
- Use your judgment to merge changes sensibly
|
|
263
|
+
|
|
264
|
+
**Output On Success**
|
|
265
|
+
|
|
266
|
+
\`\`\`
|
|
267
|
+
## Specs Synced: <change-name>
|
|
268
|
+
|
|
269
|
+
Updated main specs:
|
|
270
|
+
|
|
271
|
+
**<capability-1>**:
|
|
272
|
+
- Added requirement: "New Feature"
|
|
273
|
+
- Modified requirement: "Existing Feature" (added 1 scenario)
|
|
274
|
+
|
|
275
|
+
**<capability-2>**:
|
|
276
|
+
- Created new spec file
|
|
277
|
+
- Added requirement: "Another Feature"
|
|
278
|
+
|
|
279
|
+
Main specs are now updated. The change remains active - archive when implementation is complete.
|
|
280
|
+
\`\`\`
|
|
281
|
+
|
|
282
|
+
**Guardrails**
|
|
283
|
+
- Read both delta and main specs before making changes
|
|
284
|
+
- Preserve existing content not mentioned in delta
|
|
285
|
+
- If something is unclear, ask for clarification
|
|
286
|
+
- Show what you're changing as you go
|
|
287
|
+
- The operation should be idempotent - running twice should give same result`
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=sync-specs.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trello Draft Skill / Command Template
|
|
3
|
+
*
|
|
4
|
+
* Quickly captures an idea, insight, or rough concept into the Backlog
|
|
5
|
+
* Trello list. No refinement required — this is for raw thoughts.
|
|
6
|
+
*
|
|
7
|
+
* Requires `pscode/trello.yaml` to be present (created by /ps:trello-setup).
|
|
8
|
+
*/
|
|
9
|
+
import type { SkillTemplate, CommandTemplate } from '../types.js';
|
|
10
|
+
export declare function getTrelloDraftSkillTemplate(): SkillTemplate;
|
|
11
|
+
export declare function getTrelloDraftCommandTemplate(): CommandTemplate;
|
|
12
|
+
//# sourceMappingURL=trello-draft.d.ts.map
|