@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,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-update-navigation
|
|
3
|
+
description: "Use when code changes require incremental updates to .planning/navigation files before audit, archive, or future workflow steps."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Legacy Command Metadata
|
|
7
|
+
|
|
8
|
+
Original slash-command metadata retained only as workflow invocation guidance.
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
user-invocable: true
|
|
12
|
+
pattern: generator+reviewer
|
|
13
|
+
inputs:
|
|
14
|
+
- .planning/features/{功能名}/变更清单.md
|
|
15
|
+
- .planning/navigation/
|
|
16
|
+
output: .planning/navigation/{name}.md (updated)
|
|
17
|
+
phase-gate:
|
|
18
|
+
step1: 加载变更清单和当前 navigation
|
|
19
|
+
step2: 识别受影响的代码库和模块
|
|
20
|
+
step3: 增量更新 Directory Map
|
|
21
|
+
step4: 增量更新 Call Chain Map
|
|
22
|
+
step5: 增量更新 Conventions
|
|
23
|
+
step6: 更新 Scan Status 和审查
|
|
24
|
+
allowed-tools:
|
|
25
|
+
- Read
|
|
26
|
+
- Write
|
|
27
|
+
- Bash
|
|
28
|
+
- Grep
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
# Navigation Update
|
|
32
|
+
|
|
33
|
+
Incrementally update navigation files after code changes. Do not re-scan the entire project — only update sections affected by the change list.
|
|
34
|
+
|
|
35
|
+
## Outputs
|
|
36
|
+
|
|
37
|
+
Always update:
|
|
38
|
+
|
|
39
|
+
- `.planning/navigation/{name}.md` — affected codebase navigation files
|
|
40
|
+
- `.planning/navigation/INDEX.md` — Codebase Registry scan status timestamps
|
|
41
|
+
|
|
42
|
+
When `.planning/code-index/` exists or code-index support is part of the project workflow, also refresh and audit the machine index before editing Markdown navigation:
|
|
43
|
+
|
|
44
|
+
- `.planning/code-index/files.jsonl`
|
|
45
|
+
- `.planning/code-index/symbols.jsonl`
|
|
46
|
+
- `.planning/code-index/relations.jsonl`
|
|
47
|
+
- `.planning/code-index/diagnostics.jsonl`
|
|
48
|
+
- `.planning/code-index/index.sqlite`
|
|
49
|
+
- `.planning/code-index/AUDIT.md`
|
|
50
|
+
|
|
51
|
+
Do not create by default:
|
|
52
|
+
|
|
53
|
+
- New navigation files (only update existing ones)
|
|
54
|
+
- New `.planning/` directories
|
|
55
|
+
|
|
56
|
+
## Resource Loading
|
|
57
|
+
|
|
58
|
+
- Read `references/incremental-update-guide.md` before updating any navigation file.
|
|
59
|
+
|
|
60
|
+
## Phase 1 — Load Change List And Current Navigation
|
|
61
|
+
|
|
62
|
+
1. Read `.planning/features/{功能名}/变更清单.md` — extract all code-level changes (new/modified/deleted/renamed files).
|
|
63
|
+
2. Read `.planning/navigation/INDEX.md` — identify which codebases are affected by the changes.
|
|
64
|
+
3. For each affected codebase, read its `.planning/navigation/{name}.md`.
|
|
65
|
+
4. If `.planning/code-index/` exists, collect changed file paths and run an incremental code-index refresh before updating Markdown navigation:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
devflow_code_index(action="scan", changedFiles=["<changed-file>", "..."])
|
|
69
|
+
devflow_code_index(action="audit")
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If change list is missing, tell the user to run `workflow-change-plan` first.
|
|
73
|
+
|
|
74
|
+
If code-index refresh fails, report the failure. Continue with navigation updates only when the changed files can still be safely traced from navigation and source; otherwise stop and fix the index first.
|
|
75
|
+
|
|
76
|
+
## Phase 2 — Identify Affected Sections
|
|
77
|
+
|
|
78
|
+
Cross-reference each change in the change list with the navigation file to determine which sections need updating:
|
|
79
|
+
|
|
80
|
+
| Change Type | Affected Navigation Section | Update Action |
|
|
81
|
+
|-------------|----------------------------|---------------|
|
|
82
|
+
| New directory | `### Directory Map` | Add directory to tree and table |
|
|
83
|
+
| Deleted directory | `### Directory Map` | Remove from tree and table, or mark deprecated |
|
|
84
|
+
| New handler / controller | `#### API Modules` | Add row with route group, call chain |
|
|
85
|
+
| Modified handler (new/changed routes) | `#### API Modules` | Update routes and call chain for that row |
|
|
86
|
+
| Deleted handler | `#### API Modules` | Remove row or mark deprecated |
|
|
87
|
+
| New page component | `#### Route-Component Map` | Add row with child components, composables, API calls |
|
|
88
|
+
| Modified page component | `#### Route-Component Map` | Update child components / composables for that row |
|
|
89
|
+
| New shared component | `#### Route-Component Map` | Update affected page rows that now use it |
|
|
90
|
+
| New composable / API client | `#### Data Flow` | Add row with API client, state shape, consumers |
|
|
91
|
+
| New job / scheduler | `#### Scheduled Jobs` | Add row with cron, trigger, call chain |
|
|
92
|
+
| Modified job | `#### Scheduled Jobs` | Update cron or call chain for that row |
|
|
93
|
+
| New external integration | `#### External Integrations` | Add row with path, direction |
|
|
94
|
+
| Changed coding convention | `### Conventions` | Add or update convention row |
|
|
95
|
+
| Unchanged modules | None | Skip — do not re-scan |
|
|
96
|
+
|
|
97
|
+
Rules:
|
|
98
|
+
- Changes that don't affect directory structure, call chains, or conventions are skipped (e.g., internal logic changes within a service method).
|
|
99
|
+
- If a change affects a module that doesn't exist in the current navigation, add it as new.
|
|
100
|
+
|
|
101
|
+
## Phase 3 — Update Directory Map
|
|
102
|
+
|
|
103
|
+
For new or deleted directories identified in Phase 2:
|
|
104
|
+
|
|
105
|
+
1. Read the changed directory from the actual codebase.
|
|
106
|
+
2. Update the ASCII tree in `### Directory Map` — add new branches, remove deleted ones.
|
|
107
|
+
3. Update the Directory | Purpose | Notes table.
|
|
108
|
+
|
|
109
|
+
Scan depth: top-level and second-level only. Do not deeply read source files — infer purpose from directory names and file names.
|
|
110
|
+
|
|
111
|
+
Gate: all changed directories from the change list are reflected in the Directory Map.
|
|
112
|
+
|
|
113
|
+
## Phase 4 — Update Call Chain Map
|
|
114
|
+
|
|
115
|
+
For affected handlers, routes, components, jobs, or integrations identified in Phase 2:
|
|
116
|
+
|
|
117
|
+
**Backend-type codebases:**
|
|
118
|
+
1. Read the changed handler files. Extract route registrations.
|
|
119
|
+
2. Trace the call chain: handler method → service → repository → dao.
|
|
120
|
+
3. Update `#### API Modules` table: add new rows, update modified rows, remove deleted rows.
|
|
121
|
+
4. Read changed job files. Extract cron expression and call chain.
|
|
122
|
+
5. Update `#### Scheduled Jobs` table.
|
|
123
|
+
6. If new external integrations were added, update `#### External Integrations`.
|
|
124
|
+
|
|
125
|
+
**Frontend-type codebases:**
|
|
126
|
+
1. Read the changed page component files. Extract child component imports and composable usage.
|
|
127
|
+
2. Read changed composable files. Extract API client calls and state shape.
|
|
128
|
+
3. Update `#### Route-Component Map` table.
|
|
129
|
+
4. Update `#### Data Flow` table.
|
|
130
|
+
|
|
131
|
+
Use the same call chain tracing method as `workflow-project-context` Step 3b, but limited to changed modules only.
|
|
132
|
+
|
|
133
|
+
If code-index is available, use `.planning/code-index/relations.jsonl` or `index.sqlite` as the first source for fine-grained call relationships, then read the changed source files to confirm evidence before updating navigation. Navigation remains a human-readable summary; do not copy unverified low-confidence relations into navigation as facts.
|
|
134
|
+
|
|
135
|
+
Gate: every changed handler/route/component/job from the change list has its corresponding row updated in the navigation file.
|
|
136
|
+
|
|
137
|
+
## Phase 5 — Update Conventions
|
|
138
|
+
|
|
139
|
+
Only if the change list indicates convention changes:
|
|
140
|
+
- `.cursorrules` or `AGENTS.md` / `CLAUDE.md` was modified
|
|
141
|
+
- New coding patterns were introduced that differ from existing conventions
|
|
142
|
+
- User explicitly requested convention update
|
|
143
|
+
|
|
144
|
+
Extract conventions using the same method as `workflow-project-context` Step 3c, limited to changed areas.
|
|
145
|
+
|
|
146
|
+
If conventions haven't changed, skip this phase.
|
|
147
|
+
|
|
148
|
+
## Phase 6 — Update Scan Status And Review
|
|
149
|
+
|
|
150
|
+
1. For each updated codebase navigation file:
|
|
151
|
+
- Update `Identity → Scan Status` to the current date
|
|
152
|
+
- Add a note: "Updated after 变更清单 execution, {日期}"
|
|
153
|
+
2. Update `.planning/navigation/INDEX.md`:
|
|
154
|
+
- Sync the `Scan Status` column in the Codebase Registry for affected codebases
|
|
155
|
+
3. Run the review checklist:
|
|
156
|
+
|
|
157
|
+
- [ ] 变更清单中每个涉及代码结构的变更项都在 navigation 中有对应更新
|
|
158
|
+
- [ ] 新增的 handler/route/component/job 调用链已追溯
|
|
159
|
+
- [ ] 删除/重命名的模块在 navigation 中已更新或标记
|
|
160
|
+
- [ ] Directory Map 反映当前代码库顶层目录
|
|
161
|
+
- [ ] Scan Status 已更新为当前时间
|
|
162
|
+
- [ ] INDEX.md Codebase Registry 已同步
|
|
163
|
+
- [ ] 未变更模块未被重新扫描(没有不必要的写入)
|
|
164
|
+
|
|
165
|
+
Fix gaps before reporting completion.
|
|
166
|
+
|
|
167
|
+
## Executable Self-Check
|
|
168
|
+
|
|
169
|
+
Run these commands after all navigation edits. Replace `<affected-navigation-file>` with every navigation file selected in Phase 1.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
test -s .planning/navigation/INDEX.md
|
|
173
|
+
test -s .planning/navigation/<affected-navigation-file>
|
|
174
|
+
test -s .planning/code-index/AUDIT.md # when the code index exists
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
When `.planning/code-index/` exists, call `devflow_code_index(action="validate")` and
|
|
178
|
+
`devflow_code_index(action="audit")` before the shell artifact checks.
|
|
179
|
+
|
|
180
|
+
The code-index commands are required only when `.planning/code-index/` exists or this workflow refreshed it. Pass only when every selected navigation file and `INDEX.md` is non-empty, `validate` and `audit` exit with code 0, and `AUDIT.md` contains no blocking finding. Also complete every Phase 6 checklist item; commands validate artifact integrity, while the checklist validates change-list coverage. If any check fails, do not advance to audit or archive: correct the navigation/index discrepancy and rerun the failed checks.
|
|
181
|
+
|
|
182
|
+
## Downstream Read Contract
|
|
183
|
+
|
|
184
|
+
- `workflow-complete-milestone` should verify that navigation `Scan Status` is not older than the last commit before archiving.
|
|
185
|
+
- Future `workflow-requirement-baseline` invocations will read the updated navigation for conflict and reuse detection.
|
|
186
|
+
- Future source-tracing tasks should use `.planning/code-index/` for fine-grained relation facts when available, with source readback before answering.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 增量更新指引
|
|
2
|
+
|
|
3
|
+
## 更新范围控制
|
|
4
|
+
|
|
5
|
+
只重新扫描变更清单中涉及的模块。变更清单外的代码库和模块不做任何扫描或写入。
|
|
6
|
+
|
|
7
|
+
如果项目存在 `.planning/code-index/`,先按变更文件刷新机器索引,再更新 Markdown navigation:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
devflow_code_index(action="scan", changedFiles=["<changed-file>", "..."])
|
|
11
|
+
devflow_code_index(action="audit")
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
机器索引用于细粒度事实追踪,navigation 只记录人读摘要。低置信度或无源码证据的 relation 不应写成 navigation 事实。
|
|
15
|
+
|
|
16
|
+
## 变更类型到更新章节的映射
|
|
17
|
+
|
|
18
|
+
| 变更类型 | 文件路径特征 | 更新章节 |
|
|
19
|
+
|---------|-------------|---------|
|
|
20
|
+
| 新增目录 | 新增的目录路径 | Directory Map |
|
|
21
|
+
| 删除目录 | 已删除的目录路径 | Directory Map |
|
|
22
|
+
| 新增 handler/controller | `*_handler.go`, `*_controller.*` | API Modules |
|
|
23
|
+
| 修改 handler 路由 | 同 handler 文件被修改 | API Modules(更新对应行) |
|
|
24
|
+
| 新增页面组件 | `src/pages/**/*.vue`, `src/views/**/*.tsx` | Route-Component Map |
|
|
25
|
+
| 新增公共组件 | `src/components/**` | Route-Component Map(更新引用者) |
|
|
26
|
+
| 新增 composable | `src/hooks/**`, `src/composables/**` | Data Flow |
|
|
27
|
+
| 新增 job | `*_job.go`, `*Job.java` | Scheduled Jobs |
|
|
28
|
+
| 新增外部集成 | `pkg/**` 新增外部调用 | External Integrations |
|
|
29
|
+
| 修改 .cursorrules | `.cursorrules` | Conventions |
|
|
30
|
+
|
|
31
|
+
## 调用链追溯方法
|
|
32
|
+
|
|
33
|
+
复用 `workflow-project-context` Step 3b 的追溯逻辑,但仅限于变更涉及的 handler/route/component/job。不变更的模块跳过。
|
|
34
|
+
|
|
35
|
+
当 code-index 可用时:
|
|
36
|
+
|
|
37
|
+
1. 先从 `.planning/code-index/index.sqlite` 或 `relations.jsonl` 查 changed files 对应 symbols/relations。
|
|
38
|
+
2. 按 `routes_to`、`calls`、`imports`、`reads`、`writes` 扩展相关边。
|
|
39
|
+
3. 回读 `evidence_path` 源码。
|
|
40
|
+
4. 只把已确认且适合人读摘要的链路写入 navigation。
|
|
41
|
+
|
|
42
|
+
## 标记已废弃
|
|
43
|
+
|
|
44
|
+
如果变更清单删除了某个模块:
|
|
45
|
+
- 不直接从 navigation 删除行
|
|
46
|
+
- 在 Notes 列标记 `已废弃于 {日期}`
|
|
47
|
+
- 下次全量初始化时由 project-context 清理
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-code-reviewer
|
|
3
|
+
description: Read-only adversarial code reviewer focused on correctness, security, regressions, and contract violations in changed files.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- find
|
|
8
|
+
- lsp
|
|
9
|
+
- bash
|
|
10
|
+
model: "@slow"
|
|
11
|
+
thinkingLevel: high
|
|
12
|
+
autoloadSkills:
|
|
13
|
+
- code-review
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
Review the actual diff and its affected call paths. Prefer concrete defects over style commentary. For each finding provide severity, file and location, triggering scenario, impact, and a minimal fix direction. Verify whether tests cover the failure.
|
|
17
|
+
|
|
18
|
+
Do not edit code, fix findings, or mutate workflow state. If no actionable finding remains, say so and list the validation evidence inspected.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-runner
|
|
3
|
+
description: Independent verification agent that executes tests and acceptance checks without modifying implementation or workflow state.
|
|
4
|
+
tools:
|
|
5
|
+
- read
|
|
6
|
+
- grep
|
|
7
|
+
- find
|
|
8
|
+
- lsp
|
|
9
|
+
- bash
|
|
10
|
+
- browser
|
|
11
|
+
- devflow_mainflow
|
|
12
|
+
model: "@task"
|
|
13
|
+
thinkingLevel: medium
|
|
14
|
+
autoloadSkills:
|
|
15
|
+
- workflow-verify-work
|
|
16
|
+
- workflow-generate-mainflow-cases
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
Verify the assigned acceptance criteria against the built system. Run the smallest deterministic checks first, then integration or browser flows when required. Capture exact commands, observed results, logs or screenshots, and reproducibility details.
|
|
20
|
+
|
|
21
|
+
Do not change implementation to make tests pass and do not mark checkpoints. Return pass, fail, or blocked for each criterion, with evidence and the narrowest suspected fault boundary.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
import type { ExtensionAPI } from "@oh-my-pi/pi-coding-agent";
|
|
6
|
+
|
|
7
|
+
export default function devflowQuality(pi: ExtensionAPI) {
|
|
8
|
+
const { z } = pi.zod;
|
|
9
|
+
pi.registerTool({
|
|
10
|
+
name: "devflow_mainflow",
|
|
11
|
+
label: "Devflow Mainflow Cases",
|
|
12
|
+
description: "Run an allowlisted main-flow discovery, compile, or validation operation.",
|
|
13
|
+
parameters: z.object({
|
|
14
|
+
action: z.enum(["discover", "compile", "validate"]),
|
|
15
|
+
args: z.array(z.string()).default([]),
|
|
16
|
+
}),
|
|
17
|
+
approval: "exec",
|
|
18
|
+
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
19
|
+
const moduleDirectory = path.dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const roots = [
|
|
21
|
+
process.env.DEVFLOW_KIT_ROOT,
|
|
22
|
+
path.join(ctx.cwd, ".skills"),
|
|
23
|
+
path.resolve(moduleDirectory, "../skills"),
|
|
24
|
+
path.resolve(moduleDirectory, "../../.."),
|
|
25
|
+
].filter(Boolean) as string[];
|
|
26
|
+
const skillRoot = roots.find(root =>
|
|
27
|
+
existsSync(path.join(root, "workflow-generate-mainflow-cases/scripts")),
|
|
28
|
+
);
|
|
29
|
+
if (!skillRoot) throw new Error("Devflow quality skills not found");
|
|
30
|
+
const scripts = {
|
|
31
|
+
discover: "discover_codebases.py",
|
|
32
|
+
compile: "compile_dsl.py",
|
|
33
|
+
validate: "validate_case_payloads.py",
|
|
34
|
+
} as const;
|
|
35
|
+
const script = path.join(
|
|
36
|
+
skillRoot,
|
|
37
|
+
"workflow-generate-mainflow-cases/scripts",
|
|
38
|
+
scripts[params.action],
|
|
39
|
+
);
|
|
40
|
+
const child = Bun.spawn(["python3", script, ...params.args], {
|
|
41
|
+
cwd: ctx.cwd,
|
|
42
|
+
stdout: "pipe",
|
|
43
|
+
stderr: "pipe",
|
|
44
|
+
});
|
|
45
|
+
const [exitCode, stdout, stderr] = await Promise.all([
|
|
46
|
+
child.exited,
|
|
47
|
+
new Response(child.stdout).text(),
|
|
48
|
+
new Response(child.stderr).text(),
|
|
49
|
+
]);
|
|
50
|
+
const out = stdout.trim();
|
|
51
|
+
const err = stderr.trim();
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text" as const, text: out || err || `Process exited with ${exitCode}` }],
|
|
54
|
+
details: { action: params.action, exitCode, stderr: err || undefined },
|
|
55
|
+
isError: exitCode !== 0,
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: "Use when code needs review for project conventions, spec compliance, behavioral risks, missing tests, change-list completion criteria verification, or post-refactor validation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 代码规范审查技能
|
|
7
|
+
|
|
8
|
+
逐层对照 `.context/spec/` 规范文档,检查目标代码的合规性,输出可操作的问题清单。若项目存在 `.context/spec/index.md`,先按索引匹配 stack spec 和 codebase spec,再加载具体层级规范。
|
|
9
|
+
|
|
10
|
+
## 核心原则
|
|
11
|
+
|
|
12
|
+
1. **规范是唯一标准** — 只对照 `.context/spec/` 中的规范文档,不参考其他已有代码;代码推断规则必须低于显式规范和 codebase spec
|
|
13
|
+
2. **文件级全量扫描** — 扫描目标文件的每一行,不只看"最近改动的部分"
|
|
14
|
+
3. **逐条不跳过** — 规范文档中的每一条规则都要检查,包括"看起来无关"的细节。**禁止主观过滤**:不能因为"这个 VO 字段很简单"、"只有一个字段"、"直接传字符串"等主观判断而跳过检查项,规范就是规范,简单的代码同样要逐条对照
|
|
15
|
+
4. **加法和减法都查** — 既查"缺了什么该有的",也查"多了什么不该有的"(未使用方法/字段/import)
|
|
16
|
+
|
|
17
|
+
## 工作流程
|
|
18
|
+
|
|
19
|
+
### 第零步:提取变更清单完成标准
|
|
20
|
+
|
|
21
|
+
**当 code-review 作为 feature-development 工作流的独立 `code-review` step 被调用时必须执行。** 独立调用 code-review(如"帮我 review 一下 XX 模块")时,若提供 phase number 则尝试关联变更清单,否则跳过此步。
|
|
22
|
+
|
|
23
|
+
1. **定位变更清单**:
|
|
24
|
+
- 若传入 phase number:从 phase 目录的 CONTEXT.md 推断功能名,查找 `.planning/features/{功能名}/变更清单.md`
|
|
25
|
+
- 若直接调用但用户提供了变更清单路径:使用用户指定路径
|
|
26
|
+
- 若找不到变更清单:跳过此步,在输出 REVIEW.md 中标注 "无变更清单,跳过完成标准验证"
|
|
27
|
+
|
|
28
|
+
2. **提取每个任务的完成标准**:
|
|
29
|
+
- 遍历变更清单中所有 `### T-XXX` 或 `#### {编号}` 任务块
|
|
30
|
+
- 从每个任务的 `**完成标准**` / `**完成标准:**` 字段中提取所有条目
|
|
31
|
+
- 区分格式:
|
|
32
|
+
- `- [ ] 具体描述` → checkbox 格式(新格式,可精确验证)
|
|
33
|
+
- `- 具体描述` → 纯列表格式(旧格式,尽力验证但精度有限)
|
|
34
|
+
|
|
35
|
+
3. **提取每个任务的文件路径**:
|
|
36
|
+
- 从 `**文件**:` / `**文件**` 字段获取目标文件路径
|
|
37
|
+
- 支持多文件(反引号路径或逗号/换行分隔列表)
|
|
38
|
+
|
|
39
|
+
4. **构建验证清单**:
|
|
40
|
+
- 对每条 `- [ ]` 条目,组装:`{任务ID, 文件路径, 标准描述, 格式类型}`
|
|
41
|
+
- 对纯列表条目,标记 `format: legacy`,后续验证尽力而为
|
|
42
|
+
|
|
43
|
+
### 第一步:确定审查范围
|
|
44
|
+
|
|
45
|
+
用户可能以多种方式描述需求:
|
|
46
|
+
|
|
47
|
+
- "帮我 review 一下 activity_rule_config" → 审查该模块全部层级
|
|
48
|
+
- "检查 handler 层是否符合规范" → 审查指定层级
|
|
49
|
+
- "重构完了,检查一下" → 审查当前 git diff 涉及的文件
|
|
50
|
+
|
|
51
|
+
**确定范围后,识别涉及的层级**:
|
|
52
|
+
|
|
53
|
+
|| 层级 | 文件位置 | 对应规范 |
|
|
54
|
+
| ---------- | ---------------------------------- | --------------------------------- |
|
|
55
|
+
| Handler | `internal/web/*_handler.go` | handler.md |
|
|
56
|
+
| VO | `internal/web/vo/*_vo.go` | vo.md |
|
|
57
|
+
|
|
58
|
+
### 第一步.5 — Seam 越界检查
|
|
59
|
+
|
|
60
|
+
在加载规范之前,先检查本次要审查的代码是否在预设的 seam 范围内。
|
|
61
|
+
|
|
62
|
+
**1. 读取 seam 标注**
|
|
63
|
+
|
|
64
|
+
查找变更清单或 API 调用指南中的 seam 信息:
|
|
65
|
+
|
|
66
|
+
- 如果有 `api-call-guide.md`:从每个步骤的 `Seam` 字段提取
|
|
67
|
+
- 如果有 `变更清单.md`(旧版):从每个任务的 seam 标注提取
|
|
68
|
+
- 如果两者都没有:跳过此步骤
|
|
69
|
+
|
|
70
|
+
**2. 对比 seam 标注与实际修改文件**
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
seam 标注: "只改 OrderWorkflow.process()"
|
|
74
|
+
实际修改列表: OrderWorkflow.go (✅ 范围内)
|
|
75
|
+
OrderService.go (❌ 越界!)
|
|
76
|
+
|
|
77
|
+
→ 标记为 seam 越界项
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**3. 判断越界严重级别**
|
|
81
|
+
|
|
82
|
+
| 级别 | 定义 | 处理 |
|
|
83
|
+
|------|------|------|
|
|
84
|
+
| 🔴 阻塞 | 改了 seam 外且无文档说明 | 必须修复,审查不通过 |
|
|
85
|
+
| 🟡 警告 | 改了 seam 外但有技术方案支持 | 记录,需确认 |
|
|
86
|
+
| 🟢 信息 | 改了 seam 内但接口新增过多 | 记录观察 |
|
|
87
|
+
|
|
88
|
+
**4. 接口膨胀检查**
|
|
89
|
+
|
|
90
|
+
检查被修改的模块,其公开方法是否在本次变更中显著增加:
|
|
91
|
+
|
|
92
|
+
- 新增 ≤ 2 个公开方法 → 🟢
|
|
93
|
+
- 新增 3-5 个 → 🟡 标记为"接口膨胀观察项"
|
|
94
|
+
- 新增 > 5 个 → 🔴 标记为"模块深度退化——考虑拆分"
|
|
95
|
+
|
|
96
|
+
**输出**:seam 越界检查结果清单,列入审查问题清单。
|
|
97
|
+
|
|
98
|
+
### 第二步:加载规范(渐进式)
|
|
99
|
+
| DAO | `internal/repository/dao/*_dao.go` | dao.md |
|
|
100
|
+
| Domain | `internal/domain/*.go` | 各层规范中的 domain 相关条目 |
|
|
101
|
+
|
|
102
|
+
如果涉及分页,额外加载 `pagination.md`。
|
|
103
|
+
|
|
104
|
+
### 第二步:加载规范(渐进式)
|
|
105
|
+
|
|
106
|
+
**必读**(每次审查都要读):
|
|
107
|
+
1. `.planning/rules/INDEX.md`(如存在)— 找到项目规则入口
|
|
108
|
+
2. `.context/spec/index.md`(如存在)— 匹配目标文件所在 codebase 的 stack spec 和 codebase spec
|
|
109
|
+
3. 命中的 `.context/spec/stacks/{stack_key}.md` — 技术栈通用规范
|
|
110
|
+
4. 命中的 `.context/spec/backend|frontend/{codebase}.md` — 项目实例规范
|
|
111
|
+
5. `.planning/code-index/`(如存在)— 用于调用方、被调用方、导入、读写资源、测试覆盖等关系事实定位
|
|
112
|
+
6. 兼容旧规范:`.context/spec/backend/index.md` 和 `.context/spec/backend/go.md`(如存在)
|
|
113
|
+
|
|
114
|
+
**按层级按需加载**(只读涉及的层级,详见 `references/spec-checklist.md`):
|
|
115
|
+
- Handler 层 → 读 `handler.md`
|
|
116
|
+
- VO 层 → 读 `vo.md`
|
|
117
|
+
- Service 层 → 读 `service.md` + `errors.md` + `logging.md`
|
|
118
|
+
- Repository 层 → 读 `repository.md`
|
|
119
|
+
- DAO 层 → 读 `dao.md`
|
|
120
|
+
- 有分页 → 读 `pagination.md`
|
|
121
|
+
|
|
122
|
+
**经验教训**(目录存在时读取):
|
|
123
|
+
- `.context/lessons/README.md`(如存在)— 项目积累的踩坑经验;不存在时跳过,不阻塞审查
|
|
124
|
+
|
|
125
|
+
### 第三步:逐层执行审查
|
|
126
|
+
|
|
127
|
+
**对每一个目标文件**,按以下流程执行:
|
|
128
|
+
|
|
129
|
+
1. **⛔ Gate 前置:先查 code-index** — 在读取任何业务源码之前,必须先用 `code_index outline` 或 `code_index search` 获取目标文件的符号表。code-index 不可用时用 LSP `documentSymbol` 兜底。
|
|
130
|
+
2. **用 code-index relations 查引用/调用/导入/测试覆盖** — 确认每个导出方法是否有调用方;code-index 缺失、过期或无命中时再用 Grep / LSP findReferences 兜底
|
|
131
|
+
3. **回读源码 evidence** — 对用于审查结论的 relation,必须读取 `evidence_path:evidence_line` 附近源码。**此时可声明"基于 code-index 符号 [X] 读取源码"以通过 gate。**
|
|
132
|
+
4. **逐条对照规范检查清单** — 详见 `references/` 目录下各层级的检查清单:
|
|
133
|
+
- Handler 层 → `references/handler-checklist.md`
|
|
134
|
+
- VO 层 → `references/vo-checklist.md`
|
|
135
|
+
- Service 层 → `references/service-checklist.md`
|
|
136
|
+
- Repository 层 → `references/repository-checklist.md`
|
|
137
|
+
- DAO 层 → `references/dao-checklist.md`
|
|
138
|
+
- 跨层检查 → `references/cross-layer-checklist.md`
|
|
139
|
+
|
|
140
|
+
**⛔ Gate 合规检查:** 审查输出中,每个涉及源码的结论必须附带 code-index 符号引用(格式:`[符号名 @ path:line]`)。若审查全程未出现 code-index 查询操作,或输出中的源码引用无 code-index 依据,则在问题清单最上方追加:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
⛔ SOURCE-READ GATE VIOLATION — 本次审查未走 .planning/code-index/ gate。
|
|
144
|
+
审查结论降级为"未经索引验证",需重新执行。
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 第四步:输出问题清单
|
|
148
|
+
|
|
149
|
+
按以下格式输出,按优先级分组:
|
|
150
|
+
|
|
151
|
+
```markdown
|
|
152
|
+
## 问题清单
|
|
153
|
+
|
|
154
|
+
### 高优先级
|
|
155
|
+
| # | 层级 | 文件:行号 | 问题描述 | 规范依据 |
|
|
156
|
+
| --- | ---- | --------- | -------- | -------- |
|
|
157
|
+
|
|
158
|
+
### 中优先级
|
|
159
|
+
| # | 层级 | 文件:行号 | 问题描述 | 规范依据 |
|
|
160
|
+
|
|
161
|
+
### 低优先级
|
|
162
|
+
| # | 层级 | 文件:行号 | 问题描述 | 规范依据 |
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**优先级判断标准**:
|
|
166
|
+
- **高**:违反核心原则(跨层职责、错误处理模式、缺少必要字段 tag)
|
|
167
|
+
- **中**:不符合规范细节(命名、排序、nil slice、未使用代码)
|
|
168
|
+
- **低**:风格偏好(字段命名惯例、代码组织顺序)
|
|
169
|
+
|
|
170
|
+
### 第四步附:兼容性影响评估
|
|
171
|
+
|
|
172
|
+
输出问题清单后,**必须**对每个建议修改项评估兼容性影响。如果存在以下风险,在问题清单之后单独输出 **兼容性风险提示**:
|
|
173
|
+
|
|
174
|
+
#### 前端兼容性
|
|
175
|
+
|
|
176
|
+
涉及以下修改时必须提示用户:
|
|
177
|
+
|
|
178
|
+
- **VO 返回字段变更**:修改已有返回 VO 的 `json` tag 名称、删除字段、变更字段类型 → 会导致前端解析失败
|
|
179
|
+
- **响应结构层级变化**:如分页响应从 `{total, list}` 改为 `{total_count, list, has_next, page}` → 前端可能依赖旧的字段名
|
|
180
|
+
- **错误码/消息变更**:修改已有的错误码数值或消息文案 → 前端可能基于错误码做了逻辑判断
|
|
181
|
+
- **接口路径或参数名变更**:改变 `form`/`json` tag 的 key → 前端请求参数将不匹配
|
|
182
|
+
|
|
183
|
+
**提示格式**:
|
|
184
|
+
```markdown
|
|
185
|
+
## 兼容性风险提示
|
|
186
|
+
|
|
187
|
+
### 前端兼容性
|
|
188
|
+
| # | 修改项 | 风险描述 | 建议方案 |
|
|
189
|
+
| --- | -------------------------------- | ------------------- | ------------------------------------- |
|
|
190
|
+
| 1 | 分页响应字段 total → total_count | 前端依赖 total 字段 | 保留 total 字段兼容,新增 total_count |
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### 数据库兼容性
|
|
194
|
+
|
|
195
|
+
涉及以下修改时必须提示用户:
|
|
196
|
+
|
|
197
|
+
- **Model 字段变更**:重命名、删除、修改类型 → 需要 DDL 迁移,可能影响线上数据
|
|
198
|
+
- **表名变更**:修改 `TableName()` 返回值 → 需要 DDL 迁移
|
|
199
|
+
- **索引或约束变更**:添加/修改唯一索引、外键 → 可能与现有数据冲突
|
|
200
|
+
- **新增非空字段无默认值**:INSERT 时报错
|
|
201
|
+
|
|
202
|
+
**提示格式**:
|
|
203
|
+
```markdown
|
|
204
|
+
### 数据库兼容性
|
|
205
|
+
| # | 修改项 | 风险描述 | 建议方案 |
|
|
206
|
+
| --- | ------------------------------- | ----------------------------- | ------------------------------ |
|
|
207
|
+
| 1 | 删除 model.Xxx 的 OldField 字段 | 线上表仍有该列,需要 DDL 迁移 | 先加新列 → 数据迁移 → 再删旧列 |
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**如果不涉及兼容性风险,不需要输出此节。**
|
|
211
|
+
|
|
212
|
+
### 第四步.五:验证变更清单完成标准
|
|
213
|
+
|
|
214
|
+
**前置条件:** 已完成第零步(提取了变更清单完成标准)。若第零步未找到变更清单或全部为 legacy 格式,则 `completion_criteria_status = "skipped"`。
|
|
215
|
+
|
|
216
|
+
对第零步提取的每条完成标准,读取目标文件的完整内容,逐条验证:
|
|
217
|
+
|
|
218
|
+
#### 验证方法
|
|
219
|
+
|
|
220
|
+
1. **读取目标文件**:读取任务对应文件(从变更清单 `**文件**` 字段获取)的当前内容
|
|
221
|
+
2. **搜索证据**:扫描代码中是否有与标准描述匹配的实现
|
|
222
|
+
- 字段/方法/类定义:搜索对应的名称(如 `_evaluate_network_assertions`、`uiAssertionOptions`)
|
|
223
|
+
- 逻辑行为:搜索关键代码模式(`try/finally`、`if page is None`、`page.on("response")`)
|
|
224
|
+
- 配置/常量值:搜索枚举值、数组长度、配置项
|
|
225
|
+
- 导入/调用关系:优先查 code-index 的 `imports`、`calls`、`routes_to`、`tested_by`,再回读源码;缺失时搜索 `import`、调用语句、注册逻辑
|
|
226
|
+
3. **判定状态**:
|
|
227
|
+
- `✅ PASSED` — 代码中有明确证据满足标准(标注文件:行号作为证据)
|
|
228
|
+
- `❌ FAILED` — 代码与标准描述矛盾,或应有但缺失
|
|
229
|
+
- `⚠️ UNVERIFIABLE` — 标准描述过于模糊,无法通过静态分析判定(如"用户体验良好"、"功能正常工作")
|
|
230
|
+
- `— SKIPPED` — 旧格式条目(无 `[ ]`),已尽力验证但精度有限
|
|
231
|
+
|
|
232
|
+
#### 输出格式
|
|
233
|
+
|
|
234
|
+
```markdown
|
|
235
|
+
## 完成标准验证
|
|
236
|
+
|
|
237
|
+
> **来源**:`.planning/features/{功能名}/变更清单.md`
|
|
238
|
+
> **格式**:checkbox(N 条)/ legacy(M 条)
|
|
239
|
+
> **总结**:{passed}/{total} 通过,{failed} 未通过,{unverifiable} 待人工,{skipped} 跳过
|
|
240
|
+
|
|
241
|
+
| Task | 文件 | 完成标准 | 证据 | 状态 |
|
|
242
|
+
|------|------|---------|------|------|
|
|
243
|
+
| T-001 | executor.py | `execute_step` 在 `_run_action` 前注册 `page.on("response")` | executor.py:47 `page.on("response", ...)` | ✅ PASSED |
|
|
244
|
+
| T-001 | executor.py | `try/finally` 中 `removeListener` 确保清理 | executor.py:78-80 `finally: page.removeListener(...)` | ✅ PASSED |
|
|
245
|
+
| T-002 | executor.py | `page=None` 时全部返回 `skipped` | executor.py:210 `if page is None: return [...]` | ✅ PASSED |
|
|
246
|
+
| T-003 | StepConfigModal.tsx | 断言类型下拉包含 10 个选项 | `uiAssertionOptions` 仅含 6 项 | ❌ FAILED |
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### 状态汇总规则
|
|
250
|
+
|
|
251
|
+
- **全部 PASSED(或仅含 SKIPPED/UNVERIFIABLE)**:`completion_criteria_status = "passed"`
|
|
252
|
+
- **存在 FAILED**:`completion_criteria_status = "failed"`,将导致 `code_review_gate` 阻塞
|
|
253
|
+
- **全部为 SKIPPED**(旧格式或无变更清单):`completion_criteria_status = "skipped"`,不阻塞
|
|
254
|
+
- **存在 UNVERIFIABLE**:不影响 passed/failed 判定,但需在汇总中标注待人工确认项数量
|
|
255
|
+
|
|
256
|
+
#### REVIEW.md 输出规范
|
|
257
|
+
|
|
258
|
+
REVIEW.md 文件顶部必须包含 YAML frontmatter,供 execute-phase 解析:
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
---
|
|
262
|
+
status: clean|issues_found
|
|
263
|
+
completion_criteria_status: passed|failed|skipped
|
|
264
|
+
phase: {phase_number}
|
|
265
|
+
reviewed_at: {ISO timestamp}
|
|
266
|
+
---
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 第五步:如果处于重构流程中
|
|
270
|
+
|
|
271
|
+
当此技能作为重构验证环节被调用时:
|
|
272
|
+
|
|
273
|
+
1. 输出问题清单后,**不等待用户确认**,直接逐个修复
|
|
274
|
+
2. 每修复一个问题后运行 `go build ./...` 确认编译通过
|
|
275
|
+
3. 全部修复后运行 `go test ./目标包/... -v -count=1` 确认测试通过
|
|
276
|
+
4. 重新执行一轮审查,确认问题清零
|
|
277
|
+
5. 如果发现新问题(修复过程中引入的),继续修复循环
|
|
278
|
+
6. 直到问题清单为空,输出 "审查通过,无合规问题"
|
|
279
|
+
|
|
280
|
+
**重要:** 完成标准验证(第四步.五)中的 `❌ FAILED` 项**不属于自动修复范围**。这些是功能实现缺失,需要开发者判断和补充实现,不能通过风格修正自动处理。仅规范合规问题(第一至四步)可自动修复。
|
|
281
|
+
|
|
282
|
+
## 关键规则
|
|
283
|
+
|
|
284
|
+
1. **不修改 VO 字段定义** — 重构场景下不改变已有的 VO 字段名和类型(tag 补全除外)
|
|
285
|
+
2. **不猜测业务意图** — 不确定某段代码是否违反规范时,标注为"待确认"并说明理由
|
|
286
|
+
3. **引用具体规范** — 每个问题必须指向具体的规范文件和条目,不能只说"不规范"
|
|
287
|
+
4. **关注遗漏模式** — 重点检查之前经验教训中记录的常见遗漏(lessons/README.md)
|
|
288
|
+
5. **兼容性优先** — 任何涉及前端响应结构(VO json tag、响应格式、错误码)或数据库 schema(model 字段、表名)的修改建议,必须附带兼容性风险提示和渐进式迁移方案
|