@namewta/speculo 0.1.21 → 0.2.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/README.md +68 -78
- package/dist/src/cli.js +57 -34
- package/dist/src/cli.js.map +1 -1
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.js +128 -168
- package/dist/src/index.js.map +1 -1
- package/dist/src/migrate.d.ts +38 -0
- package/dist/src/migrate.js +646 -0
- package/dist/src/migrate.js.map +1 -0
- package/dist/src/workflows.d.ts +7 -37
- package/dist/src/workflows.js +49 -123
- package/dist/src/workflows.js.map +1 -1
- package/package.json +6 -4
- package/template/.speculo/README.md +20 -0
- package/template/.speculo/workspace.json +12 -0
- package/template/commands/docs-sync.md +28 -0
- package/template/commands/finalize.md +37 -0
- package/template/commands/knowledge-prune.md +20 -0
- package/template/commands/retro.md +15 -8
- package/template/commands/status.md +8 -51
- package/template/skills/agents-md-builder/SKILL.md +14 -101
- package/template/skills/change-lifecycle/SKILL.md +25 -0
- package/template/{workflows/dev/_templates → skills/change-lifecycle/assets}/completion-summary-template.md +2 -2
- package/template/{workflows/dev/_templates → skills/change-lifecycle/assets}/completion-verification-template.md +1 -1
- package/template/skills/change-lifecycle/references/completion-gate.md +19 -0
- package/template/skills/change-lifecycle/references/finalize-archive.md +32 -0
- package/template/skills/docs-sync/SKILL.md +22 -0
- package/template/skills/docs-sync/assets/report-template.md +45 -0
- package/template/skills/docs-sync/assets/state-template.json +20 -0
- package/template/skills/docs-sync/assets/workflow-scope-template.json +9 -0
- package/template/skills/docs-sync/references/agents-contract.md +43 -0
- package/template/skills/docs-sync/references/changelog-contract.md +39 -0
- package/template/skills/docs-sync/references/document-lifecycle-contract.md +38 -0
- package/template/skills/docs-sync/references/git-state-contract.md +67 -0
- package/template/skills/docs-sync/references/readme-contract.md +44 -0
- package/template/skills/docs-sync/references/workflow-scope-contract.md +50 -0
- package/template/skills/github-npm-ops/SKILL.md +14 -39
- package/template/skills/github-npm-ops/references/failure-recovery.md +1 -1
- package/template/skills/github-npm-ops/references/preflight-checklist.md +1 -1
- package/template/skills/github-npm-ops/references/release-notes-injection.md +1 -1
- package/template/skills/github-npm-ops/references/release-pipeline.md +13 -13
- package/template/skills/github-npm-ops/references/version-bump-flow.md +3 -3
- package/template/skills/knowledge-prune/SKILL.md +29 -0
- package/template/skills/knowledge-prune/references/audit-rules.md +24 -0
- package/template/skills/runtime-context/SKILL.md +43 -0
- package/template/skills/runtime-context/references/path-resolution.md +32 -0
- package/template/skills/speculo-retro/SKILL.md +13 -37
- package/template/skills/speculo-retro/references/friction-taxonomy.md +3 -3
- package/template/skills/speculo-retro/references/issue-drafting-sop.md +3 -3
- package/template/skills/worktree-isolation/SKILL.md +10 -46
- package/template/skills/worktree-isolation/references/audit-branch-tree.md +2 -2
- package/template/skills/worktree-isolation/references/create-worktree.md +6 -6
- package/template/skills/worktree-isolation/references/merge-and-cleanup.md +5 -5
- package/template/vendor/README.md +11 -10
- package/template/vendor/matt-pocock/README.md +41 -0
- package/template/vendor/matt-pocock/engineering/README.md +28 -0
- package/template/vendor/matt-pocock/engineering/ask-matt/SKILL.md +76 -0
- package/template/vendor/matt-pocock/engineering/code-review/SKILL.md +89 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/DEEPENING.md +37 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/template/vendor/matt-pocock/engineering/codebase-design/SKILL.md +114 -0
- package/template/vendor/matt-pocock/engineering/diagnosing-bugs/SKILL.md +134 -0
- package/template/vendor/matt-pocock/engineering/diagnosing-bugs/scripts/hitl-loop.template.sh +41 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/ADR-FORMAT.md +47 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/template/vendor/matt-pocock/engineering/domain-modeling/SKILL.md +74 -0
- package/template/vendor/matt-pocock/engineering/grill-with-docs/SKILL.md +7 -0
- package/template/vendor/matt-pocock/engineering/implement/SKILL.md +15 -0
- package/template/vendor/matt-pocock/engineering/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/template/vendor/matt-pocock/engineering/improve-codebase-architecture/SKILL.md +66 -0
- package/template/vendor/matt-pocock/engineering/prototype/LOGIC.md +79 -0
- package/template/vendor/matt-pocock/engineering/prototype/SKILL.md +30 -0
- package/template/vendor/matt-pocock/engineering/prototype/UI.md +112 -0
- package/template/vendor/matt-pocock/engineering/research/SKILL.md +12 -0
- package/template/vendor/matt-pocock/engineering/resolving-merge-conflicts/SKILL.md +14 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/SKILL.md +127 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/domain.md +51 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/template/vendor/matt-pocock/engineering/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/template/vendor/matt-pocock/engineering/tdd/SKILL.md +36 -0
- package/template/vendor/matt-pocock/engineering/tdd/mocking.md +59 -0
- package/template/vendor/matt-pocock/engineering/tdd/tests.md +77 -0
- package/template/vendor/matt-pocock/engineering/to-spec/SKILL.md +75 -0
- package/template/vendor/matt-pocock/engineering/to-tickets/SKILL.md +113 -0
- package/template/vendor/matt-pocock/engineering/triage/AGENT-BRIEF.md +204 -0
- package/template/vendor/matt-pocock/engineering/triage/OUT-OF-SCOPE.md +104 -0
- package/template/vendor/matt-pocock/engineering/triage/SKILL.md +112 -0
- package/template/vendor/matt-pocock/engineering/wayfinder/SKILL.md +127 -0
- package/template/vendor/matt-pocock/in-progress/README.md +10 -0
- package/template/vendor/matt-pocock/in-progress/claude-handoff/SKILL.md +18 -0
- package/template/vendor/matt-pocock/in-progress/loop-me/SKILL.md +32 -0
- package/template/vendor/matt-pocock/in-progress/wizard/SKILL.md +45 -0
- package/template/vendor/matt-pocock/in-progress/wizard/template.sh +211 -0
- package/template/vendor/matt-pocock/in-progress/writing-beats/SKILL.md +67 -0
- package/template/vendor/matt-pocock/in-progress/writing-fragments/SKILL.md +78 -0
- package/template/vendor/matt-pocock/in-progress/writing-shape/SKILL.md +79 -0
- package/template/vendor/matt-pocock/productivity/README.md +18 -0
- package/template/vendor/matt-pocock/productivity/grill-me/SKILL.md +7 -0
- package/template/vendor/matt-pocock/productivity/grilling/SKILL.md +12 -0
- package/template/vendor/matt-pocock/productivity/handoff/SKILL.md +16 -0
- package/template/vendor/matt-pocock/productivity/teach/GLOSSARY-FORMAT.md +35 -0
- package/template/vendor/matt-pocock/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/template/vendor/matt-pocock/productivity/teach/MISSION-FORMAT.md +31 -0
- package/template/vendor/matt-pocock/productivity/teach/RESOURCES-FORMAT.md +32 -0
- package/template/vendor/matt-pocock/productivity/teach/SKILL.md +140 -0
- package/template/vendor/matt-pocock/productivity/writing-great-skills/GLOSSARY.md +201 -0
- package/template/vendor/matt-pocock/productivity/writing-great-skills/SKILL.md +83 -0
- package/template/workflows/matt-pocock/WORKFLOW.md +145 -0
- package/template/workflows/matt-pocock/_state/status.json +5 -0
- package/template/workflows/matt-pocock/routes/architecture.md +24 -0
- package/template/workflows/matt-pocock/routes/diagnose.md +22 -0
- package/template/workflows/matt-pocock/routes/experimental.md +18 -0
- package/template/workflows/matt-pocock/routes/idea-to-delivery.md +63 -0
- package/template/workflows/matt-pocock/routes/merge-conflicts.md +19 -0
- package/template/workflows/matt-pocock/routes/productivity.md +25 -0
- package/template/workflows/matt-pocock/routes/research-prototype.md +20 -0
- package/template/workflows/matt-pocock/routes/review.md +19 -0
- package/template/workflows/matt-pocock/routes/setup.md +42 -0
- package/template/workflows/matt-pocock/routes/triage.md +25 -0
- package/template/workflows/matt-pocock/routes/wayfinder.md +27 -0
- package/template/workflows/person/M-mao-zedong-cognitive-os/M-mao-zedong-cognitive-os.md +74 -59
- package/template/workflows/person/M-mao-zedong-cognitive-os/activate.md +2 -2
- package/template/workflows/person/M-mao-zedong-cognitive-os/deliver.md +5 -5
- package/template/workflows/person/M-mao-zedong-cognitive-os/diagnose.md +2 -2
- package/template/workflows/person/M-mao-zedong-cognitive-os/mobilize.md +4 -4
- package/template/workflows/person/M-mao-zedong-cognitive-os/strategize.md +3 -3
- package/template/workflows/person/WORKFLOW.md +68 -0
- package/template/workflows/person/_state/.config/LESSONS.md +3 -0
- package/template/workflows/person/_state/.config/RULES.md +3 -0
- package/template/workflows/person/_state/changes/.gitkeep +1 -0
- package/template/workflows/person/_state/status.json +5 -0
- package/template/.speculo/.config/LESSONS.md +0 -9
- package/template/.speculo/.config/RULES.md +0 -11
- package/template/.speculo/AGENTS.md +0 -30
- package/template/.speculo/archive/AGENTS.md +0 -28
- package/template/.speculo/archive/dev/.gitkeep +0 -0
- package/template/.speculo/archive/person/.gitkeep +0 -0
- package/template/.speculo/dev/.gitkeep +0 -0
- package/template/.speculo/dev/docs-sync-state.json +0 -14
- package/template/.speculo/dev-status.json +0 -3
- package/template/.speculo/doc-status.json +0 -3
- package/template/.speculo/person/.gitkeep +0 -0
- package/template/.speculo/person-status.json +0 -1
- package/template/commands/archive.md +0 -68
- package/template/commands/caveman.md +0 -50
- package/template/commands/config-prune.md +0 -59
- package/template/commands/grill-me.md +0 -48
- package/template/commands/handoff.md +0 -59
- package/template/commands/scaffold-exercises.md +0 -56
- package/template/commands/write-a-skill.md +0 -52
- package/template/skills/caveman/SKILL.md +0 -38
- package/template/skills/caveman/references/compression-rules.md +0 -102
- package/template/skills/config-prune/SKILL.md +0 -44
- package/template/skills/config-prune/references/audit-rules.md +0 -38
- package/template/skills/grill-me/SKILL.md +0 -40
- package/template/skills/handoff/SKILL.md +0 -73
- package/template/skills/scaffold-exercises/SKILL.md +0 -41
- package/template/skills/scaffold-exercises/references/exercise-structure.md +0 -85
- package/template/skills/scaffold-exercises/references/lint-and-git.md +0 -54
- package/template/skills/speculo-write/SKILL.md +0 -56
- package/template/skills/speculo-write/references/asset-selection-sop.md +0 -67
- package/template/skills/speculo-write/references/authoring-quality-levers.md +0 -61
- package/template/skills/speculo-write/references/command-authoring-sop.md +0 -98
- package/template/skills/speculo-write/references/migration-sop.md +0 -101
- package/template/skills/speculo-write/references/persistence-contract-sop.md +0 -271
- package/template/skills/speculo-write/references/skill-authoring-sop.md +0 -212
- package/template/skills/speculo-write/references/validation-checklist.md +0 -85
- package/template/skills/speculo-write/references/workflow-authoring-sop.md +0 -165
- package/template/vendor/codebase-design/DEEPENING.md +0 -37
- package/template/vendor/codebase-design/DESIGN-IT-TWICE.md +0 -44
- package/template/vendor/codebase-design/SKILL.md +0 -114
- package/template/vendor/officecli/SKILL.md +0 -415
- package/template/vendor/resolving-merge-conflicts/SKILL.md +0 -14
- package/template/workflows/dev/01-grill-with-docs/01-grill-with-docs.md +0 -107
- package/template/workflows/dev/01-grill-with-docs/grill-context-scan.md +0 -30
- package/template/workflows/dev/01-grill-with-docs/grill-decision.md +0 -38
- package/template/workflows/dev/02-prd/02-prd.md +0 -70
- package/template/workflows/dev/02-prd/prd-synthesis.md +0 -30
- package/template/workflows/dev/02-prd/prd-zoom-out.md +0 -29
- package/template/workflows/dev/03-tdd/03-tdd.md +0 -55
- package/template/workflows/dev/03-tdd/agents/tdd-finish-agent.md +0 -34
- package/template/workflows/dev/03-tdd/agents/tdd-implement-agent.md +0 -34
- package/template/workflows/dev/03-tdd/agents/tdd-plan-agent.md +0 -34
- package/template/workflows/dev/03-tdd/mocking.md +0 -43
- package/template/workflows/dev/03-tdd/refactoring.md +0 -10
- package/template/workflows/dev/03-tdd/tdd-finish.md +0 -34
- package/template/workflows/dev/03-tdd/tdd-loop.md +0 -36
- package/template/workflows/dev/03-tdd/tdd-plan.md +0 -37
- package/template/workflows/dev/03-tdd/tests.md +0 -61
- package/template/workflows/dev/04-finalize/04-finalize.md +0 -57
- package/template/workflows/dev/04-finalize/agents/completion-gate-agent.md +0 -35
- package/template/workflows/dev/04-finalize/completion-gate.md +0 -41
- package/template/workflows/dev/04-finalize/finalize-archive.md +0 -55
- package/template/workflows/dev/A-improve-architecture/A-improve-architecture.md +0 -60
- package/template/workflows/dev/A-improve-architecture/HTML-REPORT.md +0 -123
- package/template/workflows/dev/A-improve-architecture/architecture-grill.md +0 -30
- package/template/workflows/dev/A-improve-architecture/architecture-review.md +0 -29
- package/template/workflows/dev/A-improve-architecture/architecture-scan.md +0 -37
- package/template/workflows/dev/AGENTS.md +0 -95
- package/template/workflows/dev/D-docs-sync/D-docs-sync.md +0 -140
- package/template/workflows/dev/D-docs-sync/agents/docs-diff-agent.md +0 -34
- package/template/workflows/dev/D-docs-sync/agents/docs-update-agent.md +0 -34
- package/template/workflows/dev/D-docs-sync/agents-contract.md +0 -95
- package/template/workflows/dev/D-docs-sync/changelog-contract.md +0 -155
- package/template/workflows/dev/D-docs-sync/config-contract.md +0 -75
- package/template/workflows/dev/D-docs-sync/docs-sync-diff.md +0 -86
- package/template/workflows/dev/D-docs-sync/docs-sync-finish.md +0 -37
- package/template/workflows/dev/D-docs-sync/docs-sync-state.md +0 -47
- package/template/workflows/dev/D-docs-sync/docs-sync-update.md +0 -44
- package/template/workflows/dev/D-docs-sync/knowledge-extract.md +0 -66
- package/template/workflows/dev/D-docs-sync/readme-contract.md +0 -124
- package/template/workflows/dev/D-docs-sync/state-json-schema.md +0 -172
- package/template/workflows/dev/H-diagnose/H-diagnose.md +0 -108
- package/template/workflows/dev/H-diagnose/agents/diagnose-agent.md +0 -33
- package/template/workflows/dev/H-diagnose/agents/fix-agent.md +0 -34
- package/template/workflows/dev/H-diagnose/diagnose-fix.md +0 -34
- package/template/workflows/dev/H-diagnose/diagnose-guide.md +0 -144
- package/template/workflows/dev/H-diagnose/diagnose-loop.md +0 -41
- package/template/workflows/dev/H-diagnose/scripts/hitl-loop.template.sh +0 -41
- package/template/workflows/dev/I-to-issues/I-to-issues.md +0 -79
- package/template/workflows/dev/I-to-issues/issues-slices.md +0 -211
- package/template/workflows/dev/M-domain-modeling/ADR-FORMAT.md +0 -74
- package/template/workflows/dev/M-domain-modeling/CONTEXT-FORMAT.md +0 -67
- package/template/workflows/dev/M-domain-modeling/M-domain-modeling.md +0 -102
- package/template/workflows/dev/R-review/R-review.md +0 -75
- package/template/workflows/dev/R-review/agents/engineering-review-agent.md +0 -33
- package/template/workflows/dev/R-review/agents/spec-review-agent.md +0 -34
- package/template/workflows/dev/R-review/agents/standards-review-agent.md +0 -34
- package/template/workflows/dev/R-review/code-quality-checklist.md +0 -118
- package/template/workflows/dev/R-review/removal-checklist.md +0 -53
- package/template/workflows/dev/R-review/review-axes.md +0 -61
- package/template/workflows/dev/R-review/review-setup.md +0 -111
- package/template/workflows/dev/R-review/review-verdict.md +0 -43
- package/template/workflows/dev/R-review/security-checklist.md +0 -126
- package/template/workflows/dev/R-review/solid-checklist.md +0 -73
- package/template/workflows/dev/_templates/diagnosis-template.md +0 -20
- package/template/workflows/dev/_templates/docs-sync-report-template.md +0 -45
- package/template/workflows/dev/_templates/docs-sync-state-template.json +0 -14
- package/template/workflows/dev/_templates/domain-model-log-template.md +0 -20
- package/template/workflows/dev/_templates/grill-context-map-template.md +0 -20
- package/template/workflows/dev/_templates/grill-decision-log-template.md +0 -20
- package/template/workflows/dev/_templates/issues-slices-template.md +0 -106
- package/template/workflows/dev/_templates/overview-template.md +0 -19
- package/template/workflows/dev/_templates/prd-template.md +0 -26
- package/template/workflows/dev/_templates/regression-template.md +0 -20
- package/template/workflows/dev/_templates/review-report-template.md +0 -30
- package/template/workflows/dev/_templates/review-sources-template.md +0 -33
- package/template/workflows/dev/_templates/review-verdict-template.md +0 -33
- package/template/workflows/dev/_templates/tdd-log-template.md +0 -23
- package/template/workflows/dev/_templates/tdd-plan-template.md +0 -35
- package/template/workflows/dev/_templates/tdd-verification-template.md +0 -26
- package/template/workflows/doc/AGENTS.md +0 -80
- package/template/workflows/doc/B-writing-beats/B-writing-beats.md +0 -79
- package/template/workflows/doc/B-writing-beats/writing-beats-append.md +0 -31
- package/template/workflows/doc/B-writing-beats/writing-beats-options.md +0 -29
- package/template/workflows/doc/E-edit-article/E-edit-article.md +0 -79
- package/template/workflows/doc/E-edit-article/edit-article-plan.md +0 -30
- package/template/workflows/doc/E-edit-article/edit-article-rewrite.md +0 -31
- package/template/workflows/doc/F-writing-fragments/F-writing-fragments.md +0 -80
- package/template/workflows/doc/F-writing-fragments/writing-fragments-interview.md +0 -32
- package/template/workflows/doc/F-writing-fragments/writing-fragments-log.md +0 -29
- package/template/workflows/doc/S-writing-shape/S-writing-shape.md +0 -81
- package/template/workflows/doc/S-writing-shape/writing-shape-block.md +0 -32
- package/template/workflows/doc/S-writing-shape/writing-shape-opening.md +0 -27
- package/template/workflows/doc/T-teach/T-teach.md +0 -64
- package/template/workflows/doc/T-teach/teach-lesson-wrap.md +0 -63
- package/template/workflows/doc/T-teach/teach-lesson.md +0 -53
- package/template/workflows/doc/T-teach/teach-mission.md +0 -33
- package/template/workflows/doc/T-teach/teach-resources.md +0 -36
- package/template/workflows/doc/_templates/edit-article-plan-template.md +0 -25
- package/template/workflows/doc/_templates/edit-article-template.md +0 -7
- package/template/workflows/doc/_templates/teach-glossary-template.md +0 -26
- package/template/workflows/doc/_templates/teach-learning-record-template.md +0 -38
- package/template/workflows/doc/_templates/teach-lesson-html-template.md +0 -24
- package/template/workflows/doc/_templates/teach-mission-template.md +0 -19
- package/template/workflows/doc/_templates/teach-resources-template.md +0 -18
- package/template/workflows/doc/_templates/writing-article-template.md +0 -7
- package/template/workflows/doc/_templates/writing-beat-options-template.md +0 -21
- package/template/workflows/doc/_templates/writing-fragments-template.md +0 -7
- package/template/workflows/doc/_templates/writing-interview-log-template.md +0 -21
- package/template/workflows/doc/_templates/writing-shape-log-template.md +0 -25
- package/template/workflows/person/AGENTS.md +0 -72
- /package/template/{.speculo/.config/adr → workflows/matt-pocock/_state/archive}/.gitkeep +0 -0
- /package/template/{.speculo/.config/context → workflows/matt-pocock/_state/changes}/.gitkeep +0 -0
- /package/template/{.speculo/archive/doc → workflows/person/_state/.config/context}/.gitkeep +0 -0
- /package/template/{.speculo/doc → workflows/person/_state/archive}/.gitkeep +0 -0
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { cp, mkdir, readdir, rm } from "node:fs/promises";
|
|
2
|
-
import { join, resolve } from "node:path";
|
|
2
|
+
import { basename, join, resolve } from "node:path";
|
|
3
|
+
import { detectLegacyState } from "./migrate.js";
|
|
3
4
|
import { pathExists } from "./utils.js";
|
|
4
|
-
import { discoverWorkflowCatalog,
|
|
5
|
-
const
|
|
6
|
-
const UPDATE_ASSETS = ["commands", "skills", "workflows"];
|
|
7
|
-
const CATEGORY_GUIDE_FILE = "AGENTS.md";
|
|
8
|
-
const LEGACY_CATEGORY_INDEX_FILE = "00-INDEX.md";
|
|
9
|
-
// Assets install under a single `speculo/` directory inside the target,
|
|
10
|
-
// mirroring the package layout — never scattered into the target root.
|
|
5
|
+
import { discoverWorkflowCatalog, isInteractive, promptWorkflowSelection, scanInstalledWorkflows, selectAllFromCatalog, } from "./workflows.js";
|
|
6
|
+
const CORE_ASSETS = [".speculo", "commands", "skills"];
|
|
11
7
|
const INSTALL_SUBDIR = "speculo";
|
|
8
|
+
const WORKFLOW_ENTRY = "WORKFLOW.md";
|
|
9
|
+
const STATE_TEMPLATE_DIR = "_state";
|
|
10
|
+
const MATT_WORKFLOW_ID = "matt-pocock";
|
|
12
11
|
function assetRoot(packageRoot) {
|
|
13
12
|
return join(packageRoot, "template");
|
|
14
13
|
}
|
|
@@ -18,208 +17,169 @@ function installRoot(target) {
|
|
|
18
17
|
async function ensureAssetSource(packageRoot, asset) {
|
|
19
18
|
const source = join(assetRoot(packageRoot), asset);
|
|
20
19
|
if (!(await pathExists(source))) {
|
|
21
|
-
throw new Error(
|
|
20
|
+
throw new Error("Missing packaged Speculo asset: template/" + asset);
|
|
22
21
|
}
|
|
23
22
|
return source;
|
|
24
23
|
}
|
|
25
|
-
async function
|
|
26
|
-
const
|
|
27
|
-
for (const asset of
|
|
24
|
+
async function copyCoreAssets(packageRoot, root, overwrite) {
|
|
25
|
+
const copied = [];
|
|
26
|
+
for (const asset of CORE_ASSETS) {
|
|
27
|
+
const source = await ensureAssetSource(packageRoot, asset);
|
|
28
28
|
const destination = join(root, asset);
|
|
29
|
-
if (
|
|
30
|
-
|
|
29
|
+
if (asset === ".speculo" && overwrite) {
|
|
30
|
+
await copyMissingTree(source, destination);
|
|
31
|
+
copied.push(asset);
|
|
32
|
+
continue;
|
|
31
33
|
}
|
|
34
|
+
if (overwrite && asset !== ".speculo") {
|
|
35
|
+
await rm(destination, { recursive: true, force: true });
|
|
36
|
+
}
|
|
37
|
+
await cp(source, destination, {
|
|
38
|
+
recursive: true,
|
|
39
|
+
force: overwrite,
|
|
40
|
+
errorOnExist: !overwrite,
|
|
41
|
+
});
|
|
42
|
+
copied.push(asset);
|
|
32
43
|
}
|
|
33
|
-
return
|
|
44
|
+
return copied;
|
|
34
45
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
async function copyMissingTree(source, destination) {
|
|
47
|
+
await mkdir(destination, { recursive: true });
|
|
48
|
+
const entries = await readdir(source, { withFileTypes: true });
|
|
49
|
+
for (const entry of entries) {
|
|
50
|
+
const sourceEntry = join(source, entry.name);
|
|
51
|
+
const destinationEntry = join(destination, entry.name);
|
|
52
|
+
if (entry.isDirectory()) {
|
|
53
|
+
await copyMissingTree(sourceEntry, destinationEntry);
|
|
54
|
+
}
|
|
55
|
+
else if (!(await pathExists(destinationEntry))) {
|
|
56
|
+
await cp(sourceEntry, destinationEntry, {
|
|
57
|
+
force: false,
|
|
58
|
+
errorOnExist: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
}
|
|
63
|
+
function shouldCopyVendorEntry(name, selection) {
|
|
64
|
+
return name !== MATT_WORKFLOW_ID ||
|
|
65
|
+
selection.workflowIds.includes(MATT_WORKFLOW_ID);
|
|
66
|
+
}
|
|
67
|
+
async function copyVendor(packageRoot, root, selection, mode) {
|
|
68
|
+
const sourceRoot = await ensureAssetSource(packageRoot, "vendor");
|
|
69
|
+
const destinationRoot = join(root, "vendor");
|
|
70
|
+
const copied = [];
|
|
71
|
+
if (mode === "overwrite") {
|
|
72
|
+
await rm(destinationRoot, { recursive: true, force: true });
|
|
52
73
|
}
|
|
74
|
+
await mkdir(destinationRoot, { recursive: true });
|
|
75
|
+
const entries = await readdir(sourceRoot, { withFileTypes: true });
|
|
53
76
|
for (const entry of entries) {
|
|
54
|
-
if (!entry.
|
|
77
|
+
if (!shouldCopyVendorEntry(entry.name, selection))
|
|
78
|
+
continue;
|
|
79
|
+
const source = join(sourceRoot, entry.name);
|
|
80
|
+
const destination = join(destinationRoot, entry.name);
|
|
81
|
+
if (mode === "merge" && (await pathExists(destination)))
|
|
55
82
|
continue;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
83
|
+
await cp(source, destination, {
|
|
84
|
+
recursive: entry.isDirectory(),
|
|
85
|
+
force: mode === "overwrite",
|
|
86
|
+
errorOnExist: mode === "fresh",
|
|
87
|
+
});
|
|
88
|
+
copied.push("vendor/" + entry.name);
|
|
61
89
|
}
|
|
62
|
-
return
|
|
90
|
+
return copied;
|
|
63
91
|
}
|
|
64
|
-
|
|
65
|
-
* Copy selected workflows from the template to the install root.
|
|
66
|
-
* Handles category-level metadata (AGENTS.md, _templates/) along with
|
|
67
|
-
* individual workflow directories.
|
|
68
|
-
*/
|
|
69
|
-
async function copyWorkflows(packageRoot, root, selection, options = {}) {
|
|
92
|
+
async function copyWorkflowPackages(packageRoot, root, selection, overwrite) {
|
|
70
93
|
const copied = [];
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await
|
|
83
|
-
// AGENTS.md
|
|
84
|
-
const guideSrc = join(templateWorkflows, cat, CATEGORY_GUIDE_FILE);
|
|
85
|
-
const guideDest = join(catDir, CATEGORY_GUIDE_FILE);
|
|
86
|
-
if (overwrite) {
|
|
87
|
-
if (await pathExists(guideDest)) {
|
|
88
|
-
await rm(guideDest, { force: true });
|
|
89
|
-
}
|
|
90
|
-
const legacyIndexDest = join(catDir, LEGACY_CATEGORY_INDEX_FILE);
|
|
91
|
-
if (await pathExists(legacyIndexDest)) {
|
|
92
|
-
await rm(legacyIndexDest, { force: true });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
if (await pathExists(guideSrc)) {
|
|
96
|
-
await cp(guideSrc, guideDest, { force: overwrite, errorOnExist: !overwrite });
|
|
97
|
-
}
|
|
98
|
-
// _templates/
|
|
99
|
-
const templatesSrc = join(templateWorkflows, cat, "_templates");
|
|
100
|
-
const templatesDest = join(catDir, "_templates");
|
|
101
|
-
if (overwrite && (await pathExists(templatesDest))) {
|
|
102
|
-
await rm(templatesDest, { recursive: true, force: true });
|
|
103
|
-
}
|
|
104
|
-
if (await pathExists(templatesSrc)) {
|
|
105
|
-
await cp(templatesSrc, templatesDest, { recursive: true, force: overwrite, errorOnExist: !overwrite });
|
|
106
|
-
}
|
|
107
|
-
categoriesDone.add(cat);
|
|
94
|
+
const sourceRoot = join(assetRoot(packageRoot), "workflows");
|
|
95
|
+
const destinationRoot = join(root, "workflows");
|
|
96
|
+
await mkdir(destinationRoot, { recursive: true });
|
|
97
|
+
for (const workflowId of selection.workflowIds) {
|
|
98
|
+
const source = join(sourceRoot, workflowId);
|
|
99
|
+
const entry = join(source, WORKFLOW_ENTRY);
|
|
100
|
+
if (!(await pathExists(entry))) {
|
|
101
|
+
throw new Error("Unknown workflow package: " + workflowId);
|
|
102
|
+
}
|
|
103
|
+
const destination = join(destinationRoot, workflowId);
|
|
104
|
+
if (overwrite) {
|
|
105
|
+
await rm(destination, { recursive: true, force: true });
|
|
108
106
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
await cp(source, destination, {
|
|
108
|
+
recursive: true,
|
|
109
|
+
force: overwrite,
|
|
110
|
+
errorOnExist: !overwrite,
|
|
111
|
+
filter: (path) => basename(path) !== STATE_TEMPLATE_DIR,
|
|
112
|
+
});
|
|
113
|
+
copied.push("workflows/" + workflowId);
|
|
114
|
+
const stateSource = join(source, STATE_TEMPLATE_DIR);
|
|
115
|
+
const stateDestination = join(root, ".speculo", workflowId);
|
|
116
|
+
if (!(await pathExists(stateSource))) {
|
|
117
|
+
throw new Error("Workflow " + workflowId + " is missing _state/");
|
|
114
118
|
}
|
|
115
|
-
if (await pathExists(
|
|
116
|
-
await cp(
|
|
117
|
-
|
|
119
|
+
if (!(await pathExists(stateDestination))) {
|
|
120
|
+
await cp(stateSource, stateDestination, {
|
|
121
|
+
recursive: true,
|
|
122
|
+
force: false,
|
|
123
|
+
errorOnExist: true,
|
|
124
|
+
});
|
|
125
|
+
copied.push(".speculo/" + workflowId);
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
return copied;
|
|
121
129
|
}
|
|
122
130
|
async function resolveSelection(packageRoot, root, options, mode) {
|
|
123
|
-
|
|
124
|
-
if (options.selection) {
|
|
131
|
+
if (options.selection)
|
|
125
132
|
return options.selection;
|
|
126
|
-
}
|
|
127
|
-
// --all flag or non-interactive → select all
|
|
128
|
-
if (options.all || !isInteractive()) {
|
|
129
|
-
const catalog = await discoverWorkflowCatalog(packageRoot);
|
|
130
|
-
return selectAllFromCatalog(catalog);
|
|
131
|
-
}
|
|
132
|
-
// Interactive mode
|
|
133
133
|
const catalog = await discoverWorkflowCatalog(packageRoot);
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
// root not readable — treat as empty
|
|
142
|
-
}
|
|
143
|
-
const preSelectedCategories = new Set(installed.map((w) => w.category));
|
|
144
|
-
return promptCategorySelection(catalog, { preSelectedCategories });
|
|
134
|
+
if (options.all || !isInteractive())
|
|
135
|
+
return selectAllFromCatalog(catalog);
|
|
136
|
+
if (mode === "update") {
|
|
137
|
+
const installed = await scanInstalledWorkflows(root);
|
|
138
|
+
return promptWorkflowSelection(catalog, {
|
|
139
|
+
preSelectedWorkflowIds: new Set(installed),
|
|
140
|
+
});
|
|
145
141
|
}
|
|
146
|
-
|
|
147
|
-
return promptCategorySelection(catalog);
|
|
142
|
+
return promptWorkflowSelection(catalog);
|
|
148
143
|
}
|
|
149
|
-
async function initFresh(targetArg
|
|
144
|
+
async function initFresh(targetArg, options) {
|
|
150
145
|
const target = resolve(targetArg);
|
|
151
146
|
const packageRoot = resolve(options.packageRoot ?? process.cwd());
|
|
152
147
|
const root = installRoot(target);
|
|
148
|
+
const selection = await resolveSelection(packageRoot, root, options, "init");
|
|
153
149
|
await mkdir(root, { recursive: true });
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
throw new Error([
|
|
160
|
-
"Speculo init refused to overwrite existing paths:",
|
|
161
|
-
...conflicts.map((conflict) => `- ${conflict}`)
|
|
162
|
-
].join("\n"));
|
|
163
|
-
}
|
|
164
|
-
const copied = [];
|
|
165
|
-
// Copy non-workflow assets in full
|
|
166
|
-
for (const asset of nonWorkflowAssets) {
|
|
167
|
-
const source = await ensureAssetSource(packageRoot, asset);
|
|
168
|
-
const destination = join(root, asset);
|
|
169
|
-
await cp(source, destination, { recursive: true, force: false, errorOnExist: true });
|
|
170
|
-
copied.push(asset);
|
|
171
|
-
}
|
|
172
|
-
// Selective workflow copy
|
|
173
|
-
const selection = await resolveSelection(packageRoot, root, options, 'init');
|
|
174
|
-
const workflowPaths = await copyWorkflows(packageRoot, root, selection);
|
|
175
|
-
for (const wf of workflowPaths) {
|
|
176
|
-
copied.push(wf);
|
|
177
|
-
}
|
|
178
|
-
return { target, mode: 'init', copied };
|
|
150
|
+
const copied = await copyCoreAssets(packageRoot, root, false);
|
|
151
|
+
await copyVendor(packageRoot, root, selection, "fresh");
|
|
152
|
+
copied.push("vendor");
|
|
153
|
+
copied.push(...await copyWorkflowPackages(packageRoot, root, selection, false));
|
|
154
|
+
return { target, mode: "init", copied };
|
|
179
155
|
}
|
|
180
|
-
async function
|
|
156
|
+
async function initUpdate(targetArg, options) {
|
|
181
157
|
const target = resolve(targetArg);
|
|
182
158
|
const packageRoot = resolve(options.packageRoot ?? process.cwd());
|
|
183
159
|
const root = installRoot(target);
|
|
184
|
-
await
|
|
185
|
-
const updated =
|
|
186
|
-
// Full refresh for non-workflow assets (current rm+cp behavior)
|
|
187
|
-
for (const asset of UPDATE_ASSETS.filter(a => a !== 'workflows')) {
|
|
188
|
-
const source = await ensureAssetSource(packageRoot, asset);
|
|
189
|
-
const destination = join(root, asset);
|
|
190
|
-
await rm(destination, { recursive: true, force: true });
|
|
191
|
-
await cp(source, destination, { recursive: true, force: true });
|
|
192
|
-
updated.push(asset);
|
|
193
|
-
}
|
|
194
|
-
// Vendor handling: full overwrite with --all, merge otherwise
|
|
160
|
+
const selection = await resolveSelection(packageRoot, root, options, "update");
|
|
161
|
+
const updated = await copyCoreAssets(packageRoot, root, true);
|
|
195
162
|
if (options.all) {
|
|
196
|
-
|
|
197
|
-
const vendorDest = join(root, "vendor");
|
|
198
|
-
await rm(vendorDest, { recursive: true, force: true });
|
|
199
|
-
await cp(vendorSrc, vendorDest, { recursive: true, force: true });
|
|
163
|
+
await copyVendor(packageRoot, root, selection, "overwrite");
|
|
200
164
|
updated.push("vendor");
|
|
201
165
|
}
|
|
202
166
|
else {
|
|
203
|
-
|
|
204
|
-
for (const item of added)
|
|
205
|
-
updated.push(item);
|
|
167
|
+
updated.push(...await copyVendor(packageRoot, root, selection, "merge"));
|
|
206
168
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const workflowPaths = await copyWorkflows(packageRoot, root, selection, { overwrite: true });
|
|
210
|
-
for (const wf of workflowPaths) {
|
|
211
|
-
updated.push(wf);
|
|
212
|
-
}
|
|
213
|
-
return { target, mode: 'update', updated };
|
|
169
|
+
updated.push(...await copyWorkflowPackages(packageRoot, root, selection, true));
|
|
170
|
+
return { target, mode: "update", updated };
|
|
214
171
|
}
|
|
215
172
|
export async function initSpeculo(targetArg = ".", options = {}) {
|
|
216
173
|
const target = resolve(targetArg);
|
|
217
174
|
const root = installRoot(target);
|
|
218
|
-
if (await pathExists(root)) {
|
|
219
|
-
|
|
220
|
-
|
|
175
|
+
if (!(await pathExists(root))) {
|
|
176
|
+
return initFresh(targetArg, options);
|
|
177
|
+
}
|
|
178
|
+
if (await detectLegacyState(target)) {
|
|
179
|
+
throw new Error("Legacy Speculo state detected. Run `speculo migrate " +
|
|
180
|
+
targetArg + "` to preview, then `speculo migrate --apply " +
|
|
181
|
+
targetArg + "` before updating.");
|
|
221
182
|
}
|
|
222
|
-
|
|
223
|
-
return { ...result, mode: 'init' };
|
|
183
|
+
return initUpdate(targetArg, options);
|
|
224
184
|
}
|
|
225
185
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"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AAW,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,MAAM,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CACb,sDAAsD;YACtD,SAAS,GAAG,8CAA8C;YAC1D,SAAS,GAAG,oBAAoB,CACjC,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type LegacyWorkflow = "dev" | "doc" | "person";
|
|
2
|
+
type MigrationSourceLayout = "none" | "v2" | "transitional-v3";
|
|
3
|
+
type LegacyChange = {
|
|
4
|
+
sourceWorkflow: LegacyWorkflow;
|
|
5
|
+
sourcePath: string;
|
|
6
|
+
originalName: string;
|
|
7
|
+
destinationRelative: string;
|
|
8
|
+
archived: boolean;
|
|
9
|
+
status: Record<string, unknown>;
|
|
10
|
+
};
|
|
11
|
+
export type MigrationAction = {
|
|
12
|
+
kind: string;
|
|
13
|
+
from?: string;
|
|
14
|
+
to?: string;
|
|
15
|
+
detail: string;
|
|
16
|
+
};
|
|
17
|
+
export type MigrationPlan = {
|
|
18
|
+
target: string;
|
|
19
|
+
legacyDetected: boolean;
|
|
20
|
+
sourceLayout: MigrationSourceLayout;
|
|
21
|
+
actions: MigrationAction[];
|
|
22
|
+
blockers: string[];
|
|
23
|
+
changes: LegacyChange[];
|
|
24
|
+
};
|
|
25
|
+
export type MigrateOptions = {
|
|
26
|
+
packageRoot?: string;
|
|
27
|
+
apply?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type MigrateResult = {
|
|
30
|
+
target: string;
|
|
31
|
+
legacyDetected: boolean;
|
|
32
|
+
applied: boolean;
|
|
33
|
+
actions: MigrationAction[];
|
|
34
|
+
};
|
|
35
|
+
export declare function detectLegacyState(target: string): Promise<boolean>;
|
|
36
|
+
export declare function planMigration(target: string): Promise<MigrationPlan>;
|
|
37
|
+
export declare function migrateSpeculo(targetArg?: string, options?: MigrateOptions): Promise<MigrateResult>;
|
|
38
|
+
export {};
|