@draht/coding-agent 2026.3.25 → 2026.4.23
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 +896 -624
- package/README.md +110 -97
- package/dist/cli/args.d.ts +7 -10
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +42 -44
- package/dist/cli/args.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts +83 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/core/agent-session-runtime.js +236 -0
- package/dist/core/agent-session-runtime.js.map +1 -0
- package/dist/core/agent-session-services.d.ts +86 -0
- package/dist/core/agent-session-services.d.ts.map +1 -0
- package/dist/core/agent-session-services.js +116 -0
- package/dist/core/agent-session-services.js.map +1 -0
- package/dist/core/agent-session.d.ts +17 -47
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +166 -291
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +3 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +5 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +19 -7
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +27 -26
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +2 -0
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -2
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +7 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +4 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +30 -29
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +10 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +5 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +70 -8
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +14 -1
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +13 -14
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +21 -3
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +120 -71
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +4 -4
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +21 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +108 -43
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +1 -22
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resolve-config-value.d.ts +6 -0
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +37 -5
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +25 -3
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +7 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +18 -24
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-cwd.d.ts +19 -0
- package/dist/core/session-cwd.d.ts.map +1 -0
- package/dist/core/session-cwd.js +38 -0
- package/dist/core/session-cwd.js.map +1 -0
- package/dist/core/session-manager.d.ts +5 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +16 -8
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +5 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +3 -3
- package/dist/core/skills.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +6 -6
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/timings.d.ts +1 -0
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +6 -0
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +19 -9
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -1
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +150 -57
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts +13 -11
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +55 -77
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +4 -4
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/index.d.ts +9 -6
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +2 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +259 -422
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +3 -3
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +25 -5
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +3 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +14 -3
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +5 -0
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -0
- package/dist/modes/interactive/components/earendil-announcement.js +40 -0
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -0
- package/dist/modes/interactive/components/footer.d.ts +1 -0
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +4 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +2 -7
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +4 -2
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +48 -15
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +18 -5
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +287 -188
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +15 -11
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +2 -2
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +89 -72
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +1 -0
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +2 -2
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +95 -64
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts +4 -0
- package/dist/package-manager-cli.d.ts.map +1 -0
- package/dist/package-manager-cli.js +234 -0
- package/dist/package-manager-cli.js.map +1 -0
- package/dist/prompts/commands/atomic-commit.md +17 -0
- package/dist/prompts/commands/discuss-phase.md +15 -0
- package/dist/prompts/commands/execute-phase.md +14 -0
- package/dist/prompts/commands/fix.md +14 -0
- package/dist/prompts/commands/init-project.md +16 -0
- package/dist/prompts/commands/map-codebase.md +16 -0
- package/dist/prompts/commands/new-project.md +16 -0
- package/dist/prompts/commands/next-milestone.md +16 -0
- package/dist/prompts/commands/pause-work.md +13 -0
- package/dist/prompts/commands/plan-phase.md +15 -0
- package/dist/prompts/commands/progress.md +13 -0
- package/dist/prompts/commands/quick.md +14 -0
- package/dist/prompts/commands/resume-work.md +13 -0
- package/dist/prompts/commands/review.md +15 -0
- package/dist/prompts/commands/verify-work.md +15 -0
- package/dist/utils/paths.d.ts +7 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +19 -0
- package/dist/utils/paths.js.map +1 -0
- package/docs/compaction.md +5 -3
- package/docs/custom-provider.md +1 -1
- package/docs/development.md +5 -3
- package/docs/extensions.md +221 -69
- package/docs/json.md +5 -2
- package/docs/keybindings.md +2 -0
- package/docs/models.md +60 -3
- package/docs/packages.md +3 -3
- package/docs/rpc.md +23 -9
- package/docs/sdk.md +240 -84
- package/docs/session.md +3 -3
- package/docs/settings.md +12 -0
- package/docs/skills.md +3 -2
- package/docs/tree.md +6 -3
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/antigravity-image-gen.ts +1 -1
- package/examples/extensions/custom-compaction.ts +17 -4
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
- package/examples/extensions/doom-overlay/doom/build.sh +2 -2
- package/examples/extensions/handoff.ts +5 -2
- package/examples/extensions/hello.ts +18 -17
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/overlay-qa-tests.ts +2 -2
- package/examples/extensions/qna.ts +5 -2
- package/examples/extensions/rpc-demo.ts +3 -9
- package/examples/extensions/sandbox/index.ts +8 -4
- package/examples/extensions/status-line.ts +0 -8
- package/examples/extensions/subagent/index.ts +6 -6
- package/examples/extensions/summarize.ts +15 -4
- package/examples/extensions/todo.ts +0 -2
- package/examples/extensions/tools.ts +0 -5
- package/examples/extensions/trigger-compact.ts +11 -1
- package/examples/extensions/widget-placement.ts +4 -12
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +3 -3
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +8 -5
- package/package.json +7 -8
- package/prompts/commands/atomic-commit.md +17 -0
- package/prompts/commands/discuss-phase.md +15 -0
- package/prompts/commands/execute-phase.md +14 -0
- package/prompts/commands/fix.md +14 -0
- package/prompts/commands/init-project.md +16 -0
- package/prompts/commands/map-codebase.md +16 -0
- package/prompts/commands/new-project.md +16 -0
- package/prompts/commands/next-milestone.md +16 -0
- package/prompts/commands/pause-work.md +13 -0
- package/prompts/commands/plan-phase.md +15 -0
- package/prompts/commands/progress.md +13 -0
- package/prompts/commands/quick.md +14 -0
- package/prompts/commands/resume-work.md +13 -0
- package/prompts/commands/review.md +15 -0
- package/prompts/commands/verify-work.md +15 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { selectConfig } from "./cli/config-selector.js";
|
|
3
|
+
import { APP_NAME, getAgentDir } from "./config.js";
|
|
4
|
+
import { DefaultPackageManager } from "./core/package-manager.js";
|
|
5
|
+
import { SettingsManager } from "./core/settings-manager.js";
|
|
6
|
+
function reportSettingsErrors(settingsManager, context) {
|
|
7
|
+
const errors = settingsManager.drainErrors();
|
|
8
|
+
for (const { scope, error } of errors) {
|
|
9
|
+
console.error(chalk.yellow(`Warning (${context}, ${scope} settings): ${error.message}`));
|
|
10
|
+
if (error.stack) {
|
|
11
|
+
console.error(chalk.dim(error.stack));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function getPackageCommandUsage(command) {
|
|
16
|
+
switch (command) {
|
|
17
|
+
case "install":
|
|
18
|
+
return `${APP_NAME} install <source> [-l]`;
|
|
19
|
+
case "remove":
|
|
20
|
+
return `${APP_NAME} remove <source> [-l]`;
|
|
21
|
+
case "update":
|
|
22
|
+
return `${APP_NAME} update [source]`;
|
|
23
|
+
case "list":
|
|
24
|
+
return `${APP_NAME} list`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function printPackageCommandHelp(command) {
|
|
28
|
+
switch (command) {
|
|
29
|
+
case "install":
|
|
30
|
+
console.log(`${chalk.bold("Usage:")}
|
|
31
|
+
${getPackageCommandUsage("install")}
|
|
32
|
+
|
|
33
|
+
Install a package and add it to settings.
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
-l, --local Install project-locally (.pi/settings.json)
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
${APP_NAME} install npm:@foo/bar
|
|
40
|
+
${APP_NAME} install git:github.com/user/repo
|
|
41
|
+
${APP_NAME} install git:git@github.com:user/repo
|
|
42
|
+
${APP_NAME} install https://github.com/user/repo
|
|
43
|
+
${APP_NAME} install ssh://git@github.com/user/repo
|
|
44
|
+
${APP_NAME} install ./local/path
|
|
45
|
+
`);
|
|
46
|
+
return;
|
|
47
|
+
case "remove":
|
|
48
|
+
console.log(`${chalk.bold("Usage:")}
|
|
49
|
+
${getPackageCommandUsage("remove")}
|
|
50
|
+
|
|
51
|
+
Remove a package and its source from settings.
|
|
52
|
+
Alias: ${APP_NAME} uninstall <source> [-l]
|
|
53
|
+
|
|
54
|
+
Options:
|
|
55
|
+
-l, --local Remove from project settings (.pi/settings.json)
|
|
56
|
+
|
|
57
|
+
Examples:
|
|
58
|
+
${APP_NAME} remove npm:@foo/bar
|
|
59
|
+
${APP_NAME} uninstall npm:@foo/bar
|
|
60
|
+
`);
|
|
61
|
+
return;
|
|
62
|
+
case "update":
|
|
63
|
+
console.log(`${chalk.bold("Usage:")}
|
|
64
|
+
${getPackageCommandUsage("update")}
|
|
65
|
+
|
|
66
|
+
Update installed packages.
|
|
67
|
+
If <source> is provided, only that package is updated.
|
|
68
|
+
`);
|
|
69
|
+
return;
|
|
70
|
+
case "list":
|
|
71
|
+
console.log(`${chalk.bold("Usage:")}
|
|
72
|
+
${getPackageCommandUsage("list")}
|
|
73
|
+
|
|
74
|
+
List installed packages from user and project settings.
|
|
75
|
+
`);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function parsePackageCommand(args) {
|
|
80
|
+
const [rawCommand, ...rest] = args;
|
|
81
|
+
let command;
|
|
82
|
+
if (rawCommand === "uninstall") {
|
|
83
|
+
command = "remove";
|
|
84
|
+
}
|
|
85
|
+
else if (rawCommand === "install" || rawCommand === "remove" || rawCommand === "update" || rawCommand === "list") {
|
|
86
|
+
command = rawCommand;
|
|
87
|
+
}
|
|
88
|
+
if (!command) {
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
let local = false;
|
|
92
|
+
let help = false;
|
|
93
|
+
let invalidOption;
|
|
94
|
+
let source;
|
|
95
|
+
for (const arg of rest) {
|
|
96
|
+
if (arg === "-h" || arg === "--help") {
|
|
97
|
+
help = true;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
if (arg === "-l" || arg === "--local") {
|
|
101
|
+
if (command === "install" || command === "remove") {
|
|
102
|
+
local = true;
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
invalidOption = invalidOption ?? arg;
|
|
106
|
+
}
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (arg.startsWith("-")) {
|
|
110
|
+
invalidOption = invalidOption ?? arg;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
if (!source) {
|
|
114
|
+
source = arg;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return { command, source, local, help, invalidOption };
|
|
118
|
+
}
|
|
119
|
+
export async function handleConfigCommand(args) {
|
|
120
|
+
if (args[0] !== "config") {
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
const cwd = process.cwd();
|
|
124
|
+
const agentDir = getAgentDir();
|
|
125
|
+
const settingsManager = SettingsManager.create(cwd, agentDir);
|
|
126
|
+
reportSettingsErrors(settingsManager, "config command");
|
|
127
|
+
const packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
|
|
128
|
+
const resolvedPaths = await packageManager.resolve();
|
|
129
|
+
await selectConfig({
|
|
130
|
+
resolvedPaths,
|
|
131
|
+
settingsManager,
|
|
132
|
+
cwd,
|
|
133
|
+
agentDir,
|
|
134
|
+
});
|
|
135
|
+
process.exit(0);
|
|
136
|
+
}
|
|
137
|
+
export async function handlePackageCommand(args) {
|
|
138
|
+
const options = parsePackageCommand(args);
|
|
139
|
+
if (!options) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
if (options.help) {
|
|
143
|
+
printPackageCommandHelp(options.command);
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
if (options.invalidOption) {
|
|
147
|
+
console.error(chalk.red(`Unknown option ${options.invalidOption} for "${options.command}".`));
|
|
148
|
+
console.error(chalk.dim(`Use "${APP_NAME} --help" or "${getPackageCommandUsage(options.command)}".`));
|
|
149
|
+
process.exitCode = 1;
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
const source = options.source;
|
|
153
|
+
if ((options.command === "install" || options.command === "remove") && !source) {
|
|
154
|
+
console.error(chalk.red(`Missing ${options.command} source.`));
|
|
155
|
+
console.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));
|
|
156
|
+
process.exitCode = 1;
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
const cwd = process.cwd();
|
|
160
|
+
const agentDir = getAgentDir();
|
|
161
|
+
const settingsManager = SettingsManager.create(cwd, agentDir);
|
|
162
|
+
reportSettingsErrors(settingsManager, "package command");
|
|
163
|
+
const packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });
|
|
164
|
+
packageManager.setProgressCallback((event) => {
|
|
165
|
+
if (event.type === "start") {
|
|
166
|
+
process.stdout.write(chalk.dim(`${event.message}\n`));
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
try {
|
|
170
|
+
switch (options.command) {
|
|
171
|
+
case "install":
|
|
172
|
+
await packageManager.installAndPersist(source, { local: options.local });
|
|
173
|
+
console.log(chalk.green(`Installed ${source}`));
|
|
174
|
+
return true;
|
|
175
|
+
case "remove": {
|
|
176
|
+
const removed = await packageManager.removeAndPersist(source, { local: options.local });
|
|
177
|
+
if (!removed) {
|
|
178
|
+
console.error(chalk.red(`No matching package found for ${source}`));
|
|
179
|
+
process.exitCode = 1;
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
console.log(chalk.green(`Removed ${source}`));
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
case "list": {
|
|
186
|
+
const configuredPackages = packageManager.listConfiguredPackages();
|
|
187
|
+
const userPackages = configuredPackages.filter((pkg) => pkg.scope === "user");
|
|
188
|
+
const projectPackages = configuredPackages.filter((pkg) => pkg.scope === "project");
|
|
189
|
+
if (configuredPackages.length === 0) {
|
|
190
|
+
console.log(chalk.dim("No packages installed."));
|
|
191
|
+
return true;
|
|
192
|
+
}
|
|
193
|
+
const formatPackage = (pkg) => {
|
|
194
|
+
const display = pkg.filtered ? `${pkg.source} (filtered)` : pkg.source;
|
|
195
|
+
console.log(` ${display}`);
|
|
196
|
+
if (pkg.installedPath) {
|
|
197
|
+
console.log(chalk.dim(` ${pkg.installedPath}`));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
if (userPackages.length > 0) {
|
|
201
|
+
console.log(chalk.bold("User packages:"));
|
|
202
|
+
for (const pkg of userPackages) {
|
|
203
|
+
formatPackage(pkg);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (projectPackages.length > 0) {
|
|
207
|
+
if (userPackages.length > 0)
|
|
208
|
+
console.log();
|
|
209
|
+
console.log(chalk.bold("Project packages:"));
|
|
210
|
+
for (const pkg of projectPackages) {
|
|
211
|
+
formatPackage(pkg);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
case "update":
|
|
217
|
+
await packageManager.update(source);
|
|
218
|
+
if (source) {
|
|
219
|
+
console.log(chalk.green(`Updated ${source}`));
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
console.log(chalk.green("Updated packages"));
|
|
223
|
+
}
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
const message = error instanceof Error ? error.message : "Unknown package command error";
|
|
229
|
+
console.error(chalk.red(`Error: ${message}`));
|
|
230
|
+
process.exitCode = 1;
|
|
231
|
+
return true;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=package-manager-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manager-cli.js","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAY7D,SAAS,oBAAoB,CAAC,eAAgC,EAAE,OAAe,EAAQ;IACtF,MAAM,MAAM,GAAG,eAAe,CAAC,WAAW,EAAE,CAAC;IAC7C,KAAK,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,MAAM,EAAE,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,OAAO,KAAK,KAAK,eAAe,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACzF,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,CAAC;IACF,CAAC;AAAA,CACD;AAED,SAAS,sBAAsB,CAAC,OAAuB,EAAU;IAChE,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,SAAS;YACb,OAAO,GAAG,QAAQ,wBAAwB,CAAC;QAC5C,KAAK,QAAQ;YACZ,OAAO,GAAG,QAAQ,uBAAuB,CAAC;QAC3C,KAAK,QAAQ;YACZ,OAAO,GAAG,QAAQ,kBAAkB,CAAC;QACtC,KAAK,MAAM;YACV,OAAO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C,OAAO,KAAc,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;QACzF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACb,CAAC;AAAA,CACD","sourcesContent":["import chalk from \"chalk\";\nimport { selectConfig } from \"./cli/config-selector.js\";\nimport { APP_NAME, getAgentDir } from \"./config.js\";\nimport { DefaultPackageManager } from \"./core/package-manager.js\";\nimport { SettingsManager } from \"./core/settings-manager.js\";\n\nexport type PackageCommand = \"install\" | \"remove\" | \"update\" | \"list\";\n\ninterface PackageCommandOptions {\n\tcommand: PackageCommand;\n\tsource?: string;\n\tlocal: boolean;\n\thelp: boolean;\n\tinvalidOption?: string;\n}\n\nfunction reportSettingsErrors(settingsManager: SettingsManager, context: string): void {\n\tconst errors = settingsManager.drainErrors();\n\tfor (const { scope, error } of errors) {\n\t\tconsole.error(chalk.yellow(`Warning (${context}, ${scope} settings): ${error.message}`));\n\t\tif (error.stack) {\n\t\t\tconsole.error(chalk.dim(error.stack));\n\t\t}\n\t}\n}\n\nfunction getPackageCommandUsage(command: PackageCommand): string {\n\tswitch (command) {\n\t\tcase \"install\":\n\t\t\treturn `${APP_NAME} install <source> [-l]`;\n\t\tcase \"remove\":\n\t\t\treturn `${APP_NAME} remove <source> [-l]`;\n\t\tcase \"update\":\n\t\t\treturn `${APP_NAME} update [source]`;\n\t\tcase \"list\":\n\t\t\treturn `${APP_NAME} list`;\n\t}\n}\n\nfunction printPackageCommandHelp(command: PackageCommand): void {\n\tswitch (command) {\n\t\tcase \"install\":\n\t\t\tconsole.log(`${chalk.bold(\"Usage:\")}\n ${getPackageCommandUsage(\"install\")}\n\nInstall a package and add it to settings.\n\nOptions:\n -l, --local Install project-locally (.pi/settings.json)\n\nExamples:\n ${APP_NAME} install npm:@foo/bar\n ${APP_NAME} install git:github.com/user/repo\n ${APP_NAME} install git:git@github.com:user/repo\n ${APP_NAME} install https://github.com/user/repo\n ${APP_NAME} install ssh://git@github.com/user/repo\n ${APP_NAME} install ./local/path\n`);\n\t\t\treturn;\n\n\t\tcase \"remove\":\n\t\t\tconsole.log(`${chalk.bold(\"Usage:\")}\n ${getPackageCommandUsage(\"remove\")}\n\nRemove a package and its source from settings.\nAlias: ${APP_NAME} uninstall <source> [-l]\n\nOptions:\n -l, --local Remove from project settings (.pi/settings.json)\n\nExamples:\n ${APP_NAME} remove npm:@foo/bar\n ${APP_NAME} uninstall npm:@foo/bar\n`);\n\t\t\treturn;\n\n\t\tcase \"update\":\n\t\t\tconsole.log(`${chalk.bold(\"Usage:\")}\n ${getPackageCommandUsage(\"update\")}\n\nUpdate installed packages.\nIf <source> is provided, only that package is updated.\n`);\n\t\t\treturn;\n\n\t\tcase \"list\":\n\t\t\tconsole.log(`${chalk.bold(\"Usage:\")}\n ${getPackageCommandUsage(\"list\")}\n\nList installed packages from user and project settings.\n`);\n\t\t\treturn;\n\t}\n}\n\nfunction parsePackageCommand(args: string[]): PackageCommandOptions | undefined {\n\tconst [rawCommand, ...rest] = args;\n\tlet command: PackageCommand | undefined;\n\tif (rawCommand === \"uninstall\") {\n\t\tcommand = \"remove\";\n\t} else if (rawCommand === \"install\" || rawCommand === \"remove\" || rawCommand === \"update\" || rawCommand === \"list\") {\n\t\tcommand = rawCommand;\n\t}\n\tif (!command) {\n\t\treturn undefined;\n\t}\n\n\tlet local = false;\n\tlet help = false;\n\tlet invalidOption: string | undefined;\n\tlet source: string | undefined;\n\n\tfor (const arg of rest) {\n\t\tif (arg === \"-h\" || arg === \"--help\") {\n\t\t\thelp = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arg === \"-l\" || arg === \"--local\") {\n\t\t\tif (command === \"install\" || command === \"remove\") {\n\t\t\t\tlocal = true;\n\t\t\t} else {\n\t\t\t\tinvalidOption = invalidOption ?? arg;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (arg.startsWith(\"-\")) {\n\t\t\tinvalidOption = invalidOption ?? arg;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!source) {\n\t\t\tsource = arg;\n\t\t}\n\t}\n\n\treturn { command, source, local, help, invalidOption };\n}\n\nexport async function handleConfigCommand(args: string[]): Promise<boolean> {\n\tif (args[0] !== \"config\") {\n\t\treturn false;\n\t}\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst settingsManager = SettingsManager.create(cwd, agentDir);\n\treportSettingsErrors(settingsManager, \"config command\");\n\tconst packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });\n\tconst resolvedPaths = await packageManager.resolve();\n\n\tawait selectConfig({\n\t\tresolvedPaths,\n\t\tsettingsManager,\n\t\tcwd,\n\t\tagentDir,\n\t});\n\n\tprocess.exit(0);\n}\n\nexport async function handlePackageCommand(args: string[]): Promise<boolean> {\n\tconst options = parsePackageCommand(args);\n\tif (!options) {\n\t\treturn false;\n\t}\n\n\tif (options.help) {\n\t\tprintPackageCommandHelp(options.command);\n\t\treturn true;\n\t}\n\n\tif (options.invalidOption) {\n\t\tconsole.error(chalk.red(`Unknown option ${options.invalidOption} for \"${options.command}\".`));\n\t\tconsole.error(chalk.dim(`Use \"${APP_NAME} --help\" or \"${getPackageCommandUsage(options.command)}\".`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst source = options.source;\n\tif ((options.command === \"install\" || options.command === \"remove\") && !source) {\n\t\tconsole.error(chalk.red(`Missing ${options.command} source.`));\n\t\tconsole.error(chalk.dim(`Usage: ${getPackageCommandUsage(options.command)}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n\n\tconst cwd = process.cwd();\n\tconst agentDir = getAgentDir();\n\tconst settingsManager = SettingsManager.create(cwd, agentDir);\n\treportSettingsErrors(settingsManager, \"package command\");\n\tconst packageManager = new DefaultPackageManager({ cwd, agentDir, settingsManager });\n\n\tpackageManager.setProgressCallback((event) => {\n\t\tif (event.type === \"start\") {\n\t\t\tprocess.stdout.write(chalk.dim(`${event.message}\\n`));\n\t\t}\n\t});\n\n\ttry {\n\t\tswitch (options.command) {\n\t\t\tcase \"install\":\n\t\t\t\tawait packageManager.installAndPersist(source!, { local: options.local });\n\t\t\t\tconsole.log(chalk.green(`Installed ${source}`));\n\t\t\t\treturn true;\n\n\t\t\tcase \"remove\": {\n\t\t\t\tconst removed = await packageManager.removeAndPersist(source!, { local: options.local });\n\t\t\t\tif (!removed) {\n\t\t\t\t\tconsole.error(chalk.red(`No matching package found for ${source}`));\n\t\t\t\t\tprocess.exitCode = 1;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tconsole.log(chalk.green(`Removed ${source}`));\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"list\": {\n\t\t\t\tconst configuredPackages = packageManager.listConfiguredPackages();\n\t\t\t\tconst userPackages = configuredPackages.filter((pkg) => pkg.scope === \"user\");\n\t\t\t\tconst projectPackages = configuredPackages.filter((pkg) => pkg.scope === \"project\");\n\n\t\t\t\tif (configuredPackages.length === 0) {\n\t\t\t\t\tconsole.log(chalk.dim(\"No packages installed.\"));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst formatPackage = (pkg: (typeof configuredPackages)[number]) => {\n\t\t\t\t\tconst display = pkg.filtered ? `${pkg.source} (filtered)` : pkg.source;\n\t\t\t\t\tconsole.log(` ${display}`);\n\t\t\t\t\tif (pkg.installedPath) {\n\t\t\t\t\t\tconsole.log(chalk.dim(` ${pkg.installedPath}`));\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tif (userPackages.length > 0) {\n\t\t\t\t\tconsole.log(chalk.bold(\"User packages:\"));\n\t\t\t\t\tfor (const pkg of userPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (projectPackages.length > 0) {\n\t\t\t\t\tif (userPackages.length > 0) console.log();\n\t\t\t\t\tconsole.log(chalk.bold(\"Project packages:\"));\n\t\t\t\t\tfor (const pkg of projectPackages) {\n\t\t\t\t\t\tformatPackage(pkg);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tcase \"update\":\n\t\t\t\tawait packageManager.update(source);\n\t\t\t\tif (source) {\n\t\t\t\t\tconsole.log(chalk.green(`Updated ${source}`));\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(chalk.green(\"Updated packages\"));\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t}\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : \"Unknown package command error\";\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exitCode = 1;\n\t\treturn true;\n\t}\n}\n"]}
|
|
@@ -4,6 +4,23 @@ description: "Analyze changes and create atomic commits"
|
|
|
4
4
|
|
|
5
5
|
# Git Atomic Commit Analysis
|
|
6
6
|
|
|
7
|
+
## Atomic Reasoning
|
|
8
|
+
|
|
9
|
+
Before creating commits, decompose changes into atomic reasoning units:
|
|
10
|
+
|
|
11
|
+
**For each file change:**
|
|
12
|
+
1. **State the logical component** — What does this change do? What is its purpose? Does it complete a thought?
|
|
13
|
+
2. **Validate independence** — Can this change be applied independently? Does it depend on other changes? Does it break the build alone?
|
|
14
|
+
3. **Verify correctness** — Is this change logically complete? Does it mix concerns? Should it be split further?
|
|
15
|
+
|
|
16
|
+
**Synthesize commit strategy:**
|
|
17
|
+
- Group changes by logical concern (one commit = one idea)
|
|
18
|
+
- Order commits so each builds successfully
|
|
19
|
+
- Write clear commit messages that explain WHY, not just WHAT
|
|
20
|
+
- Ensure each commit is self-contained and reviewable
|
|
21
|
+
|
|
22
|
+
## Gathering Current State
|
|
23
|
+
|
|
7
24
|
First, gather the current state:
|
|
8
25
|
|
|
9
26
|
1. Run `git status` to see what changed
|
|
@@ -13,6 +13,21 @@ Capture implementation decisions before planning a phase.
|
|
|
13
13
|
|
|
14
14
|
Phase: $1
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before questioning, decompose this phase scope into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
**For each implementation decision:**
|
|
21
|
+
1. **State the logical component** — What gray area exists? What choice needs to be made? Why does this matter?
|
|
22
|
+
2. **Validate independence** — Can this decision be made independently, or does it depend on other choices? What downstream impacts does it have?
|
|
23
|
+
3. **Verify correctness** — What criteria determine the right answer? What trade-offs exist? What domain terms need clarification?
|
|
24
|
+
|
|
25
|
+
**Synthesize discussion strategy:**
|
|
26
|
+
- Identify critical decisions that block planning
|
|
27
|
+
- Group related decisions (e.g., all API decisions together)
|
|
28
|
+
- Sequence questions from foundational to detailed
|
|
29
|
+
- Ensure domain language is established first
|
|
30
|
+
|
|
16
31
|
## Steps
|
|
17
32
|
1. Run `draht-tools phase-info $1` to load phase context
|
|
18
33
|
2. Identify gray areas based on what's being built
|
|
@@ -14,6 +14,20 @@ Execute all plans in a phase with atomic commits, parallelizing independent plan
|
|
|
14
14
|
Phase: $1
|
|
15
15
|
Arguments: $ARGUMENTS
|
|
16
16
|
|
|
17
|
+
## Atomic Reasoning
|
|
18
|
+
|
|
19
|
+
Before executing, decompose this phase execution into atomic reasoning units:
|
|
20
|
+
|
|
21
|
+
**For each plan in the phase:**
|
|
22
|
+
1. **State the logical component** — What is this plan's singular purpose? What observable outcome does it produce?
|
|
23
|
+
2. **Validate independence** — Can this plan execute in parallel with others, or does it depend on their outputs? Which files does it touch?
|
|
24
|
+
3. **Verify correctness** — What tests will prove this plan works? What failure modes exist?
|
|
25
|
+
|
|
26
|
+
**Synthesize execution strategy:**
|
|
27
|
+
- Identify parallel execution groups (plans with no shared files/dependencies)
|
|
28
|
+
- Order dependent plans (plan B depends on plan A's outputs)
|
|
29
|
+
- Map each plan to a subagent task with clear success criteria
|
|
30
|
+
|
|
17
31
|
## Steps
|
|
18
32
|
1. Run `draht-tools discover-plans $1` to find and order plans
|
|
19
33
|
2. Read each plan file yourself (from `.planning/phases/`) and analyze dependencies to identify which plans can run in parallel vs sequential
|
|
@@ -13,6 +13,20 @@ Diagnose and fix a specific bug or failing task with TDD discipline, using a sub
|
|
|
13
13
|
|
|
14
14
|
Issue: $ARGUMENTS
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before diagnosing, decompose this bug into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
1. **State the logical component** — What is the observed failure? What should happen vs what actually happens?
|
|
21
|
+
2. **Validate independence** — Which components/files are involved? Can we isolate the failure? Are there related bugs that should be fixed separately?
|
|
22
|
+
3. **Verify correctness** — What test will reproduce this bug reliably? What would prove it's fixed? What regressions could the fix introduce?
|
|
23
|
+
|
|
24
|
+
**Synthesize fix strategy:**
|
|
25
|
+
- Trace the failure to root cause
|
|
26
|
+
- Write a minimal reproducing test
|
|
27
|
+
- Identify the smallest change that makes the test pass
|
|
28
|
+
- Plan regression checks
|
|
29
|
+
|
|
16
30
|
## Steps
|
|
17
31
|
1. **Diagnose via subagent**: Use the `subagent` tool in **single mode** with the `debugger` agent:
|
|
18
32
|
"Diagnose this issue: $ARGUMENTS. Reproduce the bug by running the relevant test or command. Trace the root cause by reading the code. Identify the exact files and lines involved. Do NOT fix it yet — only report the diagnosis with: root cause, affected files, and a recommended fix approach. Do NOT run draht, draht-tools, or pi commands."
|
|
@@ -16,6 +16,22 @@ Focus: $ARGUMENTS
|
|
|
16
16
|
Use this when you have an existing codebase and want to add structured planning.
|
|
17
17
|
For greenfield projects, use `/new-project` instead.
|
|
18
18
|
|
|
19
|
+
## Atomic Reasoning
|
|
20
|
+
|
|
21
|
+
Before initializing, decompose project understanding into atomic reasoning units:
|
|
22
|
+
|
|
23
|
+
**For each aspect of the existing project:**
|
|
24
|
+
1. **State the logical component** — What does this project do? Who are the users? What problems does it solve?
|
|
25
|
+
2. **Validate independence** — What bounded contexts exist in the code? What domain concepts are already present? Can they be separated cleanly?
|
|
26
|
+
3. **Verify correctness** — What works well that we must preserve? What pain points exist? What constraints limit changes?
|
|
27
|
+
|
|
28
|
+
**Synthesize initialization strategy:**
|
|
29
|
+
- Map existing architecture and conventions
|
|
30
|
+
- Extract domain model from code (bounded contexts, aggregates, ubiquitous language)
|
|
31
|
+
- Identify test strategy and coverage
|
|
32
|
+
- Define requirements that align with existing structure
|
|
33
|
+
- Create roadmap that respects what already works
|
|
34
|
+
|
|
19
35
|
## Steps
|
|
20
36
|
1. Run `draht-tools init` to check preconditions (git repo, etc.)
|
|
21
37
|
2. Run `draht-tools map-codebase` to build a structural map of the existing code
|
|
@@ -13,6 +13,22 @@ Analyze existing codebase before planning, using subagents for parallel analysis
|
|
|
13
13
|
|
|
14
14
|
Directory: $1
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before analyzing, decompose codebase understanding into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
**For each architectural layer:**
|
|
21
|
+
1. **State the logical component** — What is this directory/module's responsibility? What concepts does it encapsulate?
|
|
22
|
+
2. **Validate independence** — Is this a bounded context? What are its dependencies? Does it leak abstractions across boundaries?
|
|
23
|
+
3. **Verify correctness** — What domain terms appear in code? What aggregates exist? What test infrastructure is present?
|
|
24
|
+
|
|
25
|
+
**Synthesize analysis strategy:**
|
|
26
|
+
- Map directory structure to bounded contexts
|
|
27
|
+
- Extract domain language from identifiers (classes, functions, types)
|
|
28
|
+
- Identify context relationships (upstream/downstream, shared kernel)
|
|
29
|
+
- Document test strategy and coverage
|
|
30
|
+
- Note architectural concerns and patterns
|
|
31
|
+
|
|
16
32
|
## Steps
|
|
17
33
|
1. Run `draht-tools map-codebase $1`
|
|
18
34
|
2. Tool generates: STACK.md, ARCHITECTURE.md, CONVENTIONS.md, CONCERNS.md
|
|
@@ -13,6 +13,22 @@ Initialize a new project: questioning → research → requirements → roadmap.
|
|
|
13
13
|
|
|
14
14
|
Description: $ARGUMENTS
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before questioning, decompose project vision into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
**For each aspect of the new project:**
|
|
21
|
+
1. **State the logical component** — What problem does this solve? Who are the users? What is core vs peripheral?
|
|
22
|
+
2. **Validate independence** — What bounded contexts will exist? What domain concepts are central? Can features be built independently?
|
|
23
|
+
3. **Verify correctness** — What defines MVP success? What constraints exist (time, tech, team)? What is explicitly out of scope?
|
|
24
|
+
|
|
25
|
+
**Synthesize project strategy:**
|
|
26
|
+
- Define bounded contexts and ubiquitous language upfront
|
|
27
|
+
- Establish test strategy before writing code
|
|
28
|
+
- Create requirements mapped to domain contexts
|
|
29
|
+
- Build roadmap with testable phase goals
|
|
30
|
+
- Ensure each phase delivers verifiable user value
|
|
31
|
+
|
|
16
32
|
## Steps
|
|
17
33
|
1. Run `draht-tools init` to check preconditions
|
|
18
34
|
2. If existing code detected, run `draht-tools map-codebase` first
|
|
@@ -11,6 +11,22 @@ Plan the next milestone after ALL phases in the current one are complete.
|
|
|
11
11
|
/next-milestone
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Atomic Reasoning
|
|
15
|
+
|
|
16
|
+
Before planning the next milestone, decompose progress into atomic reasoning units:
|
|
17
|
+
|
|
18
|
+
**For each completed phase:**
|
|
19
|
+
1. **State the logical component** — What was built? What user value was delivered? What requirements were satisfied?
|
|
20
|
+
2. **Validate independence** — What worked well? What had issues? What assumptions proved wrong?
|
|
21
|
+
3. **Verify correctness** — What tests passed? What domain model evolved? What new knowledge emerged?
|
|
22
|
+
|
|
23
|
+
**Synthesize next milestone:**
|
|
24
|
+
- Assess which v1 requirements remain vs are complete
|
|
25
|
+
- Identify requirements that should be promoted or descoped based on learning
|
|
26
|
+
- Define 3-5 new phases with clear, testable goals
|
|
27
|
+
- Order phases by dependency and risk
|
|
28
|
+
- Map each phase to specific requirements and domain contexts
|
|
29
|
+
|
|
14
30
|
## Prerequisites
|
|
15
31
|
- `.planning/ROADMAP.md` must exist
|
|
16
32
|
- ALL phases in the current milestone must be complete (verified via /verify-work)
|
|
@@ -11,6 +11,19 @@ Create a handoff document for session continuity.
|
|
|
11
11
|
/pause-work
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Atomic Reasoning
|
|
15
|
+
|
|
16
|
+
Before pausing, decompose session state into atomic reasoning units:
|
|
17
|
+
|
|
18
|
+
1. **State the logical component** — What was accomplished this session? What is in-progress? What is the current phase/task?
|
|
19
|
+
2. **Validate independence** — Are there uncommitted changes? Are there blockers? What decisions were made?
|
|
20
|
+
3. **Verify correctness** — Is the current state stable? Can work resume cleanly? What context needs to be captured?
|
|
21
|
+
|
|
22
|
+
**Synthesize handoff document:**
|
|
23
|
+
- Capture current phase and status
|
|
24
|
+
- Document decisions and blockers
|
|
25
|
+
- Note next steps for resumption
|
|
26
|
+
|
|
14
27
|
## Steps
|
|
15
28
|
1. Run `draht-tools pause` — creates CONTINUE-HERE.md
|
|
16
29
|
2. Commit: `draht-tools commit-docs "pause work"`
|
|
@@ -13,6 +13,21 @@ Create atomic execution plans for a roadmap phase, using subagents for parallel
|
|
|
13
13
|
|
|
14
14
|
Phase: $1
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before creating plans, decompose this phase goal into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
**For each observable truth (user-visible outcome):**
|
|
21
|
+
1. **State the logical component** — What must be true for the user? What can they do/see/verify?
|
|
22
|
+
2. **Validate independence** — Which artifacts (files, endpoints, schemas) prove this truth exists? Can it be built independently?
|
|
23
|
+
3. **Verify correctness** — What test scenarios would prove this observable truth? What are the specific inputs → expected outputs?
|
|
24
|
+
|
|
25
|
+
**Synthesize planning strategy:**
|
|
26
|
+
- Group related observable truths into cohesive plans (2-5 tasks each)
|
|
27
|
+
- Identify which plans can be created in parallel vs sequentially
|
|
28
|
+
- Map each plan to specific bounded contexts and domain concepts
|
|
29
|
+
- Ensure each plan produces testable, verifiable outcomes
|
|
30
|
+
|
|
16
31
|
## Steps
|
|
17
32
|
1. Run `draht-tools load-phase-context $1` to gather all context
|
|
18
33
|
2. Optional: `draht-tools research-phase $1` for domain research
|
|
@@ -11,6 +11,19 @@ Show current project status.
|
|
|
11
11
|
/progress
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Atomic Reasoning
|
|
15
|
+
|
|
16
|
+
Before checking progress, decompose project state into atomic reasoning units:
|
|
17
|
+
|
|
18
|
+
1. **State the logical component** — What milestone are we in? What phase is active? What work is complete vs in-progress?
|
|
19
|
+
2. **Validate independence** — Are there blockers? Are phases in the correct sequence? Is anything waiting on external input?
|
|
20
|
+
3. **Verify correctness** — Does the reported state match reality? Are all verified phases truly complete? Are there unreported issues?
|
|
21
|
+
|
|
22
|
+
**Synthesize status understanding:**
|
|
23
|
+
- Identify where we are in the roadmap
|
|
24
|
+
- Assess momentum and blockers
|
|
25
|
+
- Determine next action
|
|
26
|
+
|
|
14
27
|
## Steps
|
|
15
28
|
1. Run `draht-tools progress` — outputs formatted status
|
|
16
29
|
2. Display the result as-is
|
|
@@ -13,6 +13,20 @@ Execute a small ad-hoc task with tracking.
|
|
|
13
13
|
|
|
14
14
|
Task: $ARGUMENTS
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before executing, decompose this task into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
1. **State the logical component** — What is the single, concrete outcome? What files need to change? What behavior needs to work?
|
|
21
|
+
2. **Validate independence** — Can this be done without touching other features? What dependencies exist? What could break?
|
|
22
|
+
3. **Verify correctness** — What test proves this works? What edge cases matter? Is this testable behavior or pure config?
|
|
23
|
+
|
|
24
|
+
**Synthesize execution plan:**
|
|
25
|
+
- Define specific files to modify
|
|
26
|
+
- Write failing test (if testable behavior)
|
|
27
|
+
- Implement minimal solution
|
|
28
|
+
- Verify and document
|
|
29
|
+
|
|
16
30
|
## Steps
|
|
17
31
|
1. Run `draht-tools next-quick-number` to get task number
|
|
18
32
|
2. Analyze the task and write a concrete plan with actual task details (files, actions, verification). Pipe it into `draht-tools create-quick-plan`:
|
|
@@ -11,6 +11,19 @@ Resume from last session state.
|
|
|
11
11
|
/resume-work
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## Atomic Reasoning
|
|
15
|
+
|
|
16
|
+
Before resuming, decompose handoff context into atomic reasoning units:
|
|
17
|
+
|
|
18
|
+
1. **State the logical component** — What phase/task was active? What was the last accomplishment? What decisions were made?
|
|
19
|
+
2. **Validate independence** — Are there blockers? What changed since the pause? Is the codebase in the expected state?
|
|
20
|
+
3. **Verify correctness** — Is the handoff document complete? Does the current state match what was documented? Can work continue safely?
|
|
21
|
+
|
|
22
|
+
**Synthesize resumption plan:**
|
|
23
|
+
- Understand current context
|
|
24
|
+
- Identify next action
|
|
25
|
+
- Confirm no conflicts or state drift
|
|
26
|
+
|
|
14
27
|
## Steps
|
|
15
28
|
1. Run `draht-tools resume` — loads CONTINUE-HERE.md or STATE.md
|
|
16
29
|
2. Display context and ask to continue
|
|
@@ -15,6 +15,21 @@ Scope: $ARGUMENTS
|
|
|
15
15
|
|
|
16
16
|
If no scope given, reviews all recent uncommitted changes.
|
|
17
17
|
|
|
18
|
+
## Atomic Reasoning
|
|
19
|
+
|
|
20
|
+
Before reviewing, decompose code changes into atomic reasoning units:
|
|
21
|
+
|
|
22
|
+
**For each changed file:**
|
|
23
|
+
1. **State the logical component** — What does this change do? What problem does it solve? What behavior does it add/modify?
|
|
24
|
+
2. **Validate independence** — Does this change have side effects? Does it affect other modules? Are there hidden dependencies?
|
|
25
|
+
3. **Verify correctness** — Is this change correct? Type-safe? Secure? Does it follow conventions? What could go wrong?
|
|
26
|
+
|
|
27
|
+
**Synthesize review strategy:**
|
|
28
|
+
- Group changes by concern (correctness, security, style)
|
|
29
|
+
- Prioritize findings (critical, important, minor)
|
|
30
|
+
- Identify patterns across multiple files
|
|
31
|
+
- Check domain language compliance and bounded context boundaries
|
|
32
|
+
|
|
18
33
|
## Steps
|
|
19
34
|
1. Identify the scope:
|
|
20
35
|
- If argument given: use those files/directories/description as scope
|
|
@@ -13,6 +13,21 @@ Walk through acceptance testing of completed phase work, using subagents for par
|
|
|
13
13
|
|
|
14
14
|
Phase: $1
|
|
15
15
|
|
|
16
|
+
## Atomic Reasoning
|
|
17
|
+
|
|
18
|
+
Before verifying, decompose phase acceptance into atomic reasoning units:
|
|
19
|
+
|
|
20
|
+
**For each deliverable:**
|
|
21
|
+
1. **State the logical component** — What was this deliverable meant to produce? What user value does it provide?
|
|
22
|
+
2. **Validate independence** — Can this deliverable be tested independently? What are its dependencies?
|
|
23
|
+
3. **Verify correctness** — What tests prove it works? What edge cases must pass? What security concerns exist?
|
|
24
|
+
|
|
25
|
+
**Synthesize verification strategy:**
|
|
26
|
+
- Group parallel verification tasks (test suite, security audit, code review, domain compliance)
|
|
27
|
+
- Map each deliverable to specific test scenarios and acceptance criteria
|
|
28
|
+
- Identify critical vs optional checks
|
|
29
|
+
- Plan fix strategies for potential failures
|
|
30
|
+
|
|
16
31
|
## Steps
|
|
17
32
|
1. Run `draht-tools extract-deliverables $1` to get testable items
|
|
18
33
|
2. **Run parallel verification via subagents:**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the value is NOT a package source (npm:, git:, etc.)
|
|
3
|
+
* or a URL protocol. Bare names and relative paths without ./ prefix
|
|
4
|
+
* are considered local.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isLocalPath(value: string): boolean;
|
|
7
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAclD","sourcesContent":["/**\n * Returns true if the value is NOT a package source (npm:, git:, etc.)\n * or a URL protocol. Bare names and relative paths without ./ prefix\n * are considered local.\n */\nexport function isLocalPath(value: string): boolean {\n\tconst trimmed = value.trim();\n\t// Known non-local prefixes\n\tif (\n\t\ttrimmed.startsWith(\"npm:\") ||\n\t\ttrimmed.startsWith(\"git:\") ||\n\t\ttrimmed.startsWith(\"github:\") ||\n\t\ttrimmed.startsWith(\"http:\") ||\n\t\ttrimmed.startsWith(\"https:\") ||\n\t\ttrimmed.startsWith(\"ssh:\")\n\t) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the value is NOT a package source (npm:, git:, etc.)
|
|
3
|
+
* or a URL protocol. Bare names and relative paths without ./ prefix
|
|
4
|
+
* are considered local.
|
|
5
|
+
*/
|
|
6
|
+
export function isLocalPath(value) {
|
|
7
|
+
const trimmed = value.trim();
|
|
8
|
+
// Known non-local prefixes
|
|
9
|
+
if (trimmed.startsWith("npm:") ||
|
|
10
|
+
trimmed.startsWith("git:") ||
|
|
11
|
+
trimmed.startsWith("github:") ||
|
|
12
|
+
trimmed.startsWith("http:") ||
|
|
13
|
+
trimmed.startsWith("https:") ||
|
|
14
|
+
trimmed.startsWith("ssh:")) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,KAAa,EAAW;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,2BAA2B;IAC3B,IACC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;QAC1B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;QAC1B,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;QAC7B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;QAC3B,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC5B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EACzB,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AAAA,CACZ","sourcesContent":["/**\n * Returns true if the value is NOT a package source (npm:, git:, etc.)\n * or a URL protocol. Bare names and relative paths without ./ prefix\n * are considered local.\n */\nexport function isLocalPath(value: string): boolean {\n\tconst trimmed = value.trim();\n\t// Known non-local prefixes\n\tif (\n\t\ttrimmed.startsWith(\"npm:\") ||\n\t\ttrimmed.startsWith(\"git:\") ||\n\t\ttrimmed.startsWith(\"github:\") ||\n\t\ttrimmed.startsWith(\"http:\") ||\n\t\ttrimmed.startsWith(\"https:\") ||\n\t\ttrimmed.startsWith(\"ssh:\")\n\t) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n"]}
|