@guanlin4924/devflow-pi 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -0
- package/docs/OMP-NATIVE-ARCHITECTURE.md +104 -0
- package/package.json +40 -0
- package/plugins/devflow-core/extensions/devflow-core.ts +1642 -0
- package/plugins/devflow-core/package.json +14 -0
- package/plugins/devflow-core/runtime/hooks/context_sync_gate.py +174 -0
- package/plugins/devflow-core/runtime/hooks/hook_common.py +696 -0
- package/plugins/devflow-core/runtime/hooks/index_gate.py +63 -0
- package/plugins/devflow-core/runtime/hooks/injection_code_specification.py +7 -0
- package/plugins/devflow-core/runtime/hooks/post_tool.py +44 -0
- package/plugins/devflow-core/runtime/hooks/start.py +288 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/SKILL.md +265 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/agents/openai.yaml +4 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/advance_state.rb +520 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/control_io.rb +42 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_state.rb +138 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/init_workflow.rb +121 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/inspect_state.rb +553 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/manage_lessons.rb +219 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/sync_artifacts.rb +168 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/update_triage_route.rb +110 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/scripts/validate_state.rb +565 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/feature-development.yaml +783 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/uat-remediation.yaml +143 -0
- package/plugins/devflow-core/skills/workflow-orchestrator/templates/workflows-README.md +10 -0
- package/plugins/devflow-core/skills/workflow-pipeline/SKILL.md +117 -0
- package/plugins/devflow-core/skills/workflow-pipeline/references/pipeline-flow.md +167 -0
- package/plugins/devflow-core/skills/workflow-pipeline/references/slice-safety-guide.md +125 -0
- package/plugins/devflow-core/skills/workflow-project-context/SKILL.md +819 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/agents-md-template.md +25 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-backend-spec-template.md +68 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-frontend-spec-template.md +64 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/codebase-navigation-template.md +168 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/context-domain-index-template.md +43 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/context-spec-index-template.md +45 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/execution-contract-template.md +57 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/navigation-index-template.md +40 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/project-initialization-template.md +109 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/rules-index-template.md +80 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/run-manifest-template.json +40 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/directory-structure.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/engine.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/errors.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/locator.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/model.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/repository.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/router.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/scheduler.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/schema.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/service.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/backend/testing.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/api-client.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/case-editor.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/components.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/directory-structure.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/forms.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/routing.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/state.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/spec-templates/frontend/testing.md +46 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/stack-spec-template.md +106 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/state-template.md +77 -0
- package/plugins/devflow-core/skills/workflow-project-context/assets/toolchain-template.md +37 -0
- package/plugins/devflow-core/skills/workflow-project-context/references/navigation-guide.md +262 -0
- package/plugins/devflow-core/skills/workflow-project-context/scripts/validate_initialization.py +545 -0
- package/plugins/devflow-design/agents/contract-auditor.md +18 -0
- package/plugins/devflow-design/extensions/devflow-design.ts +47 -0
- package/plugins/devflow-design/package.json +14 -0
- package/plugins/devflow-design/skills/workflow-api-call-guide/SKILL.md +142 -0
- package/plugins/devflow-design/skills/workflow-api-contract/SKILL.md +150 -0
- package/plugins/devflow-design/skills/workflow-api-supplement/SKILL.md +121 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/SKILL.md +257 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/adr-template.md +57 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/assets/backend-spec-template.md +205 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/affected-module-exploration.md +59 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/backend-conventions.md +30 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/code-explore-guide.md +40 -0
- package/plugins/devflow-design/skills/workflow-backend-tech-spec/references/project-rule-contract.md +66 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/SKILL.md +91 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/index.md +71 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/accessibility.md +31 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/component-library.md +31 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/design-systems.md +47 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/responsive-grid.md +29 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/stack-guidelines.md +31 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/recommendations/ux-patterns.md +40 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tokens/project-tokens.md +19 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/SKILL.md +377 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/charts.csv +26 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/colors.csv +97 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/icons.csv +101 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/landing.csv +31 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/products.csv +97 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/styles.csv +68 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/typography.csv +58 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/core.py +253 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/assets/design/tools/ui-ux-pro-max/scripts/search.py +114 -0
- package/plugins/devflow-design/skills/workflow-design-rule-pack/scripts/install.py +67 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/SKILL.md +370 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/admin-system-template.md +57 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/api-service-template.md +42 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/c-end-system-template.md +25 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/assets/output-template.md +139 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/references/bug-rules.md +12 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/references/exception-checklist.md +31 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/references/trace-integrity-guide.md +153 -0
- package/plugins/devflow-design/skills/workflow-feature-breakdown/references/writing-guide.md +92 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/SKILL.md +223 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/assets/frontend-spec-template.md +204 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/affected-module-exploration.md +58 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/component-patterns.md +42 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-conventions.md +28 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/common-web.md +53 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/next.md +40 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/react.md +41 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/frontend-stack-slots/vue.md +41 -0
- package/plugins/devflow-design/skills/workflow-frontend-tech-spec/references/project-rule-contract.md +95 -0
- package/plugins/devflow-design/skills/workflow-integration-verify/SKILL.md +172 -0
- package/plugins/devflow-design/skills/workflow-ui-spec/SKILL.md +302 -0
- package/plugins/devflow-design/skills/workflow-ui-spec/assets/ui-spec-template.md +244 -0
- package/plugins/devflow-design/skills/workflow-ui-spec/references/affected-module-exploration.md +55 -0
- package/plugins/devflow-implementation/agents/implementation-worker.md +20 -0
- package/plugins/devflow-implementation/package.json +6 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/SKILL.md +124 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/INDEX.md +13 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/adversarial-review.md +35 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/first-principles.md +26 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/lesson-format.md +28 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/root-cause-ladder.md +51 -0
- package/plugins/devflow-implementation/skills/workflow-bug-fix/references/seam-analysis.md +30 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/SKILL.md +160 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/references/code-conventions.md +33 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/references/ddl-guidelines.md +60 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/references/output-template.md +217 -0
- package/plugins/devflow-implementation/skills/workflow-change-plan/references/project-rule-contract.md +55 -0
- package/plugins/devflow-implementation/skills/workflow-execute-phase/SKILL.md +271 -0
- package/plugins/devflow-implementation/skills/workflow-execute-phase/references/execute-phase.md +1251 -0
- package/plugins/devflow-implementation/skills/workflow-execute-phase/references/ui-brand.md +160 -0
- package/plugins/devflow-intel/agents/project-scout.md +27 -0
- package/plugins/devflow-intel/extensions/devflow-intel.ts +104 -0
- package/plugins/devflow-intel/package.json +14 -0
- package/plugins/devflow-intel/skills/code-index-query/SKILL.md +37 -0
- package/plugins/devflow-intel/skills/code-index-query/references/query-patterns.md +27 -0
- package/plugins/devflow-intel/skills/workflow-code-index/SKILL.md +68 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/adapter-contract.md +38 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/audit-checklist.md +10 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/confidence-rules.md +43 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/data-model.md +74 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/discovery.md +24 -0
- package/plugins/devflow-intel/skills/workflow-code-index/references/query-guide.md +20 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/__init__.py +1 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/base.py +30 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/generic_text.py +287 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/adapters/registry.py +17 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/code_index.py +437 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/__init__.py +1 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/discovery.py +139 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/hashing.py +11 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/scanner.py +115 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/core/schema.py +123 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/__init__.py +1 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/project_binding_check.py +66 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/relation_check.py +36 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/schema_validate.py +11 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/validators/stale_check.py +42 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/__init__.py +1 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/jsonl_writer.py +25 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/markdown_writer.py +106 -0
- package/plugins/devflow-intel/skills/workflow-code-index/scripts/writers/sqlite_writer.py +143 -0
- package/plugins/devflow-intel/skills/workflow-context-sync/SKILL.md +381 -0
- package/plugins/devflow-intel/skills/workflow-context-sync/agents/openai.yaml +4 -0
- package/plugins/devflow-intel/skills/workflow-context-sync/scripts/context_sync_cursor.py +241 -0
- package/plugins/devflow-intel/skills/workflow-update-navigation/SKILL.md +186 -0
- package/plugins/devflow-intel/skills/workflow-update-navigation/references/incremental-update-guide.md +47 -0
- package/plugins/devflow-quality/agents/code-reviewer.md +18 -0
- package/plugins/devflow-quality/agents/verification-runner.md +21 -0
- package/plugins/devflow-quality/extensions/devflow-quality.ts +59 -0
- package/plugins/devflow-quality/package.json +14 -0
- package/plugins/devflow-quality/skills/code-review/SKILL.md +288 -0
- package/plugins/devflow-quality/skills/code-review/references/cross-layer-checklist.md +70 -0
- package/plugins/devflow-quality/skills/code-review/references/dao-checklist.md +70 -0
- package/plugins/devflow-quality/skills/code-review/references/handler-checklist.md +48 -0
- package/plugins/devflow-quality/skills/code-review/references/repository-checklist.md +44 -0
- package/plugins/devflow-quality/skills/code-review/references/service-checklist.md +57 -0
- package/plugins/devflow-quality/skills/code-review/references/spec-checklist.md +34 -0
- package/plugins/devflow-quality/skills/code-review/references/vo-checklist.md +26 -0
- package/plugins/devflow-quality/skills/workflow-audit-milestone/SKILL.md +31 -0
- package/plugins/devflow-quality/skills/workflow-audit-milestone/references/audit-milestone.md +328 -0
- package/plugins/devflow-quality/skills/workflow-complete-milestone/SKILL.md +132 -0
- package/plugins/devflow-quality/skills/workflow-complete-milestone/assets/milestone-archive.md +123 -0
- package/plugins/devflow-quality/skills/workflow-complete-milestone/references/complete-milestone.md +775 -0
- package/plugins/devflow-quality/skills/workflow-complete-milestone/references/milestone-archive.md +123 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/SKILL.md +126 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/api-mainflow-rules.md +27 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/codebase-discovery.md +54 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/intermediate-format.md +244 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/mainflow-selection.md +36 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/project-dsl-contract.md +190 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/references/ui-mainflow-rules.md +110 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/compile_dsl.py +583 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/discover_codebases.py +199 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/normalize_case_payloads.py +177 -0
- package/plugins/devflow-quality/skills/workflow-generate-mainflow-cases/scripts/validate_case_payloads.py +370 -0
- package/plugins/devflow-quality/skills/workflow-verify-work/SKILL.md +106 -0
- package/plugins/devflow-quality/skills/workflow-verify-work/assets/UAT.md +265 -0
- package/plugins/devflow-quality/skills/workflow-verify-work/references/verify-work.md +759 -0
- package/plugins/devflow-requirements/agents/requirements-auditor.md +20 -0
- package/plugins/devflow-requirements/package.json +6 -0
- package/plugins/devflow-requirements/skills/requirement-feasibility-review/SKILL.md +219 -0
- package/plugins/devflow-requirements/skills/requirement-feasibility-review/agents/openai.yaml +4 -0
- package/plugins/devflow-requirements/skills/requirement-feasibility-review/references/review-method.md +257 -0
- package/plugins/devflow-requirements/skills/requirement-feasibility-review/references/review-template.md +80 -0
- package/plugins/devflow-requirements/skills/workflow-demand-clarify/SKILL.md +325 -0
- package/plugins/devflow-requirements/skills/workflow-domain-modeling/SKILL.md +163 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/SKILL.md +748 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/assets/baseline-template.md +281 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/antipatterns.md +69 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/challenge-review-guide.md +158 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/decomposition-guide.md +115 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/project-context-guide.md +119 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/questioning.md +76 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-baseline/references/requirement-review-checklist.md +115 -0
- package/plugins/devflow-requirements/skills/workflow-requirement-triage/SKILL.md +204 -0
- package/plugins/devflow-requirements/skills/workflow-wayfinder/SKILL.md +183 -0
- package/src/cli.ts +76 -0
- package/src/constants.ts +15 -0
- package/src/doctor.ts +66 -0
- package/src/paths.ts +37 -0
- package/src/platform-extension.ts +46 -0
- package/src/project-context.ts +165 -0
- package/src/runtime.ts +167 -0
- package/src/usage-stats.ts +101 -0
- package/templates/commands/start.md +58 -0
- package/templates/omp/AGENTS.md +36 -0
- package/templates/omp/config.yml +112 -0
- package/templates/omp/hook-config.json +18 -0
- package/templates/omp/index-policy.json +57 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-api-call-guide
|
|
3
|
+
description: "Use after backend-tech-spec, before integration-verify. Generates a step-by-step API call guide for frontend developers. This is NOT a change list — no code changes, just calling instructions based on the confirmed API contract and backend tech spec."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API 调用指南
|
|
7
|
+
|
|
8
|
+
## 定位
|
|
9
|
+
|
|
10
|
+
| 维度 | 说明 |
|
|
11
|
+
|------|------|
|
|
12
|
+
| **消费者** | 人类前端开发者 |
|
|
13
|
+
| **权威源** | `api-contract.md`(API 签名唯一真相源,本 skill 不重新定义) |
|
|
14
|
+
| **互补关系** | `workflow-change-plan` 产出 AI 可执行的 `变更清单.md`;本 skill 产出人类可读的 `api-call-guide.md`。两者互补,不可替代 |
|
|
15
|
+
| **前置条件** | `api-contract.md` 必须已存在且审查通过 |
|
|
16
|
+
|
|
17
|
+
## 跳过条件
|
|
18
|
+
|
|
19
|
+
满足以下任一条件时,本 skill 不产生有意义产出,应跳过:
|
|
20
|
+
|
|
21
|
+
1. `后端技术方案.meta.json` 中 `api_count == 0`(无新增或修改的 API)
|
|
22
|
+
2. `api-contract.md` 不存在(本功能无 API 变更)
|
|
23
|
+
3. 纯内部重构 / 仅修改现有实现不改变接口签名
|
|
24
|
+
|
|
25
|
+
在完整 workflow 中不要直接跳过文件产出;应生成 no-op `api-call-guide.md` 和 `api-call-guide.meta.json`,其中 `api_required: false`、`covered_endpoint_count: 0`、`pending_items: []`,并写明跳过原因。这样后续 Merge Gate 可以被机器校验。
|
|
26
|
+
|
|
27
|
+
## 产出位置
|
|
28
|
+
|
|
29
|
+
- `.planning/features/{功能名}/api-call-guide.md`
|
|
30
|
+
- `.planning/features/{功能名}/api-call-guide.meta.json`
|
|
31
|
+
|
|
32
|
+
`api-call-guide.meta.json` 必须包含:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"api_required": true,
|
|
37
|
+
"covered_endpoint_count": 0,
|
|
38
|
+
"frontend_consumable": true,
|
|
39
|
+
"mock_ready": true,
|
|
40
|
+
"pending_items": [],
|
|
41
|
+
"skip_reason": ""
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 输入
|
|
46
|
+
|
|
47
|
+
- `.planning/features/{功能名}/api-contract.md` — **API 签名唯一权威源**
|
|
48
|
+
- `.planning/features/{功能名}/后端技术方案.md` — 后端实现细节和 seam 位置
|
|
49
|
+
|
|
50
|
+
## 核心原则
|
|
51
|
+
|
|
52
|
+
1. **不改代码** — 这是调用指南,不是变更清单。不要包含 DDL、代码任务、文件路径
|
|
53
|
+
2. **API 签名必须引用 api-contract.md** — 不自行定义 endpoint、参数、响应结构。只引用,不重定义
|
|
54
|
+
3. **步骤可执行** — 每个步骤描述前端应该怎么调这个 API,包含请求示例和响应解析
|
|
55
|
+
4. **按业务流组织** — 按用户操作的业务顺序排列,不是按 API 方法名排序
|
|
56
|
+
5. **标注 seam 范围** — 每个调用步骤标注对应接口和后端模块
|
|
57
|
+
|
|
58
|
+
## 产出模板
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
# API 调用指南:{功能名}
|
|
62
|
+
|
|
63
|
+
## 业务流概览
|
|
64
|
+
|
|
65
|
+
```mermaid
|
|
66
|
+
sequenceDiagram
|
|
67
|
+
用户->>前端: 填写订单
|
|
68
|
+
前端->>后端: POST /api/v1/orders
|
|
69
|
+
后端-->>前端: {order_id, status}
|
|
70
|
+
前端->>用户: 显示订单确认页
|
|
71
|
+
用户->>前端: 查看订单详情
|
|
72
|
+
前端->>后端: GET /api/v1/orders/{id}
|
|
73
|
+
后端-->>前端: {完整订单数据}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 步骤 1:创建订单
|
|
77
|
+
|
|
78
|
+
**接口**:POST /api/v1/orders(定义见 `api-contract.md` §1)
|
|
79
|
+
**Seam**:OrderController.create()
|
|
80
|
+
|
|
81
|
+
**调用时机**:用户填写完订单并点击「提交」
|
|
82
|
+
|
|
83
|
+
**请求示例**:
|
|
84
|
+
```javascript
|
|
85
|
+
const response = await fetch('/api/v1/orders', {
|
|
86
|
+
method: 'POST',
|
|
87
|
+
headers: { 'Content-Type': 'application/json' },
|
|
88
|
+
body: JSON.stringify({
|
|
89
|
+
user_id: currentUser.id,
|
|
90
|
+
items: cart.items.map(item => ({
|
|
91
|
+
product_id: item.productId,
|
|
92
|
+
quantity: item.quantity,
|
|
93
|
+
price: item.price
|
|
94
|
+
})),
|
|
95
|
+
remark: remarkInput.value
|
|
96
|
+
})
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**成功响应 201**:
|
|
101
|
+
```javascript
|
|
102
|
+
const data = await response.json();
|
|
103
|
+
// data.order_id → 用于跳转到订单详情页
|
|
104
|
+
// data.status → "pending",可显示等待确认状态
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**错误处理**:
|
|
108
|
+
- 400: 参数校验失败,显示 `data.detail` 中的字段级错误
|
|
109
|
+
- 422: 业务规则拒绝(如库存不足),显示 `data.error`
|
|
110
|
+
|
|
111
|
+
## 步骤 2:查询订单详情
|
|
112
|
+
|
|
113
|
+
**接口**:GET /api/v1/orders/{id}(定义见 `api-contract.md` §2)
|
|
114
|
+
**Seam**:OrderController.getById()
|
|
115
|
+
|
|
116
|
+
...
|
|
117
|
+
|
|
118
|
+
## 异常流程
|
|
119
|
+
|
|
120
|
+
| 场景 | 处理方式 |
|
|
121
|
+
|------|---------|
|
|
122
|
+
| 网络超时 | 显示「请求超时,请重试」,不自动重试 |
|
|
123
|
+
| 订单不存在(404) | 显示「订单不存在」,跳转到订单列表 |
|
|
124
|
+
| 服务器错误(500) | 显示「系统繁忙,请稍后重试」 |
|
|
125
|
+
|
|
126
|
+
## 前端状态管理建议
|
|
127
|
+
|
|
128
|
+
- 订单列表:使用 React Query / SWR 缓存,key 为 `['orders']`
|
|
129
|
+
- 订单详情:使用 `['orders', orderId]` 作为缓存 key
|
|
130
|
+
- 创建订单后:invalidate 订单列表缓存
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## 完成门禁
|
|
134
|
+
|
|
135
|
+
- [ ] 每个 API 契约中的接口都有对应调用步骤
|
|
136
|
+
- [ ] 每个步骤引用 `api-contract.md` 中的接口定义(不自行定义)
|
|
137
|
+
- [ ] 每个步骤包含请求示例和响应解析
|
|
138
|
+
- [ ] 包含至少一个异常流程的响应示例
|
|
139
|
+
- [ ] 没有包含代码变更任务(那是 change-plan 的职责)
|
|
140
|
+
- [ ] meta.json 中 `frontend_consumable` 和 `mock_ready` 均为 true
|
|
141
|
+
- [ ] meta.json 中 `pending_items` 为空数组
|
|
142
|
+
- [ ] 无 API 变更时生成 no-op meta,`api_required` 为 false
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-api-contract
|
|
3
|
+
description: "Use after requirement-baseline, before dual-track fork. Defines shared API contracts (endpoints, request/response shapes, data models) that both Track A and Track B reference. This is the fork point — contract changes after this step are exception paths."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API 契约生成器
|
|
7
|
+
|
|
8
|
+
## 定位
|
|
9
|
+
|
|
10
|
+
| 维度 | 说明 |
|
|
11
|
+
|------|------|
|
|
12
|
+
| **消费者** | Track A(后端)、Track B(前端)、`api-call-guide`、`change-plan`、`integration-verify` |
|
|
13
|
+
| **角色** | **双轨分叉点** — Track A 和 Track B 唯一共享的接口定义。契约确定后变更走 `api-supplement` 异常路径 |
|
|
14
|
+
| **权威性** | 所有下游 skill 必须引用本契约中的 API 签名,不得自行定义 |
|
|
15
|
+
|
|
16
|
+
## 跳过条件
|
|
17
|
+
|
|
18
|
+
满足以下条件时,本 skill 不产生有意义产出,应跳过:
|
|
19
|
+
|
|
20
|
+
1. 本功能无新增或修改的 API(纯内部重构、配置变更、存储优化等)
|
|
21
|
+
2. baseline.md 中所有 FP 的 `seam_type` 均不涉及 API 层
|
|
22
|
+
|
|
23
|
+
在完整 workflow 中不要直接跳过文件产出;应生成 no-op API 契约,并在 meta 中写入 `api_required: false`、`endpoint_count: 0`、`pending_contract_count: 0`。后续 `api-call-guide` 和 `integration-verify` 也生成 no-op 产物,保证状态机和 artifact registry 可校验。
|
|
24
|
+
|
|
25
|
+
## 产出位置
|
|
26
|
+
|
|
27
|
+
- `.planning/features/{功能名}/api-contract.md`
|
|
28
|
+
- `.planning/features/{功能名}/api-contract.meta.json`
|
|
29
|
+
|
|
30
|
+
## 输入
|
|
31
|
+
|
|
32
|
+
- `.planning/requirements/baseline.md` — 需求基线(FP/BR/BC)
|
|
33
|
+
- `.planning/navigation/INDEX.md` 和相关 codebase navigation — 粗定位已有接口
|
|
34
|
+
- `.planning/code-index/`(如存在)— 查询已有 route/handler/API symbol 与 `routes_to` / `calls` 关系,确认接口复用和冲突
|
|
35
|
+
|
|
36
|
+
使用 code-index 时,必须回读 `evidence_path:evidence_line` 附近源码后再把既有接口写入契约;不得只凭 Markdown navigation 或 relation 摘要判断。
|
|
37
|
+
|
|
38
|
+
## 核心原则
|
|
39
|
+
|
|
40
|
+
1. **只定义接口契约,不谈实现细节** — 不写数据表结构、不写具体代码、不写业务流程内部逻辑
|
|
41
|
+
2. **分叉后不变更** — 一旦确定,Track A/B 都基于此契约工作。变更走 `api-supplement` 异常路径
|
|
42
|
+
3. **接口签名必须完整** — 包括 endpoint、method、请求参数(含类型约束)、响应结构(含状态码)
|
|
43
|
+
4. **数据模型共享** — 核心业务实体定义在这里,前后端共用一个数据模型
|
|
44
|
+
5. **切片对齐** — 若 baseline 包含 `SL-*`,先读取 `skill://workflow-pipeline/references/slice-safety-guide.md`,只为当前执行切片定义 API。后置切片接口不得提前进入契约。
|
|
45
|
+
6. **既有接口优先查事实索引** — 当 `.planning/code-index/` 存在时,先用 Symbol/Relation 定位候选接口、调用方和处理器,再读取源码证据;缺失或过期时再按 navigation 和 `rg` 兜底。
|
|
46
|
+
|
|
47
|
+
## 产出模板
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
# API 契约:{功能名}
|
|
51
|
+
|
|
52
|
+
## 当前执行切片
|
|
53
|
+
|
|
54
|
+
- Slice ID: SL-001
|
|
55
|
+
- 纳入 FP/BR/BC: FP-001, BR-001, BC-001
|
|
56
|
+
- 后置切片: SL-002(仅作上下文)
|
|
57
|
+
|
|
58
|
+
## 接口列表
|
|
59
|
+
|
|
60
|
+
| # | Method | Endpoint | 说明 | 所属 FP |
|
|
61
|
+
|---|--------|----------|------|---------|
|
|
62
|
+
| 1 | POST | /api/v1/orders | 创建订单 | FP-001 |
|
|
63
|
+
| 2 | GET | /api/v1/orders/{id} | 查询订单 | FP-001 |
|
|
64
|
+
|
|
65
|
+
## 接口详情
|
|
66
|
+
|
|
67
|
+
### 1. POST /api/v1/orders
|
|
68
|
+
|
|
69
|
+
**说明**:创建订单
|
|
70
|
+
**FP**:FP-001
|
|
71
|
+
|
|
72
|
+
**请求体**:
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"user_id": "string (uuid)",
|
|
76
|
+
"items": [
|
|
77
|
+
{
|
|
78
|
+
"product_id": "string (uuid)",
|
|
79
|
+
"quantity": "integer (>=1)",
|
|
80
|
+
"price": "number (分)"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"remark": "string (optional, max 200)"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**响应 201**:
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"order_id": "string (uuid)",
|
|
91
|
+
"status": "string (pending/confirmed/shipped)",
|
|
92
|
+
"total_amount": "number (分)",
|
|
93
|
+
"created_at": "string (ISO 8601)"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**响应 400/422**:
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"error": "string",
|
|
101
|
+
"detail": {}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 2. GET /api/v1/orders/{id}
|
|
106
|
+
...
|
|
107
|
+
|
|
108
|
+
## 共享数据模型
|
|
109
|
+
|
|
110
|
+
### Order(订单)
|
|
111
|
+
|
|
112
|
+
| 字段 | 类型 | 说明 |
|
|
113
|
+
|------|------|------|
|
|
114
|
+
| order_id | string (uuid) | 订单 ID |
|
|
115
|
+
| user_id | string (uuid) | 用户 ID |
|
|
116
|
+
| status | enum(pending/confirmed/shipped/cancelled) | 订单状态 |
|
|
117
|
+
| items | array[OrderItem] | 订单项 |
|
|
118
|
+
| total_amount | number (分) | 总金额(整数分) |
|
|
119
|
+
| created_at | string (ISO 8601) | 创建时间 |
|
|
120
|
+
| updated_at | string (ISO 8601) | 更新时间 |
|
|
121
|
+
|
|
122
|
+
### OrderItem(订单项)
|
|
123
|
+
...
|
|
124
|
+
|
|
125
|
+
## 接口依赖关系
|
|
126
|
+
|
|
127
|
+
| 调用顺序 | 接口 | 说明 |
|
|
128
|
+
|---------|------|------|
|
|
129
|
+
| 1 | POST /api/v1/orders | 先创建订单 |
|
|
130
|
+
| 2 | GET /api/v1/orders/{id} | 后查状态 |
|
|
131
|
+
|
|
132
|
+
## 未解决的接口问题
|
|
133
|
+
|
|
134
|
+
- 订单取消是否需要单独的 PUT 接口?
|
|
135
|
+
- 分页查询的 page_size 默认值?
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 完成门禁
|
|
139
|
+
|
|
140
|
+
- [ ] 每个涉及 API 的 FP 至少映射到一个接口
|
|
141
|
+
- [ ] 若存在 `SL-*`,每个接口都标注当前 Slice ID,且未包含后置切片接口
|
|
142
|
+
- [ ] 每个接口有完整的请求/响应结构
|
|
143
|
+
- [ ] 若 `.planning/code-index/` 存在,已有接口复用/冲突判断已查询 code-index 并回读源码 evidence;未使用时已说明原因
|
|
144
|
+
- [ ] 核心数据模型已定义字段和类型
|
|
145
|
+
- [ ] 没有包含实现细节(SQL、表结构、代码片段)
|
|
146
|
+
- [ ] meta.json 中 `endpoint_count` 已记录接口总数
|
|
147
|
+
- [ ] meta.json 中 `api_required` 已记录是否存在 API 变更
|
|
148
|
+
- [ ] meta.json 中 `review_status` 为 `passed`
|
|
149
|
+
- [ ] meta.json 中 `pending_contract_count` 为 0
|
|
150
|
+
- [ ] meta.json 中 `breaking_change_count`、`permission_rule_count`、`error_case_count` 已记录
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-api-supplement
|
|
3
|
+
description: "Use when Track B (frontend-tech-spec) discovers API gaps that the shared API contract doesn't cover. This is an EXCEPTION PATH — not a normal pipeline step. Submits API supplement requests for Track A evaluation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API 补充需求(异常路径)
|
|
7
|
+
|
|
8
|
+
## 定位
|
|
9
|
+
|
|
10
|
+
| 维度 | 说明 |
|
|
11
|
+
|------|------|
|
|
12
|
+
| **触发方** | Track B(`workflow-frontend-tech-spec`) |
|
|
13
|
+
| **接收方** | Track A(后端开发者) |
|
|
14
|
+
| **触发条件** | 前端方案完成时发现 API 缺口,且 `frontend-tech-spec.meta.json` 中 `api_gaps_count > 0` |
|
|
15
|
+
| **与其他 skill 关系** | 是 `api-contract` 的补丁流程。正常流程下 API 在契约阶段已完整定义,本 skill 仅在遗漏时触发 |
|
|
16
|
+
|
|
17
|
+
## 触发条件(程序化检测)
|
|
18
|
+
|
|
19
|
+
orchestrator 通过以下方式检测是否需要触发本 skill:
|
|
20
|
+
|
|
21
|
+
1. 读取 `前端技术方案.meta.json` 的 `api_gaps_count` 字段
|
|
22
|
+
2. 若 `api_gaps_count > 0` → 触发补充评估,产出补充请求并要求 Track A 回写 `api-contract.md`
|
|
23
|
+
3. 若 `api_gaps_count == 0` → 生成 no-op `api-supplement-requests.md` 和 meta,供 `integration-verify` 机器校验
|
|
24
|
+
4. 若字段不存在 → 阻断进入 `integration-verify`,要求先补齐 `前端技术方案.meta.json`
|
|
25
|
+
|
|
26
|
+
`workflow-frontend-tech-spec` 的完成门禁应包含:检查前端需要的 API 是否都在 `api-contract.md` 中有定义,缺失数量写入 `api_gaps_count`。
|
|
27
|
+
|
|
28
|
+
## 输入
|
|
29
|
+
|
|
30
|
+
- `.planning/features/{功能名}/api-contract.md` — 已有 API 契约
|
|
31
|
+
- `.planning/features/{功能名}/前端技术方案.md` — 刚刚完成的前端方案
|
|
32
|
+
- `.planning/features/{功能名}/UI-SPEC.md` — UI 设计规范
|
|
33
|
+
|
|
34
|
+
## 产出
|
|
35
|
+
|
|
36
|
+
- `.planning/features/{功能名}/api-supplement-requests.md`
|
|
37
|
+
- `.planning/features/{功能名}/api-supplement-requests.meta.json`
|
|
38
|
+
|
|
39
|
+
即使没有 API 补充需求,也要生成 no-op meta:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"api_supplement_count": 0,
|
|
44
|
+
"unresolved_supplement_count": 0,
|
|
45
|
+
"contract_updated": false,
|
|
46
|
+
"no_supplement_required": true
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 输出模板
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
# API 补充需求:{功能名}
|
|
54
|
+
|
|
55
|
+
## 来源
|
|
56
|
+
前端方案中发现 {count} 个 API 契约未覆盖的接口需求。
|
|
57
|
+
|
|
58
|
+
## 补充需求列表
|
|
59
|
+
|
|
60
|
+
### SR-1: PATCH /api/v1/orders/{id}/cancel
|
|
61
|
+
|
|
62
|
+
**理由**:前端订单详情页需要取消订单功能,但 API 契约中只有 POST(创建)和 GET(查询)。
|
|
63
|
+
|
|
64
|
+
**预期签名**:
|
|
65
|
+
```
|
|
66
|
+
PATCH /api/v1/orders/{id}/cancel
|
|
67
|
+
Request: {} (空,服务端校验权限)
|
|
68
|
+
Response 200: { order_id, status: "cancelled", cancelled_at }
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**是否可以改用已有接口**:
|
|
72
|
+
- ❌ POST /api/v1/orders — 创建非取消
|
|
73
|
+
- ❌ GET /api/v1/orders/{id} — 只读查询
|
|
74
|
+
|
|
75
|
+
**建议**:需要新增接口。
|
|
76
|
+
|
|
77
|
+
### SR-2: GET /api/v1/orders 响应增加 total_count 字段
|
|
78
|
+
|
|
79
|
+
**理由**:前端分页列表需要显示总条数,但契约中的分页响应只有 data 数组。
|
|
80
|
+
|
|
81
|
+
**预期变更**:在响应中增加 `total_count: integer` 字段
|
|
82
|
+
|
|
83
|
+
**是否可以改用已有接口**:前端可以自己算,但数据量大时不准确。
|
|
84
|
+
|
|
85
|
+
**建议**:后端增加 total_count 字段,不改前端逻辑。
|
|
86
|
+
|
|
87
|
+
## 提交给 Track A 评估
|
|
88
|
+
|
|
89
|
+
| # | 需求 | 类型 | 推荐方案 | Track A 决策 |
|
|
90
|
+
|---|------|------|---------|-------------|
|
|
91
|
+
| SR-1 | 新增取消订单接口 | 新增接口 | 新建 PATCH | {待评估} |
|
|
92
|
+
| SR-2 | 分页加 total_count | 响应扩展 | 加字段 | {待评估} |
|
|
93
|
+
|
|
94
|
+
## Track A 决策记录
|
|
95
|
+
|
|
96
|
+
| # | 决策 | 理由 | 处理方式 |
|
|
97
|
+
|---|------|------|---------|
|
|
98
|
+
| SR-1 | ① 加接口 | 取消是独立业务逻辑,不应复用创建接口 | 新增 PATCH,安排后端开发 |
|
|
99
|
+
| SR-2 | ② 已有接口拼 | 前端用 data.length + 约定 pageSize 计算 | 不改契约 |
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 评估规则
|
|
103
|
+
|
|
104
|
+
提交给 Track A 后,Track A 按以下优先级评估:
|
|
105
|
+
|
|
106
|
+
1. **用已有接口拼** — 不改契约,前端自己组合已有接口满足需求
|
|
107
|
+
2. **扩展已有接口** — 在现有接口上加可选参数或字段(不破坏兼容性)
|
|
108
|
+
3. **加新接口** — 新建 endpoint,独立开发和部署
|
|
109
|
+
4. **暂缓** — 这个版本不做,放入下一轮
|
|
110
|
+
|
|
111
|
+
**所有决策必须回写 `api-contract.md`**,确保契约保持单一真相源。
|
|
112
|
+
|
|
113
|
+
## 完成门禁
|
|
114
|
+
|
|
115
|
+
- [ ] 每个补充需求描述了"缺什么"和"为什么缺"
|
|
116
|
+
- [ ] 每个补充需求检查了是否可复用已有接口
|
|
117
|
+
- [ ] 每个补充需求有推荐的评估方案
|
|
118
|
+
- [ ] 不超过 3 个补充需求(超过说明 API 契约阶段不完整)
|
|
119
|
+
- [ ] Track A 决策已回写 `api-contract.md`
|
|
120
|
+
- [ ] meta.json 中 `unresolved_supplement_count` 为 0
|
|
121
|
+
- [ ] 若存在补充需求,`contract_updated` 为 true;若没有补充需求,`no_supplement_required` 为 true
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-backend-tech-spec
|
|
3
|
+
description: "Use when a requirement baseline needs a backend technical design, including API, data model, affected modules, integration points, and risks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Legacy Command Metadata
|
|
7
|
+
|
|
8
|
+
Original slash-command metadata retained only as workflow invocation guidance.
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
argument-hint: <功能名>
|
|
12
|
+
user-invocable: true
|
|
13
|
+
pattern: generator+tool-wrapper
|
|
14
|
+
inputs:
|
|
15
|
+
- .planning/features/{功能名}/api-contract.md
|
|
16
|
+
- .planning/requirements/baseline.md
|
|
17
|
+
- .planning/features/{功能名}/功能点梳理.md (optional, Track B context when already available)
|
|
18
|
+
- .planning/PROJECT.md
|
|
19
|
+
- .planning/navigation/INDEX.md
|
|
20
|
+
- .planning/rules/INDEX.md
|
|
21
|
+
- .planning/execution-contract.md
|
|
22
|
+
- .planning/toolchain.md
|
|
23
|
+
- .planning/lessons/README.md
|
|
24
|
+
- .context/spec/index.md
|
|
25
|
+
- .context/spec/stacks/
|
|
26
|
+
- .context/spec/backend/index.md
|
|
27
|
+
- .context/spec/backend/
|
|
28
|
+
- .context/workflow/
|
|
29
|
+
- .context/lessons/README.md(如存在)
|
|
30
|
+
- .planning/milestones/
|
|
31
|
+
- references/affected-module-exploration.md
|
|
32
|
+
output: .planning/features/{功能名}/后端技术方案.md
|
|
33
|
+
allowed-tools:
|
|
34
|
+
- Read
|
|
35
|
+
- Write
|
|
36
|
+
- Edit
|
|
37
|
+
- Bash
|
|
38
|
+
- Grep
|
|
39
|
+
- Glob
|
|
40
|
+
- ask
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
# 后端技术方案生成器
|
|
44
|
+
|
|
45
|
+
根据需求基线和项目现有代码,生成聚焦于影响分析的后端技术方案。
|
|
46
|
+
|
|
47
|
+
## 核心原则
|
|
48
|
+
|
|
49
|
+
**遇到不确定的地方,必须询问用户,不要自己做决定。**
|
|
50
|
+
|
|
51
|
+
常见需要询问的场景:
|
|
52
|
+
- 存在多个类似功能,不知道用哪个
|
|
53
|
+
- 业务规则有歧义
|
|
54
|
+
- 存在多种实现方案
|
|
55
|
+
- 不确定是否复用现有功能
|
|
56
|
+
- 涉及调用外部/上游 API,但没有对应的接口文档(URL、认证方式、请求/响应结构、错误码)
|
|
57
|
+
|
|
58
|
+
## 工作流程
|
|
59
|
+
|
|
60
|
+
### 第一阶段:理解需求
|
|
61
|
+
|
|
62
|
+
1. 读取 `.planning/requirements/baseline.md` 理解需求
|
|
63
|
+
2. 读取 `.planning/PROJECT.md` 了解项目上下文
|
|
64
|
+
3. 如果 baseline.md 不存在,询问用户需求或在 `.planning/milestones/` 中查找相关历史
|
|
65
|
+
4. 读取 `references/project-rule-contract.md`,按 Spec Read Contract 发现并加载目标项目的后端规则包:`.planning/rules/INDEX.md` → `.context/spec/index.md` → 命中的 stack spec → 命中的 backend codebase spec → navigation → code-index(如存在且需要关系事实)→ 源码
|
|
66
|
+
5. 读取 `references/code-explore-guide.md`,按项目导航和规则包做通用后端探索
|
|
67
|
+
6. 读取 baseline 的 `反向审视与用户拍板`、`待确认事项`、`下游输入契约`:
|
|
68
|
+
- 已确认的冲突/复用/替代方案决策必须进入技术方案
|
|
69
|
+
- 影响 scope、语义、归属、兼容性或实现成本的未确认项,不得被当成已确认需求
|
|
70
|
+
- 若未确认项阻塞后端方案,询问用户;`--auto` 或无法询问时写入待确认事项和风险
|
|
71
|
+
7. 读取 `.planning/features/{功能名}/api-contract.md`。在双轨模式下,后端方案必须以 API 契约和需求基线作为权威输入,不得等待 Track B 的 `功能点梳理.md` 才开始。
|
|
72
|
+
8. 若 `功能点梳理.md` 已存在,可作为测试可读上下文补充读取;若不存在,不阻塞 Track A。
|
|
73
|
+
9. 若 baseline、api-contract 或 `功能点梳理.md` 包含 `SL-*` 切片计划,读取 `skill://workflow-pipeline/references/slice-safety-guide.md`,只为当前执行切片生成后端方案。后置切片只可作为依赖上下文或后续范围,不得生成库表、接口、任务或运行时设计。
|
|
74
|
+
|
|
75
|
+
### 第二阶段:探索现有代码
|
|
76
|
+
|
|
77
|
+
在设计前,探索相关实现:
|
|
78
|
+
|
|
79
|
+
1. **读取 PROJECT.md 的 Project Layout 章节**,确定后端代码所在目录
|
|
80
|
+
2. 按 `references/project-rule-contract.md` 的顺序读取项目规则包,优先使用 `.planning/rules/INDEX.md` 和 `.context/spec/index.md` 匹配 stack/codebase spec,兼容 `.context/spec/`、`.context/workflow/`、`.context/lessons/` 和根目录 `AGENTS.md` / `CLAUDE.md`
|
|
81
|
+
3. 读取 `.planning/navigation/INDEX.md` → 筛选后端/服务类型代码库 → 加载对应 `{name}.md` 导航文件,按目标项目实际结构识别领域/模型、服务、持久化、接口、任务、集成、配置和迁移入口
|
|
82
|
+
4. 若 `.planning/code-index/` 存在,用 Symbol Index 和 Relation Graph 查询相关入口、调用链、读写资源、测试和外部集成候选;读取 `evidence_path:evidence_line` 后再写现状结论
|
|
83
|
+
5. **现有功能复用检查**:编写任何新逻辑前,必须先在项目中搜索是否已有相同或相似功能的实现。优先使用 code-index 查询 symbols/relations;缺失或过期时再按导航和 `rg` 兜底。搜索范围包括:
|
|
84
|
+
- `pkg/` 目录(已有外部集成封装,如支付、红包、短信、二维码等)
|
|
85
|
+
- Service 层(已有业务能力)
|
|
86
|
+
- Repository 层(已有数据访问模式)
|
|
87
|
+
- 工具方法/公共函数
|
|
88
|
+
**严禁绕过已有封装用裸 HTTP 重写已有集成。**
|
|
89
|
+
6. 按导航、code-index 和规则包定向搜索相关功能的现有实现,不硬编码语言、框架或业务目录结构
|
|
90
|
+
7. **寻找最佳实践标杆**:在搜索到的同类功能中,识别实现质量最高的一个作为设计参考。分析其:
|
|
91
|
+
- 分层结构(handler→service→repository→dao 的接口定义方式)
|
|
92
|
+
- 错误处理与传递模式
|
|
93
|
+
- 参数封装与命名惯例
|
|
94
|
+
- 测试覆盖模式
|
|
95
|
+
- API 路由与 Swagger 注解风格
|
|
96
|
+
新功能设计应与此标杆保持一致,避免偏离项目已验证的成熟模式。
|
|
97
|
+
8. 检查三层复用机会:业务能力、已有依赖/库、项目模式;与 baseline 的复用决策保持一致
|
|
98
|
+
9. **识别可抽象能力**:分析新功能中哪些部分具备独立复用价值,应抽象为 `pkg/` 级能力模块。判断标准:
|
|
99
|
+
- 是否在多个业务场景中会被调用(如支付、红包、短信、推送)?
|
|
100
|
+
- 是否对接了外部系统,需要统一的 Client 接口封装?
|
|
101
|
+
- 是否有独立的配置、认证、错误处理逻辑?
|
|
102
|
+
满足任一条件的,应在方案中定义能力接口(Client interface + 参数/结果结构体),参考已有 `pkg/wx_red_pack`、`pkg/wx_pay` 的模式设计。
|
|
103
|
+
10. **执行被影响方探索**:读取 `references/affected-module-exploration.md`,对 baseline 第8.2节"关联历史功能/模块"表格列出的每个受影响模块,按清单逐项读取代码并产出:现状流程图、现有字段/方法表格、集成点列表、复用/扩展/新增决策。探索产出直接填入输出文档的"现有功能说明"(第四章)和"影响范围"(第六章)。**探索产出检查不通过,不得进入 Phase 3。**
|
|
104
|
+
|
|
105
|
+
**关键:如果发现多个相似功能,必须询问用户使用哪个。**
|
|
106
|
+
如果与 baseline 中的用户拍板结果冲突,停止并要求重新确认,不要自行改判。
|
|
107
|
+
|
|
108
|
+
### 第二阶段.5 — Seam 确认(必做)
|
|
109
|
+
|
|
110
|
+
在设计方案前,确认当前的"缝"在哪里。
|
|
111
|
+
|
|
112
|
+
### 第二阶段.6 — Slice Scope Guard
|
|
113
|
+
|
|
114
|
+
如果输入包含当前执行切片:
|
|
115
|
+
|
|
116
|
+
- 在文档开头写明 active `Slice ID`、切片名称、纳入 FP/BR/BC、后置 FP/BR/BC。
|
|
117
|
+
- API、库表、Job、外部集成、消息、权限、迁移设计只允许覆盖当前切片。
|
|
118
|
+
- 共享表或服务若服务于后置切片,必须说明它在当前切片中的可验证用途;否则移到后续范围。
|
|
119
|
+
- 若后端方案必须同时设计多个 slice 才能自洽,停止并要求回到 `workflow-requirement-baseline` 重新切片。
|
|
120
|
+
|
|
121
|
+
**1. 识别候选 seam**
|
|
122
|
+
|
|
123
|
+
根据 baseline 的 `seam_type`(Phase 3.5 产出)识别每个 FP 的切入位置:
|
|
124
|
+
|
|
125
|
+
| FP | baseline seam_type | 候选模块 | 预期操作 |
|
|
126
|
+
|----|-------------------|---------|---------|
|
|
127
|
+
| FP-001 | 扩展 | OrderService | 扩展已有接口 |
|
|
128
|
+
| FP-003 | 新建 | OrderWorkflow(拟新建) | 新建独立模块 |
|
|
129
|
+
|
|
130
|
+
**2. 向用户确认**
|
|
131
|
+
|
|
132
|
+
用一句话确认,不要抛技术细节:
|
|
133
|
+
|
|
134
|
+
> "FP-001 订单审批,我打算在 `OrderService` 加一个 `process()` 方法。这个模块还被其他功能共用吗?"
|
|
135
|
+
>
|
|
136
|
+
> "FP-003 新建的审批流程,我建议新建一个 `OrderWorkflow` 模块。你确认这个位置?"
|
|
137
|
+
|
|
138
|
+
**3. 记录 seam 决策**
|
|
139
|
+
|
|
140
|
+
将用户确认的结果写入方案文档的"影响范围"章节:
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
## Seam 决策记录
|
|
144
|
+
| FP | Seam 位置 | 决策 | 确认人 |
|
|
145
|
+
|----|----------|------|--------|
|
|
146
|
+
| FP-001 | OrderService.process() | 扩展已有接口,不影响现有调用方 | 用户确认 |
|
|
147
|
+
| FP-003 | OrderWorkflow(新建) | 新建独立模块 | 用户确认 |
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**门禁**:每个 FP 必须有 seam 确认记录,否则不得进入 Phase 3。
|
|
151
|
+
|
|
152
|
+
### 第三阶段:生成文档
|
|
153
|
+
|
|
154
|
+
1. 创建 `.planning/features/{功能名}/` 目录
|
|
155
|
+
2. 读取 `assets/backend-spec-template.md` 模板
|
|
156
|
+
3. 按模板结构填充内容,并写入 `需求基线衔接`、`后端规范影响`、`能力抽象建议` 章节
|
|
157
|
+
4. 文件名格式:`.planning/features/{功能名}/后端技术方案.md`
|
|
158
|
+
|
|
159
|
+
If an older baseline still points to root `features/{功能名}/`, treat that as a legacy read path. New backend tech-spec output stays under `.planning/features/{功能名}/`.
|
|
160
|
+
|
|
161
|
+
### 第三阶段.5 — ADR 创建(按需)
|
|
162
|
+
|
|
163
|
+
在生成文档后、用户确认前,检查是否存在"值得记录为 ADR"的决策。
|
|
164
|
+
|
|
165
|
+
**ADR 触发条件(三个必须同时满足):**
|
|
166
|
+
|
|
167
|
+
1. **难逆转** — 改主意代价大(表结构变更、接口重设计、模块拆分决策)
|
|
168
|
+
2. **无上下文会困惑** — 后人会问"为什么这么选"
|
|
169
|
+
3. **有真实权衡** — 有替代方案并且选了其中一个
|
|
170
|
+
|
|
171
|
+
**ADR 格式:**
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
# ADR-001: 使用 OrderWorkflow 而非扩展 OrderService
|
|
175
|
+
|
|
176
|
+
## 状态
|
|
177
|
+
已确认 / 待定 / 已废弃
|
|
178
|
+
|
|
179
|
+
## 上下文
|
|
180
|
+
{当时面临的问题和约束}
|
|
181
|
+
|
|
182
|
+
## 被否决的方案
|
|
183
|
+
{方案 B:扩展 OrderService
|
|
184
|
+
理由:会导致 OrderService 接口膨胀,影响 3 个现有调用方}
|
|
185
|
+
|
|
186
|
+
## 决策
|
|
187
|
+
{方案 A:新建 OrderWorkflow 模块,提供单一 process() 接口}
|
|
188
|
+
|
|
189
|
+
## 后果
|
|
190
|
+
- 正面:接口隔离,不影响现有调用方
|
|
191
|
+
- 负面:多一层抽象,增加模块数量
|
|
192
|
+
- 兼容性:无影响
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**ADR 存放路径**:`.planning/architecture/adr/{序号}-{主题}.md`
|
|
196
|
+
|
|
197
|
+
**不满足条件时不要创建 ADR。** 常规决策(字段名选择、参数顺序等)直接写在方案里即可。
|
|
198
|
+
|
|
199
|
+
### 第四阶段:用户确认
|
|
200
|
+
|
|
201
|
+
1. 展示生成的文档
|
|
202
|
+
2. 询问是否需要修改
|
|
203
|
+
3. 迭代直到用户满意
|
|
204
|
+
|
|
205
|
+
### 第五阶段:结构化元数据
|
|
206
|
+
|
|
207
|
+
完成后写入 `.planning/features/{功能名}/后端技术方案.meta.json`,字段定义见 `feature-development.yaml` 中 `steps[backend-tech-spec].meta_output.fields`:`api_count`, `table_count`, `migration_count`。
|
|
208
|
+
|
|
209
|
+
## 注意事项
|
|
210
|
+
|
|
211
|
+
1. **不要包含代码实现** — 只描述"做什么",不写"怎么做"
|
|
212
|
+
2. **不要包含上线步骤** — 那是运维层面的内容
|
|
213
|
+
3. **不要包含测试用例** — 那是测试阶段的内容
|
|
214
|
+
4. **保持简洁** — 每个章节控制在必要的内容
|
|
215
|
+
5. **必须询问不确定的事项** — 不要猜测或自行决定
|
|
216
|
+
6. **必须描述现有功能** — 新功能如果影响现有功能,必须先描述现有功能的流程、字段、逻辑
|
|
217
|
+
7. **统计类功能要详细** — 对于涉及统计表的变更,必须说明:现有字段及含义、现有统计 SQL/逻辑、Job 调度频率、新增字段及统计逻辑
|
|
218
|
+
8. **只关注后端逻辑** — 流程图只描述后端服务的处理流程,不要包含前端行为
|
|
219
|
+
9. **必须体现项目规则包** — 若目标项目存在 `.planning/rules/` 或 `.context/spec/`,后端方案必须列出适用规范、相关经验教训、工具链要求、测试策略和审查门禁
|
|
220
|
+
10. **历史口径使用 `.planning`** — 与历史相关的判断优先来自 `.planning/milestones/`、`.planning/requirements/`、`.planning/lessons/` 和阶段 `CONTEXT.md`;`features/` 或 `.context/lessons/` 只作为目标项目存在时的兼容来源
|
|
221
|
+
11. **现有功能复用优先** — 编写任何新逻辑前,必须先在项目内搜索已有实现,避免重复造轮子。重点检查:`pkg/` 外部集成封装、Service 层业务能力、Repository 层数据访问模式、公共工具方法。发现已有封装时直接复用,严禁绕过直接写裸调用
|
|
222
|
+
12. **遵循最佳实践标杆** — 新功能的设计(分层、命名、错误处理、参数封装、测试模式)必须与项目内已有标杆功能保持一致,不得引入与项目验证过的成熟模式相悖的新模式。若需偏离,必须在方案中说明理由
|
|
223
|
+
13. **能力抽象** — 新功能中具有独立复用价值的部分(外部集成、通用业务能力),必须抽象为 `pkg/` 级模块,定义清晰的 Client 接口和参数/结果结构体,形成可被后续功能消费的项目能力资产
|
|
224
|
+
|
|
225
|
+
## 强制审查门禁(MANDATORY — 不可跳过)
|
|
226
|
+
|
|
227
|
+
### 反问审查
|
|
228
|
+
|
|
229
|
+
- [ ] 每个不确定的接口设计、库表变更、Job 逻辑是否已向用户确认?(禁止猜测,禁止自行决定)
|
|
230
|
+
- [ ] 涉及调用上游 API 的,是否已向用户索要接口文档并确认对接方案?(不可猜测 API 契约,包括 URL、认证、请求/响应结构、错误码)
|
|
231
|
+
- [ ] 涉及的每个能力点(外部集成、业务逻辑、数据访问、工具方法),是否已在项目内完成复用搜索?**若已有封装却被绕过直接重写,方案不合格。**
|
|
232
|
+
- [ ] `references/affected-module-exploration.md` 的探索产出检查是否全部通过?(现状流程图、字段/方法表格、集成点列表、复用/扩展/新增决策)**若不通过,必须先补充代码探索,不得继续写文档。**
|
|
233
|
+
- [ ] 若 `.planning/code-index/` 存在,复用/影响范围/调用链/读写资源判断是否已查询 code-index 并回读源码 evidence?若未使用,是否说明缺失或过期原因?
|
|
234
|
+
- [ ] 是否已找到项目内最佳实践标杆,并确认新功能的分层结构、命名、错误处理、参数封装模式与标杆一致?(若偏离,理由是否已写明?)
|
|
235
|
+
- [ ] 新功能中具有独立复用价值的部分,是否已识别并抽象为 `pkg/` 级能力模块?接口定义、参数/结果结构体是否清晰?
|
|
236
|
+
- [ ] 方案影响的现有功能是否已描述其**现状流程/字段/逻辑**?(先描述现状,再分析影响)
|
|
237
|
+
- [ ] 涉及统计表的变更,现有字段及含义、现有 SQL/逻辑、Job 调度频率是否已说明?
|
|
238
|
+
- [ ] 若存在 `SL-*`,方案是否只覆盖当前执行切片,且后置切片未进入实现范围?
|
|
239
|
+
|
|
240
|
+
### 反向对照审查(源自 spec-writer 模式)
|
|
241
|
+
|
|
242
|
+
| 嗅探 | 检查 |
|
|
243
|
+
|------|------|
|
|
244
|
+
| 复用嗅探 | 每个新增能力是否已在项目内(pkg/Service/Repository/工具方法)完成复用检查? |
|
|
245
|
+
| 冲突嗅探 | 新增字段/API 路径/表名/枚举是否与现有约定冲突? |
|
|
246
|
+
| 重叠嗅探 | 是否会与已有功能形成"两套并存"? |
|
|
247
|
+
| 背离嗅探 | 新功能的分层/命名/错误处理/参数模式是否偏离项目标杆?若偏离,理由是否充分? |
|
|
248
|
+
| 内聚嗅探 | 可独立复用的能力(外部集成/通用业务)是否被内聚在业务代码中未抽离为 `pkg/` 模块? |
|
|
249
|
+
|
|
250
|
+
### 产物完整性
|
|
251
|
+
|
|
252
|
+
- [ ] 方案包含:功能要点、影响范围、库表设计(DDL+ER)、流程设计、风险点
|
|
253
|
+
- [ ] 不含前端组件、前端路由(那属于前端技术方案)
|
|
254
|
+
- [ ] 若存在 `.planning/rules/` 或 `.context/spec/`,适用规范+经验教训+工具链+测试策略已列出
|
|
255
|
+
- [ ] 审查结论已写入方案末尾
|
|
256
|
+
|
|
257
|
+
**审查结论不通过时不得报告 "Step 3c 完成"。**
|