@ksuchoi216/ahe 0.1.6 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -214
- package/bin/ahe +34 -231
- package/package.json +8 -4
- package/packages/ahe-antigravity/bin/ahe-antigravity +325 -0
- package/packages/ahe-antigravity/package.json +7 -0
- package/packages/ahe-antigravity/skills/ahe-git/SKILL.md +35 -0
- package/packages/ahe-antigravity/skills/ahe-ship/SKILL.md +28 -0
- package/packages/ahe-antigravity/skills/ahe-ship/scripts/post-ship-hook.sh +12 -0
- package/packages/ahe-codex/.codex/agents/ahe-harness-manager.toml +19 -0
- package/{.codex → packages/ahe-codex/.codex}/ahe-shared/templates/AGENTS.md +11 -10
- package/{.codex/ahe-shared/templates/PRODUCT.md → packages/ahe-codex/.codex/ahe-shared/templates/product.md} +1 -1
- package/packages/ahe-codex/.codex/hooks/ahe-hook.js +296 -0
- package/packages/ahe-codex/.codex/skills/ahe/SKILL.md +34 -0
- package/packages/ahe-codex/.codex/skills/ahe-compress/SKILL.md +120 -0
- package/{.codex/skills/ahe-compression → packages/ahe-codex/.codex/skills/ahe-compress}/agents/openai.yaml +1 -1
- package/{.codex/skills/ahe-compression → packages/ahe-codex/.codex/skills/ahe-compress}/scripts/check-harness-size.sh +18 -6
- package/packages/ahe-codex/.codex/skills/ahe-compress/scripts/detect_stale_tests.py +30 -0
- package/packages/ahe-codex/.codex/skills/ahe-converse/SKILL.md +44 -0
- package/packages/ahe-codex/.codex/skills/ahe-feature/SKILL.md +25 -0
- package/packages/ahe-codex/.codex/skills/ahe-fix/SKILL.md +59 -0
- package/packages/ahe-codex/.codex/skills/ahe-fix/scripts/write_fix_plan.py +108 -0
- package/packages/ahe-codex/.codex/skills/ahe-git/SKILL.md +34 -0
- package/packages/ahe-codex/.codex/skills/ahe-harness/SKILL.md +128 -0
- package/packages/ahe-codex/.codex/skills/ahe-harness-checker/SKILL.md +46 -0
- package/{.codex/skills/ahe-init → packages/ahe-codex/.codex/skills/ahe-new}/SKILL.md +41 -37
- package/packages/ahe-codex/.codex/skills/ahe-overview/SKILL.md +119 -0
- package/packages/ahe-codex/.codex/skills/ahe-review/SKILL.md +43 -0
- package/packages/ahe-codex/.codex/skills/ahe-ship/SKILL.md +58 -0
- package/packages/ahe-codex/.codex/skills/ahe-ship/agents/openai.yaml +4 -0
- package/packages/ahe-codex/.codex/skills/ahe-ship/scripts/write_plan.py +107 -0
- package/packages/ahe-codex/.codex/skills/ahe-solve/SKILL.md +30 -0
- package/packages/ahe-codex/.codex/skills/ahe-think/SKILL.md +114 -0
- package/packages/ahe-codex/bin/ahe-codex +398 -0
- package/packages/ahe-codex/package.json +7 -0
- package/.codex/hooks/ahe-hook.js +0 -236
- package/.codex/skills/ahe-compression/SKILL.md +0 -97
- 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 → packages/ahe-codex/.codex}/ahe-shared/config.yaml +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/ahe-shared/schemas/feature-list-schema.json +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/ahe-shared/schemas/process_status.schema.json +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/ahe-shared/templates/INSTRUCTIONS.md +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/ahe-shared/templates/feature-list.json +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/ahe-shared/templates/init.sh +0 -0
- /package/{.codex/ahe-shared/templates/PROGRESS.md → packages/ahe-codex/.codex/ahe-shared/templates/progress.md} +0 -0
- /package/{.codex/ahe-shared/templates/SESSION-HANDOFF.md → packages/ahe-codex/.codex/ahe-shared/templates/session-handoff.md} +0 -0
- /package/{.codex → packages/ahe-codex/.codex}/hooks/hooks.json +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-ship
|
|
3
|
+
description: Use when the user explicitly invokes `$ship`, `ship`, or `ahe ship` after a plan has just been created and wants Codex to save it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Ship
|
|
7
|
+
|
|
8
|
+
`ship` is a user-facing AHE command, but it is independent from the AHE
|
|
9
|
+
agent network.
|
|
10
|
+
|
|
11
|
+
Use this skill only to export a completed Codex Plan Mode plan and save it to `.plans/`.
|
|
12
|
+
Do not route through `think`. You must not call `harness`, `solve`, or any
|
|
13
|
+
other AHE workflow agent.
|
|
14
|
+
|
|
15
|
+
## Workflow
|
|
16
|
+
|
|
17
|
+
1. Detect if the current conversation is still in Plan Mode.
|
|
18
|
+
2. If Plan Mode is active, the Codex host must exit Plan Mode and replay the command.
|
|
19
|
+
3. Outside Plan Mode, locate the most recent completed `<proposed_plan>` already visible in the
|
|
20
|
+
current conversation.
|
|
21
|
+
4. If the latest plan is clear, use it directly. Do not ask the user to paste
|
|
22
|
+
the plan again.
|
|
23
|
+
5. Derive `plan_name` from the plan title. Use a short lowercase hyphenated
|
|
24
|
+
name. If no title or safe name can be derived, ask one focused question for
|
|
25
|
+
the plan name.
|
|
26
|
+
6. Build a compact markdown handoff with these sections:
|
|
27
|
+
- `# {Plan Title}`
|
|
28
|
+
- `## Handoff Summary`
|
|
29
|
+
- `## Source Plan`
|
|
30
|
+
- `## Execution Context`
|
|
31
|
+
- `## Assumptions`
|
|
32
|
+
- `## Constraints`
|
|
33
|
+
- `## Verification Plan`
|
|
34
|
+
- `## Risks and Open Questions`
|
|
35
|
+
- `## Instructions for Next Agent`
|
|
36
|
+
7. Write the final markdown through `scripts/write_plan.py`.
|
|
37
|
+
8. Report that the plan was saved to `.plans/{plan_name}.md` and stop.
|
|
38
|
+
|
|
39
|
+
## Missing Context
|
|
40
|
+
|
|
41
|
+
- If there is no recent `<proposed_plan>` in context, ask the user for the plan
|
|
42
|
+
text instead of inventing one.
|
|
43
|
+
- If the target file already exists, ask whether to overwrite it or choose a
|
|
44
|
+
distinct plan name.
|
|
45
|
+
|
|
46
|
+
## Writer Script
|
|
47
|
+
|
|
48
|
+
Use:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
python .codex/skills/ship/scripts/write_plan.py \
|
|
52
|
+
--root "$PWD" \
|
|
53
|
+
--plan-name "Plan Title" \
|
|
54
|
+
< /tmp/ahe-plan.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add `--overwrite` only after the user explicitly confirms replacing an existing
|
|
58
|
+
file.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env -S uv run --script
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.11"
|
|
4
|
+
# dependencies = []
|
|
5
|
+
# ///
|
|
6
|
+
#
|
|
7
|
+
# How to run:
|
|
8
|
+
# 1. Install uv (if not installed):
|
|
9
|
+
# curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
10
|
+
# 2. Run directly:
|
|
11
|
+
# uv run write_plan.py --root "$PWD" --plan-name "Plan Title" < /tmp/ahe-plan.md
|
|
12
|
+
# 3. Or with Python when dependencies are already available:
|
|
13
|
+
# python write_plan.py --root "$PWD" --plan-name "Plan Title" < /tmp/ahe-plan.md
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import re
|
|
18
|
+
import sys
|
|
19
|
+
from dataclasses import dataclass
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass(frozen=True, slots=True)
|
|
24
|
+
class WritePlanArgs:
|
|
25
|
+
root: Path
|
|
26
|
+
plan_name: str
|
|
27
|
+
overwrite: bool
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class ArgumentError(Exception):
|
|
31
|
+
def __init__(self, message: str) -> None:
|
|
32
|
+
self.message = message
|
|
33
|
+
super().__init__(message)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class PlanAlreadyExistsError(Exception):
|
|
37
|
+
def __init__(self, path: Path) -> None:
|
|
38
|
+
self.path = path
|
|
39
|
+
super().__init__(f"Plan file already exists: {path}")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def sanitize_plan_name(plan_name: str) -> str:
|
|
43
|
+
normalized_name = re.sub(r"[^a-z0-9]+", "-", plan_name.strip().lower()).strip("-")
|
|
44
|
+
if normalized_name:
|
|
45
|
+
return normalized_name
|
|
46
|
+
raise ArgumentError("plan name must contain at least one letter or digit")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def parse_args(argv: list[str]) -> WritePlanArgs:
|
|
50
|
+
root: Path | None = None
|
|
51
|
+
plan_name: str | None = None
|
|
52
|
+
overwrite = False
|
|
53
|
+
index = 0
|
|
54
|
+
|
|
55
|
+
while index < len(argv):
|
|
56
|
+
argument = argv[index]
|
|
57
|
+
if argument == "--root":
|
|
58
|
+
index += 1
|
|
59
|
+
if index >= len(argv):
|
|
60
|
+
raise ArgumentError("--root requires a value")
|
|
61
|
+
root = Path(argv[index])
|
|
62
|
+
elif argument == "--plan-name":
|
|
63
|
+
index += 1
|
|
64
|
+
if index >= len(argv):
|
|
65
|
+
raise ArgumentError("--plan-name requires a value")
|
|
66
|
+
plan_name = argv[index]
|
|
67
|
+
elif argument == "--overwrite":
|
|
68
|
+
overwrite = True
|
|
69
|
+
else:
|
|
70
|
+
raise ArgumentError(f"unknown argument: {argument}")
|
|
71
|
+
index += 1
|
|
72
|
+
|
|
73
|
+
if root is None:
|
|
74
|
+
raise ArgumentError("--root is required")
|
|
75
|
+
if plan_name is None:
|
|
76
|
+
raise ArgumentError("--plan-name is required")
|
|
77
|
+
|
|
78
|
+
return WritePlanArgs(root=root, plan_name=plan_name, overwrite=overwrite)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def write_plan(args: WritePlanArgs, markdown: str) -> Path:
|
|
82
|
+
filename = f"{sanitize_plan_name(args.plan_name)}.md"
|
|
83
|
+
plans_dir = args.root / ".plans"
|
|
84
|
+
plan_path = plans_dir / filename
|
|
85
|
+
|
|
86
|
+
if plan_path.exists() and not args.overwrite:
|
|
87
|
+
raise PlanAlreadyExistsError(plan_path)
|
|
88
|
+
|
|
89
|
+
plans_dir.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
plan_path.write_text(markdown, encoding="utf-8")
|
|
91
|
+
return plan_path
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def main() -> int:
|
|
95
|
+
try:
|
|
96
|
+
args = parse_args(sys.argv[1:])
|
|
97
|
+
plan_path = write_plan(args, sys.stdin.read())
|
|
98
|
+
except (ArgumentError, PlanAlreadyExistsError) as error:
|
|
99
|
+
print(error, file=sys.stderr)
|
|
100
|
+
return 1
|
|
101
|
+
|
|
102
|
+
print(plan_path)
|
|
103
|
+
return 0
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
if __name__ == "__main__":
|
|
107
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-solve
|
|
3
|
+
description: Internal AHE feature-solving workflow for dividing, planning, and solving feature work after the active goal is clear enough.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Solver
|
|
7
|
+
|
|
8
|
+
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-solve` as a user command.
|
|
11
|
+
Use it when `ahe-think` decides that the next job is building or planning a
|
|
12
|
+
feature.
|
|
13
|
+
|
|
14
|
+
## Command Workflow: solve
|
|
15
|
+
|
|
16
|
+
- Read the active feature context from `docs/product.md`, `feature-list.json`,
|
|
17
|
+
`progress.md`, and any relevant code files.
|
|
18
|
+
- Read all existing `docs/*.md` files as supporting context.
|
|
19
|
+
- When numbered product stages exist, solve against the active product stage:
|
|
20
|
+
start with `docs/product1.md`, advance to later numeric stages only after the
|
|
21
|
+
current stage's derived feature-list items are `done`, and keep future product stages as context rather than implementation scope.
|
|
22
|
+
- Keep `docs/product.md` as overview context while working from an active
|
|
23
|
+
product stage.
|
|
24
|
+
- Divide broad work into smaller problems when useful.
|
|
25
|
+
- Plan each smaller problem before implementation.
|
|
26
|
+
- Call `ahe-review` when repo or code understanding is needed.
|
|
27
|
+
- Call `ahe-converse` when feature requirements, scope, or success criteria
|
|
28
|
+
are still unclear.
|
|
29
|
+
- Report the solved step, remaining work, and recommended next agent back to
|
|
30
|
+
`ahe-think`.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-think
|
|
3
|
+
description: Internal AHE orchestration protocol for routing exact `ahe`, `ahe <query>`, and `<query> ahe` requests through the AHE agent network.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Thinker
|
|
7
|
+
|
|
8
|
+
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-think` as a user command.
|
|
11
|
+
Use it as the central decision layer for AHE work.
|
|
12
|
+
|
|
13
|
+
## Purpose
|
|
14
|
+
|
|
15
|
+
- Judge what is missing before another agent acts.
|
|
16
|
+
- Judge the active `project`, `feature`, or `sub-feature`.
|
|
17
|
+
- Decide which of `Why`, `What`, and `How` are still missing.
|
|
18
|
+
- Choose the next internal agent: `ahe-review`, `ahe-converse`,
|
|
19
|
+
`ahe-harness`, or `ahe-solve`.
|
|
20
|
+
- Receive each agent result, reassess the state, and decide the next step.
|
|
21
|
+
|
|
22
|
+
## Routing Inputs
|
|
23
|
+
|
|
24
|
+
- Exact `ahe` means continue existing harness work.
|
|
25
|
+
- Exact `ahe init`, exact `ahe-new`, and exact `$ahe-new` stay on the
|
|
26
|
+
`$ahe-new` path.
|
|
27
|
+
- `ahe <query>` and `<query> ahe` mean route the query through `ahe-think`.
|
|
28
|
+
- Broad non-prefixed prompts must not activate AHE.
|
|
29
|
+
|
|
30
|
+
## Size and Stale-Test Preflight
|
|
31
|
+
|
|
32
|
+
- Before reading full harness files, run
|
|
33
|
+
`sh .codex/skills/ahe-compress/scripts/check-harness-size.sh`.
|
|
34
|
+
- Run the test-overlap detector `python .codex/skills/ahe-compress/scripts/detect_stale_tests.py`
|
|
35
|
+
when the user's explicit AHE query is compression-oriented (e.g., `ahe compress`).
|
|
36
|
+
- Run both compression detectors before choosing the next compression step.
|
|
37
|
+
- If either detector exits with `COMPRESSION_REQUIRED` or code `2`, call
|
|
38
|
+
`ahe-compress` before normal routing. However, `ahe-compress` must not delete tests directly;
|
|
39
|
+
for test compression, `ahe-think` must decide whether the next step is `ahe-harness` for
|
|
40
|
+
harness-file compaction, `ahe-review` for stale-test confirmation and keeper selection,
|
|
41
|
+
or both in sequence.
|
|
42
|
+
- Do not read oversized harness files wholesale before compression routing is
|
|
43
|
+
settled.
|
|
44
|
+
|
|
45
|
+
## Startup Contract
|
|
46
|
+
|
|
47
|
+
- Check whether the copied harness files are correct before reading their contents.
|
|
48
|
+
- Read files strictly in this order:
|
|
49
|
+
`AGENTS.md` -> `docs/product.md` plus `docs/product{n}.md` -> `docs/architecture.md` -> `docs/instructions.md` -> `init.sh` -> `feature-list.json` -> `status.json` -> `progress.md` -> `session-handoff.md`
|
|
50
|
+
- `ahe-think` explicitly owns the "what to do next" decisions for Codex-side AHE work.
|
|
51
|
+
|
|
52
|
+
## Decision Rules
|
|
53
|
+
|
|
54
|
+
- For a `project`, require `Why`, `What`, and `How` by default.
|
|
55
|
+
- For a `feature` or `sub-feature`, require only the minimum of `Why`, `What`,
|
|
56
|
+
and `How` needed to proceed safely.
|
|
57
|
+
- Read all existing `docs/*.md` files before choosing product work.
|
|
58
|
+
- Treat `docs/product.md` as overview context.
|
|
59
|
+
- Treat only `docs/product{number}.md` files as ordered product stages, starting
|
|
60
|
+
with `docs/product1.md` and then `docs/product2.md`.
|
|
61
|
+
- Ignore non-numeric product docs such as `docs/product-alpha.md` for stage
|
|
62
|
+
ordering.
|
|
63
|
+
- Choose the active product source as the lowest-numbered stage whose derived
|
|
64
|
+
feature work is not complete, or `docs/product.md` when no numbered stage
|
|
65
|
+
exists.
|
|
66
|
+
- If the need is understanding repo code, harness drift, progress evidence, or
|
|
67
|
+
CodeGraph context, call `ahe-review`.
|
|
68
|
+
- If the need is user clarification, call `ahe-converse`.
|
|
69
|
+
- If the need is updating harness artifacts, product docs, feature tracking,
|
|
70
|
+
todo sync, or compression of completed history, call `ahe-harness`.
|
|
71
|
+
- If the need is solving or decomposing feature work, call `ahe-solve`.
|
|
72
|
+
|
|
73
|
+
## Interaction Model
|
|
74
|
+
|
|
75
|
+
- `ahe-think` is centered, but direct worker-to-worker calls are allowed when
|
|
76
|
+
they are the obvious next step.
|
|
77
|
+
- Typical loops:
|
|
78
|
+
- `ahe-think -> ahe-review -> ahe-think`
|
|
79
|
+
- `ahe-think -> ahe-harness -> ahe-think`
|
|
80
|
+
- `ahe-think -> ahe-converse -> ahe-think`
|
|
81
|
+
- `ahe-think -> ahe-solve -> ahe-think`
|
|
82
|
+
- `ahe-think -> ahe-harness-checker -> ahe-think`
|
|
83
|
+
- Allowed direct handoffs include:
|
|
84
|
+
- `ahe-harness -> ahe-converse`
|
|
85
|
+
- `ahe-solve -> ahe-review`
|
|
86
|
+
- `ahe-review -> ahe-harness`
|
|
87
|
+
- `ahe-harness -> ahe-harness-checker`
|
|
88
|
+
- `ahe-new -> ahe-harness -> ahe-harness-checker`
|
|
89
|
+
- Every handoff must state the goal, reason, relevant files or context, and the
|
|
90
|
+
expected result.
|
|
91
|
+
|
|
92
|
+
## Broad Intent Routing
|
|
93
|
+
|
|
94
|
+
- Use `ahe-review` for review-first requests.
|
|
95
|
+
- Use `ahe-harness` for product, instructions, progress, feature-list, todo, or
|
|
96
|
+
compression maintenance.
|
|
97
|
+
- Use `ahe-solve` for feature implementation planning or execution work.
|
|
98
|
+
- Use `ahe-converse` when no safe next step exists without user input.
|
|
99
|
+
|
|
100
|
+
## Hard Editing Rule
|
|
101
|
+
|
|
102
|
+
- `AGENTS.md` and any `instructions.md` file may only be modified inside an explicitly changeable section.
|
|
103
|
+
- If no changeable section exists, AHE must ask via `ahe-converse` instead of editing.
|
|
104
|
+
- Reference and template folders must be strictly excluded from reads and edits per project rules.
|
|
105
|
+
|
|
106
|
+
## Completion
|
|
107
|
+
|
|
108
|
+
- Continue to the next skill or next unfinished feature until the active unit is
|
|
109
|
+
resolved.
|
|
110
|
+
- Keep `docs/product.md` as overview context and `feature-list.json` as a
|
|
111
|
+
derived tracker.
|
|
112
|
+
- Derive features from only the active product stage.
|
|
113
|
+
- Advance from one numbered product stage to the next only after all
|
|
114
|
+
feature-list items derived from the current active stage are `done`.
|