@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,63 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""PreToolUse hook: block protected source access until indexes were observed."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import json
|
|
7
|
+
|
|
8
|
+
from hook_common import (
|
|
9
|
+
direct_tool_paths,
|
|
10
|
+
ensure_session,
|
|
11
|
+
is_mutation_tool,
|
|
12
|
+
load_policy,
|
|
13
|
+
locked_state,
|
|
14
|
+
project_root,
|
|
15
|
+
read_event,
|
|
16
|
+
record_prechange_fingerprints,
|
|
17
|
+
required_evidence,
|
|
18
|
+
tool_requests_protected_source,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main() -> int:
|
|
23
|
+
event = read_event()
|
|
24
|
+
root = project_root(event)
|
|
25
|
+
policy = load_policy(root)
|
|
26
|
+
session_id = ensure_session(root, event)
|
|
27
|
+
required = required_evidence(root, policy)
|
|
28
|
+
|
|
29
|
+
with locked_state(root, session_id) as state:
|
|
30
|
+
state["required_evidence"] = required
|
|
31
|
+
observed = set(state.get("evidence", []))
|
|
32
|
+
|
|
33
|
+
blocked, paths = tool_requests_protected_source(event, root, policy)
|
|
34
|
+
missing = [path for path in required if path not in observed]
|
|
35
|
+
strict = str(policy.get("mode", "strict")).lower() == "strict"
|
|
36
|
+
if strict and required and missing and blocked:
|
|
37
|
+
reason = (
|
|
38
|
+
"INDEX_GATE_BLOCKED: protected source access requires observed index evidence. "
|
|
39
|
+
f"Read these files first, in order: {', '.join(missing)}. "
|
|
40
|
+
f"Blocked target: {', '.join(paths)}. The gate records successful tool reads, not assistant promises."
|
|
41
|
+
)
|
|
42
|
+
print(
|
|
43
|
+
json.dumps(
|
|
44
|
+
{
|
|
45
|
+
"hookSpecificOutput": {
|
|
46
|
+
"hookEventName": "PreToolUse",
|
|
47
|
+
"permissionDecision": "deny",
|
|
48
|
+
"permissionDecisionReason": reason,
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
ensure_ascii=False,
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
return 0
|
|
55
|
+
|
|
56
|
+
if is_mutation_tool(event):
|
|
57
|
+
record_prechange_fingerprints(root, session_id, direct_tool_paths(event, root))
|
|
58
|
+
return 0
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if __name__ == "__main__":
|
|
62
|
+
raise SystemExit(main())
|
|
63
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""PostToolUse hook: record index evidence and files changed by successful tools."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from hook_common import (
|
|
7
|
+
command_text,
|
|
8
|
+
direct_tool_paths,
|
|
9
|
+
ensure_session,
|
|
10
|
+
evidence_observed,
|
|
11
|
+
is_command_tool,
|
|
12
|
+
is_mutation_tool,
|
|
13
|
+
load_policy,
|
|
14
|
+
locked_state,
|
|
15
|
+
project_root,
|
|
16
|
+
read_event,
|
|
17
|
+
required_evidence,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main() -> int:
|
|
22
|
+
event = read_event()
|
|
23
|
+
root = project_root(event)
|
|
24
|
+
policy = load_policy(root)
|
|
25
|
+
session_id = ensure_session(root, event)
|
|
26
|
+
required = required_evidence(root, policy)
|
|
27
|
+
optional = [
|
|
28
|
+
str(item.get("path") if isinstance(item, dict) else item)
|
|
29
|
+
for item in policy.get("optional_evidence", [])
|
|
30
|
+
]
|
|
31
|
+
observed = evidence_observed(event, root, required + optional)
|
|
32
|
+
touched = direct_tool_paths(event, root) if is_mutation_tool(event) else []
|
|
33
|
+
|
|
34
|
+
with locked_state(root, session_id) as state:
|
|
35
|
+
state["evidence"] = sorted(set(state.get("evidence", [])) | set(observed))
|
|
36
|
+
state["touched_files"] = sorted(set(state.get("touched_files", [])) | set(touched))
|
|
37
|
+
if is_command_tool(event) and command_text(event):
|
|
38
|
+
state["rescan_required"] = True
|
|
39
|
+
return 0
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
raise SystemExit(main())
|
|
44
|
+
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Session bootstrapper: inject compact workflow context and initialize hook state."""
|
|
3
|
+
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
from io import StringIO
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
from hook_common import cli_dir_name, initialize_session, project_root, read_event
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def should_skip() -> bool:
|
|
14
|
+
return os.environ.get("OMP_NON_INTERACTIVE") == "1"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def read_file(path: Path, fallback: str = "") -> str:
|
|
18
|
+
try:
|
|
19
|
+
return path.read_text(encoding="utf-8")
|
|
20
|
+
except (FileNotFoundError, PermissionError):
|
|
21
|
+
return fallback
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def detect_cli_dir(project_dir: Path) -> str:
|
|
25
|
+
"""Resolve the native config directory, including marketplace execution."""
|
|
26
|
+
return cli_dir_name()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def load_config(project_dir: Path, cli_dir: str) -> dict:
|
|
30
|
+
defaults = {
|
|
31
|
+
"sources": {
|
|
32
|
+
"state": ".planning/STATE.md",
|
|
33
|
+
"workflow": ".context/workflow.md",
|
|
34
|
+
"indexes": [
|
|
35
|
+
".planning/rules/INDEX.md",
|
|
36
|
+
".context/spec/index.md",
|
|
37
|
+
".planning/navigation/INDEX.md",
|
|
38
|
+
".planning/code-index/INDEX.md",
|
|
39
|
+
],
|
|
40
|
+
"lessons": ".context/lessons/README.md",
|
|
41
|
+
"commands": f"{cli_dir}/commands/start.md",
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
config_path = project_dir / cli_dir / "hook-config.json"
|
|
45
|
+
if config_path.exists():
|
|
46
|
+
try:
|
|
47
|
+
loaded = json.loads(config_path.read_text(encoding="utf-8"))
|
|
48
|
+
if isinstance(loaded, dict):
|
|
49
|
+
merged = {**defaults, **loaded}
|
|
50
|
+
merged["sources"] = {
|
|
51
|
+
**defaults["sources"],
|
|
52
|
+
**loaded.get("sources", {}),
|
|
53
|
+
}
|
|
54
|
+
return merged
|
|
55
|
+
except json.JSONDecodeError:
|
|
56
|
+
pass
|
|
57
|
+
return defaults
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def parse_scalar(value: str):
|
|
61
|
+
value = value.strip()
|
|
62
|
+
if value == "[]":
|
|
63
|
+
return []
|
|
64
|
+
if (value.startswith('"') and value.endswith('"')) or (value.startswith("'") and value.endswith("'")):
|
|
65
|
+
return value[1:-1]
|
|
66
|
+
return value
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def parse_state_frontmatter(full: str) -> dict:
|
|
70
|
+
if not full.startswith("---\n"):
|
|
71
|
+
return {}
|
|
72
|
+
end = full.find("\n---", 4)
|
|
73
|
+
if end == -1:
|
|
74
|
+
return {}
|
|
75
|
+
|
|
76
|
+
data = {}
|
|
77
|
+
lines = full[4:end].splitlines()
|
|
78
|
+
i = 0
|
|
79
|
+
while i < len(lines):
|
|
80
|
+
line = lines[i]
|
|
81
|
+
if not line.strip() or line.startswith(" "):
|
|
82
|
+
i += 1
|
|
83
|
+
continue
|
|
84
|
+
if ":" not in line:
|
|
85
|
+
i += 1
|
|
86
|
+
continue
|
|
87
|
+
|
|
88
|
+
key, raw = line.split(":", 1)
|
|
89
|
+
key = key.strip()
|
|
90
|
+
raw = raw.strip()
|
|
91
|
+
if raw:
|
|
92
|
+
data[key] = parse_scalar(raw)
|
|
93
|
+
i += 1
|
|
94
|
+
continue
|
|
95
|
+
|
|
96
|
+
values = []
|
|
97
|
+
j = i + 1
|
|
98
|
+
while j < len(lines) and lines[j].startswith("- "):
|
|
99
|
+
values.append(parse_scalar(lines[j][2:]))
|
|
100
|
+
j += 1
|
|
101
|
+
if values:
|
|
102
|
+
data[key] = values
|
|
103
|
+
i = j
|
|
104
|
+
else:
|
|
105
|
+
i += 1
|
|
106
|
+
return data
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def format_state_from_frontmatter(full: str) -> str:
|
|
110
|
+
state = parse_state_frontmatter(full)
|
|
111
|
+
if not state.get("current_step") and not state.get("status"):
|
|
112
|
+
return ""
|
|
113
|
+
|
|
114
|
+
completed = state.get("completed_steps") or []
|
|
115
|
+
pending = state.get("pending_steps") or []
|
|
116
|
+
completed_text = ", ".join(completed) if completed else "none"
|
|
117
|
+
pending_text = ", ".join(pending) if pending else "none"
|
|
118
|
+
|
|
119
|
+
parts = [
|
|
120
|
+
"## Workflow State",
|
|
121
|
+
"",
|
|
122
|
+
f"- **Current Flow**: {state.get('current_flow', 'unknown')}",
|
|
123
|
+
f"- **Current Feature**: {state.get('current_feature', 'unknown')}",
|
|
124
|
+
f"- **Current Phase**: {state.get('current_phase', 'unknown')}",
|
|
125
|
+
f"- **Current Step**: {state.get('current_step', 'unknown')}",
|
|
126
|
+
f"- **Status**: {state.get('status', 'unknown')}",
|
|
127
|
+
]
|
|
128
|
+
if state.get("checkpoint"):
|
|
129
|
+
parts.append(f"- **Checkpoint**: {state.get('checkpoint')}")
|
|
130
|
+
parts.extend(
|
|
131
|
+
[
|
|
132
|
+
f"- **Completed Steps**: {completed_text}",
|
|
133
|
+
f"- **Pending Steps**: {pending_text}",
|
|
134
|
+
"",
|
|
135
|
+
"## Blockers",
|
|
136
|
+
"",
|
|
137
|
+
"无。",
|
|
138
|
+
"",
|
|
139
|
+
"## Recommended Next Step",
|
|
140
|
+
"",
|
|
141
|
+
]
|
|
142
|
+
)
|
|
143
|
+
if state.get("status") == "completed" and not pending:
|
|
144
|
+
parts.append("Workflow complete — no pending workflow steps.")
|
|
145
|
+
elif state.get("checkpoint"):
|
|
146
|
+
parts.append(f"Await checkpoint confirmation: {state.get('checkpoint')}.")
|
|
147
|
+
elif pending:
|
|
148
|
+
parts.append(f"Continue with next pending step: {pending[0]}.")
|
|
149
|
+
else:
|
|
150
|
+
parts.append("Inspect workflow state with workflow-orchestrator before proceeding.")
|
|
151
|
+
return "\n".join(parts)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def load_state_section(project_dir: Path, state_path: str) -> str:
|
|
155
|
+
full = read_file(project_dir / state_path)
|
|
156
|
+
if not full:
|
|
157
|
+
return ""
|
|
158
|
+
|
|
159
|
+
frontmatter_summary = format_state_from_frontmatter(full)
|
|
160
|
+
if frontmatter_summary:
|
|
161
|
+
return frontmatter_summary
|
|
162
|
+
|
|
163
|
+
lines = full.split("\n")
|
|
164
|
+
sections = []
|
|
165
|
+
capture = False
|
|
166
|
+
for line in lines:
|
|
167
|
+
if line.startswith("## ") and any(
|
|
168
|
+
kw in line for kw in ["Workflow State", "Completion", "Blockers", "Next Action", "Recommended Next Step"]
|
|
169
|
+
):
|
|
170
|
+
capture = True
|
|
171
|
+
sections.append(line)
|
|
172
|
+
elif line.startswith("## ") and capture:
|
|
173
|
+
capture = False
|
|
174
|
+
sections.append("")
|
|
175
|
+
elif capture:
|
|
176
|
+
sections.append(line)
|
|
177
|
+
|
|
178
|
+
extracted = "\n".join(sections).strip()
|
|
179
|
+
if not extracted:
|
|
180
|
+
return full[:1500]
|
|
181
|
+
return extracted
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def main():
|
|
185
|
+
if should_skip():
|
|
186
|
+
sys.exit(0)
|
|
187
|
+
|
|
188
|
+
event = read_event()
|
|
189
|
+
project_dir = project_root(event)
|
|
190
|
+
initialize_session(project_dir, event)
|
|
191
|
+
cli_dir = detect_cli_dir(project_dir)
|
|
192
|
+
config = load_config(project_dir, cli_dir)
|
|
193
|
+
sources = config.get("sources", {})
|
|
194
|
+
|
|
195
|
+
output = StringIO()
|
|
196
|
+
|
|
197
|
+
# 项目身份
|
|
198
|
+
project_name = project_dir.name
|
|
199
|
+
project_md = read_file(project_dir / ".planning" / "PROJECT.md")
|
|
200
|
+
for line in project_md.split("\n"):
|
|
201
|
+
if line.startswith("- **Name**:"):
|
|
202
|
+
project_name = line.split(":")[-1].strip()
|
|
203
|
+
break
|
|
204
|
+
|
|
205
|
+
output.write(
|
|
206
|
+
"<session-context>\n"
|
|
207
|
+
f"你正在 {project_name} 项目中进行研发工作。\n"
|
|
208
|
+
"该项目使用 .planning/ 跟踪研发流水线进度,状态写入和上下文同步由 OMP extension 强制执行。\n"
|
|
209
|
+
"索引只用于加速定位;发现索引缺失或过期时,直接回退到 LSP、搜索和源码,并报告降级状态。\n"
|
|
210
|
+
"</session-context>\n\n"
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
# 跨 clear 意图
|
|
214
|
+
intent_path = project_dir / ".planning" / ".next-intent"
|
|
215
|
+
intent = {}
|
|
216
|
+
if intent_path.exists():
|
|
217
|
+
try:
|
|
218
|
+
intent = json.loads(intent_path.read_text(encoding="utf-8"))
|
|
219
|
+
except (json.JSONDecodeError, PermissionError):
|
|
220
|
+
pass
|
|
221
|
+
try:
|
|
222
|
+
intent_path.unlink()
|
|
223
|
+
except PermissionError:
|
|
224
|
+
pass
|
|
225
|
+
|
|
226
|
+
if intent:
|
|
227
|
+
output.write("<intent>\n")
|
|
228
|
+
output.write(json.dumps(intent, ensure_ascii=False))
|
|
229
|
+
output.write("\n</intent>\n\n")
|
|
230
|
+
|
|
231
|
+
# Pipeline 状态
|
|
232
|
+
state_path = sources.get("state", ".planning/STATE.md")
|
|
233
|
+
state_text = load_state_section(project_dir, state_path)
|
|
234
|
+
if state_text:
|
|
235
|
+
output.write("<pipeline-state>\n")
|
|
236
|
+
output.write(state_text)
|
|
237
|
+
output.write("\n</pipeline-state>\n\n")
|
|
238
|
+
|
|
239
|
+
# 研发流程
|
|
240
|
+
workflow_path = sources.get("workflow", ".context/workflow.md")
|
|
241
|
+
workflow_text = read_file(project_dir / workflow_path)
|
|
242
|
+
if workflow_text:
|
|
243
|
+
output.write("<workflow>\n")
|
|
244
|
+
output.write(workflow_text)
|
|
245
|
+
output.write("\n</workflow>\n\n")
|
|
246
|
+
|
|
247
|
+
# 只注入入口清单;具体内容按需读取,过期时回退到源码事实。
|
|
248
|
+
index_paths = sources.get("indexes", [])
|
|
249
|
+
if index_paths:
|
|
250
|
+
output.write("<index-entrypoints>\n")
|
|
251
|
+
for rel_path in index_paths:
|
|
252
|
+
status = "available" if (project_dir / rel_path).is_file() else "missing"
|
|
253
|
+
output.write(f"- {rel_path}: {status}\n")
|
|
254
|
+
output.write("</index-entrypoints>\n\n")
|
|
255
|
+
|
|
256
|
+
# 经验教训
|
|
257
|
+
lessons_path = sources.get("lessons", ".context/lessons/README.md")
|
|
258
|
+
lessons_text = read_file(project_dir / lessons_path)
|
|
259
|
+
if lessons_text and lessons_text.strip():
|
|
260
|
+
output.write("<lessons>\n")
|
|
261
|
+
output.write(lessons_text)
|
|
262
|
+
output.write("\n</lessons>\n\n")
|
|
263
|
+
|
|
264
|
+
# 初始化指令
|
|
265
|
+
commands_path = sources.get("commands", f"{cli_dir}/commands/start.md")
|
|
266
|
+
start_text = read_file(project_dir / commands_path)
|
|
267
|
+
if start_text:
|
|
268
|
+
output.write("<instructions>\n")
|
|
269
|
+
output.write(start_text)
|
|
270
|
+
output.write("\n</instructions>\n\n")
|
|
271
|
+
|
|
272
|
+
output.write(
|
|
273
|
+
"<ready>\n"
|
|
274
|
+
"精简会话上下文已经加载。等待用户请求,并服从 Devflow 工具的状态门禁与同步判定。\n"
|
|
275
|
+
"</ready>"
|
|
276
|
+
)
|
|
277
|
+
|
|
278
|
+
result = {
|
|
279
|
+
"hookSpecificOutput": {
|
|
280
|
+
"hookEventName": "SessionStart",
|
|
281
|
+
"additionalContext": output.getvalue(),
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
print(json.dumps(result, ensure_ascii=False), flush=True)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
if __name__ == "__main__":
|
|
288
|
+
main()
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-orchestrator
|
|
3
|
+
description: Use when the user asks to continue, resume, advance, inspect, or route a .planning-based workflow; when the OMP development agent must decide the next workflow skill from project state; or when a checkpoint must be handled before proceeding.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Orchestrator
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Control-plane entrypoint for project workflows. Reads `.planning/STATE.md`, `.planning/workflows/*.yaml`, and the artifact registry, decides the next action, and preserves checkpoint gates. Pipeline delegates here after parameter parsing and breakpoint detection.
|
|
11
|
+
|
|
12
|
+
This skill is the **single source of truth for all execution-time rules**: gate rules, CP protocol, failure branches, parallel windows, state writeback, lessons injection, and requirement writeback. Pipeline only handles entry (args + breakpoint).
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
If the project has no generated control-plane files, initialize them through the single-writer runtime:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
devflow_bootstrap(feature="<feature>", phase="<phase>")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use `force=true` only when replacing invalid generated workflow/state files is intentional and reviewed.
|
|
23
|
+
|
|
24
|
+
Run the state inspector first:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
devflow_state(action="inspect")
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use the JSON result to choose one of these actions:
|
|
31
|
+
|
|
32
|
+
| `action` | Required behavior |
|
|
33
|
+
|----------|-------------------|
|
|
34
|
+
| `await_user_confirmation` | Stop. Summarize the checkpoint and ask the user to confirm before advancing. |
|
|
35
|
+
| `route_failure_branch` | Stop normal flow. Load the indicated remediation workflow and start its entry step. |
|
|
36
|
+
| `run_parallel_window` | Run all indicated independent branch steps if parallel execution is available, otherwise use the fallback order. |
|
|
37
|
+
| `run_project_context` | Load and execute `workflow-project-context`, then run the state inspector again. |
|
|
38
|
+
| `run_next_step` | Load and execute the indicated `next_step.skill`. |
|
|
39
|
+
| `run_current_step` | Re-run or finish the indicated `current_step.skill`. |
|
|
40
|
+
| `workflow_complete` | Report completion and do not call another workflow skill. |
|
|
41
|
+
| `blocked` | Report the blocking reason and ask for the minimum missing input. |
|
|
42
|
+
|
|
43
|
+
When `blocked` includes a `recovery` command, run or propose that command before attempting normal dispatch.
|
|
44
|
+
|
|
45
|
+
`inspect_state.rb` runs `validate_state.rb` before dispatching normal actions. If validation fails, stop at `action: blocked` and fix the reported state/artifact inconsistency before continuing. Do not treat `status: completed` as authoritative unless `validate_state.rb --json` returns `ok: true`.
|
|
46
|
+
|
|
47
|
+
When `run_project_context` is returned, do not initialize workflow state manually first. Execute `workflow-project-context` with the user's provided codebase locations and project-init arguments, verify it writes `.planning/PROJECT.md`, `.planning/navigation/INDEX.md`, `.context/spec/index.md`, and `.planning/STATE.md`, then run `inspect_state.rb --json` again and continue from the returned action.
|
|
48
|
+
|
|
49
|
+
## Automatic Run Loop
|
|
50
|
+
|
|
51
|
+
When the invocation contains `<devflow-runtime-directive>`, run the workflow continuously instead of stopping after one successful step:
|
|
52
|
+
|
|
53
|
+
1. Inspect state and execute exactly the returned action.
|
|
54
|
+
2. After a successful step transition and artifact synchronization, inspect state again.
|
|
55
|
+
3. Continue with the newly returned action and load only that step's Skill.
|
|
56
|
+
4. Stop only when the inspector returns `await_user_confirmation`, `blocked`, or `workflow_complete`; also stop on an explicit user interruption or an unrecoverable tool failure.
|
|
57
|
+
5. At `await_user_confirmation`, present the checkpoint and yield to the user. Resume the same loop only after an explicit confirmation and successful `devflow_transition`.
|
|
58
|
+
|
|
59
|
+
Do not interpret “automatic” as permission to cross a checkpoint, weaken a gate, retry a stale revision without re-inspection, or continue after a blocked action. If context pressure requires a new turn, preserve project truth in `.planning`, finish required context synchronization, and use `/devflow resume` rather than inventing state from the conversation.
|
|
60
|
+
|
|
61
|
+
## Step Execution Protocol
|
|
62
|
+
|
|
63
|
+
Each step execution follows this fixed sequence:
|
|
64
|
+
|
|
65
|
+
**Before execution:**
|
|
66
|
+
1. Call `devflow_skill_script(script="orchestrator-manage-lessons", args=["--select", "--next-step", "<step-id>", "--json"])`. If lessons are returned, prepend their content before loading the skill. This is **mandatory**, not advisory.
|
|
67
|
+
2. Read the step definition from `feature-development.yaml` for `inputs`, `outputs`, and `meta_output`.
|
|
68
|
+
|
|
69
|
+
**Execution:**
|
|
70
|
+
3. Load the named skill from `skill://<skill>`.
|
|
71
|
+
4. Pass along the resolved `inputs`, `outputs`, `meta_output`, current feature, and phase.
|
|
72
|
+
5. Ensure the skill writes both its `outputs` AND its `meta_output` (the `.meta.json` file).
|
|
73
|
+
|
|
74
|
+
**After execution:**
|
|
75
|
+
6. Verify the step's outputs exist, record the revision returned by `devflow_state(action="inspect")`, then call `devflow_transition(action="complete-step", step="<step-id>", expectedRevision=<revision>)`.
|
|
76
|
+
7. If the YAML step has `meta_output`, verify the `.meta.json` file exists and has the required fields. If missing, mark the step as `blocked` with reason "missing_meta_output".
|
|
77
|
+
8. `devflow_transition` validates the proposed state before writing and rejects inconsistent updates. Never repeat the transition after it reports success.
|
|
78
|
+
9. Call `devflow_artifact(action="sync", preserve=false)` only when the registry still shows stale `planned`/`generated` statuses for completed steps.
|
|
79
|
+
|
|
80
|
+
## Checkpoint Rules
|
|
81
|
+
|
|
82
|
+
Never cross CP checkpoints silently. CP definitions (prompts, options, fields) are in the active workflow YAML (`feature-development.yaml` → `checkpoints`).
|
|
83
|
+
|
|
84
|
+
When the inspector returns `await_user_confirmation`:
|
|
85
|
+
|
|
86
|
+
1. Read the checkpoint definition from YAML: `checkpoints.<cp-id>`.
|
|
87
|
+
2. Prefer structured checkpoint fields when present:
|
|
88
|
+
- `producing_step`
|
|
89
|
+
- `required_outputs`
|
|
90
|
+
- `required_meta_output`
|
|
91
|
+
- `required_meta_fields`
|
|
92
|
+
- `summary_fields`
|
|
93
|
+
- `prompt`
|
|
94
|
+
- `confirm_options`
|
|
95
|
+
- `skip_policy`
|
|
96
|
+
3. Read the producing step's `meta_output` or checkpoint `required_meta_output` → `.meta.json` to get structured field values (e.g., `fp_count`, `br_count`).
|
|
97
|
+
4. Verify the listed required outputs exist.
|
|
98
|
+
5. Check artifact registry content_valid status for the listed outputs.
|
|
99
|
+
6. Use `ask` to present the CP prompt, filling in the `summary_fields` from `.meta.json` data.
|
|
100
|
+
7. If the user confirms, inspect the current revision and call `devflow_transition(action="confirm-checkpoint", expectedRevision=<revision>)`.
|
|
101
|
+
8. If the user asks for fixes or rejects the checkpoint, keep `.planning/STATE.md` at `status: waiting_checkpoint`, inspect the current revision, call `devflow_transition(action="checkpoint-decision", decision="needs_fix", expectedRevision=<revision>)`, and route to the requested remediation.
|
|
102
|
+
|
|
103
|
+
CP skip rules:
|
|
104
|
+
- CP-1, CP-API, CP-2, CP-3, CP-4: **never skip**.
|
|
105
|
+
- CP-2 is the Merge Gate. It cannot be skipped in the dual-track workflow.
|
|
106
|
+
|
|
107
|
+
## Global Gate Rules
|
|
108
|
+
|
|
109
|
+
After each step completes, verify the step's gate before advancing:
|
|
110
|
+
|
|
111
|
+
| Step | Gate | Block if |
|
|
112
|
+
|------|------|---------|
|
|
113
|
+
| requirement-triage | triage.meta.json `status` is `routed` AND `route` is `ready_for_wayfinder` | Reject advance to requirement-wayfinder |
|
|
114
|
+
| requirement-wayfinder | 决策地图.meta.json `status=ready_for_baseline` AND `ready_for_baseline=true` | Reject advance to domain-modeling |
|
|
115
|
+
| domain-modeling | 领域模型记录及 meta 存在且标识当前功能 | Reject advance to requirement-feasibility-review |
|
|
116
|
+
| requirement-feasibility-review | 可实现性审查.meta.json `status=ready_for_baseline`、`baseline_gate=pass`、`gap_count=0` 且无 critical finding | Reject advance to requirement-baseline |
|
|
117
|
+
| requirement-baseline | baseline.md review conclusion is "通过" AND baseline.meta.json `review_status` is `passed` AND blocking counters are all 0 | Reject advance to api-contract |
|
|
118
|
+
| api-contract | api-contract.meta.json `review_status` is `passed` AND `pending_contract_count` is 0 | Reject advance to dual tracks |
|
|
119
|
+
| ui-spec | UI-SPEC.md review conclusion is "通过" | Reject advance to feature-breakdown |
|
|
120
|
+
| feature-breakdown | 功能点梳理.md review conclusion is "通过" | Reject advance to tech-specs |
|
|
121
|
+
| api-call-guide | api-call-guide.meta.json `frontend_consumable` and `mock_ready` are true, pending_items is empty | Reject merge gate |
|
|
122
|
+
| frontend-tech-spec + backend-tech-spec | Both review conclusions are "通过" | Reject integration-verify |
|
|
123
|
+
| integration-verify | integration-report.meta.json `merge_gate_status` is `passed` and all mismatch/blocking counters are 0 | Reject advance to change-plan |
|
|
124
|
+
| change-plan | 变更清单.md review conclusion is "通过" | Reject advance to execute |
|
|
125
|
+
|
|
126
|
+
If a gate fails, the current step must be re-executed. Do not skip failing gates.
|
|
127
|
+
|
|
128
|
+
## Requirement Writeback Gate
|
|
129
|
+
|
|
130
|
+
When any later step discovers or introduces a change that alters external behavior, the requirement baseline must be updated first before downstream documents or code are modified.
|
|
131
|
+
|
|
132
|
+
Must writeback to `.planning/requirements/baseline.md` when:
|
|
133
|
+
- New or changed user-visible behavior, notifications, failure handling, retry policy, scheduling, permissions, API contracts, or data write rules
|
|
134
|
+
- Missing edge cases, compatibility requirements, historical impacts, or non-functional constraints found during execution
|
|
135
|
+
- User adds/modifies requirements during tech-spec, change-plan, execution, or verification
|
|
136
|
+
|
|
137
|
+
After writeback, sync affected feature-breakdown, tech-specs, change-plan, and STATE.md. Do not let baseline become stale while downstream artifacts advance.
|
|
138
|
+
|
|
139
|
+
## Simplification Gate
|
|
140
|
+
|
|
141
|
+
If a user's request looks like a simple change, it cannot skip the pipeline automatically. Only propose simplification when ALL of:
|
|
142
|
+
- Change touches only a single file, method, or document
|
|
143
|
+
- No new tables, APIs, routes, permissions, configs, migrations, or cross-layer impacts
|
|
144
|
+
- Requirements are clear with no conflicts, reuse, historical, or alternative decisions pending
|
|
145
|
+
|
|
146
|
+
User must explicitly agree before any steps are skipped.
|
|
147
|
+
|
|
148
|
+
## Failure Branch Rules
|
|
149
|
+
|
|
150
|
+
When the inspector returns `route_failure_branch`:
|
|
151
|
+
|
|
152
|
+
1. Do not continue to the normal `next_step`.
|
|
153
|
+
2. Load the returned `failure_branch.workflow_config`.
|
|
154
|
+
3. Start the branch at `failure_branch.entry_step`.
|
|
155
|
+
4. Preserve the original feature and phase.
|
|
156
|
+
5. After the remediation verification step passes, return using `failure_branch.resume_after_success`.
|
|
157
|
+
|
|
158
|
+
## Parallel Window Rules
|
|
159
|
+
|
|
160
|
+
When the inspector returns `run_parallel_window`:
|
|
161
|
+
|
|
162
|
+
0. **Track filtering**(新增):读取 STATE.md 的 `active_track` 字段
|
|
163
|
+
- 如果 `active_track == "A"`:只路由完整需求主链及 Track A 步骤(requirement-triage、requirement-wayfinder、domain-modeling、requirement-feasibility-review、requirement-baseline、api-contract、backend-tech-spec、api-call-guide),完成后阻断在轨道边界
|
|
164
|
+
- 如果 `active_track == "B"`:新需求必须完成完整需求主链;前端设计步骤仍依赖 api-contract。允许步骤为 requirement-triage、requirement-wayfinder、domain-modeling、requirement-feasibility-review、requirement-baseline、api-contract、ui-spec、feature-breakdown、frontend-tech-spec、api-supplement,完成后阻断在轨道边界
|
|
165
|
+
- 如果未设置或无效:保留全部 branch_steps(双轨道)
|
|
166
|
+
- 过滤后如果只剩一个步骤,退化为串行执行(不启动并行窗口)
|
|
167
|
+
|
|
168
|
+
1. Confirm every returned branch step has its dependencies satisfied.
|
|
169
|
+
2. If the environment supports safe parallel work, dispatch the branch steps independently.
|
|
170
|
+
3. If not, execute `serial_fallback_order`.
|
|
171
|
+
4. Do not run the join step until every branch output exists and is registered as successful.
|
|
172
|
+
|
|
173
|
+
## State Writeback Rules
|
|
174
|
+
|
|
175
|
+
Use `devflow_transition` for deterministic state updates. Direct file edits and direct calls to writer scripts are blocked by the OMP extension.
|
|
176
|
+
|
|
177
|
+
Common operations:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
devflow_transition(action="complete-step", step="<step-id>", expectedRevision=<revision>)
|
|
181
|
+
devflow_transition(action="confirm-checkpoint", expectedRevision=<revision>)
|
|
182
|
+
devflow_transition(action="checkpoint-decision", decision="needs_fix", expectedRevision=<revision>)
|
|
183
|
+
devflow_transition(action="enter-failure-branch", expectedRevision=<revision>)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Always obtain `<revision>` from a fresh `devflow_state(action="inspect")`. A stale
|
|
187
|
+
revision is rejected without changing state, registry, or next-intent files.
|
|
188
|
+
|
|
189
|
+
Checkpoint confirmation also writes the configured `.planning/.next-intent`.
|
|
190
|
+
|
|
191
|
+
When `devflow_transition` succeeds, it automatically regenerates the Markdown body of STATE.md from the YAML state + artifact registry. The body is marked `<!-- GENERATED — DO NOT EDIT -->` and must not be manually edited.
|
|
192
|
+
|
|
193
|
+
## Lessons Rules
|
|
194
|
+
|
|
195
|
+
Lessons injection is **mandatory** before every step execution (see Step Execution Protocol, step 1).
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
devflow_skill_script(script="orchestrator-manage-lessons", args=["--select", "--next-step", "<step-id>", "--json"])
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
If the returned candidates list is non-empty, load the lesson files and prepend their content as context before loading the skill's SKILL.md.
|
|
202
|
+
|
|
203
|
+
Create a lesson template only from concrete evidence:
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
devflow_skill_script(script="orchestrator-manage-lessons", args=["--write-template", "--title", "<title>", "--source", "<artifact>", "--json", "--write"])
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Call the write form only when the template should be created. Do not invent root cause, fix, or prevention content without evidence from the source artifact.
|
|
210
|
+
|
|
211
|
+
## Meta Output Protocol
|
|
212
|
+
|
|
213
|
+
Steps with `meta_output` in the workflow YAML must produce a `.meta.json` file alongside their main output. The orchestrator verifies these:
|
|
214
|
+
|
|
215
|
+
1. After step execution, check if the YAML step has `meta_output`.
|
|
216
|
+
2. If yes, verify the `.meta.json` file at `meta_output.path` exists.
|
|
217
|
+
3. Verify all `required: true` fields are present and non-null.
|
|
218
|
+
4. If missing or incomplete, mark step as blocked and do not advance.
|
|
219
|
+
|
|
220
|
+
The `.meta.json` data feeds CP prompts — e.g., CP-1 reads `baseline.meta.json` to show `fp_count: 7` instead of having the AI count manually.
|
|
221
|
+
|
|
222
|
+
## Initialization Rules
|
|
223
|
+
|
|
224
|
+
This skill must be portable. Do not require manually-created `.planning` control files.
|
|
225
|
+
|
|
226
|
+
If `.planning/STATE.md` is missing and project context files are also missing, route to `workflow-project-context` instead of asking for `init_state.rb`. If `.planning/STATE.md` is missing but project context files already exist, keep the existing `init_state.rb` recovery path.
|
|
227
|
+
|
|
228
|
+
If `.planning/STATE.md` contains blockers with `type: PENDING_TEMPLATE`, stop normal dispatch and report the missing depth spec template. The blocker must name the codebase, topic, matched path, missing template path, and impact.
|
|
229
|
+
|
|
230
|
+
Use these generators:
|
|
231
|
+
|
|
232
|
+
| Script | Generates |
|
|
233
|
+
|--------|-----------|
|
|
234
|
+
| `init_workflow.rb` | `.planning/workflows/*.yaml` and workflow README from bundled templates. |
|
|
235
|
+
| `init_state.rb` | `.planning/STATE.md` YAML front matter. |
|
|
236
|
+
| `sync_artifacts.rb` | `.planning/artifacts/index.yaml` from active workflow outputs. |
|
|
237
|
+
|
|
238
|
+
The generated files may be project-specific instances, but their creation path must remain inside this skill.
|
|
239
|
+
|
|
240
|
+
## Boundaries
|
|
241
|
+
|
|
242
|
+
- Do not modify existing `workflow-*` skill behavior.
|
|
243
|
+
- Auto-execute only the parallel window returned by the inspector while the runtime loop is active. Use task agents when isolation is safe; otherwise use `serial_fallback_order`.
|
|
244
|
+
- Do not infer a missing workflow. If `.planning/STATE.md` has no machine-readable front matter, ask to initialize workflow state.
|
|
245
|
+
- Do not skip CP-1, CP-3, or CP-4. CP-2 can only be skipped if the active workflow config explicitly allows it.
|
|
246
|
+
- Do not treat `.planning/pipeline-state.md` as the primary state source when YAML front matter exists in `.planning/STATE.md`.
|
|
247
|
+
- Do not advance a step if its `meta_output` `.meta.json` is missing or incomplete.
|
|
248
|
+
|
|
249
|
+
## Files
|
|
250
|
+
|
|
251
|
+
| File | Purpose |
|
|
252
|
+
|------|---------|
|
|
253
|
+
| `.planning/STATE.md` | Primary runtime state, YAML front matter + auto-generated Markdown body. |
|
|
254
|
+
| `.planning/workflows/<current_flow>.yaml` | Active workflow config: step topology, CP definitions, meta_output contracts. |
|
|
255
|
+
| `failure_branch.workflow_config` | Optional remediation workflow returned by the inspector. |
|
|
256
|
+
| active workflow `artifact_registry.source` | Artifact status registry with content validation. |
|
|
257
|
+
| `scripts/inspect_state.rb` | Deterministic state and next-action inspector. |
|
|
258
|
+
| `scripts/init_workflow.rb` | Creates required workflow YAML files from bundled templates. |
|
|
259
|
+
| `scripts/init_state.rb` | Creates or repairs `.planning/STATE.md` front matter. |
|
|
260
|
+
| `scripts/sync_artifacts.rb` | Generates artifact registry with content validation. |
|
|
261
|
+
| `scripts/validate_state.rb` | Verifies STATE.md, workflow steps, dependencies, outputs, meta outputs, and artifact statuses agree before dispatch or writeback. |
|
|
262
|
+
| `scripts/advance_state.rb` | State writeback + Markdown body auto-generation. |
|
|
263
|
+
| `scripts/update_triage_route.rb` | Deterministically updates `.planning/requirements/{feature}/入口分诊.meta.json` route/status after clarify or wayfinder. |
|
|
264
|
+
| `scripts/manage_lessons.rb` | Lesson candidate selector and evidence-based template writer. |
|
|
265
|
+
| `templates/` | Portable workflow templates used by `init_workflow.rb`. |
|