@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,328 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# ============================================================================
|
|
3
|
+
# recon-probe.sh — 确定性代码库质量探查脚本(workflow-bootstrap B1)
|
|
4
|
+
#
|
|
5
|
+
# 用途
|
|
6
|
+
# 对既有代码库做"固定化、可复现"的机械采集:目录树 / 依赖清单 / LOC 与文件
|
|
7
|
+
# 类型分布 / 测试文件计数 / DB 迁移清单 / README-docs 探测。
|
|
8
|
+
# 本脚本只做**确定性机械采集**(设计文档 v0.8 §17.8 第四类载体)——同项目两次
|
|
9
|
+
# 运行结果一致,可横展对比。语义判断(架构模式 / 聚合根推断 / 框架定性)交给
|
|
10
|
+
# 消费本脚本 JSON 输出的侦察子代理(codebase-recon-analyst)完成。
|
|
11
|
+
#
|
|
12
|
+
# 映射
|
|
13
|
+
# 本脚本是未来 `tf recon` CLI 的底层实现雏形:
|
|
14
|
+
# tf recon [--root <path>] [--out <json>]
|
|
15
|
+
# 现阶段以独立 bash 脚本形态供 workflow-bootstrap 调用,后续原样并入 CLI。
|
|
16
|
+
#
|
|
17
|
+
# 用法
|
|
18
|
+
# recon-probe.sh [--root <path>] [--out <json>]
|
|
19
|
+
# --root <path> 探查根目录(默认当前目录)
|
|
20
|
+
# --out <json> JSON 输出文件(默认写到 stdout)
|
|
21
|
+
#
|
|
22
|
+
# 输出
|
|
23
|
+
# - 结构化 JSON → --out 指定文件或 stdout(供侦察子代理消费)
|
|
24
|
+
# - 人类可读摘要 → stderr(永远输出)
|
|
25
|
+
#
|
|
26
|
+
# 依赖
|
|
27
|
+
# 纯 bash + 常见 unix 工具(find / grep / sed / awk / wc / sort / uniq)。
|
|
28
|
+
# jq **可选**:有 jq 时美化 JSON;无 jq 时输出脚本自建的合法 JSON(降级为文本)。
|
|
29
|
+
# 健壮性:root 不存在不报错(输出最小 JSON + 提示),采集命令失败以 0/空兜底。
|
|
30
|
+
# ============================================================================
|
|
31
|
+
|
|
32
|
+
set -u # 未定义变量报错;不用 -e(单条采集失败不应中断整体),逐处 || true 兜底
|
|
33
|
+
|
|
34
|
+
# ----------------------------------------------------------------------------
|
|
35
|
+
# 默认参数
|
|
36
|
+
# ----------------------------------------------------------------------------
|
|
37
|
+
ROOT="."
|
|
38
|
+
OUT=""
|
|
39
|
+
MAX_FILES=50000 # LOC 统计文件数上限(保护超大仓库)
|
|
40
|
+
TREE_DEPTH=4 # 目录树限深
|
|
41
|
+
|
|
42
|
+
# ----------------------------------------------------------------------------
|
|
43
|
+
# 参数解析
|
|
44
|
+
# ----------------------------------------------------------------------------
|
|
45
|
+
print_help() {
|
|
46
|
+
sed -n '2,30p' "$0" 2>/dev/null | sed 's/^# \{0,1\}//'
|
|
47
|
+
}
|
|
48
|
+
while [ $# -gt 0 ]; do
|
|
49
|
+
case "$1" in
|
|
50
|
+
--root) ROOT="${2:-.}"; shift 2 ;;
|
|
51
|
+
--root=*) ROOT="${1#*=}"; shift ;;
|
|
52
|
+
--out) OUT="${2:-}"; shift 2 ;;
|
|
53
|
+
--out=*) OUT="${1#*=}"; shift ;;
|
|
54
|
+
-h|--help) print_help; exit 0 ;;
|
|
55
|
+
*) echo "[recon-probe] warn: unknown arg '$1' (ignored)" >&2; shift ;;
|
|
56
|
+
esac
|
|
57
|
+
done
|
|
58
|
+
|
|
59
|
+
# ----------------------------------------------------------------------------
|
|
60
|
+
# 临时目录 + 清理
|
|
61
|
+
# ----------------------------------------------------------------------------
|
|
62
|
+
TMP="$(mktemp -d 2>/dev/null || echo "/tmp/recon-probe.$$")"
|
|
63
|
+
mkdir -p "$TMP" 2>/dev/null
|
|
64
|
+
trap 'rm -rf "$TMP" 2>/dev/null' EXIT
|
|
65
|
+
|
|
66
|
+
# ----------------------------------------------------------------------------
|
|
67
|
+
# JSON 辅助函数
|
|
68
|
+
# ----------------------------------------------------------------------------
|
|
69
|
+
# 转义字符串为合法 JSON 字符串内容(处理 \ " 及控制字符)
|
|
70
|
+
json_escape() {
|
|
71
|
+
printf '%s' "$1" \
|
|
72
|
+
| sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/\t/\\t/g' -e 's/\r//g' \
|
|
73
|
+
| tr '\n' ' '
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# 从"每行一个 item"的文件构建 JSON 字符串数组(确定性:调用方已 sort)
|
|
77
|
+
json_array_from_file() {
|
|
78
|
+
_f="$1"
|
|
79
|
+
if [ ! -s "$_f" ]; then printf '[]'; return; fi
|
|
80
|
+
printf '['
|
|
81
|
+
_first=1
|
|
82
|
+
while IFS= read -r _line; do
|
|
83
|
+
[ -z "$_line" ] && continue
|
|
84
|
+
[ "$_first" -eq 1 ] && _first=0 || printf ','
|
|
85
|
+
printf '"%s"' "$(json_escape "$_line")"
|
|
86
|
+
done < "$_f"
|
|
87
|
+
printf ']'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
# ----------------------------------------------------------------------------
|
|
91
|
+
# root 健壮性处理
|
|
92
|
+
# ----------------------------------------------------------------------------
|
|
93
|
+
if [ ! -d "$ROOT" ]; then
|
|
94
|
+
echo "[recon-probe] warn: root '$ROOT' not found or not a directory" >&2
|
|
95
|
+
MIN_JSON='{"schema_version":1,"error":"root_not_found","root":"'"$(json_escape "$ROOT")"'"}'
|
|
96
|
+
if [ -n "$OUT" ]; then printf '%s\n' "$MIN_JSON" > "$OUT"; else printf '%s\n' "$MIN_JSON"; fi
|
|
97
|
+
exit 0
|
|
98
|
+
fi
|
|
99
|
+
ROOT_ABS="$(cd "$ROOT" 2>/dev/null && pwd)" || ROOT_ABS="$ROOT"
|
|
100
|
+
|
|
101
|
+
# 噪音目录剪枝:包装 find,排除 .git/node_modules/构建产物等
|
|
102
|
+
pruned_find() {
|
|
103
|
+
find "$ROOT_ABS" \
|
|
104
|
+
\( -type d \( \
|
|
105
|
+
-name .git -o -name node_modules -o -name target -o -name build \
|
|
106
|
+
-o -name dist -o -name out -o -name vendor -o -name .venv \
|
|
107
|
+
-o -name venv -o -name __pycache__ -o -name .idea -o -name .gradle \
|
|
108
|
+
-o -name coverage -o -name .next -o -name .turbo \
|
|
109
|
+
\) -prune \) -o "$@" 2>/dev/null
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
GENERATED_AT="$(date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || echo unknown)"
|
|
113
|
+
|
|
114
|
+
# ============================================================================
|
|
115
|
+
# ① 目录树(限深 TREE_DEPTH 层,相对路径,确定性排序)
|
|
116
|
+
# ============================================================================
|
|
117
|
+
find "$ROOT_ABS" -maxdepth "$TREE_DEPTH" \
|
|
118
|
+
\( -type d \( -name .git -o -name node_modules -o -name target -o -name build \
|
|
119
|
+
-o -name dist -o -name vendor -o -name .venv -o -name venv \
|
|
120
|
+
-o -name __pycache__ -o -name .idea -o -name .gradle \) -prune \) \
|
|
121
|
+
-o -type d -print 2>/dev/null \
|
|
122
|
+
| sed "s#^$ROOT_ABS/##; s#^$ROOT_ABS#.#" \
|
|
123
|
+
| sort > "$TMP/dirs.txt"
|
|
124
|
+
DIR_COUNT=$(wc -l < "$TMP/dirs.txt" | tr -d ' ')
|
|
125
|
+
|
|
126
|
+
# ============================================================================
|
|
127
|
+
# ② 依赖清单(探测常见 manifest,机械提取依赖)
|
|
128
|
+
# ============================================================================
|
|
129
|
+
: > "$TMP/dep_manifests.json"
|
|
130
|
+
add_manifest() {
|
|
131
|
+
# $1=file(rel) $2=type $3=deps-file(每行一个依赖)
|
|
132
|
+
_rel="$1"; _type="$2"; _deps="$3"
|
|
133
|
+
_arr="$(json_array_from_file "$_deps")"
|
|
134
|
+
printf '{"file":"%s","type":"%s","deps":%s},' \
|
|
135
|
+
"$(json_escape "$_rel")" "$(json_escape "$_type")" "$_arr" >> "$TMP/dep_manifests.json"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# 查找所有 manifest(相对路径),逐个解析
|
|
139
|
+
pruned_find -type f \
|
|
140
|
+
\( -name pom.xml -o -name package.json -o -name requirements.txt \
|
|
141
|
+
-o -name go.mod -o -name build.gradle -o -name build.gradle.kts \
|
|
142
|
+
-o -name Gemfile -o -name Cargo.toml -o -name pyproject.toml \) \
|
|
143
|
+
-print 2>/dev/null | sort | while IFS= read -r mf; do
|
|
144
|
+
rel="${mf#"$ROOT_ABS"/}"
|
|
145
|
+
base="$(basename "$mf")"
|
|
146
|
+
deps_file="$TMP/deps_$(echo "$rel" | tr '/' '_').txt"
|
|
147
|
+
: > "$deps_file"
|
|
148
|
+
case "$base" in
|
|
149
|
+
pom.xml)
|
|
150
|
+
grep -oE '<artifactId>[^<]+</artifactId>' "$mf" 2>/dev/null \
|
|
151
|
+
| sed -E 's#</?artifactId>##g' | sort -u > "$deps_file" ;;
|
|
152
|
+
package.json)
|
|
153
|
+
grep -oE '"[@A-Za-z0-9/_-]+"[[:space:]]*:[[:space:]]*"[^"]+"' "$mf" 2>/dev/null \
|
|
154
|
+
| sed -E 's/[[:space:]]*:[[:space:]]*/@/; s/"//g' | sort -u > "$deps_file" ;;
|
|
155
|
+
requirements.txt)
|
|
156
|
+
grep -vE '^[[:space:]]*(#|$)' "$mf" 2>/dev/null \
|
|
157
|
+
| sed -E 's/[[:space:]]+$//' | sort -u > "$deps_file" ;;
|
|
158
|
+
go.mod)
|
|
159
|
+
sed -n '/require/,/)/p' "$mf" 2>/dev/null \
|
|
160
|
+
| grep -oE '[A-Za-z0-9./_-]+/[A-Za-z0-9./_-]+ v[0-9][^ ]*' \
|
|
161
|
+
| sort -u > "$deps_file" ;;
|
|
162
|
+
build.gradle|build.gradle.kts)
|
|
163
|
+
grep -E '(implementation|api|compile|testImplementation)[[:space:]]*[( ]' "$mf" 2>/dev/null \
|
|
164
|
+
| grep -oE "['\"][^'\"]+:[^'\"]+:[^'\"]+['\"]" \
|
|
165
|
+
| sed -E "s/['\"]//g" | sort -u > "$deps_file" ;;
|
|
166
|
+
Gemfile)
|
|
167
|
+
grep -E "^[[:space:]]*gem " "$mf" 2>/dev/null \
|
|
168
|
+
| sed -E "s/^[[:space:]]*gem ['\"]//; s/['\"].*//" | sort -u > "$deps_file" ;;
|
|
169
|
+
Cargo.toml)
|
|
170
|
+
sed -n '/\[dependencies\]/,/^\[/p' "$mf" 2>/dev/null \
|
|
171
|
+
| grep -E '^[A-Za-z0-9_-]+[[:space:]]*=' \
|
|
172
|
+
| sed -E 's/[[:space:]]*=.*//' | sort -u > "$deps_file" ;;
|
|
173
|
+
pyproject.toml)
|
|
174
|
+
sed -n '/dependencies/,/\]/p' "$mf" 2>/dev/null \
|
|
175
|
+
| grep -oE '"[A-Za-z0-9._-]+[^"]*"' \
|
|
176
|
+
| sed -E 's/"//g' | sort -u > "$deps_file" ;;
|
|
177
|
+
esac
|
|
178
|
+
# 限制每个 manifest 提取条数,避免 JSON 过大
|
|
179
|
+
head -n 200 "$deps_file" > "$deps_file.cut" 2>/dev/null && mv "$deps_file.cut" "$deps_file"
|
|
180
|
+
add_manifest "$rel" "$base" "$deps_file"
|
|
181
|
+
done
|
|
182
|
+
# 去掉尾逗号
|
|
183
|
+
MANIFESTS_JSON="$(sed 's/,$//' "$TMP/dep_manifests.json" 2>/dev/null)"
|
|
184
|
+
[ -z "$MANIFESTS_JSON" ] && MANIFESTS_JSON=""
|
|
185
|
+
|
|
186
|
+
# ============================================================================
|
|
187
|
+
# ③ LOC 与文件类型分布(按扩展名统计;逐个 wc,避开 bash 关联数组以兼容 bash 3.2)
|
|
188
|
+
# ============================================================================
|
|
189
|
+
# 生成 "ext<TAB>lines" 对
|
|
190
|
+
# 注意:不用 `head -z`(macOS BSD head 不支持 -z,会断管);改用 while 内部计数 + break
|
|
191
|
+
# 限制文件数(MAX_FILES)。sort -z 提供确定性顺序(BSD/GNU sort 均支持)。
|
|
192
|
+
pruned_find -type f -print0 2>/dev/null \
|
|
193
|
+
| sort -z 2>/dev/null \
|
|
194
|
+
| while IFS= read -r -d '' f; do
|
|
195
|
+
_n=$(( ${_n:-0} + 1 ))
|
|
196
|
+
[ "$_n" -gt "$MAX_FILES" ] && break
|
|
197
|
+
name="$(basename "$f")"
|
|
198
|
+
case "$name" in
|
|
199
|
+
*.*) ext="${name##*.}" ;;
|
|
200
|
+
*) ext="(none)" ;;
|
|
201
|
+
esac
|
|
202
|
+
lines="$(wc -l < "$f" 2>/dev/null | tr -d ' ')"
|
|
203
|
+
[ -z "$lines" ] && lines=0
|
|
204
|
+
printf '%s\t%s\n' "$ext" "$lines"
|
|
205
|
+
done > "$TMP/ext_lines.tsv"
|
|
206
|
+
|
|
207
|
+
# awk 聚合(awk 关联数组无 bash 版本问题)
|
|
208
|
+
awk -F'\t' '
|
|
209
|
+
{ files[$1]++; loc[$1]+=$2; tf++; tl+=$2 }
|
|
210
|
+
END {
|
|
211
|
+
printf "%d\t%d\n", tf, tl > "'"$TMP"'/_totals.tsv";
|
|
212
|
+
for (e in files) printf "%s\t%d\t%d\n", e, files[e], loc[e];
|
|
213
|
+
}
|
|
214
|
+
' "$TMP/ext_lines.tsv" 2>/dev/null | sort -t"$(printf '\t')" -k2,2nr > "$TMP/ext_stats.tsv"
|
|
215
|
+
|
|
216
|
+
TOTAL_FILES="$(cut -f1 "$TMP/_totals.tsv" 2>/dev/null | head -1)"; TOTAL_FILES="${TOTAL_FILES:-0}"
|
|
217
|
+
TOTAL_LINES="$(cut -f2 "$TMP/_totals.tsv" 2>/dev/null | head -1)"; TOTAL_LINES="${TOTAL_LINES:-0}"
|
|
218
|
+
|
|
219
|
+
# 构建 by_extension JSON 数组
|
|
220
|
+
: > "$TMP/byext.json"
|
|
221
|
+
while IFS="$(printf '\t')" read -r ext fcnt lcnt; do
|
|
222
|
+
[ -z "$ext" ] && continue
|
|
223
|
+
printf '{"ext":"%s","files":%s,"lines":%s},' \
|
|
224
|
+
"$(json_escape "$ext")" "${fcnt:-0}" "${lcnt:-0}" >> "$TMP/byext.json"
|
|
225
|
+
done < "$TMP/ext_stats.tsv"
|
|
226
|
+
BYEXT_JSON="$(sed 's/,$//' "$TMP/byext.json" 2>/dev/null)"
|
|
227
|
+
|
|
228
|
+
# ============================================================================
|
|
229
|
+
# ④ 测试文件计数(test/spec 目录 + 命名约定)
|
|
230
|
+
# ============================================================================
|
|
231
|
+
pruned_find -type f \
|
|
232
|
+
\( -name '*Test.java' -o -name '*Tests.java' -o -name '*_test.go' \
|
|
233
|
+
-o -name '*.test.ts' -o -name '*.test.tsx' -o -name '*.test.js' -o -name '*.test.mjs' \
|
|
234
|
+
-o -name '*.spec.ts' -o -name '*.spec.tsx' -o -name '*.spec.js' -o -name '*.spec.mjs' \
|
|
235
|
+
-o -name 'test_*.py' -o -name '*_test.py' -o -name '*_spec.rb' \
|
|
236
|
+
-o -name '*Test.kt' -o -name '*Spec.scala' \) \
|
|
237
|
+
-print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/test_files.txt"
|
|
238
|
+
TEST_FILE_COUNT=$(wc -l < "$TMP/test_files.txt" | tr -d ' ')
|
|
239
|
+
|
|
240
|
+
# 测试目录
|
|
241
|
+
pruned_find -type d \( -name test -o -name tests -o -name spec -o -name __tests__ -o -name __test__ \) \
|
|
242
|
+
-print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/test_dirs.txt"
|
|
243
|
+
head -n 20 "$TMP/test_files.txt" > "$TMP/test_samples.txt" 2>/dev/null
|
|
244
|
+
|
|
245
|
+
# ============================================================================
|
|
246
|
+
# ⑤ DB 迁移文件清单(db/migration 目录 + *.sql)
|
|
247
|
+
# ============================================================================
|
|
248
|
+
pruned_find -type f -name '*.sql' -print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/sql_files.txt"
|
|
249
|
+
pruned_find -type d \( -name migration -o -name migrations -o -name migrate -o -name db \) \
|
|
250
|
+
-print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/migration_dirs.txt"
|
|
251
|
+
SQL_COUNT=$(wc -l < "$TMP/sql_files.txt" | tr -d ' ')
|
|
252
|
+
head -n 50 "$TMP/sql_files.txt" > "$TMP/sql_samples.txt" 2>/dev/null
|
|
253
|
+
|
|
254
|
+
# ============================================================================
|
|
255
|
+
# ⑥ README / docs 探测
|
|
256
|
+
# ============================================================================
|
|
257
|
+
pruned_find -maxdepth 2 -type f \
|
|
258
|
+
\( -iname 'README*' -o -iname 'ARCHITECTURE*' -o -iname 'CONTRIBUTING*' \
|
|
259
|
+
-o -iname 'CHANGELOG*' -o -iname 'CLAUDE.md' -o -iname 'AGENTS.md' \) \
|
|
260
|
+
-print 2>/dev/null | sed "s#^$ROOT_ABS/##" | sort > "$TMP/doc_files.txt"
|
|
261
|
+
if [ -d "$ROOT_ABS/docs" ]; then DOCS_DIR=true; else DOCS_DIR=false; fi
|
|
262
|
+
|
|
263
|
+
# ============================================================================
|
|
264
|
+
# 组装 JSON
|
|
265
|
+
# ============================================================================
|
|
266
|
+
{
|
|
267
|
+
printf '{\n'
|
|
268
|
+
printf ' "schema_version": 1,\n'
|
|
269
|
+
printf ' "tool": "recon-probe.sh (future: tf recon)",\n'
|
|
270
|
+
printf ' "root": "%s",\n' "$(json_escape "$ROOT_ABS")"
|
|
271
|
+
printf ' "generated_at": "%s",\n' "$GENERATED_AT"
|
|
272
|
+
# ① 目录树
|
|
273
|
+
printf ' "directory_tree": {"max_depth": %d, "dir_count": %s, "dirs": %s},\n' \
|
|
274
|
+
"$TREE_DEPTH" "$DIR_COUNT" "$(json_array_from_file "$TMP/dirs.txt")"
|
|
275
|
+
# ② 依赖清单
|
|
276
|
+
printf ' "dependencies": {"manifests": [%s]},\n' "$MANIFESTS_JSON"
|
|
277
|
+
# ③ LOC 与文件类型分布
|
|
278
|
+
printf ' "loc": {"total_files": %s, "total_lines": %s, "max_files_cap": %d, "by_extension": [%s]},\n' \
|
|
279
|
+
"$TOTAL_FILES" "$TOTAL_LINES" "$MAX_FILES" "$BYEXT_JSON"
|
|
280
|
+
# ④ 测试
|
|
281
|
+
printf ' "tests": {"test_file_count": %s, "test_dirs": %s, "sample_files": %s},\n' \
|
|
282
|
+
"$TEST_FILE_COUNT" \
|
|
283
|
+
"$(json_array_from_file "$TMP/test_dirs.txt")" \
|
|
284
|
+
"$(json_array_from_file "$TMP/test_samples.txt")"
|
|
285
|
+
# ⑤ DB 迁移
|
|
286
|
+
printf ' "db_migrations": {"sql_count": %s, "migration_dirs": %s, "sample_files": %s},\n' \
|
|
287
|
+
"$SQL_COUNT" \
|
|
288
|
+
"$(json_array_from_file "$TMP/migration_dirs.txt")" \
|
|
289
|
+
"$(json_array_from_file "$TMP/sql_samples.txt")"
|
|
290
|
+
# ⑥ docs
|
|
291
|
+
printf ' "docs": {"docs_dir": %s, "doc_files": %s}\n' \
|
|
292
|
+
"$DOCS_DIR" "$(json_array_from_file "$TMP/doc_files.txt")"
|
|
293
|
+
printf '}\n'
|
|
294
|
+
} > "$TMP/out.json"
|
|
295
|
+
|
|
296
|
+
# ============================================================================
|
|
297
|
+
# 输出:JSON(--out 或 stdout,jq 可选美化)+ 人类可读摘要(stderr)
|
|
298
|
+
# ============================================================================
|
|
299
|
+
emit_json() {
|
|
300
|
+
if command -v jq >/dev/null 2>&1; then
|
|
301
|
+
jq '.' "$TMP/out.json" 2>/dev/null || cat "$TMP/out.json"
|
|
302
|
+
else
|
|
303
|
+
# 无 jq:降级为脚本自建的合法 JSON 文本
|
|
304
|
+
cat "$TMP/out.json"
|
|
305
|
+
fi
|
|
306
|
+
}
|
|
307
|
+
if [ -n "$OUT" ]; then
|
|
308
|
+
emit_json > "$OUT"
|
|
309
|
+
echo "[recon-probe] JSON written to: $OUT" >&2
|
|
310
|
+
else
|
|
311
|
+
emit_json
|
|
312
|
+
fi
|
|
313
|
+
|
|
314
|
+
# 人类可读摘要 → stderr
|
|
315
|
+
{
|
|
316
|
+
echo "================ recon-probe 摘要 ================"
|
|
317
|
+
echo "root : $ROOT_ABS"
|
|
318
|
+
echo "目录(≤${TREE_DEPTH}层) : $DIR_COUNT 个"
|
|
319
|
+
echo "源码文件 : $TOTAL_FILES 个 / $TOTAL_LINES 行 (cap $MAX_FILES)"
|
|
320
|
+
echo "依赖 manifest: $(grep -c '"file"' "$TMP/dep_manifests.json" 2>/dev/null || echo 0) 个"
|
|
321
|
+
echo "测试文件 : $TEST_FILE_COUNT 个"
|
|
322
|
+
echo "SQL 迁移 : $SQL_COUNT 个"
|
|
323
|
+
echo "docs/ 目录 : $DOCS_DIR"
|
|
324
|
+
echo "README 等 : $(wc -l < "$TMP/doc_files.txt" | tr -d ' ') 个"
|
|
325
|
+
echo "================================================="
|
|
326
|
+
} >&2
|
|
327
|
+
|
|
328
|
+
exit 0
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-feedback
|
|
3
|
+
description: >
|
|
4
|
+
记录 team-flow 工作流使用过程中发现的问题和改进建议。
|
|
5
|
+
当 skill 触发不准、SOP 流程不顺、产物质量不符预期、
|
|
6
|
+
交互体验不好时使用;也可在 change 收尾时回顾性触发。
|
|
7
|
+
不适用于:记录业务代码 bug(用 bug-investigator)、
|
|
8
|
+
沉淀已解决问题的经验(用 ce-compound)。
|
|
9
|
+
argument-hint: "[问题简述] [--category <分类>] [--severity <P0-P3>]"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Workflow Feedback
|
|
13
|
+
|
|
14
|
+
记录 team-flow 工作流使用中的问题,转化为可追踪的改进项。
|
|
15
|
+
|
|
16
|
+
> **设计依据**:设计增强方案 v0.8 §21.2(P1-10,v0.16.0)
|
|
17
|
+
> **与 ce-compound 的关系**:ce-compound 是"经验沉淀端"(解决方案→docs/solutions/),workflow-feedback 是"问题发现端"(痛点→结构化记录→待办输入)。
|
|
18
|
+
|
|
19
|
+
## Use This Skill When
|
|
20
|
+
|
|
21
|
+
- skill 触发不准(误触发、不触发、触发域冲突)
|
|
22
|
+
- SOP 流程不顺畅(阶段转换卡壳、路由错误、回退不合理)
|
|
23
|
+
- 产物质量不符预期(格式、内容、校验问题)
|
|
24
|
+
- 交互体验不好(确认过多/过少、信息过载)
|
|
25
|
+
- change 收尾时回顾性触发(release-archivist 联动)
|
|
26
|
+
- 用户主动说"记录问题"、"这个不好用"、"流程有问题"、"工作流反馈"、"流程反馈"
|
|
27
|
+
|
|
28
|
+
**Do NOT use when**:
|
|
29
|
+
- 业务代码 bug → `bug-investigator`
|
|
30
|
+
- 已解决问题的经验沉淀 → `ce-compound`
|
|
31
|
+
- 上下文腐化需要保存会话状态 → `session-handoff`(本 skill 记录问题,不保存上下文)
|
|
32
|
+
- 设计增强方案的重大变更 → 直接修订设计文档
|
|
33
|
+
|
|
34
|
+
## Support Files
|
|
35
|
+
|
|
36
|
+
| 文件 | 用途 | 何时读取 |
|
|
37
|
+
|------|------|---------|
|
|
38
|
+
| `references/feedback-template.md` | 问题记录模板(YAML frontmatter + 正文) | Step 3 记录时 |
|
|
39
|
+
| `references/category-guide.md` | 10 类问题分类定义与示例 | Step 1 分类时 |
|
|
40
|
+
| `references/review-mode.md` | 回顾模式:从会话中自动识别问题信号 | 回顾模式触发时 |
|
|
41
|
+
|
|
42
|
+
**按需读取,勿批量加载。**
|
|
43
|
+
|
|
44
|
+
## Problem Categories
|
|
45
|
+
|
|
46
|
+
> 完整定义与示例见 `references/category-guide.md`,以下为快速分类简表。
|
|
47
|
+
|
|
48
|
+
| 分类 | 说明 | 优化责任方 |
|
|
49
|
+
|------|------|-----------|
|
|
50
|
+
| `skill-trigger` | 触发不准(误触发/不触发/冲突) | skill description + 触发域分层表 |
|
|
51
|
+
| `sop-flow` | 阶段转换、路由、回退不顺 | orchestrator + 设计增强方案 |
|
|
52
|
+
| `artifact-quality` | 产物格式/内容/校验问题 | 对应 skill + 制品契约 |
|
|
53
|
+
| `state-management` | 状态文件不一致、恢复失败 | state-model + CLI |
|
|
54
|
+
| `agent-quality` | subagent 产出质量问题 | agent 定义 + §18.1 |
|
|
55
|
+
| `cli-command` | tf CLI 命令问题 | scripts/ |
|
|
56
|
+
| `ux-interaction` | 交互不流畅、确认过多/过少 | skill 工作流设计 |
|
|
57
|
+
| `performance` | token 消耗过大、响应慢 | skill 拆分/渐进式披露 |
|
|
58
|
+
| `cross-platform` | 跨平台兼容性问题 | 多安装面配置 |
|
|
59
|
+
| `documentation` | 文档不一致、过时、缺失 | 文档维护规范 |
|
|
60
|
+
|
|
61
|
+
## Core Workflow
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
触发 → 1. 问题采集 → 2. 上下文关联 → 3. 结构化记录 → 4. 改进建议
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Step 1:问题采集
|
|
68
|
+
|
|
69
|
+
**主动模式**(用户传入 argument):直接记录用户描述的问题。
|
|
70
|
+
|
|
71
|
+
**回顾模式**(无 argument,或由 release-archivist 联动触发):
|
|
72
|
+
分析当前会话,识别问题信号(详见 `references/review-mode.md`):
|
|
73
|
+
- skill 被调用后用户手动纠正
|
|
74
|
+
- 用户表达不满("不对"、"不是这样"、"重来")
|
|
75
|
+
- 状态回退(mandatory rewind)
|
|
76
|
+
- 多次确认同一事项
|
|
77
|
+
- 工作流中断或跳过
|
|
78
|
+
|
|
79
|
+
### Step 2:上下文关联
|
|
80
|
+
|
|
81
|
+
自动检测并关联:
|
|
82
|
+
- 当前 SOP 阶段(`.team-flow/` yaml)
|
|
83
|
+
- 状态机状态(`.team-flow.yaml`)
|
|
84
|
+
- 涉及的 skill / agent / CLI 命令
|
|
85
|
+
- 涉及的产物路径
|
|
86
|
+
|
|
87
|
+
### Step 3:结构化记录
|
|
88
|
+
|
|
89
|
+
按 `references/feedback-template.md` 格式输出:
|
|
90
|
+
|
|
91
|
+
- **输出路径**:`.team-flow/feedback/<YYYYMMDD-HHmmss>-<category>.md`
|
|
92
|
+
- **Git 跟踪**:feedback/ 目录不加入 .gitignore(改进输入需持久化)
|
|
93
|
+
- **severity 判定**:未指定时根据影响范围自动建议
|
|
94
|
+
|
|
95
|
+
### Step 4:改进建议
|
|
96
|
+
|
|
97
|
+
1. 生成可直接追加到 CLAUDE.md 待办列表的条目(含优先级建议)
|
|
98
|
+
2. 如果问题已有解决方案 → 建议触发 `ce-compound` 沉淀经验
|
|
99
|
+
3. 如果问题涉及 skill description → 建议具体的 description 修改方向
|
|
100
|
+
|
|
101
|
+
## Guardrails
|
|
102
|
+
|
|
103
|
+
1. **不记录业务 bug**:业务代码问题归 bug-investigator,不是工作流问题
|
|
104
|
+
2. **不替代 ce-compound**:已解决问题的经验沉淀归 ce-compound
|
|
105
|
+
3. **不修改代码**:本 skill 只记录问题和建议,不直接修改 skill/agent/脚本
|
|
106
|
+
4. **severity 不虚高**:按实际影响范围判定,不为了引起重视而拔高
|
|
107
|
+
5. **一条一文件**:每个问题独立一个文件,便于追踪和关闭
|
|
108
|
+
|
|
109
|
+
## Output
|
|
110
|
+
|
|
111
|
+
- 问题记录:`.team-flow/feedback/<timestamp>-<category>.md`
|
|
112
|
+
- 终端输出:问题摘要 + 建议待办条目 + 后续建议
|
|
113
|
+
|
|
114
|
+
## Exception Handling
|
|
115
|
+
|
|
116
|
+
| 异常 | 处理 |
|
|
117
|
+
|------|------|
|
|
118
|
+
| 无法判定分类 | 询问用户,或标记为 `documentation`(最宽泛) |
|
|
119
|
+
| 同一问题已存在 | 扫描 `.team-flow/feedback/` 已有文件的 frontmatter category + 标题模糊匹配,提示用户已有记录,询问是否补充而非新建 |
|
|
120
|
+
| `.team-flow/feedback/` 不存在 | 自动创建 |
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# 问题分类指南(10 类)
|
|
2
|
+
|
|
3
|
+
> 本文件定义 workflow-feedback 的问题分类体系。
|
|
4
|
+
> 每个分类对应 team-flow 的实际组件,有明确的优化责任方。
|
|
5
|
+
|
|
6
|
+
## 分类详解
|
|
7
|
+
|
|
8
|
+
### 1. skill-trigger(触发问题)
|
|
9
|
+
|
|
10
|
+
**定义**:skill 的 description 触发条件不准确。
|
|
11
|
+
|
|
12
|
+
**典型表现**:
|
|
13
|
+
- 用户说了某个词,不该触发的 skill 被触发了(误触发)
|
|
14
|
+
- 用户明确需要某 skill,但模型没有识别到(不触发)
|
|
15
|
+
- 两个 skill 的触发词重叠,模型选错了(触发域冲突)
|
|
16
|
+
|
|
17
|
+
**优化责任方**:skill description 文本 + AGENTS.md 触发域分层表
|
|
18
|
+
|
|
19
|
+
**示例**:
|
|
20
|
+
> 用户说"帮我规划一下",触发了 ce-plan 而不是 workflow-orchestrator(产品级需求应走 orchestrator)
|
|
21
|
+
|
|
22
|
+
### 2. sop-flow(流程问题)
|
|
23
|
+
|
|
24
|
+
**定义**:SOP 阶段转换、路由、回退不顺畅。
|
|
25
|
+
|
|
26
|
+
**典型表现**:
|
|
27
|
+
- 阶段转换时卡壳(不知道下一步该做什么)
|
|
28
|
+
- 路由到错误的 skill
|
|
29
|
+
- 回退(mandatory rewind)触发条件不合理
|
|
30
|
+
- S1-S5 之间的衔接不自然
|
|
31
|
+
|
|
32
|
+
**优化责任方**:workflow-orchestrator + 设计增强方案 SOP 章节
|
|
33
|
+
|
|
34
|
+
### 3. artifact-quality(产物质量)
|
|
35
|
+
|
|
36
|
+
**定义**:生成的产物格式、内容、校验不符预期。
|
|
37
|
+
|
|
38
|
+
**典型表现**:
|
|
39
|
+
- PRD 缺少关键章节
|
|
40
|
+
- plan.md 包含了不该有的内容(如接口清单)
|
|
41
|
+
- spec 校验不通过
|
|
42
|
+
- 产物之间的不一致
|
|
43
|
+
|
|
44
|
+
**优化责任方**:对应 skill + 制品契约(artifact-contract.md)
|
|
45
|
+
|
|
46
|
+
### 4. state-management(状态管理)
|
|
47
|
+
|
|
48
|
+
**定义**:状态文件不一致、恢复失败、并发冲突。
|
|
49
|
+
|
|
50
|
+
**典型表现**:
|
|
51
|
+
- `.team-flow/` yaml 与实际产物状态不匹配
|
|
52
|
+
- 跨 session 恢复失败
|
|
53
|
+
- 多需求并行时状态混乱
|
|
54
|
+
|
|
55
|
+
**优化责任方**:state-model 设计 + CLI 脚本
|
|
56
|
+
|
|
57
|
+
### 5. agent-quality(子代理质量)
|
|
58
|
+
|
|
59
|
+
**定义**:subagent 的产出质量不达标。
|
|
60
|
+
|
|
61
|
+
**典型表现**:
|
|
62
|
+
- subagent 返回结构不符合 §18.1 协议
|
|
63
|
+
- subagent 产出内容质量低
|
|
64
|
+
- subagent 没有正确处理阻断/非阻断疑问
|
|
65
|
+
|
|
66
|
+
**优化责任方**:agent 定义文件 + §18.1 交接协议
|
|
67
|
+
|
|
68
|
+
### 6. cli-command(CLI 命令)
|
|
69
|
+
|
|
70
|
+
**定义**:tf CLI 命令的问题。
|
|
71
|
+
|
|
72
|
+
**典型表现**:
|
|
73
|
+
- 命令执行报错
|
|
74
|
+
- 命令输出不符预期
|
|
75
|
+
- 缺少必要的命令
|
|
76
|
+
|
|
77
|
+
**优化责任方**:scripts/ 目录
|
|
78
|
+
|
|
79
|
+
### 7. ux-interaction(交互体验)
|
|
80
|
+
|
|
81
|
+
**定义**:交互不流畅、信息过载、确认过多/过少。
|
|
82
|
+
|
|
83
|
+
**典型表现**:
|
|
84
|
+
- 每个小决策都要确认,打断工作流
|
|
85
|
+
- 一次性输出太多信息,用户无法消化
|
|
86
|
+
- 该确认的时候没确认,直接做了
|
|
87
|
+
|
|
88
|
+
**优化责任方**:skill 工作流设计
|
|
89
|
+
|
|
90
|
+
### 8. performance(性能)
|
|
91
|
+
|
|
92
|
+
**定义**:token 消耗过大、响应慢。
|
|
93
|
+
|
|
94
|
+
**典型表现**:
|
|
95
|
+
- SKILL.md 太长,加载就消耗大量上下文
|
|
96
|
+
- 不必要的重复读取
|
|
97
|
+
- 可以用脚本做的确定性工作用了 LLM
|
|
98
|
+
|
|
99
|
+
**优化责任方**:skill 拆分 / 渐进式披露 / 脚本化
|
|
100
|
+
|
|
101
|
+
### 9. cross-platform(跨平台)
|
|
102
|
+
|
|
103
|
+
**定义**:在不同平台(Claude Code / Codex / Cursor 等)上的兼容性问题。
|
|
104
|
+
|
|
105
|
+
**典型表现**:
|
|
106
|
+
- 某平台不支持的功能被使用
|
|
107
|
+
- 安装面配置不一致
|
|
108
|
+
- 平台特有的限制未处理
|
|
109
|
+
|
|
110
|
+
**优化责任方**:多安装面配置(.claude-plugin/ / .codex-plugin/ 等)
|
|
111
|
+
|
|
112
|
+
### 10. documentation(文档)
|
|
113
|
+
|
|
114
|
+
**定义**:文档不一致、过时、缺失。
|
|
115
|
+
|
|
116
|
+
**典型表现**:
|
|
117
|
+
- AGENTS.md 与实际 skills/ 不一致
|
|
118
|
+
- CLAUDE.md 版本号过时
|
|
119
|
+
- 设计增强方案与实际实现不匹配
|
|
120
|
+
|
|
121
|
+
**优化责任方**:文档维护规范(CLAUDE.md 迭代同步清单)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 问题记录模板
|
|
2
|
+
|
|
3
|
+
> 本文件是 workflow-feedback skill 的结构化记录模板。
|
|
4
|
+
> 设计依据:v0.8 §21.2
|
|
5
|
+
|
|
6
|
+
## YAML Frontmatter
|
|
7
|
+
|
|
8
|
+
```yaml
|
|
9
|
+
---
|
|
10
|
+
type: workflow-feedback
|
|
11
|
+
version: 1
|
|
12
|
+
created_at: <ISO 8601>
|
|
13
|
+
category: <skill-trigger | sop-flow | artifact-quality | state-management | agent-quality | cli-command | ux-interaction | performance | cross-platform | documentation>
|
|
14
|
+
severity: <P0 | P1 | P2 | P3>
|
|
15
|
+
status: open
|
|
16
|
+
related_skill: <skill-name | null>
|
|
17
|
+
related_phase: <S1-S5 | change-level | null>
|
|
18
|
+
related_requirement: <req-id | null>
|
|
19
|
+
---
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Severity 判定标准
|
|
23
|
+
|
|
24
|
+
| 级别 | 标准 | 示例 |
|
|
25
|
+
|------|------|------|
|
|
26
|
+
| P0 | 阻断工作流,无法继续 | 状态文件损坏导致无法恢复 |
|
|
27
|
+
| P1 | 严重影响效率,有 workaround 但代价大 | skill 误触发导致每次都要手动纠正 |
|
|
28
|
+
| P2 | 影响体验,有合理 workaround | 确认弹窗过多,但逐个确认也能完成 |
|
|
29
|
+
| P3 | 锦上添花,不影响正常工作 | 输出格式可以更美观 |
|
|
30
|
+
|
|
31
|
+
## 正文结构
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
# [P?] <问题标题>
|
|
35
|
+
|
|
36
|
+
## 现象
|
|
37
|
+
<发生了什么——客观描述,不带情绪>
|
|
38
|
+
|
|
39
|
+
## 期望
|
|
40
|
+
<应该怎样——正确的行为是什么>
|
|
41
|
+
|
|
42
|
+
## 复现路径
|
|
43
|
+
1. 在 <阶段> 使用 <skill/命令>
|
|
44
|
+
2. <具体操作>
|
|
45
|
+
3. 观察到 <问题现象>
|
|
46
|
+
|
|
47
|
+
## 影响
|
|
48
|
+
- 影响范围:<哪些 skill/阶段/用户>
|
|
49
|
+
- 频率:<首次 | 偶发 | 必现>
|
|
50
|
+
|
|
51
|
+
## 改进建议
|
|
52
|
+
<具体的修改方向,尽可能可操作>
|
|
53
|
+
|
|
54
|
+
## 建议待办条目
|
|
55
|
+
> 可直接追加到 CLAUDE.md 待办列表:
|
|
56
|
+
> | P?-? | <标题> | 🔲 待实施 | v?.?.? | 来源:workflow-feedback <日期> |
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 文件命名
|
|
60
|
+
|
|
61
|
+
`<YYYYMMDD-HHmmss>-<category>.md`
|
|
62
|
+
|
|
63
|
+
示例:`20260725-143022-skill-trigger.md`
|
|
64
|
+
|
|
65
|
+
## 状态流转
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
open → investigating → resolved → closed
|
|
69
|
+
→ wontfix(注明原因)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> 状态变更时更新 frontmatter 的 `status` 字段。
|
|
73
|
+
> resolved 时建议触发 ce-compound 沉淀解决方案。
|