@seanmars/tospec 0.4.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.
- package/LICENSE +21 -0
- package/README.md +114 -0
- package/assets/dashboard/app.js +1032 -0
- package/assets/dashboard/chart.umd.js +14 -0
- package/assets/dashboard/index.html +30 -0
- package/assets/dashboard/style.css +675 -0
- package/bin/tospec.js +5 -0
- package/dist/cli/index.d.ts +5 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +330 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +486 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/dashboard.d.ts +40 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +385 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/shared-output.d.ts +24 -0
- package/dist/commands/shared-output.d.ts.map +1 -0
- package/dist/commands/shared-output.js +51 -0
- package/dist/commands/shared-output.js.map +1 -0
- package/dist/commands/show.d.ts +17 -0
- package/dist/commands/show.d.ts.map +1 -0
- package/dist/commands/show.js +164 -0
- package/dist/commands/show.js.map +1 -0
- package/dist/commands/validate.d.ts +51 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +416 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.d.ts.map +1 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/index.js.map +1 -0
- package/dist/commands/workflow/instructions.d.ts +35 -0
- package/dist/commands/workflow/instructions.d.ts.map +1 -0
- package/dist/commands/workflow/instructions.js +359 -0
- package/dist/commands/workflow/instructions.js.map +1 -0
- package/dist/commands/workflow/new-change.d.ts +17 -0
- package/dist/commands/workflow/new-change.d.ts.map +1 -0
- package/dist/commands/workflow/new-change.js +97 -0
- package/dist/commands/workflow/new-change.js.map +1 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.d.ts.map +1 -0
- package/dist/commands/workflow/schemas.js +33 -0
- package/dist/commands/workflow/schemas.js.map +1 -0
- package/dist/commands/workflow/shared.d.ts +63 -0
- package/dist/commands/workflow/shared.d.ts.map +1 -0
- package/dist/commands/workflow/shared.js +111 -0
- package/dist/commands/workflow/shared.js.map +1 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.d.ts.map +1 -0
- package/dist/commands/workflow/status.js +77 -0
- package/dist/commands/workflow/status.js.map +1 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.d.ts.map +1 -0
- package/dist/commands/workflow/templates.js +60 -0
- package/dist/commands/workflow/templates.js.map +1 -0
- package/dist/core/archive.d.ts +33 -0
- package/dist/core/archive.d.ts.map +1 -0
- package/dist/core/archive.js +585 -0
- package/dist/core/archive.js.map +1 -0
- package/dist/core/artifact-graph/graph.d.ts +56 -0
- package/dist/core/artifact-graph/graph.d.ts.map +1 -0
- package/dist/core/artifact-graph/graph.js +141 -0
- package/dist/core/artifact-graph/graph.js.map +1 -0
- package/dist/core/artifact-graph/index.d.ts +9 -0
- package/dist/core/artifact-graph/index.d.ts.map +1 -0
- package/dist/core/artifact-graph/index.js +14 -0
- package/dist/core/artifact-graph/index.js.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +188 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts.map +1 -0
- package/dist/core/artifact-graph/instruction-loader.js +243 -0
- package/dist/core/artifact-graph/instruction-loader.js.map +1 -0
- package/dist/core/artifact-graph/outputs.d.ts +14 -0
- package/dist/core/artifact-graph/outputs.d.ts.map +1 -0
- package/dist/core/artifact-graph/outputs.js +39 -0
- package/dist/core/artifact-graph/outputs.js.map +1 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -0
- package/dist/core/artifact-graph/resolver.js +257 -0
- package/dist/core/artifact-graph/resolver.js.map +1 -0
- package/dist/core/artifact-graph/schema.d.ts +13 -0
- package/dist/core/artifact-graph/schema.d.ts.map +1 -0
- package/dist/core/artifact-graph/schema.js +108 -0
- package/dist/core/artifact-graph/schema.js.map +1 -0
- package/dist/core/artifact-graph/state.d.ts +12 -0
- package/dist/core/artifact-graph/state.d.ts.map +1 -0
- package/dist/core/artifact-graph/state.js +31 -0
- package/dist/core/artifact-graph/state.js.map +1 -0
- package/dist/core/artifact-graph/types.d.ts +55 -0
- package/dist/core/artifact-graph/types.d.ts.map +1 -0
- package/dist/core/artifact-graph/types.js +38 -0
- package/dist/core/artifact-graph/types.js.map +1 -0
- package/dist/core/available-tools.d.ts +17 -0
- package/dist/core/available-tools.d.ts.map +1 -0
- package/dist/core/available-tools.js +43 -0
- package/dist/core/available-tools.js.map +1 -0
- package/dist/core/change-metadata/index.d.ts +2 -0
- package/dist/core/change-metadata/index.d.ts.map +1 -0
- package/dist/core/change-metadata/index.js +2 -0
- package/dist/core/change-metadata/index.js.map +1 -0
- package/dist/core/change-metadata/schema.d.ts +12 -0
- package/dist/core/change-metadata/schema.d.ts.map +1 -0
- package/dist/core/change-metadata/schema.js +15 -0
- package/dist/core/change-metadata/schema.js.map +1 -0
- package/dist/core/change-presenter.d.ts +24 -0
- package/dist/core/change-presenter.d.ts.map +1 -0
- package/dist/core/change-presenter.js +135 -0
- package/dist/core/change-presenter.js.map +1 -0
- package/dist/core/change-status-policy.d.ts +35 -0
- package/dist/core/change-status-policy.d.ts.map +1 -0
- package/dist/core/change-status-policy.js +34 -0
- package/dist/core/change-status-policy.js.map +1 -0
- package/dist/core/command-generation/adapters/claude.d.ts +14 -0
- package/dist/core/command-generation/adapters/claude.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/claude.js +38 -0
- package/dist/core/command-generation/adapters/claude.js.map +1 -0
- package/dist/core/command-generation/adapters/cursor.d.ts +14 -0
- package/dist/core/command-generation/adapters/cursor.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/cursor.js +31 -0
- package/dist/core/command-generation/adapters/cursor.js.map +1 -0
- package/dist/core/command-generation/adapters/index.d.ts +8 -0
- package/dist/core/command-generation/adapters/index.d.ts.map +1 -0
- package/dist/core/command-generation/adapters/index.js +8 -0
- package/dist/core/command-generation/adapters/index.js.map +1 -0
- package/dist/core/command-generation/generator.d.ts +21 -0
- package/dist/core/command-generation/generator.d.ts.map +1 -0
- package/dist/core/command-generation/generator.js +27 -0
- package/dist/core/command-generation/generator.js.map +1 -0
- package/dist/core/command-generation/index.d.ts +22 -0
- package/dist/core/command-generation/index.d.ts.map +1 -0
- package/dist/core/command-generation/index.js +24 -0
- package/dist/core/command-generation/index.js.map +1 -0
- package/dist/core/command-generation/registry.d.ts +24 -0
- package/dist/core/command-generation/registry.d.ts.map +1 -0
- package/dist/core/command-generation/registry.js +38 -0
- package/dist/core/command-generation/registry.js.map +1 -0
- package/dist/core/command-generation/types.d.ts +56 -0
- package/dist/core/command-generation/types.d.ts.map +1 -0
- package/dist/core/command-generation/types.js +8 -0
- package/dist/core/command-generation/types.js.map +1 -0
- package/dist/core/command-generation/yaml.d.ts +22 -0
- package/dist/core/command-generation/yaml.d.ts.map +1 -0
- package/dist/core/command-generation/yaml.js +38 -0
- package/dist/core/command-generation/yaml.js.map +1 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.d.ts.map +1 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-prompts.js.map +1 -0
- package/dist/core/config-schema.d.ts +87 -0
- package/dist/core/config-schema.d.ts.map +1 -0
- package/dist/core/config-schema.js +239 -0
- package/dist/core/config-schema.js.map +1 -0
- package/dist/core/config.d.ts +19 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +14 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.d.ts.map +1 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/converters/json-converter.js.map +1 -0
- package/dist/core/dashboard-activity.d.ts +50 -0
- package/dist/core/dashboard-activity.d.ts.map +1 -0
- package/dist/core/dashboard-activity.js +147 -0
- package/dist/core/dashboard-activity.js.map +1 -0
- package/dist/core/dashboard-data.d.ts +100 -0
- package/dist/core/dashboard-data.d.ts.map +1 -0
- package/dist/core/dashboard-data.js +368 -0
- package/dist/core/dashboard-data.js.map +1 -0
- package/dist/core/global-config.d.ts +51 -0
- package/dist/core/global-config.d.ts.map +1 -0
- package/dist/core/global-config.js +124 -0
- package/dist/core/global-config.js.map +1 -0
- package/dist/core/id.d.ts +17 -0
- package/dist/core/id.d.ts.map +1 -0
- package/dist/core/id.js +30 -0
- package/dist/core/id.js.map +1 -0
- package/dist/core/init.d.ts +34 -0
- package/dist/core/init.d.ts.map +1 -0
- package/dist/core/init.js +495 -0
- package/dist/core/init.js.map +1 -0
- package/dist/core/list.d.ts +12 -0
- package/dist/core/list.d.ts.map +1 -0
- package/dist/core/list.js +192 -0
- package/dist/core/list.js.map +1 -0
- package/dist/core/migrate.d.ts +52 -0
- package/dist/core/migrate.d.ts.map +1 -0
- package/dist/core/migrate.js +300 -0
- package/dist/core/migrate.js.map +1 -0
- package/dist/core/parsers/change-parser.d.ts +19 -0
- package/dist/core/parsers/change-parser.d.ts.map +1 -0
- package/dist/core/parsers/change-parser.js +204 -0
- package/dist/core/parsers/change-parser.js.map +1 -0
- package/dist/core/parsers/markdown-parser.d.ts +29 -0
- package/dist/core/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/core/parsers/markdown-parser.js +181 -0
- package/dist/core/parsers/markdown-parser.js.map +1 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.d.ts.map +1 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/parsers/requirement-blocks.js.map +1 -0
- package/dist/core/parsers/requirement-text.d.ts +55 -0
- package/dist/core/parsers/requirement-text.d.ts.map +1 -0
- package/dist/core/parsers/requirement-text.js +136 -0
- package/dist/core/parsers/requirement-text.js.map +1 -0
- package/dist/core/parsers/spec-structure.d.ts +9 -0
- package/dist/core/parsers/spec-structure.d.ts.map +1 -0
- package/dist/core/parsers/spec-structure.js +88 -0
- package/dist/core/parsers/spec-structure.js.map +1 -0
- package/dist/core/planning-home.d.ts +16 -0
- package/dist/core/planning-home.d.ts.map +1 -0
- package/dist/core/planning-home.js +67 -0
- package/dist/core/planning-home.js.map +1 -0
- package/dist/core/profiles.d.ts +24 -0
- package/dist/core/profiles.d.ts.map +1 -0
- package/dist/core/profiles.js +27 -0
- package/dist/core/profiles.js.map +1 -0
- package/dist/core/project-config.d.ts +100 -0
- package/dist/core/project-config.d.ts.map +1 -0
- package/dist/core/project-config.js +389 -0
- package/dist/core/project-config.js.map +1 -0
- package/dist/core/references.d.ts +40 -0
- package/dist/core/references.d.ts.map +1 -0
- package/dist/core/references.js +11 -0
- package/dist/core/references.js.map +1 -0
- package/dist/core/root-selection.d.ts +57 -0
- package/dist/core/root-selection.d.ts.map +1 -0
- package/dist/core/root-selection.js +98 -0
- package/dist/core/root-selection.js.map +1 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.d.ts.map +1 -0
- package/dist/core/schemas/base.schema.js +18 -0
- package/dist/core/schemas/base.schema.js.map +1 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.d.ts.map +1 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/change.schema.js.map +1 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.d.ts.map +1 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/schemas/spec.schema.js.map +1 -0
- package/dist/core/shared/index.d.ts +8 -0
- package/dist/core/shared/index.d.ts.map +1 -0
- package/dist/core/shared/index.js +8 -0
- package/dist/core/shared/index.js.map +1 -0
- package/dist/core/shared/skill-generation.d.ts +63 -0
- package/dist/core/shared/skill-generation.d.ts.map +1 -0
- package/dist/core/shared/skill-generation.js +125 -0
- package/dist/core/shared/skill-generation.js.map +1 -0
- package/dist/core/shared/tool-detection.d.ts +96 -0
- package/dist/core/shared/tool-detection.d.ts.map +1 -0
- package/dist/core/shared/tool-detection.js +207 -0
- package/dist/core/shared/tool-detection.js.map +1 -0
- package/dist/core/spec-presenter.d.ts +17 -0
- package/dist/core/spec-presenter.d.ts.map +1 -0
- package/dist/core/spec-presenter.js +98 -0
- package/dist/core/spec-presenter.js.map +1 -0
- package/dist/core/specs-apply.d.ts +78 -0
- package/dist/core/specs-apply.d.ts.map +1 -0
- package/dist/core/specs-apply.js +429 -0
- package/dist/core/specs-apply.js.map +1 -0
- package/dist/core/templates/index.d.ts +8 -0
- package/dist/core/templates/index.d.ts.map +1 -0
- package/dist/core/templates/index.js +9 -0
- package/dist/core/templates/index.js.map +1 -0
- package/dist/core/templates/skill-templates.d.ts +14 -0
- package/dist/core/templates/skill-templates.d.ts.map +1 -0
- package/dist/core/templates/skill-templates.js +13 -0
- package/dist/core/templates/skill-templates.js.map +1 -0
- package/dist/core/templates/types.d.ts +20 -0
- package/dist/core/templates/types.d.ts.map +1 -0
- package/dist/core/templates/types.js +5 -0
- package/dist/core/templates/types.js.map +1 -0
- package/dist/core/templates/workflows/apply.d.ts +10 -0
- package/dist/core/templates/workflows/apply.d.ts.map +1 -0
- package/dist/core/templates/workflows/apply.js +81 -0
- package/dist/core/templates/workflows/apply.js.map +1 -0
- package/dist/core/templates/workflows/archive.d.ts +10 -0
- package/dist/core/templates/workflows/archive.d.ts.map +1 -0
- package/dist/core/templates/workflows/archive.js +75 -0
- package/dist/core/templates/workflows/archive.js.map +1 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.d.ts.map +1 -0
- package/dist/core/templates/workflows/explore.js +75 -0
- package/dist/core/templates/workflows/explore.js.map +1 -0
- package/dist/core/templates/workflows/issue.d.ts +10 -0
- package/dist/core/templates/workflows/issue.d.ts.map +1 -0
- package/dist/core/templates/workflows/issue.js +89 -0
- package/dist/core/templates/workflows/issue.js.map +1 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.d.ts.map +1 -0
- package/dist/core/templates/workflows/propose.js +77 -0
- package/dist/core/templates/workflows/propose.js.map +1 -0
- package/dist/core/templates/workflows/sync.d.ts +14 -0
- package/dist/core/templates/workflows/sync.d.ts.map +1 -0
- package/dist/core/templates/workflows/sync.js +86 -0
- package/dist/core/templates/workflows/sync.js.map +1 -0
- package/dist/core/templates/workflows/update.d.ts +10 -0
- package/dist/core/templates/workflows/update.d.ts.map +1 -0
- package/dist/core/templates/workflows/update.js +99 -0
- package/dist/core/templates/workflows/update.js.map +1 -0
- package/dist/core/templates/workflows/verify.d.ts +9 -0
- package/dist/core/templates/workflows/verify.d.ts.map +1 -0
- package/dist/core/templates/workflows/verify.js +44 -0
- package/dist/core/templates/workflows/verify.js.map +1 -0
- package/dist/core/update.d.ts +46 -0
- package/dist/core/update.d.ts.map +1 -0
- package/dist/core/update.js +296 -0
- package/dist/core/update.js.map +1 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.d.ts.map +1 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/constants.js.map +1 -0
- package/dist/core/validation/section-validator.d.ts +19 -0
- package/dist/core/validation/section-validator.d.ts.map +1 -0
- package/dist/core/validation/section-validator.js +59 -0
- package/dist/core/validation/section-validator.js.map +1 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.d.ts.map +1 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/types.js.map +1 -0
- package/dist/core/validation/validator.d.ts +51 -0
- package/dist/core/validation/validator.d.ts.map +1 -0
- package/dist/core/validation/validator.js +469 -0
- package/dist/core/validation/validator.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/searchable-multi-select.d.ts +28 -0
- package/dist/prompts/searchable-multi-select.d.ts.map +1 -0
- package/dist/prompts/searchable-multi-select.js +158 -0
- package/dist/prompts/searchable-multi-select.js.map +1 -0
- package/dist/ui/welcome-screen.d.ts +5 -0
- package/dist/ui/welcome-screen.d.ts.map +1 -0
- package/dist/ui/welcome-screen.js +22 -0
- package/dist/ui/welcome-screen.js.map +1 -0
- package/dist/utils/change-metadata.d.ts +55 -0
- package/dist/utils/change-metadata.d.ts.map +1 -0
- package/dist/utils/change-metadata.js +141 -0
- package/dist/utils/change-metadata.js.map +1 -0
- package/dist/utils/change-utils.d.ts +73 -0
- package/dist/utils/change-utils.d.ts.map +1 -0
- package/dist/utils/change-utils.js +194 -0
- package/dist/utils/change-utils.js.map +1 -0
- package/dist/utils/command-references.d.ts +18 -0
- package/dist/utils/command-references.d.ts.map +1 -0
- package/dist/utils/command-references.js +20 -0
- package/dist/utils/command-references.js.map +1 -0
- package/dist/utils/file-system.d.ts +41 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +320 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.d.ts.map +1 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/interactive.js.map +1 -0
- package/dist/utils/item-discovery.d.ts +14 -0
- package/dist/utils/item-discovery.d.ts.map +1 -0
- package/dist/utils/item-discovery.js +104 -0
- package/dist/utils/item-discovery.js.map +1 -0
- package/dist/utils/link.d.ts +22 -0
- package/dist/utils/link.d.ts.map +1 -0
- package/dist/utils/link.js +85 -0
- package/dist/utils/link.js.map +1 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.d.ts.map +1 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/match.js.map +1 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.d.ts.map +1 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/shell-detection.js.map +1 -0
- package/dist/utils/task-progress.d.ts +32 -0
- package/dist/utils/task-progress.d.ts.map +1 -0
- package/dist/utils/task-progress.js +129 -0
- package/dist/utils/task-progress.js.map +1 -0
- package/dist/utils/timestamp.d.ts +9 -0
- package/dist/utils/timestamp.d.ts.map +1 -0
- package/dist/utils/timestamp.js +18 -0
- package/dist/utils/timestamp.js.map +1 -0
- package/package.json +55 -0
- package/schemas/issue/schema.yaml +34 -0
- package/schemas/issue/templates/spec.md +13 -0
- package/schemas/issue/templates/task.md +21 -0
- package/schemas/issue/templates/ticket.md +2 -0
- package/schemas/sdd/schema.yaml +55 -0
- package/schemas/sdd/templates/design.md +15 -0
- package/schemas/sdd/templates/proposal.md +15 -0
- package/schemas/sdd/templates/spec.md +13 -0
- package/schemas/sdd/templates/tasks.md +11 -0
- package/schemas/sdd/templates/ticket.md +2 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const UPDATE_BODY = `Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
|
2
|
+
|
|
3
|
+
**Steps**
|
|
4
|
+
|
|
5
|
+
1. **If no change name provided, prompt for selection**
|
|
6
|
+
|
|
7
|
+
Run \`tospec list --json\` to get available changes sorted by most recently modified. Then use the **AskUserQuestion tool** to let the user select which change to update.
|
|
8
|
+
|
|
9
|
+
Present the top 3-4 most recently modified changes as options, showing:
|
|
10
|
+
- Change name
|
|
11
|
+
- Status (e.g., "0/5 tasks", "complete", "no tasks" from \`completedTasks\`/\`totalTasks\`/\`status\`)
|
|
12
|
+
- How recently it was modified (from \`lastModified\`)
|
|
13
|
+
|
|
14
|
+
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
|
|
15
|
+
|
|
16
|
+
**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.
|
|
17
|
+
|
|
18
|
+
2. **Get the change's artifacts**
|
|
19
|
+
\`\`\`bash
|
|
20
|
+
tospec status --change "<name>" --json
|
|
21
|
+
\`\`\`
|
|
22
|
+
Parse the JSON to understand current state. The response includes:
|
|
23
|
+
- \`schemaName\`: The workflow schema being used (e.g., "sdd")
|
|
24
|
+
- \`artifacts\`: Array of artifacts with their status ("done", "ready", "blocked", "skipped")
|
|
25
|
+
- \`isComplete\`: Boolean indicating if all required artifacts are complete
|
|
26
|
+
- \`planningHome\`, \`changeRoot\`, \`artifactPaths\`, and \`actionContext\`: path and scope context. Use these instead of assuming repo-local paths.
|
|
27
|
+
|
|
28
|
+
The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
|
|
29
|
+
|
|
30
|
+
The files to edit are \`artifactPaths.<id>.existingOutputPaths\` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. \`specs/**/*.md\`). Do NOT write to \`resolvedOutputPath\`: for a glob artifact it is still the glob pattern, not a real file.
|
|
31
|
+
|
|
32
|
+
3. **Understand the request**
|
|
33
|
+
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
|
34
|
+
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
|
|
35
|
+
|
|
36
|
+
4. **Read and reconcile**
|
|
37
|
+
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
|
38
|
+
- Apply the requested edit. Then check every other existing artifact against it - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
|
|
39
|
+
- Note everything that is now inconsistent, missing, or contradictory.
|
|
40
|
+
- Revise only files that already exist (\`existingOutputPaths\`). Do NOT create artifacts that don't exist yet, and do NOT invent new files under a glob artifact - note them and point the user to \`tospec-propose\` (sdd) or \`tospec-issue\` to create them.
|
|
41
|
+
- If the change is already coherent, say so and make no edits.
|
|
42
|
+
|
|
43
|
+
5. **Confirm and apply, one artifact at a time**
|
|
44
|
+
- Show each proposed revision and why. Write only after the user confirms.
|
|
45
|
+
- If the user rejects a revision, do not write it - leave that artifact unchanged.
|
|
46
|
+
- When a substantial rewrite is needed, get that artifact's rules and template first:
|
|
47
|
+
\`\`\`bash
|
|
48
|
+
tospec instructions <artifact-id> --change "<name>" --json
|
|
49
|
+
\`\`\`
|
|
50
|
+
Read \`rules\` and \`template\` from the response.
|
|
51
|
+
|
|
52
|
+
6. **Point to the next step (guidance only - NEVER act on it)**
|
|
53
|
+
- Artifacts still missing -> suggest \`tospec-propose\` (sdd) or \`tospec-issue\` to create them.
|
|
54
|
+
- Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest \`tospec-apply\` to carry the delta into code.
|
|
55
|
+
- Everything done and implemented -> suggest \`tospec-archive\`.
|
|
56
|
+
|
|
57
|
+
**Output**
|
|
58
|
+
|
|
59
|
+
After each invocation, show:
|
|
60
|
+
- Which artifacts were revised (and which proposed revisions were rejected)
|
|
61
|
+
- Anything deferred to artifact creation (not-yet-created artifacts or files -> \`tospec-propose\`/\`tospec-issue\`)
|
|
62
|
+
- Where the change stands and the recommended next command
|
|
63
|
+
|
|
64
|
+
**Guardrails**
|
|
65
|
+
- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to \`tospec-apply\`.
|
|
66
|
+
- Use the artifact ids and paths reported by \`tospec status\`; never branch on hardcoded artifact names.
|
|
67
|
+
- Edit only the concrete files in \`existingOutputPaths\`; never write to a glob \`resolvedOutputPath\`.
|
|
68
|
+
- Do not advance the build frontier: no new artifacts, no new files under glob artifacts - that is \`tospec-propose\`/\`tospec-issue\`'s job.
|
|
69
|
+
- Confirm every edit with the user before writing.
|
|
70
|
+
- If the request changes the change's *intent* rather than refining it, recommend starting fresh with \`tospec-propose\`/\`tospec-issue\` (the "Update vs. Start Fresh" heuristic).`;
|
|
71
|
+
export function getTospecUpdateSkillTemplate() {
|
|
72
|
+
return {
|
|
73
|
+
name: 'tospec-update',
|
|
74
|
+
description: "Update a change by revising its existing planning artifacts and keeping them coherent with one another. Use when the user wants to revise a change's plan, fold new decisions into it, or reconcile its artifacts after an edit. Never edits code.",
|
|
75
|
+
instructions: `Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
|
76
|
+
|
|
77
|
+
**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.
|
|
78
|
+
|
|
79
|
+
${UPDATE_BODY}`,
|
|
80
|
+
license: 'MIT',
|
|
81
|
+
compatibility: 'Requires tospec CLI.',
|
|
82
|
+
metadata: { author: 'tospec', version: '1.0' },
|
|
83
|
+
allowedTools: ['Bash(tospec:*)', 'Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob'],
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export function getTospecUpdateCommandTemplate() {
|
|
87
|
+
return {
|
|
88
|
+
name: 'TOSPEC: Update',
|
|
89
|
+
description: 'Update a change - revise existing planning artifacts and keep them coherent (Experimental)',
|
|
90
|
+
category: 'Workflow',
|
|
91
|
+
tags: ['workflow', 'artifacts', 'experimental'],
|
|
92
|
+
content: `Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
|
93
|
+
|
|
94
|
+
**Input**: Optionally specify a change name after \`tospec-update\` (e.g., \`tospec-update add-auth\`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
95
|
+
|
|
96
|
+
${UPDATE_BODY}`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/update.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oLAqEgK,CAAC;AAErL,MAAM,UAAU,4BAA4B;IAC1C,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oPAAoP;QACjQ,YAAY,EAAE;;;;EAIhB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,sBAAsB;QACrC,QAAQ,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAC9C,YAAY,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;KAClF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,4FAA4F;QACzG,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,cAAc,CAAC;QAC/C,OAAO,EAAE;;;;EAIX,WAAW,EAAE;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verify methodology (embedded into apply's final step).
|
|
3
|
+
*
|
|
4
|
+
* verify is no longer a standalone skill/command — it runs automatically at
|
|
5
|
+
* the end of `tospec-apply`. This module exports the methodology text so
|
|
6
|
+
* `apply.ts` can inline it; there is no skill/command template here anymore.
|
|
7
|
+
*/
|
|
8
|
+
export declare const VERIFY_METHODOLOGY = "Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings \u2014 a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.\n\n**Steps**\n\n1. **Gather context**\n ```bash\n tospec status --change \"<name>\" --json\n ```\n Note `schemaName` (sdd \u2192 compare against `specs/`; issue \u2192 compare against `task.md`) and the files this change touched (from `tasks.md`/`task.md`, or `git diff` against the commit before the change started).\n\n2. **Spawn both axes in parallel** \u2014 a single message with two `Agent` tool calls, both `general-purpose`:\n\n **Standards axis prompt** \u2014 include the diff and the brief: \"Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) \u2014 name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces.\"\n\n **Spec axis prompt** \u2014 include the diff plus, for sdd, the relevant `specs/<capability>/spec.md` delta content (`tospec show \"<name>\" --json`) and `design.md`'s decisions; for issue, `task.md`'s root cause and fix plan. Brief: \"Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding.\"\n\n3. **Run the full test suite.** This is a hard gate alongside both axes \u2014 a change with green axes but red tests isn't verified.\n\n4. **Re-validate artifacts**\n ```bash\n tospec validate \"<name>\" --json\n ```\n If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.\n\n5. **Aggregate \u2014 do not merge or rerank**\n\n Present the two reports under `## Standards` and `## Spec` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.\n\n**Verify output**\n\nReport the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified \u2014 tell the user it's ready for `tospec-archive`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply) and re-run this verify step until it's clean.\n\n**Verify guardrails**\n- Standards and Spec axes are independent \u2014 never let one axis's findings influence the other's report\n- Full test suite must be green; a clean review with red tests is not verified\n- Quote the specific spec/task line or hunk for every finding \u2014 no unsupported claims";
|
|
9
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,kBAAkB,goGAmCuD,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Verify methodology (embedded into apply's final step).
|
|
3
|
+
*
|
|
4
|
+
* verify is no longer a standalone skill/command — it runs automatically at
|
|
5
|
+
* the end of `tospec-apply`. This module exports the methodology text so
|
|
6
|
+
* `apply.ts` can inline it; there is no skill/command template here anymore.
|
|
7
|
+
*/
|
|
8
|
+
export const VERIFY_METHODOLOGY = `Two-axis review of the implementation, run as **independent parallel subagents** so neither pollutes or reranks the other's findings — a change can pass one axis and fail the other, and reporting them separately is what keeps that visible.
|
|
9
|
+
|
|
10
|
+
**Steps**
|
|
11
|
+
|
|
12
|
+
1. **Gather context**
|
|
13
|
+
\`\`\`bash
|
|
14
|
+
tospec status --change "<name>" --json
|
|
15
|
+
\`\`\`
|
|
16
|
+
Note \`schemaName\` (sdd → compare against \`specs/\`; issue → compare against \`task.md\`) and the files this change touched (from \`tasks.md\`/\`task.md\`, or \`git diff\` against the commit before the change started).
|
|
17
|
+
|
|
18
|
+
2. **Spawn both axes in parallel** — a single message with two \`Agent\` tool calls, both \`general-purpose\`:
|
|
19
|
+
|
|
20
|
+
**Standards axis prompt** — include the diff and the brief: "Report every place the diff violates this repo's documented conventions (cite the file/rule), plus any of Fowler's code smells you spot (Mysterious Name, Duplicated Code, Feature Envy, Data Clumps, Primitive Obsession, Repeated Switches, Shotgun Surgery, Divergent Change, Speculative Generality, Message Chains, Middle Man, Refused Bequest) — name the smell, quote the hunk, and treat documented repo conventions as overriding the baseline. Distinguish hard violations from judgement calls. Skip anything tooling already enforces."
|
|
21
|
+
|
|
22
|
+
**Spec axis prompt** — include the diff plus, for sdd, the relevant \`specs/<capability>/spec.md\` delta content (\`tospec show "<name>" --json\`) and \`design.md\`'s decisions; for issue, \`task.md\`'s root cause and fix plan. Brief: "Report (a) requirements/task items that are missing or partially implemented; (b) behavior in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but the implementation looks wrong, or that deviate from design.md's stated decisions. Quote the spec/task line for each finding."
|
|
23
|
+
|
|
24
|
+
3. **Run the full test suite.** This is a hard gate alongside both axes — a change with green axes but red tests isn't verified.
|
|
25
|
+
|
|
26
|
+
4. **Re-validate artifacts**
|
|
27
|
+
\`\`\`bash
|
|
28
|
+
tospec validate "<name>" --json
|
|
29
|
+
\`\`\`
|
|
30
|
+
If validation reports an artifact-format or structural problem, fix that artifact and re-run the command until it passes. A review is not complete while artifact validation is red.
|
|
31
|
+
|
|
32
|
+
5. **Aggregate — do not merge or rerank**
|
|
33
|
+
|
|
34
|
+
Present the two reports under \`## Standards\` and \`## Spec\` headings. End with one line per axis: total findings and the worst issue within that axis. Do not pick a single overall verdict across axes.
|
|
35
|
+
|
|
36
|
+
**Verify output**
|
|
37
|
+
|
|
38
|
+
Report the two-axis result plus test suite status. If both axes are clean and tests are green, the change is verified — tell the user it's ready for \`tospec-archive\`. If either axis has a blocking finding or tests are red, do **not** treat apply as done: fix the issue here (this is still apply) and re-run this verify step until it's clean.
|
|
39
|
+
|
|
40
|
+
**Verify guardrails**
|
|
41
|
+
- Standards and Spec axes are independent — never let one axis's findings influence the other's report
|
|
42
|
+
- Full test suite must be green; a clean review with red tests is not verified
|
|
43
|
+
- Quote the specific spec/task line or hunk for every finding — no unsupported claims`;
|
|
44
|
+
//# sourceMappingURL=verify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../../../src/core/templates/workflows/verify.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sFAmCoD,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Command
|
|
3
|
+
*
|
|
4
|
+
* Refreshes Tospec skills for configured tools.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Options for the update command.
|
|
8
|
+
*/
|
|
9
|
+
export interface UpdateCommandOptions {
|
|
10
|
+
/** Force update even when tools are up to date */
|
|
11
|
+
force?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class UpdateCommand {
|
|
14
|
+
private readonly force;
|
|
15
|
+
constructor(options?: UpdateCommandOptions);
|
|
16
|
+
execute(projectPath: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Display message when all tools are up to date.
|
|
19
|
+
*/
|
|
20
|
+
private displayUpToDateMessage;
|
|
21
|
+
/**
|
|
22
|
+
* Display the update plan showing which tools need updating.
|
|
23
|
+
*/
|
|
24
|
+
private displayUpdatePlan;
|
|
25
|
+
/**
|
|
26
|
+
* Detects new tool directories that aren't currently configured and displays a hint.
|
|
27
|
+
*/
|
|
28
|
+
private detectNewTools;
|
|
29
|
+
/**
|
|
30
|
+
* Suggest opting back into core when a custom profile still matches the old
|
|
31
|
+
* four-workflow core set. Keep custom profiles user-owned; do not mutate them.
|
|
32
|
+
*/
|
|
33
|
+
private displayOldCoreCustomProfileNote;
|
|
34
|
+
/**
|
|
35
|
+
* Removes skill directories for workflows when delivery changed to commands-only.
|
|
36
|
+
* Returns the number of directories removed.
|
|
37
|
+
*/
|
|
38
|
+
private removeSkillDirs;
|
|
39
|
+
/**
|
|
40
|
+
* Removes skill directories for workflows that are no longer selected in the
|
|
41
|
+
* active profile, from a tool's `skills/` dir (dirs named `tospec-<workflow>`).
|
|
42
|
+
* Returns the number of directories removed.
|
|
43
|
+
*/
|
|
44
|
+
private removeUnselectedSkillDirs;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoCH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;gBAEpB,OAAO,GAAE,oBAAyB;IAIxC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+KjD;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAQ9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;;OAGG;IACH,OAAO,CAAC,+BAA+B;IAkBvC;;;OAGG;YACW,eAAe;IAqB7B;;;;OAIG;YACW,yBAAyB;CA0BxC"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Command
|
|
3
|
+
*
|
|
4
|
+
* Refreshes Tospec skills for configured tools.
|
|
5
|
+
*/
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import * as fs from 'fs';
|
|
8
|
+
import { createRequire } from 'module';
|
|
9
|
+
import { FileSystemUtils } from '../utils/file-system.js';
|
|
10
|
+
import { AI_TOOLS, HARD_LINK_TOOLS, TOSPEC_DIR_NAME } from './config.js';
|
|
11
|
+
import { getToolVersionStatus, getSkillTemplates, generateSkillContent, getConfiguredTools, removeLegacySkillDirs, removeLegacyToolSkillLayout, writeToolCommands, } from './shared/index.js';
|
|
12
|
+
import { getGlobalConfig } from './global-config.js';
|
|
13
|
+
import { getProfileWorkflows, ALL_WORKFLOWS } from './profiles.js';
|
|
14
|
+
import { getAvailableTools } from './available-tools.js';
|
|
15
|
+
import { ensureHardLinkedDir, copyDir } from '../utils/link.js';
|
|
16
|
+
import { writeAgentsLinkMode } from './project-config.js';
|
|
17
|
+
const require = createRequire(import.meta.url);
|
|
18
|
+
const { version: TOSPEC_VERSION } = require('../../package.json');
|
|
19
|
+
const OLD_CORE_WORKFLOWS = ['propose', 'explore', 'apply', 'archive'];
|
|
20
|
+
const WORKFLOW_TO_SKILL_DIR = Object.fromEntries(getSkillTemplates().map(({ workflowId, dirName }) => [workflowId, dirName]));
|
|
21
|
+
function getConfiguredProjectTools(projectPath) {
|
|
22
|
+
return getConfiguredTools(projectPath);
|
|
23
|
+
}
|
|
24
|
+
export class UpdateCommand {
|
|
25
|
+
force;
|
|
26
|
+
constructor(options = {}) {
|
|
27
|
+
this.force = options.force ?? false;
|
|
28
|
+
}
|
|
29
|
+
async execute(projectPath) {
|
|
30
|
+
const resolvedProjectPath = path.resolve(projectPath);
|
|
31
|
+
const tospecPath = path.join(resolvedProjectPath, TOSPEC_DIR_NAME);
|
|
32
|
+
// 1. Check tospec directory exists
|
|
33
|
+
if (!await FileSystemUtils.directoryExists(tospecPath)) {
|
|
34
|
+
throw new Error(`No Tospec directory found. Run 'tospec init' first.`);
|
|
35
|
+
}
|
|
36
|
+
// 3. Read global config for profile/delivery
|
|
37
|
+
const globalConfig = getGlobalConfig();
|
|
38
|
+
const profile = globalConfig.profile ?? 'core';
|
|
39
|
+
const profileWorkflows = getProfileWorkflows(profile, globalConfig.workflows);
|
|
40
|
+
const desiredWorkflows = profileWorkflows.filter((workflow) => ALL_WORKFLOWS.includes(workflow));
|
|
41
|
+
// 5. Find configured tools
|
|
42
|
+
const configuredTools = getConfiguredProjectTools(resolvedProjectPath);
|
|
43
|
+
if (configuredTools.length === 0) {
|
|
44
|
+
console.log('No configured tools found.');
|
|
45
|
+
console.log('Run "tospec init" to set up tools.');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
// 6. Check version status for all configured tools
|
|
49
|
+
const toolStatuses = configuredTools.map((toolId) => {
|
|
50
|
+
const status = getToolVersionStatus(resolvedProjectPath, toolId, TOSPEC_VERSION);
|
|
51
|
+
return status;
|
|
52
|
+
});
|
|
53
|
+
const statusByTool = new Map(toolStatuses.map((status) => [status.toolId, status]));
|
|
54
|
+
// 7. Smart update detection
|
|
55
|
+
const toolsNeedingVersionUpdate = toolStatuses
|
|
56
|
+
.filter((s) => s.needsUpdate)
|
|
57
|
+
.map((s) => s.toolId);
|
|
58
|
+
const toolsNeedingConfigSync = [];
|
|
59
|
+
const toolsToUpdateSet = new Set([
|
|
60
|
+
...toolsNeedingVersionUpdate,
|
|
61
|
+
...toolsNeedingConfigSync,
|
|
62
|
+
]);
|
|
63
|
+
const toolsUpToDate = toolStatuses.filter((s) => !toolsToUpdateSet.has(s.toolId));
|
|
64
|
+
if (!this.force && toolsToUpdateSet.size === 0) {
|
|
65
|
+
// The generated version is current, but update is also the repair path
|
|
66
|
+
// for canonical .agents content and broken/stale links. Continue through
|
|
67
|
+
// generation instead of returning early.
|
|
68
|
+
console.log(`All ${configuredTools.length} configured tool(s) are version-current; refreshing generated skills and hard links.`);
|
|
69
|
+
this.detectNewTools(resolvedProjectPath, configuredTools);
|
|
70
|
+
this.displayOldCoreCustomProfileNote(profile, globalConfig.workflows);
|
|
71
|
+
}
|
|
72
|
+
// 8. Display update plan
|
|
73
|
+
if (this.force) {
|
|
74
|
+
console.log(`Force updating ${configuredTools.length} tool(s): ${configuredTools.join(', ')}`);
|
|
75
|
+
}
|
|
76
|
+
else if (toolsToUpdateSet.size > 0) {
|
|
77
|
+
this.displayUpdatePlan([...toolsToUpdateSet], statusByTool, toolsUpToDate);
|
|
78
|
+
}
|
|
79
|
+
console.log();
|
|
80
|
+
// 9. Determine what to generate based on delivery
|
|
81
|
+
const skillTemplates = getSkillTemplates(desiredWorkflows);
|
|
82
|
+
// 9b. Refresh canonical .agents/ content — the single source of truth
|
|
83
|
+
// every tool links into (or is regenerated from, for non-linkable
|
|
84
|
+
// formats). Always rewritten on update, same as init.
|
|
85
|
+
const agentsSkillsDir = path.join(resolvedProjectPath, '.agents', 'skills');
|
|
86
|
+
for (const { template, dirName } of skillTemplates) {
|
|
87
|
+
const skillContent = generateSkillContent(template, TOSPEC_VERSION);
|
|
88
|
+
await FileSystemUtils.writeFile(path.join(agentsSkillsDir, dirName, 'SKILL.md'), skillContent);
|
|
89
|
+
}
|
|
90
|
+
await removeLegacySkillDirs(agentsSkillsDir);
|
|
91
|
+
await fs.promises.rm(path.join(resolvedProjectPath, '.agents', 'commands'), { recursive: true, force: true });
|
|
92
|
+
await fs.promises.rm(path.join(resolvedProjectPath, '.cursor', 'commands'), { recursive: true, force: true });
|
|
93
|
+
// Drop the old `.claude/commands/tospec` namespace (replaced by tosx);
|
|
94
|
+
// `.claude/commands/tosx` is refreshed per-tool by writeToolCommands below.
|
|
95
|
+
await fs.promises.rm(path.join(resolvedProjectPath, '.claude', 'commands', 'tospec'), { recursive: true, force: true });
|
|
96
|
+
// Deselected workflows (custom profile) must be cleaned up canonically too —
|
|
97
|
+
// per-tool cleanup below only removes that tool's link/file, which would
|
|
98
|
+
// otherwise leave a stale, unlinked-from entry behind in .agents/ forever.
|
|
99
|
+
{
|
|
100
|
+
const desiredSet = new Set(desiredWorkflows);
|
|
101
|
+
for (const workflow of ALL_WORKFLOWS) {
|
|
102
|
+
if (desiredSet.has(workflow))
|
|
103
|
+
continue;
|
|
104
|
+
const dirName = WORKFLOW_TO_SKILL_DIR[workflow];
|
|
105
|
+
if (dirName) {
|
|
106
|
+
await fs.promises.rm(path.join(agentsSkillsDir, dirName), { recursive: true, force: true });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// 10. Update tools (all if force, otherwise only those needing update)
|
|
111
|
+
const toolsToUpdate = (this.force || toolsToUpdateSet.size === 0)
|
|
112
|
+
? configuredTools
|
|
113
|
+
: [...toolsToUpdateSet];
|
|
114
|
+
const updatedTools = [];
|
|
115
|
+
const failedTools = [];
|
|
116
|
+
let removedDeselectedSkillCount = 0;
|
|
117
|
+
for (const toolId of toolsToUpdate) {
|
|
118
|
+
const tool = AI_TOOLS.find((t) => t.value === toolId);
|
|
119
|
+
if (!tool?.skillsDir)
|
|
120
|
+
continue;
|
|
121
|
+
console.log(`Updating ${tool.name}...`);
|
|
122
|
+
try {
|
|
123
|
+
const skillsDir = path.join(resolvedProjectPath, tool.skillsDir, 'skills');
|
|
124
|
+
await removeLegacyToolSkillLayout(path.join(resolvedProjectPath, tool.skillsDir));
|
|
125
|
+
await removeLegacySkillDirs(skillsDir);
|
|
126
|
+
// Link (or copy) each skill dir from .agents/skills/ into the tool's
|
|
127
|
+
// standard `skills/` dir, flat and prefixed
|
|
128
|
+
// (`<tool>/skills/tospec-<workflow>/`) since project-scope skills can't
|
|
129
|
+
// be nested. Only tools in HARD_LINK_TOOLS get hard links; the rest
|
|
130
|
+
// (e.g. codex) land as a copy.
|
|
131
|
+
const useHardLink = HARD_LINK_TOOLS.includes(tool.value);
|
|
132
|
+
let skillsMode = useHardLink ? 'hardlink' : 'copy';
|
|
133
|
+
for (const { dirName } of skillTemplates) {
|
|
134
|
+
const src = path.join(agentsSkillsDir, dirName);
|
|
135
|
+
const dest = path.join(skillsDir, dirName);
|
|
136
|
+
if (useHardLink) {
|
|
137
|
+
const mode = await ensureHardLinkedDir(src, dest);
|
|
138
|
+
if (mode === 'copy')
|
|
139
|
+
skillsMode = 'copy';
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
await copyDir(src, dest);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
writeAgentsLinkMode(resolvedProjectPath, tool.value, { skills: skillsMode });
|
|
146
|
+
removedDeselectedSkillCount += await this.removeUnselectedSkillDirs(skillsDir, desiredWorkflows);
|
|
147
|
+
// Refresh slash commands for tools with an adapter (Claude Code):
|
|
148
|
+
// `.claude/commands/tosx/<id>.md`, invocable as `/tosx:<id>`.
|
|
149
|
+
await writeToolCommands(resolvedProjectPath, tool.value, desiredWorkflows);
|
|
150
|
+
console.log(`Updated ${tool.name}`);
|
|
151
|
+
updatedTools.push(tool.name);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.log(`Failed to update ${tool.name}`);
|
|
155
|
+
failedTools.push({
|
|
156
|
+
name: tool.name,
|
|
157
|
+
error: error instanceof Error ? error.message : String(error)
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// 11. Summary
|
|
162
|
+
console.log();
|
|
163
|
+
if (updatedTools.length > 0) {
|
|
164
|
+
console.log(`Updated: ${updatedTools.join(', ')} (v${TOSPEC_VERSION})`);
|
|
165
|
+
}
|
|
166
|
+
if (failedTools.length > 0) {
|
|
167
|
+
console.log(`Failed: ${failedTools.map(f => `${f.name} (${f.error})`).join(', ')}`);
|
|
168
|
+
}
|
|
169
|
+
if (removedDeselectedSkillCount > 0) {
|
|
170
|
+
console.log(`Removed: ${removedDeselectedSkillCount} skill directories (deselected workflows)`);
|
|
171
|
+
}
|
|
172
|
+
// 13. Detect new tool directories not currently configured
|
|
173
|
+
this.detectNewTools(resolvedProjectPath, configuredTools);
|
|
174
|
+
// 14. Display note about extra workflows not in profile
|
|
175
|
+
this.displayOldCoreCustomProfileNote(profile, globalConfig.workflows);
|
|
176
|
+
// 15. List affected tools
|
|
177
|
+
if (updatedTools.length > 0) {
|
|
178
|
+
const toolDisplayNames = updatedTools;
|
|
179
|
+
console.log(`Tools: ${toolDisplayNames.join(', ')}`);
|
|
180
|
+
}
|
|
181
|
+
console.log();
|
|
182
|
+
console.log('Restart your agent for skills to take effect.');
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Display message when all tools are up to date.
|
|
186
|
+
*/
|
|
187
|
+
displayUpToDateMessage(toolStatuses) {
|
|
188
|
+
const toolNames = toolStatuses.map((s) => s.toolId);
|
|
189
|
+
console.log(`All ${toolStatuses.length} tool(s) up to date (v${TOSPEC_VERSION})`);
|
|
190
|
+
console.log(` Tools: ${toolNames.join(', ')}`);
|
|
191
|
+
console.log();
|
|
192
|
+
console.log('Use --force to refresh files anyway.');
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Display the update plan showing which tools need updating.
|
|
196
|
+
*/
|
|
197
|
+
displayUpdatePlan(toolsToUpdate, statusByTool, upToDate) {
|
|
198
|
+
const updates = toolsToUpdate.map((toolId) => {
|
|
199
|
+
const status = statusByTool.get(toolId);
|
|
200
|
+
if (status?.needsUpdate) {
|
|
201
|
+
const fromVersion = status.generatedByVersion ?? 'unknown';
|
|
202
|
+
return `${status.toolId} (${fromVersion} → ${TOSPEC_VERSION})`;
|
|
203
|
+
}
|
|
204
|
+
return `${toolId} (config sync)`;
|
|
205
|
+
});
|
|
206
|
+
console.log(`Updating ${toolsToUpdate.length} tool(s): ${updates.join(', ')}`);
|
|
207
|
+
if (upToDate.length > 0) {
|
|
208
|
+
const upToDateNames = upToDate.map((s) => s.toolId);
|
|
209
|
+
console.log(`Already up to date: ${upToDateNames.join(', ')}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Detects new tool directories that aren't currently configured and displays a hint.
|
|
214
|
+
*/
|
|
215
|
+
detectNewTools(projectPath, configuredTools) {
|
|
216
|
+
const availableTools = getAvailableTools(projectPath);
|
|
217
|
+
const configuredSet = new Set(configuredTools);
|
|
218
|
+
const newTools = availableTools.filter((t) => !configuredSet.has(t.value));
|
|
219
|
+
if (newTools.length > 0) {
|
|
220
|
+
const newToolNames = newTools.map((tool) => tool.name);
|
|
221
|
+
const isSingleTool = newToolNames.length === 1;
|
|
222
|
+
const toolNoun = isSingleTool ? 'tool' : 'tools';
|
|
223
|
+
const pronoun = isSingleTool ? 'it' : 'them';
|
|
224
|
+
console.log();
|
|
225
|
+
console.log(`Detected new ${toolNoun}: ${newToolNames.join(', ')}. Run 'tospec init' to add ${pronoun}.`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Suggest opting back into core when a custom profile still matches the old
|
|
230
|
+
* four-workflow core set. Keep custom profiles user-owned; do not mutate them.
|
|
231
|
+
*/
|
|
232
|
+
displayOldCoreCustomProfileNote(profile, workflows) {
|
|
233
|
+
if (profile !== 'custom' || !workflows) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const workflowSet = new Set(workflows);
|
|
237
|
+
const matchesOldCore = workflowSet.size === OLD_CORE_WORKFLOWS.length &&
|
|
238
|
+
OLD_CORE_WORKFLOWS.every((workflow) => workflowSet.has(workflow));
|
|
239
|
+
if (!matchesOldCore) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
console.log('Note: The core profile now includes issue and update. Your custom profile is preserving the old core workflow set.');
|
|
243
|
+
console.log('Run `tospec config profile core` and then `tospec update` to add them.');
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Removes skill directories for workflows when delivery changed to commands-only.
|
|
247
|
+
* Returns the number of directories removed.
|
|
248
|
+
*/
|
|
249
|
+
async removeSkillDirs(skillsDir) {
|
|
250
|
+
let removed = 0;
|
|
251
|
+
for (const workflow of ALL_WORKFLOWS) {
|
|
252
|
+
const dirName = WORKFLOW_TO_SKILL_DIR[workflow];
|
|
253
|
+
if (!dirName)
|
|
254
|
+
continue;
|
|
255
|
+
const skillDir = path.join(skillsDir, dirName);
|
|
256
|
+
try {
|
|
257
|
+
if (fs.existsSync(skillDir)) {
|
|
258
|
+
await fs.promises.rm(skillDir, { recursive: true, force: true });
|
|
259
|
+
removed++;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
// Ignore errors
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return removed;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Removes skill directories for workflows that are no longer selected in the
|
|
270
|
+
* active profile, from a tool's `skills/` dir (dirs named `tospec-<workflow>`).
|
|
271
|
+
* Returns the number of directories removed.
|
|
272
|
+
*/
|
|
273
|
+
async removeUnselectedSkillDirs(skillsDir, desiredWorkflows) {
|
|
274
|
+
const desiredSet = new Set(desiredWorkflows);
|
|
275
|
+
let removed = 0;
|
|
276
|
+
for (const workflow of ALL_WORKFLOWS) {
|
|
277
|
+
if (desiredSet.has(workflow))
|
|
278
|
+
continue;
|
|
279
|
+
const dirName = WORKFLOW_TO_SKILL_DIR[workflow];
|
|
280
|
+
if (!dirName)
|
|
281
|
+
continue;
|
|
282
|
+
const skillDir = path.join(skillsDir, dirName);
|
|
283
|
+
try {
|
|
284
|
+
if (fs.existsSync(skillDir)) {
|
|
285
|
+
await fs.promises.rm(skillDir, { recursive: true, force: true });
|
|
286
|
+
removed++;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
catch {
|
|
290
|
+
// Ignore errors
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return removed;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EAEpB,kBAAkB,EAClB,qBAAqB,EACrB,2BAA2B,EAC3B,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAgB,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EA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Q,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;oBACjE,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CAEF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation threshold constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const MIN_WHY_SECTION_LENGTH = 50;
|
|
5
|
+
export declare const MIN_PURPOSE_LENGTH = 50;
|
|
6
|
+
export declare const MAX_WHY_SECTION_LENGTH = 1000;
|
|
7
|
+
export declare const MAX_REQUIREMENT_TEXT_LENGTH = 500;
|
|
8
|
+
export declare const MAX_DELTAS_PER_CHANGE = 10;
|
|
9
|
+
export declare const VALIDATION_MESSAGES: {
|
|
10
|
+
readonly SCENARIO_EMPTY: "Scenario text cannot be empty";
|
|
11
|
+
readonly REQUIREMENT_EMPTY: "Requirement text cannot be empty";
|
|
12
|
+
readonly REQUIREMENT_NO_SHALL: "Requirement must contain SHALL or MUST keyword";
|
|
13
|
+
readonly REQUIREMENT_NO_SCENARIOS: "Requirement must have at least one scenario";
|
|
14
|
+
readonly SPEC_NAME_EMPTY: "Spec name cannot be empty";
|
|
15
|
+
readonly SPEC_PURPOSE_EMPTY: "Purpose section cannot be empty";
|
|
16
|
+
readonly SPEC_NO_REQUIREMENTS: "Spec must have at least one requirement";
|
|
17
|
+
readonly CHANGE_NAME_EMPTY: "Change name cannot be empty";
|
|
18
|
+
readonly CHANGE_WHY_TOO_SHORT: "Why section must be at least 50 characters";
|
|
19
|
+
readonly CHANGE_WHY_TOO_LONG: "Why section should not exceed 1000 characters";
|
|
20
|
+
readonly CHANGE_WHAT_EMPTY: "What Changes section cannot be empty";
|
|
21
|
+
readonly CHANGE_NO_DELTAS: "Change must have at least one delta";
|
|
22
|
+
readonly CHANGE_TOO_MANY_DELTAS: "Consider splitting changes with more than 10 deltas";
|
|
23
|
+
readonly DELTA_SPEC_EMPTY: "Spec name cannot be empty";
|
|
24
|
+
readonly DELTA_DESCRIPTION_EMPTY: "Delta description cannot be empty";
|
|
25
|
+
readonly PURPOSE_TOO_BRIEF: "Purpose section is too brief (less than 50 characters)";
|
|
26
|
+
readonly REQUIREMENT_TOO_LONG: "Requirement text is very long (>500 characters). Consider breaking it down.";
|
|
27
|
+
readonly DELTA_DESCRIPTION_TOO_BRIEF: "Delta description is too brief";
|
|
28
|
+
readonly DELTA_MISSING_REQUIREMENTS: "Delta should include requirements";
|
|
29
|
+
readonly GUIDE_NO_DELTAS: "No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one \"#### Scenario:\" block. Tip: run \"tospec show <change-id> --json --deltas-only\" to inspect parsed deltas.";
|
|
30
|
+
readonly GUIDE_MISSING_SPEC_SECTIONS: "Missing required sections. Expected headers: \"## Purpose\" and \"## Requirements\". Example:\n## Purpose\n[brief purpose]\n\n## Requirements\n### Requirement: Clear requirement statement\nUsers SHALL ...\n\n#### Scenario: Descriptive name\n- **WHEN** ...\n- **THEN** ...";
|
|
31
|
+
readonly GUIDE_MISSING_CHANGE_SECTIONS: "Missing required sections. Expected headers: \"## Why\" and \"## What Changes\". Ensure deltas are documented in specs/ using delta headers.";
|
|
32
|
+
readonly GUIDE_SCENARIO_FORMAT: "Scenarios must use level-4 headers. Convert bullet lists into:\n#### Scenario: Short name\n- **WHEN** ...\n- **THEN** ...\n- **AND** ...";
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/validation/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AACzC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAGrC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAGxC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;CAiCtB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation threshold constants
|
|
3
|
+
*/
|
|
4
|
+
// Minimum character lengths
|
|
5
|
+
export const MIN_WHY_SECTION_LENGTH = 50;
|
|
6
|
+
export const MIN_PURPOSE_LENGTH = 50;
|
|
7
|
+
// Maximum character/item limits
|
|
8
|
+
export const MAX_WHY_SECTION_LENGTH = 1000;
|
|
9
|
+
export const MAX_REQUIREMENT_TEXT_LENGTH = 500;
|
|
10
|
+
export const MAX_DELTAS_PER_CHANGE = 10;
|
|
11
|
+
// Validation messages
|
|
12
|
+
export const VALIDATION_MESSAGES = {
|
|
13
|
+
// Required content
|
|
14
|
+
SCENARIO_EMPTY: 'Scenario text cannot be empty',
|
|
15
|
+
REQUIREMENT_EMPTY: 'Requirement text cannot be empty',
|
|
16
|
+
REQUIREMENT_NO_SHALL: 'Requirement must contain SHALL or MUST keyword',
|
|
17
|
+
REQUIREMENT_NO_SCENARIOS: 'Requirement must have at least one scenario',
|
|
18
|
+
SPEC_NAME_EMPTY: 'Spec name cannot be empty',
|
|
19
|
+
SPEC_PURPOSE_EMPTY: 'Purpose section cannot be empty',
|
|
20
|
+
SPEC_NO_REQUIREMENTS: 'Spec must have at least one requirement',
|
|
21
|
+
CHANGE_NAME_EMPTY: 'Change name cannot be empty',
|
|
22
|
+
CHANGE_WHY_TOO_SHORT: `Why section must be at least ${MIN_WHY_SECTION_LENGTH} characters`,
|
|
23
|
+
CHANGE_WHY_TOO_LONG: `Why section should not exceed ${MAX_WHY_SECTION_LENGTH} characters`,
|
|
24
|
+
CHANGE_WHAT_EMPTY: 'What Changes section cannot be empty',
|
|
25
|
+
CHANGE_NO_DELTAS: 'Change must have at least one delta',
|
|
26
|
+
CHANGE_TOO_MANY_DELTAS: `Consider splitting changes with more than ${MAX_DELTAS_PER_CHANGE} deltas`,
|
|
27
|
+
DELTA_SPEC_EMPTY: 'Spec name cannot be empty',
|
|
28
|
+
DELTA_DESCRIPTION_EMPTY: 'Delta description cannot be empty',
|
|
29
|
+
// Warnings
|
|
30
|
+
PURPOSE_TOO_BRIEF: `Purpose section is too brief (less than ${MIN_PURPOSE_LENGTH} characters)`,
|
|
31
|
+
REQUIREMENT_TOO_LONG: `Requirement text is very long (>${MAX_REQUIREMENT_TEXT_LENGTH} characters). Consider breaking it down.`,
|
|
32
|
+
DELTA_DESCRIPTION_TOO_BRIEF: 'Delta description is too brief',
|
|
33
|
+
DELTA_MISSING_REQUIREMENTS: 'Delta should include requirements',
|
|
34
|
+
// Guidance snippets (appended to primary messages for remediation)
|
|
35
|
+
GUIDE_NO_DELTAS: 'No deltas found. Ensure your change has a specs/ directory with capability folders (e.g. specs/http-server/spec.md) containing .md files that use delta headers (## ADDED/MODIFIED/REMOVED/RENAMED Requirements) and that each requirement includes at least one "#### Scenario:" block. Tip: run "tospec show <change-id> --json --deltas-only" to inspect parsed deltas.',
|
|
36
|
+
GUIDE_MISSING_SPEC_SECTIONS: 'Missing required sections. Expected headers: "## Purpose" and "## Requirements". Example:\n## Purpose\n[brief purpose]\n\n## Requirements\n### Requirement: Clear requirement statement\nUsers SHALL ...\n\n#### Scenario: Descriptive name\n- **WHEN** ...\n- **THEN** ...',
|
|
37
|
+
GUIDE_MISSING_CHANGE_SECTIONS: 'Missing required sections. Expected headers: "## Why" and "## What Changes". Ensure deltas are documented in specs/ using delta headers.',
|
|
38
|
+
GUIDE_SCENARIO_FORMAT: 'Scenarios must use level-4 headers. Convert bullet lists into:\n#### Scenario: Short name\n- **WHEN** ...\n- **THEN** ...\n- **AND** ...',
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/core/validation/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAErC,gCAAgC;AAChC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAExC,sBAAsB;AACtB,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,mBAAmB;IACnB,cAAc,EAAE,+BAA+B;IAC/C,iBAAiB,EAAE,kCAAkC;IACrD,oBAAoB,EAAE,gDAAgD;IACtE,wBAAwB,EAAE,6CAA6C;IACvE,eAAe,EAAE,2BAA2B;IAC5C,kBAAkB,EAAE,iCAAiC;IACrD,oBAAoB,EAAE,yCAAyC;IAC/D,iBAAiB,EAAE,6BAA6B;IAChD,oBAAoB,EAAE,gCAAgC,sBAAsB,aAAa;IACzF,mBAAmB,EAAE,iCAAiC,sBAAsB,aAAa;IACzF,iBAAiB,EAAE,sCAAsC;IACzD,gBAAgB,EAAE,qCAAqC;IACvD,sBAAsB,EAAE,6CAA6C,qBAAqB,SAAS;IACnG,gBAAgB,EAAE,2BAA2B;IAC7C,uBAAuB,EAAE,mCAAmC;IAE5D,WAAW;IACX,iBAAiB,EAAE,2CAA2C,kBAAkB,cAAc;IAC9F,oBAAoB,EAAE,mCAAmC,2BAA2B,0CAA0C;IAC9H,2BAA2B,EAAE,gCAAgC;IAC7D,0BAA0B,EAAE,mCAAmC;IAE/D,mEAAmE;IACnE,eAAe,EACb,4WAA4W;IAC9W,2BAA2B,EACzB,6QAA6Q;I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