@phuc1403/musketeer 0.9.0 → 0.11.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/INSTALLATION.md +53 -52
- package/README.md +1 -1
- package/bin/musketeer.js +168 -168
- package/manifest.json +19 -2
- package/package.json +48 -48
- package/src/dotnet-scaffold-copier.js +79 -79
- package/src/provisioner/detect.js +93 -93
- package/src/self-update.js +77 -77
- package/template/.claude/agents/git-manager.md +18 -18
- package/template/.claude/agents/hallmark-auditor.md +78 -78
- package/template/.claude/agents/researcher.md +33 -33
- package/template/.claude/hooks/block-unsafe-adr-title.cjs +85 -85
- package/template/.claude/hooks/init-adr-dir.cjs +173 -173
- package/template/.claude/hooks/inject-adr-flags.cjs +94 -94
- package/template/.claude/hooks/lib/adr/command-scan.cjs +115 -115
- package/template/.claude/hooks/lib/characteristics/checker.cjs +357 -357
- package/template/.claude/hooks/lib/git-info-cache.cjs +191 -191
- package/template/.claude/hooks/sync-adr-toc.cjs +146 -146
- package/template/.claude/hooks/usage-quota-cache-refresh.cjs +166 -166
- package/template/.claude/hooks/validate-characteristics-hook.cjs +66 -66
- package/template/.claude/hooks/validate-cml-hook.js +146 -145
- package/template/.claude/skills/adr-writer/SKILL.md +48 -48
- package/template/.claude/skills/adr-writer/references/adr-example.md +35 -35
- package/template/.claude/skills/architecture-characteristic-writer/SKILL.md +215 -215
- package/template/.claude/skills/architecture-characteristic-writer/assets/worksheet-template.md +29 -29
- package/template/.claude/skills/architecture-characteristic-writer/references/characteristics-catalog.md +40 -40
- package/template/.claude/skills/architecture-characteristic-writer/scripts/ranking-table.cjs +171 -171
- package/template/.claude/skills/context-map/SKILL.md +80 -80
- package/template/.claude/skills/context-map/example.cml +106 -106
- package/template/.claude/skills/context-map/reference/Bounded Context/Bounded Context.md +40 -40
- package/template/.claude/skills/context-map/reference/Bounded Context/businessModel.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context/domainVisionStatement.md +2 -2
- package/template/.claude/skills/context-map/reference/Bounded Context/evolution.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context/implementationTechnology.md +1 -1
- package/template/.claude/skills/context-map/reference/Bounded Context/implements.md +1 -1
- package/template/.claude/skills/context-map/reference/Bounded Context/knowledgeLevel.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context/realizes.md +9 -9
- package/template/.claude/skills/context-map/reference/Bounded Context/refines.md +10 -10
- package/template/.claude/skills/context-map/reference/Bounded Context/responsibilities.md +26 -26
- package/template/.claude/skills/context-map/reference/Bounded Context/type.md +23 -23
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Anticorruption Layer.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Bounded Context Relationship.md +12 -12
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Conformist.md +5 -5
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Customer-Supplier (C-S).md +22 -22
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Open Host Service.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Partnership (P).md +13 -13
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Published Language.md +4 -4
- package/template/.claude/skills/context-map/reference/Bounded Context Relationship/Shared Kernel (SK).md +12 -12
- package/template/.claude/skills/context-map/reference/Context Map.md +62 -62
- package/template/.claude/skills/context-map/reference/Domain/Domain.md +30 -30
- package/template/.claude/skills/context-map/reference/Domain/supports.md +33 -33
- package/template/.claude/skills/context-map/reference/Domain/type.md +3 -3
- package/template/.claude/skills/context-map/reference/Semantic Rules.md +32 -32
- package/template/.claude/skills/hallmark/SKILL.md +552 -552
- package/template/.claude/skills/hallmark/references/anti-patterns.md +412 -412
- package/template/.claude/skills/hallmark/references/assets.md +406 -406
- package/template/.claude/skills/hallmark/references/color.md +95 -95
- package/template/.claude/skills/hallmark/references/component-cookbook.md +256 -256
- package/template/.claude/skills/hallmark/references/components/c1-outlined-chip.md +12 -12
- package/template/.claude/skills/hallmark/references/components/c2-inline-form-as-cta.md +16 -16
- package/template/.claude/skills/hallmark/references/components/c3-typographic-link.md +8 -8
- package/template/.claude/skills/hallmark/references/components/c4-sticky-bottom-bar.md +16 -16
- package/template/.claude/skills/hallmark/references/components/f1-bento-grid.md +20 -20
- package/template/.claude/skills/hallmark/references/components/f2-sticky-scroll-stack.md +20 -20
- package/template/.claude/skills/hallmark/references/components/f3-tabular-spec-sheet.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f4-step-sequence.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f5-annotated-screenshot.md +11 -11
- package/template/.claude/skills/hallmark/references/components/f6-product-card-grid.md +41 -41
- package/template/.claude/skills/hallmark/references/components/ft1-mast-headed.md +13 -13
- package/template/.claude/skills/hallmark/references/components/ft2-inline-rule-single-line.md +10 -10
- package/template/.claude/skills/hallmark/references/components/ft3-index-style-category-list.md +12 -12
- package/template/.claude/skills/hallmark/references/components/ft4-dense-typographic.md +10 -10
- package/template/.claude/skills/hallmark/references/components/ft5-statement.md +21 -21
- package/template/.claude/skills/hallmark/references/components/ft6-letter-close.md +19 -19
- package/template/.claude/skills/hallmark/references/components/ft7-newsletter-first.md +27 -27
- package/template/.claude/skills/hallmark/references/components/ft8-marquee-scroll.md +25 -25
- package/template/.claude/skills/hallmark/references/components/h1-marquee.md +15 -15
- package/template/.claude/skills/hallmark/references/components/h2-split-diptych.md +15 -15
- package/template/.claude/skills/hallmark/references/components/h3-quote-led.md +11 -11
- package/template/.claude/skills/hallmark/references/components/h4-stat-led.md +14 -14
- package/template/.claude/skills/hallmark/references/components/h5-letter-hero.md +11 -11
- package/template/.claude/skills/hallmark/references/components/h6-photographic-fold.md +16 -16
- package/template/.claude/skills/hallmark/references/components/h7-demo-video-clipped-by-viewport-edge.md +27 -27
- package/template/.claude/skills/hallmark/references/components/h8-mockup-split-browser-framed.md +23 -23
- package/template/.claude/skills/hallmark/references/components/h9-custom-illustration-centerpiece.md +27 -27
- package/template/.claude/skills/hallmark/references/components/n1-wordmark-2-links.md +12 -12
- package/template/.claude/skills/hallmark/references/components/n10-floating-on-scroll-morph.md +19 -19
- package/template/.claude/skills/hallmark/references/components/n2-floating-chip.md +14 -14
- package/template/.claude/skills/hallmark/references/components/n3-side-rail.md +14 -14
- package/template/.claude/skills/hallmark/references/components/n4-hidden-behind-k.md +9 -9
- package/template/.claude/skills/hallmark/references/components/n5-floating-pill.md +28 -28
- package/template/.claude/skills/hallmark/references/components/n6-newspaper-masthead.md +24 -24
- package/template/.claude/skills/hallmark/references/components/n7-brutal-slab.md +22 -22
- package/template/.claude/skills/hallmark/references/components/n8-terminal-command.md +21 -21
- package/template/.claude/skills/hallmark/references/components/n9-edge-aligned-minimal.md +17 -17
- package/template/.claude/skills/hallmark/references/components/s1-left-margin-numbered.md +15 -15
- package/template/.claude/skills/hallmark/references/components/s2-hanging.md +13 -13
- package/template/.claude/skills/hallmark/references/components/s3-sticky-pinned.md +19 -19
- package/template/.claude/skills/hallmark/references/components/s4-inline-no-break.md +11 -11
- package/template/.claude/skills/hallmark/references/components/s5-bottom-anchored.md +13 -13
- package/template/.claude/skills/hallmark/references/components/t1-pull-quote-with-marginalia.md +12 -12
- package/template/.claude/skills/hallmark/references/components/t2-logo-wall-hairline.md +19 -19
- package/template/.claude/skills/hallmark/references/components/t3-single-huge-quote.md +11 -11
- package/template/.claude/skills/hallmark/references/components/t4-numbered-stat-strip.md +14 -14
- package/template/.claude/skills/hallmark/references/contract.md +24 -24
- package/template/.claude/skills/hallmark/references/copy.md +182 -182
- package/template/.claude/skills/hallmark/references/custom-craft.md +626 -626
- package/template/.claude/skills/hallmark/references/custom-theme.md +329 -329
- package/template/.claude/skills/hallmark/references/design-md.md +116 -116
- package/template/.claude/skills/hallmark/references/export-formats.md +328 -328
- package/template/.claude/skills/hallmark/references/floating-nav.md +89 -89
- package/template/.claude/skills/hallmark/references/genres/atmospheric.md +65 -65
- package/template/.claude/skills/hallmark/references/genres/editorial.md +70 -70
- package/template/.claude/skills/hallmark/references/genres/modern-minimal.md +67 -67
- package/template/.claude/skills/hallmark/references/genres/playful.md +65 -65
- package/template/.claude/skills/hallmark/references/hero-enrichment.md +474 -474
- package/template/.claude/skills/hallmark/references/imagery-kit.md +170 -170
- package/template/.claude/skills/hallmark/references/interaction-and-states.md +207 -207
- package/template/.claude/skills/hallmark/references/layout-and-space.md +111 -111
- package/template/.claude/skills/hallmark/references/macrostructures/01-bento-grid.md +35 -35
- package/template/.claude/skills/hallmark/references/macrostructures/02-long-document.md +34 -34
- package/template/.claude/skills/hallmark/references/macrostructures/03-marquee-hero.md +31 -31
- package/template/.claude/skills/hallmark/references/macrostructures/04-stat-led.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/05-workbench.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/06-conversational-faq.md +33 -33
- package/template/.claude/skills/hallmark/references/macrostructures/07-manifesto.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/08-photographic.md +34 -34
- package/template/.claude/skills/hallmark/references/macrostructures/09-quote-led.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/10-specimen.md +32 -32
- package/template/.claude/skills/hallmark/references/macrostructures/11-catalogue.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/12-letter.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/13-index-first.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/14-narrative-workflow.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/15-split-studio.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/16-feature-stack.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/17-type-specimen.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/18-portfolio-grid.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/19-map-diagram.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/20-ecosystem-index.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures/21-component-playground.md +23 -23
- package/template/.claude/skills/hallmark/references/macrostructures.md +89 -89
- package/template/.claude/skills/hallmark/references/microinteractions.md +260 -260
- package/template/.claude/skills/hallmark/references/motion.md +109 -109
- package/template/.claude/skills/hallmark/references/preview-examples.md +49 -49
- package/template/.claude/skills/hallmark/references/responsive.md +138 -138
- package/template/.claude/skills/hallmark/references/slop-test.md +205 -205
- package/template/.claude/skills/hallmark/references/structure.md +164 -164
- package/template/.claude/skills/hallmark/references/study.md +511 -511
- package/template/.claude/skills/hallmark/references/typography.md +243 -243
- package/template/.claude/skills/hallmark/references/verbs/audit.md +25 -25
- package/template/.claude/skills/hallmark/references/verbs/redesign.md +269 -269
- package/template/.claude/skills/hallmark-loop/SKILL.md +105 -105
- package/template/.claude/skills/hallmark-loop/references/auditor-call.md +60 -60
- package/template/.claude/skills/hallmark-loop/references/capture.md +78 -78
- package/template/.claude/skills/hallmark-loop/references/loop-control.md +79 -79
- package/template/.claude/skills/handoff/SKILL.md +15 -15
- package/template/.claude/skills/knowledge-crunching/SKILL.md +94 -94
- package/template/.claude/skills/logical-components/.gitattributes +2 -0
- package/template/.claude/skills/logical-components/SKILL.md +102 -0
- package/template/.claude/skills/logical-components/references/component-classifier-prompt.md +53 -0
- package/template/.claude/skills/logical-components/references/responsibility-agent-prompt.md +67 -0
- package/template/.claude/skills/logical-components/references/responsibility-verifier-prompt.md +39 -0
- package/template/.claude/skills/logical-components/scripts/Directory.Build.props +7 -0
- package/template/.claude/skills/logical-components/scripts/Directory.Packages.props +8 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/BatchPlanning.cs +69 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/BatchesCommand.cs +39 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/CandidatesCommand.cs +70 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/CitableSource.cs +39 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/Citation.cs +37 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ClassifyBatchesCommand.cs +65 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ClassifyMergeCommand.cs +187 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ComponentDiscovery.cs +166 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ComponentRule.cs +87 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ComponentsFile.cs +83 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/CouplingResolver.cs +196 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/DisplayName.cs +14 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/EdgeExtraction.cs +111 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ExtractCommand.cs +72 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ExtractConfig.cs +79 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/LogicalComponents.csproj +15 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/MarkdownRenderer.cs +73 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/MemberUseResolution.cs +203 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/MemberUses.cs +155 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/PortResolution.cs +75 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/Program.cs +27 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ProjectFilters.cs +76 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/PruneCommand.cs +132 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/RenderCommand.cs +173 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ResponsibilityBatches.cs +84 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/ResponsibilityValidation.cs +178 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/SeamDispatch.cs +59 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/SymbolNames.cs +53 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/TypeMap.cs +75 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/WalkRoots.cs +63 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents/WorkspaceLoader.cs +227 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/AssignIdsTests.cs +41 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/BatchPlanningTests.cs +82 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/CandidatesCommandTests.cs +34 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/CitationTests.cs +42 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/ClassifyCommandsTests.cs +176 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/ComponentDiscoveryTests.cs +190 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/CouplingExtractionTests.cs +174 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/DisplayNameTests.cs +17 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/ExtractConfigTests.cs +72 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/FixturePaths.cs +32 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/LogicalComponents.Tests.csproj +23 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/MarkdownRendererTests.cs +50 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/ProjectFiltersTests.cs +65 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/PruneCommandTests.cs +119 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/RenderCommandTests.cs +162 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/RenderGoldenTests.cs +34 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/RenderTestData.cs +49 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/ResponsibilityValidationTests.cs +227 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/SampleAppWorkspace.cs +27 -0
- package/template/.claude/skills/logical-components/scripts/LogicalComponents.Tests/WorkspaceLoaderTests.cs +87 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/BrokenApp/src/Broken.Application/Broken.Application.csproj +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/BrokenApp/src/Broken.Application/Broken.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/MultiTargetApp/MultiTargetApp.slnx +6 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/MultiTargetApp/src/Legacy.FSharp/Legacy.FSharp.fsproj +8 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/MultiTargetApp/src/Legacy.FSharp/Library.fs +5 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/MultiTargetApp/src/Multi.Application/Multi.Application.csproj +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/MultiTargetApp/src/Multi.Application/Scheduling.cs +14 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/NoSolutionApp/src/Solo.Application/Solo.Application.csproj +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/NoSolutionApp/src/Solo.Application/SoloGreeting.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/NoSolutionApp/src/Solo.Application.Tests/FakeGreeting.cs +6 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/NoSolutionApp/src/Solo.Application.Tests/Solo.Application.Tests.csproj +11 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/RenderGolden/components.json +63 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/RenderGolden/expected.md +28 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/RenderGolden/repo/src/App/OrderAcceptance.cs +16 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/RenderGolden/repo/src/Infra/OrderQueue.cs +10 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/RenderGolden/resp/batch-01.json +18 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/SampleApp.slnx +10 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/logical-components.json +78 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/CandidateCases.cs +37 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/CouplingCases.cs +33 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/DependencyInjection.cs +18 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/EdgeCases.cs +63 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/LoudNotifying.Base.cs +5 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/LoudNotifying.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderAcceptance.cs +17 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderOptions.cs +9 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderRejectedException.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderRequest.cs +4 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderRunning.cs +18 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/OrderValidation.cs +6 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/Ports.cs +19 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/PriceRules.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/ReceiptPrinting.Totals.cs +6 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/ReceiptPrinting.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/ReviewCases.cs +107 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/ReviewFixCases.cs +143 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/RunClock.cs +12 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/Sample.Application.csproj +10 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Application/SeeThroughCases.cs +89 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Billing.Application/OrderRunning.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Billing.Application/Sample.Billing.Application.csproj +11 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/ForwardedNotifier.cs +8 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/InfrastructureDependencyInjection.cs +16 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/Mailer.cs +6 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/OrderQueue.cs +11 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/QueueEntry.cs +4 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/QueueStore.cs +8 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/ReviewCases.cs +35 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/ReviewFixCases.cs +13 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/Sample.Infrastructure.csproj +13 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/SeeThroughCases.cs +18 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/src/Sample.Infrastructure/UnreachedPlumbing.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/tests/Sample.Tests/FakeOrderQueue.cs +11 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SampleApp/tests/Sample.Tests/Sample.Tests.csproj +11 -0
- package/template/.claude/skills/logical-components/scripts/fixtures/SharedOutsideRepo/SharedClock.cs +7 -0
- package/template/.claude/skills/logical-components/scripts/global.json +5 -0
- package/template/.claude/skills/logical-components/scripts/smoke-sample.sh +26 -0
- package/template/.claude/skills/research/SKILL.md +69 -69
- package/template/.claude/skills/tdd/SKILL.md +142 -142
- package/template/.claude/skills/tdd/deep-modules.md +15 -15
- package/template/.claude/skills/tdd/interface-design.md +31 -31
- package/template/.claude/skills/tdd/mocking.md +59 -59
- package/template/.claude/skills/tdd/refactoring.md +10 -10
- package/template/.claude/skills/tdd/tests.md +61 -61
- package/template/.claude/statusline.cjs +100 -37
package/template/.claude/skills/architecture-characteristic-writer/scripts/ranking-table.cjs
CHANGED
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Scaffolds and repairs the architecture-characteristics ranking table.
|
|
3
|
-
//
|
|
4
|
-
// scaffold write a blank ranking holding every catalog characteristic
|
|
5
|
-
// fix renumber the Order column and rebuild every "Above X:" prefix
|
|
6
|
-
// from the row order as it now stands, keeping the justifications
|
|
7
|
-
//
|
|
8
|
-
// Ranking ORDER and justification prose are the architect's work. Everything
|
|
9
|
-
// this script touches — which characteristics appear, the numbering, which row
|
|
10
|
-
// each reason compares against — is mechanical, so no one has to transcribe it.
|
|
11
|
-
//
|
|
12
|
-
// Run `fix` after moving rows. A prefix left naming the wrong row is the usual
|
|
13
|
-
// defect after a reorder, and regenerating them makes it impossible.
|
|
14
|
-
|
|
15
|
-
const fs = require('fs');
|
|
16
|
-
const path = require('path');
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
loadCatalog,
|
|
20
|
-
normalise,
|
|
21
|
-
locateTable,
|
|
22
|
-
splitCells,
|
|
23
|
-
isSeparator,
|
|
24
|
-
RANKING_HEADER,
|
|
25
|
-
} = require('../../../hooks/lib/characteristics/checker.cjs');
|
|
26
|
-
|
|
27
|
-
const DEFAULT_FILE = 'docs/architecture-characteristics-ranking.md';
|
|
28
|
-
|
|
29
|
-
// The validation hook resolves the ranking against CLAUDE_PROJECT_DIR. Resolve
|
|
30
|
-
// against the same root, or running this from a subdirectory would quietly
|
|
31
|
-
// write a second ranking somewhere the hook never looks at.
|
|
32
|
-
const projectRoot = () => process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
33
|
-
const PLACEHOLDER = '{why}';
|
|
34
|
-
const HEADING = '# Architecture Characteristics Ranking';
|
|
35
|
-
|
|
36
|
-
const PREAMBLE = [
|
|
37
|
-
HEADING,
|
|
38
|
-
'',
|
|
39
|
-
'All characteristics in priority order. The top 7 feed the worksheet in',
|
|
40
|
-
'`architecture-characteristics.md`.',
|
|
41
|
-
'',
|
|
42
|
-
'<!-- Reason = why this row outranks the row directly BELOW it. Comparative, never a description.',
|
|
43
|
-
' Keep the "Above {next characteristic}:" prefix and replace {why} with the justification.',
|
|
44
|
-
' Both sides must appear: what this row protects, and what the row below gives up.',
|
|
45
|
-
' State WHY the system needs it, meaning the business driver or risk.',
|
|
46
|
-
' Never name the mechanism: no patterns, libraries, components, or tactics.',
|
|
47
|
-
'',
|
|
48
|
-
' Move rows freely, then run scripts/ranking-table.cjs fix to renumber and',
|
|
49
|
-
' rebuild every prefix. Do not hand-maintain the numbering or the prefixes. -->',
|
|
50
|
-
'',
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const die = (msg) => {
|
|
54
|
-
process.stderr.write(`${msg}\n`);
|
|
55
|
-
process.exit(1);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// Builds the three table lines plus data rows for the given ordered names,
|
|
59
|
-
// pairing each row with the justification supplied for it.
|
|
60
|
-
function render(order, justifications) {
|
|
61
|
-
const rows = order.map((name, i) => {
|
|
62
|
-
const last = i === order.length - 1;
|
|
63
|
-
const reason = last ? '—' : `Above ${order[i + 1]}: ${justifications[i] || PLACEHOLDER}`;
|
|
64
|
-
return `| ${i + 1} | ${name} | ${reason} |`;
|
|
65
|
-
});
|
|
66
|
-
return ['| Order | Characteristic | Reason |', '|---|---|---|', ...rows];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Drops an "Above X:" prefix and a lone em dash, leaving the justification the
|
|
70
|
-
// author actually wrote.
|
|
71
|
-
function justificationOf(reason) {
|
|
72
|
-
const text = String(reason).trim();
|
|
73
|
-
if (/^[—-]$/.test(text)) return '';
|
|
74
|
-
const m = text.match(/^above\s+[^:]+:\s*(.*)$/i);
|
|
75
|
-
return (m ? m[1] : text).trim();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function scaffold(argv) {
|
|
79
|
-
const out = argv.out || DEFAULT_FILE;
|
|
80
|
-
const target = path.resolve(projectRoot(), out);
|
|
81
|
-
|
|
82
|
-
if (fs.existsSync(target) && !argv.force) {
|
|
83
|
-
die(`${out} already exists. Run fix to repair it, or pass --force to start over.`);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const { catalog } = loadCatalog(argv.catalog);
|
|
87
|
-
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
88
|
-
fs.writeFileSync(target, [...PREAMBLE, ...render(catalog, []), ''].join('\n'), 'utf8');
|
|
89
|
-
|
|
90
|
-
process.stdout.write(
|
|
91
|
-
`Wrote ${out} with ${catalog.length} characteristics in catalog order.\n` +
|
|
92
|
-
'Reorder the rows, replace every {why}, then run fix.\n'
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function fix(argv) {
|
|
97
|
-
const file = argv.file || DEFAULT_FILE;
|
|
98
|
-
const target = path.resolve(projectRoot(), file);
|
|
99
|
-
|
|
100
|
-
if (!fs.existsSync(target)) die(`${file} does not exist. Run scaffold first.`);
|
|
101
|
-
|
|
102
|
-
const original = fs.readFileSync(target, 'utf8');
|
|
103
|
-
const eol = original.includes('\r\n') ? '\r\n' : '\n';
|
|
104
|
-
const lines = original.split(/\r?\n/);
|
|
105
|
-
|
|
106
|
-
const bounds = locateTable(lines, RANKING_HEADER);
|
|
107
|
-
if (!bounds) die(`${file} holds no table with a "| Order | Characteristic | Reason |" header row.`);
|
|
108
|
-
|
|
109
|
-
const table = lines.slice(bounds.start, bounds.end);
|
|
110
|
-
const data = table.filter((l) => {
|
|
111
|
-
const c = splitCells(l);
|
|
112
|
-
return c.length >= 3 && !isSeparator(c) && !/^order$/i.test(c[0]);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
if (!data.length) die(`${file} holds no ranking rows to fix.`);
|
|
116
|
-
|
|
117
|
-
const order = data.map((l) => normalise(splitCells(l)[1]));
|
|
118
|
-
const justifications = data.map((l) => justificationOf(splitCells(l)[2]));
|
|
119
|
-
|
|
120
|
-
const { catalog } = loadCatalog(argv.catalog);
|
|
121
|
-
const unknown = order.filter((n) => !catalog.includes(n));
|
|
122
|
-
if (unknown.length) die(`${file} names characteristics absent from the catalog: ${unknown.join(', ')}`);
|
|
123
|
-
|
|
124
|
-
const rebuilt = render(order, justifications);
|
|
125
|
-
const next = [...lines.slice(0, bounds.start), ...rebuilt, ...lines.slice(bounds.end)];
|
|
126
|
-
const updated = next.join(eol);
|
|
127
|
-
|
|
128
|
-
// Reported whether or not anything moved: a scaffold is already correct and
|
|
129
|
-
// still has every justification left to write.
|
|
130
|
-
const blank = justifications.filter((j, i) => i < justifications.length - 1 && (!j || j === PLACEHOLDER)).length;
|
|
131
|
-
const outstanding = blank ? `${blank} row(s) still need a justification in place of ${PLACEHOLDER}.\n` : '';
|
|
132
|
-
|
|
133
|
-
if (updated === original) {
|
|
134
|
-
process.stdout.write(`${file} is already correct.\n${outstanding}`);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
fs.writeFileSync(target, updated, 'utf8');
|
|
139
|
-
|
|
140
|
-
const repaired = data.filter((l, i) => splitCells(l)[2] !== splitCells(rebuilt[i + 2])[2]).length;
|
|
141
|
-
const renumbered = data.filter((l, i) => splitCells(l)[0] !== String(i + 1)).length;
|
|
142
|
-
|
|
143
|
-
process.stdout.write(
|
|
144
|
-
`Fixed ${file}: renumbered ${renumbered} row(s), rebuilt ${repaired} reason(s).\n${outstanding}`
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function main() {
|
|
149
|
-
const [command, ...rest] = process.argv.slice(2);
|
|
150
|
-
const argv = { force: false };
|
|
151
|
-
|
|
152
|
-
for (let i = 0; i < rest.length; i += 1) {
|
|
153
|
-
const flag = rest[i];
|
|
154
|
-
if (flag === '--force') argv.force = true;
|
|
155
|
-
else if (flag === '--out') argv.out = rest[(i += 1)];
|
|
156
|
-
else if (flag === '--file') argv.file = rest[(i += 1)];
|
|
157
|
-
else if (flag === '--catalog') argv.catalog = rest[(i += 1)];
|
|
158
|
-
else die(`unknown argument: ${flag}`);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
try {
|
|
162
|
-
if (command === 'scaffold') return scaffold(argv);
|
|
163
|
-
if (command === 'fix') return fix(argv);
|
|
164
|
-
} catch (err) {
|
|
165
|
-
die(err.message);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
die('usage: ranking-table.cjs scaffold [--out <path>] [--force] | fix [--file <path>]');
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Scaffolds and repairs the architecture-characteristics ranking table.
|
|
3
|
+
//
|
|
4
|
+
// scaffold write a blank ranking holding every catalog characteristic
|
|
5
|
+
// fix renumber the Order column and rebuild every "Above X:" prefix
|
|
6
|
+
// from the row order as it now stands, keeping the justifications
|
|
7
|
+
//
|
|
8
|
+
// Ranking ORDER and justification prose are the architect's work. Everything
|
|
9
|
+
// this script touches — which characteristics appear, the numbering, which row
|
|
10
|
+
// each reason compares against — is mechanical, so no one has to transcribe it.
|
|
11
|
+
//
|
|
12
|
+
// Run `fix` after moving rows. A prefix left naming the wrong row is the usual
|
|
13
|
+
// defect after a reorder, and regenerating them makes it impossible.
|
|
14
|
+
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
loadCatalog,
|
|
20
|
+
normalise,
|
|
21
|
+
locateTable,
|
|
22
|
+
splitCells,
|
|
23
|
+
isSeparator,
|
|
24
|
+
RANKING_HEADER,
|
|
25
|
+
} = require('../../../hooks/lib/characteristics/checker.cjs');
|
|
26
|
+
|
|
27
|
+
const DEFAULT_FILE = 'docs/architecture-characteristics-ranking.md';
|
|
28
|
+
|
|
29
|
+
// The validation hook resolves the ranking against CLAUDE_PROJECT_DIR. Resolve
|
|
30
|
+
// against the same root, or running this from a subdirectory would quietly
|
|
31
|
+
// write a second ranking somewhere the hook never looks at.
|
|
32
|
+
const projectRoot = () => process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
33
|
+
const PLACEHOLDER = '{why}';
|
|
34
|
+
const HEADING = '# Architecture Characteristics Ranking';
|
|
35
|
+
|
|
36
|
+
const PREAMBLE = [
|
|
37
|
+
HEADING,
|
|
38
|
+
'',
|
|
39
|
+
'All characteristics in priority order. The top 7 feed the worksheet in',
|
|
40
|
+
'`architecture-characteristics.md`.',
|
|
41
|
+
'',
|
|
42
|
+
'<!-- Reason = why this row outranks the row directly BELOW it. Comparative, never a description.',
|
|
43
|
+
' Keep the "Above {next characteristic}:" prefix and replace {why} with the justification.',
|
|
44
|
+
' Both sides must appear: what this row protects, and what the row below gives up.',
|
|
45
|
+
' State WHY the system needs it, meaning the business driver or risk.',
|
|
46
|
+
' Never name the mechanism: no patterns, libraries, components, or tactics.',
|
|
47
|
+
'',
|
|
48
|
+
' Move rows freely, then run scripts/ranking-table.cjs fix to renumber and',
|
|
49
|
+
' rebuild every prefix. Do not hand-maintain the numbering or the prefixes. -->',
|
|
50
|
+
'',
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const die = (msg) => {
|
|
54
|
+
process.stderr.write(`${msg}\n`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Builds the three table lines plus data rows for the given ordered names,
|
|
59
|
+
// pairing each row with the justification supplied for it.
|
|
60
|
+
function render(order, justifications) {
|
|
61
|
+
const rows = order.map((name, i) => {
|
|
62
|
+
const last = i === order.length - 1;
|
|
63
|
+
const reason = last ? '—' : `Above ${order[i + 1]}: ${justifications[i] || PLACEHOLDER}`;
|
|
64
|
+
return `| ${i + 1} | ${name} | ${reason} |`;
|
|
65
|
+
});
|
|
66
|
+
return ['| Order | Characteristic | Reason |', '|---|---|---|', ...rows];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Drops an "Above X:" prefix and a lone em dash, leaving the justification the
|
|
70
|
+
// author actually wrote.
|
|
71
|
+
function justificationOf(reason) {
|
|
72
|
+
const text = String(reason).trim();
|
|
73
|
+
if (/^[—-]$/.test(text)) return '';
|
|
74
|
+
const m = text.match(/^above\s+[^:]+:\s*(.*)$/i);
|
|
75
|
+
return (m ? m[1] : text).trim();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function scaffold(argv) {
|
|
79
|
+
const out = argv.out || DEFAULT_FILE;
|
|
80
|
+
const target = path.resolve(projectRoot(), out);
|
|
81
|
+
|
|
82
|
+
if (fs.existsSync(target) && !argv.force) {
|
|
83
|
+
die(`${out} already exists. Run fix to repair it, or pass --force to start over.`);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const { catalog } = loadCatalog(argv.catalog);
|
|
87
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
88
|
+
fs.writeFileSync(target, [...PREAMBLE, ...render(catalog, []), ''].join('\n'), 'utf8');
|
|
89
|
+
|
|
90
|
+
process.stdout.write(
|
|
91
|
+
`Wrote ${out} with ${catalog.length} characteristics in catalog order.\n` +
|
|
92
|
+
'Reorder the rows, replace every {why}, then run fix.\n'
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function fix(argv) {
|
|
97
|
+
const file = argv.file || DEFAULT_FILE;
|
|
98
|
+
const target = path.resolve(projectRoot(), file);
|
|
99
|
+
|
|
100
|
+
if (!fs.existsSync(target)) die(`${file} does not exist. Run scaffold first.`);
|
|
101
|
+
|
|
102
|
+
const original = fs.readFileSync(target, 'utf8');
|
|
103
|
+
const eol = original.includes('\r\n') ? '\r\n' : '\n';
|
|
104
|
+
const lines = original.split(/\r?\n/);
|
|
105
|
+
|
|
106
|
+
const bounds = locateTable(lines, RANKING_HEADER);
|
|
107
|
+
if (!bounds) die(`${file} holds no table with a "| Order | Characteristic | Reason |" header row.`);
|
|
108
|
+
|
|
109
|
+
const table = lines.slice(bounds.start, bounds.end);
|
|
110
|
+
const data = table.filter((l) => {
|
|
111
|
+
const c = splitCells(l);
|
|
112
|
+
return c.length >= 3 && !isSeparator(c) && !/^order$/i.test(c[0]);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
if (!data.length) die(`${file} holds no ranking rows to fix.`);
|
|
116
|
+
|
|
117
|
+
const order = data.map((l) => normalise(splitCells(l)[1]));
|
|
118
|
+
const justifications = data.map((l) => justificationOf(splitCells(l)[2]));
|
|
119
|
+
|
|
120
|
+
const { catalog } = loadCatalog(argv.catalog);
|
|
121
|
+
const unknown = order.filter((n) => !catalog.includes(n));
|
|
122
|
+
if (unknown.length) die(`${file} names characteristics absent from the catalog: ${unknown.join(', ')}`);
|
|
123
|
+
|
|
124
|
+
const rebuilt = render(order, justifications);
|
|
125
|
+
const next = [...lines.slice(0, bounds.start), ...rebuilt, ...lines.slice(bounds.end)];
|
|
126
|
+
const updated = next.join(eol);
|
|
127
|
+
|
|
128
|
+
// Reported whether or not anything moved: a scaffold is already correct and
|
|
129
|
+
// still has every justification left to write.
|
|
130
|
+
const blank = justifications.filter((j, i) => i < justifications.length - 1 && (!j || j === PLACEHOLDER)).length;
|
|
131
|
+
const outstanding = blank ? `${blank} row(s) still need a justification in place of ${PLACEHOLDER}.\n` : '';
|
|
132
|
+
|
|
133
|
+
if (updated === original) {
|
|
134
|
+
process.stdout.write(`${file} is already correct.\n${outstanding}`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
fs.writeFileSync(target, updated, 'utf8');
|
|
139
|
+
|
|
140
|
+
const repaired = data.filter((l, i) => splitCells(l)[2] !== splitCells(rebuilt[i + 2])[2]).length;
|
|
141
|
+
const renumbered = data.filter((l, i) => splitCells(l)[0] !== String(i + 1)).length;
|
|
142
|
+
|
|
143
|
+
process.stdout.write(
|
|
144
|
+
`Fixed ${file}: renumbered ${renumbered} row(s), rebuilt ${repaired} reason(s).\n${outstanding}`
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function main() {
|
|
149
|
+
const [command, ...rest] = process.argv.slice(2);
|
|
150
|
+
const argv = { force: false };
|
|
151
|
+
|
|
152
|
+
for (let i = 0; i < rest.length; i += 1) {
|
|
153
|
+
const flag = rest[i];
|
|
154
|
+
if (flag === '--force') argv.force = true;
|
|
155
|
+
else if (flag === '--out') argv.out = rest[(i += 1)];
|
|
156
|
+
else if (flag === '--file') argv.file = rest[(i += 1)];
|
|
157
|
+
else if (flag === '--catalog') argv.catalog = rest[(i += 1)];
|
|
158
|
+
else die(`unknown argument: ${flag}`);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
if (command === 'scaffold') return scaffold(argv);
|
|
163
|
+
if (command === 'fix') return fix(argv);
|
|
164
|
+
} catch (err) {
|
|
165
|
+
die(err.message);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
die('usage: ranking-table.cjs scaffold [--out <path>] [--force] | fix [--file <path>]');
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
main();
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: context-map
|
|
3
|
-
description: Write or update a DDD Context Map in CML (Context Mapper Language).
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
<what-to-do>
|
|
7
|
-
|
|
8
|
-
Given a Context Map intent, produce or update the single `docs/bounded-contexts/context-map.cml` (one map per system, spanning every BC). The four intent shapes (use these exact labels):
|
|
9
|
-
|
|
10
|
-
- **`BC`** — name, optional `type` / `domainVisionStatement` / `responsibilities`. Adds it to `contains` and appends a `BoundedContext <Name>` declaration.
|
|
11
|
-
- **`peer-context`** — same shape as `BC`, named after an external system. Used for every `external_system` declared on the EventStorming wall.
|
|
12
|
-
- **`relationship`** — upstream BC, downstream BC, shape (Partnership / Shared-Kernel / Upstream-Downstream / Customer-Supplier), role brackets, optional name, optional `{ implementationTechnology, downstreamRights, exposedAggregates }` attributes.
|
|
13
|
-
- **`Aggregate`** — name + owning BC. Adds `Aggregate <Name>` inside the BC's `{ … }` body, creating the body if it was empty. Required when the name appears in any relationship's `exposedAggregates`. Maintain 1:1 sync with the wall JSON: every entry in `aggregates[]` on the BC's `docs/bounded-contexts/{bc}/event-storming.json` (or the general `docs/event-storming.json` before segregation) has a matching `Aggregate <Name>` inside its owning BC, written the same turn.
|
|
14
|
-
|
|
15
|
-
Workflow:
|
|
16
|
-
|
|
17
|
-
1. **Locate or scaffold the file.** If it doesn't exist, scaffold a minimal `ContextMap SystemContextMap { type = SYSTEM_LANDSCAPE state = AS_IS contains <BCs> }` block followed by one `BoundedContext <Name>` declaration per BC in `contains`. Use [example.cml](./example.cml) as a **syntax reference**, not a literal copy — its DDDSample BCs are illustrative.
|
|
18
|
-
2. **Write the requested change.** Per intent shape: add the `contains` entry + `BoundedContext` declaration (`BC` / `peer-context`); add the relationship line (`relationship`); add `Aggregate <Name>` inside the owning BC's body (`Aggregate`). For every BC newly referenced anywhere, append a `BoundedContext <Name>` declaration — without it Xtext linker fails with `Couldn't resolve reference to BoundedContext '<Name>'`.
|
|
19
|
-
3. **Lint.** A PostToolUse hook auto-runs Context Mapper validation on every `.cml` edit. Treat any `ERROR …` line in its output as blocking; `WARNING …` lines (e.g. ACL on Customer-Supplier per Semantic Rule #7) are allowed when intentional.
|
|
20
|
-
4. **Hand-audit.** `cm validate` is necessary but not sufficient — see Limitations below. Audit three things by hand before reporting success: (i) every `exposedAggregates` name lives in the upstream BC of its relationship; (ii) every role bracket combo respects the 10 Semantic Rules; (iii) no Aggregate name is duplicated across BCs unless deliberate.
|
|
21
|
-
5. **Report.** State the line(s) written and PASS/FAIL of `cm validate` (on FAIL, paste only the first `ERROR` line and where to fix). Call out anything the hand-audit flagged.
|
|
22
|
-
|
|
23
|
-
If a piece of the intent is ambiguous (e.g. which side is upstream, which roles to use), ask the caller — don't invent. The skill's job is mechanical correctness, not design judgement.
|
|
24
|
-
|
|
25
|
-
</what-to-do>
|
|
26
|
-
|
|
27
|
-
<supporting-info>
|
|
28
|
-
|
|
29
|
-
## File location
|
|
30
|
-
|
|
31
|
-
`docs/bounded-contexts/context-map.cml` — a single map for the whole system, sitting beside the per-BC folders.
|
|
32
|
-
|
|
33
|
-
## Reference (load lazily by intent shape)
|
|
34
|
-
|
|
35
|
-
The reference is an Obsidian folder with `[[wikilinks]]` between files. Load in tiers — don't front-load everything:
|
|
36
|
-
|
|
37
|
-
- **Always** (first invocation this session):
|
|
38
|
-
- `./reference/Context Map.md` — top-level grammar, relationship arrows, role brackets, attributes.
|
|
39
|
-
- `./reference/Semantic Rules.md` — the 10 combination rules.
|
|
40
|
-
- **When writing a `BC` or `peer-context`** with non-trivial attributes:
|
|
41
|
-
- `./reference/Bounded Context/Bounded Context.md` — attribute docs (`implements`, `refines`, `domainVisionStatement`, `responsibilities`, `type`, `knowledgeLevel`, `businessModel`, `evolution`, `realizes`).
|
|
42
|
-
- **When writing a `relationship`**:
|
|
43
|
-
- `./reference/Bounded Context Relationship/Bounded Context Relationship.md` — per-pattern pages (Partnership, Shared Kernel, Customer-Supplier, OHS, PL, CF, ACL).
|
|
44
|
-
- **When writing an `Aggregate` or setting `exposedAggregates`**:
|
|
45
|
-
- `./reference/Aggregate/Aggregate.md` — Aggregate composition.
|
|
46
|
-
- **When a BC uses `implements` / `refines`**:
|
|
47
|
-
- `./reference/Domain/Domain.md` — Domain / Subdomain framing.
|
|
48
|
-
|
|
49
|
-
## Linting (mandatory before reporting success)
|
|
50
|
-
|
|
51
|
-
Validation runs automatically via the PostToolUse `validate-cml-hook` on every `.cml` edit (Context Mapper CLI, self-bootstrapped from Maven on first run; requires Java 8+).
|
|
52
|
-
|
|
53
|
-
**CML-specific failure modes to recognise:**
|
|
54
|
-
|
|
55
|
-
- `Couldn't resolve reference to BoundedContext '<Name>'` + `The Bounded Context 'null' is not part of the Context Map.` — a name in `contains` or a relationship line has no `BoundedContext <Name>` declaration. Fix: append the missing declaration.
|
|
56
|
-
- `ERROR in null on line N: no viable alternative at input '<token>'` — parse error. Re-read the grammar at the reported line.
|
|
57
|
-
|
|
58
|
-
## Limitations of `cm validate` — hand-audit is required after it passes
|
|
59
|
-
|
|
60
|
-
Confirmed-misses (tested against 6.12.0):
|
|
61
|
-
|
|
62
|
-
| Catches | Misses |
|
|
63
|
-
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
-
| Parse errors with line numbers | Semantic Rule violations from `Semantic Rules.md` (OHS on Customer-Supplier #6, CF on Customer-Supplier #5, ACL/CF/OHS/PL on symmetric relationships #4, etc.) |
|
|
65
|
-
| Linker errors when they fire | Duplicate Aggregate names across different BCs (CML scopes `exposedAggregates` by upstream BC, so duplicates resolve rather than collide — but they're semantically muddled) |
|
|
66
|
-
| Resource-level diagnostics from `cmlResource.getErrors()` | Anything that needs the full Xtext `IResourceValidator` chain (Eclipse/VSCode extension surfaces these; the CLI does not) |
|
|
67
|
-
|
|
68
|
-
After `cm validate` prints "without errors", audit by hand:
|
|
69
|
-
|
|
70
|
-
1. Every `exposedAggregates` name resolves to an Aggregate declared inside the **upstream** BC of that relationship line.
|
|
71
|
-
2. Every role bracket combo is allowed by the 10 Semantic Rules (consult `./reference/Semantic Rules.md`).
|
|
72
|
-
3. No Aggregate name is duplicated across BCs unless deliberate.
|
|
73
|
-
|
|
74
|
-
For deeper validation, open the file in VSCode with the Context Mapper extension installed.
|
|
75
|
-
|
|
76
|
-
## Glossary
|
|
77
|
-
|
|
78
|
-
Same `ubiquitous-language.md` convention as the EventStorming skills. Challenge BC names against the language doc before writing. If a relationship introduces a novel domain term, add a one-sentence definition in `docs/ubiquitous-language.md` the same turn.
|
|
79
|
-
|
|
80
|
-
</supporting-info>
|
|
1
|
+
---
|
|
2
|
+
name: context-map
|
|
3
|
+
description: Write or update a DDD Context Map in CML (Context Mapper Language).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<what-to-do>
|
|
7
|
+
|
|
8
|
+
Given a Context Map intent, produce or update the single `docs/bounded-contexts/context-map.cml` (one map per system, spanning every BC). The four intent shapes (use these exact labels):
|
|
9
|
+
|
|
10
|
+
- **`BC`** — name, optional `type` / `domainVisionStatement` / `responsibilities`. Adds it to `contains` and appends a `BoundedContext <Name>` declaration.
|
|
11
|
+
- **`peer-context`** — same shape as `BC`, named after an external system. Used for every `external_system` declared on the EventStorming wall.
|
|
12
|
+
- **`relationship`** — upstream BC, downstream BC, shape (Partnership / Shared-Kernel / Upstream-Downstream / Customer-Supplier), role brackets, optional name, optional `{ implementationTechnology, downstreamRights, exposedAggregates }` attributes.
|
|
13
|
+
- **`Aggregate`** — name + owning BC. Adds `Aggregate <Name>` inside the BC's `{ … }` body, creating the body if it was empty. Required when the name appears in any relationship's `exposedAggregates`. Maintain 1:1 sync with the wall JSON: every entry in `aggregates[]` on the BC's `docs/bounded-contexts/{bc}/event-storming.json` (or the general `docs/event-storming.json` before segregation) has a matching `Aggregate <Name>` inside its owning BC, written the same turn.
|
|
14
|
+
|
|
15
|
+
Workflow:
|
|
16
|
+
|
|
17
|
+
1. **Locate or scaffold the file.** If it doesn't exist, scaffold a minimal `ContextMap SystemContextMap { type = SYSTEM_LANDSCAPE state = AS_IS contains <BCs> }` block followed by one `BoundedContext <Name>` declaration per BC in `contains`. Use [example.cml](./example.cml) as a **syntax reference**, not a literal copy — its DDDSample BCs are illustrative.
|
|
18
|
+
2. **Write the requested change.** Per intent shape: add the `contains` entry + `BoundedContext` declaration (`BC` / `peer-context`); add the relationship line (`relationship`); add `Aggregate <Name>` inside the owning BC's body (`Aggregate`). For every BC newly referenced anywhere, append a `BoundedContext <Name>` declaration — without it Xtext linker fails with `Couldn't resolve reference to BoundedContext '<Name>'`.
|
|
19
|
+
3. **Lint.** A PostToolUse hook auto-runs Context Mapper validation on every `.cml` edit. Treat any `ERROR …` line in its output as blocking; `WARNING …` lines (e.g. ACL on Customer-Supplier per Semantic Rule #7) are allowed when intentional.
|
|
20
|
+
4. **Hand-audit.** `cm validate` is necessary but not sufficient — see Limitations below. Audit three things by hand before reporting success: (i) every `exposedAggregates` name lives in the upstream BC of its relationship; (ii) every role bracket combo respects the 10 Semantic Rules; (iii) no Aggregate name is duplicated across BCs unless deliberate.
|
|
21
|
+
5. **Report.** State the line(s) written and PASS/FAIL of `cm validate` (on FAIL, paste only the first `ERROR` line and where to fix). Call out anything the hand-audit flagged.
|
|
22
|
+
|
|
23
|
+
If a piece of the intent is ambiguous (e.g. which side is upstream, which roles to use), ask the caller — don't invent. The skill's job is mechanical correctness, not design judgement.
|
|
24
|
+
|
|
25
|
+
</what-to-do>
|
|
26
|
+
|
|
27
|
+
<supporting-info>
|
|
28
|
+
|
|
29
|
+
## File location
|
|
30
|
+
|
|
31
|
+
`docs/bounded-contexts/context-map.cml` — a single map for the whole system, sitting beside the per-BC folders.
|
|
32
|
+
|
|
33
|
+
## Reference (load lazily by intent shape)
|
|
34
|
+
|
|
35
|
+
The reference is an Obsidian folder with `[[wikilinks]]` between files. Load in tiers — don't front-load everything:
|
|
36
|
+
|
|
37
|
+
- **Always** (first invocation this session):
|
|
38
|
+
- `./reference/Context Map.md` — top-level grammar, relationship arrows, role brackets, attributes.
|
|
39
|
+
- `./reference/Semantic Rules.md` — the 10 combination rules.
|
|
40
|
+
- **When writing a `BC` or `peer-context`** with non-trivial attributes:
|
|
41
|
+
- `./reference/Bounded Context/Bounded Context.md` — attribute docs (`implements`, `refines`, `domainVisionStatement`, `responsibilities`, `type`, `knowledgeLevel`, `businessModel`, `evolution`, `realizes`).
|
|
42
|
+
- **When writing a `relationship`**:
|
|
43
|
+
- `./reference/Bounded Context Relationship/Bounded Context Relationship.md` — per-pattern pages (Partnership, Shared Kernel, Customer-Supplier, OHS, PL, CF, ACL).
|
|
44
|
+
- **When writing an `Aggregate` or setting `exposedAggregates`**:
|
|
45
|
+
- `./reference/Aggregate/Aggregate.md` — Aggregate composition.
|
|
46
|
+
- **When a BC uses `implements` / `refines`**:
|
|
47
|
+
- `./reference/Domain/Domain.md` — Domain / Subdomain framing.
|
|
48
|
+
|
|
49
|
+
## Linting (mandatory before reporting success)
|
|
50
|
+
|
|
51
|
+
Validation runs automatically via the PostToolUse `validate-cml-hook` on every `.cml` edit (Context Mapper CLI, self-bootstrapped from Maven on first run; requires Java 8+).
|
|
52
|
+
|
|
53
|
+
**CML-specific failure modes to recognise:**
|
|
54
|
+
|
|
55
|
+
- `Couldn't resolve reference to BoundedContext '<Name>'` + `The Bounded Context 'null' is not part of the Context Map.` — a name in `contains` or a relationship line has no `BoundedContext <Name>` declaration. Fix: append the missing declaration.
|
|
56
|
+
- `ERROR in null on line N: no viable alternative at input '<token>'` — parse error. Re-read the grammar at the reported line.
|
|
57
|
+
|
|
58
|
+
## Limitations of `cm validate` — hand-audit is required after it passes
|
|
59
|
+
|
|
60
|
+
Confirmed-misses (tested against 6.12.0):
|
|
61
|
+
|
|
62
|
+
| Catches | Misses |
|
|
63
|
+
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| Parse errors with line numbers | Semantic Rule violations from `Semantic Rules.md` (OHS on Customer-Supplier #6, CF on Customer-Supplier #5, ACL/CF/OHS/PL on symmetric relationships #4, etc.) |
|
|
65
|
+
| Linker errors when they fire | Duplicate Aggregate names across different BCs (CML scopes `exposedAggregates` by upstream BC, so duplicates resolve rather than collide — but they're semantically muddled) |
|
|
66
|
+
| Resource-level diagnostics from `cmlResource.getErrors()` | Anything that needs the full Xtext `IResourceValidator` chain (Eclipse/VSCode extension surfaces these; the CLI does not) |
|
|
67
|
+
|
|
68
|
+
After `cm validate` prints "without errors", audit by hand:
|
|
69
|
+
|
|
70
|
+
1. Every `exposedAggregates` name resolves to an Aggregate declared inside the **upstream** BC of that relationship line.
|
|
71
|
+
2. Every role bracket combo is allowed by the 10 Semantic Rules (consult `./reference/Semantic Rules.md`).
|
|
72
|
+
3. No Aggregate name is duplicated across BCs unless deliberate.
|
|
73
|
+
|
|
74
|
+
For deeper validation, open the file in VSCode with the Context Mapper extension installed.
|
|
75
|
+
|
|
76
|
+
## Glossary
|
|
77
|
+
|
|
78
|
+
Same `ubiquitous-language.md` convention as the EventStorming skills. Challenge BC names against the language doc before writing. If a relationship introduces a novel domain term, add a one-sentence definition in `docs/ubiquitous-language.md` the same turn.
|
|
79
|
+
|
|
80
|
+
</supporting-info>
|