@ksuchoi216/ahe 0.1.6 → 0.1.7
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/.codex/hooks/ahe-hook.js +162 -203
- package/.codex/skills/ahe-compression/SKILL.md +8 -8
- package/.codex/skills/ahe-conversator/SKILL.md +44 -0
- package/.codex/skills/ahe-harness/SKILL.md +115 -0
- package/.codex/skills/ahe-init/SKILL.md +16 -23
- package/.codex/skills/ahe-reviewer/SKILL.md +35 -0
- package/.codex/skills/ahe-solver/SKILL.md +24 -0
- package/.codex/skills/ahe-thinker/SKILL.md +80 -0
- package/README.md +30 -205
- package/bin/ahe +6 -4
- package/package.json +3 -2
- package/.codex/skills/ahe-conversation/SKILL.md +0 -73
- package/.codex/skills/ahe-spec/SKILL.md +0 -63
- package/.codex/skills/ahe-thinking/SKILL.md +0 -104
- package/.codex/skills/ahe-update/SKILL.md +0 -66
package/.codex/hooks/ahe-hook.js
CHANGED
|
@@ -1,236 +1,195 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const AHE_DIRECTIVE_MARKER = "<ahe-mode>";
|
|
3
|
+
|
|
4
|
+
const STATUS_TABLE_LINES = [
|
|
5
|
+
" - Start the response with a concise status report table.",
|
|
6
|
+
" - Use this consistent Markdown table format:",
|
|
7
|
+
" | Item | Content |",
|
|
8
|
+
" |---|---|",
|
|
9
|
+
" | AGENTS.md | Exists/missing, purpose status, and any obvious issue. |",
|
|
10
|
+
" | PRODUCT.md | Exists/missing, completion state, and whether product scope needs work. |",
|
|
11
|
+
" | INSTRUCTIONS.md | Exists/missing, and whether instruction boundaries need work. |",
|
|
12
|
+
" | feature-list.json | Valid/missing/invalid, unfinished feature summary, and all-done status. |",
|
|
13
|
+
" | PROGRESS.md | Exists/missing and current session state. |",
|
|
14
|
+
" - Keep the table short and readable.",
|
|
15
|
+
" - Do not include the next step inside the table.",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const COMMON_ROUTING_LINES = [
|
|
19
|
+
"1. Run CodeGraph preflight before inspecting harness status:",
|
|
20
|
+
" - Check whether the CodeGraph CLI is installed with `command -v codegraph`.",
|
|
21
|
+
" - If the `codegraph` command is not installed, report `NOT INSTALLATION of codegraph`, skip `codegraph init` and `codegraph sync`, and continue with normal repo inspection.",
|
|
22
|
+
" - If `.codegraph/` does not exist, run `codegraph init` before reviewing code.",
|
|
23
|
+
" - If `.codegraph/` exists, run `codegraph sync` before reviewing code.",
|
|
24
|
+
"",
|
|
25
|
+
"2. Inspect current harness state before choosing a workflow:",
|
|
26
|
+
" - Check `AGENTS.md`.",
|
|
27
|
+
" - Check `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` as the product/specification source of truth.",
|
|
28
|
+
" - Check `feature-list.json` as a derived tracker.",
|
|
29
|
+
" - Check `PROGRESS.md`.",
|
|
30
|
+
" - Use `ahe-thinker` as the internal decision layer before choosing the next action.",
|
|
31
|
+
" - Before reading large harness files wholesale, let `ahe-thinker` run the `ahe-compression` size detector and call `ahe-compression` if compression is required.",
|
|
32
|
+
"",
|
|
33
|
+
"3. Review code through CodeGraph when available:",
|
|
34
|
+
" - Prefer CodeGraph MCP or CodeGraph exploration for code review and impact context after the preflight command succeeds.",
|
|
35
|
+
" - If CodeGraph is not installed, skip CodeGraph review and rely on normal repo inspection.",
|
|
36
|
+
"",
|
|
37
|
+
"4. Make the first response a simple harness engineering status report table before proceeding:",
|
|
38
|
+
...STATUS_TABLE_LINES,
|
|
39
|
+
];
|
|
40
|
+
|
|
3
41
|
const AHE_PROGRESS_DIRECTIVE = [
|
|
42
|
+
AHE_DIRECTIVE_MARKER,
|
|
43
|
+
"AHE automatic operation activated.",
|
|
44
|
+
"",
|
|
45
|
+
"The user sent the exact AHE command. Operate as the Awesome Harness Engineering router:",
|
|
46
|
+
"",
|
|
47
|
+
...COMMON_ROUTING_LINES,
|
|
48
|
+
"",
|
|
49
|
+
"5. Decide the next AHE workflow with `ahe-thinker`:",
|
|
50
|
+
" - If no harness files exist, route to `$ahe-init`.",
|
|
51
|
+
" - If `docs/PRODUCT.md` or `docs/INSTRUCTIONS.md` is missing or empty, classify the state as `harness engineering not enough`.",
|
|
52
|
+
" - If `feature-list.json` is missing or invalid, generating an empty one from template is allowed, but do not write specific features until `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` are created and organized.",
|
|
53
|
+
" - If any feature in `feature-list.json` has a status other than `done`, classify the state as `in the middle of building features` and continue the first unfinished feature whose dependencies are satisfied.",
|
|
54
|
+
" - If all features are `done` and no obvious harness gap remains, classify the state as `completed all` and ask the user for the next task.",
|
|
55
|
+
" - Call `ahe-reviewer` when repo or code understanding is needed.",
|
|
56
|
+
" - Call `ahe-conversator` when the next safe step is blocked on user input.",
|
|
57
|
+
" - Call `ahe-harness` when product docs, instructions, tracking, todo sync, or compression-aware harness maintenance must change.",
|
|
58
|
+
" - Call `ahe-solver` when the next job is solving or planning a feature.",
|
|
59
|
+
"",
|
|
60
|
+
"6. After the table, classify the harness into exactly one state.",
|
|
61
|
+
" - Use exactly one state: `harness engineering not enough`, `in the middle of building features`, or `completed all`.",
|
|
62
|
+
" - Do not include the next step inside the table.",
|
|
63
|
+
" - Continue automatically after classification.",
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
const AHE_INIT_DIRECTIVE = [
|
|
67
|
+
AHE_DIRECTIVE_MARKER,
|
|
68
|
+
"AHE automatic operation activated.",
|
|
69
|
+
"",
|
|
70
|
+
"The user sent the exact AHE init command. Treat this as a possible new start request:",
|
|
71
|
+
"",
|
|
72
|
+
"1. Route to `$ahe-init` first.",
|
|
73
|
+
"2. If no AHE-managed harness files exist, start initialization normally.",
|
|
74
|
+
"3. If any AHE-managed harness file exists, read the existing files, summarize the current project purpose and product specification state, and ask what restart scope the user wants.",
|
|
75
|
+
"4. Do not remove, overwrite, or refresh existing harness files before the user answers the restart-scope question.",
|
|
76
|
+
"5. If the chosen restart scope replaces prior harness history, summarize that replaced state in the refreshed tracking artifacts instead of creating backup copies.",
|
|
77
|
+
"6. Interpret the restart scope from the user's free-form answer; examples like `purpose` and `product` are not a closed list.",
|
|
78
|
+
"7. Product/instructions specification details belong in `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md`, not `AGENTS.md`.",
|
|
79
|
+
"8. After setup, call `ahe-harness` to build the initial product, instructions, and tracking state.",
|
|
80
|
+
"9. Use `ahe-thinker` before clarification when the next setup step is uncertain.",
|
|
81
|
+
"10. If clarification is needed, call `ahe-conversator` for the exact missing detail.",
|
|
82
|
+
].join("\n");
|
|
83
|
+
|
|
84
|
+
function getQueryDirective(prompt) {
|
|
85
|
+
return [
|
|
4
86
|
AHE_DIRECTIVE_MARKER,
|
|
5
87
|
"AHE automatic operation activated.",
|
|
6
88
|
"",
|
|
7
|
-
|
|
8
|
-
"",
|
|
9
|
-
"1. Run CodeGraph preflight before inspecting harness status:",
|
|
10
|
-
" - Check whether the CodeGraph CLI is installed with `command -v codegraph`.",
|
|
11
|
-
" - If the `codegraph` command is not installed, report `NOT INSTALLATION of codegraph`, skip `codegraph init` and `codegraph sync`, and continue with normal repo inspection.",
|
|
12
|
-
" - If `.codegraph/` does not exist, run `codegraph init` before reviewing code.",
|
|
13
|
-
" - If `.codegraph/` exists, run `codegraph sync` before reviewing code.",
|
|
89
|
+
`Original prompt: "${prompt}"`,
|
|
14
90
|
"",
|
|
15
|
-
"
|
|
16
|
-
" - Check `AGENTS.md`.",
|
|
17
|
-
" - Check `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` as the product/specification source of truth.",
|
|
18
|
-
" - Check `feature-list.json` as a derived tracker.",
|
|
19
|
-
" - Check `PROGRESS.md`.",
|
|
20
|
-
" - Use `ahe-thinking` as the internal decision layer before choosing the next action.",
|
|
21
|
-
" - Before reading large harness files wholesale, let `ahe-thinking` run the `ahe-compression` size detector and call `ahe-compression` if compression is required.",
|
|
91
|
+
"The user sent an explicit AHE query. Route it through `ahe-thinker`:",
|
|
22
92
|
"",
|
|
23
|
-
|
|
24
|
-
" - Prefer CodeGraph MCP or CodeGraph exploration for code review and impact context after the preflight command succeeds.",
|
|
25
|
-
" - If CodeGraph is not installed, skip CodeGraph review and rely on normal repo inspection.",
|
|
93
|
+
...COMMON_ROUTING_LINES,
|
|
26
94
|
"",
|
|
27
|
-
"
|
|
28
|
-
" -
|
|
29
|
-
" - Use
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
" | INSTRUCTIONS.md | Exists/missing, and whether instruction boundaries need work. |",
|
|
35
|
-
" | feature-list.json | Valid/missing/invalid, unfinished feature summary, and all-done status. |",
|
|
36
|
-
" | PROGRESS.md | Exists/missing and current session state. |",
|
|
37
|
-
" - Keep the table short and readable.",
|
|
38
|
-
" - Do not include the next step inside the table.",
|
|
39
|
-
"",
|
|
40
|
-
"5. Decide the next AHE workflow with `ahe-thinking`:",
|
|
41
|
-
" - If no harness files exist, route to `$ahe-init`.",
|
|
42
|
-
" - If `docs/PRODUCT.md` or `docs/INSTRUCTIONS.md` is missing or empty, classify the state as `harness engineering not enough` and prioritize product/instructions specification.",
|
|
43
|
-
" - If `feature-list.json` is missing or invalid, generating an empty one from template is allowed, but do not write specific features until `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` are created and organized.",
|
|
44
|
-
" - If any feature in `feature-list.json` has a status other than `done`, classify the state as `in the middle of building features` and continue the first unfinished feature whose dependencies are satisfied.",
|
|
45
|
-
" - Respect dependencies listed in `feature-list.json`; do not start a dependent feature before prerequisites are done.",
|
|
46
|
-
" - If all features are `done` and no obvious harness gap remains, classify the state as `completed all` and ask the user for the next task.",
|
|
47
|
-
" - Judge the active `project`, `feature`, or `sub-feature` before moving forward.",
|
|
48
|
-
" - For a `project`, require `Why`, `What`, and `How` by default.",
|
|
49
|
-
" - For a `feature` or `sub-feature`, require only the minimum of `Why`, `What`, and `How` needed to proceed safely.",
|
|
95
|
+
"5. Decide the next AHE workflow with `ahe-thinker` based on the original prompt:",
|
|
96
|
+
" - Use `ahe-reviewer` for code or harness review work.",
|
|
97
|
+
" - Use `ahe-harness` for product, instructions, progress, feature-list, todo, or compression maintenance.",
|
|
98
|
+
" - For `ahe compress feature-list`, replace old completed feature entries with one summarized done feature, preserve unfinished details, and reconcile `feature-list.json` against `docs/PRODUCT.md`.",
|
|
99
|
+
" - If no new feature can be derived from `docs/PRODUCT.md`, call `ahe-conversator` to ask what next feature, product direction, or goal should be tracked.",
|
|
100
|
+
" - Use `ahe-solver` for feature-solving work.",
|
|
101
|
+
" - If multiple plausible next steps remain, use `ahe-conversator` to ask the minimum question needed.",
|
|
50
102
|
"",
|
|
51
|
-
"6.
|
|
52
|
-
" - If multiple plausible next steps exist, feature data conflicts, dependencies are unclear, or CodeGraph review points to several valid directions, use `ahe-thinking` to judge the missing detail.",
|
|
53
|
-
" - If clarity is missing, call `ahe-conversation` for the exact missing `Why`, `What`, or `How`.",
|
|
54
|
-
" - Continue only after one safe next step is clear.",
|
|
55
|
-
"",
|
|
56
|
-
"7. After the table, classify the harness into exactly one state.",
|
|
103
|
+
"6. After the table, classify the harness into exactly one state.",
|
|
57
104
|
" - Use exactly one state: `harness engineering not enough`, `in the middle of building features`, or `completed all`.",
|
|
58
105
|
" - Do not include the next step inside the table.",
|
|
59
106
|
" - Continue automatically after classification.",
|
|
60
|
-
|
|
61
|
-
|
|
107
|
+
].join("\n");
|
|
108
|
+
}
|
|
62
109
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"",
|
|
67
|
-
"The user sent the exact AHE init command. Treat this as a possible new start request:",
|
|
68
|
-
"",
|
|
69
|
-
"1. Route to `$ahe-init` first.",
|
|
70
|
-
"2. If no AHE-managed harness files exist, start initialization normally.",
|
|
71
|
-
"3. If any AHE-managed harness file exists, read the existing files, summarize the current project purpose and product specification state, and ask what restart scope the user wants.",
|
|
72
|
-
"4. Do not back up, remove, overwrite, or refresh existing harness files before the user answers the restart-scope question.",
|
|
73
|
-
"5. Interpret the restart scope from the user's free-form answer; examples like `purpose` and `product` are not a closed list.",
|
|
74
|
-
"6. Product/instructions specification details belong in `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md`, not `AGENTS.md`.",
|
|
75
|
-
"7. Use `ahe-thinking` before clarification when the next setup step is uncertain.",
|
|
76
|
-
"8. If clarification is needed, call `ahe-conversation` for the exact missing detail.",
|
|
77
|
-
"9. Continue through initialization work until the new start path is clear.",
|
|
78
|
-
].join("\\n");
|
|
110
|
+
function normalizePrompt(prompt) {
|
|
111
|
+
return prompt.trim().toLowerCase();
|
|
112
|
+
}
|
|
79
113
|
|
|
80
114
|
function isExactAheCommand(prompt) {
|
|
81
|
-
|
|
115
|
+
return normalizePrompt(prompt) === "ahe";
|
|
82
116
|
}
|
|
83
117
|
|
|
84
118
|
function isExactAheInitCommand(prompt) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
119
|
+
const normalizedPrompt = normalizePrompt(prompt);
|
|
120
|
+
return (
|
|
121
|
+
normalizedPrompt === "ahe init" ||
|
|
122
|
+
normalizedPrompt === "ahe-init" ||
|
|
123
|
+
normalizedPrompt === "$ahe-init"
|
|
124
|
+
);
|
|
91
125
|
}
|
|
92
126
|
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const hasAction = /(add|new|update|change|track|manage)/.test(p);
|
|
101
|
-
const hasTarget = /(product|feature|instruction|requirement|spec|work|todo)/.test(p);
|
|
102
|
-
|
|
103
|
-
if (!(hasAction && hasTarget)) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const falsePositives = [
|
|
108
|
-
/what is/,
|
|
109
|
-
/explain/,
|
|
110
|
-
/how to/,
|
|
111
|
-
/how do/,
|
|
112
|
-
/file/,
|
|
113
|
-
/error/,
|
|
114
|
-
/issue/
|
|
115
|
-
];
|
|
116
|
-
|
|
117
|
-
for (const fp of falsePositives) {
|
|
118
|
-
if (fp.test(p)) return false;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return true;
|
|
127
|
+
function isExplicitAheQuery(prompt) {
|
|
128
|
+
const normalizedPrompt = normalizePrompt(prompt);
|
|
129
|
+
if (isExactAheCommand(prompt) || isExactAheInitCommand(prompt)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return normalizedPrompt.startsWith("ahe ");
|
|
122
133
|
}
|
|
123
134
|
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"",
|
|
131
|
-
"The user provided a broad natural-language AHE work intent.",
|
|
132
|
-
"Operate as the Awesome Harness Engineering router with an adaptive workflow:",
|
|
133
|
-
"",
|
|
134
|
-
"1. Run CodeGraph preflight before inspecting harness status:",
|
|
135
|
-
" - Check whether the CodeGraph CLI is installed with `command -v codegraph`.",
|
|
136
|
-
" - If the `codegraph` command is not installed, report `NOT INSTALLATION of codegraph`, skip `codegraph init` and `codegraph sync`, and continue with normal repo inspection.",
|
|
137
|
-
" - If `.codegraph/` does not exist, run `codegraph init` before reviewing code.",
|
|
138
|
-
" - If `.codegraph/` exists, run `codegraph sync` before reviewing code.",
|
|
139
|
-
"",
|
|
140
|
-
"2. Inspect current harness state before choosing a workflow:",
|
|
141
|
-
" - Check `AGENTS.md`.",
|
|
142
|
-
" - Check `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` as the product/specification source of truth.",
|
|
143
|
-
" - Check `feature-list.json` as a derived tracker.",
|
|
144
|
-
" - Check `PROGRESS.md`.",
|
|
145
|
-
" - Use `ahe-thinking` as the internal decision layer before choosing the next action.",
|
|
146
|
-
" - Before reading large harness files wholesale, let `ahe-thinking` run the `ahe-compression` size detector and call `ahe-compression` if compression is required.",
|
|
147
|
-
"",
|
|
148
|
-
"3. Review code through CodeGraph when available.",
|
|
149
|
-
"",
|
|
150
|
-
"4. Make the first response a simple harness engineering status report table before proceeding:",
|
|
151
|
-
" - Start the response with a concise status report table.",
|
|
152
|
-
" - Use this consistent Markdown table format:",
|
|
153
|
-
" | Item | Content |",
|
|
154
|
-
" |---|---|",
|
|
155
|
-
" | AGENTS.md | Exists/missing, purpose status, and any obvious issue. |",
|
|
156
|
-
" | PRODUCT.md | Exists/missing, completion state, and whether product scope needs work. |",
|
|
157
|
-
" | INSTRUCTIONS.md | Exists/missing, and whether instruction boundaries need work. |",
|
|
158
|
-
" | feature-list.json | Valid/missing/invalid, unfinished feature summary, and all-done status. |",
|
|
159
|
-
" | PROGRESS.md | Exists/missing and current session state. |",
|
|
160
|
-
" - Keep the table short and readable.",
|
|
161
|
-
" - Do not include the next step inside the table.",
|
|
162
|
-
"",
|
|
163
|
-
"5. Decide the next AHE workflow with `ahe-thinking` based on the original prompt:",
|
|
164
|
-
" - Classify the user intent from the original prompt as: `product/spec changes`, `instruction changes`, `feature/todo tracking`, or `unclear AHE work`.",
|
|
165
|
-
" - Route product/spec changes to `ahe-spec`.",
|
|
166
|
-
" - Route instruction changes to `ahe-spec`, and create `docs/INSTRUCTIONS.md` from the template when needed.",
|
|
167
|
-
" - Route feature/todo tracking to `ahe-update`.",
|
|
168
|
-
" - Route unclear AHE work to `ahe-conversation`.",
|
|
169
|
-
"",
|
|
170
|
-
"6. Ask for clarification instead of guessing:",
|
|
171
|
-
" - If the request is vague, ask exactly one detail question before editing.",
|
|
172
|
-
" - Call `ahe-conversation` for missing `Why`, `What`, or `How`.",
|
|
173
|
-
" - Continue only after one safe next step is clear.",
|
|
174
|
-
"",
|
|
175
|
-
"7. After the table, classify the harness into exactly one state.",
|
|
176
|
-
" - Use exactly one state: `harness engineering not enough`, `in the middle of building features`, or `completed all`.",
|
|
177
|
-
" - Do not include the next step inside the table.",
|
|
178
|
-
" - Continue automatically after classification.",
|
|
179
|
-
" - Follow this loop: `thinking -> conversation if needed -> execution -> thinking`.",
|
|
180
|
-
].join("\\n");
|
|
181
|
-
}
|
|
135
|
+
async function main() {
|
|
136
|
+
let raw = "";
|
|
137
|
+
process.stdin.setEncoding("utf8");
|
|
138
|
+
for await (const chunk of process.stdin) {
|
|
139
|
+
raw += chunk;
|
|
140
|
+
}
|
|
182
141
|
|
|
183
|
-
|
|
184
|
-
return
|
|
185
|
-
}
|
|
142
|
+
if (!raw.trim()) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
186
145
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
146
|
+
let parsed;
|
|
147
|
+
try {
|
|
148
|
+
parsed = JSON.parse(raw);
|
|
149
|
+
} catch {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
193
152
|
|
|
194
|
-
|
|
153
|
+
if (
|
|
154
|
+
parsed &&
|
|
155
|
+
parsed.hook_event_name === "UserPromptSubmit" &&
|
|
156
|
+
typeof parsed.prompt === "string"
|
|
157
|
+
) {
|
|
158
|
+
if (isExactAheCommand(parsed.prompt)) {
|
|
159
|
+
process.stdout.write(
|
|
160
|
+
JSON.stringify({
|
|
161
|
+
hookSpecificOutput: {
|
|
162
|
+
hookEventName: "UserPromptSubmit",
|
|
163
|
+
additionalContext: AHE_PROGRESS_DIRECTIVE.join("\n"),
|
|
164
|
+
},
|
|
165
|
+
}) + "\n"
|
|
166
|
+
);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
195
169
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
170
|
+
if (isExactAheInitCommand(parsed.prompt)) {
|
|
171
|
+
process.stdout.write(
|
|
172
|
+
JSON.stringify({
|
|
173
|
+
hookSpecificOutput: {
|
|
174
|
+
hookEventName: "UserPromptSubmit",
|
|
175
|
+
additionalContext: AHE_INIT_DIRECTIVE,
|
|
176
|
+
},
|
|
177
|
+
}) + "\n"
|
|
178
|
+
);
|
|
179
|
+
return;
|
|
201
180
|
}
|
|
202
181
|
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
additionalContext: AHE_PROGRESS_DIRECTIVE
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
process.stdout.write(JSON.stringify(output) + "\n");
|
|
216
|
-
} else if (isExactAheInitCommand(parsed.prompt)) {
|
|
217
|
-
const output = {
|
|
218
|
-
hookSpecificOutput: {
|
|
219
|
-
hookEventName: "UserPromptSubmit",
|
|
220
|
-
additionalContext: AHE_INIT_DIRECTIVE
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
process.stdout.write(JSON.stringify(output) + "\n");
|
|
224
|
-
} else if (isBroadAheIntent(parsed.prompt)) {
|
|
225
|
-
const output = {
|
|
226
|
-
hookSpecificOutput: {
|
|
227
|
-
hookEventName: "UserPromptSubmit",
|
|
228
|
-
additionalContext: getAdaptiveDirective(parsed.prompt)
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
process.stdout.write(JSON.stringify(output) + "\n");
|
|
232
|
-
}
|
|
182
|
+
if (isExplicitAheQuery(parsed.prompt)) {
|
|
183
|
+
process.stdout.write(
|
|
184
|
+
JSON.stringify({
|
|
185
|
+
hookSpecificOutput: {
|
|
186
|
+
hookEventName: "UserPromptSubmit",
|
|
187
|
+
additionalContext: getQueryDirective(parsed.prompt),
|
|
188
|
+
},
|
|
189
|
+
}) + "\n"
|
|
190
|
+
);
|
|
233
191
|
}
|
|
192
|
+
}
|
|
234
193
|
}
|
|
235
194
|
|
|
236
195
|
main().catch(() => {});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ahe-compression
|
|
3
|
-
description: Internal AHE compression workflow for detecting oversized harness-engineering files and compacting them before AHE
|
|
3
|
+
description: Internal AHE compression workflow for detecting oversized harness-engineering files and compacting them before AHE thinker or harness routing reads large context. Use when AGENTS.md, docs/PRODUCT.md, docs/INSTRUCTIONS.md, feature-list.json, PROGRESS.md, SESSION-HANDOFF.md, docs/todo.md, or other AHE harness artifacts have too many lines or waste context.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# AHE Compression
|
|
@@ -8,7 +8,7 @@ description: Internal AHE compression workflow for detecting oversized harness-e
|
|
|
8
8
|
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
9
|
|
|
10
10
|
Do not treat `$ahe-compression` as a user command.
|
|
11
|
-
Use it after `ahe-
|
|
11
|
+
Use it after `ahe-thinker` or `ahe-harness` decides that harness context is too large to read
|
|
12
12
|
efficiently.
|
|
13
13
|
|
|
14
14
|
## Size Detection
|
|
@@ -73,9 +73,10 @@ Exit code meanings:
|
|
|
73
73
|
dependencies, and verification evidence.
|
|
74
74
|
- Preserve required headers and file formats for `PROGRESS.md`,
|
|
75
75
|
`SESSION-HANDOFF.md`, `feature-list.json`, and `AGENTS.md`.
|
|
76
|
-
- Keep `feature-list.json` valid JSON.
|
|
77
|
-
|
|
78
|
-
`status`, and current unfinished
|
|
76
|
+
- Keep `feature-list.json` valid JSON. Replace stale completed-feature history
|
|
77
|
+
with one summarized done feature, preserve its `id`, `name`, `description`,
|
|
78
|
+
`dependencies`, `status`, and short evidence, and keep current unfinished
|
|
79
|
+
details as-is.
|
|
79
80
|
- Keep `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` as the current harness
|
|
80
81
|
contract. Remove duplicate historical wording only when the active contract
|
|
81
82
|
remains clear.
|
|
@@ -83,9 +84,8 @@ Exit code meanings:
|
|
|
83
84
|
decisions that still matter, blockers, and latest verification.
|
|
84
85
|
- Keep `SESSION-HANDOFF.md` focused on the startup path for the next session,
|
|
85
86
|
important files, open questions, and current verification status.
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
be useful.
|
|
87
|
+
- Do not create backup copies when compressing harness history. Preserve useful
|
|
88
|
+
context through concise summaries in the refreshed harness files instead.
|
|
89
89
|
|
|
90
90
|
## Completion
|
|
91
91
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-conversator
|
|
3
|
+
description: Internal AHE conversation protocol for recursive clarification, conversation state, and resume-aware workflow guidance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Conversator
|
|
7
|
+
|
|
8
|
+
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-conversator` as a user command.
|
|
11
|
+
Use it after `ahe-thinker` or another AHE agent identifies a missing decision or
|
|
12
|
+
missing `Why`, `What`, or `How`.
|
|
13
|
+
|
|
14
|
+
## When To Converse
|
|
15
|
+
|
|
16
|
+
- Ask one question at a time.
|
|
17
|
+
- Use conversation state when multiple answers are needed across turns.
|
|
18
|
+
- Clarify product intent, instructions, next feature, restart scope, or any
|
|
19
|
+
decision that materially changes the workflow.
|
|
20
|
+
- If the answer can be derived safely from repo state, do that instead of
|
|
21
|
+
asking.
|
|
22
|
+
|
|
23
|
+
## Conversation Protocol
|
|
24
|
+
|
|
25
|
+
- Inspect relevant files before asking.
|
|
26
|
+
- Explain the blocked decision briefly.
|
|
27
|
+
- Use a Codex-supported structured response request when it helps.
|
|
28
|
+
- Ask exactly one focused question at a time.
|
|
29
|
+
- Continue recursively until the answer is specific enough to unblock the
|
|
30
|
+
calling workflow.
|
|
31
|
+
|
|
32
|
+
## State Persistence
|
|
33
|
+
|
|
34
|
+
- Update `.ahe/process_status.json` before pausing for user input.
|
|
35
|
+
- Preserve the current command, current_step, workflow_complete, and files map.
|
|
36
|
+
- Update `PROGRESS.md` and `SESSION-HANDOFF.md` when the pending question
|
|
37
|
+
changes the workflow state.
|
|
38
|
+
|
|
39
|
+
## Resume Protocol
|
|
40
|
+
|
|
41
|
+
- Read `.ahe/process_status.json` and the relevant workflow artifacts.
|
|
42
|
+
- Summarize the current state briefly.
|
|
43
|
+
- Ask the next focused question or return control to the caller when the answer
|
|
44
|
+
resolves the missing detail.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-harness
|
|
3
|
+
description: Internal AHE harness workflow for managing product docs, instructions, feature tracking, session artifacts, todo sync, and compression-aware maintenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Harness
|
|
7
|
+
|
|
8
|
+
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-harness` as a user command.
|
|
11
|
+
Use it when `ahe-thinker` or another worker decides that harness artifacts must
|
|
12
|
+
be created, updated, reconciled, or compressed.
|
|
13
|
+
|
|
14
|
+
## Command Workflow: ahe-harness
|
|
15
|
+
|
|
16
|
+
### Harness Inspection
|
|
17
|
+
|
|
18
|
+
- Read `docs/PRODUCT.md` if it exists.
|
|
19
|
+
- Read `docs/INSTRUCTIONS.md` if it exists.
|
|
20
|
+
- Read `AGENTS.md`, `feature-list.json`, `PROGRESS.md`, `SESSION-HANDOFF.md`,
|
|
21
|
+
and `docs/todo.md` when they exist.
|
|
22
|
+
- Read `.ahe/process_status.json` when it exists.
|
|
23
|
+
- Treat `docs/PRODUCT.md` as the canonical source of truth and
|
|
24
|
+
`feature-list.json` as a derived tracker.
|
|
25
|
+
|
|
26
|
+
### Harness Decision Paths
|
|
27
|
+
|
|
28
|
+
- Clarify product goal, scope, and success criteria when `docs/PRODUCT.md`
|
|
29
|
+
needs to change.
|
|
30
|
+
- Clarify project instructions when `docs/INSTRUCTIONS.md` needs to change.
|
|
31
|
+
- Clarify what next feature or goal should be tracked when the next work item is
|
|
32
|
+
unclear.
|
|
33
|
+
- `docs/PRODUCT.md` is the canonical home for product specification details collected during `ahe init`.
|
|
34
|
+
- Write product behavior, scope, requirements, success criteria, and workflow details into `docs/PRODUCT.md`.
|
|
35
|
+
- `docs/PRODUCT.md` is the canonical source of truth. Concrete feature items for `feature-list.json` must be derived from it only after it has been populated.
|
|
36
|
+
- Do not move product specification details into `AGENTS.md`.
|
|
37
|
+
- Update only the relevant docs among `docs/PRODUCT.md` and
|
|
38
|
+
`docs/INSTRUCTIONS.md`.
|
|
39
|
+
- If the user is adding new work, append it into the last `## TODO` section of
|
|
40
|
+
`docs/todo.md`, create that section when needed, and update
|
|
41
|
+
`feature-list.json`.
|
|
42
|
+
- Apply the queued `docs/todo.md` content to `docs/PRODUCT.md`.
|
|
43
|
+
- Remove the applied content from `docs/todo.md` because that todo content is
|
|
44
|
+
already reflected in `docs/PRODUCT.md`.
|
|
45
|
+
- Update `feature-list.json` to derive the specific feature items from the updated `docs/PRODUCT.md`.
|
|
46
|
+
- Update `PROGRESS.md`.
|
|
47
|
+
- Update `SESSION-HANDOFF.md`.
|
|
48
|
+
- For `ahe compress feature-list`, replace old completed feature entries with one summarized done feature.
|
|
49
|
+
- Keep the summarized feature valid for the existing schema by preserving its
|
|
50
|
+
own `id`, `name`, `description`, `dependencies`, `status`, and short
|
|
51
|
+
evidence.
|
|
52
|
+
- Preserve unfinished, blocked, or active feature items in full detail.
|
|
53
|
+
- Reconcile `feature-list.json` against `docs/PRODUCT.md` after compression.
|
|
54
|
+
- If no new feature can be derived from `docs/PRODUCT.md`, call `ahe-conversator` to ask what next feature, product direction, or goal should be tracked.
|
|
55
|
+
- Call `ahe-reviewer` directly when code or progress evidence must be checked
|
|
56
|
+
before updating harness files.
|
|
57
|
+
|
|
58
|
+
### Harness Completion
|
|
59
|
+
|
|
60
|
+
- Keep `feature-list.json` valid JSON.
|
|
61
|
+
- Do not create backup copies when compressing harness history.
|
|
62
|
+
- Keep `PROGRESS.md` focused on current work, decisions that still matter,
|
|
63
|
+
blockers, and recent verification evidence.
|
|
64
|
+
- Keep `SESSION-HANDOFF.md` focused on the next-session startup path.
|
|
65
|
+
- Keep `.ahe/process_status.json` aligned with the active workflow.
|
|
66
|
+
|
|
67
|
+
## Clarification Rule
|
|
68
|
+
|
|
69
|
+
When the next harness step is not clear, follow the `ahe-thinker` protocol first. If `ahe-thinker` finds missing information, follow the `ahe-conversator` protocol. Ask again recursively using a Codex-supported structured response request, provide 2-3 meaningful mutually exclusive options
|
|
70
|
+
when possible, and allow custom input when predefined options are not enough.
|
|
71
|
+
|
|
72
|
+
### User Response Target
|
|
73
|
+
|
|
74
|
+
- Collect the product, instruction, tracking, or next-feature details required
|
|
75
|
+
to update harness artifacts safely.
|
|
76
|
+
|
|
77
|
+
### Questions to Ask
|
|
78
|
+
|
|
79
|
+
- Ask who the product is for and what problem it solves when product intent is
|
|
80
|
+
unclear.
|
|
81
|
+
- Ask what behavior, scope boundaries, and success criteria should be
|
|
82
|
+
documented.
|
|
83
|
+
- Ask what rule, practice, or guideline belongs in `docs/INSTRUCTIONS.md`.
|
|
84
|
+
- Ask what work should be added next when `docs/PRODUCT.md` does not imply a new
|
|
85
|
+
feature safely.
|
|
86
|
+
|
|
87
|
+
### Clarification Criteria
|
|
88
|
+
|
|
89
|
+
- The answer must be concrete enough to update the relevant harness files
|
|
90
|
+
without guessing.
|
|
91
|
+
- The answer must describe actionable work, the affected area, and the intended
|
|
92
|
+
outcome when queuing a todo item.
|
|
93
|
+
|
|
94
|
+
### Re-ask When
|
|
95
|
+
|
|
96
|
+
- Ask again when the answer is vague, contradictory, or incomplete.
|
|
97
|
+
- Ask again when the response names a topic without enough detail to update the
|
|
98
|
+
harness safely.
|
|
99
|
+
|
|
100
|
+
## Session Tracking and Handoff Sync
|
|
101
|
+
|
|
102
|
+
### Tracking Update Rules
|
|
103
|
+
|
|
104
|
+
- Update `.ahe/process_status.json` at workflow start.
|
|
105
|
+
- Update `.ahe/process_status.json` after every answered question.
|
|
106
|
+
- Refresh `updated_at` every time workflow state changes.
|
|
107
|
+
- Keep `current_command`, `current_step`, and `workflow_complete` aligned with the active workflow state.
|
|
108
|
+
- Keep the `files` status map aligned with the actual workspace files.
|
|
109
|
+
|
|
110
|
+
### Progress and Handoff Content Requirements
|
|
111
|
+
|
|
112
|
+
- Update `PROGRESS.md` whenever the active feature, workflow status, blockers, or verification state changes.
|
|
113
|
+
- Update `SESSION-HANDOFF.md` whenever the current objective, completed work, important files, verification evidence, or recommended next step changes.
|
|
114
|
+
- PROGRESS.md must reflect the current active feature and latest completed work.
|
|
115
|
+
- SESSION-HANDOFF.md must leave the next Codex session with a concrete startup path.
|