@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,219 @@
|
|
|
1
|
+
# Architecture And Governance
|
|
2
|
+
|
|
3
|
+
## Mission
|
|
4
|
+
|
|
5
|
+
This file defines the governance contract for engineering agents working in the DevTrack API. It protects architecture, quality, safety, and continuity across different assistants and automation hosts.
|
|
6
|
+
|
|
7
|
+
A good result is not only a working patch. A good result is scoped, validated, explainable, secure, reversible when practical, and aligned with the repository architecture.
|
|
8
|
+
|
|
9
|
+
## Authority
|
|
10
|
+
|
|
11
|
+
Use this precedence when context conflicts:
|
|
12
|
+
|
|
13
|
+
1. Current repository files for implementation facts.
|
|
14
|
+
2. Nearest `AGENTS.md` / `AGENT.md` for local agent instructions.
|
|
15
|
+
3. `.sdd/state/*.yaml` for operational state, planning, progress, dependencies, blockers, quality, and handoff.
|
|
16
|
+
4. `.sdd/core/*.md`, `.sdd/planning/*.md`, `.sdd/AGENT.md`, and `.sdd/README.md` as OpenSDD operational views and guides.
|
|
17
|
+
5. Skill reference files as architecture and quality policy.
|
|
18
|
+
6. Historical notes, generated summaries, or legacy docs only when confirmed by current repository evidence.
|
|
19
|
+
|
|
20
|
+
Do not let old notes override the codebase or OpenSDD. If useful legacy material exists, repatriate the decision into OpenSDD and remove or ignore the legacy artifact.
|
|
21
|
+
|
|
22
|
+
## Model Neutrality
|
|
23
|
+
|
|
24
|
+
Keep this skill portable across capable coding assistants and automation hosts.
|
|
25
|
+
|
|
26
|
+
- Do not depend on a specific model, vendor, chat product, IDE, proprietary runtime, or hidden tool.
|
|
27
|
+
- Do not encode assumptions about model capabilities, context windows, browsing, memory, or private scratchpads.
|
|
28
|
+
- Prefer repository commands, file paths, architecture rules, local configs, tests, and validation evidence over assistant-specific behavior.
|
|
29
|
+
- Treat files under `agents/` as packaging metadata only; do not make architecture guidance depend on them.
|
|
30
|
+
- If an assistant cannot perform a required command, it must report the limitation and use the smallest safe substitute. It must not fabricate output.
|
|
31
|
+
|
|
32
|
+
## Evidence And Truthfulness
|
|
33
|
+
|
|
34
|
+
Agents must be conservative with facts.
|
|
35
|
+
|
|
36
|
+
- Do not invent files, APIs, commands, flags, DTOs, classes, database columns, migrations, package scripts, environment variables, or cloud resources.
|
|
37
|
+
- Verify version-sensitive behavior from local files such as `package.json`, lockfiles, framework configs, migrations, source code, or official documentation when available.
|
|
38
|
+
- When evidence is incomplete, state the assumption and keep the implementation reversible and narrow.
|
|
39
|
+
- Never claim a command passed unless it was actually executed and completed successfully.
|
|
40
|
+
- Never hide failed checks. Either fix the issue or report the failure with the likely cause and impact.
|
|
41
|
+
|
|
42
|
+
## Required Operational Flow
|
|
43
|
+
|
|
44
|
+
Before edits:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
opensdd sdd onboard system
|
|
48
|
+
opensdd sdd next
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If `opensdd sdd next` returns a ready or active feature id:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
opensdd sdd context <FEAT-ID>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Also before edits:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git status --short
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Rules:
|
|
64
|
+
|
|
65
|
+
- Read nearest `AGENTS.md` and `AGENT.md` before editing.
|
|
66
|
+
- Inspect nearby files before introducing new patterns.
|
|
67
|
+
- If there is no feature id but the user explicitly asked for work outside SDD, state the exception in the final handoff.
|
|
68
|
+
- Create an OpenSDD insight or feature only when durable follow-up is required.
|
|
69
|
+
- Do not create external context notes, workflow state, backlog, project memory, scratchpads, or handoff stores.
|
|
70
|
+
- Do not use BRV.
|
|
71
|
+
|
|
72
|
+
The handoff must include command outputs that matter, why no SDD context was loaded when applicable, target files or external directory, key architecture decisions, validation evidence, skipped checks, and residual risk.
|
|
73
|
+
|
|
74
|
+
## Repository Safety
|
|
75
|
+
|
|
76
|
+
Protect the worktree and user changes.
|
|
77
|
+
|
|
78
|
+
- Never overwrite unrelated user changes in a dirty worktree.
|
|
79
|
+
- Do not run broad destructive commands such as `rm -rf`, `git reset --hard`, `git clean -fd`, force pushes, table drops, queue purges, or cloud deletion unless the user explicitly requested that exact class of action and the scope is clear.
|
|
80
|
+
- Prefer precise patches over wholesale rewrites unless replacing the file is safer and the file is fully owned by the task.
|
|
81
|
+
- Do not change generated, vendored, or dependency files unless the task requires it.
|
|
82
|
+
- Do not commit changes unless the user explicitly asks.
|
|
83
|
+
|
|
84
|
+
## Security And Privacy Baseline
|
|
85
|
+
|
|
86
|
+
- Never commit real secrets or credentials.
|
|
87
|
+
- Do not print `.env` values, tokens, private keys, connection strings, cookies, authorization headers, or provider credentials in handoff text.
|
|
88
|
+
- Update `.env.example` names when environment variable names change; do not copy real values.
|
|
89
|
+
- Keep authentication, authorization, tenancy, encryption, PII, audit logging, and retention changes explicitly validated.
|
|
90
|
+
- Avoid adding logs that expose personal data, secrets, prompts with sensitive content, internal lifecycle payloads, or full provider responses.
|
|
91
|
+
- Treat LLM prompts, tool schemas, vector-store payloads, and conversation transcripts as sensitive when they can contain business or personal data.
|
|
92
|
+
|
|
93
|
+
## Project Layers
|
|
94
|
+
|
|
95
|
+
Canonical folders:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
src/domain
|
|
99
|
+
src/application
|
|
100
|
+
src/presentation
|
|
101
|
+
src/infrastructure
|
|
102
|
+
src/shared
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Dependency rules:
|
|
106
|
+
|
|
107
|
+
- `domain` is the innermost layer. It contains business logic only.
|
|
108
|
+
- `domain` must not import from `application`, `presentation`, or `infrastructure`.
|
|
109
|
+
- `application` orchestrates domain logic. It must not import from `presentation` or concrete infrastructure.
|
|
110
|
+
- `presentation` receives and validates transport input. It depends on `application`; keep it thin.
|
|
111
|
+
- `infrastructure` implements ports and integrates frameworks, TypeORM, AWS, queues, cache, HTTP, LLMs, vector stores, Temporal, and settings.
|
|
112
|
+
- `shared` is for stable cross-cutting primitives, not a dumping ground.
|
|
113
|
+
|
|
114
|
+
## Application Module Shape
|
|
115
|
+
|
|
116
|
+
Every module under `src/application/<context>/<module>/` should follow this shape:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
ports/in
|
|
120
|
+
ports/out
|
|
121
|
+
use-cases
|
|
122
|
+
services
|
|
123
|
+
handlers
|
|
124
|
+
agents
|
|
125
|
+
tools
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The folders may start empty when the module does not need implementations yet. Do not create ad-hoc `ports` folders outside `ports/in` or `ports/out`.
|
|
129
|
+
|
|
130
|
+
Current contexts include:
|
|
131
|
+
|
|
132
|
+
- `src/application/business/*`
|
|
133
|
+
- `src/application/intelligence/*`
|
|
134
|
+
|
|
135
|
+
## Intelligence Architecture
|
|
136
|
+
|
|
137
|
+
The canonical intelligence boundary is:
|
|
138
|
+
|
|
139
|
+
- `src/application/intelligence/conversation/`: omnichannel boundary.
|
|
140
|
+
- `src/application/intelligence/report-chat/`: specialized capability.
|
|
141
|
+
- `src/application/intelligence/common/agent-runtime/`: generic runtime ownership.
|
|
142
|
+
- `src/domain/intelligence/`: single domain aggregate with `business-objects/`, `value-objects/`, and `types/`.
|
|
143
|
+
|
|
144
|
+
Compatibility only:
|
|
145
|
+
|
|
146
|
+
- `src/application/intelligence/agents/`
|
|
147
|
+
- `src/shared/agent/`
|
|
148
|
+
|
|
149
|
+
Do not add new ownership to compatibility layers.
|
|
150
|
+
|
|
151
|
+
Provider and model rules:
|
|
152
|
+
|
|
153
|
+
- Provider-specific SDKs, credentials, transport settings, retries, and rate-limit handling belong in infrastructure.
|
|
154
|
+
- Application owns provider-neutral ports, use cases, tool orchestration, and conversation semantics.
|
|
155
|
+
- Domain owns durable business concepts, not prompt mechanics.
|
|
156
|
+
- Prompt templates and tool schemas must not bypass domain or application invariants.
|
|
157
|
+
- Internal agent/tool failures must be handled explicitly and must not leak secrets or internal payloads to presentation.
|
|
158
|
+
|
|
159
|
+
## AWS Internal Lifecycle Rules
|
|
160
|
+
|
|
161
|
+
Internal AWS lifecycle integrations stay in:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
src/infrastructure/adapters/aws
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
They are consumed through application use cases and ports, not public endpoints.
|
|
168
|
+
|
|
169
|
+
EventBridge Scheduler, EventBridge, SNS, SQS, S3, Secrets Manager, and CloudWatch are infrastructure resources. Do not leak canonical internal lifecycle payloads into `presentation`.
|
|
170
|
+
|
|
171
|
+
The public EventBridge laboratory may live in:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
src/presentation/rest/aws-integrations
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
It must use its own test envelope and must not share the canonical internal lifecycle payload.
|
|
178
|
+
|
|
179
|
+
SQS lab processing belongs in `application`; polling, ack, retry, and DLQ handling belong in `infrastructure/adapters/aws/sqs`.
|
|
180
|
+
|
|
181
|
+
## Environment Governance
|
|
182
|
+
|
|
183
|
+
Development AWS uses:
|
|
184
|
+
|
|
185
|
+
- region: `us-east-1`
|
|
186
|
+
- profile: `devtrack`
|
|
187
|
+
|
|
188
|
+
Keep `.env` and `.env.example` names synchronized for:
|
|
189
|
+
|
|
190
|
+
- `AWS_ACCESS_KEY_ID`
|
|
191
|
+
- `AWS_SECRET_ACCESS_KEY`
|
|
192
|
+
- `AWS_S3_BUCKET`
|
|
193
|
+
- `AWS_EVENTBRIDGE_BUS_NAME`
|
|
194
|
+
- `AWS_ORCHESTRATION_SECRET_ID`
|
|
195
|
+
- `AWS_SNS_*`
|
|
196
|
+
- `AWS_SQS_*`
|
|
197
|
+
- `AWS_CLOUDWATCH_NAMESPACE`
|
|
198
|
+
|
|
199
|
+
Never commit real secrets.
|
|
200
|
+
|
|
201
|
+
## ORM Decision
|
|
202
|
+
|
|
203
|
+
Use TypeORM exclusively.
|
|
204
|
+
|
|
205
|
+
- Do not introduce Prisma.
|
|
206
|
+
- Do not use Prisma templates, migrations, clients, or schema files.
|
|
207
|
+
- Keep domain and application ORM-agnostic.
|
|
208
|
+
- Put ORM decorators and repositories only in infrastructure.
|
|
209
|
+
|
|
210
|
+
## Change Scope
|
|
211
|
+
|
|
212
|
+
Keep changes narrowly scoped:
|
|
213
|
+
|
|
214
|
+
- Add abstractions only when they reduce real duplication or match existing local patterns.
|
|
215
|
+
- Do not refactor unrelated modules while implementing a feature.
|
|
216
|
+
- Preserve user changes in a dirty worktree.
|
|
217
|
+
- When touching docs as part of SDD, update only docs affected by the feature.
|
|
218
|
+
- Prefer simple, observable changes over broad rewrites.
|
|
219
|
+
- Do not change public contracts unless the task requires it and tests/docs are updated accordingly.
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Domain Modeling
|
|
2
|
+
|
|
3
|
+
## Domain Intent
|
|
4
|
+
|
|
5
|
+
Domain code expresses business language, invariants, state transitions, and persistence contracts for aggregates. It must remain framework-free and portable.
|
|
6
|
+
|
|
7
|
+
Domain is the last place where business truth should be guessed. When a rule is unclear, inspect existing domain objects, tests, use cases, and SDD context before adding a new invariant.
|
|
8
|
+
|
|
9
|
+
## Domain Folder Choices
|
|
10
|
+
|
|
11
|
+
Use these folders by intent:
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
src/domain/<context>/types
|
|
15
|
+
src/domain/<context>/business-objects
|
|
16
|
+
src/domain/<context>/value-objects
|
|
17
|
+
src/domain/<context>/entities
|
|
18
|
+
src/domain/<context>/validators
|
|
19
|
+
src/domain/<context>/events
|
|
20
|
+
src/domain/<context>/repository-ports
|
|
21
|
+
src/domain/<context>/constants
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Use `business-objects/` and `value-objects/` for new canonical aggregate work, especially intelligence. Use `entities/` when extending a context that already uses domain entities, such as `pessoas` or `wallets`.
|
|
25
|
+
|
|
26
|
+
Do not create domain folders for transport, database, provider, prompt, SDK, queue, cache, HTTP, or UI concerns.
|
|
27
|
+
|
|
28
|
+
## Domain Decision Rules
|
|
29
|
+
|
|
30
|
+
Before adding a domain artifact, decide:
|
|
31
|
+
|
|
32
|
+
- Is this a durable business concept or just transport/persistence shape?
|
|
33
|
+
- Does it own invariants or only type information?
|
|
34
|
+
- Is it an aggregate/business object, value object, legacy entity, validator, event, constant, or repository port?
|
|
35
|
+
- Does existing domain language already cover it?
|
|
36
|
+
- Which tests should prove normalization, invalid paths, and immutability?
|
|
37
|
+
|
|
38
|
+
Keep names in domain language. Avoid DTO, HTTP, ORM, GraphQL, provider, LLM, queue, or database naming unless the business term itself requires it.
|
|
39
|
+
|
|
40
|
+
## Type Files: `.type.ts`
|
|
41
|
+
|
|
42
|
+
All domain type files end with `.type.ts`.
|
|
43
|
+
|
|
44
|
+
Use namespace style when a context has multiple related shapes:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
48
|
+
export namespace ExampleType {
|
|
49
|
+
export type Status = 'draft' | 'active' | 'completed';
|
|
50
|
+
|
|
51
|
+
export type Input = {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
status?: Status;
|
|
55
|
+
createdAt?: Date;
|
|
56
|
+
updatedAt?: Date | null;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export type Output = {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
status: Status;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date | null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type Repository = Output;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Use interfaces for simpler legacy contexts:
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
export type PessoaId = string;
|
|
75
|
+
|
|
76
|
+
export interface PessoaProps {
|
|
77
|
+
id: PessoaId;
|
|
78
|
+
nome: string;
|
|
79
|
+
email: string;
|
|
80
|
+
telefone: string;
|
|
81
|
+
isActive: boolean;
|
|
82
|
+
imagemUrl?: string | null;
|
|
83
|
+
createdAt?: Date;
|
|
84
|
+
updatedAt?: Date | null;
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Rules:
|
|
89
|
+
|
|
90
|
+
- Keep type files framework-free.
|
|
91
|
+
- Prefer domain language over transport/database names.
|
|
92
|
+
- Use `Date` in domain outputs where the domain needs time values.
|
|
93
|
+
- Keep persistence shape explicit as `Repository` when mapping to infrastructure.
|
|
94
|
+
- Avoid DTO, HTTP, ORM, GraphQL, class-validator, provider, SDK, queue, cache, and prompt concepts.
|
|
95
|
+
- Represent optional and nullable values deliberately; do not conflate `undefined` and `null` when persistence depends on the distinction.
|
|
96
|
+
|
|
97
|
+
## Business Objects: `.bo.ts`
|
|
98
|
+
|
|
99
|
+
Use `.bo.ts` for aggregate/business objects with behavior and invariants.
|
|
100
|
+
|
|
101
|
+
Recommended shape:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import { GenericBusinessObject } from '@domain/generic-business-object';
|
|
105
|
+
import { BusinessValidationException } from '@domain/exceptions/business-validation.exception';
|
|
106
|
+
import type { ExampleType } from '@domain/example/types/example.type';
|
|
107
|
+
import { ExampleName } from '@domain/example/value-objects/example-name.vo';
|
|
108
|
+
import { ValidationBuilder, type IValidator } from '@shared/domain/validators';
|
|
109
|
+
|
|
110
|
+
export interface ExampleInterface {
|
|
111
|
+
readonly value: ExampleType.Output;
|
|
112
|
+
readonly id: string;
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly createdAt: Date;
|
|
115
|
+
readonly updatedAt: Date | null;
|
|
116
|
+
rename(name: string): Example;
|
|
117
|
+
toPersistenceObject(): ExampleType.Repository;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export class Example
|
|
121
|
+
extends GenericBusinessObject<ExampleType.Output>
|
|
122
|
+
implements ExampleInterface, IValidator
|
|
123
|
+
{
|
|
124
|
+
constructor(data: ExampleType.Input | ExampleType.Output) {
|
|
125
|
+
super(Example.loadData(data));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
static loadData(data: ExampleType.Input | ExampleType.Output): ExampleType.Output {
|
|
129
|
+
return {
|
|
130
|
+
...data,
|
|
131
|
+
name: ExampleName.create(data.name).getValue(),
|
|
132
|
+
status: 'status' in data && data.status ? data.status : 'draft',
|
|
133
|
+
createdAt: data.createdAt ? new Date(data.createdAt) : new Date(),
|
|
134
|
+
updatedAt: data.updatedAt ? new Date(data.updatedAt) : null,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
public validate(props: ExampleType.Output = this.value): void {
|
|
139
|
+
ValidationBuilder.of({ value: props.id, fieldName: 'id' })
|
|
140
|
+
.required('Identificador e obrigatorio')
|
|
141
|
+
.of({ value: props.name, fieldName: 'name' })
|
|
142
|
+
.required('Nome e obrigatorio')
|
|
143
|
+
.of({ value: props.createdAt, fieldName: 'createdAt' })
|
|
144
|
+
.required('createdAt e obrigatorio')
|
|
145
|
+
.date('createdAt deve ser uma data valida')
|
|
146
|
+
.build('Example invalido');
|
|
147
|
+
|
|
148
|
+
ExampleName.create(props.name);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
protected transform(props: ExampleType.Output): ExampleType.Output {
|
|
152
|
+
return {
|
|
153
|
+
...props,
|
|
154
|
+
name: ExampleName.create(props.name).getValue(),
|
|
155
|
+
createdAt: new Date(props.createdAt),
|
|
156
|
+
updatedAt: props.updatedAt ? new Date(props.updatedAt) : null,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
get id(): string {
|
|
161
|
+
return this.value.id;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
get name(): string {
|
|
165
|
+
return this.value.name;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
get createdAt(): Date {
|
|
169
|
+
return new Date(this.value.createdAt);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
get updatedAt(): Date | null {
|
|
173
|
+
return this.value.updatedAt ? new Date(this.value.updatedAt) : null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
rename(name: string): Example {
|
|
177
|
+
if (!name.trim()) {
|
|
178
|
+
throw new BusinessValidationException('Nome invalido', {
|
|
179
|
+
name: ['Nome e obrigatorio'],
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return new Example({
|
|
184
|
+
...this.value,
|
|
185
|
+
name,
|
|
186
|
+
updatedAt: new Date(),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
toPersistenceObject(): ExampleType.Repository {
|
|
191
|
+
return {
|
|
192
|
+
id: this.id,
|
|
193
|
+
name: this.name,
|
|
194
|
+
status: this.value.status,
|
|
195
|
+
createdAt: this.createdAt,
|
|
196
|
+
updatedAt: this.updatedAt,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Rules:
|
|
203
|
+
|
|
204
|
+
- Extend `GenericBusinessObject<T>` when the object owns invariants.
|
|
205
|
+
- Implement `IValidator` when following the canonical BO pattern.
|
|
206
|
+
- Validate before transform through `GenericBusinessObject` constructor behavior.
|
|
207
|
+
- Normalize data in `loadData` or `transform`.
|
|
208
|
+
- Expose read-only getters; clone arrays/objects/dates to avoid external mutation.
|
|
209
|
+
- Business methods should return a new instance unless the surrounding context already uses mutation.
|
|
210
|
+
- `toPersistenceObject()` must return domain persistence data, not a TypeORM entity.
|
|
211
|
+
- Throw domain exceptions, usually `BusinessValidationException`, not HTTP exceptions.
|
|
212
|
+
- Do not inject repositories, services, loggers, config, SDKs, or framework dependencies into domain objects.
|
|
213
|
+
- Do not publish events, send messages, call providers, or persist data from the domain object directly.
|
|
214
|
+
|
|
215
|
+
## Value Objects: `.vo.ts`
|
|
216
|
+
|
|
217
|
+
Use `.vo.ts` for normalized, comparable, validated scalar/domain values.
|
|
218
|
+
|
|
219
|
+
Recommended shape:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
import { BusinessValidationException } from '@domain/exceptions/business-validation.exception';
|
|
223
|
+
|
|
224
|
+
export class ExampleName {
|
|
225
|
+
private constructor(private readonly value: string) {}
|
|
226
|
+
|
|
227
|
+
static create(input: string): ExampleName {
|
|
228
|
+
const normalized = ExampleName.normalize(input);
|
|
229
|
+
|
|
230
|
+
if (!ExampleName.isValid(normalized)) {
|
|
231
|
+
throw new BusinessValidationException('Nome invalido', {
|
|
232
|
+
name: ['Nome deve ter entre 2 e 120 caracteres'],
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return new ExampleName(normalized);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
static normalize(input: string): string {
|
|
240
|
+
return String(input ?? '').trim();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
static isValid(input: string): boolean {
|
|
244
|
+
return input.length >= 2 && input.length <= 120;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
getValue(): string {
|
|
248
|
+
return this.value;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
toString(): string {
|
|
252
|
+
return this.value;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
equals(other: ExampleName): boolean {
|
|
256
|
+
return this.value === other.value;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Rules:
|
|
262
|
+
|
|
263
|
+
- Private constructor.
|
|
264
|
+
- `create`, `normalize`, `isValid`, `getValue`, `toString`, `equals`.
|
|
265
|
+
- Normalize before validating.
|
|
266
|
+
- Keep VOs framework-free.
|
|
267
|
+
- Prefer existing shared VOs when available, such as `Email` and `Telefone`.
|
|
268
|
+
- Avoid returning mutable internal objects. Clone dates, arrays, and object values.
|
|
269
|
+
|
|
270
|
+
## Validators
|
|
271
|
+
|
|
272
|
+
Use validators when validation is large or reused:
|
|
273
|
+
|
|
274
|
+
```text
|
|
275
|
+
src/domain/<context>/validators/<name>.validator.ts
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Pattern:
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
import type { PessoaProps } from '@domain/pessoas/types/pessoa.type';
|
|
282
|
+
import { ValidationBuilder } from '@shared/domain/validators';
|
|
283
|
+
|
|
284
|
+
export class PessoaValidator {
|
|
285
|
+
static validate(props: PessoaProps): void {
|
|
286
|
+
ValidationBuilder.of({ value: props.id, fieldName: 'id' })
|
|
287
|
+
.required('ID deve ser um UUID valido')
|
|
288
|
+
.uuid('ID deve ser um UUID valido')
|
|
289
|
+
.build('Business validation failed');
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Presentation validators must not replace domain validators. Presentation validates request shape; domain validates business invariants.
|
|
295
|
+
|
|
296
|
+
## Repository Ports
|
|
297
|
+
|
|
298
|
+
Repository ports belong in domain when they represent domain aggregate persistence:
|
|
299
|
+
|
|
300
|
+
```text
|
|
301
|
+
src/domain/<context>/repository-ports/<name>-repository.port.ts
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Pattern:
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
import type { Example } from '@domain/example/business-objects/example.bo';
|
|
308
|
+
|
|
309
|
+
export const ExampleRepositoryPortSymbol = Symbol('ExampleRepositoryPortSymbol');
|
|
310
|
+
|
|
311
|
+
export interface ExampleRepositoryPort {
|
|
312
|
+
save(example: Example): Promise<Example>;
|
|
313
|
+
findById(id: string): Promise<Example | null>;
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Rules:
|
|
318
|
+
|
|
319
|
+
- Export a `Symbol` and an interface.
|
|
320
|
+
- Return domain objects, not ORM entities.
|
|
321
|
+
- Keep persistence technology out of the port name, except implementation names in infrastructure.
|
|
322
|
+
- Application ports can also describe repositories when the persistence need is application-specific rather than aggregate-owned. Follow existing module patterns.
|
|
323
|
+
- Do not expose query builders, transactions, connection objects, ORM entities, or provider SDK types through domain ports.
|
|
324
|
+
|
|
325
|
+
## Domain Events
|
|
326
|
+
|
|
327
|
+
Use domain events for business facts:
|
|
328
|
+
|
|
329
|
+
```text
|
|
330
|
+
src/domain/<context>/events/<name>-created.event.ts
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Keep events serializable and framework-free:
|
|
334
|
+
|
|
335
|
+
```ts
|
|
336
|
+
export type ExampleCreatedDomainEvent = {
|
|
337
|
+
exampleId: string;
|
|
338
|
+
occurredOn: Date;
|
|
339
|
+
};
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Rules:
|
|
343
|
+
|
|
344
|
+
- Events describe something that already happened in business language.
|
|
345
|
+
- Keep payloads minimal and serializable.
|
|
346
|
+
- Publish events from application use cases through an output port.
|
|
347
|
+
- Do not publish from the domain object directly.
|
|
348
|
+
- Do not include secrets, provider raw responses, or transport-specific envelopes in domain events.
|
|
349
|
+
|
|
350
|
+
## Domain Test Expectations
|
|
351
|
+
|
|
352
|
+
Domain changes should be covered by focused tests for:
|
|
353
|
+
|
|
354
|
+
- required fields and invalid values,
|
|
355
|
+
- normalization,
|
|
356
|
+
- immutable getters and cloned mutable values,
|
|
357
|
+
- business methods and state transitions,
|
|
358
|
+
- exception types and relevant error payloads,
|
|
359
|
+
- repository port contracts only when the change alters expected behavior.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Implementation Checklist
|
|
2
|
+
|
|
3
|
+
## Before Editing
|
|
4
|
+
|
|
5
|
+
- Read nearest `AGENTS.md` and `AGENT.md`.
|
|
6
|
+
- Run `opensdd sdd onboard system`.
|
|
7
|
+
- Run `opensdd sdd next`.
|
|
8
|
+
- Run `opensdd sdd context <FEAT-ID>` if a feature id is available.
|
|
9
|
+
- Check `git status --short`.
|
|
10
|
+
- Inspect nearby files before creating new patterns.
|
|
11
|
+
- Identify user changes in the dirty worktree and avoid overwriting them.
|
|
12
|
+
- If SDD has no ready feature and work proceeds because the user explicitly requested it, state that exception in the final handoff and create an OpenSDD insight/feature only when durable follow-up is required.
|
|
13
|
+
- Do not persist planning, backlog, workflow status, project memory, scratchpad, or handoff in external context stores.
|
|
14
|
+
|
|
15
|
+
## Task Understanding
|
|
16
|
+
|
|
17
|
+
- Restate the target outcome internally before editing.
|
|
18
|
+
- Identify whether the change is feature work, bug fix, refactor, docs-only, test-only, or operational support.
|
|
19
|
+
- Confirm the repository evidence needed for version-sensitive behavior.
|
|
20
|
+
- Keep the scope narrow; do not repair unrelated architecture unless it blocks the requested work.
|
|
21
|
+
- Prefer local patterns over generic best practices when both are valid.
|
|
22
|
+
|
|
23
|
+
## Design Slice
|
|
24
|
+
|
|
25
|
+
- Identify touched layers.
|
|
26
|
+
- Start from domain unless the task is purely presentation/infrastructure.
|
|
27
|
+
- Decide whether new files belong to `business` or `intelligence`.
|
|
28
|
+
- Decide whether the domain concept is a `.bo.ts`, `.vo.ts`, `.entity.ts`, or only a `.type.ts`.
|
|
29
|
+
- Decide whether persistence needs a domain repository port or an application output port.
|
|
30
|
+
- Decide whether a public endpoint is appropriate. Internal AWS lifecycle work should not get public endpoints.
|
|
31
|
+
- Decide whether the change affects API contracts, migrations, environment variables, queues, LLM tools, prompts, or security-sensitive behavior.
|
|
32
|
+
|
|
33
|
+
## Domain Pass
|
|
34
|
+
|
|
35
|
+
- Types end with `.type.ts`.
|
|
36
|
+
- BO files end with `.bo.ts`.
|
|
37
|
+
- VO files end with `.vo.ts`.
|
|
38
|
+
- No Nest, TypeORM, class-validator, HTTP, AWS, queue, cache, LLM, vector store, SDK, or presentation concepts.
|
|
39
|
+
- Invariants live in BO/VO/validator.
|
|
40
|
+
- VOs normalize before validating.
|
|
41
|
+
- BOs expose getters and clone mutable data.
|
|
42
|
+
- Repository ports return domain objects.
|
|
43
|
+
- Domain events are serializable and framework-free.
|
|
44
|
+
- Domain exceptions are used instead of HTTP exceptions.
|
|
45
|
+
|
|
46
|
+
## Application Pass
|
|
47
|
+
|
|
48
|
+
- Module shape uses `ports/in`, `ports/out`, `use-cases`, `services`, `handlers`, `agents`, `tools`.
|
|
49
|
+
- Use cases end with `.use-case.ts`.
|
|
50
|
+
- Services end with `.service.ts`.
|
|
51
|
+
- Handlers end with `.handler.ts`.
|
|
52
|
+
- Input ports export `Symbol` plus interface.
|
|
53
|
+
- Output ports export `Symbol` plus interface.
|
|
54
|
+
- Use cases orchestrate domain and ports only.
|
|
55
|
+
- No presentation imports.
|
|
56
|
+
- No concrete infrastructure adapter imports.
|
|
57
|
+
- Floating background promises are explicitly caught.
|
|
58
|
+
- Application module wires providers and exports port symbols.
|
|
59
|
+
- Agent/tool orchestration uses ports and does not expose provider-specific internals.
|
|
60
|
+
|
|
61
|
+
## Presentation Pass
|
|
62
|
+
|
|
63
|
+
- One controller per file.
|
|
64
|
+
- One public route method per controller.
|
|
65
|
+
- Controllers inject application input ports.
|
|
66
|
+
- Controllers do mapping only.
|
|
67
|
+
- Presentation validators use class-validator and Swagger for request shape only.
|
|
68
|
+
- No TypeORM entities or repositories.
|
|
69
|
+
- No provider SDKs, queue clients, AWS clients, or LLM clients.
|
|
70
|
+
- No business rules that bypass domain.
|
|
71
|
+
- No internal lifecycle payloads exposed publicly.
|
|
72
|
+
- Module imports `ApplicationModule` and registers controllers.
|
|
73
|
+
|
|
74
|
+
## Infrastructure And TypeORM Pass
|
|
75
|
+
|
|
76
|
+
- TypeORM entity ends with `.orm-entity.ts`.
|
|
77
|
+
- Repository ends with `.typeorm-repository.ts`.
|
|
78
|
+
- Mapper ends with `.mapper.ts`.
|
|
79
|
+
- Repository implements a port.
|
|
80
|
+
- Mapper is stateless and maps domain <-> ORM only.
|
|
81
|
+
- New entity is added to TypeORM config, CLI datasource, root module, ORM feature module, and infrastructure module as needed.
|
|
82
|
+
- Migration SQL matches entity decorators.
|
|
83
|
+
- Unique violations are translated to domain/shared exceptions.
|
|
84
|
+
- No Prisma artifacts.
|
|
85
|
+
- Settings remain centralized in infrastructure.
|
|
86
|
+
- Provider credentials, SDK clients, retries, rate limits, queue polling, ack, retry, and DLQ handling stay in infrastructure.
|
|
87
|
+
|
|
88
|
+
## Imports And Lint Pass
|
|
89
|
+
|
|
90
|
+
- No relative imports.
|
|
91
|
+
- Use path aliases.
|
|
92
|
+
- Use `import type` for type-only imports.
|
|
93
|
+
- Domain imports only domain/shared-domain.
|
|
94
|
+
- Application imports no presentation or concrete infrastructure.
|
|
95
|
+
- Presentation imports no concrete infrastructure.
|
|
96
|
+
- No unused variables unless intentionally prefixed `_`.
|
|
97
|
+
- No unsafe `any` unless narrowly justified.
|
|
98
|
+
- No unhandled promises.
|
|
99
|
+
- No broad lint disables without a narrow reason.
|
|
100
|
+
|
|
101
|
+
## Security And Data Pass
|
|
102
|
+
|
|
103
|
+
- No secrets, tokens, private keys, cookies, credentials, or connection strings are added to code, tests, docs, logs, prompts, or handoff.
|
|
104
|
+
- `.env.example` is updated when variable names change; `.env` real values are not copied.
|
|
105
|
+
- Logs avoid sensitive payloads, raw prompts, full provider responses, and personal data unless existing policy allows it.
|
|
106
|
+
- Auth, authorization, tenancy, encryption, PII, retention, and audit behavior are unchanged unless the task requires it.
|
|
107
|
+
- Destructive operations are not executed unless explicitly requested and scoped.
|
|
108
|
+
- Public endpoints do not expose internal lifecycle envelopes or infrastructure payloads.
|
|
109
|
+
|
|
110
|
+
## Validation Pass
|
|
111
|
+
|
|
112
|
+
- Run targeted tests for changed files.
|
|
113
|
+
- Run `pnpm lint` for import/layer/lint-sensitive changes.
|
|
114
|
+
- Run `pnpm build` for module wiring, TypeORM, path aliases, or cross-layer changes.
|
|
115
|
+
- Run e2e only when user-facing behavior needs it or the feature already has e2e coverage.
|
|
116
|
+
- Update SDD quality/frontend impact/finalize only when feature completion is in scope.
|
|
117
|
+
- If a command fails, fix it or report the failure, cause, and impact.
|
|
118
|
+
- Do not claim validation passed without real command output.
|
|
119
|
+
|
|
120
|
+
## Final Response
|
|
121
|
+
|
|
122
|
+
- Mention files or areas changed.
|
|
123
|
+
- Mention validation commands and results.
|
|
124
|
+
- Mention skipped checks with a reason.
|
|
125
|
+
- Mention any SDD exception if applicable.
|
|
126
|
+
- Mention residual risk when validation was partial or assumptions remain.
|
|
127
|
+
- Keep the handoff concise, factual, and reproducible.
|