@xulthekl/team-flow 0.22.4
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/.agents/plugins/marketplace.json +20 -0
- package/.agents/skills +1 -0
- package/.claude/always/phase-guard.md +3 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +31 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.codexignore +6 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +31 -0
- package/.github/copilot-instructions.md +15 -0
- package/.github/dependabot.yml +10 -0
- package/.github/plugin/marketplace.json +42 -0
- package/.github/workflows/ci.yml +98 -0
- package/.github/workflows/hol-plugin-scanner.yml +17 -0
- package/.opencode/INSTALL.md +61 -0
- package/.opencode/plugins/team-flow.js +70 -0
- package/AGENTS.md +280 -0
- package/CHANGELOG.md +635 -0
- package/CONTRIBUTING.md +115 -0
- package/GEMINI.md +14 -0
- package/HANDOFF.md +219 -0
- package/INSTALL.md +810 -0
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/SECURITY.md +37 -0
- package/agents/bug-investigator.md +180 -0
- package/agents/change-split-auditor.md +257 -0
- package/agents/code-reviewer.md +171 -0
- package/agents/cross-change-consistency-checker.md +215 -0
- package/agents/prd-completeness-reviewer.md +197 -0
- package/agents/prototype-builder.md +230 -0
- package/agents/prototype-env-scout.md +156 -0
- package/agents/prototype-reviewer.md +226 -0
- package/assets/icon.svg +6 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +5 -0
- package/dist/parsing/change-parser.d.ts +12 -0
- package/dist/parsing/change-parser.js +54 -0
- package/dist/parsing/requirement-blocks.d.ts +31 -0
- package/dist/parsing/requirement-blocks.js +192 -0
- package/dist/schema/base.d.ts +7 -0
- package/dist/schema/base.js +1 -0
- package/dist/schema/change.d.ts +25 -0
- package/dist/schema/change.js +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/spec.d.ts +11 -0
- package/dist/schema/spec.js +1 -0
- package/dist/validation/constants.d.ts +42 -0
- package/dist/validation/constants.js +42 -0
- package/dist/validation/tokenizer.d.ts +17 -0
- package/dist/validation/tokenizer.js +173 -0
- package/dist/validation/types.d.ts +40 -0
- package/dist/validation/types.js +1 -0
- package/dist/validation/validator.d.ts +21 -0
- package/dist/validation/validator.js +489 -0
- package/docs/README_en.md +358 -0
- package/docs/artifact-contract.md +96 -0
- package/docs/decision-points.md +88 -0
- package/docs/e2e-integration-design.md +207 -0
- package/docs/examples/README.md +25 -0
- package/docs/examples/add-dark-mode/README.md +13 -0
- package/docs/examples/add-dark-mode/design.md +49 -0
- package/docs/examples/add-dark-mode/execution-contract.md +56 -0
- package/docs/examples/add-dark-mode/proposal.md +46 -0
- package/docs/examples/add-dark-mode/specs/ui-theme/spec.md +35 -0
- package/docs/examples/add-dark-mode/tasks.md +26 -0
- package/docs/examples/refactor-auth-boundary/README.md +15 -0
- package/docs/examples/refactor-auth-boundary/design.md +41 -0
- package/docs/examples/refactor-auth-boundary/execution-contract.md +61 -0
- package/docs/examples/refactor-auth-boundary/proposal.md +47 -0
- package/docs/examples/refactor-auth-boundary/specs/auth-boundary/spec.md +45 -0
- package/docs/examples/refactor-auth-boundary/tasks.md +25 -0
- package/docs/plans/2026-07-07-fix-batch-design.md +68 -0
- package/docs/plans/2026-07-20-001-refactor-skill-collaboration-protocol-plan.md +128 -0
- package/docs/platform-matrix.md +45 -0
- package/docs/prototype-design-research.md +206 -0
- package/docs/release-checklist.md +96 -0
- package/docs/showcase.html +699 -0
- package/docs/skill-rename-v0.8.0.md +49 -0
- package/docs/state-machine.md +162 -0
- package/gemini-extension.json +6 -0
- package/hooks/hooks-cursor.json +8 -0
- package/hooks/hooks.json +26 -0
- package/hooks/pre-tool-use-guard +116 -0
- package/hooks/session-start +14 -0
- package/llms.txt +51 -0
- package/package.json +48 -0
- package/plugin.json +27 -0
- package/prd/v1/plan.md +443 -0
- package/prd/v1/prd.md +580 -0
- package/scripts/check-update.mjs +91 -0
- package/scripts/check-version-consistency.mjs +345 -0
- package/scripts/ensure-branch.mjs +71 -0
- package/scripts/get-config +31 -0
- package/scripts/guard/checks/artifacts-exist.mjs +36 -0
- package/scripts/guard/checks/contract-current.mjs +33 -0
- package/scripts/guard/checks/contract-fresh.mjs +17 -0
- package/scripts/guard/checks/dp-gate-passed.mjs +35 -0
- package/scripts/guard/checks/dp3-approved.mjs +22 -0
- package/scripts/guard/checks/execution-plan-ready.mjs +40 -0
- package/scripts/guard/checks/execution-reviews-passed.mjs +36 -0
- package/scripts/guard/checks/schema-valid.mjs +63 -0
- package/scripts/guard/checks/specs-merged.mjs +51 -0
- package/scripts/guard/checks/tasks-complete.mjs +31 -0
- package/scripts/guard/checks/tests-passing.mjs +31 -0
- package/scripts/guard/design-token-guard.mjs +237 -0
- package/scripts/guard/guard.mjs +205 -0
- package/scripts/infer-workflow.mjs +136 -0
- package/scripts/install-amazon-q.mjs +9 -0
- package/scripts/install-cline.mjs +9 -0
- package/scripts/install-continue.mjs +9 -0
- package/scripts/install-cursor.mjs +265 -0
- package/scripts/install-git-hooks.mjs +82 -0
- package/scripts/install-kiro.mjs +9 -0
- package/scripts/install-pi.mjs +9 -0
- package/scripts/install-qoder.mjs +9 -0
- package/scripts/install-qwen.mjs +9 -0
- package/scripts/install-roocode.mjs +9 -0
- package/scripts/install-windsurf.mjs +9 -0
- package/scripts/install-zcode.mjs +265 -0
- package/scripts/lib/cmd-audit.mjs +127 -0
- package/scripts/lib/cmd-checkpoint.mjs +118 -0
- package/scripts/lib/cmd-config.mjs +88 -0
- package/scripts/lib/cmd-doctor.mjs +267 -0
- package/scripts/lib/cmd-execution.mjs +206 -0
- package/scripts/lib/cmd-handoff.mjs +94 -0
- package/scripts/lib/cmd-inject.mjs +310 -0
- package/scripts/lib/cmd-install-amazon-q.mjs +11 -0
- package/scripts/lib/cmd-install-cline.mjs +11 -0
- package/scripts/lib/cmd-install-continue.mjs +11 -0
- package/scripts/lib/cmd-install-cursor.mjs +14 -0
- package/scripts/lib/cmd-install-kiro.mjs +11 -0
- package/scripts/lib/cmd-install-pi.mjs +11 -0
- package/scripts/lib/cmd-install-qoder.mjs +11 -0
- package/scripts/lib/cmd-install-qwen.mjs +11 -0
- package/scripts/lib/cmd-install-roocode.mjs +11 -0
- package/scripts/lib/cmd-install-windsurf.mjs +11 -0
- package/scripts/lib/cmd-install-workbuddy.mjs +359 -0
- package/scripts/lib/cmd-install-zcode.mjs +14 -0
- package/scripts/lib/cmd-isolate.mjs +37 -0
- package/scripts/lib/cmd-list.mjs +71 -0
- package/scripts/lib/cmd-runtime.mjs +85 -0
- package/scripts/lib/cmd-solutions.mjs +71 -0
- package/scripts/lib/cmd-state.mjs +231 -0
- package/scripts/lib/cmd-sync.mjs +102 -0
- package/scripts/lib/cmd-validate.mjs +105 -0
- package/scripts/lib/cmd-version.mjs +148 -0
- package/scripts/lib/config-loader.mjs +107 -0
- package/scripts/lib/execution-plan.mjs +492 -0
- package/scripts/lib/execution-recommendation.mjs +221 -0
- package/scripts/lib/hash.mjs +74 -0
- package/scripts/lib/install.mjs +267 -0
- package/scripts/lib/platform-runtime-inventory.mjs +27 -0
- package/scripts/lib/platforms.mjs +165 -0
- package/scripts/lib/prototype-sync.mjs +192 -0
- package/scripts/lib/sdd-overlay.mjs +262 -0
- package/scripts/lib/shell-quote.mjs +4 -0
- package/scripts/lib/solutions-capture.mjs +102 -0
- package/scripts/lib/solutions-index-gen.mjs +112 -0
- package/scripts/lib/solutions-inject.mjs +77 -0
- package/scripts/lib/solutions-promote.mjs +145 -0
- package/scripts/lib/spec-paths.mjs +85 -0
- package/scripts/lib/state-loader.mjs +154 -0
- package/scripts/lint/lint-skills.mjs +149 -0
- package/scripts/lint/rules/behavior-consistency.mjs +56 -0
- package/scripts/lint/rules/dp-trigger-points.mjs +60 -0
- package/scripts/lint/rules/exception-handling.mjs +59 -0
- package/scripts/lint/rules/no-contradictory-instructions.mjs +67 -0
- package/scripts/lint/rules/no-redundant-checks.mjs +50 -0
- package/scripts/lint/rules/token-rules.mjs +122 -0
- package/scripts/review-package +44 -0
- package/scripts/task-brief +40 -0
- package/scripts/team-flow.mjs +164 -0
- package/scripts/token-baseline.mjs +158 -0
- package/scripts/validate-artifacts +96 -0
- package/scripts/verify-marketplace-release.mjs +59 -0
- package/skills/architecture-design/SKILL.md +140 -0
- package/skills/architecture-design/chapters/ch01-4a-domains.md +27 -0
- package/skills/architecture-design/chapters/ch02-change-cascade.md +27 -0
- package/skills/architecture-design/chapters/ch03-architecture-outputs.md +25 -0
- package/skills/architecture-design/chapters/ch04-entity-to-aggregate.md +27 -0
- package/skills/architecture-design/chapters/ch05-cqrs.md +32 -0
- package/skills/architecture-design/chapters/ch06-integration.md +54 -0
- package/skills/architecture-design/cheatsheet.md +51 -0
- package/skills/architecture-design/glossary.md +23 -0
- package/skills/architecture-design/patterns.md +32 -0
- package/skills/bug-investigator/SKILL.md +77 -0
- package/skills/build-executor/SKILL.md +163 -0
- package/skills/build-executor/implementer-prompt.md +162 -0
- package/skills/build-executor/references/execution-modes.md +86 -0
- package/skills/build-executor/task-reviewer-prompt.md +195 -0
- package/skills/ce-brainstorm/SKILL.md +415 -0
- package/skills/ce-brainstorm/references/agents/slack-researcher.md +127 -0
- package/skills/ce-brainstorm/references/blindspot-pass.md +70 -0
- package/skills/ce-brainstorm/references/brainstorm-sections.md +285 -0
- package/skills/ce-brainstorm/references/handoff.md +168 -0
- package/skills/ce-brainstorm/references/html-rendering.md +634 -0
- package/skills/ce-brainstorm/references/markdown-rendering.md +241 -0
- package/skills/ce-brainstorm/references/model-tiers.md +9 -0
- package/skills/ce-brainstorm/references/prd-mapping.md +71 -0
- package/skills/ce-brainstorm/references/product-pressure-test.md +42 -0
- package/skills/ce-brainstorm/references/reasoning-elevation.md +63 -0
- package/skills/ce-brainstorm/references/settled-decisions.md +45 -0
- package/skills/ce-brainstorm/references/synthesis-summary.md +282 -0
- package/skills/ce-brainstorm/references/universal-brainstorming.md +73 -0
- package/skills/ce-brainstorm/references/verdict-routing.md +26 -0
- package/skills/ce-brainstorm/references/visual-probes.md +158 -0
- package/skills/ce-brainstorm/scripts/visual-probe-server.js +418 -0
- package/skills/ce-compound/SKILL.md +114 -0
- package/skills/ce-compound/assets/resolution-template.md +94 -0
- package/skills/ce-compound/references/agents/best-practices-researcher.md +115 -0
- package/skills/ce-compound/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-compound/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-compound/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-compound/references/agents/performance-oracle.md +108 -0
- package/skills/ce-compound/references/agents/security-sentinel.md +91 -0
- package/skills/ce-compound/references/agents/session-historian.md +83 -0
- package/skills/ce-compound/references/concepts-vocabulary.md +78 -0
- package/skills/ce-compound/references/full-mode-workflow.md +413 -0
- package/skills/ce-compound/references/grounding-validation.md +84 -0
- package/skills/ce-compound/references/lightweight-mode.md +53 -0
- package/skills/ce-compound/references/output-standards.md +182 -0
- package/skills/ce-compound/references/promotion-rules.md +38 -0
- package/skills/ce-compound/references/schema.yaml +231 -0
- package/skills/ce-compound/references/three-tier-index.md +55 -0
- package/skills/ce-compound/references/v0.5-upgrade.md +32 -0
- package/skills/ce-compound/references/write-flow.md +36 -0
- package/skills/ce-compound/references/yaml-schema.md +118 -0
- package/skills/ce-compound/scripts/session-history/discover-sessions.sh +130 -0
- package/skills/ce-compound/scripts/session-history/extract-errors.py +254 -0
- package/skills/ce-compound/scripts/session-history/extract-metadata.py +456 -0
- package/skills/ce-compound/scripts/session-history/extract-skeleton.py +575 -0
- package/skills/ce-compound/scripts/validate-doc-claims.py +346 -0
- package/skills/ce-compound/scripts/validate-frontmatter.py +137 -0
- package/skills/ce-ideate/SKILL.md +402 -0
- package/skills/ce-ideate/references/agents/issue-intelligence-analyst.md +200 -0
- package/skills/ce-ideate/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-ideate/references/agents/slack-researcher.md +127 -0
- package/skills/ce-ideate/references/agents/web-researcher.md +121 -0
- package/skills/ce-ideate/references/divergent-ideation.md +89 -0
- package/skills/ce-ideate/references/html-rendering.md +634 -0
- package/skills/ce-ideate/references/ideation-sections.md +191 -0
- package/skills/ce-ideate/references/markdown-rendering.md +238 -0
- package/skills/ce-ideate/references/post-ideation-workflow.md +167 -0
- package/skills/ce-ideate/references/universal-ideation.md +107 -0
- package/skills/ce-ideate/references/web-research-cache.md +56 -0
- package/skills/ce-plan/SKILL.md +137 -0
- package/skills/ce-plan/references/agents/agent-native-planning-strategist.md +62 -0
- package/skills/ce-plan/references/agents/architecture-strategist.md +46 -0
- package/skills/ce-plan/references/agents/best-practices-researcher.md +114 -0
- package/skills/ce-plan/references/agents/data-integrity-guardian.md +68 -0
- package/skills/ce-plan/references/agents/data-migration-reviewer.md +103 -0
- package/skills/ce-plan/references/agents/deployment-verification-agent.md +157 -0
- package/skills/ce-plan/references/agents/framework-docs-researcher.md +93 -0
- package/skills/ce-plan/references/agents/git-history-analyzer.md +40 -0
- package/skills/ce-plan/references/agents/learnings-researcher.md +247 -0
- package/skills/ce-plan/references/agents/pattern-recognition-specialist.md +55 -0
- package/skills/ce-plan/references/agents/performance-oracle.md +108 -0
- package/skills/ce-plan/references/agents/repo-research-analyst.md +258 -0
- package/skills/ce-plan/references/agents/security-sentinel.md +91 -0
- package/skills/ce-plan/references/agents/slack-researcher.md +127 -0
- package/skills/ce-plan/references/agents/spec-flow-analyzer.md +80 -0
- package/skills/ce-plan/references/agents/web-researcher.md +121 -0
- package/skills/ce-plan/references/approach-altitude.md +55 -0
- package/skills/ce-plan/references/change-splitting.md +65 -0
- package/skills/ce-plan/references/completion-contract.md +33 -0
- package/skills/ce-plan/references/core-principles.md +40 -0
- package/skills/ce-plan/references/deepening-workflow.md +263 -0
- package/skills/ce-plan/references/dependency-graph.md +36 -0
- package/skills/ce-plan/references/html-rendering.md +634 -0
- package/skills/ce-plan/references/intake-routing.md +189 -0
- package/skills/ce-plan/references/markdown-rendering.md +238 -0
- package/skills/ce-plan/references/plan-handoff.md +150 -0
- package/skills/ce-plan/references/plan-sections.md +427 -0
- package/skills/ce-plan/references/plan-structure.md +120 -0
- package/skills/ce-plan/references/planning-modes.md +69 -0
- package/skills/ce-plan/references/reasoning-elevation.md +63 -0
- package/skills/ce-plan/references/research-workflow.md +165 -0
- package/skills/ce-plan/references/review-and-write.md +127 -0
- package/skills/ce-plan/references/settled-decisions.md +45 -0
- package/skills/ce-plan/references/synthesis-summary.md +418 -0
- package/skills/ce-plan/references/universal-planning.md +168 -0
- package/skills/ce-proof/SKILL.md +346 -0
- package/skills/ce-strategy/SKILL.md +97 -0
- package/skills/ce-strategy/references/interview.md +143 -0
- package/skills/ce-strategy/references/strategy-template.md +89 -0
- package/skills/code-reviewer/SKILL.md +84 -0
- package/skills/code-reviewer/code-reviewer-prompt.md +195 -0
- package/skills/contract-builder/SKILL.md +72 -0
- package/skills/design-system/SKILL.md +75 -0
- package/skills/design-system/references/agents/design-system-architect.md +138 -0
- package/skills/design-system/references/creation-flow.md +170 -0
- package/skills/design-system/references/preview-template.html +319 -0
- package/skills/design-system/references/token-derivation.md +115 -0
- package/skills/design-system/references/variant-schema.md +60 -0
- package/skills/e2e/SKILL.md +56 -0
- package/skills/e2e/references/test-verifier.md +40 -0
- package/skills/need-explorer/SKILL.md +79 -0
- package/skills/prototype/SKILL.md +98 -0
- package/skills/prototype/references/agents/design-system-architect.md +122 -0
- package/skills/prototype/references/checklist.md +82 -0
- package/skills/prototype/references/craft/accessibility-baseline.md +71 -0
- package/skills/prototype/references/craft/anti-ai-slop.md +87 -0
- package/skills/prototype/references/craft/laws-of-ux.md +60 -0
- package/skills/prototype/references/craft/state-coverage.md +81 -0
- package/skills/prototype/references/craft/typography-hierarchy.md +50 -0
- package/skills/prototype/references/layouts.md +223 -0
- package/skills/prototype/references/orchestration-flow.md +101 -0
- package/skills/prototype/references/prototype-scaffold/assets/design-tokens.css +19 -0
- package/skills/prototype/references/prototype-scaffold/components/button.html +3 -0
- package/skills/prototype/references/prototype-scaffold/design-system.md +7 -0
- package/skills/prototype/references/prototype-scaffold/flow.md +11 -0
- package/skills/prototype/references/prototype-scaffold/index.html +20 -0
- package/skills/prototype/references/prototype-scaffold/pages/index.html +11 -0
- package/skills/prototype/references/template.html +396 -0
- package/skills/release-archivist/SKILL.md +166 -0
- package/skills/release-archivist/references/closing-procedures.md +81 -0
- package/skills/session-handoff/SKILL.md +110 -0
- package/skills/session-handoff/references/context-extraction.md +70 -0
- package/skills/session-handoff/references/handoff-template.md +90 -0
- package/skills/session-handoff/references/skill-recommendation.md +43 -0
- package/skills/spec-merger/SKILL.md +66 -0
- package/skills/spec-writer/SKILL.md +149 -0
- package/skills/workflow-bootstrap/SKILL.md +148 -0
- package/skills/workflow-bootstrap/references/agents/codebase-recon-analyst.md +121 -0
- package/skills/workflow-bootstrap/references/b1-reconnaissance.md +80 -0
- package/skills/workflow-bootstrap/scripts/recon-probe.sh +328 -0
- package/skills/workflow-feedback/SKILL.md +120 -0
- package/skills/workflow-feedback/references/category-guide.md +121 -0
- package/skills/workflow-feedback/references/feedback-template.md +73 -0
- package/skills/workflow-feedback/references/review-mode.md +92 -0
- package/skills/workflow-orchestrator/SKILL.md +94 -0
- package/skills/workflow-orchestrator/references/feedback-loops.md +56 -0
- package/skills/workflow-orchestrator/references/s1-path-router.md +81 -0
- package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +96 -0
- package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +50 -0
- package/skills/workflow-orchestrator/references/s4-split-validate.md +108 -0
- package/skills/workflow-orchestrator/references/s5-monitoring.md +61 -0
- package/skills/workflow-orchestrator/references/state-model.md +185 -0
- package/skills/workflow-start/SKILL.md +147 -0
- package/skills/workflow-start/references/routing-rules.md +155 -0
- package/src/index.ts +16 -0
- package/src/parsing/change-parser.ts +79 -0
- package/src/parsing/requirement-blocks.ts +244 -0
- package/src/schema/base.ts +8 -0
- package/src/schema/change.ts +29 -0
- package/src/schema/index.ts +3 -0
- package/src/schema/spec.ts +12 -0
- package/src/validation/constants.ts +53 -0
- package/src/validation/tokenizer.ts +180 -0
- package/src/validation/types.ts +47 -0
- package/src/validation/validator.ts +552 -0
- package/templates/abandonment-summary.md +29 -0
- package/templates/design.md +37 -0
- package/templates/execution-contract.md +99 -0
- package/templates/plan.md +86 -0
- package/templates/prd.md +468 -0
- package/templates/proposal.md +37 -0
- package/templates/spec.md +31 -0
- package/templates/tasks.md +47 -0
- package/tests/e2e.test.mjs +266 -0
- package/tests/lib/cmd-audit.test.mjs +202 -0
- package/tests/lib/cmd-checkpoint.test.mjs +98 -0
- package/tests/lib/cmd-config.test.mjs +101 -0
- package/tests/lib/cmd-doctor.test.mjs +450 -0
- package/tests/lib/cmd-execution.test.mjs +647 -0
- package/tests/lib/cmd-handoff.test.mjs +137 -0
- package/tests/lib/cmd-inject.test.mjs +218 -0
- package/tests/lib/cmd-install-workbuddy.test.mjs +113 -0
- package/tests/lib/cmd-install-zcode.test.mjs +42 -0
- package/tests/lib/cmd-isolate.test.mjs +68 -0
- package/tests/lib/cmd-list.test.mjs +127 -0
- package/tests/lib/cmd-runtime.test.mjs +83 -0
- package/tests/lib/cmd-state-missing.test.mjs +65 -0
- package/tests/lib/cmd-state.test.mjs +365 -0
- package/tests/lib/cmd-sync-paths.test.mjs +84 -0
- package/tests/lib/cmd-validate-paths.test.mjs +90 -0
- package/tests/lib/config-loader.test.mjs +175 -0
- package/tests/lib/ensure-branch.test.mjs +59 -0
- package/tests/lib/execution-control-plane.test.mjs +168 -0
- package/tests/lib/execution-plan.test.mjs +474 -0
- package/tests/lib/guard-specs-merged.test.mjs +108 -0
- package/tests/lib/guard-tests-passing.test.mjs +112 -0
- package/tests/lib/guard-transitions.test.mjs +262 -0
- package/tests/lib/guard.test.mjs +611 -0
- package/tests/lib/hash.test.mjs +138 -0
- package/tests/lib/infer-workflow.test.mjs +161 -0
- package/tests/lib/install-git-hooks.test.mjs +20 -0
- package/tests/lib/marketplace-release-docs.test.mjs +31 -0
- package/tests/lib/minimality-discipline.test.mjs +37 -0
- package/tests/lib/model-profiles-docs.test.mjs +33 -0
- package/tests/lib/node20-compatibility.test.mjs +73 -0
- package/tests/lib/node20-test-entry.test.mjs +17 -0
- package/tests/lib/platform-runtime-distribution.test.mjs +150 -0
- package/tests/lib/raw-mode-smoke.test.mjs +42 -0
- package/tests/lib/sdd-overlay.test.mjs +118 -0
- package/tests/lib/spec-paths.test.mjs +80 -0
- package/tests/lib/state-loader.test.mjs +251 -0
- package/tests/lib/token-baseline.test.mjs +72 -0
- package/tests/lib/token-rules.test.mjs +94 -0
- package/tests/lib/verify-marketplace-release.test.mjs +128 -0
- package/tests/tsconfig.json +12 -0
- package/token-baseline.json +95 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# 编排状态模型(v0.7 新增,v0.15.0 多需求重构 + `.team-flow/` 治理)
|
|
2
|
+
|
|
3
|
+
> orchestrator 的持久化记忆 / checkpointer(对标 LangGraph Checkpointer),跨阶段、跨 session 的状态一律读 yaml 而非依赖上下文记忆。设计依据:设计增强方案 v0.7 §17.9 + v0.8 §18.2/§18.3。
|
|
4
|
+
|
|
5
|
+
## 状态文件布局(v0.15.0:每需求一份 + 注册表)
|
|
6
|
+
|
|
7
|
+
> **v0.15.0 重构**:从「单需求单文件 `.workflow-orchestrator.yaml`(项目根)」升级为「每需求一份 + 注册表索引」,支持多需求并行;所有状态文件收敛到 `.team-flow/` 目录(P1-6 第一阶段)。
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
.team-flow/
|
|
11
|
+
├── registry.yaml # 需求注册表(索引 + 活跃指针)
|
|
12
|
+
└── requirements/
|
|
13
|
+
└── <req-id>/ # 每个需求独立目录(req-id = prd 迭代主题短码)
|
|
14
|
+
└── orchestrator.yaml # 该需求的产品级编排状态(原 .workflow-orchestrator.yaml)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- **迁移兼容**:检测到旧 `<root>/.workflow-orchestrator.yaml` 存在时,自动迁移到 `.team-flow/requirements/<req-id>/orchestrator.yaml` 并提示用户(一次性)。
|
|
18
|
+
- **变更级状态**:各 change 的状态文件**当前仍为** `<change>/.team-flow.yaml`,检测逻辑不动;**计划 v1.0.0(P1-6 第二阶段)改名**为 `.team-flow.yaml`(对齐设计增强方案 v0.8 §18.3)。改名落地前,编排层与变更层一律以 `.team-flow.yaml` 为准。
|
|
19
|
+
|
|
20
|
+
## registry.yaml Schema
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
schema_version: 1
|
|
24
|
+
active_requirement: <req-id> # 当前活跃需求(orchestrator 默认操作对象)
|
|
25
|
+
requirements:
|
|
26
|
+
- id: <req-id>
|
|
27
|
+
title: <需求标题>
|
|
28
|
+
prd_version: v1
|
|
29
|
+
phase: S3 # 冗余快照,真相源仍是各 orchestrator.yaml
|
|
30
|
+
orchestrator_state: .team-flow/requirements/<req-id>/orchestrator.yaml
|
|
31
|
+
created_at: "..."
|
|
32
|
+
updated_at: "..."
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 单需求 orchestrator.yaml Schema
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
schema_version: 1 # schema 版本号
|
|
39
|
+
requirement_id: <req-id> # 需求标识(与 registry 对应)
|
|
40
|
+
workflow_phase: S2 # 当前阶段
|
|
41
|
+
phases: # 各阶段状态
|
|
42
|
+
- { id: S1, status: completed, started_at: "...", completed_at: "...", artifacts: [...] }
|
|
43
|
+
- { id: S2, status: active, started_at: "...", artifacts: [...] }
|
|
44
|
+
- { id: S3, status: pending }
|
|
45
|
+
custom_phases: [] # reserved
|
|
46
|
+
replan_log: # 重规划履历
|
|
47
|
+
- { seq: 1, trigger: "用户要求跳过原型", before: "S2→S3", after: "S2(skip-proto)→S3", approved_by: user }
|
|
48
|
+
change_dag: # change 依赖图(S4 后填充)
|
|
49
|
+
- id: change-1
|
|
50
|
+
change_dir: changes/change-1/ # 项目根 changes/<change-name>/(非 specs/,非 .team-flow/)
|
|
51
|
+
state_file: changes/change-1/.team-flow.yaml # 变更级状态文件(P1-6 第二阶段 v1.0.0 改名为 .team-flow.yaml)
|
|
52
|
+
depends_on: []
|
|
53
|
+
priority: 1
|
|
54
|
+
parallel_group: A # 同组可并行
|
|
55
|
+
status: executing # 从 .team-flow.yaml 同步(计划 v1.0.0 改名 .team-flow.yaml)
|
|
56
|
+
- id: change-2
|
|
57
|
+
depends_on: [change-1]
|
|
58
|
+
status: pending
|
|
59
|
+
prd_version: v1 # PRD 版本
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 状态枚举
|
|
63
|
+
|
|
64
|
+
`pending | active | completed | skipped | blocked | aborted`
|
|
65
|
+
|
|
66
|
+
## 状态转换规则
|
|
67
|
+
|
|
68
|
+
- **正向**:pending → active → completed
|
|
69
|
+
- **跳过**:pending → skipped(用户确认)
|
|
70
|
+
- **回退**:active → pending(**必须写 replan_log**)
|
|
71
|
+
- **阻塞**:active → blocked → active(S5 检测到 change 卡死)或 blocked → aborted
|
|
72
|
+
- **终止**:任何非 completed 状态 → aborted(用户放弃编排)
|
|
73
|
+
|
|
74
|
+
## 双层冻结语义(解决 §17.3 与 §17.9.1 矛盾)
|
|
75
|
+
|
|
76
|
+
- **`frozen_downstream`**(S2 完成时设置):下游阶段(S3/S4/S5)不可直接修改 PRD,只能通过回退到 S2 修改。**S3→S2 回退 = 临时解除 frozen_downstream**,S2 重新完成后恢复。
|
|
77
|
+
- **`frozen_absolute`**(用户显式确认或 vN+1 启动时设置):任何修改都必须升版 vN+1。
|
|
78
|
+
- **单一真相源**:frozen 状态以 `prd/vN/prd.md` frontmatter 为准,yaml 只存指针不重复存 frozen 值,避免双写不一致。
|
|
79
|
+
|
|
80
|
+
## 原型补跑/重跑:部分重入语义(v0.20.0,S1 第 7 入口)
|
|
81
|
+
|
|
82
|
+
S1 判定「原型补跑/重跑」(PRD `frozen_downstream` ∧ `prototype/` 缺失/需重做)时的状态转换规则,**区别于 S3→S2 回退**:
|
|
83
|
+
|
|
84
|
+
- **状态转换**:`workflow_phase` 临时回 `S2`,S2 阶段状态置 `active` 并加子标记 `prototype-only`(仅重跑 S2 步骤 2 判断→3 原型循环→4 冻结);**不重置** S3/S4 已 `completed` 的 phases。记录原 phase(如 `S4`)到 `replan_log`,闭环后恢复。
|
|
85
|
+
- **冻结语义**:PRD `frozen_downstream` **保持不变**(与 S3→S2 回退会临时解除 frozen 不同)——原型补跑不修 PRD,故无需解除冻结。
|
|
86
|
+
- **制品保留**:S3 `plan.md` / S4 `changes/` 已存在且仍有效则**保留不动**,不重做、不归档。
|
|
87
|
+
- **闭环恢复**:原型循环闭环(自动评审 PASS / 人工通过)后,`workflow_phase` 恢复原 phase(如 `s4-distribution`),S2 状态回 `completed`(去掉 `prototype-only` 子标记)。
|
|
88
|
+
- **replan_log 必写**:`{ seq, trigger: "prototype-rerun", before: <原 phase>, after: "S2(prototype-only)", approved_by }`,并记结论「未暴露 scope 问题、changes 保持有效」。
|
|
89
|
+
- **升级路径**:若原型循环暴露 PRD scope 问题 → **脱离本路径**,升级为 S3→S2 回退修订(临时解除 `frozen_downstream`,PRD vN 内修订 + 变更履历),不再按 prototype-only 处理。
|
|
90
|
+
|
|
91
|
+
## change_dag 结构
|
|
92
|
+
|
|
93
|
+
S4 后填充。每个节点字段:
|
|
94
|
+
- `id`:change 标识(与 C-ID 对应)
|
|
95
|
+
- `change_dir` / `state_file`:change 目录与状态文件路径。`change_dir` 固定为项目根 `changes/<change-name>/`,不是 `specs/<cap>/`(change 内部行为规格目录)或 `architecture/`(change 内部架构设计目录),也不是 `.team-flow/`(仅存产品级编排状态)
|
|
96
|
+
- `depends_on`:依赖的 change id 列表(构成 DAG)
|
|
97
|
+
- `priority`:优先级数值
|
|
98
|
+
- `parallel_group`:同组可并行(如 A、B)
|
|
99
|
+
- `status`:从该 change 的 `.team-flow.yaml` 同步(变更级状态文件,P1-6 第二阶段改名 `.team-flow.yaml`)
|
|
100
|
+
|
|
101
|
+
## yaml 定位与并发约束
|
|
102
|
+
|
|
103
|
+
- **持久化记忆 / checkpointer**:跨阶段、跨 session 状态读 yaml,不依赖上下文记忆
|
|
104
|
+
- **幂等恢复**:S1「继续执行」入口通过 yaml + 制品实际存在性双重校验重建状态
|
|
105
|
+
- **多需求隔离(v0.15.0)**:每个需求的 `orchestrator.yaml` 只由该需求的 orchestrator 实例单写——多需求并行时**天然隔离,无写冲突**(原「单写者」约束自动成立)。
|
|
106
|
+
- **registry 写入**:`registry.yaml` 只在需求创建/切换/状态快照时由 orchestrator 写,频率低。
|
|
107
|
+
- **变更级单写者**:各 change 只写自己的状态文件(当前 `.team-flow.yaml`,P1-6 第二阶段改名 `.team-flow.yaml`),避免并发写冲突。
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 动态重规划(§17.9)
|
|
112
|
+
|
|
113
|
+
> 从「固定管道」升级为「默认路径 + 任意时刻可重规划」。
|
|
114
|
+
|
|
115
|
+
### 三级意图分类器(宁可漏判,不可误触发)
|
|
116
|
+
|
|
117
|
+
| 级别 | 方法 | 触发条件 | 动作 |
|
|
118
|
+
|------|------|---------|------|
|
|
119
|
+
| L1 关键词 | 零成本匹配(**宾语须为 orchestrator 阶段或 change 全局结构**) | 「改阶段顺序/跳过原型阶段/插入一个评审阶段/回退到S2/重规划工作流」 | → 重规划评估 |
|
|
120
|
+
| L2 语义分析 | LLM 判断 | 对阶段顺序的不满 / 对缺失环节的要求 / 对已完成产出的否定 | → **建议模式**:输出轻量提示「你似乎想调整工作流?输入'重规划'进入重规划模式」,**不自动进入评估** |
|
|
121
|
+
| L3 默认 | — | 不改变工作流结构 | 普通问答处理 |
|
|
122
|
+
|
|
123
|
+
> **L1 上下文限定**:「跳过这个功能」(PRD 内容讨论)不触发;「跳过原型阶段」(orchestrator 阶段)才触发。L2 从「自动触发」降级为「建议模式」(B2),将触发权交还用户。
|
|
124
|
+
|
|
125
|
+
### 重规划评估流程
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
边界检查(红/绿/灰区)→ 影响分析 → before/after 对比呈现
|
|
129
|
+
→ DP-R 用户确认(硬门禁,阻塞式)→ 执行 + 写入 replan_log
|
|
130
|
+
→ 触发复利捕获(workflow_pattern)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 重规划边界
|
|
134
|
+
|
|
135
|
+
| 区域 | 范围 | 规则 |
|
|
136
|
+
|------|------|------|
|
|
137
|
+
| **绿区(可重规划)** | 调整未完成阶段顺序;跳过未完成阶段;插入新阶段;修改未执行 change 的优先级/依赖;S4 后新增 change | 用户确认即可 |
|
|
138
|
+
| **红区(不可重规划)** | 修改已冻结 PRD(只能升版);删除已执行 change(只能走 abandoned);重做已完成阶段;改变已合并 delta spec | 硬阻断 |
|
|
139
|
+
| **灰区(二次确认)** | 回退 active 阶段(半成品可能丢失);修改有下游执行的 change 依赖图 | 需二次确认 + 影响说明 |
|
|
140
|
+
|
|
141
|
+
### replan_log
|
|
142
|
+
|
|
143
|
+
每次回退/重规划必须写入 `replan_log`:`{ seq, trigger, before, after, approved_by }`。是 ACM/CMMN Case Event Log 的 LLM 简化版。
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 工作流模式复利 L2(§17.9.4)
|
|
148
|
+
|
|
149
|
+
与现有 solutions 体系完全兼容,新增 `type: workflow_pattern`:
|
|
150
|
+
|
|
151
|
+
| 字段 | 值 |
|
|
152
|
+
|------|---|
|
|
153
|
+
| type | `workflow_pattern`(新增值) |
|
|
154
|
+
| domain | `workflow`(固定) |
|
|
155
|
+
| phase | `cross-phase`(固定) |
|
|
156
|
+
| pattern_kind | stage-insertion / stage-skip / reorder / change-split-adjust / gate-adding |
|
|
157
|
+
| outcome | positive / negative / neutral |
|
|
158
|
+
| confidence | 浮点数(0.3 基础 + occurrences×0.1 + outcome 加成) |
|
|
159
|
+
| occurrences | 出现次数 |
|
|
160
|
+
|
|
161
|
+
**捕获时机**:DP-R 确认的重规划、阶段回退、用户主动反馈、PRD 升版、change closing 回顾。
|
|
162
|
+
|
|
163
|
+
**注入时机**(全部 advisory 级,不阻断):
|
|
164
|
+
- S1 路由时:历史模式 top-3(confidence ≥ 0.5)
|
|
165
|
+
- 阶段转换时:applicable_when 匹配
|
|
166
|
+
- DP-R 触发时:类似历史重规划
|
|
167
|
+
|
|
168
|
+
**置信度阈值**:≥0.7 强建议 / ≥0.5 弱建议 / <0.5 仅记录 / ≤0.1 淘汰。晋升:confidence ≥ 0.7 且 occurrences ≥ 3 → 建议固化到 SOP。
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 实施路线图(§17.9.6)
|
|
173
|
+
|
|
174
|
+
| 阶段 | 版本 | 内容 | 依赖 |
|
|
175
|
+
|------|------|------|------|
|
|
176
|
+
| Phase 0 | v0.14.0 | `.workflow-orchestrator.yaml` 状态持久化 | 无(一切前提) |
|
|
177
|
+
| Phase 1 | v0.14.0 | DP-R 决策点 + 阶段跳过/插入/重排 + replan_log | Phase 0 |
|
|
178
|
+
| Phase 2 | v0.15.0 | 三级意图分类器 + 红/绿/灰区边界检查 | Phase 1 |
|
|
179
|
+
| Phase 3 | v0.15.0 | workflow_pattern 注册 + 捕获 + INDEX.md 兼容 | Phase 1 |
|
|
180
|
+
| Phase 4 | v0.16.0 | confidence 模型 + 三处注入 + 用户反馈回写 | Phase 3 |
|
|
181
|
+
| Phase 5 | v0.17.0+ | 高 confidence 模式固化 SOP + 失效淘汰 | Phase 4 |
|
|
182
|
+
|
|
183
|
+
**关键约束**:Phase 0 是一切前提;所有 L2 注入为 advisory 级;L3(自动工作流修改)明确不做,人在环。
|
|
184
|
+
|
|
185
|
+
> **当前实现状态**:状态持久化(Phase 0)已于 **v0.15.0** 落地,并升级为多需求模型(`.team-flow/registry.yaml` + `.team-flow/requirements/<req-id>/orchestrator.yaml`)。动态重规划相关能力(三级意图分类器、红/绿/灰区、workflow_pattern 复利)随路线图分版本交付。
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-start
|
|
3
|
+
description: Primary entry point for the team-flow state-machine workflow. Invoke when the user is inside an active team-flow change directory (look for .team-flow.yaml, changes/<name>/, proposal.md, specs/, design.md, tasks.md, or execution-contract.md) and asks to start, continue, resume, implement, plan, or figure out the next workflow step. Also invoke when the user explicitly asks to start a new team-flow change or route through the team-flow workflow. Do not invoke for unrelated coding tasks that happen to use words like start, continue, implement, or plan.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Start
|
|
7
|
+
|
|
8
|
+
Primary entry point for `team-flow`. Jobs: inspect change context, check for updates, confirm DP-0, determine state, route to correct skill, block invalid transitions.
|
|
9
|
+
|
|
10
|
+
## Use This Skill When
|
|
11
|
+
|
|
12
|
+
Only invoke when team-flow context is present: `.team-flow.yaml` exists, artifacts like `proposal.md`/`specs/`/`design.md`/`tasks.md`/`execution-contract.md` are present, or user explicitly invokes team-flow by name. When in doubt, check for `.team-flow.yaml` first.
|
|
13
|
+
|
|
14
|
+
Do NOT invoke for: general coding tasks outside team-flow changes, casual questions, unrelated work.
|
|
15
|
+
|
|
16
|
+
## States
|
|
17
|
+
|
|
18
|
+
`exploring` → `specifying` → `bridging` → `approved-for-build` → `executing` → `closing`, with `debugging` side-path from `executing`, and `abandoned` as terminal. If a transition is ambiguous, run `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime asset read docs/state-machine.md`.
|
|
19
|
+
|
|
20
|
+
## Initialization
|
|
21
|
+
|
|
22
|
+
1. **Update check**: Run `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime check-update`. Exit 0 → continue. Exit 1 → non-blocking upgrade reminder. Exit 2 → skip.
|
|
23
|
+
2. **Inspect change folder**: Check for `proposal.md`, `specs/`, `design.md`, `tasks.md`, `execution-contract.md`. Answer: Is the change fuzzy? Artifacts missing/unstable? Contract exist? User approved contract? Execution in progress or blocked? In verification/wrap-up?
|
|
24
|
+
3. **Overlay recovery scan**: Run `npx --yes --package @xulthekl/team-flow@0.22.4 tf handoff list <change-dir> --json` and `npx --yes --package @xulthekl/team-flow@0.22.4 tf checkpoint list <change-dir> --json`. A `result-ready` handoff requires explicit review and `npx --yes --package @xulthekl/team-flow@0.22.4 tf handoff resolve` before resuming the affected work. An `active` handoff is non-blocking side work. Show a non-stale checkpoint as recovery context; show a stale checkpoint only as historical evidence.
|
|
25
|
+
4. **Execution-control recovery scan**: For `approved-for-build`, `executing`, `debugging`, or `closing`, run `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution show <change-dir> --json`. Treat only `current: true` plus `waves[].eligible: true` as permission to start a wave; report plan revision, mode, next eligible wave, and every wave's receipt/blockers. A missing, invalid, or stale plan blocks implementation and routes to `build-executor`; do not infer progress from chat history.
|
|
26
|
+
|
|
27
|
+
## DP-0: User Confirmation Gate
|
|
28
|
+
|
|
29
|
+
Run DP-0 when: change folder doesn't exist, planning artifacts missing/empty, or `dp_0_confirmed` ≠ `true`. Skip if `dp_0_confirmed` is `true`.
|
|
30
|
+
|
|
31
|
+
### Upstream Inheritance (v0.9)
|
|
32
|
+
|
|
33
|
+
若 `change-brief.md` 存在且 `upstream_source == orchestrator`(本 change 由 orchestrator S4 分发),**继承** brief 的 scope/约束/AC 为默认值,DP-0 从"从零问"改为"一次确认继承或修正",**不**重新问"你想做什么"。否则(手动新建 / hotfix / 单 change 快速通道 / 存量 change 无 brief)照常 DP-0。**主信号 = brief 文件存在**(非 yaml 字段——可天然排除无 brief 的快速通道,且对存量手动 change 零误伤);双源冲突以 `prd/vN/plan.md` 为准并触发 Brief drift(见「Staleness Detection」)。完整判定伪代码与主信号理由见 `references/routing-rules.md`「DP-0」。
|
|
34
|
+
|
|
35
|
+
Ask (manual path): change name + one-sentence intent, known constraints, related optimizations (include or stay focused?), communication preference (ask per decision or draft for review).
|
|
36
|
+
|
|
37
|
+
After confirmation:
|
|
38
|
+
```bash
|
|
39
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_decisions "<summary>"
|
|
40
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_result confirmed
|
|
41
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_confirmed true
|
|
42
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Config-aware routing: check `artifacts.order` and `artifacts.skip` from project config.
|
|
46
|
+
|
|
47
|
+
## Mode Detection
|
|
48
|
+
|
|
49
|
+
If workflow is `auto`/`null`/unset: run `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime infer <change-dir>`. Inference: **hotfix** (≤2 tasks, ≤2 files, no schema/API/new modules), **tweak** (≤4 tasks, config/doc only), **full** (anything larger). Persist with `npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <dir> workflow <mode>`.
|
|
50
|
+
|
|
51
|
+
Validate mode against artifact content. If hotfix/tweak criteria not met → upgrade to `full` and output reason. Don't overwrite explicit mode unless user asks.
|
|
52
|
+
|
|
53
|
+
## Routing Rules
|
|
54
|
+
|
|
55
|
+
### Route to need-explorer
|
|
56
|
+
Change is fuzzy, scope unclear, comparing options, no stable change name.
|
|
57
|
+
|
|
58
|
+
### Route to architecture-design (v0.9 §26)
|
|
59
|
+
Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer. Dispatch `architecture-design` as sub-agent; after return, run reasonableness check and write yaml. Full protocol in `references/routing-rules.md`「Route to architecture-design」.
|
|
60
|
+
|
|
61
|
+
### Route to spec-writer
|
|
62
|
+
Guard: `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime guard check <dir> exploring specifying --json` → fail = BLOCK. **arch_design_decision must not be null** → fail = BLOCK (v0.9 §26). User knows what they want, artifacts missing/incomplete.
|
|
63
|
+
|
|
64
|
+
### Route to contract-builder
|
|
65
|
+
Guard: `... check <dir> specifying bridging --json` → fail = BLOCK. Artifacts exist, implementation requested, contract missing/stale. Include `DP-3: 契约批准`.
|
|
66
|
+
|
|
67
|
+
### Route to build-executor
|
|
68
|
+
Contract exists and approved, contract matches artifacts. Include `DP-4: 执行模式选择`: propose waves, run `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution recommend <change-dir> [--wave ...]`, show the user every available mode plus evidence and the recommendation, then obtain a clear selection. The command saves a current receipt; before the first implementation edit, `build-executor` must run `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution plan <change-dir> --mode <selected> --confirm ...` (and `--acknowledge-recommendation` when the selected mode differs from the recommendation) using matching artifacts, contract, and waves, then `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution show <change-dir> --json`; report the saved revision, selected mode, recommendation alignment, ordered waves, and actual concurrent-dispatch capability. A revision must repeat recommend and confirmation. Do not transition to `executing` until `show` reports `current: true`; then run `... check <dir> approved-for-build executing --json` → fail = BLOCK.
|
|
69
|
+
|
|
70
|
+
### Route to bug-investigator
|
|
71
|
+
Execution hit blockage: test failure, unexpected behavior, build error, task cannot proceed. After debugging, route back to build-executor.
|
|
72
|
+
|
|
73
|
+
### Route to code-reviewer
|
|
74
|
+
The current planned wave is implemented and ready for spec-compliance + code-quality verification. A reviewer must write an `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <path> --verdict <pass|fail>` receipt before any dependent wave or closing transition.
|
|
75
|
+
|
|
76
|
+
### Route to release-archivist
|
|
77
|
+
Guard: `... check <dir> executing closing --json` → fail = BLOCK. Implementation complete, verification complete/nearly complete. Include `DP-7: 归档确认`.
|
|
78
|
+
|
|
79
|
+
### Route to spec-merger
|
|
80
|
+
Delta specs exist that need merging, change closing with ADDED/MODIFIED/REMOVED/RENAMED specs.
|
|
81
|
+
|
|
82
|
+
### Route to abandoned
|
|
83
|
+
User explicitly requests, bug-investigator escalates after 3+ failures AND user chooses, scope change makes change no longer worthwhile AND user confirms. Block from `closing` or `abandoned`.
|
|
84
|
+
|
|
85
|
+
### Optional Prototype Handoff
|
|
86
|
+
|
|
87
|
+
When the user's brief explicitly contains UI, screen, interaction, layout, UX,
|
|
88
|
+
or product-experience uncertainty, ask once whether a prototype would reduce
|
|
89
|
+
uncertainty. Do not create a prototype handoff or enter a prototype worktree
|
|
90
|
+
until the user confirms. After confirmation:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf handoff create <change-dir> \
|
|
94
|
+
--type prototype --objective "<confirmed objective>" \
|
|
95
|
+
--expected-output "<expected evidence>" --acceptance "<completion criterion>"
|
|
96
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf isolate <change-dir> prototype-<handoff-id>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Never suggest or enter this route automatically for backend, CLI, configuration,
|
|
100
|
+
or internal-refactor work. Never pass `--force` to `tf isolate` for prototype
|
|
101
|
+
work.
|
|
102
|
+
|
|
103
|
+
### Fast-Path Routing
|
|
104
|
+
- **Hotfix**: Route to contract-builder (minimal), skip need-explorer + spec-writer, guard check `exploring bridging --workflow hotfix`, then `bridging -> approved-for-build`, after DP-3 → build-executor (recommend, show, and confirm an execution mode), after → release-archivist (lightweight). Hotfix may skip `proposal.md`, `design.md`, `tasks.md`, and `specs/`, but it still requires a fresh minimal `execution-contract.md`, DP-3 approval, and a current execution plan before build. **architecture-design 不豁免**(v0.9 §26):同样过 architecture-design 子代理判断门,快速判定是否涉及架构变更(hotfix 可能正是架构缺陷导致)
|
|
105
|
+
- **Tweak**: Route to build-executor (direct edit), skip need-explorer + spec-writer + contract-builder, guard check `exploring approved-for-build --workflow tweak`, after → release-archivist (lightweight). **architecture-design 不豁免**(v0.9 §26):同样过 architecture-design 子代理判断门
|
|
106
|
+
|
|
107
|
+
Post-transition: 💡 `npx --yes --package @xulthekl/team-flow@0.22.4 tf inject <change-dir>` to update phase-guard artifacts.
|
|
108
|
+
|
|
109
|
+
## Staleness Detection
|
|
110
|
+
|
|
111
|
+
Use content inspection, not timestamps.
|
|
112
|
+
|
|
113
|
+
**Stale contract**: proposal scope expanded beyond contract scope fence, or contract references capabilities no longer in proposal → route back to `contract-builder`.
|
|
114
|
+
|
|
115
|
+
**Stale planning artifacts**: capability in proposal has no spec file, or spec exists for capability not in proposal → drift detected.
|
|
116
|
+
|
|
117
|
+
**Stale tasks**: requirement in specs has no corresponding task → stale tasks.
|
|
118
|
+
|
|
119
|
+
**Brief drift (advisory, v0.9, 不阻断)**: change-brief.md 是上游输入(非 team-flow 产物),**不**混入上述三条产物互查、**不**进入 `artifacts_hash`。当 brief 的 `plan_hash` 与当前 `prd/vN/plan.md` 不一致,或 brief AC 列表与 PRD 功能清单明显出入 → 提示"产品层已变更,brief 可能过期,建议回 orchestrator 重新分发(S4→S3 环路)",**不**触发产物重审。
|
|
120
|
+
|
|
121
|
+
## Guardrails
|
|
122
|
+
|
|
123
|
+
- No implementation before planning artifacts or contract exist
|
|
124
|
+
- No implementation for full/hotfix without a current `npx --yes --package @xulthekl/team-flow@0.22.4 tf execution plan`; no state transition based on an unverified DP-4 string
|
|
125
|
+
- No "continue" without state inspection
|
|
126
|
+
- No implementation past stale contract
|
|
127
|
+
- No implementation past bug without investigation
|
|
128
|
+
- No closure without all planned wave review receipts recorded as `pass`
|
|
129
|
+
- No closure with unsynced delta specs
|
|
130
|
+
- No transitions from `abandoned` (terminal)
|
|
131
|
+
- No transition to `abandoned` from `closing` or `abandoned`
|
|
132
|
+
- No auto-abandon without user confirmation
|
|
133
|
+
- No merging delta specs from abandoned change
|
|
134
|
+
- **No routing to spec-writer without architecture-design gate pass** (v0.9 §26): `arch_design_decision` must be `required` or `skipped` (not `null`). hotfix/tweak 不豁免
|
|
135
|
+
|
|
136
|
+
## Output Standard
|
|
137
|
+
|
|
138
|
+
Always state: (1) current detected state, (2) why (cite file/content/condition), (3) which skill should run next. If blocking, explain missing artifact/approval.
|
|
139
|
+
|
|
140
|
+
Decision point references when routing:
|
|
141
|
+
- architecture-design → DP-A(架构设计判断门,v0.9 §26), contract-builder → DP-3, build-executor → DP-4, bug-investigator (escalation) → DP-5, release-archivist (verification failure) → DP-6, release-archivist → DP-7
|
|
142
|
+
|
|
143
|
+
## Exception Handling
|
|
144
|
+
|
|
145
|
+
- **Parse failures**: Fall back to content-level detection if `.team-flow.yaml` is malformed
|
|
146
|
+
- **Missing files**: Route to the skill that generates the missing files
|
|
147
|
+
- **User interruption**: Re-inspect change directory content (not cached state) on resume
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Routing Rules Reference
|
|
2
|
+
|
|
3
|
+
> 从 workflow-start SKILL.md 提取的详细路由规则和 CLI 命令。
|
|
4
|
+
|
|
5
|
+
## Route to need-explorer
|
|
6
|
+
Change is fuzzy, scope unclear, comparing options, no stable change name.
|
|
7
|
+
|
|
8
|
+
## Route to architecture-design (v0.9 §26)
|
|
9
|
+
|
|
10
|
+
Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer.
|
|
11
|
+
|
|
12
|
+
Dispatch `architecture-design` as sub-agent with inputs:
|
|
13
|
+
- `change-brief.md`(scope / AC / 技术方向)
|
|
14
|
+
- `prd/vN/plan.md` 高阶技术设计段
|
|
15
|
+
- existing `specs/`
|
|
16
|
+
- global `docs/architecture/`(As-Is 基线)
|
|
17
|
+
|
|
18
|
+
Sub-agent returns structured output:
|
|
19
|
+
```yaml
|
|
20
|
+
decision: required | skipped
|
|
21
|
+
reason: "..." # skipped 时:不涉及架构变更的理由
|
|
22
|
+
# required 时:涉及的变更项摘要
|
|
23
|
+
artifacts: # required 时必填
|
|
24
|
+
- architecture/architecture.md
|
|
25
|
+
- architecture/database.md
|
|
26
|
+
- architecture/api.md
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Reasonableness check**(workflow-start 确认后写入 yaml):
|
|
30
|
+
- `skipped` + reason inconsistent with brief/plan scope → **BLOCK**(如 scope 含"新增 API"但 reason 说"不涉及架构变更")
|
|
31
|
+
- `required` + artifacts files missing on disk → **BLOCK**
|
|
32
|
+
- `null`(未判定)→ **BLOCK**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> arch_design_decision "<required|skipped>"
|
|
36
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> arch_design_reason "<reason>"
|
|
37
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> arch_design_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
38
|
+
# if required:
|
|
39
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> arch_design_artifacts "architecture/architecture.md,architecture/database.md,architecture/api.md"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门。
|
|
43
|
+
|
|
44
|
+
## Route to spec-writer
|
|
45
|
+
Guard: `npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime guard check <dir> exploring specifying --json` → fail = BLOCK.
|
|
46
|
+
**arch_design_decision must not be null** → fail = BLOCK(architecture-design gate not passed,v0.9 §26)。
|
|
47
|
+
User knows what they want, artifacts missing/incomplete.
|
|
48
|
+
|
|
49
|
+
## Route to contract-builder
|
|
50
|
+
Guard: `... check <dir> specifying bridging --json` → fail = BLOCK.
|
|
51
|
+
Artifacts exist, implementation requested, contract missing/stale. Include DP-3: 契约批准.
|
|
52
|
+
|
|
53
|
+
## Route to build-executor
|
|
54
|
+
Contract exists and approved, contract matches artifacts. Include DP-4: 执行模式选择.
|
|
55
|
+
|
|
56
|
+
Propose waves, run:
|
|
57
|
+
```bash
|
|
58
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf execution recommend <change-dir> [--wave ...]
|
|
59
|
+
```
|
|
60
|
+
Show every available mode plus evidence and recommendation, obtain clear selection. Then:
|
|
61
|
+
```bash
|
|
62
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf execution plan <change-dir> --mode <selected> --confirm ...
|
|
63
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf execution show <change-dir> --json
|
|
64
|
+
```
|
|
65
|
+
Do not transition to `executing` until `show` reports `current: true`.
|
|
66
|
+
Guard: `... check <dir> approved-for-build executing --json` → fail = BLOCK.
|
|
67
|
+
|
|
68
|
+
## Route to bug-investigator
|
|
69
|
+
Execution hit blockage: test failure, unexpected behavior, build error. After debugging, route back to build-executor.
|
|
70
|
+
|
|
71
|
+
## Route to code-reviewer
|
|
72
|
+
Current planned wave implemented and ready for review. Reviewer must write:
|
|
73
|
+
```bash
|
|
74
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf execution review <change-dir> --wave <id> --base <sha> --head <sha> --report <path> --verdict <pass|fail>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Route to release-archivist
|
|
78
|
+
Guard: `... check <dir> executing closing --json` → fail = BLOCK. Include DP-7: 归档确认.
|
|
79
|
+
|
|
80
|
+
## Route to spec-merger
|
|
81
|
+
Delta specs exist that need merging, change closing with ADDED/MODIFIED/REMOVED/RENAMED specs.
|
|
82
|
+
|
|
83
|
+
## Route to abandoned
|
|
84
|
+
User explicitly requests, bug-investigator escalates after 3+ failures AND user chooses, scope change makes change no longer worthwhile AND user confirms. Block from `closing` or `abandoned`.
|
|
85
|
+
|
|
86
|
+
## Fast-Path Routing
|
|
87
|
+
|
|
88
|
+
- **Hotfix**: Route to contract-builder (minimal), skip need-explorer + spec-writer, guard check `exploring bridging --workflow hotfix`, then `bridging -> approved-for-build`, after DP-3 → build-executor, after → release-archivist (lightweight).
|
|
89
|
+
- **Tweak**: Route to build-executor (direct edit), skip need-explorer + spec-writer + contract-builder, guard check `exploring approved-for-build --workflow tweak`, after → release-archivist (lightweight).
|
|
90
|
+
- **architecture-design 不豁免**(v0.9 §26):hotfix / tweak 同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。
|
|
91
|
+
|
|
92
|
+
## Optional Prototype Handoff
|
|
93
|
+
|
|
94
|
+
When the user's brief explicitly contains UI/screen/interaction/layout/UX uncertainty, ask once whether a prototype would reduce uncertainty. After confirmation:
|
|
95
|
+
```bash
|
|
96
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf handoff create <change-dir> \
|
|
97
|
+
--type prototype --objective "<confirmed objective>" \
|
|
98
|
+
--expected-output "<expected evidence>" --acceptance "<completion criterion>"
|
|
99
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf isolate <change-dir> prototype-<handoff-id>
|
|
100
|
+
```
|
|
101
|
+
Never suggest for backend/CLI/config/internal-refactor work. Never pass `--force`.
|
|
102
|
+
|
|
103
|
+
## DP-0: User Confirmation Gate
|
|
104
|
+
|
|
105
|
+
Run when: change folder doesn't exist, planning artifacts missing/empty, or `dp_0_confirmed` ≠ `true`.
|
|
106
|
+
|
|
107
|
+
**Upstream Inheritance (v0.9)**:主信号 = `change-brief.md` 是否存在(非 yaml 字段)。
|
|
108
|
+
|
|
109
|
+
判定伪代码:
|
|
110
|
+
```
|
|
111
|
+
brief = read(<change-dir>/change-brief.md)
|
|
112
|
+
if brief 存在 and brief.upstream_source == "orchestrator":
|
|
113
|
+
# 编排分发:继承但允许修正(DP-0 仍执行,从"从零问"改为"一次确认继承或修正")
|
|
114
|
+
defaults = { name: brief.upstream_change_id/<dir basename>,
|
|
115
|
+
intent: brief.Scope,
|
|
116
|
+
constraints: brief.约束,
|
|
117
|
+
AC: brief.AC 列表 }
|
|
118
|
+
问用户(一次): "本 change 由 orchestrator 分发,继承意图/约束/AC 如下 {…}。
|
|
119
|
+
[A] 继承并开始 [B] 我要修正(逐项覆盖 defaults)"
|
|
120
|
+
# 绝不重新问"你想做什么"——那是手动路径的问题
|
|
121
|
+
else:
|
|
122
|
+
# 手动新建 / hotfix / 单 change 快速通道 / 存量 change(均无 brief)→ 照常 DP-0
|
|
123
|
+
问用户(原题): change name + 一句话意图 + 已知约束
|
|
124
|
+
+ 相关优化(纳入还是聚焦) + 沟通偏好
|
|
125
|
+
两分支最终都写 dp_0_confirmed=true(命令见下)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
- **为何以 brief 存在为主信号**:hotfix / 单 change 快速通道也是 orchestrator 创建的 change,但不产 brief;以 brief 存在为信号可天然排除这两条路径,且对存量手动 change(无 brief)零误伤。
|
|
129
|
+
- **双源权威**:继承的 scope/AC 若与 `prd/vN/plan.md` 冲突,以 plan.md 为准(brief 是 S4 时刻快照,非真相源);冲突时触发 Brief drift 提示(见「Staleness Detection」)。
|
|
130
|
+
|
|
131
|
+
After confirmation:
|
|
132
|
+
```bash
|
|
133
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_decisions "<summary>"
|
|
134
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_result confirmed
|
|
135
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_confirmed true
|
|
136
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf state set <change-dir> dp_0_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Mode Detection
|
|
140
|
+
|
|
141
|
+
If workflow is `auto`/`null`/unset:
|
|
142
|
+
```bash
|
|
143
|
+
npx --yes --package @xulthekl/team-flow@0.22.4 tf runtime infer <change-dir>
|
|
144
|
+
```
|
|
145
|
+
Inference: **hotfix** (≤2 tasks, ≤2 files, no schema/API/new modules), **tweak** (≤4 tasks, config/doc only), **full** (anything larger).
|
|
146
|
+
|
|
147
|
+
## Staleness Detection
|
|
148
|
+
|
|
149
|
+
- **Stale contract**: proposal scope expanded beyond contract scope fence → route to contract-builder
|
|
150
|
+
- **Stale planning artifacts**: capability in proposal has no spec file, or vice versa → drift detected
|
|
151
|
+
- **Stale tasks**: requirement in specs has no corresponding task → stale tasks
|
|
152
|
+
- **Brief drift (advisory, v0.9)**: change-brief.md 的 `plan_hash` 与当前 plan.md 不一致 → 提示回 orchestrator 重新分发;**不**阻断、**不**进 artifacts_hash、**不**混入上述三条产物互查
|
|
153
|
+
|
|
154
|
+
## Post-transition
|
|
155
|
+
💡 `npx --yes --package @xulthekl/team-flow@0.22.4 tf inject <change-dir>` to update phase-guard artifacts.
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { Scenario, Requirement } from './schema/base.js';
|
|
2
|
+
export type { DeltaOperationType, Rename, Delta, Change } from './schema/change.js';
|
|
3
|
+
export type { Spec } from './schema/spec.js';
|
|
4
|
+
|
|
5
|
+
export type { ValidationLevel, ValidationIssue, ValidationReport } from './validation/types.js';
|
|
6
|
+
export type { VerificationDimension, VerificationStatus, VerificationFinding, VerificationReport } from './validation/types.js';
|
|
7
|
+
export type { ConflictReport, SyncConflict } from './validation/types.js';
|
|
8
|
+
export { VALIDATION_MESSAGES, MIN_WHY_SECTION_LENGTH, MIN_PURPOSE_LENGTH, MAX_WHY_SECTION_LENGTH, MAX_REQUIREMENT_TEXT_LENGTH, MAX_DELTAS_PER_CHANGE, VERIFICATION_DIMENSIONS, VERIFICATION_MESSAGES, MIN_ABANDONMENT_REASON_LENGTH } from './validation/constants.js';
|
|
9
|
+
export { Validator } from './validation/validator.js';
|
|
10
|
+
|
|
11
|
+
export type { RequirementBlock, RequirementsSectionParts, DeltaPlan } from './parsing/requirement-blocks.js';
|
|
12
|
+
export { REQUIREMENT_HEADER_REGEX, normalizeRequirementName, extractRequirementsSection, parseDeltaSpec } from './parsing/requirement-blocks.js';
|
|
13
|
+
export type { ParsedDelta, ParsedChange } from './parsing/change-parser.js';
|
|
14
|
+
export { parseChangeMarkdown } from './parsing/change-parser.js';
|
|
15
|
+
|
|
16
|
+
export { tokenize, detectLanguage } from './validation/tokenizer.js';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface ParsedDelta {
|
|
2
|
+
spec: string;
|
|
3
|
+
operation: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ParsedChange {
|
|
8
|
+
name: string;
|
|
9
|
+
why: string;
|
|
10
|
+
whatChanges: string;
|
|
11
|
+
deltas: ParsedDelta[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function normalizeLineEndings(content: string): string {
|
|
15
|
+
return content.replace(/\r\n?/g, '\n');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function extractSection(content: string, heading: string): string {
|
|
19
|
+
const normalized = normalizeLineEndings(content);
|
|
20
|
+
const lines = normalized.split('\n');
|
|
21
|
+
// Match headings that contain the English keyword — supports both
|
|
22
|
+
// "## Why" and "## 背景(Why)" style bilingual headings.
|
|
23
|
+
const headingRegex = new RegExp(
|
|
24
|
+
`^##\\s+.*\\b${heading.replace(/\s+/g, '\\s+')}\\b.*$`,
|
|
25
|
+
'i'
|
|
26
|
+
);
|
|
27
|
+
const idx = lines.findIndex((l) => headingRegex.test(l));
|
|
28
|
+
if (idx === -1) return '';
|
|
29
|
+
|
|
30
|
+
let endIdx = lines.length;
|
|
31
|
+
for (let i = idx + 1; i < lines.length; i++) {
|
|
32
|
+
if (/^##\s+/.test(lines[i])) {
|
|
33
|
+
endIdx = i;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return lines.slice(idx + 1, endIdx).join('\n').trim();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function parseChangeMarkdown(
|
|
42
|
+
content: string,
|
|
43
|
+
changeName: string
|
|
44
|
+
): ParsedChange {
|
|
45
|
+
const why = extractSection(content, 'Why');
|
|
46
|
+
const whatChanges = extractSection(content, 'What Changes');
|
|
47
|
+
|
|
48
|
+
const deltas: ParsedDelta[] = [];
|
|
49
|
+
|
|
50
|
+
const deltaSectionRegex =
|
|
51
|
+
/^##\s+(ADDED|MODIFIED|REMOVED|RENAMED)\s+Requirements\s*$/im;
|
|
52
|
+
|
|
53
|
+
const sections = content.split(/(?=^##\s)/m);
|
|
54
|
+
for (const section of sections) {
|
|
55
|
+
const match = section.match(deltaSectionRegex);
|
|
56
|
+
if (match) {
|
|
57
|
+
const operation = match[1].toUpperCase();
|
|
58
|
+
const body = section.substring(match[0].length).trim();
|
|
59
|
+
const descLines: string[] = [];
|
|
60
|
+
for (const line of body.split('\n')) {
|
|
61
|
+
if (/^###\s+/.test(line)) break;
|
|
62
|
+
const trimmed = line.trim();
|
|
63
|
+
if (trimmed) descLines.push(trimmed);
|
|
64
|
+
}
|
|
65
|
+
deltas.push({
|
|
66
|
+
spec: '',
|
|
67
|
+
operation,
|
|
68
|
+
description: descLines.join('\n'),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
name: changeName,
|
|
75
|
+
why,
|
|
76
|
+
whatChanges,
|
|
77
|
+
deltas,
|
|
78
|
+
};
|
|
79
|
+
}
|