@khoavu882/doflow 0.0.0-stage → 2.0.0-beta.3
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/LICENSE +21 -0
- package/README.md +132 -2
- package/bin/doflow.js +44 -0
- package/core/.antigravity-plugin/hooks.json +39 -0
- package/core/.antigravity-plugin/mcp_config.json +18 -0
- package/core/.antigravity-plugin/plugin.json +31 -0
- package/core/.claude-plugin/marketplace.json +20 -0
- package/core/.claude-plugin/plugin.json +21 -0
- package/core/.codex-plugin/marketplace.json +20 -0
- package/core/.codex-plugin/plugin.json +35 -0
- package/core/.plugin/plugin.json +19 -0
- package/core/harnesses/antigravity/hooks/pre-implementation-gate.sh +9 -0
- package/core/harnesses/antigravity/hooks/stop-check.sh +10 -0
- package/core/harnesses/claude/hooks/lib.sh +304 -0
- package/core/harnesses/claude/hooks/mcp-tool-guard.sh +20 -0
- package/core/harnesses/claude/hooks/permission-audit.sh +47 -0
- package/core/harnesses/claude/hooks/post-compact.sh +74 -0
- package/core/harnesses/claude/hooks/post-edit-lint.sh +36 -0
- package/core/harnesses/claude/hooks/post-tool-failure.sh +47 -0
- package/core/harnesses/claude/hooks/pre-bash-guard.sh +20 -0
- package/core/harnesses/claude/hooks/pre-compact.sh +43 -0
- package/core/harnesses/claude/hooks/pre-implement-gate.sh +21 -0
- package/core/harnesses/claude/hooks/session-end.sh +89 -0
- package/core/harnesses/claude/hooks/session-start.sh +5 -0
- package/core/harnesses/claude/hooks/skill-config-audit.sh +39 -0
- package/core/harnesses/claude/hooks/stop-check.sh +5 -0
- package/core/harnesses/claude/hooks/subagent-audit.sh +7 -0
- package/core/harnesses/claude/hooks/user-prompt-submit.sh +5 -0
- package/core/harnesses/claude/settings/keybindings.json +20 -0
- package/core/harnesses/claude/settings/settings.json +201 -0
- package/core/harnesses/claude/statusline/doflow-statusline.sh +49 -0
- package/core/harnesses/codex/agents/core-implementer.toml +7 -0
- package/core/harnesses/codex/agents/quality-guardian.toml +8 -0
- package/core/harnesses/codex/agents/research-writer.toml +8 -0
- package/core/harnesses/codex/agents/spec-analyst.toml +8 -0
- package/core/harnesses/codex/agents/system-architect.toml +9 -0
- package/core/harnesses/codex/config/config.toml +10 -0
- package/core/harnesses/codex/hooks/hooks.json +122 -0
- package/core/harnesses/codex/hooks/lib.sh +335 -0
- package/core/harnesses/codex/hooks/mcp-tool-guard.sh +18 -0
- package/core/harnesses/codex/hooks/post-edit-lint.impl.sh +52 -0
- package/core/harnesses/codex/hooks/post-edit-lint.sh +6 -0
- package/core/harnesses/codex/hooks/pre-bash-guard.sh +18 -0
- package/core/harnesses/codex/hooks/pre-compact.impl.sh +46 -0
- package/core/harnesses/codex/hooks/pre-compact.sh +9 -0
- package/core/harnesses/codex/hooks/pre-implement-gate.sh +19 -0
- package/core/harnesses/codex/hooks/session-end.impl.sh +92 -0
- package/core/harnesses/codex/hooks/session-end.sh +5 -0
- package/core/harnesses/codex/hooks/session-start.sh +5 -0
- package/core/harnesses/codex/hooks/stop-check.sh +8 -0
- package/core/harnesses/codex/hooks/subagent-audit.sh +8 -0
- package/core/harnesses/codex/hooks/user-prompt-submit.sh +6 -0
- package/core/harnesses/gemini/hooks/hooks.json +77 -0
- package/core/harnesses/gemini/hooks/lib.sh +302 -0
- package/core/harnesses/gemini/hooks/mcp-tool-guard.sh +21 -0
- package/core/harnesses/gemini/hooks/post-edit-lint.sh +39 -0
- package/core/harnesses/gemini/hooks/pre-bash-guard.sh +21 -0
- package/core/harnesses/gemini/hooks/pre-compact.sh +38 -0
- package/core/harnesses/gemini/hooks/pre-implement-gate.sh +22 -0
- package/core/harnesses/gemini/hooks/session-end.impl.sh +89 -0
- package/core/harnesses/gemini/hooks/session-end.sh +5 -0
- package/core/harnesses/gemini/hooks/session-start.sh +5 -0
- package/core/harnesses/gemini/settings/adapter-defaults.json +4 -0
- package/core/harnesses/kiro/agents/doflow.json +58 -0
- package/core/harnesses/kiro/hooks/doflow.json +53 -0
- package/core/harnesses/kiro/hooks/lib.sh +324 -0
- package/core/harnesses/kiro/hooks/mcp-tool-guard.sh +9 -0
- package/core/harnesses/kiro/hooks/pre-bash-guard.sh +9 -0
- package/core/harnesses/kiro/hooks/pre-implement-gate.sh +9 -0
- package/core/harnesses/kiro/hooks/session-start.sh +9 -0
- package/core/harnesses/kiro/hooks/stop-check.sh +43 -0
- package/core/harnesses/shared/hooks/ENVELOPE_MIGRATION.md +39 -0
- package/core/harnesses/shared/hooks/adapters/antigravity.js +111 -0
- package/core/harnesses/shared/hooks/adapters/arg-fields.js +19 -0
- package/core/harnesses/shared/hooks/adapters/gemini.js +114 -0
- package/core/harnesses/shared/hooks/hooks.json +47 -0
- package/core/harnesses/shared/hooks/policies/blocked-patterns.conf +91 -0
- package/core/harnesses/shared/hooks/policies/capture-failure.sh +97 -0
- package/core/harnesses/shared/hooks/policies/deny-json.sh +29 -0
- package/core/harnesses/shared/hooks/policies/lib.sh +501 -0
- package/core/harnesses/shared/hooks/policies/mcp-policy.conf +21 -0
- package/core/harnesses/shared/hooks/policies/mcp-tool-guard.sh +91 -0
- package/core/harnesses/shared/hooks/policies/pre-bash-guard.sh +328 -0
- package/core/harnesses/shared/hooks/policies/pre-implementation-gate.sh +496 -0
- package/core/harnesses/shared/hooks/policies/prompt-nudge.jq +131 -0
- package/core/harnesses/shared/hooks/policies/session-context.sh +141 -0
- package/core/harnesses/shared/hooks/policies/stop-check.sh +264 -0
- package/core/harnesses/shared/hooks/policies/subagent-audit.sh +46 -0
- package/core/harnesses/shared/hooks/policies/user-prompt-submit.sh +235 -0
- package/core/harnesses/shared/hooks/stream-hook-runner.js +590 -0
- package/core/harnesses/shared/locator/doflow-run +87 -0
- package/core/registry/advice.json +101 -0
- package/core/registry/assets.json +792 -0
- package/core/registry/capabilities.json +120 -0
- package/core/registry/contracts.json +189 -0
- package/core/registry/external-tools.json +191 -0
- package/core/registry/harnesses.json +2062 -0
- package/core/registry/lifecycle.json +231 -0
- package/core/registry/mcp.json +18 -0
- package/core/registry/models.json +79 -0
- package/core/registry/readiness-templates.json +118 -0
- package/core/registry/routes.json +47 -0
- package/core/registry/storage.json +1057 -0
- package/core/registry/verification.json +258 -0
- package/core/registry/workflows.json +790 -0
- package/core/shared/agent-specs/core-implementer.md +73 -0
- package/core/shared/agent-specs/quality-guardian.md +28 -0
- package/core/shared/agent-specs/research-writer.md +31 -0
- package/core/shared/agent-specs/spec-analyst.md +33 -0
- package/core/shared/agent-specs/system-architect.md +29 -0
- package/core/shared/guidance/DOFLOW_CORE.md +8 -0
- package/core/shared/guidance/FLAGS.md +25 -0
- package/core/shared/guidance/PRINCIPLES.md +61 -0
- package/core/shared/guidance/VERSION +1 -0
- package/core/shared/guidance/mcp/MCP_Context7.md +18 -0
- package/core/shared/guidance/mcp/MCP_Sequential.md +17 -0
- package/core/shared/guidance/modes/MODE_Brainstorming.md +46 -0
- package/core/shared/guidance/modes/MODE_DeepResearch.md +69 -0
- package/core/shared/guidance/modes/MODE_Introspection.md +33 -0
- package/core/shared/guidance/modes/MODE_Orchestration.md +57 -0
- package/core/shared/guidance/modes/MODE_Task_Management.md +74 -0
- package/core/shared/guidance/pointers/claude-gemini.md +2 -0
- package/core/shared/guidance/pointers/codex.md +6 -0
- package/core/shared/guidance/references/ARTIFACT_FORMAT.md +373 -0
- package/core/shared/guidance/references/ARTIFACT_VOICE.md +104 -0
- package/core/shared/guidance/references/CONSTITUTION_BASE.md +47 -0
- package/core/shared/guidance/references/DIAGRAM_GUIDE.md +161 -0
- package/core/shared/guidance/references/DOFLOW_CHAIN.md +87 -0
- package/core/shared/guidance/references/EVIDENCE_LEDGER.md +93 -0
- package/core/shared/guidance/references/MODEL_SELECTION.md +74 -0
- package/core/shared/guidance/references/ORCHESTRATION.md +36 -0
- package/core/shared/guidance/references/RESEARCH_CONFIG.md +21 -0
- package/core/shared/guidance/references/WORKFLOW_HANDOFF.md +81 -0
- package/core/shared/guidance/rules/RULE_01_SAFETY.md +25 -0
- package/core/shared/guidance/rules/RULE_02_WORKFLOW.md +23 -0
- package/core/shared/guidance/rules/RULE_03_QUALITY.md +14 -0
- package/core/shared/guidance/rules/RULE_04_QUESTIONS.md +46 -0
- package/core/shared/scripts/doflow/assets/mermaid-theme.json +46 -0
- package/core/shared/scripts/doflow/bash/do-exec-paths.sh +167 -0
- package/core/shared/scripts/doflow/bash/do-git-state.sh +546 -0
- package/core/shared/scripts/doflow/bash/do-parallel-check.sh +208 -0
- package/core/shared/scripts/doflow/bash/do-paths.sh +347 -0
- package/core/shared/scripts/doflow/bash/do-prereqs.sh +66 -0
- package/core/shared/scripts/doflow/bash/do-review-package.sh +127 -0
- package/core/shared/scripts/doflow/bash/do-task-brief.sh +698 -0
- package/core/shared/scripts/doflow/bash/render-audit.sh +224 -0
- package/core/shared/scripts/doflow/bash/render-diagrams.sh +177 -0
- package/core/shared/scripts/doflow/bash/render-puml.sh +223 -0
- package/core/shared/scripts/doflow/bash/sync-context.sh +66 -0
- package/core/shared/scripts/doflow/bash/validate-artifacts.sh +526 -0
- package/core/shared/scripts/doflow/bin/doflow-run +592 -0
- package/core/shared/skills/do/SKILL.md +128 -0
- package/core/shared/skills/do/references/estimation.md +13 -0
- package/core/shared/skills/do/references/pm_routing.md +25 -0
- package/core/shared/skills/do/references/tool_matrix.md +52 -0
- package/core/shared/skills/do-brainstorm/SKILL.md +252 -0
- package/core/shared/skills/do-code-review/README.md +49 -0
- package/core/shared/skills/do-code-review/SKILL.md +333 -0
- package/core/shared/skills/do-code-review/assets/sample_c_clean.c +71 -0
- package/core/shared/skills/do-code-review/assets/sample_c_smells.c +66 -0
- package/core/shared/skills/do-code-review/assets/sample_cpp_shift.cpp +19 -0
- package/core/shared/skills/do-code-review/assets/sample_csharp_clean.cs +100 -0
- package/core/shared/skills/do-code-review/assets/sample_csharp_smells.cs +78 -0
- package/core/shared/skills/do-code-review/assets/sample_java_clean.java +55 -0
- package/core/shared/skills/do-code-review/assets/sample_java_smells.java +56 -0
- package/core/shared/skills/do-code-review/assets/sample_json_clean.json +7 -0
- package/core/shared/skills/do-code-review/assets/sample_markdown_clean.md +30 -0
- package/core/shared/skills/do-code-review/assets/sample_markdown_smells.md +29 -0
- package/core/shared/skills/do-code-review/assets/sample_shell_heredoc.sh +38 -0
- package/core/shared/skills/do-code-review/assets/sample_shell_smells.sh +15 -0
- package/core/shared/skills/do-code-review/assets/sample_typescript_strings.ts +36 -0
- package/core/shared/skills/do-code-review/assets/sample_yaml_smells.yaml +6 -0
- package/core/shared/skills/do-code-review/content-types/config.md +83 -0
- package/core/shared/skills/do-code-review/content-types/markdown.md +132 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_c_clean_quality.json +79 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_c_smells_quality.json +169 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_cpp_shift_quality.json +49 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_csharp_clean_quality.json +149 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_csharp_smells_quality.json +157 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_java_clean_quality.json +67 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_java_smells_quality.json +97 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_json_clean_quality.json +33 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_markdown_clean_quality.json +1 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_markdown_smells_quality.json +16 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_shell_heredoc_quality.json +54 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_shell_smells_quality.json +91 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_typescript_strings_quality.json +60 -0
- package/core/shared/skills/do-code-review/expected_outputs/sample_yaml_smells_quality.json +46 -0
- package/core/shared/skills/do-code-review/languages/c.md +103 -0
- package/core/shared/skills/do-code-review/languages/cpp.md +103 -0
- package/core/shared/skills/do-code-review/languages/csharp.md +97 -0
- package/core/shared/skills/do-code-review/languages/dart.md +108 -0
- package/core/shared/skills/do-code-review/languages/go.md +92 -0
- package/core/shared/skills/do-code-review/languages/java.md +103 -0
- package/core/shared/skills/do-code-review/languages/kotlin.md +88 -0
- package/core/shared/skills/do-code-review/languages/php.md +109 -0
- package/core/shared/skills/do-code-review/languages/python.md +94 -0
- package/core/shared/skills/do-code-review/languages/ruby.md +105 -0
- package/core/shared/skills/do-code-review/languages/rust.md +99 -0
- package/core/shared/skills/do-code-review/languages/shell.md +90 -0
- package/core/shared/skills/do-code-review/languages/swift.md +88 -0
- package/core/shared/skills/do-code-review/languages/typescript.md +97 -0
- package/core/shared/skills/do-code-review/review-policy.json +47 -0
- package/core/shared/skills/do-code-review/rules/universal.md +49 -0
- package/core/shared/skills/do-code-review/scripts/code_quality_checker.py +1696 -0
- package/core/shared/skills/do-code-review/scripts/doc_quality_checker.py +532 -0
- package/core/shared/skills/do-code-review/scripts/pr_analyzer.py +620 -0
- package/core/shared/skills/do-code-review/scripts/review_report_generator.py +505 -0
- package/core/shared/skills/do-constitution/SKILL.md +72 -0
- package/core/shared/skills/do-design/SKILL.md +212 -0
- package/core/shared/skills/do-diagnose/SKILL.md +156 -0
- package/core/shared/skills/do-diagnose/references/code_audit.md +15 -0
- package/core/shared/skills/do-diagnose/references/refactoring.md +12 -0
- package/core/shared/skills/do-diagnose/references/root_cause.md +17 -0
- package/core/shared/skills/do-document/SKILL.md +81 -0
- package/core/shared/skills/do-document/references/api-reference.md +42 -0
- package/core/shared/skills/do-document/references/deep_research.md +18 -0
- package/core/shared/skills/do-document/references/embedded-research.md +11 -0
- package/core/shared/skills/do-document/references/implementation-flow.md +105 -0
- package/core/shared/skills/do-document/references/index_generator.md +9 -0
- package/core/shared/skills/do-document/references/user-guide.md +22 -0
- package/core/shared/skills/do-execute-plan/SKILL.md +261 -0
- package/core/shared/skills/do-execute-plan/references/handoff_record.md +57 -0
- package/core/shared/skills/do-execute-plan/references/parallel_dispatch.md +92 -0
- package/core/shared/skills/do-execute-plan/references/readiness_gate.md +155 -0
- package/core/shared/skills/do-execute-plan/references/run_position.md +63 -0
- package/core/shared/skills/do-execute-plan/references/scaffold.md +441 -0
- package/core/shared/skills/do-execute-plan/references/task_attempts.md +41 -0
- package/core/shared/skills/do-flow/SKILL.md +186 -0
- package/core/shared/skills/do-flow/references/task_classes.md +134 -0
- package/core/shared/skills/do-git/SKILL.md +115 -0
- package/core/shared/skills/do-git/references/hotfix-ritual.md +44 -0
- package/core/shared/skills/do-git/references/lifecycle-policy.md +54 -0
- package/core/shared/skills/do-git/references/release-ritual.md +64 -0
- package/core/shared/skills/do-implement/SKILL.md +222 -0
- package/core/shared/skills/do-plan/SKILL.md +219 -0
- package/core/shared/skills/do-test/SKILL.md +113 -0
- package/core/shared/templates/doflow/constitution-template.md +28 -0
- package/core/shared/templates/doflow/data-model-template.md +169 -0
- package/core/shared/templates/doflow/design-template.md +193 -0
- package/core/shared/templates/doflow/external-contract-template.md +35 -0
- package/core/shared/templates/doflow/intent-template.md +45 -0
- package/core/shared/templates/doflow/plan-template.md +151 -0
- package/core/shared/templates/doflow/question-log-template.md +51 -0
- package/core/shared/templates/doflow/requirement-template.md +126 -0
- package/core/shared/templates/doflow/specs-template.md +55 -0
- package/core/shared/templates/doflow/state-template.md +59 -0
- package/core/shared/workflows/do-flow-chain.md +17 -0
- package/package.json +46 -4
- package/src/adapters/antigravity/index.ts +631 -0
- package/src/adapters/claude/index.ts +548 -0
- package/src/adapters/claude/mcp.ts +94 -0
- package/src/adapters/codex/agents.ts +208 -0
- package/src/adapters/codex/config.ts +272 -0
- package/src/adapters/codex/hooks.ts +203 -0
- package/src/adapters/codex/index.ts +707 -0
- package/src/adapters/codex/mcp.ts +271 -0
- package/src/adapters/codex/native-projection.ts +34 -0
- package/src/adapters/copilot/index.ts +413 -0
- package/src/adapters/copy-tree.ts +620 -0
- package/src/adapters/gemini/hooks.ts +210 -0
- package/src/adapters/gemini/index.ts +390 -0
- package/src/adapters/hook-commands.ts +60 -0
- package/src/adapters/index.ts +106 -0
- package/src/adapters/kiro/index.ts +310 -0
- package/src/adapters/mcp-entries.ts +331 -0
- package/src/adapters/opencode/index.ts +466 -0
- package/src/adapters/pi/index.ts +279 -0
- package/src/adapters/pi/json-members.ts +185 -0
- package/src/adapters/pi/mcp.ts +373 -0
- package/src/adapters/resolve-source.ts +19 -0
- package/src/cli/commands/install.ts +218 -0
- package/src/cli/commands/list-backups.ts +21 -0
- package/src/cli/commands/reconcile.ts +120 -0
- package/src/cli/commands/remove.ts +82 -0
- package/src/cli/commands/rollback.ts +172 -0
- package/src/cli/commands/self-update.ts +33 -0
- package/src/cli/commands/status.ts +138 -0
- package/src/cli/commands/tools.ts +92 -0
- package/src/cli/commands/update.ts +162 -0
- package/src/cli/index.ts +568 -0
- package/src/cli/runtime-commands.ts +281 -0
- package/src/cli/shared.ts +218 -0
- package/src/helper/bash-helper.ts +34 -0
- package/src/helper/git.ts +24 -0
- package/src/helper/guardrails.ts +49 -0
- package/src/helper/harness-paths.ts +140 -0
- package/src/helper/marker-merge.ts +116 -0
- package/src/helper/prompt.ts +61 -0
- package/src/helper/repo-root.ts +29 -0
- package/src/helper/settings-merge.ts +151 -0
- package/src/helper/settings-scope.ts +33 -0
- package/src/helper/toml.ts +244 -0
- package/src/install/backup-set.ts +149 -0
- package/src/install/backup.ts +724 -0
- package/src/install/context.ts +58 -0
- package/src/install/manifest.ts +145 -0
- package/src/install/mcp.ts +254 -0
- package/src/install/paths.ts +84 -0
- package/src/install/targets.ts +90 -0
- package/src/install/tool-lifecycle.ts +151 -0
- package/src/lifecycle/bash-availability.ts +25 -0
- package/src/lifecycle/index.ts +812 -0
- package/src/lifecycle/mcp-index.ts +28 -0
- package/src/lifecycle/policies.ts +73 -0
- package/src/lifecycle/view.ts +175 -0
- package/src/registry/index.ts +611 -0
- package/src/release/sync-plugin-versions.ts +66 -0
- package/src/runtime/advice/cli.ts +283 -0
- package/src/runtime/advice/client.ts +324 -0
- package/src/runtime/advice/config.ts +189 -0
- package/src/runtime/advice/doctor.ts +169 -0
- package/src/runtime/advice/endpoint-guard.ts +134 -0
- package/src/runtime/advice/kinds.ts +154 -0
- package/src/runtime/advice/providers/ollama-systemone.ts +209 -0
- package/src/runtime/advice/record.ts +166 -0
- package/src/runtime/advice/registry.ts +170 -0
- package/src/runtime/advice/strength.ts +66 -0
- package/src/runtime/brief-tools.ts +342 -0
- package/src/runtime/c4-project.ts +371 -0
- package/src/runtime/capability-router.ts +484 -0
- package/src/runtime/checkouts.ts +170 -0
- package/src/runtime/claims.ts +468 -0
- package/src/runtime/cli-result.ts +55 -0
- package/src/runtime/cli.ts +678 -0
- package/src/runtime/command-detect.ts +516 -0
- package/src/runtime/context-pack.ts +492 -0
- package/src/runtime/decision-register.ts +493 -0
- package/src/runtime/evidence-ledger.ts +338 -0
- package/src/runtime/failure/capture.ts +272 -0
- package/src/runtime/failure/classifier.ts +68 -0
- package/src/runtime/failure/cli.ts +178 -0
- package/src/runtime/failure/home.ts +64 -0
- package/src/runtime/failure/store.ts +226 -0
- package/src/runtime/feature-resolve.ts +79 -0
- package/src/runtime/freshness.ts +177 -0
- package/src/runtime/health.ts +863 -0
- package/src/runtime/history-compactor.ts +237 -0
- package/src/runtime/implementation-gate.ts +321 -0
- package/src/runtime/inventory/coverage.ts +218 -0
- package/src/runtime/inventory/identity.ts +65 -0
- package/src/runtime/inventory/index.ts +705 -0
- package/src/runtime/inventory/precedence.ts +134 -0
- package/src/runtime/inventory/read-scopes.ts +131 -0
- package/src/runtime/inventory/siblings.ts +192 -0
- package/src/runtime/knowledge/chunker.ts +124 -0
- package/src/runtime/knowledge/hybrid.ts +149 -0
- package/src/runtime/knowledge/index-store.ts +145 -0
- package/src/runtime/knowledge/retrieval.ts +194 -0
- package/src/runtime/leak-scan.ts +185 -0
- package/src/runtime/lifecycle/cli.ts +276 -0
- package/src/runtime/lifecycle/event-store.ts +340 -0
- package/src/runtime/lifecycle/fold.ts +353 -0
- package/src/runtime/lifecycle/followup.ts +432 -0
- package/src/runtime/lifecycle/goal.ts +249 -0
- package/src/runtime/lifecycle/intent-writer.ts +86 -0
- package/src/runtime/lifecycle/overview.ts +292 -0
- package/src/runtime/lifecycle/release.ts +241 -0
- package/src/runtime/lifecycle/report-store.ts +221 -0
- package/src/runtime/lifecycle/retention.ts +212 -0
- package/src/runtime/lifecycle/root.ts +71 -0
- package/src/runtime/lifecycle/status.ts +353 -0
- package/src/runtime/lifecycle/store-upkeep.ts +393 -0
- package/src/runtime/locator-resolve.ts +158 -0
- package/src/runtime/mask.ts +210 -0
- package/src/runtime/mcp-consultations.ts +412 -0
- package/src/runtime/mcp-reach.ts +157 -0
- package/src/runtime/model-router.ts +153 -0
- package/src/runtime/outcome.ts +467 -0
- package/src/runtime/reach.ts +148 -0
- package/src/runtime/readiness-record.ts +150 -0
- package/src/runtime/readiness.ts +435 -0
- package/src/runtime/recovery.ts +282 -0
- package/src/runtime/research-request.ts +231 -0
- package/src/runtime/retrieval-plan.ts +578 -0
- package/src/runtime/scaffold/artifacts.ts +217 -0
- package/src/runtime/scaffold/fingerprint.ts +56 -0
- package/src/runtime/scaffold/generate.ts +911 -0
- package/src/runtime/scaffold/languages.ts +245 -0
- package/src/runtime/storage/cli.ts +64 -0
- package/src/runtime/storage/engine.ts +249 -0
- package/src/runtime/storage/registry.ts +130 -0
- package/src/runtime/storage/roots.ts +63 -0
- package/src/runtime/storage/rules.ts +282 -0
- package/src/runtime/storage/upkeep.ts +243 -0
- package/src/runtime/storage/work-status.ts +326 -0
- package/src/runtime/task-attempts.ts +415 -0
- package/src/runtime/task-classifier.ts +550 -0
- package/src/runtime/task-scope.ts +130 -0
- package/src/runtime/task-state.ts +176 -0
- package/src/runtime/trace/indicators.ts +235 -0
- package/src/runtime/trace/ledger.ts +626 -0
- package/src/runtime/trace/render.ts +76 -0
- package/src/runtime/trace/views.ts +459 -0
- package/src/runtime/verification/contract-runner.ts +341 -0
- package/src/runtime/verification/engine.ts +1461 -0
- package/src/runtime/verification/registry.ts +130 -0
- package/src/runtime/verification/scope-bound.ts +418 -0
- package/src/runtime/verification/test-selection.ts +172 -0
- package/src/runtime/workflow-engine.ts +588 -0
- package/src/runtime/workflow-orchestrator.ts +953 -0
- package/src/runtime/worktree.ts +340 -0
- package/src/state/index.ts +193 -0
- package/src/state/lockfile.ts +136 -0
- package/src/state/run-lock.ts +408 -0
- package/types/node-commonjs.d.ts +68 -0
- package/types/runtime.d.ts +91 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# session-end.sh — SessionEnd hook
|
|
3
|
+
#
|
|
4
|
+
# Runs when Claude Code closes a session. Responsibilities:
|
|
5
|
+
# 1. Append END marker to sessions.log
|
|
6
|
+
# 2. Write uncommitted-warning.txt if the working tree is dirty
|
|
7
|
+
# 3. Delete the session-scoped state directory (cleanup)
|
|
8
|
+
# 4. Trim sessions.log to last 500 lines (lock-guarded for parallel safety)
|
|
9
|
+
#
|
|
10
|
+
# Multi-session safe: with_file_lock (lib.sh) prevents concurrent sessions from
|
|
11
|
+
# corrupting the log trim. Session directory deletion is per session_id so
|
|
12
|
+
# sessions don't interfere.
|
|
13
|
+
# Must never exit non-zero or block (SessionEnd is fire-and-forget).
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
# shellcheck source=lib.sh
|
|
17
|
+
source "$(dirname "$0")/lib.sh"
|
|
18
|
+
require_jq
|
|
19
|
+
|
|
20
|
+
INPUT=$(cat)
|
|
21
|
+
SESSION_ID=$(json_field "$INPUT" ".session_id")
|
|
22
|
+
CWD=$(json_field "$INPUT" ".cwd")
|
|
23
|
+
|
|
24
|
+
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
25
|
+
|
|
26
|
+
# ── 1. Log session end ────────────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
mkdir -p "$(dirname "$SESSIONS_LOG")"
|
|
29
|
+
echo "$TIMESTAMP END ${SESSION_ID:-unknown} ${CWD:-unknown}" >> "$SESSIONS_LOG"
|
|
30
|
+
|
|
31
|
+
# ── 2. Uncommitted-changes warning ────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
# A worker session never writes the project's warning; it is left for the main session.
|
|
34
|
+
if [[ "$(doflow_session_role || echo main)" != "worker" ]] && [[ -n "$CWD" ]] && is_git_worktree "$CWD"; then
|
|
35
|
+
if has_uncommitted_changes "$CWD"; then
|
|
36
|
+
BRANCH=$(git_branch_of "$CWD" || echo "unknown")
|
|
37
|
+
PROJECT_DIR=$(ensure_project_dir "$CWD")
|
|
38
|
+
echo "Session ${SESSION_ID:-unknown} ended with uncommitted changes on branch ${BRANCH}" \
|
|
39
|
+
> "$PROJECT_DIR/uncommitted-warning.txt"
|
|
40
|
+
fi
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# ── 2b. Update meta.json last_active ─────────────────────────────────────────
|
|
44
|
+
|
|
45
|
+
if [[ -n "$CWD" ]]; then
|
|
46
|
+
PROJECT_DIR=$(ensure_project_dir "$CWD")
|
|
47
|
+
if [[ -f "$PROJECT_DIR/meta.json" ]]; then
|
|
48
|
+
META_TMP=$(mktemp "$PROJECT_DIR/.meta.XXXXXX")
|
|
49
|
+
jq --arg ts "$TIMESTAMP" '.last_active = $ts' "$PROJECT_DIR/meta.json" \
|
|
50
|
+
> "$META_TMP" && mv "$META_TMP" "$PROJECT_DIR/meta.json" \
|
|
51
|
+
|| rm -f "$META_TMP" 2>/dev/null || true
|
|
52
|
+
fi
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# ── 3. Delete session directory ───────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
if [[ -n "$SESSION_ID" ]]; then
|
|
58
|
+
SESSION_PATH="$SESSION_DIR/$SESSION_ID"
|
|
59
|
+
rm -rf "$SESSION_PATH" 2>/dev/null || true
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
(
|
|
63
|
+
SHARED_POLICY_LIB="$(dirname "$0")/../../.doflow/shared/hooks/policies/lib.sh"
|
|
64
|
+
if [[ ! -f "$SHARED_POLICY_LIB" ]]; then
|
|
65
|
+
SHARED_POLICY_LIB="$(dirname "$0")/../../shared/hooks/policies/lib.sh"
|
|
66
|
+
fi
|
|
67
|
+
if [[ -f "$SHARED_POLICY_LIB" ]]; then
|
|
68
|
+
source "$SHARED_POLICY_LIB"
|
|
69
|
+
storage_upkeep_async "$CWD"
|
|
70
|
+
fi
|
|
71
|
+
) >/dev/null 2>&1 || true
|
|
72
|
+
|
|
73
|
+
# ── 4. Trim sessions.log (lock-guarded) ───────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
LOCK_FILE="${SESSIONS_LOG}.lock"
|
|
76
|
+
if with_file_lock "$LOCK_FILE" 5; then
|
|
77
|
+
trap 'release_file_lock "$LOCK_FILE"' EXIT
|
|
78
|
+
if [[ -f "$SESSIONS_LOG" ]]; then
|
|
79
|
+
TMP=$(mktemp "${SESSIONS_LOG}.XXXXXX")
|
|
80
|
+
if tail -n 500 "$SESSIONS_LOG" > "$TMP"; then
|
|
81
|
+
mv "$TMP" "$SESSIONS_LOG" || rm -f "$TMP"
|
|
82
|
+
else
|
|
83
|
+
rm -f "$TMP"
|
|
84
|
+
fi
|
|
85
|
+
fi
|
|
86
|
+
release_file_lock "$LOCK_FILE"
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
exit 0
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# skill-config-audit.sh — ConfigChange(skills) hook (pure observability, no deny path)
|
|
3
|
+
#
|
|
4
|
+
# Logs skill-file mutations regardless of which tool made them (a subagent's Bash heredoc-to-file
|
|
5
|
+
# write, an MCP filesystem tool, a plugin) — not just the Edit/Write tools pre-implement-gate.sh
|
|
6
|
+
# already watches for the doflow chain's own narrower purpose. Appends
|
|
7
|
+
# {timestamp, session_id, event} to a session-scoped log, same convention as subagent-audit.sh.
|
|
8
|
+
#
|
|
9
|
+
# Per agent-docs/research/hook-governance-agent-tool-mcp-skill.md §3.4: skill files get
|
|
10
|
+
# legitimately edited during normal development (this project's own doflow-framework tooling
|
|
11
|
+
# among them), so a naive hard-block on skill-file change would fight that — `decision: "block"`
|
|
12
|
+
# is deliberately NOT used here.
|
|
13
|
+
# This ships pure-logging only; a stricter follow-on (only once the log shows what "normal" skill
|
|
14
|
+
# churn looks like in practice) is a separate, later decision.
|
|
15
|
+
#
|
|
16
|
+
# Multi-session safe: writes only to sessions/{session_id}/skill-config-audit.log.
|
|
17
|
+
# Must never exit non-zero or block a config change.
|
|
18
|
+
|
|
19
|
+
set -euo pipefail
|
|
20
|
+
# shellcheck source=lib.sh
|
|
21
|
+
source "$(dirname "$0")/lib.sh"
|
|
22
|
+
require_jq
|
|
23
|
+
|
|
24
|
+
INPUT=$(cat)
|
|
25
|
+
SESSION_ID=$(json_field "$INPUT" ".session_id")
|
|
26
|
+
|
|
27
|
+
# Guard: if we can't determine the session, nothing to do
|
|
28
|
+
[[ -z "$SESSION_ID" ]] && exit 0
|
|
29
|
+
|
|
30
|
+
TIMESTAMP=$(date -u +%FT%TZ)
|
|
31
|
+
SESSION_PATH=$(ensure_session_dir "$SESSION_ID")
|
|
32
|
+
|
|
33
|
+
jq -nc \
|
|
34
|
+
--arg ts "$TIMESTAMP" \
|
|
35
|
+
--arg session "$SESSION_ID" \
|
|
36
|
+
'{timestamp: $ts, session_id: $session, event: "ConfigChange", source: "skills"}' \
|
|
37
|
+
>> "$SESSION_PATH/skill-config-audit.log" 2>/dev/null || true
|
|
38
|
+
|
|
39
|
+
exit 0
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Claude front door: reuse the canonical subagent-audit policy with Claude attribution.
|
|
3
|
+
# No JSON-shape translation needed — claude/codex's copies were byte-identical
|
|
4
|
+
# (022-hooks-remaining-duplication).
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
export DOFLOW_AGENT="${DOFLOW_AGENT:-claude}"
|
|
7
|
+
exec bash "$(dirname "$0")/../../.doflow/shared/hooks/policies/subagent-audit.sh"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://www.schemastore.org/claude-code-keybindings.json",
|
|
3
|
+
"$docs": "https://code.claude.com/docs/en/keybindings",
|
|
4
|
+
"bindings": [
|
|
5
|
+
{
|
|
6
|
+
"context": "Global",
|
|
7
|
+
"bindings": {
|
|
8
|
+
"ctrl+shift+t": "app:toggleTodos",
|
|
9
|
+
"ctrl+shift+o": "app:toggleTranscript"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"context": "Chat",
|
|
14
|
+
"bindings": {
|
|
15
|
+
"ctrl+e": "chat:externalEditor",
|
|
16
|
+
"ctrl+g": null
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"env": {
|
|
4
|
+
"MCP_TIMEOUT": "120000",
|
|
5
|
+
"ENABLE_TOOL_SEARCH": "true",
|
|
6
|
+
"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
|
|
7
|
+
},
|
|
8
|
+
"outputStyle": "Explanatory",
|
|
9
|
+
"enableAllProjectMcpServers": true,
|
|
10
|
+
"plansDirectory": "./agent-docs",
|
|
11
|
+
"permissions": {
|
|
12
|
+
"allow": [
|
|
13
|
+
"Bash(git *:*)",
|
|
14
|
+
"Bash(./gradlew *:*)",
|
|
15
|
+
"Bash(npm *:*)",
|
|
16
|
+
"Bash(python *:*)",
|
|
17
|
+
"Bash(pytest *:*)",
|
|
18
|
+
"Bash(mvn *:*)"
|
|
19
|
+
],
|
|
20
|
+
"deny": [
|
|
21
|
+
"Bash(git push --force*:*)",
|
|
22
|
+
"Bash(git reset --hard*:*)",
|
|
23
|
+
"Bash(git clean -fd*:*)"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"alwaysThinkingEnabled": true,
|
|
27
|
+
"cleanupPeriodDays": 60,
|
|
28
|
+
"autoUpdatesChannel": "stable",
|
|
29
|
+
"availableModels": [
|
|
30
|
+
"opus",
|
|
31
|
+
"sonnet",
|
|
32
|
+
"haiku"
|
|
33
|
+
],
|
|
34
|
+
"model": "sonnet",
|
|
35
|
+
"hooks": {
|
|
36
|
+
"SessionStart": [
|
|
37
|
+
{
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "~/.claude/hooks/session-start.sh"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"UserPromptSubmit": [
|
|
47
|
+
{
|
|
48
|
+
"hooks": [
|
|
49
|
+
{
|
|
50
|
+
"type": "command",
|
|
51
|
+
"command": "~/.claude/hooks/user-prompt-submit.sh"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"SubagentStart": [
|
|
57
|
+
{
|
|
58
|
+
"matcher": ".*",
|
|
59
|
+
"hooks": [
|
|
60
|
+
{
|
|
61
|
+
"type": "command",
|
|
62
|
+
"command": "~/.claude/hooks/subagent-audit.sh"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"SubagentStop": [
|
|
68
|
+
{
|
|
69
|
+
"matcher": ".*",
|
|
70
|
+
"hooks": [
|
|
71
|
+
{
|
|
72
|
+
"type": "command",
|
|
73
|
+
"command": "~/.claude/hooks/subagent-audit.sh"
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"ConfigChange": [
|
|
79
|
+
{
|
|
80
|
+
"matcher": "skills",
|
|
81
|
+
"hooks": [
|
|
82
|
+
{
|
|
83
|
+
"type": "command",
|
|
84
|
+
"command": "~/.claude/hooks/skill-config-audit.sh"
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"PreToolUse": [
|
|
90
|
+
{
|
|
91
|
+
"matcher": "Bash",
|
|
92
|
+
"hooks": [
|
|
93
|
+
{
|
|
94
|
+
"type": "command",
|
|
95
|
+
"command": "~/.claude/hooks/pre-bash-guard.sh"
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"matcher": "mcp__.*",
|
|
101
|
+
"hooks": [
|
|
102
|
+
{
|
|
103
|
+
"type": "command",
|
|
104
|
+
"command": "~/.claude/hooks/mcp-tool-guard.sh"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"matcher": "Edit|Write|MultiEdit",
|
|
110
|
+
"hooks": [
|
|
111
|
+
{
|
|
112
|
+
"type": "command",
|
|
113
|
+
"command": "~/.claude/hooks/pre-implement-gate.sh"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"PostToolUse": [
|
|
119
|
+
{
|
|
120
|
+
"matcher": "Edit",
|
|
121
|
+
"hooks": [
|
|
122
|
+
{
|
|
123
|
+
"type": "command",
|
|
124
|
+
"command": "~/.claude/hooks/post-edit-lint.sh"
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"matcher": "Write",
|
|
130
|
+
"hooks": [
|
|
131
|
+
{
|
|
132
|
+
"type": "command",
|
|
133
|
+
"command": "~/.claude/hooks/post-edit-lint.sh"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"Stop": [
|
|
139
|
+
{
|
|
140
|
+
"hooks": [
|
|
141
|
+
{
|
|
142
|
+
"type": "command",
|
|
143
|
+
"command": "~/.claude/hooks/stop-check.sh"
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"PreCompact": [
|
|
149
|
+
{
|
|
150
|
+
"hooks": [
|
|
151
|
+
{
|
|
152
|
+
"type": "command",
|
|
153
|
+
"command": "~/.claude/hooks/pre-compact.sh"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
"PostCompact": [
|
|
159
|
+
{
|
|
160
|
+
"hooks": [
|
|
161
|
+
{
|
|
162
|
+
"type": "command",
|
|
163
|
+
"command": "~/.claude/hooks/post-compact.sh"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
"SessionEnd": [
|
|
169
|
+
{
|
|
170
|
+
"hooks": [
|
|
171
|
+
{
|
|
172
|
+
"type": "command",
|
|
173
|
+
"command": "~/.claude/hooks/session-end.sh"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"PostToolUseFailure": [
|
|
179
|
+
{
|
|
180
|
+
"matcher": ".*",
|
|
181
|
+
"hooks": [
|
|
182
|
+
{
|
|
183
|
+
"type": "command",
|
|
184
|
+
"command": "~/.claude/hooks/post-tool-failure.sh"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"PermissionDenied": [
|
|
190
|
+
{
|
|
191
|
+
"matcher": ".*",
|
|
192
|
+
"hooks": [
|
|
193
|
+
{
|
|
194
|
+
"type": "command",
|
|
195
|
+
"command": "~/.claude/hooks/permission-audit.sh"
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# doflow-statusline — Claude Code status line fed by DoFlow's neutral state.
|
|
3
|
+
#
|
|
4
|
+
# Claude Code pipes one session-state JSON document to stdin; whatever this script prints becomes
|
|
5
|
+
# the persistent status row. Everything here is best-effort: any failure prints the static prefix
|
|
6
|
+
# and exits 0, because a broken status line must never break the session.
|
|
7
|
+
#
|
|
8
|
+
# Rendered segments (space-separated, dash-joined):
|
|
9
|
+
# branch — current git branch, when stdin carries a git-capable cwd
|
|
10
|
+
# task — active task id from .doflow/state/orchestration/ (project scope)
|
|
11
|
+
# readiness— last recorded readiness verdict for that task
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
input=$(cat)
|
|
16
|
+
|
|
17
|
+
cwd=$(printf '%s' "$input" | jq -r '.cwd // empty' 2>/dev/null || true)
|
|
18
|
+
branch=""
|
|
19
|
+
task=""
|
|
20
|
+
|
|
21
|
+
if [[ -n "$cwd" && -d "$cwd/.git" ]] || git -C "${cwd:-.}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
22
|
+
branch=$(git -C "${cwd:-.}" branch --show-current 2>/dev/null || true)
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
state_root=".doflow/state"
|
|
26
|
+
if [[ -n "$cwd" && -d "$cwd/$state_root" ]]; then
|
|
27
|
+
state_root="$cwd/$state_root"
|
|
28
|
+
elif [[ ! -d "$state_root" ]]; then
|
|
29
|
+
state_root=""
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [[ -n "$state_root" ]]; then
|
|
33
|
+
cursor=$(ls -t "$state_root"/orchestration/*.json 2>/dev/null | head -1 || true)
|
|
34
|
+
if [[ -n "$cursor" ]]; then
|
|
35
|
+
task=$(jq -r '.taskId // empty' "$cursor" 2>/dev/null || true)
|
|
36
|
+
fi
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
segments=()
|
|
40
|
+
[[ -n "$branch" ]] && segments+=("$branch")
|
|
41
|
+
[[ -n "$task" ]] && segments+=("task:$task")
|
|
42
|
+
|
|
43
|
+
if [[ ${#segments[@]} -eq 0 ]]; then
|
|
44
|
+
echo "doflow"
|
|
45
|
+
else
|
|
46
|
+
printf 'doflow '
|
|
47
|
+
printf '%s ' "${segments[@]:-}"
|
|
48
|
+
printf '\n'
|
|
49
|
+
fi
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
name = "core-implementer"
|
|
2
|
+
description = "Specialist code engineer for full-stack implementation, clean refactoring, and performance optimization."
|
|
3
|
+
developer_instructions = """
|
|
4
|
+
Implement features and refactor code strictly according to approved designs and task checklists.
|
|
5
|
+
Optimize algorithms, reduce complexity, and maintain polyglot code quality across the codebase.
|
|
6
|
+
Ensure changes pass all existing tests and conform to language-specific standards.
|
|
7
|
+
"""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
name = "quality-guardian"
|
|
2
|
+
description = "Specialist quality and security engineer for automated testing, security audits, and root cause analysis."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """
|
|
5
|
+
Author and run comprehensive test suites, audit code for security vulnerabilities, and diagnose root causes.
|
|
6
|
+
Verify adherence to SOLID principles, check error handling boundaries, and analyze reproduction traces.
|
|
7
|
+
Stay in audit mode: do not modify business logic code directly without an approved fix plan.
|
|
8
|
+
"""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
name = "research-writer"
|
|
2
|
+
description = "Specialist research and technical writing agent for documentation, architecture indices, and web research."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """
|
|
5
|
+
Conduct deep web research with cited sources and write comprehensive technical documentation.
|
|
6
|
+
Create project architecture indices and implementation flow summaries capturing architectural trade-offs.
|
|
7
|
+
Stay in documentation mode: do not modify workspace source code.
|
|
8
|
+
"""
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
name = "spec-analyst"
|
|
2
|
+
description = "Specialist agent for requirements discovery, user story breakdown, and estimation."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """
|
|
5
|
+
Elicit requirements through Socratic dialogue focusing on user value and business goals.
|
|
6
|
+
Decompose initiatives into user stories with testable acceptance criteria and estimate effort.
|
|
7
|
+
Stay in planning mode: do not implement code or modify workspace files.
|
|
8
|
+
"""
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
name = "system-architect"
|
|
2
|
+
description = "Specialist architect agent for system design, API contracts, and infrastructure."
|
|
3
|
+
sandbox_mode = "read-only"
|
|
4
|
+
developer_instructions = """
|
|
5
|
+
Design scalable systems with explicit component boundaries, interfaces, dependencies, and trade-offs.
|
|
6
|
+
Evaluate architecture decisions for maintainability, resilience, operational impact, and future change.
|
|
7
|
+
Document clear recommendations with alternatives and validation criteria.
|
|
8
|
+
Stay in planning mode: do not implement code or modify workspace files.
|
|
9
|
+
"""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# DoFlow Codex configuration source.
|
|
2
|
+
#
|
|
3
|
+
# This deliberately contains only the lifecycle-hook feature flag. The installer
|
|
4
|
+
# owns just this key and must preserve every unrelated Codex setting, provider,
|
|
5
|
+
# MCP server, and custom-agent declaration when it reconciles this file.
|
|
6
|
+
# Hooks themselves live exclusively in hooks.json beside this config; do not add
|
|
7
|
+
# inline [hooks] tables here because Codex would load both representations.
|
|
8
|
+
|
|
9
|
+
[features]
|
|
10
|
+
hooks = true
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "DoFlow lifecycle hooks for Codex. Review and trust these hooks in Codex before use.",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/session-start.sh\" ] && printf '%s/.codex/hooks/session-start.sh' \"$root\" || printf '%s/hooks/session-start.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
10
|
+
"statusMessage": "Preparing DoFlow session context"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"UserPromptSubmit": [
|
|
16
|
+
{
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/user-prompt-submit.sh\" ] && printf '%s/.codex/hooks/user-prompt-submit.sh' \"$root\" || printf '%s/hooks/user-prompt-submit.sh' \"${CODEX_HOME:-$HOME/.codex}\")\""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"SubagentStart": [
|
|
26
|
+
{
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/subagent-audit.sh\" ] && printf '%s/.codex/hooks/subagent-audit.sh' \"$root\" || printf '%s/hooks/subagent-audit.sh' \"${CODEX_HOME:-$HOME/.codex}\")\""
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"SubagentStop": [
|
|
36
|
+
{
|
|
37
|
+
"hooks": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/subagent-audit.sh\" ] && printf '%s/.codex/hooks/subagent-audit.sh' \"$root\" || printf '%s/hooks/subagent-audit.sh' \"${CODEX_HOME:-$HOME/.codex}\")\""
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"PreToolUse": [
|
|
46
|
+
{
|
|
47
|
+
"matcher": "^Bash$",
|
|
48
|
+
"hooks": [
|
|
49
|
+
{
|
|
50
|
+
"type": "command",
|
|
51
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/pre-bash-guard.sh\" ] && printf '%s/.codex/hooks/pre-bash-guard.sh' \"$root\" || printf '%s/hooks/pre-bash-guard.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
52
|
+
"statusMessage": "Checking command safety"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"matcher": "^mcp__.*",
|
|
58
|
+
"hooks": [
|
|
59
|
+
{
|
|
60
|
+
"type": "command",
|
|
61
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/mcp-tool-guard.sh\" ] && printf '%s/.codex/hooks/mcp-tool-guard.sh' \"$root\" || printf '%s/hooks/mcp-tool-guard.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
62
|
+
"statusMessage": "Checking MCP policy"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"matcher": "^(apply_patch|Edit|Write)$",
|
|
68
|
+
"hooks": [
|
|
69
|
+
{
|
|
70
|
+
"type": "command",
|
|
71
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/pre-implement-gate.sh\" ] && printf '%s/.codex/hooks/pre-implement-gate.sh' \"$root\" || printf '%s/hooks/pre-implement-gate.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
72
|
+
"statusMessage": "Checking DoFlow prerequisites"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"PostToolUse": [
|
|
78
|
+
{
|
|
79
|
+
"matcher": "^(apply_patch|Edit|Write)$",
|
|
80
|
+
"hooks": [
|
|
81
|
+
{
|
|
82
|
+
"type": "command",
|
|
83
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/post-edit-lint.sh\" ] && printf '%s/.codex/hooks/post-edit-lint.sh' \"$root\" || printf '%s/hooks/post-edit-lint.sh' \"${CODEX_HOME:-$HOME/.codex}\")\""
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"PreCompact": [
|
|
89
|
+
{
|
|
90
|
+
"hooks": [
|
|
91
|
+
{
|
|
92
|
+
"type": "command",
|
|
93
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/pre-compact.sh\" ] && printf '%s/.codex/hooks/pre-compact.sh' \"$root\" || printf '%s/hooks/pre-compact.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
94
|
+
"timeout": 3
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"Stop": [
|
|
100
|
+
{
|
|
101
|
+
"hooks": [
|
|
102
|
+
{
|
|
103
|
+
"type": "command",
|
|
104
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/stop-check.sh\" ] && printf '%s/.codex/hooks/stop-check.sh' \"$root\" || printf '%s/hooks/stop-check.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
105
|
+
"timeout": 30
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"SessionEnd": [
|
|
111
|
+
{
|
|
112
|
+
"hooks": [
|
|
113
|
+
{
|
|
114
|
+
"type": "command",
|
|
115
|
+
"command": "bash \"$(root=$(git rev-parse --show-toplevel 2>/dev/null) && [ -f \"$root/.codex/hooks/session-end.sh\" ] && printf '%s/.codex/hooks/session-end.sh' \"$root\" || printf '%s/hooks/session-end.sh' \"${CODEX_HOME:-$HOME/.codex}\")\"",
|
|
116
|
+
"timeout": 3
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|