@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
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
function containedPath(root, candidate) {
|
|
7
|
-
const resolvedRoot = path.resolve(root);
|
|
8
|
-
const resolved = path.resolve(candidate);
|
|
9
|
-
if (resolved !== resolvedRoot && !resolved.startsWith(resolvedRoot + path.sep)) return null;
|
|
10
|
-
return resolved;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Build output directories. These are regenerated by `dotnet build` and must
|
|
14
|
-
// never reach a generated project: they embed absolute paths from whichever
|
|
15
|
-
// machine built the template, and their binaries would be mangled by the
|
|
16
|
-
// UTF-8 read + token substitution below.
|
|
17
|
-
const EXCLUDED_DIRS = new Set(["bin", "obj"]);
|
|
18
|
-
|
|
19
|
-
function substitute(text, token, replacement) {
|
|
20
|
-
return text.split(token).join(replacement);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Recursively copy every file under srcDir into stagingDir, substituting
|
|
25
|
-
* `token` with `replacement` in both path segments and file contents. Every
|
|
26
|
-
* computed destination path is validated to stay under `stagingDir` — rejects
|
|
27
|
-
* (throws) rather than writing outside it.
|
|
28
|
-
* @param {string} srcDir
|
|
29
|
-
* @param {string} stagingDir
|
|
30
|
-
* @param {string} token
|
|
31
|
-
* @param {string} replacement
|
|
32
|
-
*/
|
|
33
|
-
function copyTemplateWithTokenSubstitution(srcDir, stagingDir, token, replacement) {
|
|
34
|
-
walk(srcDir, stagingDir, stagingDir, token, replacement);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function walk(currentSrc, currentDest, stagingRoot, token, replacement) {
|
|
38
|
-
const entries = fs.readdirSync(currentSrc, { withFileTypes: true });
|
|
39
|
-
for (const entry of entries) {
|
|
40
|
-
if (entry.isDirectory() && EXCLUDED_DIRS.has(entry.name)) continue;
|
|
41
|
-
const substitutedName = substitute(entry.name, token, replacement);
|
|
42
|
-
const srcPath = path.join(currentSrc, entry.name);
|
|
43
|
-
const destPath = containedPath(stagingRoot, path.join(currentDest, substitutedName));
|
|
44
|
-
if (!destPath) {
|
|
45
|
-
throw new Error(`copyTemplateWithTokenSubstitution: computed path escapes staging dir: "${substitutedName}"`);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (entry.isDirectory()) {
|
|
49
|
-
fs.mkdirSync(destPath, { recursive: true });
|
|
50
|
-
walk(srcPath, destPath, stagingRoot, token, replacement);
|
|
51
|
-
} else if (entry.isFile()) {
|
|
52
|
-
fs.mkdirSync(path.dirname(destPath), { recursive: true });
|
|
53
|
-
const content = fs.readFileSync(srcPath, 'utf8');
|
|
54
|
-
fs.writeFileSync(destPath, substitute(content, token, replacement), 'utf8');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Move every top-level entry from stagingDir into projectDir. Pre-checks all
|
|
61
|
-
* names for collisions before moving any of them, then moves each via
|
|
62
|
-
* fs.renameSync (atomic per entry on the same filesystem). Throws instead of
|
|
63
|
-
* silently overwriting if a destination name already exists.
|
|
64
|
-
* @param {string} stagingDir
|
|
65
|
-
* @param {string} projectDir
|
|
66
|
-
*/
|
|
67
|
-
function promoteStagedScaffold(stagingDir, projectDir) {
|
|
68
|
-
const entries = fs.readdirSync(stagingDir, { withFileTypes: true });
|
|
69
|
-
for (const entry of entries) {
|
|
70
|
-
if (fs.existsSync(path.join(projectDir, entry.name))) {
|
|
71
|
-
throw new Error(`promoteStagedScaffold: "${entry.name}" already exists at destination`);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
for (const entry of entries) {
|
|
75
|
-
fs.renameSync(path.join(stagingDir, entry.name), path.join(projectDir, entry.name));
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
module.exports = { copyTemplateWithTokenSubstitution, promoteStagedScaffold };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
function containedPath(root, candidate) {
|
|
7
|
+
const resolvedRoot = path.resolve(root);
|
|
8
|
+
const resolved = path.resolve(candidate);
|
|
9
|
+
if (resolved !== resolvedRoot && !resolved.startsWith(resolvedRoot + path.sep)) return null;
|
|
10
|
+
return resolved;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Build output directories. These are regenerated by `dotnet build` and must
|
|
14
|
+
// never reach a generated project: they embed absolute paths from whichever
|
|
15
|
+
// machine built the template, and their binaries would be mangled by the
|
|
16
|
+
// UTF-8 read + token substitution below.
|
|
17
|
+
const EXCLUDED_DIRS = new Set(["bin", "obj"]);
|
|
18
|
+
|
|
19
|
+
function substitute(text, token, replacement) {
|
|
20
|
+
return text.split(token).join(replacement);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Recursively copy every file under srcDir into stagingDir, substituting
|
|
25
|
+
* `token` with `replacement` in both path segments and file contents. Every
|
|
26
|
+
* computed destination path is validated to stay under `stagingDir` — rejects
|
|
27
|
+
* (throws) rather than writing outside it.
|
|
28
|
+
* @param {string} srcDir
|
|
29
|
+
* @param {string} stagingDir
|
|
30
|
+
* @param {string} token
|
|
31
|
+
* @param {string} replacement
|
|
32
|
+
*/
|
|
33
|
+
function copyTemplateWithTokenSubstitution(srcDir, stagingDir, token, replacement) {
|
|
34
|
+
walk(srcDir, stagingDir, stagingDir, token, replacement);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function walk(currentSrc, currentDest, stagingRoot, token, replacement) {
|
|
38
|
+
const entries = fs.readdirSync(currentSrc, { withFileTypes: true });
|
|
39
|
+
for (const entry of entries) {
|
|
40
|
+
if (entry.isDirectory() && EXCLUDED_DIRS.has(entry.name)) continue;
|
|
41
|
+
const substitutedName = substitute(entry.name, token, replacement);
|
|
42
|
+
const srcPath = path.join(currentSrc, entry.name);
|
|
43
|
+
const destPath = containedPath(stagingRoot, path.join(currentDest, substitutedName));
|
|
44
|
+
if (!destPath) {
|
|
45
|
+
throw new Error(`copyTemplateWithTokenSubstitution: computed path escapes staging dir: "${substitutedName}"`);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (entry.isDirectory()) {
|
|
49
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
50
|
+
walk(srcPath, destPath, stagingRoot, token, replacement);
|
|
51
|
+
} else if (entry.isFile()) {
|
|
52
|
+
fs.mkdirSync(path.dirname(destPath), { recursive: true });
|
|
53
|
+
const content = fs.readFileSync(srcPath, 'utf8');
|
|
54
|
+
fs.writeFileSync(destPath, substitute(content, token, replacement), 'utf8');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Move every top-level entry from stagingDir into projectDir. Pre-checks all
|
|
61
|
+
* names for collisions before moving any of them, then moves each via
|
|
62
|
+
* fs.renameSync (atomic per entry on the same filesystem). Throws instead of
|
|
63
|
+
* silently overwriting if a destination name already exists.
|
|
64
|
+
* @param {string} stagingDir
|
|
65
|
+
* @param {string} projectDir
|
|
66
|
+
*/
|
|
67
|
+
function promoteStagedScaffold(stagingDir, projectDir) {
|
|
68
|
+
const entries = fs.readdirSync(stagingDir, { withFileTypes: true });
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
if (fs.existsSync(path.join(projectDir, entry.name))) {
|
|
71
|
+
throw new Error(`promoteStagedScaffold: "${entry.name}" already exists at destination`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const entry of entries) {
|
|
75
|
+
fs.renameSync(path.join(stagingDir, entry.name), path.join(projectDir, entry.name));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
module.exports = { copyTemplateWithTokenSubstitution, promoteStagedScaffold };
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { spawnSync } = require('child_process');
|
|
6
|
-
|
|
7
|
-
// Map of secret prereq name → environment variable that satisfies it.
|
|
8
|
-
const SECRET_ENV = { 'anthropic-api-key': 'ANTHROPIC_API_KEY' };
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Default command runner. Captures stdout+stderr (java prints version to stderr)
|
|
12
|
-
* and never throws. Tests inject their own `ctx.run` to avoid touching the host.
|
|
13
|
-
* @param {string} cmd
|
|
14
|
-
* @returns {{code:number, stdout:string, stderr:string}}
|
|
15
|
-
*/
|
|
16
|
-
function defaultRun(cmd) {
|
|
17
|
-
const r = spawnSync(cmd, { shell: true, encoding: 'utf8', windowsHide: true });
|
|
18
|
-
return {
|
|
19
|
-
code: typeof r.status === 'number' ? r.status : 1,
|
|
20
|
-
stdout: r.stdout || '',
|
|
21
|
-
stderr: r.stderr || '',
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Extract a numeric version tuple from arbitrary command output. */
|
|
26
|
-
function parseVersion(text) {
|
|
27
|
-
const m = String(text).match(/(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
28
|
-
if (!m) return null;
|
|
29
|
-
return [Number(m[1] || 0), Number(m[2] || 0), Number(m[3] || 0)];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/** found >= min ? (min may be "18" or "3.8") */
|
|
33
|
-
function versionGte(found, min) {
|
|
34
|
-
if (!found) return false;
|
|
35
|
-
const want = parseVersion(min) || [0, 0, 0];
|
|
36
|
-
for (let i = 0; i < 3; i++) {
|
|
37
|
-
if (found[i] > want[i]) return true;
|
|
38
|
-
if (found[i] < want[i]) return false;
|
|
39
|
-
}
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Detect whether a single prereq is satisfied. Detection NEVER mutates the host.
|
|
45
|
-
* @param {string} name prereq id
|
|
46
|
-
* @param {object} prereq manifest prereq entry
|
|
47
|
-
* @param {object} ctx { run, platform, projectDir }
|
|
48
|
-
* @returns {{name:string, present:boolean, version:?string, reason:string}}
|
|
49
|
-
*/
|
|
50
|
-
function detectPrereq(name, prereq, ctx) {
|
|
51
|
-
const run = ctx.run || defaultRun;
|
|
52
|
-
|
|
53
|
-
switch (prereq.kind) {
|
|
54
|
-
case 'secret': {
|
|
55
|
-
const envVar = SECRET_ENV[name];
|
|
56
|
-
const present = !!(envVar && process.env[envVar]);
|
|
57
|
-
return { name, present, version: null, reason: present ? `${envVar} set` : `${envVar} unset` };
|
|
58
|
-
}
|
|
59
|
-
case 'venv': {
|
|
60
|
-
const dir = path.join(ctx.projectDir, '.claude', 'skills', '.venv');
|
|
61
|
-
const present = fs.existsSync(dir);
|
|
62
|
-
return { name, present, version: null, reason: present ? 'venv exists' : 'venv missing' };
|
|
63
|
-
}
|
|
64
|
-
case 'mcp': {
|
|
65
|
-
const r = run('claude mcp list');
|
|
66
|
-
const present = r.code === 0 && /playwright/i.test(r.stdout + r.stderr);
|
|
67
|
-
return { name, present, version: null, reason: present ? 'mcp registered' : 'mcp not registered' };
|
|
68
|
-
}
|
|
69
|
-
case 'note':
|
|
70
|
-
// Nothing to probe directly; satisfied iff its `needs` are (handled by caller).
|
|
71
|
-
return { name, present: false, version: null, reason: 'note (self-bootstrap)' };
|
|
72
|
-
default: {
|
|
73
|
-
// package
|
|
74
|
-
if (!prereq.detect) return { name, present: false, version: null, reason: 'no detect command' };
|
|
75
|
-
let r = run(prereq.detect);
|
|
76
|
-
if (r.code !== 0 && name === 'python') r = run('python3 --version'); // unix fallback
|
|
77
|
-
const out = r.stdout + r.stderr;
|
|
78
|
-
const ver = parseVersion(out);
|
|
79
|
-
if (r.code !== 0) return { name, present: false, version: null, reason: 'not found' };
|
|
80
|
-
if (prereq.minVersion && !versionGte(ver, prereq.minVersion)) {
|
|
81
|
-
return {
|
|
82
|
-
name,
|
|
83
|
-
present: false,
|
|
84
|
-
version: ver ? ver.join('.') : null,
|
|
85
|
-
reason: `version ${ver ? ver.join('.') : '?'} < required ${prereq.minVersion}`,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
return { name, present: true, version: ver ? ver.join('.') : null, reason: 'present' };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
module.exports = { detectPrereq, parseVersion, versionGte, defaultRun, SECRET_ENV };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
// Map of secret prereq name → environment variable that satisfies it.
|
|
8
|
+
const SECRET_ENV = { 'anthropic-api-key': 'ANTHROPIC_API_KEY' };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Default command runner. Captures stdout+stderr (java prints version to stderr)
|
|
12
|
+
* and never throws. Tests inject their own `ctx.run` to avoid touching the host.
|
|
13
|
+
* @param {string} cmd
|
|
14
|
+
* @returns {{code:number, stdout:string, stderr:string}}
|
|
15
|
+
*/
|
|
16
|
+
function defaultRun(cmd) {
|
|
17
|
+
const r = spawnSync(cmd, { shell: true, encoding: 'utf8', windowsHide: true });
|
|
18
|
+
return {
|
|
19
|
+
code: typeof r.status === 'number' ? r.status : 1,
|
|
20
|
+
stdout: r.stdout || '',
|
|
21
|
+
stderr: r.stderr || '',
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Extract a numeric version tuple from arbitrary command output. */
|
|
26
|
+
function parseVersion(text) {
|
|
27
|
+
const m = String(text).match(/(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
28
|
+
if (!m) return null;
|
|
29
|
+
return [Number(m[1] || 0), Number(m[2] || 0), Number(m[3] || 0)];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** found >= min ? (min may be "18" or "3.8") */
|
|
33
|
+
function versionGte(found, min) {
|
|
34
|
+
if (!found) return false;
|
|
35
|
+
const want = parseVersion(min) || [0, 0, 0];
|
|
36
|
+
for (let i = 0; i < 3; i++) {
|
|
37
|
+
if (found[i] > want[i]) return true;
|
|
38
|
+
if (found[i] < want[i]) return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Detect whether a single prereq is satisfied. Detection NEVER mutates the host.
|
|
45
|
+
* @param {string} name prereq id
|
|
46
|
+
* @param {object} prereq manifest prereq entry
|
|
47
|
+
* @param {object} ctx { run, platform, projectDir }
|
|
48
|
+
* @returns {{name:string, present:boolean, version:?string, reason:string}}
|
|
49
|
+
*/
|
|
50
|
+
function detectPrereq(name, prereq, ctx) {
|
|
51
|
+
const run = ctx.run || defaultRun;
|
|
52
|
+
|
|
53
|
+
switch (prereq.kind) {
|
|
54
|
+
case 'secret': {
|
|
55
|
+
const envVar = SECRET_ENV[name];
|
|
56
|
+
const present = !!(envVar && process.env[envVar]);
|
|
57
|
+
return { name, present, version: null, reason: present ? `${envVar} set` : `${envVar} unset` };
|
|
58
|
+
}
|
|
59
|
+
case 'venv': {
|
|
60
|
+
const dir = path.join(ctx.projectDir, '.claude', 'skills', '.venv');
|
|
61
|
+
const present = fs.existsSync(dir);
|
|
62
|
+
return { name, present, version: null, reason: present ? 'venv exists' : 'venv missing' };
|
|
63
|
+
}
|
|
64
|
+
case 'mcp': {
|
|
65
|
+
const r = run('claude mcp list');
|
|
66
|
+
const present = r.code === 0 && /playwright/i.test(r.stdout + r.stderr);
|
|
67
|
+
return { name, present, version: null, reason: present ? 'mcp registered' : 'mcp not registered' };
|
|
68
|
+
}
|
|
69
|
+
case 'note':
|
|
70
|
+
// Nothing to probe directly; satisfied iff its `needs` are (handled by caller).
|
|
71
|
+
return { name, present: false, version: null, reason: 'note (self-bootstrap)' };
|
|
72
|
+
default: {
|
|
73
|
+
// package
|
|
74
|
+
if (!prereq.detect) return { name, present: false, version: null, reason: 'no detect command' };
|
|
75
|
+
let r = run(prereq.detect);
|
|
76
|
+
if (r.code !== 0 && name === 'python') r = run('python3 --version'); // unix fallback
|
|
77
|
+
const out = r.stdout + r.stderr;
|
|
78
|
+
const ver = parseVersion(out);
|
|
79
|
+
if (r.code !== 0) return { name, present: false, version: null, reason: 'not found' };
|
|
80
|
+
if (prereq.minVersion && !versionGte(ver, prereq.minVersion)) {
|
|
81
|
+
return {
|
|
82
|
+
name,
|
|
83
|
+
present: false,
|
|
84
|
+
version: ver ? ver.join('.') : null,
|
|
85
|
+
reason: `version ${ver ? ver.join('.') : '?'} < required ${prereq.minVersion}`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return { name, present: true, version: ver ? ver.join('.') : null, reason: 'present' };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module.exports = { detectPrereq, parseVersion, versionGte, defaultRun, SECRET_ENV };
|
package/src/self-update.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Self-update gate for `musketeer muster`. Before the picker applies the bundled
|
|
4
|
-
// template, make sure the CLI is at the latest PUBLISHED version — otherwise
|
|
5
|
-
// "muster" would refresh installed skills to a stale package's template.
|
|
6
|
-
//
|
|
7
|
-
// When behind: promote (npm i -g @latest), then re-exec `musketeer muster` so the
|
|
8
|
-
// picker runs under the freshly-installed template. A running Node process can't
|
|
9
|
-
// reliably hot-swap its own package files mid-run, so re-exec is the safe path.
|
|
10
|
-
//
|
|
11
|
-
// Guards:
|
|
12
|
-
// MUSKETEER_REEXEC=1 set on the child so it never re-checks (no loop)
|
|
13
|
-
// MUSKETEER_NO_SELF_UPDATE=1 user opt-out (offline / pinned version)
|
|
14
|
-
|
|
15
|
-
const { spawnSync } = require('child_process');
|
|
16
|
-
const { fetchLatest, compareVersions, defaultRun } = require('./promote');
|
|
17
|
-
const pkg = require('../package.json');
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Decide whether muster should self-update first. Pure — injectable exec/env.
|
|
21
|
-
* @param {{exec?:Function, current?:string, name?:string, env?:object}} [o]
|
|
22
|
-
* @returns {{action:'proceed'|'update', latest:?string}}
|
|
23
|
-
*/
|
|
24
|
-
function decide(o = {}) {
|
|
25
|
-
const exec = o.exec || defaultRun;
|
|
26
|
-
const current = o.current || pkg.version;
|
|
27
|
-
const name = o.name || pkg.name;
|
|
28
|
-
const env = o.env || process.env;
|
|
29
|
-
|
|
30
|
-
if (env.MUSKETEER_REEXEC === '1' || env.MUSKETEER_NO_SELF_UPDATE === '1') {
|
|
31
|
-
return { action: 'proceed', latest: null };
|
|
32
|
-
}
|
|
33
|
-
const latest = fetchLatest(exec, name);
|
|
34
|
-
if (!latest) return { action: 'proceed', latest: null }; // offline / unknown — proceed as-is
|
|
35
|
-
if (compareVersions(latest, current) <= 0) return { action: 'proceed', latest }; // already latest
|
|
36
|
-
return { action: 'update', latest };
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Ensure the CLI is latest before muster applies the template.
|
|
41
|
-
* @param {object} [io] injectable { log, exec, spawn, env, name, current } for tests
|
|
42
|
-
* @returns {?number} an exit code if it re-exec'd a fresh muster (caller should
|
|
43
|
-
* exit with it); null to mean "proceed in-process".
|
|
44
|
-
*/
|
|
45
|
-
function ensureLatest(io = {}) {
|
|
46
|
-
const log = io.log || ((m) => process.stdout.write(m + '\n'));
|
|
47
|
-
const exec = io.exec || defaultRun;
|
|
48
|
-
const spawn = io.spawn || spawnSync;
|
|
49
|
-
const env = io.env || process.env;
|
|
50
|
-
const name = io.name || pkg.name;
|
|
51
|
-
const current = io.current || pkg.version;
|
|
52
|
-
|
|
53
|
-
const d = decide({ exec, current, name, env });
|
|
54
|
-
if (d.action === 'proceed') return null;
|
|
55
|
-
|
|
56
|
-
log(`Updating musketeer ${current} → ${d.latest} before muster…`);
|
|
57
|
-
const ins = exec(`npm i -g ${name}@latest`);
|
|
58
|
-
if (ins.code !== 0) {
|
|
59
|
-
log('Self-update failed — continuing with the current version.');
|
|
60
|
-
if (ins.stderr) log(ins.stderr.trim());
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Re-exec the now-latest binary's muster, inheriting the TTY for the picker.
|
|
65
|
-
// The caller's flags come along: dropping them here would send a scripted
|
|
66
|
-
// `muster --keep` back to the interactive picker, which is the one place it
|
|
67
|
-
// cannot run.
|
|
68
|
-
const args = io.args || [];
|
|
69
|
-
const r = spawn('musketeer', ['muster', ...args], {
|
|
70
|
-
stdio: 'inherit',
|
|
71
|
-
shell: true,
|
|
72
|
-
env: { ...env, MUSKETEER_REEXEC: '1' },
|
|
73
|
-
});
|
|
74
|
-
return typeof r.status === 'number' ? r.status : 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
module.exports = { decide, ensureLatest };
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Self-update gate for `musketeer muster`. Before the picker applies the bundled
|
|
4
|
+
// template, make sure the CLI is at the latest PUBLISHED version — otherwise
|
|
5
|
+
// "muster" would refresh installed skills to a stale package's template.
|
|
6
|
+
//
|
|
7
|
+
// When behind: promote (npm i -g @latest), then re-exec `musketeer muster` so the
|
|
8
|
+
// picker runs under the freshly-installed template. A running Node process can't
|
|
9
|
+
// reliably hot-swap its own package files mid-run, so re-exec is the safe path.
|
|
10
|
+
//
|
|
11
|
+
// Guards:
|
|
12
|
+
// MUSKETEER_REEXEC=1 set on the child so it never re-checks (no loop)
|
|
13
|
+
// MUSKETEER_NO_SELF_UPDATE=1 user opt-out (offline / pinned version)
|
|
14
|
+
|
|
15
|
+
const { spawnSync } = require('child_process');
|
|
16
|
+
const { fetchLatest, compareVersions, defaultRun } = require('./promote');
|
|
17
|
+
const pkg = require('../package.json');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Decide whether muster should self-update first. Pure — injectable exec/env.
|
|
21
|
+
* @param {{exec?:Function, current?:string, name?:string, env?:object}} [o]
|
|
22
|
+
* @returns {{action:'proceed'|'update', latest:?string}}
|
|
23
|
+
*/
|
|
24
|
+
function decide(o = {}) {
|
|
25
|
+
const exec = o.exec || defaultRun;
|
|
26
|
+
const current = o.current || pkg.version;
|
|
27
|
+
const name = o.name || pkg.name;
|
|
28
|
+
const env = o.env || process.env;
|
|
29
|
+
|
|
30
|
+
if (env.MUSKETEER_REEXEC === '1' || env.MUSKETEER_NO_SELF_UPDATE === '1') {
|
|
31
|
+
return { action: 'proceed', latest: null };
|
|
32
|
+
}
|
|
33
|
+
const latest = fetchLatest(exec, name);
|
|
34
|
+
if (!latest) return { action: 'proceed', latest: null }; // offline / unknown — proceed as-is
|
|
35
|
+
if (compareVersions(latest, current) <= 0) return { action: 'proceed', latest }; // already latest
|
|
36
|
+
return { action: 'update', latest };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Ensure the CLI is latest before muster applies the template.
|
|
41
|
+
* @param {object} [io] injectable { log, exec, spawn, env, name, current } for tests
|
|
42
|
+
* @returns {?number} an exit code if it re-exec'd a fresh muster (caller should
|
|
43
|
+
* exit with it); null to mean "proceed in-process".
|
|
44
|
+
*/
|
|
45
|
+
function ensureLatest(io = {}) {
|
|
46
|
+
const log = io.log || ((m) => process.stdout.write(m + '\n'));
|
|
47
|
+
const exec = io.exec || defaultRun;
|
|
48
|
+
const spawn = io.spawn || spawnSync;
|
|
49
|
+
const env = io.env || process.env;
|
|
50
|
+
const name = io.name || pkg.name;
|
|
51
|
+
const current = io.current || pkg.version;
|
|
52
|
+
|
|
53
|
+
const d = decide({ exec, current, name, env });
|
|
54
|
+
if (d.action === 'proceed') return null;
|
|
55
|
+
|
|
56
|
+
log(`Updating musketeer ${current} → ${d.latest} before muster…`);
|
|
57
|
+
const ins = exec(`npm i -g ${name}@latest`);
|
|
58
|
+
if (ins.code !== 0) {
|
|
59
|
+
log('Self-update failed — continuing with the current version.');
|
|
60
|
+
if (ins.stderr) log(ins.stderr.trim());
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Re-exec the now-latest binary's muster, inheriting the TTY for the picker.
|
|
65
|
+
// The caller's flags come along: dropping them here would send a scripted
|
|
66
|
+
// `muster --keep` back to the interactive picker, which is the one place it
|
|
67
|
+
// cannot run.
|
|
68
|
+
const args = io.args || [];
|
|
69
|
+
const r = spawn('musketeer', ['muster', ...args], {
|
|
70
|
+
stdio: 'inherit',
|
|
71
|
+
shell: true,
|
|
72
|
+
env: { ...env, MUSKETEER_REEXEC: '1' },
|
|
73
|
+
});
|
|
74
|
+
return typeof r.status === 'number' ? r.status : 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
module.exports = { decide, ensureLatest };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: git-manager
|
|
3
|
-
description: Stage, commit, and push code changes with conventional commits. Use when user says "commit", "push", or finishes a feature/fix.
|
|
4
|
-
model: haiku
|
|
5
|
-
tools: Glob, Grep, Read, Bash, TaskCreate, TaskGet, TaskUpdate, TaskList, SendMessage
|
|
6
|
-
---
|
|
7
|
-
You are a Git Operations Specialist. Execute workflow in EXACTLY 2-4 tool calls. No exploration phase.
|
|
8
|
-
Activate `git` skill.
|
|
9
|
-
**IMPORTANT**: Ensure token efficiency while maintaining high quality.
|
|
10
|
-
|
|
11
|
-
## Team Mode (when spawned as teammate)
|
|
12
|
-
|
|
13
|
-
When operating as a team member:
|
|
14
|
-
1. On start: check `TaskList` then claim your assigned or next unblocked task via `TaskUpdate`
|
|
15
|
-
2. Read full task description via `TaskGet` before starting work
|
|
16
|
-
3. Only perform git operations explicitly requested in task — no unsolicited pushes or force operations
|
|
17
|
-
4. When done: `TaskUpdate(status: "completed")` then `SendMessage` git operation summary to lead
|
|
18
|
-
5. When receiving `shutdown_request`: approve via `SendMessage(type: "shutdown_response")` unless mid-critical-operation
|
|
1
|
+
---
|
|
2
|
+
name: git-manager
|
|
3
|
+
description: Stage, commit, and push code changes with conventional commits. Use when user says "commit", "push", or finishes a feature/fix.
|
|
4
|
+
model: haiku
|
|
5
|
+
tools: Glob, Grep, Read, Bash, TaskCreate, TaskGet, TaskUpdate, TaskList, SendMessage
|
|
6
|
+
---
|
|
7
|
+
You are a Git Operations Specialist. Execute workflow in EXACTLY 2-4 tool calls. No exploration phase.
|
|
8
|
+
Activate `git` skill.
|
|
9
|
+
**IMPORTANT**: Ensure token efficiency while maintaining high quality.
|
|
10
|
+
|
|
11
|
+
## Team Mode (when spawned as teammate)
|
|
12
|
+
|
|
13
|
+
When operating as a team member:
|
|
14
|
+
1. On start: check `TaskList` then claim your assigned or next unblocked task via `TaskUpdate`
|
|
15
|
+
2. Read full task description via `TaskGet` before starting work
|
|
16
|
+
3. Only perform git operations explicitly requested in task — no unsolicited pushes or force operations
|
|
17
|
+
4. When done: `TaskUpdate(status: "completed")` then `SendMessage` git operation summary to lead
|
|
18
|
+
5. When receiving `shutdown_request`: approve via `SendMessage(type: "shutdown_response")` unless mid-critical-operation
|
|
19
19
|
6. Communicate with peers via `SendMessage(type: "message")` when coordination needed
|