@sk8metal/michi-cli 0.14.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +268 -2
- package/README.md +27 -2
- package/dist/scripts/config/config-schema.d.ts +5 -333
- package/dist/scripts/config/config-schema.d.ts.map +1 -1
- package/dist/scripts/config/config-schema.js +6 -233
- package/dist/scripts/config/config-schema.js.map +1 -1
- package/dist/scripts/config-global.d.ts.map +1 -1
- package/dist/scripts/config-global.js +3 -2
- package/dist/scripts/config-global.js.map +1 -1
- package/dist/scripts/confluence-sync.d.ts +5 -73
- package/dist/scripts/confluence-sync.d.ts.map +1 -1
- package/dist/scripts/confluence-sync.js +14 -392
- package/dist/scripts/confluence-sync.js.map +1 -1
- package/dist/scripts/constants/environments.d.ts +3 -30
- package/dist/scripts/constants/environments.d.ts.map +1 -1
- package/dist/scripts/constants/environments.js +3 -41
- package/dist/scripts/constants/environments.js.map +1 -1
- package/dist/scripts/constants/languages.d.ts +3 -20
- package/dist/scripts/constants/languages.d.ts.map +1 -1
- package/dist/scripts/constants/languages.js +3 -50
- package/dist/scripts/constants/languages.js.map +1 -1
- package/dist/scripts/constants/test-commands.d.ts +3 -33
- package/dist/scripts/constants/test-commands.d.ts.map +1 -1
- package/dist/scripts/constants/test-commands.js +3 -67
- package/dist/scripts/constants/test-commands.js.map +1 -1
- package/dist/scripts/dev-tools/mermaid-converter.d.ts.map +1 -0
- package/dist/scripts/dev-tools/mermaid-converter.js.map +1 -0
- package/dist/scripts/dev-tools/test-interactive.d.ts.map +1 -0
- package/dist/scripts/{test-interactive.js → dev-tools/test-interactive.js} +4 -3
- package/dist/scripts/dev-tools/test-interactive.js.map +1 -0
- package/dist/scripts/github-actions-client.d.ts +5 -75
- package/dist/scripts/github-actions-client.d.ts.map +1 -1
- package/dist/scripts/github-actions-client.js +4 -178
- package/dist/scripts/github-actions-client.js.map +1 -1
- package/dist/scripts/jira-sync.d.ts +3 -121
- package/dist/scripts/jira-sync.d.ts.map +1 -1
- package/dist/scripts/jira-sync.js +5 -879
- package/dist/scripts/jira-sync.js.map +1 -1
- package/dist/scripts/markdown-to-confluence.d.ts.map +1 -1
- package/dist/scripts/markdown-to-confluence.js +2 -2
- package/dist/scripts/markdown-to-confluence.js.map +1 -1
- package/dist/scripts/multi-project-estimate.d.ts.map +1 -1
- package/dist/scripts/multi-project-estimate.js +3 -2
- package/dist/scripts/multi-project-estimate.js.map +1 -1
- package/dist/scripts/phase-runner.d.ts.map +1 -1
- package/dist/scripts/phase-runner.js +34 -18
- package/dist/scripts/phase-runner.js.map +1 -1
- package/dist/scripts/pre-flight-check.d.ts.map +1 -1
- package/dist/scripts/pre-flight-check.js +27 -11
- package/dist/scripts/pre-flight-check.js.map +1 -1
- package/dist/scripts/template/multi-repo-renderer.js +2 -2
- package/dist/scripts/template/multi-repo-renderer.js.map +1 -1
- package/dist/scripts/test-execution-generator.d.ts.map +1 -1
- package/dist/scripts/test-execution-generator.js +5 -4
- package/dist/scripts/test-execution-generator.js.map +1 -1
- package/dist/scripts/utils/aidlc-parser.d.ts +5 -82
- package/dist/scripts/utils/aidlc-parser.d.ts.map +1 -1
- package/dist/scripts/utils/aidlc-parser.js +4 -204
- package/dist/scripts/utils/aidlc-parser.js.map +1 -1
- package/dist/scripts/utils/ci-generator.d.ts.map +1 -1
- package/dist/scripts/utils/ci-generator.js +4 -3
- package/dist/scripts/utils/ci-generator.js.map +1 -1
- package/dist/scripts/utils/config-loader.d.ts.map +1 -1
- package/dist/scripts/utils/config-loader.js +46 -49
- package/dist/scripts/utils/config-loader.js.map +1 -1
- package/dist/scripts/utils/config-validator.d.ts +9 -10
- package/dist/scripts/utils/config-validator.d.ts.map +1 -1
- package/dist/scripts/utils/config-validator.js +68 -70
- package/dist/scripts/utils/config-validator.js.map +1 -1
- package/dist/scripts/utils/docker-requirement-detector.d.ts.map +1 -1
- package/dist/scripts/utils/docker-requirement-detector.js +5 -4
- package/dist/scripts/utils/docker-requirement-detector.js.map +1 -1
- package/dist/scripts/utils/env-config.d.ts.map +1 -1
- package/dist/scripts/utils/env-config.js +55 -38
- package/dist/scripts/utils/env-config.js.map +1 -1
- package/dist/scripts/utils/feature-name-validator.d.ts +4 -9
- package/dist/scripts/utils/feature-name-validator.d.ts.map +1 -1
- package/dist/scripts/utils/feature-name-validator.js +12 -21
- package/dist/scripts/utils/feature-name-validator.js.map +1 -1
- package/dist/scripts/utils/interactive-helpers.d.ts +5 -29
- package/dist/scripts/utils/interactive-helpers.d.ts.map +1 -1
- package/dist/scripts/utils/interactive-helpers.js +5 -89
- package/dist/scripts/utils/interactive-helpers.js.map +1 -1
- package/dist/scripts/utils/language-detector.d.ts.map +1 -1
- package/dist/scripts/utils/language-detector.js +4 -3
- package/dist/scripts/utils/language-detector.js.map +1 -1
- package/dist/scripts/utils/markdown-parser.d.ts +6 -52
- package/dist/scripts/utils/markdown-parser.d.ts.map +1 -1
- package/dist/scripts/utils/markdown-parser.js +5 -286
- package/dist/scripts/utils/markdown-parser.js.map +1 -1
- package/dist/scripts/utils/multi-repo-validator.d.ts +9 -10
- package/dist/scripts/utils/multi-repo-validator.d.ts.map +1 -1
- package/dist/scripts/utils/multi-repo-validator.js +15 -17
- package/dist/scripts/utils/multi-repo-validator.js.map +1 -1
- package/dist/scripts/utils/project-analyzer.d.ts +120 -0
- package/dist/scripts/utils/project-analyzer.d.ts.map +1 -0
- package/dist/scripts/utils/project-analyzer.js +358 -0
- package/dist/scripts/utils/project-analyzer.js.map +1 -0
- package/dist/scripts/utils/project-detector.d.ts.map +1 -1
- package/dist/scripts/utils/project-detector.js +6 -5
- package/dist/scripts/utils/project-detector.js.map +1 -1
- package/dist/scripts/utils/project-finder.d.ts +1 -21
- package/dist/scripts/utils/project-finder.d.ts.map +1 -1
- package/dist/scripts/utils/project-finder.js +2 -121
- package/dist/scripts/utils/project-finder.js.map +1 -1
- package/dist/scripts/utils/project-meta.d.ts +4 -27
- package/dist/scripts/utils/project-meta.d.ts.map +1 -1
- package/dist/scripts/utils/project-meta.js +3 -67
- package/dist/scripts/utils/project-meta.js.map +1 -1
- package/dist/scripts/utils/safe-file-reader.d.ts +84 -0
- package/dist/scripts/utils/safe-file-reader.d.ts.map +1 -0
- package/dist/scripts/utils/safe-file-reader.js +122 -0
- package/dist/scripts/utils/safe-file-reader.js.map +1 -0
- package/dist/scripts/utils/security-validator.d.ts +8 -19
- package/dist/scripts/utils/security-validator.d.ts.map +1 -1
- package/dist/scripts/utils/security-validator.js +28 -58
- package/dist/scripts/utils/security-validator.js.map +1 -1
- package/dist/scripts/utils/spec-archiver.d.ts.map +1 -1
- package/dist/scripts/utils/spec-archiver.js +7 -6
- package/dist/scripts/utils/spec-archiver.js.map +1 -1
- package/dist/scripts/utils/spec-updater.d.ts.map +1 -1
- package/dist/scripts/utils/spec-updater.js +10 -7
- package/dist/scripts/utils/spec-updater.js.map +1 -1
- package/dist/scripts/utils/tasks-converter.js +2 -2
- package/dist/scripts/utils/tasks-converter.js.map +1 -1
- package/dist/scripts/utils/tasks-format-validator.js +4 -4
- package/dist/scripts/utils/tasks-format-validator.js.map +1 -1
- package/dist/scripts/utils/template-applier.d.ts.map +1 -1
- package/dist/scripts/utils/template-applier.js +4 -3
- package/dist/scripts/utils/template-applier.js.map +1 -1
- package/dist/scripts/utils/types/validation.d.ts +57 -0
- package/dist/scripts/utils/types/validation.d.ts.map +1 -0
- package/dist/scripts/utils/types/validation.js +50 -0
- package/dist/scripts/utils/types/validation.js.map +1 -0
- package/dist/scripts/validate-phase.d.ts +6 -1
- package/dist/scripts/validate-phase.d.ts.map +1 -1
- package/dist/scripts/validate-phase.js +42 -20
- package/dist/scripts/validate-phase.js.map +1 -1
- package/dist/scripts/workflow-orchestrator.d.ts +4 -40
- package/dist/scripts/workflow-orchestrator.d.ts.map +1 -1
- package/dist/scripts/workflow-orchestrator.js +7 -194
- package/dist/scripts/workflow-orchestrator.js.map +1 -1
- package/dist/src/application/interfaces/config-provider.d.ts +89 -0
- package/dist/src/application/interfaces/config-provider.d.ts.map +1 -0
- package/dist/src/application/interfaces/config-provider.js +8 -0
- package/dist/src/application/interfaces/config-provider.js.map +1 -0
- package/dist/src/application/interfaces/external-api.d.ts +80 -0
- package/dist/src/application/interfaces/external-api.d.ts.map +1 -0
- package/dist/src/application/interfaces/external-api.js +8 -0
- package/dist/src/application/interfaces/external-api.js.map +1 -0
- package/dist/src/application/interfaces/spec-repository.d.ts +52 -0
- package/dist/src/application/interfaces/spec-repository.d.ts.map +1 -0
- package/dist/src/application/interfaces/spec-repository.js +8 -0
- package/dist/src/application/interfaces/spec-repository.js.map +1 -0
- package/dist/src/application/services/spec-service.d.ts +49 -0
- package/dist/src/application/services/spec-service.d.ts.map +1 -0
- package/dist/src/application/services/spec-service.js +94 -0
- package/dist/src/application/services/spec-service.js.map +1 -0
- package/dist/src/application/services/workflow-service.d.ts +58 -0
- package/dist/src/application/services/workflow-service.d.ts.map +1 -0
- package/dist/src/application/services/workflow-service.js +125 -0
- package/dist/src/application/services/workflow-service.js.map +1 -0
- package/dist/src/application/templates/processor.d.ts +31 -0
- package/dist/src/application/templates/processor.d.ts.map +1 -0
- package/dist/src/application/templates/processor.js +58 -0
- package/dist/src/application/templates/processor.js.map +1 -0
- package/dist/src/application/use-cases/spec/archive-spec.d.ts +34 -0
- package/dist/src/application/use-cases/spec/archive-spec.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/archive-spec.js +56 -0
- package/dist/src/application/use-cases/spec/archive-spec.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-design.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-design.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-design.js +58 -0
- package/dist/src/application/use-cases/spec/generate-design.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-requirements.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-requirements.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-requirements.js +58 -0
- package/dist/src/application/use-cases/spec/generate-requirements.js.map +1 -0
- package/dist/src/application/use-cases/spec/generate-tasks.d.ts +34 -0
- package/dist/src/application/use-cases/spec/generate-tasks.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/generate-tasks.js +58 -0
- package/dist/src/application/use-cases/spec/generate-tasks.js.map +1 -0
- package/dist/src/application/use-cases/spec/init-spec.d.ts +48 -0
- package/dist/src/application/use-cases/spec/init-spec.d.ts.map +1 -0
- package/dist/src/application/use-cases/spec/init-spec.js +121 -0
- package/dist/src/application/use-cases/spec/init-spec.js.map +1 -0
- package/dist/src/cli.d.ts +6 -7
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +6 -745
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/config-validate.js +2 -2
- package/dist/src/commands/init.d.ts +6 -21
- package/dist/src/commands/init.d.ts.map +1 -1
- package/dist/src/commands/init.js +5 -508
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/migrate.js +4 -3
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/spec-archive.d.ts +6 -13
- package/dist/src/commands/spec-archive.d.ts.map +1 -1
- package/dist/src/commands/spec-archive.js +5 -36
- package/dist/src/commands/spec-archive.js.map +1 -1
- package/dist/src/commands/spec-list.d.ts +6 -11
- package/dist/src/commands/spec-list.d.ts.map +1 -1
- package/dist/src/commands/spec-list.js +5 -51
- package/dist/src/commands/spec-list.js.map +1 -1
- package/dist/src/domain/constants/approval.d.ts +18 -0
- package/dist/src/domain/constants/approval.d.ts.map +1 -0
- package/dist/src/domain/constants/approval.js +23 -0
- package/dist/src/domain/constants/approval.js.map +1 -0
- package/dist/src/domain/constants/environments.d.ts +33 -0
- package/dist/src/domain/constants/environments.d.ts.map +1 -0
- package/dist/src/domain/constants/environments.js +44 -0
- package/dist/src/domain/constants/environments.js.map +1 -0
- package/dist/src/domain/constants/index.d.ts +12 -0
- package/dist/src/domain/constants/index.d.ts.map +1 -0
- package/dist/src/domain/constants/index.js +18 -0
- package/dist/src/domain/constants/index.js.map +1 -0
- package/dist/src/domain/constants/languages.d.ts +23 -0
- package/dist/src/domain/constants/languages.d.ts.map +1 -0
- package/dist/src/domain/constants/languages.js +53 -0
- package/dist/src/domain/constants/languages.js.map +1 -0
- package/dist/src/domain/constants/phases.d.ts +32 -0
- package/dist/src/domain/constants/phases.d.ts.map +1 -0
- package/dist/src/domain/constants/phases.js +52 -0
- package/dist/src/domain/constants/phases.js.map +1 -0
- package/dist/src/domain/constants/test-commands.d.ts +36 -0
- package/dist/src/domain/constants/test-commands.d.ts.map +1 -0
- package/dist/src/domain/constants/test-commands.js +70 -0
- package/dist/src/domain/constants/test-commands.js.map +1 -0
- package/dist/src/domain/constants/validation-rules.d.ts +32 -0
- package/dist/src/domain/constants/validation-rules.d.ts.map +1 -0
- package/dist/src/domain/constants/validation-rules.js +51 -0
- package/dist/src/domain/constants/validation-rules.js.map +1 -0
- package/dist/src/domain/entities/spec.d.ts +66 -0
- package/dist/src/domain/entities/spec.d.ts.map +1 -0
- package/dist/src/domain/entities/spec.js +112 -0
- package/dist/src/domain/entities/spec.js.map +1 -0
- package/dist/src/domain/entities/task.d.ts +43 -0
- package/dist/src/domain/entities/task.d.ts.map +1 -0
- package/dist/src/domain/entities/task.js +65 -0
- package/dist/src/domain/entities/task.js.map +1 -0
- package/dist/src/domain/services/spec-validator.d.ts +46 -0
- package/dist/src/domain/services/spec-validator.d.ts.map +1 -0
- package/dist/src/domain/services/spec-validator.js +99 -0
- package/dist/src/domain/services/spec-validator.js.map +1 -0
- package/dist/src/domain/value-objects/feature-name.d.ts +24 -0
- package/dist/src/domain/value-objects/feature-name.d.ts.map +1 -0
- package/dist/src/domain/value-objects/feature-name.js +36 -0
- package/dist/src/domain/value-objects/feature-name.js.map +1 -0
- package/dist/src/domain/value-objects/index.d.ts +7 -0
- package/dist/src/domain/value-objects/index.d.ts.map +1 -0
- package/dist/src/domain/value-objects/index.js +7 -0
- package/dist/src/domain/value-objects/index.js.map +1 -0
- package/dist/src/infrastructure/config/index.d.ts +5 -0
- package/dist/src/infrastructure/config/index.d.ts.map +1 -0
- package/dist/src/infrastructure/config/index.js +6 -0
- package/dist/src/infrastructure/config/index.js.map +1 -0
- package/dist/src/infrastructure/config/schema.d.ts +337 -0
- package/dist/src/infrastructure/config/schema.d.ts.map +1 -0
- package/dist/src/infrastructure/config/schema.js +237 -0
- package/dist/src/infrastructure/config/schema.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.d.ts +14 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.js +102 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/approval.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.d.ts +23 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.js +192 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.d.ts +48 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.js +531 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/hierarchy.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.d.ts +10 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.js +12 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.d.ts +13 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.js +129 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/sync-service.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.d.ts +113 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.js +5 -0
- package/dist/src/infrastructure/external-apis/atlassian/confluence/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.d.ts +15 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.js +141 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/adf-converter.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.d.ts +50 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.js +226 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.d.ts +12 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.js +16 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.d.ts +49 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.js +165 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/issue-builder.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.d.ts +14 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.js +110 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/status-mapper.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.d.ts +32 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.js +284 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/sync-service.js.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.d.ts +114 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.js +7 -0
- package/dist/src/infrastructure/external-apis/atlassian/jira/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/client.d.ts +25 -0
- package/dist/src/infrastructure/external-apis/github/client.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/client.js +109 -0
- package/dist/src/infrastructure/external-apis/github/client.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/index.d.ts +7 -0
- package/dist/src/infrastructure/external-apis/github/index.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/index.js +8 -0
- package/dist/src/infrastructure/external-apis/github/index.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/types.d.ts +69 -0
- package/dist/src/infrastructure/external-apis/github/types.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/types.js +5 -0
- package/dist/src/infrastructure/external-apis/github/types.js.map +1 -0
- package/dist/src/infrastructure/external-apis/github/utils.d.ts +18 -0
- package/dist/src/infrastructure/external-apis/github/utils.d.ts.map +1 -0
- package/dist/src/infrastructure/external-apis/github/utils.js +84 -0
- package/dist/src/infrastructure/external-apis/github/utils.js.map +1 -0
- package/dist/src/infrastructure/filesystem/index.d.ts +6 -0
- package/dist/src/infrastructure/filesystem/index.d.ts.map +1 -0
- package/dist/src/infrastructure/filesystem/index.js +5 -0
- package/dist/src/infrastructure/filesystem/index.js.map +1 -0
- package/dist/src/infrastructure/filesystem/project-meta.d.ts +32 -0
- package/dist/src/infrastructure/filesystem/project-meta.d.ts.map +1 -0
- package/dist/src/infrastructure/filesystem/project-meta.js +75 -0
- package/dist/src/infrastructure/filesystem/project-meta.js.map +1 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.d.ts +86 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.js +208 -0
- package/dist/src/infrastructure/parsers/aidlc-parser.js.map +1 -0
- package/dist/src/infrastructure/parsers/index.d.ts +8 -0
- package/dist/src/infrastructure/parsers/index.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/index.js +6 -0
- package/dist/src/infrastructure/parsers/index.js.map +1 -0
- package/dist/src/infrastructure/parsers/markdown-parser.d.ts +51 -0
- package/dist/src/infrastructure/parsers/markdown-parser.d.ts.map +1 -0
- package/dist/src/infrastructure/parsers/markdown-parser.js +253 -0
- package/dist/src/infrastructure/parsers/markdown-parser.js.map +1 -0
- package/dist/src/presentation/cli/config.d.ts +12 -0
- package/dist/src/presentation/cli/config.d.ts.map +1 -0
- package/dist/src/presentation/cli/config.js +22 -0
- package/dist/src/presentation/cli/config.js.map +1 -0
- package/dist/src/presentation/cli/version.d.ts +10 -0
- package/dist/src/presentation/cli/version.d.ts.map +1 -0
- package/dist/src/presentation/cli/version.js +41 -0
- package/dist/src/presentation/cli/version.js.map +1 -0
- package/dist/src/presentation/cli.d.ts +22 -0
- package/dist/src/presentation/cli.d.ts.map +1 -0
- package/dist/src/presentation/cli.js +85 -0
- package/dist/src/presentation/cli.js.map +1 -0
- package/dist/src/presentation/commands/config/register.d.ts +11 -0
- package/dist/src/presentation/commands/config/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/config/register.js +98 -0
- package/dist/src/presentation/commands/config/register.js.map +1 -0
- package/dist/src/presentation/commands/confluence/register.d.ts +11 -0
- package/dist/src/presentation/commands/confluence/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/confluence/register.js +32 -0
- package/dist/src/presentation/commands/confluence/register.js.map +1 -0
- package/dist/src/presentation/commands/confluence/sync.d.ts +17 -0
- package/dist/src/presentation/commands/confluence/sync.d.ts.map +1 -0
- package/dist/src/presentation/commands/confluence/sync.js +25 -0
- package/dist/src/presentation/commands/confluence/sync.js.map +1 -0
- package/dist/src/presentation/commands/init/handler.d.ts +10 -0
- package/dist/src/presentation/commands/init/handler.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/handler.js +64 -0
- package/dist/src/presentation/commands/init/handler.js.map +1 -0
- package/dist/src/presentation/commands/init/prompts.d.ts +41 -0
- package/dist/src/presentation/commands/init/prompts.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/prompts.js +119 -0
- package/dist/src/presentation/commands/init/prompts.js.map +1 -0
- package/dist/src/presentation/commands/init/register.d.ts +11 -0
- package/dist/src/presentation/commands/init/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/register.js +141 -0
- package/dist/src/presentation/commands/init/register.js.map +1 -0
- package/dist/src/presentation/commands/init/setup.d.ts +26 -0
- package/dist/src/presentation/commands/init/setup.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/setup.js +196 -0
- package/dist/src/presentation/commands/init/setup.js.map +1 -0
- package/dist/src/presentation/commands/init/templates.d.ts +19 -0
- package/dist/src/presentation/commands/init/templates.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/templates.js +140 -0
- package/dist/src/presentation/commands/init/templates.js.map +1 -0
- package/dist/src/presentation/commands/init/validation.d.ts +21 -0
- package/dist/src/presentation/commands/init/validation.d.ts.map +1 -0
- package/dist/src/presentation/commands/init/validation.js +65 -0
- package/dist/src/presentation/commands/init/validation.js.map +1 -0
- package/dist/src/presentation/commands/jira/register.d.ts +11 -0
- package/dist/src/presentation/commands/jira/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/jira/register.js +75 -0
- package/dist/src/presentation/commands/jira/register.js.map +1 -0
- package/dist/src/presentation/commands/jira/sync.d.ts +29 -0
- package/dist/src/presentation/commands/jira/sync.d.ts.map +1 -0
- package/dist/src/presentation/commands/jira/sync.js +37 -0
- package/dist/src/presentation/commands/jira/sync.js.map +1 -0
- package/dist/src/{commands/multi-repo-add-repo.d.ts → presentation/commands/multi-repo/add-repo.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/add-repo.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-add-repo.js → presentation/commands/multi-repo/add-repo.js} +4 -4
- package/dist/src/presentation/commands/multi-repo/add-repo.js.map +1 -0
- package/dist/src/{commands/multi-repo-ci-status.d.ts → presentation/commands/multi-repo/ci-status.d.ts} +2 -2
- package/dist/src/presentation/commands/multi-repo/ci-status.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-ci-status.js → presentation/commands/multi-repo/ci-status.js} +95 -81
- package/dist/src/presentation/commands/multi-repo/ci-status.js.map +1 -0
- package/dist/src/{commands/multi-repo-confluence-sync.d.ts → presentation/commands/multi-repo/confluence-sync.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/confluence-sync.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-confluence-sync.js → presentation/commands/multi-repo/confluence-sync.js} +7 -6
- package/dist/src/presentation/commands/multi-repo/confluence-sync.js.map +1 -0
- package/dist/src/{commands/multi-repo-init.d.ts → presentation/commands/multi-repo/init.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/init.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-init.js → presentation/commands/multi-repo/init.js} +6 -6
- package/dist/src/presentation/commands/multi-repo/init.js.map +1 -0
- package/dist/src/{commands/multi-repo-list.d.ts → presentation/commands/multi-repo/list.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/list.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-list.js → presentation/commands/multi-repo/list.js} +2 -2
- package/dist/src/presentation/commands/multi-repo/list.js.map +1 -0
- package/dist/src/presentation/commands/multi-repo/register.d.ts +12 -0
- package/dist/src/presentation/commands/multi-repo/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/multi-repo/register.js +249 -0
- package/dist/src/presentation/commands/multi-repo/register.js.map +1 -0
- package/dist/src/{commands/multi-repo-test.d.ts → presentation/commands/multi-repo/test.d.ts} +1 -1
- package/dist/src/presentation/commands/multi-repo/test.d.ts.map +1 -0
- package/dist/src/{commands/multi-repo-test.js → presentation/commands/multi-repo/test.js} +4 -4
- package/dist/src/presentation/commands/multi-repo/test.js.map +1 -0
- package/dist/src/presentation/commands/phase/register.d.ts +11 -0
- package/dist/src/presentation/commands/phase/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/phase/register.js +97 -0
- package/dist/src/presentation/commands/phase/register.js.map +1 -0
- package/dist/src/presentation/commands/spec/archive.d.ts +17 -0
- package/dist/src/presentation/commands/spec/archive.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/archive.js +40 -0
- package/dist/src/presentation/commands/spec/archive.js.map +1 -0
- package/dist/src/presentation/commands/spec/list.d.ts +15 -0
- package/dist/src/presentation/commands/spec/list.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/list.js +55 -0
- package/dist/src/presentation/commands/spec/list.js.map +1 -0
- package/dist/src/presentation/commands/spec/register.d.ts +11 -0
- package/dist/src/presentation/commands/spec/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/spec/register.js +45 -0
- package/dist/src/presentation/commands/spec/register.js.map +1 -0
- package/dist/src/presentation/commands/workflow/orchestrator.d.ts +50 -0
- package/dist/src/presentation/commands/workflow/orchestrator.d.ts.map +1 -0
- package/dist/src/presentation/commands/workflow/orchestrator.js +174 -0
- package/dist/src/presentation/commands/workflow/orchestrator.js.map +1 -0
- package/dist/src/presentation/commands/workflow/register.d.ts +11 -0
- package/dist/src/presentation/commands/workflow/register.d.ts.map +1 -0
- package/dist/src/presentation/commands/workflow/register.js +58 -0
- package/dist/src/presentation/commands/workflow/register.js.map +1 -0
- package/dist/src/presentation/formatters/error-formatter.d.ts +79 -0
- package/dist/src/presentation/formatters/error-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/error-formatter.js +150 -0
- package/dist/src/presentation/formatters/error-formatter.js.map +1 -0
- package/dist/src/presentation/formatters/index.d.ts +8 -0
- package/dist/src/presentation/formatters/index.d.ts.map +1 -0
- package/dist/src/presentation/formatters/index.js +11 -0
- package/dist/src/presentation/formatters/index.js.map +1 -0
- package/dist/src/presentation/formatters/output-formatter.d.ts +98 -0
- package/dist/src/presentation/formatters/output-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/output-formatter.js +165 -0
- package/dist/src/presentation/formatters/output-formatter.js.map +1 -0
- package/dist/src/presentation/formatters/progress-formatter.d.ts +121 -0
- package/dist/src/presentation/formatters/progress-formatter.d.ts.map +1 -0
- package/dist/src/presentation/formatters/progress-formatter.js +235 -0
- package/dist/src/presentation/formatters/progress-formatter.js.map +1 -0
- package/dist/src/presentation/interactive/config/env-wizard.d.ts +9 -0
- package/dist/src/presentation/interactive/config/env-wizard.d.ts.map +1 -0
- package/dist/src/presentation/interactive/config/env-wizard.js +193 -0
- package/dist/src/presentation/interactive/config/env-wizard.js.map +1 -0
- package/dist/src/presentation/interactive/config/index.d.ts +5 -0
- package/dist/src/presentation/interactive/config/index.d.ts.map +1 -0
- package/dist/src/presentation/interactive/config/index.js +5 -0
- package/dist/src/presentation/interactive/config/index.js.map +1 -0
- package/dist/src/presentation/interactive/confirmation.d.ts +24 -0
- package/dist/src/presentation/interactive/confirmation.d.ts.map +1 -0
- package/dist/src/presentation/interactive/confirmation.js +54 -0
- package/dist/src/presentation/interactive/confirmation.js.map +1 -0
- package/dist/src/presentation/interactive/index.d.ts +8 -0
- package/dist/src/presentation/interactive/index.d.ts.map +1 -0
- package/dist/src/presentation/interactive/index.js +11 -0
- package/dist/src/presentation/interactive/index.js.map +1 -0
- package/dist/src/presentation/interactive/prompts.d.ts +30 -0
- package/dist/src/presentation/interactive/prompts.d.ts.map +1 -0
- package/dist/src/presentation/interactive/prompts.js +69 -0
- package/dist/src/presentation/interactive/prompts.js.map +1 -0
- package/dist/src/presentation/interactive/selection.d.ts +31 -0
- package/dist/src/presentation/interactive/selection.d.ts.map +1 -0
- package/dist/src/presentation/interactive/selection.js +138 -0
- package/dist/src/presentation/interactive/selection.js.map +1 -0
- package/dist/src/shared/types/errors.d.ts +132 -0
- package/dist/src/shared/types/errors.d.ts.map +1 -0
- package/dist/src/shared/types/errors.js +61 -0
- package/dist/src/shared/types/errors.js.map +1 -0
- package/dist/src/shared/types/result.d.ts +53 -0
- package/dist/src/shared/types/result.d.ts.map +1 -0
- package/dist/src/shared/types/result.js +42 -0
- package/dist/src/shared/types/result.js.map +1 -0
- package/dist/test-confluence-auth.d.ts +6 -0
- package/dist/test-confluence-auth.d.ts.map +1 -0
- package/dist/test-confluence-auth.js +128 -0
- package/dist/test-confluence-auth.js.map +1 -0
- package/docs/MIGRATION.md +513 -0
- package/docs/architecture.md +774 -0
- package/docs/guides/comprehensive-verification-guide.md +1926 -0
- package/docs/guides/interactive-config.md +285 -0
- package/docs/onion-architecture-phase0-complete.md +91 -0
- package/package.json +6 -6
- package/scripts/README.md +148 -0
- package/scripts/__tests__/jira-transitions.test.ts +44 -30
- package/scripts/__tests__/mermaid-converter.test.ts +2 -2
- package/scripts/__tests__/multi-repo-validator.test.ts +62 -62
- package/scripts/__tests__/spec-archiver.test.ts +12 -0
- package/scripts/__tests__/validate-phase.test.ts +6 -6
- package/scripts/build/README.md +24 -0
- package/scripts/{copy-static-assets.js → build/copy-static-assets.js} +1 -1
- package/scripts/{set-permissions.js → build/set-permissions.js} +1 -1
- package/scripts/config/config-schema.ts +43 -302
- package/scripts/config-global.ts +3 -2
- package/scripts/confluence-sync.ts +17 -538
- package/scripts/constants/environments.ts +3 -53
- package/scripts/constants/languages.ts +3 -68
- package/scripts/constants/test-commands.ts +3 -94
- package/scripts/dev-tools/README.md +22 -0
- package/scripts/{test-interactive.ts → dev-tools/test-interactive.ts} +4 -3
- package/scripts/github-actions-client.ts +18 -256
- package/scripts/jira-sync.ts +5 -1270
- package/scripts/markdown-to-confluence.ts +5 -5
- package/scripts/multi-project-estimate.ts +3 -2
- package/scripts/phase-runner.ts +41 -19
- package/scripts/pre-flight-check.ts +27 -11
- package/scripts/template/__tests__/multi-repo-renderer.test.ts +12 -0
- package/scripts/template/multi-repo-renderer.ts +2 -2
- package/scripts/test-execution-generator.ts +5 -4
- package/scripts/utils/__tests__/config-validator.test.ts +19 -19
- package/scripts/utils/__tests__/feature-name-validator.test.ts +13 -13
- package/scripts/utils/__tests__/multi-repo-validator.test.ts +34 -34
- package/scripts/utils/__tests__/project-analyzer.test.ts +542 -0
- package/scripts/utils/__tests__/safe-file-reader.test.ts +208 -0
- package/scripts/utils/__tests__/security-validator.test.ts +33 -33
- package/scripts/utils/__tests__/validation-result.test.ts +112 -0
- package/scripts/utils/aidlc-parser.ts +18 -287
- package/scripts/utils/ci-generator.ts +4 -3
- package/scripts/utils/config-loader.ts +54 -50
- package/scripts/utils/config-validator.ts +89 -80
- package/scripts/utils/docker-requirement-detector.ts +5 -4
- package/scripts/utils/env-config.ts +59 -40
- package/scripts/utils/feature-name-validator.ts +25 -40
- package/scripts/utils/interactive-helpers.ts +24 -132
- package/scripts/utils/language-detector.ts +4 -3
- package/scripts/utils/markdown-parser.ts +18 -373
- package/scripts/utils/multi-repo-validator.ts +27 -28
- package/scripts/utils/project-analyzer.ts +429 -0
- package/scripts/utils/project-detector.ts +6 -5
- package/scripts/utils/project-finder.ts +2 -154
- package/scripts/utils/project-meta.ts +8 -91
- package/scripts/utils/safe-file-reader.ts +158 -0
- package/scripts/utils/security-validator.ts +42 -78
- package/scripts/utils/spec-archiver.ts +7 -6
- package/scripts/utils/spec-updater.ts +12 -6
- package/scripts/utils/tasks-converter.ts +2 -2
- package/scripts/utils/tasks-format-validator.ts +4 -4
- package/scripts/utils/template-applier.ts +4 -3
- package/scripts/utils/types/validation.ts +92 -0
- package/scripts/validate-phase.ts +51 -23
- package/scripts/workflow-orchestrator.ts +16 -251
- package/dist/scripts/mermaid-converter.d.ts.map +0 -1
- package/dist/scripts/mermaid-converter.js.map +0 -1
- package/dist/scripts/resource-dashboard.d.ts +0 -7
- package/dist/scripts/resource-dashboard.d.ts.map +0 -1
- package/dist/scripts/resource-dashboard.js +0 -157
- package/dist/scripts/resource-dashboard.js.map +0 -1
- package/dist/scripts/test-interactive.d.ts.map +0 -1
- package/dist/scripts/test-interactive.js.map +0 -1
- package/dist/scripts/test-new-features.d.ts +0 -5
- package/dist/scripts/test-new-features.d.ts.map +0 -1
- package/dist/scripts/test-new-features.js +0 -148
- package/dist/scripts/test-new-features.js.map +0 -1
- package/dist/scripts/test-spec-generator.d.ts +0 -29
- package/dist/scripts/test-spec-generator.d.ts.map +0 -1
- package/dist/scripts/test-spec-generator.js +0 -493
- package/dist/scripts/test-spec-generator.js.map +0 -1
- package/dist/scripts/utils/confluence-approval.d.ts +0 -46
- package/dist/scripts/utils/confluence-approval.d.ts.map +0 -1
- package/dist/scripts/utils/confluence-approval.js +0 -120
- package/dist/scripts/utils/confluence-approval.js.map +0 -1
- package/dist/scripts/utils/template-finder.d.ts +0 -37
- package/dist/scripts/utils/template-finder.d.ts.map +0 -1
- package/dist/scripts/utils/template-finder.js +0 -58
- package/dist/scripts/utils/template-finder.js.map +0 -1
- package/dist/src/commands/multi-repo-add-repo.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-add-repo.js.map +0 -1
- package/dist/src/commands/multi-repo-ci-status.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-ci-status.js.map +0 -1
- package/dist/src/commands/multi-repo-confluence-sync.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-confluence-sync.js.map +0 -1
- package/dist/src/commands/multi-repo-init.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-init.js.map +0 -1
- package/dist/src/commands/multi-repo-list.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-list.js.map +0 -1
- package/dist/src/commands/multi-repo-test.d.ts.map +0 -1
- package/dist/src/commands/multi-repo-test.js.map +0 -1
- package/dist/src/commands/setup-existing.d.ts +0 -22
- package/dist/src/commands/setup-existing.d.ts.map +0 -1
- package/dist/src/commands/setup-existing.js +0 -606
- package/dist/src/commands/setup-existing.js.map +0 -1
- package/scripts/__tests__/setup-existing-project.test.ts +0 -244
- package/scripts/resource-dashboard.ts +0 -189
- package/scripts/test-new-features.ts +0 -171
- package/scripts/test-spec-generator.ts +0 -570
- package/scripts/utils/confluence-approval.ts +0 -169
- package/scripts/utils/template-finder.ts +0 -69
- /package/dist/scripts/{mermaid-converter.d.ts → dev-tools/mermaid-converter.d.ts} +0 -0
- /package/dist/scripts/{mermaid-converter.js → dev-tools/mermaid-converter.js} +0 -0
- /package/dist/scripts/{test-interactive.d.ts → dev-tools/test-interactive.d.ts} +0 -0
- /package/scripts/{mermaid-converter.ts → dev-tools/mermaid-converter.ts} +0 -0
|
@@ -0,0 +1,774 @@
|
|
|
1
|
+
# Architecture Guide
|
|
2
|
+
|
|
3
|
+
Michi CLIプロジェクトのアーキテクチャガイドラインです。本プロジェクトはオニオンアーキテクチャの4層構造を採用し、明確な層分離と依存関係管理を実現しています。
|
|
4
|
+
|
|
5
|
+
## 目次
|
|
6
|
+
|
|
7
|
+
1. [概要](#概要)
|
|
8
|
+
2. [層構造](#層構造)
|
|
9
|
+
3. [依存関係ルール](#依存関係ルール)
|
|
10
|
+
4. [ファイル配置規則](#ファイル配置規則)
|
|
11
|
+
5. [scripts/ディレクトリ](#scriptsディレクトリ)
|
|
12
|
+
6. [層選択フローチャート](#層選択フローチャート)
|
|
13
|
+
7. [実践ガイド](#実践ガイド)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 概要
|
|
18
|
+
|
|
19
|
+
### アーキテクチャパターン
|
|
20
|
+
|
|
21
|
+
Michiは**オニオンアーキテクチャ(4層構造)**を採用しています:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
┌─────────────────────────────────────────┐
|
|
25
|
+
│ Presentation Layer (CLI) │ ← ユーザーインターフェース
|
|
26
|
+
├─────────────────────────────────────────┤
|
|
27
|
+
│ Application Layer (Use Cases) │ ← ビジネスロジック調整
|
|
28
|
+
├─────────────────────────────────────────┤
|
|
29
|
+
│ Infrastructure Layer (External APIs) │ ← 外部サービス統合
|
|
30
|
+
├─────────────────────────────────────────┤
|
|
31
|
+
│ Domain Layer (Business Logic) │ ← コアビジネスルール
|
|
32
|
+
└─────────────────────────────────────────┘
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### ハイブリッドアプローチ
|
|
36
|
+
|
|
37
|
+
本プロジェクトは、業界標準に準拠した**ハイブリッドアプローチ**を採用しています:
|
|
38
|
+
|
|
39
|
+
- **`src/` ディレクトリ**: すべてのプロダクションコード(4層構造)
|
|
40
|
+
- **`scripts/` ディレクトリ**: ビルドツール・開発ツール専用(層構造なし)
|
|
41
|
+
|
|
42
|
+
この分離により、プロダクションコードとビルド/開発ツールの責務を明確にしています。
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 層構造
|
|
47
|
+
|
|
48
|
+
### 1. Domain Layer(ドメイン層)
|
|
49
|
+
|
|
50
|
+
**責務**: コアビジネスロジック、エンティティ、値オブジェクト、ドメインサービス、定数定義
|
|
51
|
+
|
|
52
|
+
**配置場所**: `src/domain/`
|
|
53
|
+
|
|
54
|
+
**特徴**:
|
|
55
|
+
- **外部依存ゼロ** - 他の層やサードパーティライブラリに依存しない
|
|
56
|
+
- プロジェクト固有のビジネスルールのみを含む
|
|
57
|
+
- 最も安定した層(変更頻度が低い)
|
|
58
|
+
|
|
59
|
+
**含むもの**:
|
|
60
|
+
- エンティティ(`entities/`)
|
|
61
|
+
- `Spec`: 仕様ドキュメント
|
|
62
|
+
- `Task`: 実装タスク
|
|
63
|
+
- `Project`: プロジェクト情報
|
|
64
|
+
- 値オブジェクト(`value-objects/`)
|
|
65
|
+
- `FeatureName`: 機能名
|
|
66
|
+
- `TaskStatus`: タスクステータス
|
|
67
|
+
- `PhaseIdentifier`: フェーズ識別子
|
|
68
|
+
- ドメインサービス(`services/`)
|
|
69
|
+
- `SpecValidator`: 仕様検証
|
|
70
|
+
- `TaskOrchestrator`: タスク調整
|
|
71
|
+
- 定数(`constants/`)
|
|
72
|
+
- `DEFAULT_VALUES`: デフォルト値
|
|
73
|
+
- `PHASE_CONSTANTS`: フェーズ定数
|
|
74
|
+
|
|
75
|
+
**例**:
|
|
76
|
+
```typescript
|
|
77
|
+
// src/domain/entities/spec.ts
|
|
78
|
+
export class Spec {
|
|
79
|
+
constructor(
|
|
80
|
+
public readonly featureName: FeatureName,
|
|
81
|
+
public readonly phase: PhaseIdentifier,
|
|
82
|
+
public readonly language: string
|
|
83
|
+
) {}
|
|
84
|
+
|
|
85
|
+
isReadyForImplementation(): boolean {
|
|
86
|
+
return this.phase === 'implementation-in-progress';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### 2. Application Layer(アプリケーション層)
|
|
94
|
+
|
|
95
|
+
**責務**: ユースケース、アプリケーションサービス、DTO、ワークフロー、テンプレート処理
|
|
96
|
+
|
|
97
|
+
**配置場所**: `src/application/`
|
|
98
|
+
|
|
99
|
+
**特徴**:
|
|
100
|
+
- **Domain層のみに依存** - Infrastructure層に依存しない
|
|
101
|
+
- ビジネスロジックを調整・組み合わせる
|
|
102
|
+
- 外部APIやUIとは疎結合
|
|
103
|
+
|
|
104
|
+
**含むもの**:
|
|
105
|
+
- ユースケース(`use-cases/`)
|
|
106
|
+
- `InitSpecUseCase`: 仕様初期化
|
|
107
|
+
- `GenerateDesignUseCase`: 設計書生成
|
|
108
|
+
- `ExecuteTasksUseCase`: タスク実行
|
|
109
|
+
- アプリケーションサービス(`services/`)
|
|
110
|
+
- `TemplateProcessor`: テンプレート処理
|
|
111
|
+
- `WorkflowOrchestrator`: ワークフロー調整
|
|
112
|
+
- `TaskGenerator`: タスク生成
|
|
113
|
+
- DTO(`dto/`)
|
|
114
|
+
- `SpecDto`: 仕様データ転送オブジェクト
|
|
115
|
+
- `TaskDto`: タスクデータ転送オブジェクト
|
|
116
|
+
- インターフェース(`interfaces/`)
|
|
117
|
+
- `ISpecRepository`: 仕様リポジトリ
|
|
118
|
+
- `IFileWriter`: ファイル書き込み
|
|
119
|
+
- `ITemplateEngine`: テンプレートエンジン
|
|
120
|
+
|
|
121
|
+
**例**:
|
|
122
|
+
```typescript
|
|
123
|
+
// src/application/use-cases/init-spec.ts
|
|
124
|
+
import { Spec } from '@domain/entities/spec';
|
|
125
|
+
import { ISpecRepository } from '@application/interfaces/spec-repository';
|
|
126
|
+
|
|
127
|
+
export class InitSpecUseCase {
|
|
128
|
+
constructor(private specRepo: ISpecRepository) {}
|
|
129
|
+
|
|
130
|
+
async execute(featureName: string, description: string): Promise<Spec> {
|
|
131
|
+
// ドメインロジック使用
|
|
132
|
+
const spec = new Spec(featureName, 'requirements', 'ja');
|
|
133
|
+
|
|
134
|
+
// リポジトリ保存(Infrastructure層が実装)
|
|
135
|
+
await this.specRepo.save(spec);
|
|
136
|
+
|
|
137
|
+
return spec;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
### 3. Infrastructure Layer(インフラストラクチャ層)
|
|
145
|
+
|
|
146
|
+
**責務**: 外部API、データベース、ファイルシステム、サードパーティライブラリとの統合、設定管理
|
|
147
|
+
|
|
148
|
+
**配置場所**: `src/infrastructure/`
|
|
149
|
+
|
|
150
|
+
**特徴**:
|
|
151
|
+
- **Application層のインターフェースを実装** - 疎結合を維持
|
|
152
|
+
- Domain層とApplication層に依存できる
|
|
153
|
+
- 外部依存の具体的な実装を含む
|
|
154
|
+
|
|
155
|
+
**含むもの**:
|
|
156
|
+
- 外部API統合(`external-apis/`)
|
|
157
|
+
- `atlassian/jira/`: JIRA API
|
|
158
|
+
- `atlassian/confluence/`: Confluence API
|
|
159
|
+
- `github/`: GitHub API
|
|
160
|
+
- 設定管理(`config/`)
|
|
161
|
+
- `ConfigLoader`: 環境変数・設定ファイル読み込み
|
|
162
|
+
- `EnvValidator`: 環境変数検証
|
|
163
|
+
- ファイルシステム(`file-system/`)
|
|
164
|
+
- `FileReader`: ファイル読み込み
|
|
165
|
+
- `FileWriter`: ファイル書き込み(`IFileWriter`実装)
|
|
166
|
+
- `DirectoryManager`: ディレクトリ管理
|
|
167
|
+
- パーサー(`parsers/`)
|
|
168
|
+
- `MarkdownParser`: Markdown解析
|
|
169
|
+
- `JsonParser`: JSON解析
|
|
170
|
+
- `TemplateParser`: テンプレート解析
|
|
171
|
+
|
|
172
|
+
**例**:
|
|
173
|
+
```typescript
|
|
174
|
+
// src/infrastructure/file-system/file-writer.ts
|
|
175
|
+
import { IFileWriter } from '@application/interfaces/file-writer';
|
|
176
|
+
|
|
177
|
+
export class FileWriter implements IFileWriter {
|
|
178
|
+
async write(path: string, content: string): Promise<void> {
|
|
179
|
+
await fs.promises.writeFile(path, content, 'utf-8');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### 4. Presentation Layer(プレゼンテーション層)
|
|
187
|
+
|
|
188
|
+
**責務**: CLIインターフェース、コマンドハンドラー、入出力フォーマッタ、対話型プロンプト
|
|
189
|
+
|
|
190
|
+
**配置場所**: `src/presentation/`
|
|
191
|
+
|
|
192
|
+
**特徴**:
|
|
193
|
+
- **すべての層に依存できる** - 最外層
|
|
194
|
+
- ユーザーとの接点を担当
|
|
195
|
+
- Commander.js、Inquirer.jsなどのUIライブラリ使用
|
|
196
|
+
|
|
197
|
+
**含むもの**:
|
|
198
|
+
- CLIエントリポイント(`cli.ts`)
|
|
199
|
+
- コマンドハンドラー(`commands/`)
|
|
200
|
+
- `init/`: プロジェクト初期化
|
|
201
|
+
- `confluence/`: Confluence統合
|
|
202
|
+
- `jira/`: JIRA統合
|
|
203
|
+
- `multi-repo/`: Multi-Repo管理
|
|
204
|
+
- フォーマッタ(`formatters/`)
|
|
205
|
+
- `ConsoleFormatter`: コンソール出力
|
|
206
|
+
- `MarkdownFormatter`: Markdown出力
|
|
207
|
+
- `JsonFormatter`: JSON出力
|
|
208
|
+
- 対話型UI(`interactive/`)
|
|
209
|
+
- `Prompter`: ユーザー入力プロンプト
|
|
210
|
+
- `ProgressBar`: 進捗表示
|
|
211
|
+
|
|
212
|
+
**例**:
|
|
213
|
+
```typescript
|
|
214
|
+
// src/presentation/commands/init/init-command.ts
|
|
215
|
+
import { InitSpecUseCase } from '@application/use-cases/init-spec';
|
|
216
|
+
import { ConsoleFormatter } from '@presentation/formatters/console-formatter';
|
|
217
|
+
|
|
218
|
+
export class InitCommand {
|
|
219
|
+
constructor(
|
|
220
|
+
private initSpec: InitSpecUseCase,
|
|
221
|
+
private formatter: ConsoleFormatter
|
|
222
|
+
) {}
|
|
223
|
+
|
|
224
|
+
async execute(featureName: string, description: string): Promise<void> {
|
|
225
|
+
const spec = await this.initSpec.execute(featureName, description);
|
|
226
|
+
this.formatter.success(`仕様 ${spec.featureName} を作成しました`);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### 5. Shared Layer(共通層)
|
|
234
|
+
|
|
235
|
+
**責務**: すべての層で使用される共通ユーティリティ、エラー型
|
|
236
|
+
|
|
237
|
+
**配置場所**: `src/shared/`
|
|
238
|
+
|
|
239
|
+
**特徴**:
|
|
240
|
+
- **外部依存なし** - 純粋なTypeScriptコードのみ
|
|
241
|
+
- 層に依存しない汎用的な機能
|
|
242
|
+
|
|
243
|
+
**含むもの**:
|
|
244
|
+
- ユーティリティ(`utils/`)
|
|
245
|
+
- `StringUtils`: 文字列操作
|
|
246
|
+
- `ArrayUtils`: 配列操作
|
|
247
|
+
- `DateUtils`: 日付操作
|
|
248
|
+
- エラー型(`errors/`)
|
|
249
|
+
- `DomainError`: ドメインエラー基底クラス
|
|
250
|
+
- `ApplicationError`: アプリケーションエラー
|
|
251
|
+
- `InfrastructureError`: インフラエラー
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## 依存関係ルール
|
|
256
|
+
|
|
257
|
+
### 基本原則
|
|
258
|
+
|
|
259
|
+
依存関係は**内側から外側に向かう一方向**です:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
Presentation → Application → Domain
|
|
263
|
+
↓ ↓
|
|
264
|
+
Infrastructure → Application
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### 詳細ルール
|
|
268
|
+
|
|
269
|
+
| 層 | 依存できる層 |
|
|
270
|
+
|----|------------|
|
|
271
|
+
| **Domain** | `shared/` のみ(外部ライブラリ禁止) |
|
|
272
|
+
| **Application** | `domain/`, `shared/` のみ |
|
|
273
|
+
| **Infrastructure** | `application/`(インターフェースのみ), `domain/`, `shared/` |
|
|
274
|
+
| **Presentation** | すべての層に依存可 |
|
|
275
|
+
| **Shared** | 外部依存なし |
|
|
276
|
+
|
|
277
|
+
### 禁止事項
|
|
278
|
+
|
|
279
|
+
❌ **Domain層から他の層へのインポート**
|
|
280
|
+
```typescript
|
|
281
|
+
// ❌ NG: Domain層からApplication層をインポート
|
|
282
|
+
import { InitSpecUseCase } from '@application/use-cases/init-spec';
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
❌ **Application層からInfrastructure層の具体実装をインポート**
|
|
286
|
+
```typescript
|
|
287
|
+
// ❌ NG: Application層からInfrastructure層の具体クラスをインポート
|
|
288
|
+
import { FileWriter } from '@infrastructure/file-system/file-writer';
|
|
289
|
+
|
|
290
|
+
// ✅ OK: インターフェースを使用
|
|
291
|
+
import { IFileWriter } from '@application/interfaces/file-writer';
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
❌ **循環依存**
|
|
295
|
+
```typescript
|
|
296
|
+
// ❌ NG: A → B → A の循環
|
|
297
|
+
// src/domain/entities/spec.ts
|
|
298
|
+
import { Task } from './task';
|
|
299
|
+
|
|
300
|
+
// src/domain/entities/task.ts
|
|
301
|
+
import { Spec } from './spec'; // 循環依存!
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### 検証方法
|
|
305
|
+
|
|
306
|
+
依存関係ルールは**ts-arch**により自動検証されます:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
# アーキテクチャテスト実行
|
|
310
|
+
npm run test:arch
|
|
311
|
+
|
|
312
|
+
# CI/CDで自動実行
|
|
313
|
+
# .github/workflows/ci.yml の architecture ジョブ
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
違反が検出された場合、ビルドが失敗します:
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
❌ Architecture test failed:
|
|
320
|
+
Domain layer should not depend on Application layer
|
|
321
|
+
Violation: src/domain/entities/spec.ts imports from @application/use-cases/init-spec
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## ファイル配置規則
|
|
327
|
+
|
|
328
|
+
### パスエイリアス
|
|
329
|
+
|
|
330
|
+
TypeScriptパスエイリアスを使用してインポートを簡潔に記述します:
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
// tsconfig.json で定義
|
|
334
|
+
{
|
|
335
|
+
"paths": {
|
|
336
|
+
"@domain/*": ["./src/domain/*"],
|
|
337
|
+
"@application/*": ["./src/application/*"],
|
|
338
|
+
"@infrastructure/*": ["./src/infrastructure/*"],
|
|
339
|
+
"@presentation/*": ["./src/presentation/*"],
|
|
340
|
+
"@shared/*": ["./src/shared/*"],
|
|
341
|
+
"@kiro/*": ["./.kiro/*"]
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**使用例**:
|
|
347
|
+
```typescript
|
|
348
|
+
// 相対パスではなくエイリアス使用
|
|
349
|
+
import { Spec } from '@domain/entities/spec';
|
|
350
|
+
import { InitSpecUseCase } from '@application/use-cases/init-spec';
|
|
351
|
+
import { FileWriter } from '@infrastructure/file-system/file-writer';
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### ディレクトリ構造
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
src/
|
|
358
|
+
├── domain/ # Domain層
|
|
359
|
+
│ ├── entities/ # エンティティ
|
|
360
|
+
│ ├── value-objects/ # 値オブジェクト
|
|
361
|
+
│ ├── services/ # ドメインサービス
|
|
362
|
+
│ └── constants/ # 定数
|
|
363
|
+
│
|
|
364
|
+
├── application/ # Application層
|
|
365
|
+
│ ├── use-cases/ # ユースケース
|
|
366
|
+
│ ├── services/ # アプリケーションサービス
|
|
367
|
+
│ ├── dto/ # データ転送オブジェクト
|
|
368
|
+
│ ├── interfaces/ # インターフェース定義
|
|
369
|
+
│ └── workflows/ # ワークフロー
|
|
370
|
+
│
|
|
371
|
+
├── infrastructure/ # Infrastructure層
|
|
372
|
+
│ ├── external-apis/ # 外部API統合
|
|
373
|
+
│ │ ├── atlassian/
|
|
374
|
+
│ │ │ ├── jira/
|
|
375
|
+
│ │ │ └── confluence/
|
|
376
|
+
│ │ └── github/
|
|
377
|
+
│ ├── file-system/ # ファイルシステム
|
|
378
|
+
│ ├── config/ # 設定管理
|
|
379
|
+
│ └── parsers/ # パーサー
|
|
380
|
+
│
|
|
381
|
+
├── presentation/ # Presentation層
|
|
382
|
+
│ ├── cli.ts # CLIエントリポイント
|
|
383
|
+
│ ├── commands/ # コマンドハンドラー
|
|
384
|
+
│ ├── formatters/ # 出力フォーマッタ
|
|
385
|
+
│ └── interactive/ # 対話型UI
|
|
386
|
+
│
|
|
387
|
+
└── shared/ # Shared層
|
|
388
|
+
├── utils/ # ユーティリティ
|
|
389
|
+
└── errors/ # エラー型
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### 命名規則
|
|
393
|
+
|
|
394
|
+
| 種類 | 規則 | 例 |
|
|
395
|
+
|------|------|-----|
|
|
396
|
+
| エンティティ | PascalCase | `Spec`, `Task`, `Project` |
|
|
397
|
+
| 値オブジェクト | PascalCase | `FeatureName`, `TaskStatus` |
|
|
398
|
+
| ユースケース | `{動詞}{名詞}UseCase` | `InitSpecUseCase`, `GenerateDesignUseCase` |
|
|
399
|
+
| サービス | `{名詞}Service` | `SpecValidator`, `TaskOrchestrator` |
|
|
400
|
+
| インターフェース | `I{名詞}` | `ISpecRepository`, `IFileWriter` |
|
|
401
|
+
| DTO | `{名詞}Dto` | `SpecDto`, `TaskDto` |
|
|
402
|
+
| コマンド | `{名詞}Command` | `InitCommand`, `DesignCommand` |
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## scripts/ディレクトリ
|
|
407
|
+
|
|
408
|
+
### 重要原則
|
|
409
|
+
|
|
410
|
+
⚠️ **scripts/はビルド・開発ツール専用です。プロダクションコードは含めないでください。**
|
|
411
|
+
|
|
412
|
+
すべてのプロダクションコード(CLIツール本体の実装)は`src/`の適切な層に配置します。
|
|
413
|
+
|
|
414
|
+
### scripts/の構造
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
scripts/
|
|
418
|
+
├── build/ # ビルド関連スクリプト
|
|
419
|
+
│ ├── copy-static-assets.js
|
|
420
|
+
│ └── set-permissions.js
|
|
421
|
+
│
|
|
422
|
+
├── dev-tools/ # 開発支援ツール
|
|
423
|
+
│ ├── test-interactive.ts
|
|
424
|
+
│ └── mermaid-converter.ts
|
|
425
|
+
│
|
|
426
|
+
├── utils/ # 共通ユーティリティ
|
|
427
|
+
│ ├── env-loader.js
|
|
428
|
+
│ ├── config-loader.ts
|
|
429
|
+
│ └── safe-file-reader.ts
|
|
430
|
+
│
|
|
431
|
+
├── config/ # 設定ファイル・スキーマ
|
|
432
|
+
└── constants/ # 定数定義
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### 配置ガイドライン
|
|
436
|
+
|
|
437
|
+
| 種類 | 配置先 | 理由 |
|
|
438
|
+
|------|--------|------|
|
|
439
|
+
| **プロダクションコード** | `src/` | CLIツール本体の実装 |
|
|
440
|
+
| **ビルドスクリプト** | `scripts/build/` | ビルド時にのみ実行 |
|
|
441
|
+
| **開発ツール** | `scripts/dev-tools/` | 開発者が手動実行 |
|
|
442
|
+
| **テストヘルパー** | `scripts/__tests__/` | テスト専用 |
|
|
443
|
+
|
|
444
|
+
**判断基準**:
|
|
445
|
+
- `npm run build`で実行される → `scripts/build/`
|
|
446
|
+
- 開発者が手動実行する開発ツール → `scripts/dev-tools/`
|
|
447
|
+
- CLIコマンドとして公開される機能 → `src/presentation/commands/`
|
|
448
|
+
- 外部API統合 → `src/infrastructure/external-apis/`
|
|
449
|
+
- ビジネスロジック → `src/domain/` または `src/application/`
|
|
450
|
+
|
|
451
|
+
### Entry Points(エントリーポイント)
|
|
452
|
+
|
|
453
|
+
scripts/ルートにあるEntry Pointsは、`src/`の実装を呼び出す薄いラッパーです:
|
|
454
|
+
|
|
455
|
+
```typescript
|
|
456
|
+
// scripts/confluence-sync.ts (Entry Point)
|
|
457
|
+
import { ConfluenceSyncCommand } from '@presentation/commands/confluence/sync-command';
|
|
458
|
+
|
|
459
|
+
async function main() {
|
|
460
|
+
const command = new ConfluenceSyncCommand();
|
|
461
|
+
await command.execute(process.argv[2], process.argv[3]);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
main();
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
実装本体は`src/presentation/commands/confluence/`にあります。
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
## 層選択フローチャート
|
|
472
|
+
|
|
473
|
+
新しいファイルを作成する際、以下のフローチャートに従って適切な層を選択してください:
|
|
474
|
+
|
|
475
|
+
```mermaid
|
|
476
|
+
flowchart TD
|
|
477
|
+
Start([新しいファイルを作成])
|
|
478
|
+
|
|
479
|
+
Start --> Q1{ビルド・開発<br/>ツールか?}
|
|
480
|
+
Q1 -->|Yes| Build[scripts/build/<br/>or<br/>scripts/dev-tools/]
|
|
481
|
+
Q1 -->|No| Q2{ユーザーと<br/>直接やり取りするか?}
|
|
482
|
+
|
|
483
|
+
Q2 -->|Yes| Presentation[Presentation層<br/>src/presentation/]
|
|
484
|
+
Q2 -->|No| Q3{外部サービスと<br/>統合するか?}
|
|
485
|
+
|
|
486
|
+
Q3 -->|Yes| Infrastructure[Infrastructure層<br/>src/infrastructure/]
|
|
487
|
+
Q3 -->|No| Q4{ビジネスロジックを<br/>調整するか?}
|
|
488
|
+
|
|
489
|
+
Q4 -->|Yes| Application[Application層<br/>src/application/]
|
|
490
|
+
Q4 -->|No| Q5{コアビジネスルールか?}
|
|
491
|
+
|
|
492
|
+
Q5 -->|Yes| Domain[Domain層<br/>src/domain/]
|
|
493
|
+
Q5 -->|No| Shared[Shared層<br/>src/shared/]
|
|
494
|
+
|
|
495
|
+
Build --> End([配置完了])
|
|
496
|
+
Presentation --> End
|
|
497
|
+
Infrastructure --> End
|
|
498
|
+
Application --> End
|
|
499
|
+
Domain --> End
|
|
500
|
+
Shared --> End
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### 判断ポイント
|
|
504
|
+
|
|
505
|
+
**1. ビルド・開発ツールか?**
|
|
506
|
+
- ✅ Yes: `npm run build`で実行される、または開発者が手動実行するツール
|
|
507
|
+
- → `scripts/build/` または `scripts/dev-tools/`
|
|
508
|
+
- ❌ No: プロダクションコード → 次の質問へ
|
|
509
|
+
|
|
510
|
+
**2. ユーザーと直接やり取りするか?**
|
|
511
|
+
- ✅ Yes: CLIコマンド、プロンプト、出力フォーマット
|
|
512
|
+
- → `src/presentation/`
|
|
513
|
+
- ❌ No: 内部処理 → 次の質問へ
|
|
514
|
+
|
|
515
|
+
**3. 外部サービスと統合するか?**
|
|
516
|
+
- ✅ Yes: 外部API、ファイルシステム、データベース、サードパーティライブラリ
|
|
517
|
+
- → `src/infrastructure/`
|
|
518
|
+
- ❌ No: 外部依存なし → 次の質問へ
|
|
519
|
+
|
|
520
|
+
**4. ビジネスロジックを調整するか?**
|
|
521
|
+
- ✅ Yes: ユースケース、ワークフロー、複数ドメインサービスの組み合わせ
|
|
522
|
+
- → `src/application/`
|
|
523
|
+
- ❌ No: 単一責務 → 次の質問へ
|
|
524
|
+
|
|
525
|
+
**5. コアビジネスルールか?**
|
|
526
|
+
- ✅ Yes: エンティティ、値オブジェクト、ドメインサービス、定数
|
|
527
|
+
- → `src/domain/`
|
|
528
|
+
- ❌ No: 汎用的なユーティリティ
|
|
529
|
+
- → `src/shared/`
|
|
530
|
+
|
|
531
|
+
---
|
|
532
|
+
|
|
533
|
+
## 実践ガイド
|
|
534
|
+
|
|
535
|
+
### ケーススタディ1: 新しいCLIコマンド追加
|
|
536
|
+
|
|
537
|
+
**要件**: `/kiro:spec-validate <feature-name>` コマンドを追加
|
|
538
|
+
|
|
539
|
+
**実装手順**:
|
|
540
|
+
|
|
541
|
+
1. **Domain層**: バリデーションロジック
|
|
542
|
+
```typescript
|
|
543
|
+
// src/domain/services/spec-validator.ts
|
|
544
|
+
export class SpecValidator {
|
|
545
|
+
validate(spec: Spec): ValidationResult {
|
|
546
|
+
// コアビジネスルール
|
|
547
|
+
if (!spec.featureName.isValid()) {
|
|
548
|
+
return { valid: false, errors: ['Invalid feature name'] };
|
|
549
|
+
}
|
|
550
|
+
return { valid: true, errors: [] };
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
2. **Application層**: ユースケース
|
|
556
|
+
```typescript
|
|
557
|
+
// src/application/use-cases/validate-spec.ts
|
|
558
|
+
export class ValidateSpecUseCase {
|
|
559
|
+
constructor(
|
|
560
|
+
private specRepo: ISpecRepository,
|
|
561
|
+
private validator: SpecValidator
|
|
562
|
+
) {}
|
|
563
|
+
|
|
564
|
+
async execute(featureName: string): Promise<ValidationResult> {
|
|
565
|
+
const spec = await this.specRepo.findByFeatureName(featureName);
|
|
566
|
+
return this.validator.validate(spec);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
3. **Infrastructure層**: リポジトリ実装
|
|
572
|
+
```typescript
|
|
573
|
+
// src/infrastructure/repositories/spec-repository.ts
|
|
574
|
+
export class SpecRepository implements ISpecRepository {
|
|
575
|
+
async findByFeatureName(name: string): Promise<Spec> {
|
|
576
|
+
const data = await fs.promises.readFile(`.kiro/specs/${name}/spec.json`);
|
|
577
|
+
return JSON.parse(data.toString());
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
4. **Presentation層**: コマンドハンドラー
|
|
583
|
+
```typescript
|
|
584
|
+
// src/presentation/commands/validate/validate-command.ts
|
|
585
|
+
export class ValidateCommand {
|
|
586
|
+
constructor(
|
|
587
|
+
private validateSpec: ValidateSpecUseCase,
|
|
588
|
+
private formatter: ConsoleFormatter
|
|
589
|
+
) {}
|
|
590
|
+
|
|
591
|
+
async execute(featureName: string): Promise<void> {
|
|
592
|
+
const result = await this.validateSpec.execute(featureName);
|
|
593
|
+
if (result.valid) {
|
|
594
|
+
this.formatter.success('Validation passed');
|
|
595
|
+
} else {
|
|
596
|
+
this.formatter.error(result.errors);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
5. **Presentation層**: CLI登録
|
|
603
|
+
```typescript
|
|
604
|
+
// src/presentation/cli.ts
|
|
605
|
+
import { ValidateCommand } from './commands/validate/validate-command';
|
|
606
|
+
|
|
607
|
+
program
|
|
608
|
+
.command('spec:validate <feature-name>')
|
|
609
|
+
.action(async (featureName) => {
|
|
610
|
+
const command = new ValidateCommand(/* DI */);
|
|
611
|
+
await command.execute(featureName);
|
|
612
|
+
});
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
---
|
|
616
|
+
|
|
617
|
+
### ケーススタディ2: 外部API統合追加
|
|
618
|
+
|
|
619
|
+
**要件**: Slack通知機能を追加
|
|
620
|
+
|
|
621
|
+
**実装手順**:
|
|
622
|
+
|
|
623
|
+
1. **Application層**: インターフェース定義
|
|
624
|
+
```typescript
|
|
625
|
+
// src/application/interfaces/notification-service.ts
|
|
626
|
+
export interface INotificationService {
|
|
627
|
+
notify(message: string): Promise<void>;
|
|
628
|
+
}
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
2. **Infrastructure層**: Slack実装
|
|
632
|
+
```typescript
|
|
633
|
+
// src/infrastructure/external-apis/slack/slack-notifier.ts
|
|
634
|
+
import { INotificationService } from '@application/interfaces/notification-service';
|
|
635
|
+
|
|
636
|
+
export class SlackNotifier implements INotificationService {
|
|
637
|
+
async notify(message: string): Promise<void> {
|
|
638
|
+
await axios.post(process.env.SLACK_WEBHOOK_URL!, { text: message });
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
3. **Application層**: 通知ユースケース
|
|
644
|
+
```typescript
|
|
645
|
+
// src/application/use-cases/notify-completion.ts
|
|
646
|
+
export class NotifyCompletionUseCase {
|
|
647
|
+
constructor(private notifier: INotificationService) {}
|
|
648
|
+
|
|
649
|
+
async execute(featureName: string): Promise<void> {
|
|
650
|
+
await this.notifier.notify(`Feature ${featureName} completed!`);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
```
|
|
654
|
+
|
|
655
|
+
4. **Presentation層**: 既存コマンドに統合
|
|
656
|
+
```typescript
|
|
657
|
+
// src/presentation/commands/impl/impl-command.ts
|
|
658
|
+
export class ImplCommand {
|
|
659
|
+
constructor(
|
|
660
|
+
private executeTask: ExecuteTasksUseCase,
|
|
661
|
+
private notifyCompletion: NotifyCompletionUseCase
|
|
662
|
+
) {}
|
|
663
|
+
|
|
664
|
+
async execute(featureName: string): Promise<void> {
|
|
665
|
+
await this.executeTask.execute(featureName);
|
|
666
|
+
await this.notifyCompletion.execute(featureName);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
673
|
+
### ベストプラクティス
|
|
674
|
+
|
|
675
|
+
#### 1. インターフェース駆動設計
|
|
676
|
+
|
|
677
|
+
Application層でインターフェースを定義し、Infrastructure層で実装します:
|
|
678
|
+
|
|
679
|
+
```typescript
|
|
680
|
+
// ✅ Good: Application層がインターフェースに依存
|
|
681
|
+
export class InitSpecUseCase {
|
|
682
|
+
constructor(private writer: IFileWriter) {}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
// ❌ Bad: Application層が具体実装に依存
|
|
686
|
+
import { FileWriter } from '@infrastructure/file-system/file-writer';
|
|
687
|
+
export class InitSpecUseCase {
|
|
688
|
+
constructor(private writer: FileWriter) {}
|
|
689
|
+
}
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
#### 2. 依存性注入
|
|
693
|
+
|
|
694
|
+
コンストラクタ注入を使用して疎結合を実現します:
|
|
695
|
+
|
|
696
|
+
```typescript
|
|
697
|
+
// Presentation層で依存関係を組み立て
|
|
698
|
+
const fileWriter = new FileWriter();
|
|
699
|
+
const specRepo = new SpecRepository(fileWriter);
|
|
700
|
+
const initSpec = new InitSpecUseCase(specRepo);
|
|
701
|
+
const command = new InitCommand(initSpec, new ConsoleFormatter());
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
#### 3. エラーハンドリング
|
|
705
|
+
|
|
706
|
+
各層で適切なエラー型を使用します:
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
// Domain層
|
|
710
|
+
export class DomainError extends Error {
|
|
711
|
+
constructor(message: string) {
|
|
712
|
+
super(message);
|
|
713
|
+
this.name = 'DomainError';
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// Application層
|
|
718
|
+
export class ApplicationError extends Error {
|
|
719
|
+
constructor(message: string) {
|
|
720
|
+
super(message);
|
|
721
|
+
this.name = 'ApplicationError';
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
// Infrastructure層
|
|
726
|
+
export class InfrastructureError extends Error {
|
|
727
|
+
constructor(message: string) {
|
|
728
|
+
super(message);
|
|
729
|
+
this.name = 'InfrastructureError';
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
#### 4. テスト戦略
|
|
735
|
+
|
|
736
|
+
各層に応じたテスト戦略を採用します:
|
|
737
|
+
|
|
738
|
+
| 層 | テスト種別 | フォーカス |
|
|
739
|
+
|----|-----------|----------|
|
|
740
|
+
| Domain | ユニットテスト | ビジネスロジックの正確性 |
|
|
741
|
+
| Application | ユニットテスト | ユースケースフロー |
|
|
742
|
+
| Infrastructure | 統合テスト | 外部サービス連携 |
|
|
743
|
+
| Presentation | E2Eテスト | ユーザーフロー |
|
|
744
|
+
|
|
745
|
+
---
|
|
746
|
+
|
|
747
|
+
## まとめ
|
|
748
|
+
|
|
749
|
+
### 重要ポイント
|
|
750
|
+
|
|
751
|
+
1. **4層構造を遵守する**: Domain → Application → Infrastructure → Presentation
|
|
752
|
+
2. **依存関係は一方向**: 内側から外側へ
|
|
753
|
+
3. **Domain層は純粋に保つ**: 外部依存ゼロ
|
|
754
|
+
4. **scripts/はビルド・開発ツール専用**: プロダクションコードは `src/` に配置
|
|
755
|
+
5. **インターフェース駆動設計**: Application層でインターフェース定義、Infrastructure層で実装
|
|
756
|
+
6. **ts-archで自動検証**: 依存関係ルール違反を検出
|
|
757
|
+
|
|
758
|
+
### 参考資料
|
|
759
|
+
|
|
760
|
+
- [Design Document](.kiro/specs/onion-architecture/design.md) - 詳細設計
|
|
761
|
+
- [Requirements Document](.kiro/specs/onion-architecture/requirements.md) - 要件定義
|
|
762
|
+
- [Migration Guide](./MIGRATION.md) - 移行ガイド
|
|
763
|
+
- [scripts/README.md](../scripts/README.md) - scripts/ディレクトリガイド
|
|
764
|
+
|
|
765
|
+
### サポート
|
|
766
|
+
|
|
767
|
+
質問や不明点がある場合:
|
|
768
|
+
- [GitHub Issues](https://github.com/sk8metalme/michi/issues)
|
|
769
|
+
- [Architecture Discussion](https://github.com/sk8metalme/michi/discussions)
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
**Last Updated**: 2026-01-01
|
|
774
|
+
**Version**: 0.19.0
|