@devtrack-solution/codesdd 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.sdd/skills/curated/api-clean-flask-langgraph/SKILL.md +2751 -0
- package/.sdd/skills/curated/devtrack-api/SKILL.md +137 -0
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +4 -0
- package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +381 -0
- package/.sdd/skills/curated/devtrack-api/references/architecture-governance.md +219 -0
- package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +359 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +127 -0
- package/.sdd/skills/curated/devtrack-api/references/imports-lint.md +207 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +167 -0
- package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +334 -0
- package/LICENSE +21 -0
- package/README.md +842 -0
- package/bin/codesdd.js +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +560 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +296 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +258 -0
- package/dist/commands/config.d.ts +36 -0
- package/dist/commands/config.js +552 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +184 -0
- package/dist/commands/schema.d.ts +6 -0
- package/dist/commands/schema.js +870 -0
- package/dist/commands/sdd/execution.d.ts +3 -0
- package/dist/commands/sdd/execution.js +409 -0
- package/dist/commands/sdd/shared.d.ts +9 -0
- package/dist/commands/sdd/shared.js +84 -0
- package/dist/commands/sdd/skills.d.ts +3 -0
- package/dist/commands/sdd/skills.js +154 -0
- package/dist/commands/sdd.d.ts +3 -0
- package/dist/commands/sdd.js +769 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +133 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +228 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +295 -0
- package/dist/commands/workflow/index.d.ts +17 -0
- package/dist/commands/workflow/index.js +12 -0
- package/dist/commands/workflow/instructions.d.ts +29 -0
- package/dist/commands/workflow/instructions.js +383 -0
- package/dist/commands/workflow/new-change.d.ts +11 -0
- package/dist/commands/workflow/new-change.js +45 -0
- package/dist/commands/workflow/schemas.d.ts +10 -0
- package/dist/commands/workflow/schemas.js +34 -0
- package/dist/commands/workflow/shared.d.ts +57 -0
- package/dist/commands/workflow/shared.js +117 -0
- package/dist/commands/workflow/status.d.ts +14 -0
- package/dist/commands/workflow/status.js +76 -0
- package/dist/commands/workflow/templates.d.ts +16 -0
- package/dist/commands/workflow/templates.js +68 -0
- package/dist/core/archive.d.ts +16 -0
- package/dist/core/archive.js +487 -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 +7 -0
- package/dist/core/artifact-graph/index.js +13 -0
- package/dist/core/artifact-graph/instruction-loader.d.ts +143 -0
- package/dist/core/artifact-graph/instruction-loader.js +215 -0
- package/dist/core/artifact-graph/resolver.d.ts +81 -0
- package/dist/core/artifact-graph/resolver.js +258 -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 +54 -0
- package/dist/core/artifact-graph/types.d.ts +45 -0
- package/dist/core/artifact-graph/types.js +43 -0
- package/dist/core/available-tools.d.ts +16 -0
- package/dist/core/available-tools.js +30 -0
- package/dist/core/branding.d.ts +8 -0
- package/dist/core/branding.js +12 -0
- package/dist/core/cli/command-matrix.d.ts +23 -0
- package/dist/core/cli/command-matrix.js +123 -0
- package/dist/core/command-generation/adapters/amazon-q.d.ts +13 -0
- package/dist/core/command-generation/adapters/amazon-q.js +26 -0
- package/dist/core/command-generation/adapters/antigravity.d.ts +13 -0
- package/dist/core/command-generation/adapters/antigravity.js +26 -0
- package/dist/core/command-generation/adapters/auggie.d.ts +13 -0
- package/dist/core/command-generation/adapters/auggie.js +27 -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/cline.d.ts +14 -0
- package/dist/core/command-generation/adapters/cline.js +27 -0
- package/dist/core/command-generation/adapters/codebuddy.d.ts +13 -0
- package/dist/core/command-generation/adapters/codebuddy.js +28 -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/continue.d.ts +13 -0
- package/dist/core/command-generation/adapters/continue.js +28 -0
- package/dist/core/command-generation/adapters/costrict.d.ts +13 -0
- package/dist/core/command-generation/adapters/costrict.js +27 -0
- package/dist/core/command-generation/adapters/crush.d.ts +13 -0
- package/dist/core/command-generation/adapters/crush.js +30 -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/factory.d.ts +13 -0
- package/dist/core/command-generation/adapters/factory.js +27 -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/iflow.d.ts +13 -0
- package/dist/core/command-generation/adapters/iflow.js +29 -0
- package/dist/core/command-generation/adapters/index.d.ts +29 -0
- package/dist/core/command-generation/adapters/index.js +29 -0
- package/dist/core/command-generation/adapters/kilocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/kilocode.js +23 -0
- package/dist/core/command-generation/adapters/kiro.d.ts +13 -0
- package/dist/core/command-generation/adapters/kiro.js +26 -0
- package/dist/core/command-generation/adapters/opencode.d.ts +13 -0
- package/dist/core/command-generation/adapters/opencode.js +29 -0
- package/dist/core/command-generation/adapters/pi.d.ts +14 -0
- package/dist/core/command-generation/adapters/pi.js +41 -0
- package/dist/core/command-generation/adapters/qoder.d.ts +13 -0
- package/dist/core/command-generation/adapters/qoder.js +30 -0
- package/dist/core/command-generation/adapters/qwen.d.ts +13 -0
- package/dist/core/command-generation/adapters/qwen.js +26 -0
- package/dist/core/command-generation/adapters/roocode.d.ts +14 -0
- package/dist/core/command-generation/adapters/roocode.js +27 -0
- package/dist/core/command-generation/adapters/windsurf.d.ts +14 -0
- package/dist/core/command-generation/adapters/windsurf.js +51 -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 +36 -0
- package/dist/core/command-generation/registry.js +92 -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 +7 -0
- package/dist/core/completions/command-registry.js +461 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.js +102 -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 +32 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
- package/dist/core/completions/generators/powershell-generator.js +207 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
- package/dist/core/completions/generators/zsh-generator.js +250 -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 +88 -0
- package/dist/core/completions/installers/powershell-installer.js +327 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +125 -0
- package/dist/core/completions/installers/zsh-installer.js +452 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/completions/types.d.ts +79 -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 +17 -0
- package/dist/core/config.js +33 -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 +44 -0
- package/dist/core/global-config.js +125 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/init.d.ts +36 -0
- package/dist/core/init.js +576 -0
- package/dist/core/legacy-cleanup.d.ts +162 -0
- package/dist/core/legacy-cleanup.js +512 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +173 -0
- package/dist/core/migration.d.ts +23 -0
- package/dist/core/migration.js +108 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/profile-sync-drift.d.ts +38 -0
- package/dist/core/profile-sync-drift.js +201 -0
- package/dist/core/profiles.d.ts +26 -0
- package/dist/core/profiles.js +41 -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/sdd/adr-policy.d.ts +7 -0
- package/dist/core/sdd/adr-policy.js +47 -0
- package/dist/core/sdd/adr.d.ts +4 -0
- package/dist/core/sdd/adr.js +27 -0
- package/dist/core/sdd/bootstrap.d.ts +28 -0
- package/dist/core/sdd/bootstrap.js +353 -0
- package/dist/core/sdd/check.d.ts +51 -0
- package/dist/core/sdd/check.js +831 -0
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +73 -0
- package/dist/core/sdd/coordination/coordination-adapters.js +87 -0
- package/dist/core/sdd/coordination/index.d.ts +2 -0
- package/dist/core/sdd/coordination/index.js +2 -0
- package/dist/core/sdd/dedup.d.ts +23 -0
- package/dist/core/sdd/dedup.js +62 -0
- package/dist/core/sdd/default-bootstrap-files.d.ts +23 -0
- package/dist/core/sdd/default-bootstrap-files.js +385 -0
- package/dist/core/sdd/default-skills.d.ts +16 -0
- package/dist/core/sdd/default-skills.js +427 -0
- package/dist/core/sdd/diagnose.d.ts +25 -0
- package/dist/core/sdd/diagnose.js +1312 -0
- package/dist/core/sdd/docs-sync.d.ts +21 -0
- package/dist/core/sdd/docs-sync.js +231 -0
- package/dist/core/sdd/domain/helpers.d.ts +6 -0
- package/dist/core/sdd/domain/helpers.js +37 -0
- package/dist/core/sdd/domain/lifecycle-guardrails.d.ts +22 -0
- package/dist/core/sdd/domain/lifecycle-guardrails.js +31 -0
- package/dist/core/sdd/domain/lifecycle-hooks.d.ts +16 -0
- package/dist/core/sdd/domain/lifecycle-hooks.js +27 -0
- package/dist/core/sdd/domain/post-active-validation.d.ts +15 -0
- package/dist/core/sdd/domain/post-active-validation.js +71 -0
- package/dist/core/sdd/domain/traceability.d.ts +8 -0
- package/dist/core/sdd/domain/traceability.js +83 -0
- package/dist/core/sdd/domain/transition-engine.d.ts +49 -0
- package/dist/core/sdd/domain/transition-engine.js +120 -0
- package/dist/core/sdd/fingerprint.d.ts +23 -0
- package/dist/core/sdd/fingerprint.js +146 -0
- package/dist/core/sdd/import-openspec.d.ts +31 -0
- package/dist/core/sdd/import-openspec.js +232 -0
- package/dist/core/sdd/init.d.ts +36 -0
- package/dist/core/sdd/init.js +65 -0
- package/dist/core/sdd/json-schema.d.ts +6 -0
- package/dist/core/sdd/json-schema.js +59 -0
- package/dist/core/sdd/legacy-operations.d.ts +286 -0
- package/dist/core/sdd/legacy-operations.js +2175 -0
- package/dist/core/sdd/lenses.d.ts +14 -0
- package/dist/core/sdd/lenses.js +97 -0
- package/dist/core/sdd/merge-catalog.d.ts +9 -0
- package/dist/core/sdd/merge-catalog.js +70 -0
- package/dist/core/sdd/migrate-workspace.d.ts +36 -0
- package/dist/core/sdd/migrate-workspace.js +344 -0
- package/dist/core/sdd/migrate.d.ts +24 -0
- package/dist/core/sdd/migrate.js +385 -0
- package/dist/core/sdd/resolve-project-root.d.ts +15 -0
- package/dist/core/sdd/resolve-project-root.js +46 -0
- package/dist/core/sdd/root-resolver.d.ts +16 -0
- package/dist/core/sdd/root-resolver.js +62 -0
- package/dist/core/sdd/sanitize.d.ts +35 -0
- package/dist/core/sdd/sanitize.js +750 -0
- package/dist/core/sdd/services/approve.service.d.ts +20 -0
- package/dist/core/sdd/services/approve.service.js +82 -0
- package/dist/core/sdd/services/audit.service.d.ts +53 -0
- package/dist/core/sdd/services/audit.service.js +136 -0
- package/dist/core/sdd/services/breakdown.service.d.ts +35 -0
- package/dist/core/sdd/services/breakdown.service.js +185 -0
- package/dist/core/sdd/services/context.service.d.ts +346 -0
- package/dist/core/sdd/services/context.service.js +278 -0
- package/dist/core/sdd/services/debate.service.d.ts +16 -0
- package/dist/core/sdd/services/debate.service.js +73 -0
- package/dist/core/sdd/services/decide.service.d.ts +23 -0
- package/dist/core/sdd/services/decide.service.js +81 -0
- package/dist/core/sdd/services/dedup-apply.service.d.ts +39 -0
- package/dist/core/sdd/services/dedup-apply.service.js +259 -0
- package/dist/core/sdd/services/feature-lint.service.d.ts +29 -0
- package/dist/core/sdd/services/feature-lint.service.js +146 -0
- package/dist/core/sdd/services/finalize.service.d.ts +33 -0
- package/dist/core/sdd/services/finalize.service.js +707 -0
- package/dist/core/sdd/services/frontend-gap.service.d.ts +23 -0
- package/dist/core/sdd/services/frontend-gap.service.js +117 -0
- package/dist/core/sdd/services/frontend-impact.service.d.ts +19 -0
- package/dist/core/sdd/services/frontend-impact.service.js +46 -0
- package/dist/core/sdd/services/ingest-deposito.service.d.ts +32 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +231 -0
- package/dist/core/sdd/services/insight.service.d.ts +21 -0
- package/dist/core/sdd/services/insight.service.js +81 -0
- package/dist/core/sdd/services/legacy-capability.service.d.ts +24 -0
- package/dist/core/sdd/services/legacy-capability.service.js +59 -0
- package/dist/core/sdd/services/mcp-runtime.service.d.ts +42 -0
- package/dist/core/sdd/services/mcp-runtime.service.js +144 -0
- package/dist/core/sdd/services/metrics.service.d.ts +49 -0
- package/dist/core/sdd/services/metrics.service.js +181 -0
- package/dist/core/sdd/services/next.service.d.ts +35 -0
- package/dist/core/sdd/services/next.service.js +54 -0
- package/dist/core/sdd/services/onboard.service.d.ts +9 -0
- package/dist/core/sdd/services/onboard.service.js +165 -0
- package/dist/core/sdd/services/rebuild.service.d.ts +31 -0
- package/dist/core/sdd/services/rebuild.service.js +482 -0
- package/dist/core/sdd/services/scan-naming.service.d.ts +43 -0
- package/dist/core/sdd/services/scan-naming.service.js +246 -0
- package/dist/core/sdd/services/skills-invoke.service.d.ts +24 -0
- package/dist/core/sdd/services/skills-invoke.service.js +63 -0
- package/dist/core/sdd/services/skills-sync.service.d.ts +15 -0
- package/dist/core/sdd/services/skills-sync.service.js +117 -0
- package/dist/core/sdd/services/start.service.d.ts +26 -0
- package/dist/core/sdd/services/start.service.js +237 -0
- package/dist/core/sdd/skills.d.ts +15 -0
- package/dist/core/sdd/skills.js +46 -0
- package/dist/core/sdd/state-lock.d.ts +19 -0
- package/dist/core/sdd/state-lock.js +144 -0
- package/dist/core/sdd/state.d.ts +155 -0
- package/dist/core/sdd/state.js +1000 -0
- package/dist/core/sdd/store/in-memory-adapter.d.ts +12 -0
- package/dist/core/sdd/store/in-memory-adapter.js +27 -0
- package/dist/core/sdd/store/index.d.ts +5 -0
- package/dist/core/sdd/store/index.js +5 -0
- package/dist/core/sdd/store/sdd-stores.d.ts +25 -0
- package/dist/core/sdd/store/sdd-stores.js +59 -0
- package/dist/core/sdd/store/state-store.d.ts +32 -0
- package/dist/core/sdd/store/state-store.js +2 -0
- package/dist/core/sdd/store/yaml-file-adapter.d.ts +12 -0
- package/dist/core/sdd/store/yaml-file-adapter.js +43 -0
- package/dist/core/sdd/structural-health.d.ts +557 -0
- package/dist/core/sdd/structural-health.js +187 -0
- package/dist/core/sdd/transaction.d.ts +14 -0
- package/dist/core/sdd/transaction.js +100 -0
- package/dist/core/sdd/types.d.ts +1570 -0
- package/dist/core/sdd/types.js +617 -0
- package/dist/core/sdd/views.d.ts +3 -0
- package/dist/core/sdd/views.js +560 -0
- package/dist/core/sdd/workspace-schemas.d.ts +620 -0
- package/dist/core/sdd/workspace-schemas.js +254 -0
- package/dist/core/sdd/write-manifest.d.ts +25 -0
- package/dist/core/sdd/write-manifest.js +353 -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 +106 -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 +385 -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 +20 -0
- package/dist/core/templates/skill-templates.js +19 -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 +308 -0
- package/dist/core/templates/workflows/archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/archive-change.js +277 -0
- package/dist/core/templates/workflows/bulk-archive-change.d.ts +10 -0
- package/dist/core/templates/workflows/bulk-archive-change.js +502 -0
- package/dist/core/templates/workflows/continue-change.d.ts +10 -0
- package/dist/core/templates/workflows/continue-change.js +232 -0
- package/dist/core/templates/workflows/explore.d.ts +10 -0
- package/dist/core/templates/workflows/explore.js +475 -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 +206 -0
- package/dist/core/templates/workflows/new-change.d.ts +10 -0
- package/dist/core/templates/workflows/new-change.js +151 -0
- package/dist/core/templates/workflows/onboard.d.ts +10 -0
- package/dist/core/templates/workflows/onboard.js +573 -0
- package/dist/core/templates/workflows/propose.d.ts +10 -0
- package/dist/core/templates/workflows/propose.js +224 -0
- package/dist/core/templates/workflows/sdd.d.ts +10 -0
- package/dist/core/templates/workflows/sdd.js +107 -0
- package/dist/core/templates/workflows/sync-specs.d.ts +10 -0
- package/dist/core/templates/workflows/sync-specs.js +286 -0
- package/dist/core/templates/workflows/verify-change.d.ts +10 -0
- package/dist/core/templates/workflows/verify-change.js +346 -0
- package/dist/core/update.d.ts +77 -0
- package/dist/core/update.js +538 -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 +409 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +170 -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 +32 -0
- package/dist/telemetry/config.js +68 -0
- package/dist/telemetry/index.d.ts +44 -0
- package/dist/telemetry/index.js +207 -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 +51 -0
- package/dist/utils/change-metadata.js +147 -0
- package/dist/utils/change-utils.d.ts +62 -0
- package/dist/utils/change-utils.js +121 -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 +36 -0
- package/dist/utils/file-system.js +281 -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 +73 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/openspec-compat.d.ts +2 -0
- package/dist/utils/openspec-compat.js +2 -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 +111 -0
- package/schemas/sdd/1-spec.schema.json +221 -0
- package/schemas/sdd/2-plan.schema.json +199 -0
- package/schemas/sdd/3-tasks.schema.json +102 -0
- package/schemas/sdd/4-changelog.schema.json +55 -0
- package/schemas/sdd/5-quality.schema.json +427 -0
- package/schemas/sdd/workspace-catalog.schema.json +1012 -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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface StructuralLens {
|
|
2
|
+
artifact_type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
required_sections: string[];
|
|
5
|
+
forbidden_phrases?: string[];
|
|
6
|
+
section_rules?: Record<string, {
|
|
7
|
+
min_lines?: number;
|
|
8
|
+
min_length?: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare const LENSES: Record<string, StructuralLens>;
|
|
12
|
+
export declare function extractSectionContent(content: string, sectionHeader: string): string;
|
|
13
|
+
export declare function validateDocumentAgainstLens(content: string, lens: StructuralLens): string[];
|
|
14
|
+
//# sourceMappingURL=lenses.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export const LENSES = {
|
|
2
|
+
insight: {
|
|
3
|
+
artifact_type: 'INS',
|
|
4
|
+
name: 'Insight Lens',
|
|
5
|
+
required_sections: ['## Title', '## Description'],
|
|
6
|
+
section_rules: {
|
|
7
|
+
'## Description': { min_length: 100 },
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
debate: {
|
|
11
|
+
artifact_type: 'DEB',
|
|
12
|
+
name: 'Debate Lens',
|
|
13
|
+
required_sections: [
|
|
14
|
+
'## 1) Decision Question (Required)',
|
|
15
|
+
'## 2) Decision Criteria (Required)',
|
|
16
|
+
'## 3) Options Considered (Minimum 2)',
|
|
17
|
+
'### Option A',
|
|
18
|
+
'### Option B',
|
|
19
|
+
'## 6) Scoring Matrix (0-5)',
|
|
20
|
+
'## 7) Mediator Decision (Required)',
|
|
21
|
+
'- Choice (A/B/C):',
|
|
22
|
+
'- Rationale:',
|
|
23
|
+
'## 8) Quality Contract (Required)',
|
|
24
|
+
'## 9) Output',
|
|
25
|
+
],
|
|
26
|
+
forbidden_phrases: ['(fill in', 'Describe the result'],
|
|
27
|
+
},
|
|
28
|
+
epic: {
|
|
29
|
+
artifact_type: 'EPIC',
|
|
30
|
+
name: 'Epic Lens',
|
|
31
|
+
required_sections: ['## Origin', '## Approved Summary', '## Status'],
|
|
32
|
+
forbidden_phrases: ['(fill in approved summary)'],
|
|
33
|
+
},
|
|
34
|
+
adr: {
|
|
35
|
+
artifact_type: 'ADR',
|
|
36
|
+
name: 'ADR Lens',
|
|
37
|
+
required_sections: ['## Context', '## Decision', '## Consequences'],
|
|
38
|
+
forbidden_phrases: ['(fill in context)'],
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export function extractSectionContent(content, sectionHeader) {
|
|
42
|
+
// Encontra a seção especificada e pega tudo até o próximo header de mesmo ou maior nível,
|
|
43
|
+
const lines = content.split('\n');
|
|
44
|
+
const startIndex = lines.findIndex(l => l.trim() === sectionHeader);
|
|
45
|
+
if (startIndex === -1) {
|
|
46
|
+
// Tenta encontrar cabecalho parcial caso o template tenha adicionado sufixo
|
|
47
|
+
const partialIndex = lines.findIndex(l => l.trim().startsWith(sectionHeader));
|
|
48
|
+
if (partialIndex === -1)
|
|
49
|
+
return '';
|
|
50
|
+
return extractFromLines(lines, partialIndex);
|
|
51
|
+
}
|
|
52
|
+
return extractFromLines(lines, startIndex);
|
|
53
|
+
}
|
|
54
|
+
function extractFromLines(lines, startIndex) {
|
|
55
|
+
const contentLines = [];
|
|
56
|
+
for (let i = startIndex + 1; i < lines.length; i++) {
|
|
57
|
+
if (lines[i].trim().startsWith('#'))
|
|
58
|
+
break;
|
|
59
|
+
contentLines.push(lines[i]);
|
|
60
|
+
}
|
|
61
|
+
return contentLines.join('\n').trim();
|
|
62
|
+
}
|
|
63
|
+
export function validateDocumentAgainstLens(content, lens) {
|
|
64
|
+
const missing = lens.required_sections.filter((section) => !content.includes(section));
|
|
65
|
+
const violations = [...missing];
|
|
66
|
+
if (lens.forbidden_phrases) {
|
|
67
|
+
for (const phrase of lens.forbidden_phrases) {
|
|
68
|
+
if (content.includes(phrase)) {
|
|
69
|
+
violations.push(`Frase proibida encontrada: "${phrase}"`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (lens.section_rules) {
|
|
74
|
+
for (const [sectionHeader, rules] of Object.entries(lens.section_rules)) {
|
|
75
|
+
if (missing.includes(sectionHeader))
|
|
76
|
+
continue;
|
|
77
|
+
const sectionContent = extractSectionContent(content, sectionHeader);
|
|
78
|
+
if (rules.min_length !== undefined && sectionContent.length < rules.min_length) {
|
|
79
|
+
violations.push(`Seção "${sectionHeader}" requer no mínimo ${rules.min_length} caracteres, encontrado: ${sectionContent.length}`);
|
|
80
|
+
}
|
|
81
|
+
if (rules.min_lines !== undefined) {
|
|
82
|
+
// Ignora linhas de listas vazias e placeholders para a checagem real
|
|
83
|
+
const validLines = sectionContent.split('\n')
|
|
84
|
+
.map(l => l.trim())
|
|
85
|
+
.filter(l => l.length > 0 && l !== '-' && !l.startsWith('- [ ]') && !l.includes('preencher') && !l.includes('TODO'));
|
|
86
|
+
if (validLines.length < rules.min_lines) {
|
|
87
|
+
violations.push(`Seção "${sectionHeader}" requer no mínimo ${rules.min_lines} linhas de conteúdo não vazio, encontrado:\n${sectionContent}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (violations.length > 0) {
|
|
93
|
+
console.log('LENS VIOLATIONS:', violations);
|
|
94
|
+
}
|
|
95
|
+
return violations;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=lenses.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ArchitectureNode, FrontendDecisionRecord, RepoMapRecord, ServiceRecord, TechStackRecord } from './types.js';
|
|
2
|
+
export declare function stableUniqueStrings(values: string[]): string[];
|
|
3
|
+
export declare function upsertByKey<T>(items: T[], incoming: T, keyFor: (item: T) => string, merge: (existing: T, next: T) => T): void;
|
|
4
|
+
export declare function mergeArchitectureNode(existing: ArchitectureNode, incoming: ArchitectureNode): ArchitectureNode;
|
|
5
|
+
export declare function mergeServiceRecord(existing: ServiceRecord, incoming: ServiceRecord): ServiceRecord;
|
|
6
|
+
export declare function mergeTechStackRecord(existing: TechStackRecord, incoming: TechStackRecord): TechStackRecord;
|
|
7
|
+
export declare function mergeRepoMapRecord(existing: RepoMapRecord, incoming: RepoMapRecord): RepoMapRecord;
|
|
8
|
+
export declare function mergeFrontendDecisionRecord(existing: FrontendDecisionRecord, incoming: FrontendDecisionRecord): FrontendDecisionRecord;
|
|
9
|
+
//# sourceMappingURL=merge-catalog.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function stableUniqueStrings(values) {
|
|
2
|
+
return Array.from(new Set(values.filter((value) => value && value.trim().length > 0)));
|
|
3
|
+
}
|
|
4
|
+
function preferExisting(existing, incoming) {
|
|
5
|
+
const existingValue = existing?.trim() || '';
|
|
6
|
+
if (existingValue)
|
|
7
|
+
return existingValue;
|
|
8
|
+
return incoming?.trim() || '';
|
|
9
|
+
}
|
|
10
|
+
export function upsertByKey(items, incoming, keyFor, merge) {
|
|
11
|
+
const index = items.findIndex((item) => keyFor(item) === keyFor(incoming));
|
|
12
|
+
if (index < 0) {
|
|
13
|
+
items.push(incoming);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
items[index] = merge(items[index], incoming);
|
|
17
|
+
}
|
|
18
|
+
export function mergeArchitectureNode(existing, incoming) {
|
|
19
|
+
return {
|
|
20
|
+
...existing,
|
|
21
|
+
name: preferExisting(existing.name, incoming.name),
|
|
22
|
+
kind: preferExisting(existing.kind, incoming.kind),
|
|
23
|
+
description: preferExisting(existing.description, incoming.description),
|
|
24
|
+
repo_paths: stableUniqueStrings([...existing.repo_paths, ...incoming.repo_paths]),
|
|
25
|
+
depends_on: stableUniqueStrings([...existing.depends_on, ...incoming.depends_on]),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function mergeServiceRecord(existing, incoming) {
|
|
29
|
+
return {
|
|
30
|
+
...existing,
|
|
31
|
+
name: preferExisting(existing.name, incoming.name),
|
|
32
|
+
responsibility: preferExisting(existing.responsibility, incoming.responsibility),
|
|
33
|
+
owner_refs: stableUniqueStrings([...existing.owner_refs, ...incoming.owner_refs]),
|
|
34
|
+
repo_paths: stableUniqueStrings([...existing.repo_paths, ...incoming.repo_paths]),
|
|
35
|
+
contracts: stableUniqueStrings([...existing.contracts, ...incoming.contracts]),
|
|
36
|
+
external_dependencies: stableUniqueStrings([
|
|
37
|
+
...existing.external_dependencies,
|
|
38
|
+
...incoming.external_dependencies,
|
|
39
|
+
]),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function mergeTechStackRecord(existing, incoming) {
|
|
43
|
+
return {
|
|
44
|
+
...existing,
|
|
45
|
+
version: preferExisting(existing.version, incoming.version),
|
|
46
|
+
purpose: preferExisting(existing.purpose, incoming.purpose),
|
|
47
|
+
constraints: stableUniqueStrings([...existing.constraints, ...incoming.constraints]),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function mergeRepoMapRecord(existing, incoming) {
|
|
51
|
+
return {
|
|
52
|
+
...existing,
|
|
53
|
+
kind: preferExisting(existing.kind, incoming.kind),
|
|
54
|
+
service_ref: preferExisting(existing.service_ref, incoming.service_ref),
|
|
55
|
+
notes: preferExisting(existing.notes, incoming.notes),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export function mergeFrontendDecisionRecord(existing, incoming) {
|
|
59
|
+
return {
|
|
60
|
+
...existing,
|
|
61
|
+
title: preferExisting(existing.title, incoming.title),
|
|
62
|
+
status: existing.status || incoming.status,
|
|
63
|
+
decision: preferExisting(existing.decision, incoming.decision),
|
|
64
|
+
rationale: preferExisting(existing.rationale, incoming.rationale),
|
|
65
|
+
related_refs: stableUniqueStrings([...existing.related_refs, ...incoming.related_refs]),
|
|
66
|
+
route_refs: stableUniqueStrings([...existing.route_refs, ...incoming.route_refs]),
|
|
67
|
+
adr_refs: stableUniqueStrings([...existing.adr_refs, ...incoming.adr_refs]),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=merge-catalog.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
type WorkspaceDocKind = 'spec' | 'plan' | 'tasks' | 'changelog' | 'quality';
|
|
2
|
+
export type WorkspaceMigrationFileResult = {
|
|
3
|
+
source: string;
|
|
4
|
+
target: string;
|
|
5
|
+
kind: WorkspaceDocKind;
|
|
6
|
+
written: boolean;
|
|
7
|
+
removedSource: boolean;
|
|
8
|
+
missingFields: string[];
|
|
9
|
+
validationErrors: string[];
|
|
10
|
+
};
|
|
11
|
+
export type WorkspaceMigrationFeatureResult = {
|
|
12
|
+
featureId: string;
|
|
13
|
+
root: 'planned' | 'active' | 'archived';
|
|
14
|
+
workspace: string;
|
|
15
|
+
files: WorkspaceMigrationFileResult[];
|
|
16
|
+
};
|
|
17
|
+
export type WorkspaceMigrationResult = {
|
|
18
|
+
dryRun: boolean;
|
|
19
|
+
scanned: number;
|
|
20
|
+
migrated: number;
|
|
21
|
+
features: WorkspaceMigrationFeatureResult[];
|
|
22
|
+
incomplete: Array<{
|
|
23
|
+
featureId: string;
|
|
24
|
+
file: string;
|
|
25
|
+
fields: string[];
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
export declare function findMarkdownWorkspaceFiles(projectRoot: string, feat?: string): Promise<string[]>;
|
|
29
|
+
export declare class MigrateWorkspaceCommand {
|
|
30
|
+
execute(projectRoot: string, options?: {
|
|
31
|
+
dryRun?: boolean;
|
|
32
|
+
feat?: string;
|
|
33
|
+
}): Promise<WorkspaceMigrationResult>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=migrate-workspace.d.ts.map
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { existsSync, promises as fs } from 'node:fs';
|
|
3
|
+
import { stringify as stringifyYaml } from 'yaml';
|
|
4
|
+
import { loadProjectSddConfig, resolveSddPaths } from './state.js';
|
|
5
|
+
import { workspaceChangelogSchema, workspacePlanSchema, workspaceQualitySchema, workspaceSpecSchema, workspaceTasksSchema, } from './workspace-schemas.js';
|
|
6
|
+
const MIGRATION_MARKER = '# MIGRATION: field required but source had no content';
|
|
7
|
+
const CANONICAL_DOCS = [
|
|
8
|
+
'1-spec',
|
|
9
|
+
'1-especificacao',
|
|
10
|
+
'2-plan',
|
|
11
|
+
'2-planejamento',
|
|
12
|
+
'3-tasks',
|
|
13
|
+
'3-tarefas',
|
|
14
|
+
'4-changelog',
|
|
15
|
+
'5-quality',
|
|
16
|
+
'quality',
|
|
17
|
+
];
|
|
18
|
+
export async function findMarkdownWorkspaceFiles(projectRoot, feat) {
|
|
19
|
+
const config = await loadProjectSddConfig(projectRoot);
|
|
20
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
21
|
+
const files = [];
|
|
22
|
+
for (const root of [paths.plannedDir, paths.activeDir, paths.archivedDir]) {
|
|
23
|
+
for (const workspace of await listFeatureWorkspaces(root, feat)) {
|
|
24
|
+
const entries = await fs.readdir(workspace.path, { withFileTypes: true }).catch(() => []);
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
if (!entry.isFile() || path.extname(entry.name) !== '.md')
|
|
27
|
+
continue;
|
|
28
|
+
if (!canonicalDocKind(entry.name))
|
|
29
|
+
continue;
|
|
30
|
+
files.push(path.join(workspace.path, entry.name));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return files.sort();
|
|
35
|
+
}
|
|
36
|
+
export class MigrateWorkspaceCommand {
|
|
37
|
+
async execute(projectRoot, options) {
|
|
38
|
+
const config = await loadProjectSddConfig(projectRoot);
|
|
39
|
+
const paths = resolveSddPaths(projectRoot, config);
|
|
40
|
+
const dryRun = Boolean(options?.dryRun);
|
|
41
|
+
const features = [];
|
|
42
|
+
for (const [rootName, rootPath] of [
|
|
43
|
+
['planned', paths.plannedDir],
|
|
44
|
+
['active', paths.activeDir],
|
|
45
|
+
['archived', paths.archivedDir],
|
|
46
|
+
]) {
|
|
47
|
+
for (const workspace of await listFeatureWorkspaces(rootPath, options?.feat)) {
|
|
48
|
+
const fileResults = [];
|
|
49
|
+
const entries = await fs.readdir(workspace.path, { withFileTypes: true }).catch(() => []);
|
|
50
|
+
for (const entry of entries) {
|
|
51
|
+
if (!entry.isFile() || path.extname(entry.name) !== '.md')
|
|
52
|
+
continue;
|
|
53
|
+
const kind = canonicalDocKind(entry.name);
|
|
54
|
+
if (!kind)
|
|
55
|
+
continue;
|
|
56
|
+
const sourcePath = path.join(workspace.path, entry.name);
|
|
57
|
+
const raw = await fs.readFile(sourcePath, 'utf-8');
|
|
58
|
+
const migrated = migrateMarkdownDocument(workspace.featureId, kind, raw);
|
|
59
|
+
const targetPath = path.join(workspace.path, migrated.targetName);
|
|
60
|
+
let written = false;
|
|
61
|
+
let removedSource = false;
|
|
62
|
+
if (!dryRun) {
|
|
63
|
+
await fs.writeFile(targetPath, renderYamlWithMigrationComments(migrated.document, migrated.missingFields), 'utf-8');
|
|
64
|
+
written = true;
|
|
65
|
+
await fs.rm(sourcePath, { force: true });
|
|
66
|
+
removedSource = true;
|
|
67
|
+
}
|
|
68
|
+
fileResults.push({
|
|
69
|
+
source: rel(paths, sourcePath),
|
|
70
|
+
target: rel(paths, targetPath),
|
|
71
|
+
kind,
|
|
72
|
+
written,
|
|
73
|
+
removedSource,
|
|
74
|
+
missingFields: migrated.missingFields,
|
|
75
|
+
validationErrors: migrated.validationErrors,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (fileResults.length > 0) {
|
|
79
|
+
features.push({
|
|
80
|
+
featureId: workspace.featureId,
|
|
81
|
+
root: rootName,
|
|
82
|
+
workspace: rel(paths, workspace.path),
|
|
83
|
+
files: fileResults,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
dryRun,
|
|
90
|
+
scanned: features.length,
|
|
91
|
+
migrated: features.reduce((total, feature) => total + feature.files.filter((file) => file.written).length, 0),
|
|
92
|
+
features,
|
|
93
|
+
incomplete: features.flatMap((feature) => feature.files
|
|
94
|
+
.filter((file) => file.missingFields.length > 0 || file.validationErrors.length > 0)
|
|
95
|
+
.map((file) => ({
|
|
96
|
+
featureId: feature.featureId,
|
|
97
|
+
file: file.target,
|
|
98
|
+
fields: [...file.missingFields, ...file.validationErrors],
|
|
99
|
+
}))),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function listFeatureWorkspaces(rootPath, feat) {
|
|
104
|
+
if (!existsSync(rootPath))
|
|
105
|
+
return [];
|
|
106
|
+
const entries = await fs.readdir(rootPath, { withFileTypes: true }).catch(() => []);
|
|
107
|
+
return entries
|
|
108
|
+
.filter((entry) => entry.isDirectory())
|
|
109
|
+
.filter((entry) => /^FEAT-\d{4}$/.test(entry.name))
|
|
110
|
+
.filter((entry) => !feat || entry.name === feat)
|
|
111
|
+
.map((entry) => ({ featureId: entry.name, path: path.join(rootPath, entry.name) }))
|
|
112
|
+
.sort((a, b) => a.featureId.localeCompare(b.featureId));
|
|
113
|
+
}
|
|
114
|
+
function canonicalDocKind(fileName) {
|
|
115
|
+
const base = path.basename(fileName, '.md');
|
|
116
|
+
if (!CANONICAL_DOCS.includes(base))
|
|
117
|
+
return undefined;
|
|
118
|
+
if (base.startsWith('1-'))
|
|
119
|
+
return 'spec';
|
|
120
|
+
if (base.startsWith('2-'))
|
|
121
|
+
return 'plan';
|
|
122
|
+
if (base.startsWith('3-'))
|
|
123
|
+
return 'tasks';
|
|
124
|
+
if (base.startsWith('4-'))
|
|
125
|
+
return 'changelog';
|
|
126
|
+
return 'quality';
|
|
127
|
+
}
|
|
128
|
+
function migrateMarkdownDocument(featureId, kind, markdown) {
|
|
129
|
+
const parsed = parseMarkdown(markdown);
|
|
130
|
+
if (kind === 'spec')
|
|
131
|
+
return migrateSpec(featureId, parsed);
|
|
132
|
+
if (kind === 'plan')
|
|
133
|
+
return migratePlan(featureId, parsed);
|
|
134
|
+
if (kind === 'tasks')
|
|
135
|
+
return migrateTasks(featureId, parsed);
|
|
136
|
+
if (kind === 'changelog')
|
|
137
|
+
return migrateChangelog(featureId, parsed);
|
|
138
|
+
return migrateQuality(featureId, parsed);
|
|
139
|
+
}
|
|
140
|
+
function parseMarkdown(markdown) {
|
|
141
|
+
const sections = new Map();
|
|
142
|
+
const lines = markdown.replace(/\r\n/g, '\n').split('\n');
|
|
143
|
+
let title = '';
|
|
144
|
+
let current = '';
|
|
145
|
+
let buffer = [];
|
|
146
|
+
const flush = () => {
|
|
147
|
+
if (current)
|
|
148
|
+
sections.set(normalizeHeading(current), buffer.join('\n').trim());
|
|
149
|
+
};
|
|
150
|
+
for (const line of lines) {
|
|
151
|
+
const heading = /^(#{1,6})\s+(.+?)\s*$/.exec(line);
|
|
152
|
+
if (heading) {
|
|
153
|
+
if (!title && heading[1] === '#')
|
|
154
|
+
title = heading[2].trim();
|
|
155
|
+
flush();
|
|
156
|
+
current = heading[2].trim();
|
|
157
|
+
buffer = [];
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (current)
|
|
161
|
+
buffer.push(line);
|
|
162
|
+
}
|
|
163
|
+
flush();
|
|
164
|
+
const bullets = lines
|
|
165
|
+
.map((line) => line.trim())
|
|
166
|
+
.filter((line) => /^[-*]\s+/.test(line))
|
|
167
|
+
.map((line) => line.replace(/^[-*]\s+/, '').trim())
|
|
168
|
+
.filter(Boolean);
|
|
169
|
+
return { title, body: markdown.trim(), sections, bullets };
|
|
170
|
+
}
|
|
171
|
+
function migrateSpec(featureId, parsed) {
|
|
172
|
+
const missing = [];
|
|
173
|
+
const title = ensureText(featureId, 'title', parsed.title || section(parsed, ['title', 'titulo']), 10, missing);
|
|
174
|
+
const objective = ensureText(featureId, 'objective', section(parsed, ['objective', 'objetivo', 'summary', 'resumo']), 100, missing);
|
|
175
|
+
const expected = ensureText(featureId, 'expected_outcome', section(parsed, ['expected outcome', 'resultado esperado', 'outcome']), 50, missing);
|
|
176
|
+
const impact = ensureText(featureId, 'system_impact', section(parsed, ['system impact', 'impacto sistêmico', 'impacto sistemico']), 30, missing);
|
|
177
|
+
const doc = {
|
|
178
|
+
schema_version: 1,
|
|
179
|
+
feature_id: featureId,
|
|
180
|
+
title,
|
|
181
|
+
origin: { type: 'direct', ref: featureId },
|
|
182
|
+
objective,
|
|
183
|
+
expected_outcome: expected,
|
|
184
|
+
system_impact: impact,
|
|
185
|
+
acceptance_refs: parsed.bullets.length > 0 ? parsed.bullets.slice(0, 5) : [featureId],
|
|
186
|
+
gates: defaultGates(),
|
|
187
|
+
created_at: new Date().toISOString(),
|
|
188
|
+
updated_at: new Date().toISOString(),
|
|
189
|
+
};
|
|
190
|
+
return withValidation('1-spec.yaml', doc, missing, workspaceSpecSchema);
|
|
191
|
+
}
|
|
192
|
+
function migratePlan(featureId, parsed) {
|
|
193
|
+
const missing = [];
|
|
194
|
+
const affected = parsed.bullets.length > 0 ? parsed.bullets.slice(0, 6) : ['migration'];
|
|
195
|
+
const doc = {
|
|
196
|
+
schema_version: 1,
|
|
197
|
+
feature_id: featureId,
|
|
198
|
+
architectural_impact: {
|
|
199
|
+
description: ensureText(featureId, 'architectural_impact.description', section(parsed, ['architectural impact', 'impacto arquitetural', 'plan', 'plano']), 1, missing),
|
|
200
|
+
affected_modules: affected,
|
|
201
|
+
},
|
|
202
|
+
frontend_impact: {
|
|
203
|
+
status: 'unknown',
|
|
204
|
+
description: ensureText(featureId, 'frontend_impact.description', section(parsed, ['frontend impact', 'impacto frontend']), 1, missing),
|
|
205
|
+
},
|
|
206
|
+
affected_contracts: [],
|
|
207
|
+
quality_strategy: {
|
|
208
|
+
unit_target: 95,
|
|
209
|
+
integration_target: 95,
|
|
210
|
+
approach: 'hybrid',
|
|
211
|
+
},
|
|
212
|
+
suggested_skills: [],
|
|
213
|
+
};
|
|
214
|
+
return withValidation('2-plan.yaml', doc, missing, workspacePlanSchema);
|
|
215
|
+
}
|
|
216
|
+
function migrateTasks(featureId, parsed) {
|
|
217
|
+
const phases = ['preparation', 'implementation', 'testing', 'documentation', 'finalization'];
|
|
218
|
+
const sourceTasks = parsed.bullets.length > 0 ? parsed.bullets : parsed.body.split('\n').filter((line) => line.trim());
|
|
219
|
+
const doc = {
|
|
220
|
+
schema_version: 1,
|
|
221
|
+
feature_id: featureId,
|
|
222
|
+
tasks: phases.map((phase, index) => {
|
|
223
|
+
const source = sourceTasks[index] || `${phase} migration task`;
|
|
224
|
+
return {
|
|
225
|
+
id: `${featureId}-MIG-${index + 1}`,
|
|
226
|
+
phase,
|
|
227
|
+
title: source.slice(0, 80),
|
|
228
|
+
description: source,
|
|
229
|
+
files_touched: [],
|
|
230
|
+
test_scripts: phase === 'testing'
|
|
231
|
+
? [{ command: 'pnpm test', type: 'test', expected: 'Migration validation passes.' }]
|
|
232
|
+
: [],
|
|
233
|
+
acceptance: `Migrated ${phase} task is reviewed for completeness.`,
|
|
234
|
+
status: 'pending',
|
|
235
|
+
};
|
|
236
|
+
}),
|
|
237
|
+
};
|
|
238
|
+
return withValidation('3-tasks.yaml', doc, [], workspaceTasksSchema);
|
|
239
|
+
}
|
|
240
|
+
function migrateChangelog(featureId, parsed) {
|
|
241
|
+
const entries = parsed.bullets.length > 0 ? parsed.bullets : [parsed.body || 'Legacy changelog migrated.'];
|
|
242
|
+
const doc = {
|
|
243
|
+
schema_version: 1,
|
|
244
|
+
feature_id: featureId,
|
|
245
|
+
entries: entries.map((details) => ({
|
|
246
|
+
timestamp: new Date().toISOString(),
|
|
247
|
+
action: 'migrated',
|
|
248
|
+
details,
|
|
249
|
+
refs: [],
|
|
250
|
+
})),
|
|
251
|
+
};
|
|
252
|
+
return withValidation('4-changelog.yaml', doc, [], workspaceChangelogSchema);
|
|
253
|
+
}
|
|
254
|
+
function migrateQuality(featureId, parsed) {
|
|
255
|
+
const missing = [];
|
|
256
|
+
const evidence = parsed.bullets.length > 0 ? parsed.bullets : [];
|
|
257
|
+
const doc = {
|
|
258
|
+
schema_version: 1,
|
|
259
|
+
feature_id: featureId,
|
|
260
|
+
coverage_targets: { unit: 95, integration: 95 },
|
|
261
|
+
validation_strategies: [
|
|
262
|
+
{
|
|
263
|
+
name: 'Migrated validation',
|
|
264
|
+
command: 'pnpm test',
|
|
265
|
+
expected: ensureText(featureId, 'validation_strategies[0].expected', section(parsed, ['validation', 'validacao', 'quality', 'qualidade']), 1, missing),
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
evidence_log: evidence.map((result) => ({
|
|
269
|
+
timestamp: new Date().toISOString(),
|
|
270
|
+
kind: 'migrated',
|
|
271
|
+
result,
|
|
272
|
+
})),
|
|
273
|
+
skill_evidence: {
|
|
274
|
+
required_skill_ids: [],
|
|
275
|
+
evidence: [],
|
|
276
|
+
verification_rule: 'No skill evidence required for migrated legacy workspaces.',
|
|
277
|
+
},
|
|
278
|
+
acceptance_matrix: [
|
|
279
|
+
{
|
|
280
|
+
criterion: 'migrated-quality-review',
|
|
281
|
+
status: evidence.length > 0 ? 'met' : 'not_met',
|
|
282
|
+
evidence: evidence.join('; ') || `${MIGRATION_MARKER}: quality evidence`,
|
|
283
|
+
},
|
|
284
|
+
],
|
|
285
|
+
exceptions: [],
|
|
286
|
+
remediation_policy: { on_coverage_miss: 'block', max_rounds: 3 },
|
|
287
|
+
traceability: {
|
|
288
|
+
spec_anchor: {
|
|
289
|
+
spec_updated_at: '',
|
|
290
|
+
changelog_refs: ['migrated'],
|
|
291
|
+
},
|
|
292
|
+
requirements: [],
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
return withValidation('5-quality.yaml', doc, missing, workspaceQualitySchema);
|
|
296
|
+
}
|
|
297
|
+
function section(parsed, names) {
|
|
298
|
+
for (const name of names) {
|
|
299
|
+
const value = parsed.sections.get(normalizeHeading(name));
|
|
300
|
+
if (value)
|
|
301
|
+
return value;
|
|
302
|
+
}
|
|
303
|
+
return '';
|
|
304
|
+
}
|
|
305
|
+
function normalizeHeading(value) {
|
|
306
|
+
return value
|
|
307
|
+
.normalize('NFD')
|
|
308
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
309
|
+
.trim()
|
|
310
|
+
.toLowerCase();
|
|
311
|
+
}
|
|
312
|
+
function ensureText(featureId, field, value, minLength, missing) {
|
|
313
|
+
const normalized = value.replace(/\s+/g, ' ').trim();
|
|
314
|
+
if (normalized.length >= minLength)
|
|
315
|
+
return normalized;
|
|
316
|
+
missing.push(field);
|
|
317
|
+
const fallback = `${MIGRATION_MARKER}: ${field} for ${featureId}. Review the migrated workspace and replace this placeholder with source-specific content before relying on the artifact.`;
|
|
318
|
+
return fallback.length >= minLength ? fallback : fallback.padEnd(minLength, '.');
|
|
319
|
+
}
|
|
320
|
+
function defaultGates() {
|
|
321
|
+
return {
|
|
322
|
+
proposta: { status: 'rascunho' },
|
|
323
|
+
planejamento: { status: 'rascunho' },
|
|
324
|
+
tarefas: { status: 'rascunho' },
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function withValidation(targetName, document, missingFields, schema) {
|
|
328
|
+
const validation = schema.safeParse(document);
|
|
329
|
+
return {
|
|
330
|
+
targetName,
|
|
331
|
+
document,
|
|
332
|
+
missingFields,
|
|
333
|
+
validationErrors: validation.success ? [] : [validation.error.message],
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
function renderYamlWithMigrationComments(document, missingFields) {
|
|
337
|
+
const comments = missingFields.map((field) => `${MIGRATION_MARKER}: ${field}`);
|
|
338
|
+
const prefix = comments.length > 0 ? `${comments.join('\n')}\n` : '';
|
|
339
|
+
return `${prefix}${stringifyYaml(document)}`;
|
|
340
|
+
}
|
|
341
|
+
function rel(paths, filePath) {
|
|
342
|
+
return path.relative(paths.projectRoot, filePath).replace(/\\/g, '/');
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=migrate-workspace.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const CURRENT_SDD_STATE_VERSION = 2;
|
|
2
|
+
export interface SddMigrationAssessment {
|
|
3
|
+
currentVersion: number;
|
|
4
|
+
targetVersion: number;
|
|
5
|
+
needsMigration: boolean;
|
|
6
|
+
reasons: string[];
|
|
7
|
+
conversions: Array<{
|
|
8
|
+
from: string;
|
|
9
|
+
to: string;
|
|
10
|
+
}>;
|
|
11
|
+
legacyRecords: string[];
|
|
12
|
+
workspaceMarkdownFiles: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function assessSddMigration(projectRoot: string): Promise<SddMigrationAssessment>;
|
|
15
|
+
export declare class SddMigrateCommand {
|
|
16
|
+
execute(projectRoot: string, options?: {
|
|
17
|
+
radToEpic?: boolean;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
converted: number;
|
|
20
|
+
messages: string[];
|
|
21
|
+
assessment: SddMigrationAssessment;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=migrate.d.ts.map
|