@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,819 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-project-context
|
|
3
|
+
description: "Use when a new or existing project needs .planning initialization, repository discovery, project context, navigation files, or rule-package setup."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Legacy Command Metadata
|
|
7
|
+
|
|
8
|
+
Original slash-command metadata retained only as workflow invocation guidance.
|
|
9
|
+
|
|
10
|
+
```yaml
|
|
11
|
+
argument-hint: '[--auto]'
|
|
12
|
+
user-invocable: true
|
|
13
|
+
pattern: inversion+generator+reviewer
|
|
14
|
+
resumable: true
|
|
15
|
+
state-file: .planning/STATE.md
|
|
16
|
+
allowed-tools:
|
|
17
|
+
- Read
|
|
18
|
+
- Bash
|
|
19
|
+
- Write
|
|
20
|
+
- Glob
|
|
21
|
+
- Grep
|
|
22
|
+
- ask
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
# Project Initialization
|
|
26
|
+
|
|
27
|
+
Initialize project context only. Do not create requirements, roadmap, research files, commits, tags, or Git repositories unless the user explicitly asks.
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
Always create or update:
|
|
32
|
+
|
|
33
|
+
- `.planning/PROJECT.md` — project facts, structure, navigation, constraints, and decisions
|
|
34
|
+
- `.planning/STATE.md` — initialization state, project locations, scan status, and next recommended step
|
|
35
|
+
- `.planning/navigation/INDEX.md` — codebase registry: maps each codebase to its navigation file, plus rule package index and downstream read contract
|
|
36
|
+
- `.planning/navigation/{name}.md` — one file per codebase: framework, entries, conventions, commands (name comes from user-provided codebase name)
|
|
37
|
+
- `.planning/code-index/` — machine code intelligence index location; generated by `workflow-code-index` by default unless fast mode skips it
|
|
38
|
+
- `.context/spec/design/` — conditional frontend design rule package; installed after code-index for projects with frontend codebases
|
|
39
|
+
- `.planning/project-context-run.json` — current-run evidence: run identity, code-index status, dynamically discovered depth specs, source paths, and source fingerprints
|
|
40
|
+
- `.context/spec/index.md` — generated technical specification registry: maps stack profiles and codebase specs
|
|
41
|
+
- `.context/spec/stacks/{stack_key}.md` — deduplicated stack-level technical rules for each detected stack profile
|
|
42
|
+
- `.context/spec/frontend/{name}.md` / `.context/spec/backend/{name}.md` — codebase-specific technical rules generated from explicit rules and observed conventions
|
|
43
|
+
- `.planning/rules/INDEX.md` — project rule index, the first file downstream skills read for project-specific conventions
|
|
44
|
+
- `.planning/execution-contract.md` — layer order, TDD strategy, codegen and verification gates
|
|
45
|
+
- `.planning/toolchain.md` — consolidated build, test, lint, mock, and migration commands
|
|
46
|
+
|
|
47
|
+
Also record existing project rule package locations when found (these are accumulated over time, not created during initialization):
|
|
48
|
+
|
|
49
|
+
- `.planning/lessons/`
|
|
50
|
+
- `.planning/milestones/`
|
|
51
|
+
- `.planning/requirements/`
|
|
52
|
+
- `.context/spec/`
|
|
53
|
+
- `.context/workflow/`
|
|
54
|
+
- `.context/lessons/`
|
|
55
|
+
- root `AGENTS.md`, `CLAUDE.md`, or equivalent instruction files
|
|
56
|
+
|
|
57
|
+
Do not create by default:
|
|
58
|
+
|
|
59
|
+
- `.planning/REQUIREMENTS.md`
|
|
60
|
+
- `.planning/ROADMAP.md`
|
|
61
|
+
- `.planning/research/`
|
|
62
|
+
- `.planning/config.json`
|
|
63
|
+
|
|
64
|
+
## Pattern
|
|
65
|
+
|
|
66
|
+
This skill combines three patterns:
|
|
67
|
+
|
|
68
|
+
- **Inversion**: ask for required project locations before scanning or generating files.
|
|
69
|
+
- **Generator**: fill templates from `assets/`.
|
|
70
|
+
- **Reviewer**: check the generated files against `references/navigation-guide.md`.
|
|
71
|
+
|
|
72
|
+
Load bundled resources only when needed:
|
|
73
|
+
|
|
74
|
+
- Read `assets/project-initialization-template.md` before writing `PROJECT.md`.
|
|
75
|
+
- Read `assets/codebase-navigation-template.md` before writing each codebase navigation file.
|
|
76
|
+
- Read `assets/navigation-index-template.md` before writing `.planning/navigation/INDEX.md`.
|
|
77
|
+
- Read `assets/context-spec-index-template.md` before writing `.context/spec/index.md`.
|
|
78
|
+
- Read `assets/stack-spec-template.md` before writing each `.context/spec/stacks/{stack_key}.md`.
|
|
79
|
+
- Read `assets/codebase-backend-spec-template.md` before writing each backend/service `.context/spec/backend/{name}.md`.
|
|
80
|
+
- Read `assets/codebase-frontend-spec-template.md` before writing each frontend `.context/spec/frontend/{name}.md`.
|
|
81
|
+
- Read `assets/spec-templates/backend/{template}.md` before writing each backend depth spec file.
|
|
82
|
+
- Read `assets/spec-templates/frontend/{template}.md` before writing each frontend depth spec file.
|
|
83
|
+
- Read `assets/agents-md-template.md` before writing root `AGENTS.md`.
|
|
84
|
+
- Read `assets/context-domain-index-template.md` before writing `.context/spec/frontend/index.md`, `.context/spec/backend/index.md`, and `.context/spec/design/index.md`.
|
|
85
|
+
- Read `assets/state-template.md` before writing `.planning/STATE.md`.
|
|
86
|
+
- Read `assets/execution-contract-template.md` before writing `.planning/execution-contract.md`.
|
|
87
|
+
- Read `assets/toolchain-template.md` before writing `.planning/toolchain.md`.
|
|
88
|
+
- Read `assets/rules-index-template.md` before writing `.planning/rules/INDEX.md`.
|
|
89
|
+
- Read `assets/run-manifest-template.json` before writing `.planning/project-context-run.json`.
|
|
90
|
+
- Read `references/navigation-guide.md` before scanning code and again before final review.
|
|
91
|
+
- Run `scripts/validate_initialization.py` as the final completion gate.
|
|
92
|
+
|
|
93
|
+
## Argument Handling
|
|
94
|
+
|
|
95
|
+
Parse `$ARGUMENTS` before Step 1:
|
|
96
|
+
|
|
97
|
+
- `--auto`: non-interactive initialization. If codebase locations are not provided, treat the current workspace as a single codebase, scan boundedly, and mark anything not found as `待确认` or `pending`. Do not block on project-name or business-context questions; infer what is obvious and record missing facts.
|
|
98
|
+
- `--fast` / `--skip-code-index`: fast initialization. Generate project context, navigation, specs, and rules, but skip Step 6.5 (code-index) and mark code-index as skipped in `STATE.md`, `PROJECT.md`, navigation INDEX, and rules INDEX. This is the ONLY condition under which code-index may be skipped. Without this flag, code-index is REQUIRED regardless of whether `.planning/` already exists.
|
|
99
|
+
- `--with-code-index`: compatibility flag for explicit full initialization. This is the default behavior; after navigation generation, run Step 6.5 to build/validate/audit `.planning/code-index/`, then carry its status into the remaining generated context and rule files.
|
|
100
|
+
- Other text may be used as project-name or project-context hint when it is not a path.
|
|
101
|
+
|
|
102
|
+
At invocation start, before scanning or writing:
|
|
103
|
+
|
|
104
|
+
1. Generate a unique `run_id`.
|
|
105
|
+
2. Capture `run_started_at` as an ISO-8601 UTC timestamp.
|
|
106
|
+
3. Set mode to `full`, or `fast` only when one of the explicit skip flags is present.
|
|
107
|
+
4. Carry the same `run_id`, `run_started_at`, `code_index_status`, and skip reason into all templates and `.planning/project-context-run.json`. Use `none` when full mode has no skip reason.
|
|
108
|
+
|
|
109
|
+
In non-auto mode, ask the intake questions below.
|
|
110
|
+
|
|
111
|
+
## Existing Planning Update Policy
|
|
112
|
+
|
|
113
|
+
If `.planning/` already exists:
|
|
114
|
+
|
|
115
|
+
1. Read existing `.planning/PROJECT.md`, `.planning/STATE.md`, and `.planning/navigation/*.md` before writing.
|
|
116
|
+
2. Preserve user-authored business context, constraints, key decisions, and missing information unless the user explicitly asks to replace them.
|
|
117
|
+
3. Refresh only machine-derived fields. This includes: detected paths, frameworks, entries, commands, scan status, navigation index, rule package files (execution-contract.md, toolchain.md, rules/INDEX.md), **all currently discovered depth spec files (Step 7.4)**, and **code index (Step 6.5)**. The presence of existing output files does NOT exempt a step from re-execution — machine-derived fields must be regenerated to reflect current codebase state.
|
|
118
|
+
4. If provided codebase locations differ from existing records, record the change in `STATE.md` under `Change Log`.
|
|
119
|
+
5. Never delete existing planning files during initialization. Preserve user-authored content in execution-contract.md and toolchain.md when refreshing machine-derived fields.
|
|
120
|
+
|
|
121
|
+
## Step 1 — Intake Gate
|
|
122
|
+
|
|
123
|
+
Before any initialization, ask for all codebases in the project:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
请提供项目涉及的所有代码库。每个代码库需要三个信息:
|
|
127
|
+
- 地址:本地路径或 Git 仓库 URL;如果在当前目录,请写”当前目录”
|
|
128
|
+
- 类型:描述这个代码库的角色(如:C端前端、后台前端、后端服务、定时任务、SDK等)
|
|
129
|
+
- 名称:简短的标识名称,用作导航文件名(如:union-next、saas-admin、union-api)
|
|
130
|
+
|
|
131
|
+
示例(3个代码库的项目):
|
|
132
|
+
1. byn-web/packages/union-next C端前端 union-next 联盟客户侧
|
|
133
|
+
2. byn-web/packages/saas-admin 后台前端 saas-admin 运营后台
|
|
134
|
+
3. union/ 后端服务 union 联盟核心服务
|
|
135
|
+
|
|
136
|
+
如果只有1个代码库,写1行即可。
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Do not proceed until at least one codebase is provided, except in `--auto` mode where the current workspace is used as a single codebase with `待确认` type and name inferred from the directory.
|
|
140
|
+
|
|
141
|
+
Accepted values per codebase:
|
|
142
|
+
- **Path**: local path (`./frontend`, `/path/to/web`), Git URL (`https://...`, `git@...`), current workspace (`当前目录`, `same repo`, `.`)
|
|
143
|
+
- **Type**: freeform text describing the codebase's role. Common values: `C端前端`, `后台前端`, `后端服务`, `定时任务`, `SDK`, `公共组件库`, `移动端` — but these are not hardcoded; use whatever the user provides.
|
|
144
|
+
- **Name**: short identifier safe as a filename segment (letters, digits, hyphens). Used for `.planning/navigation/{name}.md`.
|
|
145
|
+
|
|
146
|
+
If a Git URL is provided, record it. Ask before cloning; do not clone automatically.
|
|
147
|
+
|
|
148
|
+
Record the codebase list for use in Step 3 (scan) and Step 6 (generate navigation files).
|
|
149
|
+
|
|
150
|
+
## Step 2 — Minimal Project Questions
|
|
151
|
+
|
|
152
|
+
Ask only what cannot be inferred from code:
|
|
153
|
+
|
|
154
|
+
1. Project name
|
|
155
|
+
2. What the product/system does
|
|
156
|
+
3. Primary users or business domain
|
|
157
|
+
4. Non-negotiable constraints, if any
|
|
158
|
+
|
|
159
|
+
If the user says these are unknown, continue and mark them as `待确认`.
|
|
160
|
+
|
|
161
|
+
## Step 3 — Structure Scan (Four-Phase)
|
|
162
|
+
|
|
163
|
+
Read `references/navigation-guide.md`. Run the following four phases for EACH codebase from Step 1. Each phase has its own scan depth, output, and gate. Do not skip phases.
|
|
164
|
+
|
|
165
|
+
Exclude generated/dependency directories in all phases: `node_modules`, `dist`, `build`, `.next`, `.nuxt`, `target`, `vendor`, `.git`, `coverage`.
|
|
166
|
+
|
|
167
|
+
### Step 3a — Directory Map (Mandatory)
|
|
168
|
+
|
|
169
|
+
Scan the codebase's top-level and second-level directory layout. This is the factual layer — what directories exist and what they contain.
|
|
170
|
+
|
|
171
|
+
Scan method:
|
|
172
|
+
```
|
|
173
|
+
1. rg --files from codebase root → extract top-level and second-level directories
|
|
174
|
+
2. Identify key manifest/config files: package.json, go.mod, Makefile, Dockerfile, README
|
|
175
|
+
3. For each directory, infer purpose from file names and README content
|
|
176
|
+
4. Do NOT read source files in depth — only directory names and manifests
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Output (write to `{name}.md` → `## Structure → ### Directory Map`):
|
|
180
|
+
- ASCII directory tree (top-level + second-level)
|
|
181
|
+
- Table: Directory | Purpose | Notes
|
|
182
|
+
|
|
183
|
+
Gate: every top-level and second-level directory is listed with a purpose (one sentence, inferred from file names is acceptable). Key entry files (main.go, main.ts, router files, handler files) are identified.
|
|
184
|
+
|
|
185
|
+
### Step 3b — Call Chain Map (Mandatory)
|
|
186
|
+
|
|
187
|
+
Trace the call chains through the codebase. This is the connectivity layer — how code connects across directories.
|
|
188
|
+
|
|
189
|
+
**Dual-path routing** (decide before scanning):
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
For each codebase, check if a rule file exists in this order:
|
|
193
|
+
1. .cursorrules within the codebase root
|
|
194
|
+
2. AGENTS.md / CLAUDE.md at project root or codebase root
|
|
195
|
+
|
|
196
|
+
If a rule file EXISTS → Path A: Conventions first
|
|
197
|
+
1. Execute Step 3c first to extract conventions
|
|
198
|
+
2. Use extracted conventions to guide call chain tracing
|
|
199
|
+
(e.g., if convention says "handler→service→repository→dao", follow that pattern)
|
|
200
|
+
|
|
201
|
+
If NO rule file → Path B: Call chain first
|
|
202
|
+
1. Trace call chains from entry points by following imports/method calls
|
|
203
|
+
2. The traced patterns will feed into Step 3c for convention extraction
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Scan method:
|
|
207
|
+
|
|
208
|
+
**Backend-type codebases** (type contains "后端" or "服务"):
|
|
209
|
+
```
|
|
210
|
+
1. Find handler files (look for route registration patterns):
|
|
211
|
+
- Go: files with RegisterRoutes, gin routes, or echo routes
|
|
212
|
+
- Java: @RestController, @RequestMapping
|
|
213
|
+
- Node: router files, controller files
|
|
214
|
+
2. For each handler, extract registered routes and the methods they call
|
|
215
|
+
3. Follow the call chain: handler method → service method → repository method → dao method
|
|
216
|
+
4. Find job/scheduler files (look for cron patterns, @Scheduled, job registration):
|
|
217
|
+
- Extract cron expression or trigger condition
|
|
218
|
+
- Trace the job's call chain into services
|
|
219
|
+
5. Find external integration packages/directories:
|
|
220
|
+
- Identify outbound HTTP clients, gRPC clients, message queues
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Output (write to `{name}.md` → `## Structure → ### Call Chain Map`):
|
|
224
|
+
- `#### API Modules` table: Route Group | Handler | Routes | Service → Repository → DAO
|
|
225
|
+
- `#### Scheduled Jobs` table: Job | Cron | Trigger Type | Call Chain | Notes
|
|
226
|
+
- `#### External Integrations` table: Integration | Path | Direction | Notes
|
|
227
|
+
|
|
228
|
+
Gate: every handler file identified in 3a has its call chain traced (at minimum: handler→service). Every job file has its trigger and target service identified.
|
|
229
|
+
|
|
230
|
+
**Frontend-type codebases** (type contains "前端"):
|
|
231
|
+
```
|
|
232
|
+
1. Read router configuration → extract all routes with their page components
|
|
233
|
+
2. For each page component, read the file and extract:
|
|
234
|
+
- Imported child components (from page-private and common components)
|
|
235
|
+
- Imported composables/hooks
|
|
236
|
+
- API calls (direct or through composables)
|
|
237
|
+
3. For each composable, extract:
|
|
238
|
+
- API client methods called
|
|
239
|
+
- State shape (reactive/ref/store)
|
|
240
|
+
4. Build the route→component→composable→API call tree
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Output (write to `{name}.md` → `## Structure → ### Call Chain Map`):
|
|
244
|
+
- `#### Route-Component Map` table: Route | Page Component | Child Components | Composables | API Calls
|
|
245
|
+
- `#### Data Flow` table: Composable / Store | API Client | State Shape | Consumed By
|
|
246
|
+
|
|
247
|
+
Gate: every route has its page component and at least the first-level child components listed. Every composable used by more than one component is in the Data Flow table.
|
|
248
|
+
|
|
249
|
+
### Step 3c — Conventions (Mandatory)
|
|
250
|
+
|
|
251
|
+
Extract the coding conventions that govern this codebase. This is the rules layer — how code should be written.
|
|
252
|
+
|
|
253
|
+
**If Path A (rule file existed, 3c was already executed before 3b):**
|
|
254
|
+
- The conventions extracted from .cursorrules / AGENTS.md were used to guide 3b.
|
|
255
|
+
- Now cross-validate: did the actual code follow these conventions? If violations found, note them.
|
|
256
|
+
|
|
257
|
+
**If Path B (no rule file, 3c runs after 3b):**
|
|
258
|
+
- Infer conventions from the patterns observed during 3b call chain tracing.
|
|
259
|
+
- If a pattern is consistent across all modules (e.g., every handler calls a service interface), record it as a convention.
|
|
260
|
+
- If patterns are inconsistent, record the dominant pattern and note the variations.
|
|
261
|
+
|
|
262
|
+
Scan method:
|
|
263
|
+
```
|
|
264
|
+
1. If .cursorrules or AGENTS.md / CLAUDE.md exist, read them and extract:
|
|
265
|
+
- Layer/component hierarchy rules
|
|
266
|
+
- Naming conventions
|
|
267
|
+
- Data conversion rules (VO↔Domain↔Model)
|
|
268
|
+
- Error handling patterns
|
|
269
|
+
- Code generation or documentation rules
|
|
270
|
+
2. If no rule file, infer from 3b observations:
|
|
271
|
+
- Consistent directory patterns → layer convention
|
|
272
|
+
- Consistent method signatures → interface convention
|
|
273
|
+
- Consistent import patterns → dependency direction
|
|
274
|
+
3. Mark any convention as "推断" (inferred) when not backed by an explicit rule file.
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Output (write to `{name}.md` → `## Structure → ### Conventions`):
|
|
278
|
+
|
|
279
|
+
**Backend-type**: Table with columns Category | Rule | Source
|
|
280
|
+
Categories: Layer order, Conversion (VO↔Domain↔Model), Interface/DI, Error handling, Naming, Swagger/API docs
|
|
281
|
+
|
|
282
|
+
**Frontend-type**: Table with columns Category | Rule | Source
|
|
283
|
+
Categories: Component hierarchy, Data flow (composable/store), Route naming, Style/theme, API client, State management
|
|
284
|
+
|
|
285
|
+
Source values: `{rule_file_name}` (explicit rule), `代码推断` (inferred from code patterns), or `待确认` (not observed).
|
|
286
|
+
|
|
287
|
+
Gate: at least Layer order (backend) or Component hierarchy (frontend) is recorded. Inferred conventions are marked as `代码推断`, not as facts.
|
|
288
|
+
|
|
289
|
+
### Step 3d — Stack Profile Extraction (Mandatory)
|
|
290
|
+
|
|
291
|
+
Extract a normalized stack profile for each codebase. This is the dependency fingerprint layer: which runtime, framework, major versions, and key libraries govern the codebase.
|
|
292
|
+
|
|
293
|
+
Scan method:
|
|
294
|
+
```
|
|
295
|
+
1. Read detected manifest files from 3a:
|
|
296
|
+
- Frontend/Node: package.json, pnpm-lock.yaml, yarn.lock, package-lock.json
|
|
297
|
+
- Python: pyproject.toml, requirements.txt, poetry.lock, uv.lock
|
|
298
|
+
- Go: go.mod
|
|
299
|
+
- Java/Kotlin: pom.xml, build.gradle, build.gradle.kts
|
|
300
|
+
2. Extract only dependency names and versions needed to identify the stack profile:
|
|
301
|
+
- language/runtime
|
|
302
|
+
- primary framework and major version
|
|
303
|
+
- key libraries that materially change conventions (e.g., Ant Design, Zustand, FastAPI, Pydantic major version, SQLAlchemy vs SQLModel, Gin, GORM, Spring Boot)
|
|
304
|
+
- package manager/build tool
|
|
305
|
+
- test framework if detectable
|
|
306
|
+
3. Compute a stable `stack_key` from:
|
|
307
|
+
language + framework + framework major version + key libraries
|
|
308
|
+
Examples: `python-fastapi-pydantic2-sqlalchemy`, `react-vite-antd`, `go-gin-gorm`
|
|
309
|
+
4. Record manifest path and dependency fingerprint. A hash of the manifest is acceptable; otherwise list key dependency versions.
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Output (write to `{name}.md` → `## Stack → ### Stack Profile`):
|
|
313
|
+
- Table: Field | Value | Source
|
|
314
|
+
- Required fields: language/runtime, framework, framework version, key libraries, package manager/build tool, test framework, manifest path, dependency fingerprint, stack_key
|
|
315
|
+
|
|
316
|
+
Rules:
|
|
317
|
+
- Do not merge different major versions or materially different key libraries into the same stack profile.
|
|
318
|
+
- Do not put project-instance conventions into the stack profile. Stack profiles identify technology families; project-specific rules belong in codebase specs.
|
|
319
|
+
- If a manifest exists but versions are ambiguous, record `待确认` for version and keep the manifest path.
|
|
320
|
+
|
|
321
|
+
Gate: every local/scannable codebase has a stack profile. Remote/unavailable codebases may be `pending` with the known manifest or stack hint recorded.
|
|
322
|
+
|
|
323
|
+
### After All Codebases — Project-Wide Sources
|
|
324
|
+
|
|
325
|
+
After 3a/3b/3c/3d complete for all codebases, identify project-wide sources once:
|
|
326
|
+
- `.planning/rules/`, `.planning/execution-contract.md`, `.planning/toolchain.md`, `.planning/lessons/`
|
|
327
|
+
- `.planning/milestones/`, `.planning/requirements/`
|
|
328
|
+
- `.context/spec/`, `.context/workflow/`, `.context/lessons/`
|
|
329
|
+
- root `AGENTS.md` / `CLAUDE.md`
|
|
330
|
+
|
|
331
|
+
Identify history model locations once:
|
|
332
|
+
- primary: `.planning/milestones/`, `.planning/requirements/`, `.planning/lessons/`, `.planning/*/CONTEXT.md`
|
|
333
|
+
- optional legacy: `features/`, `.context/lessons/`
|
|
334
|
+
|
|
335
|
+
If a codebase location is unavailable or only a Git URL, write what is known and mark scan status as pending.
|
|
336
|
+
|
|
337
|
+
Do not run `git init`.
|
|
338
|
+
|
|
339
|
+
## Unknown Field Policy
|
|
340
|
+
|
|
341
|
+
Avoid filling every table cell with `待确认`.
|
|
342
|
+
|
|
343
|
+
- Required fields may be `待确认`: root, framework, app entry, router/controllers, commands.
|
|
344
|
+
- Optional fields should be omitted from notes or summarized in `Missing Information` when not found.
|
|
345
|
+
- If a whole area does not apply (e.g., frontend-type sections for a backend-only codebase), skip those sections in the codebase navigation file.
|
|
346
|
+
- Each codebase gets its own navigation file regardless of type. There is no limit on the number of codebases.
|
|
347
|
+
|
|
348
|
+
## Step 4 — Generate Base Directories
|
|
349
|
+
|
|
350
|
+
Use this directory contract:
|
|
351
|
+
|
|
352
|
+
```text
|
|
353
|
+
.planning/
|
|
354
|
+
├── PROJECT.md # stable project overview and decisions
|
|
355
|
+
├── STATE.md # workflow memory and initialization status
|
|
356
|
+
├── project-context-run.json # current-run completion evidence
|
|
357
|
+
├── navigation/
|
|
358
|
+
│ ├── INDEX.md # codebase registry — maps each codebase to its navigation file
|
|
359
|
+
│ ├── {name1}.md # per-codebase navigation (e.g., union-next.md)
|
|
360
|
+
│ ├── {name2}.md # per-codebase navigation (e.g., saas-admin.md)
|
|
361
|
+
│ └── ... # one file for each codebase from Step 1
|
|
362
|
+
└── rules/
|
|
363
|
+
└── INDEX.md # rule source registry
|
|
364
|
+
|
|
365
|
+
.context/
|
|
366
|
+
└── spec/
|
|
367
|
+
├── index.md # generated spec registry and read order
|
|
368
|
+
├── stacks/
|
|
369
|
+
│ └── {stack_key}.md # deduplicated stack-level rules
|
|
370
|
+
├── frontend/
|
|
371
|
+
│ ├── index.md
|
|
372
|
+
│ └── {name}.md # per-frontend codebase rules
|
|
373
|
+
├── backend/
|
|
374
|
+
│ ├── index.md
|
|
375
|
+
│ └── {name}.md # per-backend/service codebase rules
|
|
376
|
+
└── design/
|
|
377
|
+
└── index.md
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
The number of navigation files matches the number of codebases provided in Step 1. Codebase specs are generated only for matching codebase types. No hardcoded frontend/backend split is assumed beyond the user's type labels and scan evidence.
|
|
381
|
+
|
|
382
|
+
Do not create requirement, roadmap, research, config, or `.context/spec/workflow/` directories during initialization unless explicitly requested.
|
|
383
|
+
|
|
384
|
+
## Step 5 — Generate PROJECT.md
|
|
385
|
+
|
|
386
|
+
Load `assets/project-initialization-template.md` and fill every section.
|
|
387
|
+
|
|
388
|
+
Required emphasis:
|
|
389
|
+
|
|
390
|
+
- Project basics
|
|
391
|
+
- Codebase locations (from Step 1)
|
|
392
|
+
- Current structure
|
|
393
|
+
- Links to navigation files (INDEX.md and per-codebase files)
|
|
394
|
+
- Constraints
|
|
395
|
+
- Key decisions
|
|
396
|
+
- Project rule package locations
|
|
397
|
+
- History model locations, with `.planning/milestones/`, `.planning/requirements/`, and `.planning/lessons/` as primary history and `.context/lessons/` / `features/` as optional legacy sources
|
|
398
|
+
- Missing information
|
|
399
|
+
|
|
400
|
+
If a field is unknown, write `待确认` rather than guessing.
|
|
401
|
+
|
|
402
|
+
## Step 5.5 — Generate Root AGENTS.md
|
|
403
|
+
|
|
404
|
+
Load `assets/agents-md-template.md` and write `AGENTS.md` at the project root.
|
|
405
|
+
|
|
406
|
+
Fill from scan results:
|
|
407
|
+
|
|
408
|
+
- **Project name**: from Step 2 or PROJECT.md.
|
|
409
|
+
- **Codebase count and types**: from Step 1 codebase list.
|
|
410
|
+
- **Rule entry**: `.planning/rules/INDEX.md` as entry point.
|
|
411
|
+
- **Spec entry**: `.context/spec/index.md` if spec files were generated.
|
|
412
|
+
|
|
413
|
+
Do not create `.claude/`, `.codex/`, or compatibility symlinks. OMP reads the
|
|
414
|
+
project-local `.omp/AGENTS.md`; root `AGENTS.md` remains the portable project rule entry.
|
|
415
|
+
|
|
416
|
+
## Step 6 — Generate Navigation Files
|
|
417
|
+
|
|
418
|
+
Create `.planning/navigation/`.
|
|
419
|
+
|
|
420
|
+
### 6.1 Generate INDEX.md
|
|
421
|
+
|
|
422
|
+
Load `assets/navigation-index-template.md` and fill the Codebase Registry with every codebase from Step 1. Each row maps a codebase name to its path, type, role, scan status, and navigation file path.
|
|
423
|
+
|
|
424
|
+
### 6.2 Generate per-codebase navigation files
|
|
425
|
+
|
|
426
|
+
For EACH codebase from Step 1, load `assets/codebase-navigation-template.md` and generate `.planning/navigation/{name}.md`.
|
|
427
|
+
|
|
428
|
+
Fill sections based on the codebase's user-provided type:
|
|
429
|
+
|
|
430
|
+
**All codebases** fill these sections:
|
|
431
|
+
- Identity (name, root, type, role, location, scan status)
|
|
432
|
+
- Stack (framework, runtime, build tool, type-specific libraries, and Stack Profile from Step 3d)
|
|
433
|
+
- Application Entry Points (app entry, and type-specific entries)
|
|
434
|
+
- Commands (install, dev, build, test, lint, codegen)
|
|
435
|
+
- Notes, Missing Information
|
|
436
|
+
|
|
437
|
+
**Frontend-type codebases** (type contains "前端") additionally fill:
|
|
438
|
+
- Stack: UI Library, State Management, Request Library
|
|
439
|
+
- Entry Points: Router, Pages/Views, Layouts, API Client, Auth/Permission, Styles/Theme, Env Config
|
|
440
|
+
- Structure: Directory Map (from 3a), Call Chain Map → Route-Component Map + Data Flow (from 3b), Conventions (from 3c)
|
|
441
|
+
|
|
442
|
+
**Backend-type codebases** (type contains "后端" or "服务") additionally fill:
|
|
443
|
+
- Stack: Database Access, API Style
|
|
444
|
+
- Entry Points: Routes/Controllers, Middleware/Filters, Auth/Permission, Env Config, API Docs
|
|
445
|
+
- Structure: Directory Map (from 3a), Call Chain Map → API Modules + Scheduled Jobs + External Integrations (from 3b), Conventions (from 3c)
|
|
446
|
+
|
|
447
|
+
**Other types**: use the user-provided type to decide which sections to include. Prefer fewer sections with higher confidence over guessing.
|
|
448
|
+
|
|
449
|
+
Rules:
|
|
450
|
+
- Only write what was observed during scan. Do not invent paths or conventions.
|
|
451
|
+
- If a section's data was not found during scan, write `待确认` for required fields or omit optional fields.
|
|
452
|
+
- The `## Requirement-Relevant Areas` section is left with a placeholder `{{requirement_areas}}` — it will be filled by downstream skills as features are mapped to this codebase.
|
|
453
|
+
- The `## Rule Sources` section points to `.planning/rules/INDEX.md` and lists only rule files found within this codebase's root (e.g., `.cursorrules`).
|
|
454
|
+
|
|
455
|
+
## Step 6.5 — Code Index Refresh (REQUIRED)
|
|
456
|
+
|
|
457
|
+
本步骤**必须**执行。仅当用户传入 `--fast` / `--skip-code-index` 时允许跳过,否则初始化视为未完成。已有输出、刷新场景或执行耗时均不构成豁免。
|
|
458
|
+
|
|
459
|
+
In full mode, invoke `workflow-code-index` and run its deterministic implementation:
|
|
460
|
+
|
|
461
|
+
```text
|
|
462
|
+
devflow_code_index(action="scan")
|
|
463
|
+
devflow_code_index(action="validate")
|
|
464
|
+
devflow_code_index(action="audit")
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
All three commands must succeed. Do not treat pre-existing files as execution evidence. Step 10 verifies that these outputs were modified after `run_started_at`:
|
|
468
|
+
|
|
469
|
+
- `.planning/code-index/index.sqlite`
|
|
470
|
+
- `.planning/code-index/files.jsonl`
|
|
471
|
+
- `.planning/code-index/symbols.jsonl`
|
|
472
|
+
- `.planning/code-index/relations.jsonl`
|
|
473
|
+
- `.planning/code-index/AUDIT.md`
|
|
474
|
+
|
|
475
|
+
In fast mode, do not run the commands. Set `code_index_status` to `skipped`, record the explicit flag as `code_index_skip_reason`, and write the same current-run marker to `STATE.md`, `PROJECT.md`, navigation INDEX, and rules INDEX.
|
|
476
|
+
|
|
477
|
+
After full-mode commands succeed, set `code_index_status` to `complete`, use skip reason `none`, and update the same marker in PROJECT and navigation INDEX. Rules INDEX and STATE receive it when generated in Steps 8 and 9.
|
|
478
|
+
|
|
479
|
+
Do not require users to manually run Python when they invoked this skill.
|
|
480
|
+
|
|
481
|
+
## Step 6.6 — Design Rule Package (Conditional Required)
|
|
482
|
+
|
|
483
|
+
This step belongs to project initialization, not feature design. It runs **after the code index is available** and before the context-spec package is finalized.
|
|
484
|
+
|
|
485
|
+
1. Determine applicability from the Step 1 codebase types and Step 3 scan evidence:
|
|
486
|
+
- If at least one local/scannable codebase is frontend-type, this step is required.
|
|
487
|
+
- If no frontend-type codebase exists, do not install UI recommendation assets; record `design_rule_pack.status: not_applicable` and reason `no_frontend_codebase` in the run manifest.
|
|
488
|
+
2. For an applicable project, run the design-rule installer without overwriting project-local decisions or the project-context-owned index:
|
|
489
|
+
|
|
490
|
+
```text
|
|
491
|
+
devflow_design_rule(args=["--without-index"])
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
3. Verify these installed assets exist:
|
|
495
|
+
- `.context/spec/design/tokens/project-tokens.md`
|
|
496
|
+
- `.context/spec/design/recommendations/accessibility.md`
|
|
497
|
+
- `.context/spec/design/recommendations/component-library.md`
|
|
498
|
+
- `.context/spec/design/tools/ui-ux-pro-max/SKILL.md`
|
|
499
|
+
4. Record `design_rule_pack.status: installed`, source `skill://workflow-design-rule-pack/assets/design/`, and the verified asset paths in `.planning/project-context-run.json`.
|
|
500
|
+
5. Never use `--overwrite` during ordinary initialization. Existing confirmed project tokens and intentional local overrides take precedence. If an existing shared recommendation must be refreshed, require explicit user authorization and record it as a separate maintenance action.
|
|
501
|
+
|
|
502
|
+
`--fast` only skips code-index generation. It does not skip this step for frontend projects.
|
|
503
|
+
|
|
504
|
+
## Step 7 — Generate Context Spec Package
|
|
505
|
+
|
|
506
|
+
Create `.context/spec/` after navigation files exist. Context specs are generated rule documents, not source-code indexes.
|
|
507
|
+
|
|
508
|
+
### 7.1 Generate stack specs
|
|
509
|
+
|
|
510
|
+
Use all Step 3d stack profiles, group by `stack_key`, and generate one `.context/spec/stacks/{stack_key}.md` per unique stack profile.
|
|
511
|
+
|
|
512
|
+
Rules:
|
|
513
|
+
- Deduplicate by `stack_key`, not by framework name alone.
|
|
514
|
+
- If two codebases share the same framework but differ in major framework version or key libraries, generate separate stack specs.
|
|
515
|
+
- Stack specs contain technology-stack guidance only. Do not include one codebase's local directory names, local naming habits, or route/module names as stack rules.
|
|
516
|
+
- Stack specs must fill `## Per-Layer Rules` with stack-level guidance for every listed layer. Use `NOT_APPLICABLE` for layers that do not apply to the stack.
|
|
517
|
+
- Each stack spec must include version metadata: generation date, source manifests, key dependency versions, dependency fingerprint, and regeneration triggers.
|
|
518
|
+
|
|
519
|
+
### 7.2 Generate codebase specs
|
|
520
|
+
|
|
521
|
+
For EACH frontend-type codebase, load `assets/codebase-frontend-spec-template.md` and write `.context/spec/frontend/{name}.md`.
|
|
522
|
+
|
|
523
|
+
For EACH backend/service-type codebase, load `assets/codebase-backend-spec-template.md` and write `.context/spec/backend/{name}.md`.
|
|
524
|
+
|
|
525
|
+
Codebase specs must:
|
|
526
|
+
- Link to the matching stack spec by `stack_key`.
|
|
527
|
+
- Separate `显式规则`, `代码推断`, and `待确认`.
|
|
528
|
+
- Use navigation facts and actual scanned conventions; do not invent rules or promote inconsistent legacy code to a hard rule.
|
|
529
|
+
- Include version metadata and regeneration triggers.
|
|
530
|
+
|
|
531
|
+
### 7.3 Generate spec indexes
|
|
532
|
+
|
|
533
|
+
Load `assets/context-spec-index-template.md` and write `.context/spec/index.md`.
|
|
534
|
+
|
|
535
|
+
Load `assets/context-domain-index-template.md` and write:
|
|
536
|
+
- `.context/spec/frontend/index.md`
|
|
537
|
+
- `.context/spec/backend/index.md`
|
|
538
|
+
- `.context/spec/design/index.md`
|
|
539
|
+
|
|
540
|
+
For `.context/spec/design/index.md`, project-context is the only writer. When `design_rule_pack.status` is `installed`, add a `## Shared Design Rule Package` section that links to `tokens/`, `recommendations/`, and `tools/ui-ux-pro-max/`, preserves the priority order (confirmed project facts before recommendations), and identifies the pack as recommendations rather than project facts. When it is `not_applicable`, retain the explicit no-frontend reason.
|
|
541
|
+
|
|
542
|
+
The root spec index must list:
|
|
543
|
+
- Every stack spec with its `stack_key`.
|
|
544
|
+
- Every codebase spec with codebase name, type, navigation file, and stack spec.
|
|
545
|
+
- Read order for downstream skills:
|
|
546
|
+
1. `.planning/rules/INDEX.md`
|
|
547
|
+
2. `.context/spec/index.md`
|
|
548
|
+
3. matching `.context/spec/stacks/{stack_key}.md`
|
|
549
|
+
4. matching `.context/spec/frontend|backend/{codebase}.md`
|
|
550
|
+
5. matching `.context/spec/{domain}/index.md` and applicable depth specs
|
|
551
|
+
6. `.planning/navigation/{codebase}.md`
|
|
552
|
+
7. `.planning/code-index/` machine symbols/relations when present and source-level relation facts are needed
|
|
553
|
+
8. actual source files
|
|
554
|
+
|
|
555
|
+
Each frontend/backend domain index must:
|
|
556
|
+
|
|
557
|
+
- List every codebase-level spec in that domain.
|
|
558
|
+
- Include a depth-spec registry row for every candidate topic and codebase.
|
|
559
|
+
- Emit one exact machine marker per registry row:
|
|
560
|
+
- Present: `<!-- depth_spec: codebase={name}; domain={domain}; topic={topic}; status=present; path={output_path} -->`
|
|
561
|
+
- Not applicable: `<!-- depth_spec: codebase={name}; domain={domain}; topic={topic}; status=not_applicable; path=none -->`
|
|
562
|
+
- Contain no marker from an earlier run that is absent from the current run manifest.
|
|
563
|
+
|
|
564
|
+
### 7.4 Generate depth spec files (REQUIRED)
|
|
565
|
+
|
|
566
|
+
本步骤**必须**执行。depth spec 是机器推导字段,刷新时必须与导航文件同步重新生成,禁止因为"已有旧文件"而跳过。
|
|
567
|
+
|
|
568
|
+
Depth specs are topic-specific expansions of the codebase spec. Determine the topic list dynamically from navigation scan data, then load and fill the matching template from `assets/spec-templates/{codebase-type}/`. Do not iterate a hardcoded file list.
|
|
569
|
+
|
|
570
|
+
**Backend topic discovery** (from backend-type codebase navigation):
|
|
571
|
+
|
|
572
|
+
| Topic | Match rule | Conditional |
|
|
573
|
+
|-------|-----------|-------------|
|
|
574
|
+
| `service` | directory matching `**/service*/` or `**/svc/` | always when present |
|
|
575
|
+
| `router` | directory matching `**/router*/`, `**/route*/`, `**/handler*/`, `**/controller*/`, `**/web/`, or route registration files | always when present |
|
|
576
|
+
| `schema` | directory matching `**/schema*/`, `**/dto*/`, `**/vo*/`, `**/request*/`, `**/response*/`, or request/response type files | always when present |
|
|
577
|
+
| `model` | directory matching `**/model*/`, `**/entity*/`, `**/domain/`, or ORM/entity files | always when present |
|
|
578
|
+
| `repository` | directory matching `**/repository*/`, `**/repo*/`, `**/dao/`, or persistence adapter files | always when present |
|
|
579
|
+
| `engine` | directory matching `**/engine*/`, `**/client*/`, `**/integration*/`, `**/external*/`, or outbound integration files | always when present |
|
|
580
|
+
| `scheduler` | files or directories matching `**/cron*`, `**/job*`, `**/task*`, `**/scheduler*`, or framework scheduler annotations/registrations | presence of cron/job files |
|
|
581
|
+
| `locator` | locator module detected | presence of locator-specific code |
|
|
582
|
+
| `testing` | directory matching `**/test*/`, `**/tests/`, or files matching `**/*_test.*`, `**/test_*`, `**/*.spec.*` | always when present |
|
|
583
|
+
| `directory-structure` | always | always |
|
|
584
|
+
| `errors` | always | always — derived from HTTP exception and error mapping patterns |
|
|
585
|
+
|
|
586
|
+
**Frontend topic discovery** (from frontend-type codebase navigation):
|
|
587
|
+
|
|
588
|
+
| Navigation signal | Depth spec topic | Conditional |
|
|
589
|
+
|---|---|---|
|
|
590
|
+
| Router config, `app/`, `pages/`, `src/app/`, `src/pages/`, or framework file-based routes detected | `routing` | always when present |
|
|
591
|
+
| API client dir/file exists (`**/api*/`, `**/client*/`, `**/request*`, `**/services*`) | `api-client` | always when present |
|
|
592
|
+
| State management (store/redux/zustand/pinia/vuex/context/composable state) detected | `state` | always when present |
|
|
593
|
+
| Components directory exists (`**/components/`, `**/ui/`, `**/widgets/`) | `components` | always when present |
|
|
594
|
+
| Form patterns detected | `forms` | always when present |
|
|
595
|
+
| Domain-specific editor detected | `case-editor` | presence of editor modules |
|
|
596
|
+
| Test dir/file exists (`**/test*/`, `**/*.test.*`, `**/*.spec.*`) | `testing` | always when present |
|
|
597
|
+
| always | `directory-structure` | always |
|
|
598
|
+
|
|
599
|
+
**Generation rules:**
|
|
600
|
+
|
|
601
|
+
Build `candidate_topics` and `expected_topics` independently for every local/scannable codebase:
|
|
602
|
+
|
|
603
|
+
1. Enumerate `candidate_topics` from the current filenames in `assets/spec-templates/{backend|frontend}/`; do not copy a fixed count or list into a completion gate.
|
|
604
|
+
2. Apply the discovery table to the navigation evidence. The matching subset becomes `expected_topics`.
|
|
605
|
+
3. Record both sets in `.planning/project-context-run.json.topic_inventory`.
|
|
606
|
+
|
|
607
|
+
The runtime inventory is the single source for generation and validation. A candidate topic must appear exactly once as either generated or `NOT_APPLICABLE`.
|
|
608
|
+
|
|
609
|
+
Choose output paths without collisions:
|
|
610
|
+
|
|
611
|
+
- When a domain has one codebase: `.context/spec/{domain}/{topic}.md`
|
|
612
|
+
- When a domain has multiple codebases: `.context/spec/{domain}/{codebase}/{topic}.md`
|
|
613
|
+
|
|
614
|
+
For each expected topic:
|
|
615
|
+
|
|
616
|
+
1. Record the codebase's absolute or project-relative root as `codebase_root`.
|
|
617
|
+
2. Collect every source file actually used to derive the topic as `source_paths` relative to that codebase root. Do not use directories or generated spec files as substitutes.
|
|
618
|
+
3. Compute `source_fingerprint` with the same algorithm as `scripts/validate_initialization.py`: sort unique paths, hash each file, then hash the sequence of `relative_path + NUL + file_sha256 + newline`.
|
|
619
|
+
4. Load `assets/spec-templates/{backend|frontend}/{topic}.md`, fill placeholders from navigation facts and stack template, and write the selected output path.
|
|
620
|
+
5. Add one matching entry to `.planning/project-context-run.json.depth_specs`.
|
|
621
|
+
6. Record every undiscovered candidate topic in `not_applicable_topics` and in the matching domain spec index.
|
|
622
|
+
7. Emit the exact matching `depth_spec` machine marker in the domain index.
|
|
623
|
+
|
|
624
|
+
Each depth spec uses the same structure: Generation Metadata, Scope, Source Summary (Type+Confidence), Stack-Specific Conventions, Observed Patterns, Rules (Strength+Source+Notes), Current Project Shape, Not Applicable, Pending Confirmation.
|
|
625
|
+
|
|
626
|
+
Placeholder filling rules:
|
|
627
|
+
- `{{run_id}}`: the current invocation's immutable run ID.
|
|
628
|
+
- `{{generated_at}}`: ISO-8601 UTC time when this file was regenerated.
|
|
629
|
+
- `{{source_fingerprint}}`: fingerprint computed from this manifest entry's `source_paths`.
|
|
630
|
+
- `{{scope_path}}`: derived from codebase root + navigation scan.
|
|
631
|
+
- `{{source_summary}}`: rows from navigation scan (`代码推断 | OBSERVED | high`), stack template (`SHOULD | medium`), and rule files (`MUST | high`).
|
|
632
|
+
- `{{stack_layer_rules}}`: extract the matching subsection from `.context/spec/stacks/{stack_key}.md` → `## Per-Layer Rules`. If the subsection is `NOT_APPLICABLE`, record that in this field and in `{{not_applicable}}`.
|
|
633
|
+
- `{{observed_rules}}`: rows or bullets from navigation facts, call-chain tracing, codebase conventions, explicit rule files, and lessons. Do not mix in generic stack rules here.
|
|
634
|
+
- `{{rules_table}}`: merged rows from stack layer rules, observed project conventions, explicit rule files, and lessons. Each row is `\| {{rule}} | {{strength}} | {{source}} | {{notes}} |`.
|
|
635
|
+
- `{{current_shape}}` / `{{directory_tree}}`: from navigation directory map and call chain map.
|
|
636
|
+
- `{{not_applicable}}`: layers and patterns observed to be absent.
|
|
637
|
+
- `{{pending}}`: items not yet confirmed.
|
|
638
|
+
|
|
639
|
+
Topics not discovered are skipped. Record them in the domain index and run manifest as `NOT_APPLICABLE`. A skipped topic must not be added to `depth_specs`.
|
|
640
|
+
|
|
641
|
+
If a topic is discovered but the matching template file is missing, do not silently skip it. Record a `PENDING_TEMPLATE` blocker in `.planning/STATE.md` front matter and in the matching domain spec index:
|
|
642
|
+
|
|
643
|
+
```yaml
|
|
644
|
+
blockers:
|
|
645
|
+
- type: PENDING_TEMPLATE
|
|
646
|
+
codebase: {{name}}
|
|
647
|
+
topic: {{topic}}
|
|
648
|
+
reason: found {{matched_path}} but no template in assets/spec-templates/{{backend_or_frontend}}/{{topic}}.md
|
|
649
|
+
impact: depth spec not generated for this layer
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
For the domain spec index, include the same topic, matched path, missing template path, and impact under `## Pending Confirmation`.
|
|
653
|
+
|
|
654
|
+
Do not mark initialization fully complete while `PENDING_TEMPLATE` blockers exist.
|
|
655
|
+
|
|
656
|
+
**Completion gate:**
|
|
657
|
+
|
|
658
|
+
- Every frontend/backend codebase has its codebase-level spec.
|
|
659
|
+
- Every present domain has its domain index.
|
|
660
|
+
- Every domain index contains the current run ID and exactly the machine markers represented by the run manifest.
|
|
661
|
+
- Every `(codebase, domain, topic)` in `expected_topics` has exactly one run-manifest entry and one output file.
|
|
662
|
+
- Every undiscovered candidate topic is recorded as `NOT_APPLICABLE`, not generated to satisfy a fixed count.
|
|
663
|
+
- No two manifest entries share one output path.
|
|
664
|
+
- Every depth spec contains the current `run_id` and matching `source_fingerprint`.
|
|
665
|
+
|
|
666
|
+
Any mismatch means Step 7.4 is incomplete.
|
|
667
|
+
|
|
668
|
+
## Step 8 — Generate Rule Package Files
|
|
669
|
+
|
|
670
|
+
Create the project rule package that downstream skills (`workflow-frontend-tech-spec`, `workflow-backend-tech-spec`) check first in their discovery order. This step consolidates information already collected during structure scan and generated context specs — it does not invent new rules.
|
|
671
|
+
|
|
672
|
+
### 8.1 Create `.planning/rules/` directory
|
|
673
|
+
|
|
674
|
+
```bash
|
|
675
|
+
mkdir -p .planning/rules
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
### 8.2 Generate `.planning/execution-contract.md`
|
|
679
|
+
|
|
680
|
+
Load `assets/execution-contract-template.md` and fill from scan results:
|
|
681
|
+
|
|
682
|
+
- **Backend layer models**: from each backend-type codebase navigation file's "Layer Conventions" table. Map handler/service/repository/DAO directories and describe the dependency direction. One subsection per backend codebase.
|
|
683
|
+
- **Conversion rules**: from `.cursorrules` (if present) or codebase navigation Notes. Capture domain↔vo↔model conversion rules verbatim.
|
|
684
|
+
- **Interface rules**: from `.cursorrules` or code scan. E.g., "handler implements handler interface with RegisterRoutes method".
|
|
685
|
+
- **Frontend component hierarchies**: from each frontend-type codebase navigation file's "Component Conventions" table. Map pages→page components→common components→layout→hooks. One subsection per frontend codebase.
|
|
686
|
+
- **TDD Strategy**: already embedded in template default. Fill from codebase conventions when the project has explicit TDD rules. Keep the template default otherwise.
|
|
687
|
+
- **Code Generation**: `待确认` unless codegen commands (wire, protobuf, swagger, etc.) were found during scan. If found, list each command with its source and run condition.
|
|
688
|
+
- **Verification Gates**: already embedded in template default. Fill additional project-specific verification rules from codebase conventions when present. Keep the template default otherwise.
|
|
689
|
+
|
|
690
|
+
Rules:
|
|
691
|
+
- Only write what was observed during scan. Do not invent layer rules or component conventions.
|
|
692
|
+
- If `.cursorrules` or `AGENTS.md` / `CLAUDE.md` contain explicit conventions, quote or summarize them in the relevant section.
|
|
693
|
+
- Mark unobserved sections as `待确认`, not with guessed defaults.
|
|
694
|
+
|
|
695
|
+
### 8.3 Generate `.planning/toolchain.md`
|
|
696
|
+
|
|
697
|
+
Load `assets/toolchain-template.md` and fill from the "Commands" tables in all codebase navigation files:
|
|
698
|
+
|
|
699
|
+
- Consolidate commands from each codebase, grouped by codebase name.
|
|
700
|
+
- If database migration commands were found during scan, add them.
|
|
701
|
+
- If code generation commands (wire, protobuf, swagger, etc.) were found, add them.
|
|
702
|
+
- If a command is `待确认` in the navigation files, keep it as `待确认` here.
|
|
703
|
+
|
|
704
|
+
### 8.4 Generate `.planning/rules/INDEX.md`
|
|
705
|
+
|
|
706
|
+
Load `assets/rules-index-template.md` and fill status for every rule source:
|
|
707
|
+
|
|
708
|
+
- Files created in Step 8 (`execution-contract.md`, `toolchain.md`) → status `present`.
|
|
709
|
+
- Files created in Step 7 (`.context/spec/index.md`, stack specs, frontend/backend/design indexes, codebase specs) → status `present`.
|
|
710
|
+
- Files found during Step 3 scan (`.cursorrules`, `AGENTS.md`, existing `.context/spec/`, etc.) → status `present` with path.
|
|
711
|
+
- Files not found → status `missing`.
|
|
712
|
+
- Files that don't apply (e.g., frontend rules for backend-only projects) → status `不适用`.
|
|
713
|
+
|
|
714
|
+
This file is the first thing downstream skills read. It must accurately reflect what exists after initialization.
|
|
715
|
+
|
|
716
|
+
## Step 9 — Generate STATE.md
|
|
717
|
+
|
|
718
|
+
Load `assets/state-template.md` and create `.planning/STATE.md` with:
|
|
719
|
+
|
|
720
|
+
- Initialization date
|
|
721
|
+
- Current step
|
|
722
|
+
- Completed steps
|
|
723
|
+
- Pending steps
|
|
724
|
+
- Each codebase: name, type, path, scan status, navigation file path, stack_key, and generated spec path
|
|
725
|
+
- Whether `.planning/PROJECT.md` exists
|
|
726
|
+
- Whether `.planning/navigation/` exists
|
|
727
|
+
- Whether `.context/spec/` exists and each required spec file is complete
|
|
728
|
+
- Whether each codebase navigation is complete
|
|
729
|
+
- Whether `.planning/rules/INDEX.md`, `.planning/execution-contract.md`, and `.planning/toolchain.md` exist
|
|
730
|
+
- Current `run_id`, `run_started_at`, and `code_index_status`
|
|
731
|
+
- Design rule pack status and reason
|
|
732
|
+
- Last scan timestamp
|
|
733
|
+
- Blockers
|
|
734
|
+
- Known missing information
|
|
735
|
+
- Recommended next step, usually `workflow-requirement-baseline` after the user provides a requirement
|
|
736
|
+
|
|
737
|
+
## Step 9.5 — Finalize Run Manifest
|
|
738
|
+
|
|
739
|
+
Load `assets/run-manifest-template.json` and write `.planning/project-context-run.json`.
|
|
740
|
+
|
|
741
|
+
Requirements:
|
|
742
|
+
|
|
743
|
+
- `run_id` and `started_at` exactly match the values captured before Step 1.
|
|
744
|
+
- `mode` is `full` or `fast`.
|
|
745
|
+
- `code_index_status` is `complete` in full mode and `skipped` in fast mode.
|
|
746
|
+
- `code_index_skip_reason` is `none` in full mode or the explicit skip flag in fast mode.
|
|
747
|
+
- `design_rule_pack` has status `installed` with its verified assets for frontend projects, or `not_applicable` with a reason for projects without frontend codebases.
|
|
748
|
+
- Every local/scannable frontend/backend codebase has one `topic_inventory` entry. Its `candidate_topics` come from current template filenames and its `discovered_topics` come from the Step 7.4 evidence match.
|
|
749
|
+
- Every expected depth topic has one entry with its codebase root, actual output path, complete codebase-relative `source_paths`, and computed `source_fingerprint`.
|
|
750
|
+
- Every undiscovered candidate topic is listed under `not_applicable_topics`.
|
|
751
|
+
- JSON placeholders and example rows are fully removed.
|
|
752
|
+
|
|
753
|
+
## Step 10 — Review Gate
|
|
754
|
+
|
|
755
|
+
This is the final step. Before finishing, review generated files against `references/navigation-guide.md`, then run the deterministic completion validator.
|
|
756
|
+
|
|
757
|
+
Check:
|
|
758
|
+
|
|
759
|
+
- All codebase locations from Step 1 are recorded in INDEX.md Codebase Registry.
|
|
760
|
+
- Each codebase has a navigation file at `.planning/navigation/{name}.md`.
|
|
761
|
+
- Frameworks are recorded or marked `待确认` for each codebase.
|
|
762
|
+
- Entry points and key directories are recorded or marked `待确认` for each codebase.
|
|
763
|
+
- Each codebase has a Directory Map (3a gate: all top-level/second-level directories listed).
|
|
764
|
+
- Each codebase has a Call Chain Map (3b gate: all handlers/routes traced).
|
|
765
|
+
- Each codebase has Conventions (3c gate: at minimum layer order or component hierarchy recorded).
|
|
766
|
+
- Each local/scannable codebase has a Stack Profile (3d gate: stack_key, manifest path, and dependency fingerprint recorded).
|
|
767
|
+
- Every detected stack profile has `.context/spec/stacks/{stack_key}.md`.
|
|
768
|
+
- Every frontend-type codebase has `.context/spec/frontend/{name}.md`.
|
|
769
|
+
- Every backend/service-type codebase has `.context/spec/backend/{name}.md`.
|
|
770
|
+
- Every depth topic discovered in Step 7.4 has exactly one output and manifest entry.
|
|
771
|
+
- Every topic not discovered in Step 7.4 is recorded as `NOT_APPLICABLE`; no fixed topic count is imposed.
|
|
772
|
+
- Every frontend/backend domain index has exactly the current manifest's depth-spec registry markers and no stale markers.
|
|
773
|
+
- `.context/spec/index.md` lists every stack spec and codebase spec mapping.
|
|
774
|
+
- All generated context specs include generation metadata and regeneration triggers; depth specs include the current run ID and source fingerprint.
|
|
775
|
+
- Frontend-type codebases have Route-Component Map and Data Flow tables.
|
|
776
|
+
- Backend-type codebases have API Modules, Scheduled Jobs, and External Integrations tables.
|
|
777
|
+
- Commands are recorded or marked `待确认` for each codebase.
|
|
778
|
+
- `.planning/execution-contract.md` exists and contains layer order and component hierarchy from scan results, not invented defaults.
|
|
779
|
+
- `.planning/toolchain.md` exists and consolidates commands from all codebase navigation files.
|
|
780
|
+
- `.planning/rules/INDEX.md` exists and accurately reflects generated `.context/spec/` files as present.
|
|
781
|
+
- Project rule package locations are recorded when present, including `.context/spec/`, `.context/workflow/`, and lessons.
|
|
782
|
+
- History model locations are recorded, and outbound-call style `features/` history is labeled as optional legacy rather than the default source.
|
|
783
|
+
- `.planning/PROJECT.md` links to `.planning/navigation/INDEX.md`.
|
|
784
|
+
- `.planning/navigation/INDEX.md` Codebase Registry links to every codebase navigation file.
|
|
785
|
+
- `.planning/navigation/INDEX.md` includes downstream read contract.
|
|
786
|
+
- `.planning/navigation/INDEX.md` and `.context/spec/index.md` describe `.planning/code-index/` as the machine fact layer before source reads, unless fast mode skipped generation.
|
|
787
|
+
- Every frontend project has the design rule assets from Step 6.6, while `.context/spec/design/index.md` remains generated by project-context rather than overwritten by the installer.
|
|
788
|
+
- Future output locations include `.planning/features/{功能名}/功能点梳理.md`.
|
|
789
|
+
- No requirements or roadmap were generated without explicit user request.
|
|
790
|
+
- `STATE.md` includes completion statuses and next action for each codebase.
|
|
791
|
+
- Generated files include an initialization quality summary.
|
|
792
|
+
|
|
793
|
+
Run:
|
|
794
|
+
|
|
795
|
+
```text
|
|
796
|
+
devflow_skill_script(script="project-context-validate", args=["--root", ".", "--manifest", ".planning/project-context-run.json"])
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
The validator checks current-run markers, full-mode code-index freshness, fast-mode skip evidence, template-derived topic inventory partitioning, dynamic depth-spec outputs, domain-index registry markers, source fingerprints, duplicate identities, and output-path collisions.
|
|
800
|
+
|
|
801
|
+
Fix every reported gap and rerun the validator. If the command does not pass, initialization is incomplete and the final response must report the blocker instead of claiming success.
|
|
802
|
+
|
|
803
|
+
Quality status rules:
|
|
804
|
+
|
|
805
|
+
- `complete`: required fields are known and commands are identified.
|
|
806
|
+
- `partial`: project is local and scannable, but some required fields are `待确认`.
|
|
807
|
+
- `pending`: project location is remote/unavailable or scan could not run.
|
|
808
|
+
- `not_applicable`: this codebase type does not support this field (e.g., component conventions for a backend service).
|
|
809
|
+
|
|
810
|
+
## Downstream Read Contract
|
|
811
|
+
|
|
812
|
+
This skill writes the contract and the initial rule package. Other skills consume them:
|
|
813
|
+
|
|
814
|
+
- Requirement discussion should read `.planning/PROJECT.md`, `.planning/navigation/INDEX.md`, and `.planning/rules/INDEX.md`.
|
|
815
|
+
- Feature breakdown should read `.planning/PROJECT.md`, `.planning/navigation/INDEX.md`, and relevant codebase navigation files as needed.
|
|
816
|
+
- Test guide generation should read `.planning/PROJECT.md`, `.planning/navigation/INDEX.md`, and `.planning/rules/INDEX.md`.
|
|
817
|
+
- Frontend technical planning should read `.planning/rules/INDEX.md` → `.context/spec/index.md` → matching `.context/spec/stacks/{stack_key}.md` → matching `.context/spec/frontend/{codebase}.md` → `.context/spec/frontend/index.md` and applicable depth specs → `.planning/navigation/{codebase}.md` → `.planning/code-index/` when relation facts are needed → actual source files.
|
|
818
|
+
- Backend technical planning should read `.planning/rules/INDEX.md` → `.context/spec/index.md` → matching `.context/spec/stacks/{stack_key}.md` → matching `.context/spec/backend/{codebase}.md` → `.context/spec/backend/index.md` and applicable depth specs → `.planning/navigation/{codebase}.md` → `.planning/code-index/` when relation facts are needed → actual source files.
|
|
819
|
+
- Change-list generation should use `.planning/navigation/INDEX.md` for output locations and project conventions, and use discovered `.context/spec/` + `.planning/rules/` sources for task-level gates.
|