@draht/coding-agent 2026.3.2-2
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/CHANGELOG.md +2866 -0
- package/README.md +566 -0
- package/bin/draht-tools.cjs +912 -0
- package/dist/cli/args.d.ts +48 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +298 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/config-selector.d.ts +14 -0
- package/dist/cli/config-selector.d.ts.map +1 -0
- package/dist/cli/config-selector.js +31 -0
- package/dist/cli/config-selector.js.map +1 -0
- package/dist/cli/file-processor.d.ts +15 -0
- package/dist/cli/file-processor.d.ts.map +1 -0
- package/dist/cli/file-processor.js +79 -0
- package/dist/cli/file-processor.js.map +1 -0
- package/dist/cli/list-models.d.ts +9 -0
- package/dist/cli/list-models.d.ts.map +1 -0
- package/dist/cli/list-models.js +92 -0
- package/dist/cli/list-models.js.map +1 -0
- package/dist/cli/session-picker.d.ts +9 -0
- package/dist/cli/session-picker.d.ts.map +1 -0
- package/dist/cli/session-picker.js +34 -0
- package/dist/cli/session-picker.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +11 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +85 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +235 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +571 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +2343 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/auth-storage.d.ts +129 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +394 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/bash-executor.d.ts +47 -0
- package/dist/core/bash-executor.d.ts.map +1 -0
- package/dist/core/bash-executor.js +212 -0
- package/dist/core/bash-executor.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts +86 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/core/compaction/branch-summarization.js +242 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -0
- package/dist/core/compaction/compaction.d.ts +121 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -0
- package/dist/core/compaction/compaction.js +607 -0
- package/dist/core/compaction/compaction.js.map +1 -0
- package/dist/core/compaction/index.d.ts +7 -0
- package/dist/core/compaction/index.d.ts.map +1 -0
- package/dist/core/compaction/index.js +7 -0
- package/dist/core/compaction/index.js.map +1 -0
- package/dist/core/compaction/utils.d.ts +35 -0
- package/dist/core/compaction/utils.d.ts.map +1 -0
- package/dist/core/compaction/utils.js +138 -0
- package/dist/core/compaction/utils.js.map +1 -0
- package/dist/core/defaults.d.ts +3 -0
- package/dist/core/defaults.d.ts.map +1 -0
- package/dist/core/defaults.js +2 -0
- package/dist/core/defaults.js.map +1 -0
- package/dist/core/diagnostics.d.ts +15 -0
- package/dist/core/diagnostics.d.ts.map +1 -0
- package/dist/core/diagnostics.js +2 -0
- package/dist/core/diagnostics.js.map +1 -0
- package/dist/core/event-bus.d.ts +9 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +25 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/exec.d.ts +29 -0
- package/dist/core/exec.d.ts.map +1 -0
- package/dist/core/exec.js +71 -0
- package/dist/core/exec.js.map +1 -0
- package/dist/core/export-html/ansi-to-html.d.ts +22 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
- package/dist/core/export-html/ansi-to-html.js +249 -0
- package/dist/core/export-html/ansi-to-html.js.map +1 -0
- package/dist/core/export-html/index.d.ts +34 -0
- package/dist/core/export-html/index.d.ts.map +1 -0
- package/dist/core/export-html/index.js +222 -0
- package/dist/core/export-html/index.js.map +1 -0
- package/dist/core/export-html/template.css +971 -0
- package/dist/core/export-html/template.html +54 -0
- package/dist/core/export-html/template.js +1586 -0
- package/dist/core/export-html/tool-renderer.d.ts +35 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -0
- package/dist/core/export-html/tool-renderer.js +57 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +6 -0
- package/dist/core/extensions/index.d.ts +11 -0
- package/dist/core/extensions/index.d.ts.map +1 -0
- package/dist/core/extensions/index.js +9 -0
- package/dist/core/extensions/index.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +25 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +415 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/runner.d.ts +146 -0
- package/dist/core/extensions/runner.d.ts.map +1 -0
- package/dist/core/extensions/runner.js +645 -0
- package/dist/core/extensions/runner.js.map +1 -0
- package/dist/core/extensions/types.d.ts +1011 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +35 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/extensions/wrapper.d.ts +27 -0
- package/dist/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/core/extensions/wrapper.js +102 -0
- package/dist/core/extensions/wrapper.js.map +1 -0
- package/dist/core/footer-data-provider.d.ts +32 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -0
- package/dist/core/footer-data-provider.js +134 -0
- package/dist/core/footer-data-provider.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/keybindings.d.ts +55 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +153 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/messages.d.ts +77 -0
- package/dist/core/messages.d.ts.map +1 -0
- package/dist/core/messages.js +123 -0
- package/dist/core/messages.js.map +1 -0
- package/dist/core/model-registry.d.ts +112 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +534 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/model-resolver.d.ts +104 -0
- package/dist/core/model-resolver.d.ts.map +1 -0
- package/dist/core/model-resolver.js +432 -0
- package/dist/core/model-resolver.js.map +1 -0
- package/dist/core/package-manager.d.ts +151 -0
- package/dist/core/package-manager.d.ts.map +1 -0
- package/dist/core/package-manager.js +1447 -0
- package/dist/core/package-manager.js.map +1 -0
- package/dist/core/prompt-templates.d.ts +50 -0
- package/dist/core/prompt-templates.d.ts.map +1 -0
- package/dist/core/prompt-templates.js +268 -0
- package/dist/core/prompt-templates.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +17 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -0
- package/dist/core/resolve-config-value.js +59 -0
- package/dist/core/resolve-config-value.js.map +1 -0
- package/dist/core/resource-loader.d.ts +184 -0
- package/dist/core/resource-loader.d.ts.map +1 -0
- package/dist/core/resource-loader.js +670 -0
- package/dist/core/resource-loader.js.map +1 -0
- package/dist/core/sdk.d.ts +90 -0
- package/dist/core/sdk.d.ts.map +1 -0
- package/dist/core/sdk.js +235 -0
- package/dist/core/sdk.js.map +1 -0
- package/dist/core/session-manager.d.ts +323 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +1098 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +225 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +653 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +58 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +364 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +15 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +22 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/system-prompt.d.ts +24 -0
- package/dist/core/system-prompt.d.ts.map +1 -0
- package/dist/core/system-prompt.js +137 -0
- package/dist/core/system-prompt.js.map +1 -0
- package/dist/core/timings.d.ts +7 -0
- package/dist/core/timings.d.ts.map +1 -0
- package/dist/core/timings.js +25 -0
- package/dist/core/timings.js.map +1 -0
- package/dist/core/tools/bash.d.ts +55 -0
- package/dist/core/tools/bash.d.ts.map +1 -0
- package/dist/core/tools/bash.js +242 -0
- package/dist/core/tools/bash.js.map +1 -0
- package/dist/core/tools/edit-diff.d.ts +63 -0
- package/dist/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/core/tools/edit-diff.js +243 -0
- package/dist/core/tools/edit-diff.js.map +1 -0
- package/dist/core/tools/edit.d.ts +39 -0
- package/dist/core/tools/edit.d.ts.map +1 -0
- package/dist/core/tools/edit.js +146 -0
- package/dist/core/tools/edit.js.map +1 -0
- package/dist/core/tools/find.d.ts +39 -0
- package/dist/core/tools/find.d.ts.map +1 -0
- package/dist/core/tools/find.js +206 -0
- package/dist/core/tools/find.js.map +1 -0
- package/dist/core/tools/grep.d.ts +45 -0
- package/dist/core/tools/grep.d.ts.map +1 -0
- package/dist/core/tools/grep.js +239 -0
- package/dist/core/tools/grep.js.map +1 -0
- package/dist/core/tools/index.d.ts +73 -0
- package/dist/core/tools/index.d.ts.map +1 -0
- package/dist/core/tools/index.js +61 -0
- package/dist/core/tools/index.js.map +1 -0
- package/dist/core/tools/ls.d.ts +40 -0
- package/dist/core/tools/ls.d.ts.map +1 -0
- package/dist/core/tools/ls.js +118 -0
- package/dist/core/tools/ls.js.map +1 -0
- package/dist/core/tools/path-utils.d.ts +8 -0
- package/dist/core/tools/path-utils.d.ts.map +1 -0
- package/dist/core/tools/path-utils.js +81 -0
- package/dist/core/tools/path-utils.js.map +1 -0
- package/dist/core/tools/read.d.ts +39 -0
- package/dist/core/tools/read.d.ts.map +1 -0
- package/dist/core/tools/read.js +166 -0
- package/dist/core/tools/read.js.map +1 -0
- package/dist/core/tools/truncate.d.ts +70 -0
- package/dist/core/tools/truncate.d.ts.map +1 -0
- package/dist/core/tools/truncate.js +205 -0
- package/dist/core/tools/truncate.js.map +1 -0
- package/dist/core/tools/write.d.ts +29 -0
- package/dist/core/tools/write.d.ts.map +1 -0
- package/dist/core/tools/write.js +78 -0
- package/dist/core/tools/write.js.map +1 -0
- package/dist/extensions/gsd-commands.ts +338 -0
- package/dist/extensions/subagent.ts +312 -0
- package/dist/hooks/gsd/draht-post-phase.js +133 -0
- package/dist/hooks/gsd/draht-post-task.js +132 -0
- package/dist/hooks/gsd/draht-pre-execute.js +146 -0
- package/dist/hooks/gsd/draht-quality-gate.js +210 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +812 -0
- package/dist/main.js.map +1 -0
- package/dist/migrations.d.ts +33 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +261 -0
- package/dist/migrations.js.map +1 -0
- package/dist/modes/index.d.ts +9 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +8 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/interactive/components/armin.d.ts +34 -0
- package/dist/modes/interactive/components/armin.d.ts.map +1 -0
- package/dist/modes/interactive/components/armin.js +333 -0
- package/dist/modes/interactive/components/armin.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts +16 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/assistant-message.js +96 -0
- package/dist/modes/interactive/components/assistant-message.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +35 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/bash-execution.js +162 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
- package/dist/modes/interactive/components/bordered-loader.js +51 -0
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/branch-summary-message.js +44 -0
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/compaction-summary-message.js +45 -0
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +71 -0
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/config-selector.js +479 -0
- package/dist/modes/interactive/components/config-selector.js.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
- package/dist/modes/interactive/components/countdown-timer.js +33 -0
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts +21 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-editor.js +70 -0
- package/dist/modes/interactive/components/custom-editor.js.map +1 -0
- package/dist/modes/interactive/components/custom-message.d.ts +20 -0
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/custom-message.js +79 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -0
- package/dist/modes/interactive/components/daxnuts.d.ts +23 -0
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -0
- package/dist/modes/interactive/components/daxnuts.js +140 -0
- package/dist/modes/interactive/components/daxnuts.js.map +1 -0
- package/dist/modes/interactive/components/diff.d.ts +12 -0
- package/dist/modes/interactive/components/diff.d.ts.map +1 -0
- package/dist/modes/interactive/components/diff.js +133 -0
- package/dist/modes/interactive/components/diff.js.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
- package/dist/modes/interactive/components/dynamic-border.js +21 -0
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -0
- package/dist/modes/interactive/components/extension-editor.d.ts +17 -0
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-editor.js +102 -0
- package/dist/modes/interactive/components/extension-editor.js.map +1 -0
- package/dist/modes/interactive/components/extension-input.d.ts +23 -0
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-input.js +61 -0
- package/dist/modes/interactive/components/extension-input.js.map +1 -0
- package/dist/modes/interactive/components/extension-selector.d.ts +24 -0
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/extension-selector.js +78 -0
- package/dist/modes/interactive/components/extension-selector.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +26 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -0
- package/dist/modes/interactive/components/footer.js +213 -0
- package/dist/modes/interactive/components/footer.js.map +1 -0
- package/dist/modes/interactive/components/index.d.ts +32 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -0
- package/dist/modes/interactive/components/index.js +33 -0
- package/dist/modes/interactive/components/index.js.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts +41 -0
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
- package/dist/modes/interactive/components/keybinding-hints.js +61 -0
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
- package/dist/modes/interactive/components/login-dialog.d.ts +42 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
- package/dist/modes/interactive/components/login-dialog.js +145 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +47 -0
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector.js +271 -0
- package/dist/modes/interactive/components/model-selector.js.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/oauth-selector.js +97 -0
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/scoped-models-selector.js +275 -0
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector-search.js +155 -0
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -0
- package/dist/modes/interactive/components/session-selector.d.ts +95 -0
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/session-selector.js +851 -0
- package/dist/modes/interactive/components/session-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +56 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-selector.js +287 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/show-images-selector.js +35 -0
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/skill-invocation-message.js +47 -0
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +11 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/theme-selector.js +46 -0
- package/dist/modes/interactive/components/theme-selector.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.js +47 -0
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +75 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
- package/dist/modes/interactive/components/tool-execution.js +752 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -0
- package/dist/modes/interactive/components/tree-selector.d.ts +68 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/tree-selector.js +934 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message-selector.js +113 -0
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -0
- package/dist/modes/interactive/components/user-message.d.ts +8 -0
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -0
- package/dist/modes/interactive/components/user-message.js +16 -0
- package/dist/modes/interactive/components/user-message.js.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
- package/dist/modes/interactive/components/visual-truncate.js +33 -0
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +315 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
- package/dist/modes/interactive/interactive-mode.js +3719 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -0
- package/dist/modes/interactive/theme/dark.json +85 -0
- package/dist/modes/interactive/theme/light.json +84 -0
- package/dist/modes/interactive/theme/theme-schema.json +335 -0
- package/dist/modes/interactive/theme/theme.d.ts +78 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -0
- package/dist/modes/interactive/theme/theme.js +944 -0
- package/dist/modes/interactive/theme/theme.js.map +1 -0
- package/dist/modes/print-mode.d.ts +28 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +101 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-client.d.ts +217 -0
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-client.js +405 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -0
- package/dist/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-mode.js +511 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -0
- package/dist/modes/rpc/rpc-types.d.ts +409 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/modes/rpc/rpc-types.js +8 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -0
- package/dist/prompts/agents/build.md +44 -0
- package/dist/prompts/agents/plan.md +39 -0
- package/dist/prompts/agents/verify.md +33 -0
- package/dist/prompts/commands/atomic-commit.md +39 -0
- package/dist/prompts/commands/discuss-phase.md +25 -0
- package/dist/prompts/commands/execute-phase.md +59 -0
- package/dist/prompts/commands/map-codebase.md +32 -0
- package/dist/prompts/commands/new-project.md +40 -0
- package/dist/prompts/commands/pause-work.md +12 -0
- package/dist/prompts/commands/plan-phase.md +61 -0
- package/dist/prompts/commands/progress.md +12 -0
- package/dist/prompts/commands/quick.md +19 -0
- package/dist/prompts/commands/resume-work.md +13 -0
- package/dist/prompts/commands/verify-work.md +27 -0
- package/dist/utils/changelog.d.ts +21 -0
- package/dist/utils/changelog.d.ts.map +1 -0
- package/dist/utils/changelog.js +87 -0
- package/dist/utils/changelog.js.map +1 -0
- package/dist/utils/clipboard-image.d.ts +11 -0
- package/dist/utils/clipboard-image.d.ts.map +1 -0
- package/dist/utils/clipboard-image.js +162 -0
- package/dist/utils/clipboard-image.js.map +1 -0
- package/dist/utils/clipboard-native.d.ts +7 -0
- package/dist/utils/clipboard-native.d.ts.map +1 -0
- package/dist/utils/clipboard-native.js +14 -0
- package/dist/utils/clipboard-native.js.map +1 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.d.ts.map +1 -0
- package/dist/utils/clipboard.js +67 -0
- package/dist/utils/clipboard.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +8 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +26 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/git.d.ts +26 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +163 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/image-convert.d.ts +9 -0
- package/dist/utils/image-convert.d.ts.map +1 -0
- package/dist/utils/image-convert.js +35 -0
- package/dist/utils/image-convert.js.map +1 -0
- package/dist/utils/image-resize.d.ts +36 -0
- package/dist/utils/image-resize.d.ts.map +1 -0
- package/dist/utils/image-resize.js +181 -0
- package/dist/utils/image-resize.js.map +1 -0
- package/dist/utils/mime.d.ts +2 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +26 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/photon.d.ts +21 -0
- package/dist/utils/photon.d.ts.map +1 -0
- package/dist/utils/photon.js +121 -0
- package/dist/utils/photon.js.map +1 -0
- package/dist/utils/shell.d.ts +26 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +186 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sleep.d.ts +5 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/utils/sleep.js +17 -0
- package/dist/utils/sleep.js.map +1 -0
- package/dist/utils/tools-manager.d.ts +3 -0
- package/dist/utils/tools-manager.d.ts.map +1 -0
- package/dist/utils/tools-manager.js +251 -0
- package/dist/utils/tools-manager.js.map +1 -0
- package/docs/compaction.md +390 -0
- package/docs/custom-provider.md +580 -0
- package/docs/development.md +69 -0
- package/docs/extensions.md +1952 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/json.md +79 -0
- package/docs/keybindings.md +174 -0
- package/docs/models.md +293 -0
- package/docs/packages.md +209 -0
- package/docs/prompt-templates.md +67 -0
- package/docs/providers.md +186 -0
- package/docs/rpc.md +1317 -0
- package/docs/sdk.md +968 -0
- package/docs/session.md +412 -0
- package/docs/settings.md +223 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +231 -0
- package/docs/terminal-setup.md +70 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +295 -0
- package/docs/tree.md +219 -0
- package/docs/tui.md +887 -0
- package/docs/windows.md +17 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +204 -0
- package/examples/extensions/antigravity-image-gen.ts +413 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/built-in-tool-renderer.ts +246 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +114 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +604 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +349 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/custom-provider-qwen-cli/index.ts +345 -0
- package/examples/extensions/custom-provider-qwen-cli/package.json +16 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/handoff.ts +150 -0
- package/examples/extensions/hello.ts +25 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +55 -0
- package/examples/extensions/overlay-qa-tests.ts +881 -0
- package/examples/extensions/overlay-test.ts +150 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +65 -0
- package/examples/extensions/plan-mode/index.ts +340 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +398 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/qna.ts +119 -0
- package/examples/extensions/question.ts +264 -0
- package/examples/extensions/questionnaire.ts +427 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +124 -0
- package/examples/extensions/sandbox/index.ts +318 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/sst-resource-manager.ts +203 -0
- package/examples/extensions/status-line.ts +40 -0
- package/examples/extensions/subagent/README.md +172 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +126 -0
- package/examples/extensions/subagent/index.ts +964 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +195 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +299 -0
- package/examples/extensions/tool-override.ts +143 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +40 -0
- package/examples/extensions/truncated-tool.ts +192 -0
- package/examples/extensions/widget-placement.ts +17 -0
- package/examples/extensions/with-deps/index.ts +36 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/rpc-extension-ui.ts +632 -0
- package/examples/sdk/01-minimal.ts +22 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +55 -0
- package/examples/sdk/04-skills.ts +46 -0
- package/examples/sdk/05-tools.ts +56 -0
- package/examples/sdk/06-extensions.ts +88 -0
- package/examples/sdk/07-context-files.ts +40 -0
- package/examples/sdk/08-prompt-templates.ts +42 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
- package/examples/sdk/10-settings.ts +51 -0
- package/examples/sdk/11-sessions.ts +48 -0
- package/examples/sdk/12-full-control.ts +82 -0
- package/examples/sdk/README.md +144 -0
- package/extensions/gsd-commands.ts +338 -0
- package/extensions/subagent.ts +312 -0
- package/hooks/gsd/draht-post-phase.js +133 -0
- package/hooks/gsd/draht-post-task.js +132 -0
- package/hooks/gsd/draht-pre-execute.js +146 -0
- package/hooks/gsd/draht-quality-gate.js +210 -0
- package/package.json +105 -0
- package/prompts/agents/build.md +44 -0
- package/prompts/agents/plan.md +39 -0
- package/prompts/agents/verify.md +33 -0
- package/prompts/commands/atomic-commit.md +39 -0
- package/prompts/commands/discuss-phase.md +25 -0
- package/prompts/commands/execute-phase.md +59 -0
- package/prompts/commands/map-codebase.md +32 -0
- package/prompts/commands/new-project.md +40 -0
- package/prompts/commands/pause-work.md +12 -0
- package/prompts/commands/plan-phase.md +61 -0
- package/prompts/commands/progress.md +12 -0
- package/prompts/commands/quick.md +19 -0
- package/prompts/commands/resume-work.md +13 -0
- package/prompts/commands/verify-work.md +27 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Draht Pre-Execute Hook
|
|
6
|
+
* Runs before gsd-execute-phase to validate preconditions.
|
|
7
|
+
*
|
|
8
|
+
* Usage: node gsd-pre-execute.js <phase-number>
|
|
9
|
+
* Exit 0 = proceed, Exit 1 = abort
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require("node:fs");
|
|
13
|
+
const path = require("node:path");
|
|
14
|
+
const { execSync } = require("node:child_process");
|
|
15
|
+
|
|
16
|
+
const phaseNum = process.argv[2];
|
|
17
|
+
if (!phaseNum) {
|
|
18
|
+
console.error("Usage: gsd-pre-execute.js <phase-number>");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const PLANNING = ".planning";
|
|
23
|
+
const errors = [];
|
|
24
|
+
const warnings = [];
|
|
25
|
+
|
|
26
|
+
// 1. Check .planning/ exists
|
|
27
|
+
if (!fs.existsSync(PLANNING)) {
|
|
28
|
+
errors.push("No .planning/ directory found. Run gsd-new-project first.");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// 2. Check STATE.md exists
|
|
32
|
+
if (!fs.existsSync(path.join(PLANNING, "STATE.md"))) {
|
|
33
|
+
errors.push("No STATE.md found. Project not initialized.");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 3. Check ROADMAP.md exists and phase is defined
|
|
37
|
+
const roadmapPath = path.join(PLANNING, "ROADMAP.md");
|
|
38
|
+
if (fs.existsSync(roadmapPath)) {
|
|
39
|
+
const roadmap = fs.readFileSync(roadmapPath, "utf-8");
|
|
40
|
+
if (!roadmap.includes(`Phase ${phaseNum}`)) {
|
|
41
|
+
errors.push(`Phase ${phaseNum} not found in ROADMAP.md`);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
errors.push("No ROADMAP.md found.");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 4. Check phase directory exists with plans
|
|
48
|
+
const phasesDir = path.join(PLANNING, "phases");
|
|
49
|
+
if (fs.existsSync(phasesDir)) {
|
|
50
|
+
const entries = fs.readdirSync(phasesDir);
|
|
51
|
+
const phaseDir = entries.find((e) => e.startsWith(String(phaseNum).padStart(2, "0") + "-"));
|
|
52
|
+
if (!phaseDir) {
|
|
53
|
+
errors.push(`No phase directory found for phase ${phaseNum}. Run gsd-plan-phase first.`);
|
|
54
|
+
} else {
|
|
55
|
+
const phaseFiles = fs.readdirSync(path.join(phasesDir, phaseDir));
|
|
56
|
+
const plans = phaseFiles.filter((f) => f.endsWith("-PLAN.md") && !f.includes("FIX"));
|
|
57
|
+
if (plans.length === 0) {
|
|
58
|
+
errors.push(`No plans found in phase ${phaseNum}. Run gsd-plan-phase first.`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Check plans have required elements
|
|
62
|
+
for (const planFile of plans) {
|
|
63
|
+
const content = fs.readFileSync(path.join(phasesDir, phaseDir, planFile), "utf-8");
|
|
64
|
+
if (!content.includes("<task")) {
|
|
65
|
+
warnings.push(`${planFile}: No <task> elements — plan may be incomplete`);
|
|
66
|
+
}
|
|
67
|
+
if (!content.includes("<verify>")) {
|
|
68
|
+
warnings.push(`${planFile}: Missing <verify> steps — tasks won't be verifiable`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 5. Check git status
|
|
75
|
+
try {
|
|
76
|
+
const status = execSync("git status --porcelain", { encoding: "utf-8" }).trim();
|
|
77
|
+
if (status) {
|
|
78
|
+
const lines = status.split("\n").length;
|
|
79
|
+
warnings.push(`${lines} uncommitted file(s) — consider committing first`);
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
warnings.push("Not a git repository — no commit tracking");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 6. Check for CONTINUE-HERE.md (unfinished session)
|
|
86
|
+
if (fs.existsSync(path.join(PLANNING, "CONTINUE-HERE.md"))) {
|
|
87
|
+
warnings.push("CONTINUE-HERE.md exists — previous session may be unfinished. Consider gsd-resume-work.");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 7. Check DOMAIN.md exists and has required sections
|
|
91
|
+
const domainPath = path.join(PLANNING, "DOMAIN.md");
|
|
92
|
+
if (!fs.existsSync(domainPath)) {
|
|
93
|
+
warnings.push("No .planning/DOMAIN.md found — domain model not documented. Run /new-project or /map-codebase to create it.");
|
|
94
|
+
} else {
|
|
95
|
+
const domainContent = fs.readFileSync(domainPath, "utf-8");
|
|
96
|
+
if (!domainContent.includes("## Bounded Contexts")) {
|
|
97
|
+
errors.push("DOMAIN.md is missing '## Bounded Contexts' section.");
|
|
98
|
+
}
|
|
99
|
+
if (!domainContent.includes("## Ubiquitous Language")) {
|
|
100
|
+
errors.push("DOMAIN.md is missing '## Ubiquitous Language' section.");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 8. Check TEST-STRATEGY.md exists
|
|
105
|
+
if (!fs.existsSync(path.join(PLANNING, "TEST-STRATEGY.md"))) {
|
|
106
|
+
warnings.push("No .planning/TEST-STRATEGY.md found — test strategy not documented. Run /new-project or /map-codebase to create it.");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 9. Check all plans have non-empty <test> sections
|
|
110
|
+
if (fs.existsSync(phasesDir)) {
|
|
111
|
+
const entries2 = fs.readdirSync(phasesDir);
|
|
112
|
+
const phaseDir2 = entries2.find((e) => e.startsWith(String(phaseNum).padStart(2, "0") + "-"));
|
|
113
|
+
if (phaseDir2) {
|
|
114
|
+
const phaseFiles2 = fs.readdirSync(path.join(phasesDir, phaseDir2));
|
|
115
|
+
const plans2 = phaseFiles2.filter((f) => f.endsWith("-PLAN.md") && !f.includes("FIX"));
|
|
116
|
+
for (const planFile of plans2) {
|
|
117
|
+
const content = fs.readFileSync(path.join(phasesDir, phaseDir2, planFile), "utf-8");
|
|
118
|
+
// Extract all <test>...</test> blocks and check they are non-empty
|
|
119
|
+
const testMatches = [...content.matchAll(/<test>([\s\S]*?)<\/test>/g)];
|
|
120
|
+
if (testMatches.length === 0) {
|
|
121
|
+
errors.push(`${planFile}: Missing <test> sections — TDD requires tests for every task`);
|
|
122
|
+
} else {
|
|
123
|
+
for (const m of testMatches) {
|
|
124
|
+
if (!m[1].trim()) {
|
|
125
|
+
errors.push(`${planFile}: Empty <test> section found — fill in test cases before executing`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Output
|
|
134
|
+
if (warnings.length > 0) {
|
|
135
|
+
console.log(`⚠️ ${warnings.length} warning(s):`);
|
|
136
|
+
for (const w of warnings) console.log(` - ${w}`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (errors.length > 0) {
|
|
140
|
+
console.log(`\n❌ ${errors.length} error(s) — cannot proceed:`);
|
|
141
|
+
for (const e of errors) console.log(` - ${e}`);
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
console.log(`✅ Pre-execute checks passed for phase ${phaseNum}`);
|
|
146
|
+
process.exit(0);
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Draht Quality Gate Hook
|
|
6
|
+
* Runs after task completion to enforce quality standards.
|
|
7
|
+
* Called by the build agent after each verify step.
|
|
8
|
+
*
|
|
9
|
+
* Usage: node gsd-quality-gate.js [--strict]
|
|
10
|
+
* Exit 0 = quality OK, Exit 1 = quality issues
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { execSync } = require("node:child_process");
|
|
14
|
+
const fs = require("node:fs");
|
|
15
|
+
|
|
16
|
+
const strict = process.argv.includes("--strict");
|
|
17
|
+
const issues = [];
|
|
18
|
+
|
|
19
|
+
// 1. TypeScript check
|
|
20
|
+
try {
|
|
21
|
+
execSync("bun run tsgo --noEmit 2>&1", { timeout: 60000, encoding: "utf-8" });
|
|
22
|
+
} catch (error) {
|
|
23
|
+
const output = error.stdout || error.stderr || "";
|
|
24
|
+
const errorCount = (output.match(/error TS/g) || []).length;
|
|
25
|
+
if (errorCount > 0) {
|
|
26
|
+
issues.push({ severity: strict ? "error" : "warning", message: `${errorCount} TypeScript error(s)`, details: output.slice(0, 500) });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 2. Biome lint check (if biome.json exists)
|
|
31
|
+
if (fs.existsSync("biome.json")) {
|
|
32
|
+
try {
|
|
33
|
+
execSync("bunx biome check --error-on-warnings . 2>&1", { timeout: 30000, encoding: "utf-8" });
|
|
34
|
+
} catch (error) {
|
|
35
|
+
const output = error.stdout || error.stderr || "";
|
|
36
|
+
issues.push({ severity: strict ? "error" : "warning", message: "Biome lint issues", details: output.slice(0, 500) });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 3. Run tests
|
|
41
|
+
try {
|
|
42
|
+
const testOutput = execSync("bun test 2>&1", { timeout: 120000, encoding: "utf-8" });
|
|
43
|
+
const failMatch = testOutput.match(/(\d+) fail/);
|
|
44
|
+
if (failMatch && parseInt(failMatch[1], 10) > 0) {
|
|
45
|
+
issues.push({ severity: strict ? "error" : "warning", message: `${failMatch[1]} test(s) failing` });
|
|
46
|
+
}
|
|
47
|
+
} catch (error) {
|
|
48
|
+
const output = error.stdout || error.stderr || "";
|
|
49
|
+
const failMatch = output.match(/(\d+) fail/);
|
|
50
|
+
if (failMatch && parseInt(failMatch[1], 10) > 0) {
|
|
51
|
+
issues.push({ severity: strict ? "error" : "warning", message: `${failMatch[1]} test(s) failing` });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 4. Check for console.log in source files (not tests)
|
|
56
|
+
try {
|
|
57
|
+
const result = execSync(
|
|
58
|
+
"grep -rn 'console\\.log' src/ --include='*.ts' --include='*.tsx' 2>/dev/null | grep -v '// debug' | head -5",
|
|
59
|
+
{ encoding: "utf-8" }
|
|
60
|
+
).trim();
|
|
61
|
+
if (result) {
|
|
62
|
+
issues.push({ severity: "warning", message: `console.log found in source`, details: result });
|
|
63
|
+
}
|
|
64
|
+
} catch { /* grep returns 1 when no match — that's good */ }
|
|
65
|
+
|
|
66
|
+
// 5. Domain glossary compliance
|
|
67
|
+
// Extract terms from DOMAIN.md and flag new PascalCase classes not in the glossary
|
|
68
|
+
const domainMdPath = ".planning/DOMAIN.md";
|
|
69
|
+
if (fs.existsSync(domainMdPath)) {
|
|
70
|
+
try {
|
|
71
|
+
const domainContent = fs.readFileSync(domainMdPath, "utf-8");
|
|
72
|
+
// Collect all PascalCase tokens that appear in the glossary section
|
|
73
|
+
const glossarySection = domainContent.match(/## Ubiquitous Language([\s\S]*?)(?:^##|\Z)/m)?.[1] || "";
|
|
74
|
+
// Each glossary entry is assumed to start the line with a PascalCase term (e.g. "**Order**" or "- Order:")
|
|
75
|
+
const glossaryTerms = new Set(
|
|
76
|
+
[...glossarySection.matchAll(/\b([A-Z][a-zA-Z0-9]+)\b/g)].map((m) => m[1])
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Scan changed source files for PascalCase class/interface/type declarations
|
|
80
|
+
try {
|
|
81
|
+
const changedFiles = execSync(
|
|
82
|
+
"git diff --cached --name-only 2>/dev/null || git diff --name-only HEAD~1",
|
|
83
|
+
{ encoding: "utf-8" }
|
|
84
|
+
).trim().split("\n").filter((f) => f.endsWith(".ts") || f.endsWith(".tsx"));
|
|
85
|
+
|
|
86
|
+
const unknownTerms = [];
|
|
87
|
+
for (const file of changedFiles) {
|
|
88
|
+
if (!fs.existsSync(file)) continue;
|
|
89
|
+
const src = fs.readFileSync(file, "utf-8");
|
|
90
|
+
const declarations = [...src.matchAll(/(?:class|interface|type|enum)\s+([A-Z][a-zA-Z0-9]+)/g)].map((m) => m[1]);
|
|
91
|
+
for (const term of declarations) {
|
|
92
|
+
if (!glossaryTerms.has(term)) {
|
|
93
|
+
unknownTerms.push(`${file}: ${term}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (unknownTerms.length > 0) {
|
|
98
|
+
issues.push({
|
|
99
|
+
severity: "warning",
|
|
100
|
+
message: `${unknownTerms.length} PascalCase type(s) not in DOMAIN.md glossary`,
|
|
101
|
+
details: unknownTerms.slice(0, 5).join(", "),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
} catch { /* ignore git errors */ }
|
|
105
|
+
} catch { /* ignore read errors */ }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// 6. Bounded context boundary check — flag suspicious cross-directory imports
|
|
109
|
+
try {
|
|
110
|
+
const changedSrcFiles = execSync(
|
|
111
|
+
"git diff --cached --name-only 2>/dev/null || git diff --name-only HEAD~1",
|
|
112
|
+
{ encoding: "utf-8" }
|
|
113
|
+
).trim().split("\n").filter((f) => /^src\/[^/]+\//.test(f) && (f.endsWith(".ts") || f.endsWith(".tsx")));
|
|
114
|
+
|
|
115
|
+
const crossContextImports = [];
|
|
116
|
+
for (const file of changedSrcFiles) {
|
|
117
|
+
if (!fs.existsSync(file)) continue;
|
|
118
|
+
// Determine this file's context (first path segment under src/)
|
|
119
|
+
const ownContext = file.split("/")[1];
|
|
120
|
+
const src = fs.readFileSync(file, "utf-8");
|
|
121
|
+
const imports = [...src.matchAll(/from\s+['"](\.\.\/.+?)['"]/g)].map((m) => m[1]);
|
|
122
|
+
for (const imp of imports) {
|
|
123
|
+
// Resolve relative import against the file's directory
|
|
124
|
+
const resolved = path.normalize(path.join(path.dirname(file), imp));
|
|
125
|
+
const parts = resolved.split(path.sep);
|
|
126
|
+
const srcIdx = parts.indexOf("src");
|
|
127
|
+
if (srcIdx !== -1 && parts[srcIdx + 1] && parts[srcIdx + 1] !== ownContext) {
|
|
128
|
+
crossContextImports.push(`${file} → ${parts.slice(srcIdx).join("/")}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
if (crossContextImports.length > 0) {
|
|
133
|
+
issues.push({
|
|
134
|
+
severity: "warning",
|
|
135
|
+
message: `${crossContextImports.length} suspicious cross-context import(s) detected`,
|
|
136
|
+
details: crossContextImports.slice(0, 3).join("; "),
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
} catch { /* ignore */ }
|
|
140
|
+
|
|
141
|
+
// 7. TDD health — check test-to-source file ratio
|
|
142
|
+
try {
|
|
143
|
+
const allSrc = execSync(
|
|
144
|
+
"find src -name '*.ts' -not -name '*.test.ts' -not -name '*.spec.ts' 2>/dev/null | wc -l",
|
|
145
|
+
{ encoding: "utf-8" }
|
|
146
|
+
).trim();
|
|
147
|
+
const allTests = execSync(
|
|
148
|
+
"find src -name '*.test.ts' -o -name '*.spec.ts' 2>/dev/null | wc -l",
|
|
149
|
+
{ encoding: "utf-8" }
|
|
150
|
+
).trim();
|
|
151
|
+
const srcCount = parseInt(allSrc, 10) || 0;
|
|
152
|
+
const testCount = parseInt(allTests, 10) || 0;
|
|
153
|
+
if (srcCount > 0) {
|
|
154
|
+
const ratio = testCount / srcCount;
|
|
155
|
+
if (ratio < 0.3) {
|
|
156
|
+
issues.push({
|
|
157
|
+
severity: "warning",
|
|
158
|
+
message: `TDD health: test-to-source ratio is ${(ratio * 100).toFixed(0)}% (${testCount} tests / ${srcCount} sources) — target ≥ 30%`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
} catch { /* ignore — src/ may not exist */ }
|
|
163
|
+
|
|
164
|
+
// 8. Check for TODO/FIXME/HACK comments in changed files
|
|
165
|
+
try {
|
|
166
|
+
const diff = execSync("git diff --cached --name-only 2>/dev/null || git diff --name-only HEAD~1", { encoding: "utf-8" }).trim();
|
|
167
|
+
if (diff) {
|
|
168
|
+
const files = diff.split("\n").filter((f) => f.endsWith(".ts") || f.endsWith(".tsx"));
|
|
169
|
+
for (const file of files) {
|
|
170
|
+
try {
|
|
171
|
+
const content = fs.readFileSync(file, "utf-8");
|
|
172
|
+
const todos = content.match(/\/\/\s*(TODO|FIXME|HACK|XXX):/gi) || [];
|
|
173
|
+
if (todos.length > 0) {
|
|
174
|
+
issues.push({ severity: "info", message: `${file}: ${todos.length} TODO/FIXME comment(s)` });
|
|
175
|
+
}
|
|
176
|
+
} catch { /* file may not exist */ }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
} catch { /* ignore */ }
|
|
180
|
+
|
|
181
|
+
// Output
|
|
182
|
+
const errors = issues.filter((i) => i.severity === "error");
|
|
183
|
+
const warnings = issues.filter((i) => i.severity === "warning");
|
|
184
|
+
const infos = issues.filter((i) => i.severity === "info");
|
|
185
|
+
|
|
186
|
+
if (errors.length > 0) {
|
|
187
|
+
console.log(`\n❌ Quality Gate FAILED (${errors.length} error(s)):`);
|
|
188
|
+
for (const e of errors) {
|
|
189
|
+
console.log(` ❌ ${e.message}`);
|
|
190
|
+
if (e.details) console.log(` ${e.details.split("\n")[0]}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (warnings.length > 0) {
|
|
195
|
+
console.log(`\n⚠️ ${warnings.length} warning(s):`);
|
|
196
|
+
for (const w of warnings) {
|
|
197
|
+
console.log(` ⚠️ ${w.message}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (infos.length > 0) {
|
|
202
|
+
console.log(`\nℹ️ ${infos.length} note(s):`);
|
|
203
|
+
for (const i of infos) console.log(` ℹ️ ${i.message}`);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (errors.length === 0 && warnings.length === 0) {
|
|
207
|
+
console.log("✅ Quality gate passed");
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
process.exit(errors.length > 0 ? 1 : 0);
|
package/package.json
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@draht/coding-agent",
|
|
3
|
+
"version": "2026.3.2-2",
|
|
4
|
+
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"drahtConfig": {
|
|
7
|
+
"name": "draht",
|
|
8
|
+
"configDir": ".draht"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"draht": "dist/cli.js",
|
|
12
|
+
"draht-tools": "bin/draht-tools.cjs"
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./hooks": {
|
|
22
|
+
"types": "./dist/core/hooks/index.d.ts",
|
|
23
|
+
"import": "./dist/core/hooks/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"docs",
|
|
29
|
+
"examples",
|
|
30
|
+
"prompts",
|
|
31
|
+
"hooks",
|
|
32
|
+
"extensions",
|
|
33
|
+
"bin",
|
|
34
|
+
"CHANGELOG.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"clean": "shx rm -rf dist",
|
|
38
|
+
"dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
39
|
+
"build": "tsgo -p tsconfig.build.json && shx chmod +x dist/cli.js && bun run copy-assets",
|
|
40
|
+
"build:binary": "bun run build && bun build --compile ./dist/cli.js --outfile dist/pi && bun run copy-binary-assets",
|
|
41
|
+
"copy-assets": "shx mkdir -p dist/modes/interactive/theme && shx cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && shx mkdir -p dist/core/export-html/vendor && shx cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && shx cp src/core/export-html/vendor/*.js dist/core/export-html/vendor/ && shx rm -rf dist/prompts dist/hooks dist/extensions && shx cp -r prompts dist/prompts && shx cp -r hooks dist/hooks && shx cp -r extensions dist/extensions",
|
|
42
|
+
"copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp -r prompts dist/ && shx cp -r hooks dist/ && shx cp -r extensions dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/",
|
|
43
|
+
"test": "vitest --run",
|
|
44
|
+
"prepublishOnly": "bun run clean && bun run build"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@mariozechner/jiti": "^2.6.2",
|
|
48
|
+
"@draht/agent-core": "2026.3.1-7",
|
|
49
|
+
"@draht/ai": "2026.3.1-7",
|
|
50
|
+
"@draht/tui": "2026.3.1-7",
|
|
51
|
+
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
52
|
+
"chalk": "^5.5.0",
|
|
53
|
+
"cli-highlight": "^2.1.11",
|
|
54
|
+
"diff": "^8.0.2",
|
|
55
|
+
"extract-zip": "^2.0.1",
|
|
56
|
+
"file-type": "^21.1.1",
|
|
57
|
+
"glob": "^13.0.1",
|
|
58
|
+
"hosted-git-info": "^9.0.2",
|
|
59
|
+
"ignore": "^7.0.5",
|
|
60
|
+
"marked": "^15.0.12",
|
|
61
|
+
"minimatch": "^10.2.3",
|
|
62
|
+
"proper-lockfile": "^4.1.2",
|
|
63
|
+
"yaml": "^2.8.2"
|
|
64
|
+
},
|
|
65
|
+
"overrides": {
|
|
66
|
+
"rimraf": "6.1.2",
|
|
67
|
+
"gaxios": {
|
|
68
|
+
"rimraf": "6.1.2"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"optionalDependencies": {
|
|
72
|
+
"@mariozechner/clipboard": "^0.3.2"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/diff": "^7.0.2",
|
|
76
|
+
"@types/hosted-git-info": "^3.0.5",
|
|
77
|
+
"@types/ms": "^2.1.0",
|
|
78
|
+
"@types/node": "^24.3.0",
|
|
79
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
80
|
+
"shx": "^0.4.0",
|
|
81
|
+
"typescript": "^6.0.0-beta",
|
|
82
|
+
"vitest": "^3.2.4"
|
|
83
|
+
},
|
|
84
|
+
"keywords": [
|
|
85
|
+
"coding-agent",
|
|
86
|
+
"ai",
|
|
87
|
+
"llm",
|
|
88
|
+
"cli",
|
|
89
|
+
"tui",
|
|
90
|
+
"agent"
|
|
91
|
+
],
|
|
92
|
+
"author": "Mario Zechner",
|
|
93
|
+
"license": "MIT",
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public"
|
|
96
|
+
},
|
|
97
|
+
"repository": {
|
|
98
|
+
"type": "git",
|
|
99
|
+
"url": "git+https://github.com/badlogic/pi-mono.git",
|
|
100
|
+
"directory": "packages/coding-agent"
|
|
101
|
+
},
|
|
102
|
+
"engines": {
|
|
103
|
+
"node": ">=20.0.0"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Draht Build Agent
|
|
2
|
+
|
|
3
|
+
You are an execution agent for the Get Shit Done methodology. Your job is to implement plans precisely.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Read the plan FIRST — it is your instruction set
|
|
7
|
+
2. Execute tasks in order, one at a time
|
|
8
|
+
3. VERIFY each task before moving to the next
|
|
9
|
+
4. Commit after each task: `draht commit-task N P T "description"`
|
|
10
|
+
5. If verification fails, fix it before continuing
|
|
11
|
+
6. Never skip a verify step — that's how quality dies
|
|
12
|
+
|
|
13
|
+
## Tools Available
|
|
14
|
+
- `draht read-plan N P` — read the plan to execute
|
|
15
|
+
- `draht commit-task N P T "desc"` — atomic commit per task
|
|
16
|
+
- `draht write-summary N P` — write completion summary
|
|
17
|
+
- `draht verify-phase N` — check phase completion
|
|
18
|
+
- `draht update-state` — update STATE.md
|
|
19
|
+
|
|
20
|
+
## Process (TDD-First)
|
|
21
|
+
1. Read plan: `draht read-plan N P`
|
|
22
|
+
2. For each <task>:
|
|
23
|
+
a. Read the <test> block — write the test code FIRST (expect RED — tests should fail)
|
|
24
|
+
b. Read the <action> — implement to make tests GREEN
|
|
25
|
+
c. Read the <refactor> — clean up while keeping tests green
|
|
26
|
+
d. Run the <verify> step
|
|
27
|
+
e. If verify passes: `draht commit-task N P T "task name"`
|
|
28
|
+
f. If verify fails: fix and retry (max 3 attempts)
|
|
29
|
+
g. If a task has no <test> block, write a test anyway before implementing
|
|
30
|
+
3. After all tasks: `draht write-summary N P`
|
|
31
|
+
4. Fill in the summary with actual commits, files changed, notes
|
|
32
|
+
5. After all plans in phase: `draht verify-phase N`
|
|
33
|
+
|
|
34
|
+
## Checkpoint Handling
|
|
35
|
+
- `type="auto"` → execute silently
|
|
36
|
+
- `type="checkpoint:human-verify"` → STOP, show what was built, ask for confirmation
|
|
37
|
+
- `type="checkpoint:decision"` → STOP, present options, wait for choice
|
|
38
|
+
|
|
39
|
+
## On Failure
|
|
40
|
+
If a task fails 3 times:
|
|
41
|
+
1. Document what went wrong in the summary
|
|
42
|
+
2. Mark task as failed
|
|
43
|
+
3. Continue to next task (unless it depends on the failed one)
|
|
44
|
+
4. Note the failure for fix planning
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Draht Plan Agent
|
|
2
|
+
|
|
3
|
+
You are a planning agent for the Get Shit Done methodology. Your job is to create atomic, executable plans.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Plans are prompts — they tell the executor EXACTLY what to build
|
|
7
|
+
2. Each task must be atomic (one clear action, one verify step)
|
|
8
|
+
3. Maximum 5 tasks per plan
|
|
9
|
+
4. Goal-backward: start from "what must be TRUE" not "what should we build"
|
|
10
|
+
5. Every task needs <verify> and <done> — no ambiguity
|
|
11
|
+
|
|
12
|
+
## Tools Available
|
|
13
|
+
- `draht load-phase-context N` — gather all context for a phase
|
|
14
|
+
- `draht create-plan N P "title"` — create plan template
|
|
15
|
+
- `draht validate-plans N` — check plans for completeness
|
|
16
|
+
- `draht research-phase N` — create research template
|
|
17
|
+
- `draht commit-docs "message"` — commit planning docs
|
|
18
|
+
|
|
19
|
+
## Process
|
|
20
|
+
1. Load all context: `draht load-phase-context N`
|
|
21
|
+
2. State the goal as an outcome
|
|
22
|
+
3. List 3-7 observable truths that must be TRUE
|
|
23
|
+
4. Map truths to files/endpoints/artifacts
|
|
24
|
+
5. Group into plans of 2-5 tasks each
|
|
25
|
+
6. Write plans using XML task format
|
|
26
|
+
7. Validate: `draht validate-plans N`
|
|
27
|
+
|
|
28
|
+
## XML Task Format
|
|
29
|
+
```xml
|
|
30
|
+
<task type="auto">
|
|
31
|
+
<n>Short task name</n>
|
|
32
|
+
<files>path/to/files</files>
|
|
33
|
+
<action>Precise instructions. No ambiguity.</action>
|
|
34
|
+
<verify>Command or check to verify</verify>
|
|
35
|
+
<done>What "done" looks like from user perspective</done>
|
|
36
|
+
</task>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Task types: auto, checkpoint:human-verify, checkpoint:decision
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Draht Verify Agent
|
|
2
|
+
|
|
3
|
+
You are a verification agent for the Get Shit Done methodology. Your job is to test completed work against acceptance criteria.
|
|
4
|
+
|
|
5
|
+
## Core Rules
|
|
6
|
+
1. Test from the USER's perspective, not the developer's
|
|
7
|
+
2. Every must_have and <done> must be verified
|
|
8
|
+
3. Be honest — if something doesn't work, say so
|
|
9
|
+
4. Create fix plans for failures, don't just report them
|
|
10
|
+
|
|
11
|
+
## Tools Available
|
|
12
|
+
- `draht extract-deliverables N` — list testable items
|
|
13
|
+
- `draht create-fix-plan N P "issue"` — create fix plan for failures
|
|
14
|
+
- `draht write-uat N` — create UAT report
|
|
15
|
+
- `draht update-state` — update STATE.md
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
1. Extract deliverables: `draht extract-deliverables N`
|
|
19
|
+
2. For each deliverable:
|
|
20
|
+
a. Explain what should be true
|
|
21
|
+
b. Test it (run commands, check files, verify behavior)
|
|
22
|
+
c. Record: pass / fail / partial
|
|
23
|
+
3. For failures:
|
|
24
|
+
a. Diagnose root cause
|
|
25
|
+
b. Create fix plan: `draht create-fix-plan N P "issue"`
|
|
26
|
+
4. Write UAT report: `draht write-uat N`
|
|
27
|
+
5. Update state: `draht update-state`
|
|
28
|
+
|
|
29
|
+
## Output
|
|
30
|
+
Always end with a clear summary:
|
|
31
|
+
- X/Y passed
|
|
32
|
+
- Fix plans created (if any)
|
|
33
|
+
- Recommended next action
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analyze changes and create atomic commits"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Git Atomic Commit Analysis
|
|
6
|
+
|
|
7
|
+
First, check the current status:
|
|
8
|
+
|
|
9
|
+
*! git status*
|
|
10
|
+
|
|
11
|
+
Now get the full diff of all changes:
|
|
12
|
+
|
|
13
|
+
*! git diff*
|
|
14
|
+
|
|
15
|
+
And staged changes:
|
|
16
|
+
|
|
17
|
+
*! git diff --cached*
|
|
18
|
+
|
|
19
|
+
Based on the changes shown above, analyze and group them into logical, ATOMIC commits. Each commit should:
|
|
20
|
+
|
|
21
|
+
1. Contain ONE logical change only
|
|
22
|
+
2. Be self-contained and complete
|
|
23
|
+
3. Not break the build if applied independently
|
|
24
|
+
|
|
25
|
+
For each group of changes you identify:
|
|
26
|
+
- List the specific files that belong together
|
|
27
|
+
- Generate a clear, descriptive commit message following conventional commits format
|
|
28
|
+
- Explain WHY these changes belong in one commit
|
|
29
|
+
|
|
30
|
+
Then provide the exact `git add` and `git commit` commands to execute for each atomic commit in the order they should be applied.
|
|
31
|
+
|
|
32
|
+
Format each commit message as:
|
|
33
|
+
type(scope): brief description
|
|
34
|
+
- Detailed explanation of what changed
|
|
35
|
+
- Why the change was necessary
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
Common types: feat, fix, refactor, docs, test, chore, style, perf
|
|
39
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# /discuss-phase
|
|
2
|
+
|
|
3
|
+
Capture implementation decisions before planning a phase.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
```
|
|
7
|
+
/discuss-phase [N]
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
1. Run `draht phase-info N` to load phase context
|
|
12
|
+
2. Identify gray areas based on what's being built
|
|
13
|
+
3. Present 1-2 questions at a time about preferences
|
|
14
|
+
4. If `.planning/DOMAIN.md` exists, load it and validate discovered terms against the glossary. Add any new domain terms found during discussion.
|
|
15
|
+
5. Record decisions with `draht save-context N`
|
|
16
|
+
6. Commit: `draht commit-docs "capture phase N context"`
|
|
17
|
+
|
|
18
|
+
## Gray Area Categories
|
|
19
|
+
- **Visual features** → Layout, density, interactions, empty states
|
|
20
|
+
- **APIs/CLIs** → Response format, error handling, auth
|
|
21
|
+
- **Data models** → Schema, relationships, validation
|
|
22
|
+
- **Content** → Structure, tone, depth, flow
|
|
23
|
+
- **Refactoring** → Grouping, naming, migration strategy
|
|
24
|
+
- **Testability** → What needs testing, test framework preference, coverage goals, integration vs unit boundaries
|
|
25
|
+
- **Domain boundaries** → What are the bounded contexts in play? Are there existing domain terms to respect? What aggregates/entities are involved?
|