@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,108 @@
|
|
|
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_fix_plan.py --root "$PWD" --plan-name "Fix Plan Title" < /tmp/fix-plan.md
|
|
12
|
+
# 3. Or with Python when dependencies are already available:
|
|
13
|
+
# python3 write_fix_plan.py --root "$PWD" --plan-name "Fix Plan Title" < /tmp/fix-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 WriteFixPlanArgs:
|
|
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]) -> WriteFixPlanArgs:
|
|
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
|
+
match argument:
|
|
58
|
+
case "--root":
|
|
59
|
+
index += 1
|
|
60
|
+
if index >= len(argv):
|
|
61
|
+
raise ArgumentError("--root requires a value")
|
|
62
|
+
root = Path(argv[index])
|
|
63
|
+
case "--plan-name":
|
|
64
|
+
index += 1
|
|
65
|
+
if index >= len(argv):
|
|
66
|
+
raise ArgumentError("--plan-name requires a value")
|
|
67
|
+
plan_name = argv[index]
|
|
68
|
+
case "--overwrite":
|
|
69
|
+
overwrite = True
|
|
70
|
+
case _:
|
|
71
|
+
raise ArgumentError(f"unknown argument: {argument}")
|
|
72
|
+
index += 1
|
|
73
|
+
|
|
74
|
+
if root is None:
|
|
75
|
+
raise ArgumentError("--root is required")
|
|
76
|
+
if plan_name is None:
|
|
77
|
+
raise ArgumentError("--plan-name is required")
|
|
78
|
+
|
|
79
|
+
return WriteFixPlanArgs(root=root, plan_name=plan_name, overwrite=overwrite)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def write_fix_plan(args: WriteFixPlanArgs, markdown: str) -> Path:
|
|
83
|
+
filename = f"{sanitize_plan_name(args.plan_name)}.md"
|
|
84
|
+
plans_dir = args.root / ".plans"
|
|
85
|
+
plan_path = plans_dir / filename
|
|
86
|
+
|
|
87
|
+
if plan_path.exists() and not args.overwrite:
|
|
88
|
+
raise PlanAlreadyExistsError(plan_path)
|
|
89
|
+
|
|
90
|
+
plans_dir.mkdir(parents=True, exist_ok=True)
|
|
91
|
+
plan_path.write_text(markdown, encoding="utf-8")
|
|
92
|
+
return plan_path
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def main() -> int:
|
|
96
|
+
try:
|
|
97
|
+
args = parse_args(sys.argv[1:])
|
|
98
|
+
plan_path = write_fix_plan(args, sys.stdin.read())
|
|
99
|
+
except (ArgumentError, PlanAlreadyExistsError) as error:
|
|
100
|
+
print(error, file=sys.stderr)
|
|
101
|
+
return 1
|
|
102
|
+
|
|
103
|
+
print(plan_path)
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
if __name__ == "__main__":
|
|
108
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-git
|
|
3
|
+
description: Use when the user explicitly invokes `ahe git` or `ahe-git` to manage and commit changes across repositories and submodules.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Git
|
|
7
|
+
|
|
8
|
+
`ahe-git` is a user-facing AHE command independent from the normal AHE agent network.
|
|
9
|
+
|
|
10
|
+
Use this skill only to orchestrate safe Git pulls and commits across the active repository and its nested Git repositories or submodules.
|
|
11
|
+
Do not route through `ahe-think`. You must not call `ahe-harness`, `ahe-solve`, or any other AHE workflow agent.
|
|
12
|
+
|
|
13
|
+
## Workflow
|
|
14
|
+
|
|
15
|
+
1. **Discover**: Scan for both `.git` directories and `.git` files to find all nested repositories, worktrees, and submodules. Normalize and deduplicate the repo roots. Process them deepest-first (so submodules commit before parent gitlink updates).
|
|
16
|
+
2. **Safe Pull**: For each repo, run `git fetch` and inspect the current branch and upstream state:
|
|
17
|
+
- If the repo is clean and upstream is ahead, fast-forward with `git pull --ff-only`.
|
|
18
|
+
- If the repo is already at upstream head, continue.
|
|
19
|
+
- If the repo is locally ahead of upstream and has local changes, continue to Dirty-State Review.
|
|
20
|
+
- If the repo has local changes and upstream has commits not present locally, **stop and explain the issue**.
|
|
21
|
+
- If upstream is missing, detached, diverged, rebasing, merging, cherry-picking, or cannot fast-forward cleanly, **stop and explain the issue**.
|
|
22
|
+
- *Never* auto-stash, auto-merge, auto-rebase, auto-resolve conflicts, or change branch topology.
|
|
23
|
+
3. **Failure Policy**: On any hard Git state, stop immediately and report:
|
|
24
|
+
- Which repo is blocked.
|
|
25
|
+
- The exact detected condition.
|
|
26
|
+
- Why `ahe-git` is refusing to continue.
|
|
27
|
+
- Concrete manual steps the user should perform next (e.g., set upstream, finish merge, clean changes).
|
|
28
|
+
- Do not attempt partial recovery beyond safe read-only diagnosis.
|
|
29
|
+
4. **Dirty-State Review**: Inspect `git status --short`. Read unstaged diffs first, then staged diffs, and include untracked files so the commit message covers the full pending change.
|
|
30
|
+
5. **Commit-Message Drafting**: Generate one concise conventional-style message per repo (`feat:`, `fix:`, `chore:`, etc.) based on the actual diff.
|
|
31
|
+
- Run an explicit self-check pass to reject vague or misleading messages before commit.
|
|
32
|
+
- If the message is still ambiguous after self-check, stop and ask the user instead of committing a generic summary.
|
|
33
|
+
6. **Commit**: Stage with `git add -A` inside that repo. Commit exactly once per dirty repo with its reviewed message.
|
|
34
|
+
7. **Re-evaluate**: After submodule commits, re-evaluate parent repos so gitlink updates are committed if they became dirty.
|
|
@@ -0,0 +1,128 @@
|
|
|
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-think` or another worker decides that harness artifacts must
|
|
12
|
+
be created, updated, reconciled, or compressed. It remains responsible for tracker compression, while test-suite cleanup is routed by `ahe-think` through `ahe-review` first and then `ahe-solve` or `ahe-harness` as needed.
|
|
13
|
+
|
|
14
|
+
## Command Workflow: harness
|
|
15
|
+
|
|
16
|
+
### Harness Inspection
|
|
17
|
+
|
|
18
|
+
- Discover and read scoped docs anywhere in the repo. Treat every docs file as supporting project context, even when `AGENTS.md` does not name it directly.
|
|
19
|
+
- Treat `docs/product.md`, `docs/architecture.md`, and `docs/INSTRUCTIONS.md` (or `docs/instructions.md`) as overview docs.
|
|
20
|
+
- Especially read `docs/product{number}.md` files when present because they explain what to do.
|
|
21
|
+
- Read `AGENTS.md`, `feature-list.json`, `progress.md`, `session-handoff.md`,
|
|
22
|
+
and `docs/todo.md` when they exist.
|
|
23
|
+
- Read `status.json` when it exists.
|
|
24
|
+
- Treat `docs/product.md` as the canonical source of truth and
|
|
25
|
+
`feature-list.json` as a derived tracker.
|
|
26
|
+
- Treat `docs/product.md` as overview context even when a numbered product stage is active.
|
|
27
|
+
- Recognize only `docs/product{number}.md` files as ordered product stages.
|
|
28
|
+
- Ignore non-numeric product files such as `docs/product-alpha.md` for stage ordering.
|
|
29
|
+
- Choose the lowest-numbered product stage whose derived feature work is not complete.
|
|
30
|
+
- Use `docs/product.md` as the normal overview-only source when no numbered product stage exists.
|
|
31
|
+
|
|
32
|
+
### Harness Decision Paths
|
|
33
|
+
|
|
34
|
+
- Clarify product goal, scope, and success criteria when `docs/product.md`
|
|
35
|
+
needs to change.
|
|
36
|
+
- Clarify project instructions when `docs/INSTRUCTIONS.md` needs to change.
|
|
37
|
+
- Clarify what next feature or goal should be tracked when the next work item is
|
|
38
|
+
unclear.
|
|
39
|
+
- `docs/product.md` is the canonical home for product specification details collected during `ahe-new`.
|
|
40
|
+
- Write product behavior, scope, requirements, success criteria, and workflow details into `docs/product.md`.
|
|
41
|
+
- `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.
|
|
42
|
+
- Derive concrete feature items from only the active product stage, not future stages.
|
|
43
|
+
- Advance from `docs/product1.md` to `docs/product2.md` only after all feature-list items derived from `docs/product1.md` are `done`.
|
|
44
|
+
- Apply the same done-before-advance rule for later stages such as `docs/product2.md` to `docs/product3.md`.
|
|
45
|
+
- Do not move product specification details into `AGENTS.md`.
|
|
46
|
+
- Update only the relevant docs among `docs/product.md` and
|
|
47
|
+
`docs/INSTRUCTIONS.md`.
|
|
48
|
+
- If the user is adding new work, append it into the last `## TODO` section of
|
|
49
|
+
`docs/todo.md`, create that section when needed, and update
|
|
50
|
+
`feature-list.json`.
|
|
51
|
+
- Apply the queued `docs/todo.md` content to `docs/product.md`.
|
|
52
|
+
- Remove the applied content from `docs/todo.md` because that todo content is
|
|
53
|
+
already reflected in `docs/product.md`.
|
|
54
|
+
- Update `feature-list.json` to derive the specific feature items from the updated `docs/product.md`.
|
|
55
|
+
- Update `progress.md`.
|
|
56
|
+
- Update `session-handoff.md`.
|
|
57
|
+
- For `ahe compress`, if the harness-size detector signals compression pressure, replace old completed feature entries with one summarized done feature.
|
|
58
|
+
- Keep the summarized feature valid for the existing schema by preserving its
|
|
59
|
+
own `id`, `name`, `description`, `dependencies`, `status`, and short
|
|
60
|
+
evidence.
|
|
61
|
+
- Preserve unfinished, blocked, or active feature items in full detail.
|
|
62
|
+
- Reconcile `feature-list.json` against `docs/product.md` after compression.
|
|
63
|
+
- If no new feature can be derived from `docs/product.md`, call `ahe-converse` to ask what next feature, product direction, or goal should be tracked.
|
|
64
|
+
- If a numbered product stage is active and no new feature can be derived from
|
|
65
|
+
that active product stage, call `ahe-converse` with the same clarification
|
|
66
|
+
target.
|
|
67
|
+
- Call `ahe-review` directly when code or progress evidence must be checked
|
|
68
|
+
before updating harness files.
|
|
69
|
+
|
|
70
|
+
### Harness Completion
|
|
71
|
+
|
|
72
|
+
- Keep `feature-list.json` valid JSON.
|
|
73
|
+
- Do not create backup copies when compressing harness history.
|
|
74
|
+
- Keep `progress.md` focused on current work, decisions that still matter,
|
|
75
|
+
blockers, and recent verification evidence.
|
|
76
|
+
- Keep `session-handoff.md` focused on the next-session startup path.
|
|
77
|
+
- Keep `status.json` aligned with the active workflow.
|
|
78
|
+
- When harness files are created or refreshed, hand off to `ahe-harness-checker` before considering the harness ready.
|
|
79
|
+
|
|
80
|
+
## Clarification Rule
|
|
81
|
+
|
|
82
|
+
When the next harness step is not clear, follow the `ahe-think` protocol first. If `ahe-think` finds missing information, follow the `ahe-converse` protocol. Ask again recursively using a Codex-supported structured response request, provide 2-3 meaningful mutually exclusive options
|
|
83
|
+
when possible, and allow custom input when predefined options are not enough.
|
|
84
|
+
|
|
85
|
+
### User Response Target
|
|
86
|
+
|
|
87
|
+
- Collect the product, instruction, tracking, or next-feature details required
|
|
88
|
+
to update harness artifacts safely.
|
|
89
|
+
|
|
90
|
+
### Questions to Ask
|
|
91
|
+
|
|
92
|
+
- Ask who the product is for and what problem it solves when product intent is
|
|
93
|
+
unclear.
|
|
94
|
+
- Ask what behavior, scope boundaries, and success criteria should be
|
|
95
|
+
documented.
|
|
96
|
+
- Ask what rule, practice, or guideline belongs in `docs/INSTRUCTIONS.md`.
|
|
97
|
+
- Ask what work should be added next when `docs/product.md` does not imply a new
|
|
98
|
+
feature safely.
|
|
99
|
+
|
|
100
|
+
### Clarification Criteria
|
|
101
|
+
|
|
102
|
+
- The answer must be concrete enough to update the relevant harness files
|
|
103
|
+
without guessing.
|
|
104
|
+
- The answer must describe actionable work, the affected area, and the intended
|
|
105
|
+
outcome when queuing a todo item.
|
|
106
|
+
|
|
107
|
+
### Re-ask When
|
|
108
|
+
|
|
109
|
+
- Ask again when the answer is vague, contradictory, or incomplete.
|
|
110
|
+
- Ask again when the response names a topic without enough detail to update the
|
|
111
|
+
harness safely.
|
|
112
|
+
|
|
113
|
+
## Session Tracking and Handoff Sync
|
|
114
|
+
|
|
115
|
+
### Tracking Update Rules
|
|
116
|
+
|
|
117
|
+
- Update `status.json` at workflow start.
|
|
118
|
+
- Update `status.json` after every answered question.
|
|
119
|
+
- Refresh `updated_at` every time workflow state changes.
|
|
120
|
+
- Keep `current_command`, `current_step`, and `workflow_complete` aligned with the active workflow state.
|
|
121
|
+
- Keep the `files` status map aligned with the actual workspace files.
|
|
122
|
+
|
|
123
|
+
### Progress and Handoff Content Requirements
|
|
124
|
+
|
|
125
|
+
- Update `progress.md` whenever the active feature, workflow status, blockers, or verification state changes.
|
|
126
|
+
- Update `session-handoff.md` whenever the current objective, completed work, important files, verification evidence, or recommended next step changes.
|
|
127
|
+
- progress.md must reflect the current active feature and latest completed work.
|
|
128
|
+
- session-handoff.md must leave the next Codex session with a concrete startup path.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-harness-checker
|
|
3
|
+
description: Internal AHE harness validation and repair protocol for checking artifacts after generation or maintenance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Harness Checker
|
|
7
|
+
|
|
8
|
+
**CRITICAL: This is an internal AHE workflow skill, not a user-facing command.**
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-harness-checker` as a user command.
|
|
11
|
+
Use it when `ahe-think`, `ahe-harness`, or `ahe-new` decides that generated or maintained harness files must be validated and repaired.
|
|
12
|
+
|
|
13
|
+
## Protocol and Purpose
|
|
14
|
+
|
|
15
|
+
Your primary purpose is to validate and repair generated harness artifacts after bootstrap/initialization or harness maintenance work.
|
|
16
|
+
|
|
17
|
+
**CRITICAL MANDATORY STEP**: You MUST read and review the actual contents of all harness files before attempting to validate or repair them. You have explicit authority and the obligation to inspect the contents of the following key files:
|
|
18
|
+
- `AGENTS.md`
|
|
19
|
+
- `docs/product.md`
|
|
20
|
+
- `docs/INSTRUCTIONS.md`
|
|
21
|
+
- `feature-list.json`
|
|
22
|
+
- `progress.md`
|
|
23
|
+
- `session-handoff.md`
|
|
24
|
+
- `init.sh`
|
|
25
|
+
- `status.json`
|
|
26
|
+
|
|
27
|
+
## Detectable Failure Classes
|
|
28
|
+
|
|
29
|
+
You must detect and classify the following issues during your validation check:
|
|
30
|
+
|
|
31
|
+
1. **Missing Required File**: A key harness file is completely absent from the workspace.
|
|
32
|
+
2. **Empty Required File**: A key harness file exists but contains zero bytes or only whitespace.
|
|
33
|
+
3. **Invalid Tracker JSON**: `feature-list.json` or `status.json` contains malformed JSON or violates the required schema.
|
|
34
|
+
4. **Wrong Filename Casing**: A harness file uses an incorrect case (e.g., `PROGRESS.md` instead of `progress.md`). Note: `AGENTS.md` is the only file that must remain uppercase.
|
|
35
|
+
5. **Forbidden AGENTS.md Edits**: Edits to `AGENTS.md` have occurred outside the allowed changeable section / `PROJECT_PURPOSE`.
|
|
36
|
+
6. **Missing Product Docs**: `docs/product.md` is absent or does not contain valid specification text.
|
|
37
|
+
7. **Template/Bootstrap Drift**: Workspace files contradict the intended layout or templates defined by AHE.
|
|
38
|
+
|
|
39
|
+
## Repair Behavior
|
|
40
|
+
|
|
41
|
+
- **Direct Fix**: If the detected failure is deterministic and local (e.g., wrong casing, missing template placeholders, local syntax drift, malformed but fixable JSON), fix the issue directly in the workspace without prompting.
|
|
42
|
+
- **Escalation**: If the issue is ambiguous or requires understanding the user's intent (e.g., missing project purpose, contradictory requirements, or major data loss in tracker files), escalate the issue by handing off to `ahe-converse` to query the user for clarification.
|
|
43
|
+
|
|
44
|
+
## Sequence Completion
|
|
45
|
+
|
|
46
|
+
Once all detected issues have been either directly fixed or safely escalated, summarize the fixes applied and exit. Do not proceed to other workflow steps on your own.
|
|
@@ -1,77 +1,81 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: ahe-
|
|
2
|
+
name: ahe-new
|
|
3
3
|
description: Initialize AHE in the current workspace and create the base harness files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# AHE
|
|
6
|
+
# AHE New
|
|
7
7
|
|
|
8
|
-
Use this skill when the user invokes `$ahe-
|
|
8
|
+
Use this skill when the user invokes `$ahe-new`.
|
|
9
9
|
|
|
10
|
-
## Command Workflow:
|
|
10
|
+
## Command Workflow: new
|
|
11
11
|
|
|
12
12
|
### Workspace Inspection
|
|
13
13
|
|
|
14
14
|
- Read `AGENTS.md` if it already exists.
|
|
15
|
-
- Read `docs
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
- Treat `
|
|
15
|
+
- Read all `docs/*.md` files when they exist. Treat every docs file as
|
|
16
|
+
supporting project context, even when `AGENTS.md` does not name it directly.
|
|
17
|
+
- Especially read `docs/product.md` and
|
|
18
|
+
`docs/product{number}.md` files when present because they explain what to do.
|
|
19
|
+
- Treat `docs/product.md` as overview context and numbered
|
|
20
|
+
`docs/product{number}.md` files as ordered product stages.
|
|
21
|
+
- Ignore non-numeric product docs such as `docs/product-alpha.md` for stage
|
|
22
|
+
ordering.
|
|
23
|
+
- Read existing workspace-root harness files that may be copied from templates, including `progress.md`, `session-handoff.md`, `feature-list.json`, and `init.sh`.
|
|
24
|
+
- Read `status.json` when it exists.
|
|
25
|
+
- Treat `AGENTS.md`, `docs/product.md`, `docs/INSTRUCTIONS.md`, `progress.md`, `session-handoff.md`, `feature-list.json`, `init.sh`, and `status.json` as AHE-managed harness files for restart-scope decisions.
|
|
20
26
|
|
|
21
27
|
### Sequential Conversation Flow
|
|
22
28
|
|
|
23
|
-
- Treat exact `ahe
|
|
29
|
+
- Treat exact `ahe new` as a possible new start request.
|
|
24
30
|
- If no AHE-managed harness files exist, start initialization normally without asking a restart-scope question.
|
|
25
31
|
- If any AHE-managed harness file already exists, read the existing files first.
|
|
26
|
-
- When existing harness files are present, summarize the current project purpose and product specification state, then ask what restart scope the user wants before
|
|
27
|
-
- Do not
|
|
32
|
+
- When existing harness files are present, summarize the current project purpose and product specification state, then ask what restart scope the user wants before removing, overwriting, or refreshing existing harness files.
|
|
33
|
+
- Do not remove, overwrite, or refresh existing harness files until the restart scope is clear.
|
|
28
34
|
- Interpret the restart scope from the user's free-form answer; examples are guidance only and must not limit valid answers.
|
|
29
35
|
- If the answer says `purpose`, full restart, or equivalent, `purpose` means restart the whole harness from the project purpose.
|
|
30
|
-
- If the answer says `product`, product spec, or equivalent, `product` means preserve the project purpose in `AGENTS.md
|
|
31
|
-
- If the answer names
|
|
36
|
+
- If the answer says `product`, product spec, or equivalent, `product` means preserve the project purpose in `AGENTS.md` and restart product specification work in `docs/product.md`.
|
|
37
|
+
- If the answer names staged product work, restart only the named product stage
|
|
38
|
+
files unless the user also requests the overview product spec.
|
|
39
|
+
- If the answer names a narrower custom scope, preserve unrelated harness files and restart only the named scope.
|
|
32
40
|
- If `AGENTS.md` already exists, ask the user whether the current `AGENTS.md` is right.
|
|
33
41
|
- If the current `AGENTS.md` is not right or does not exist, ask for the purpose of this project.
|
|
34
42
|
- If `AGENTS.md` does not exist, copy `AGENTS.md` from `.codex/ahe-shared/templates/`.
|
|
35
43
|
- Update only the `PROJECT_PURPOSE` portion of `AGENTS.md`.
|
|
36
44
|
- Keep `AGENTS.md` limited to the project purpose and base agent settings.
|
|
37
45
|
- Do not put product specification details in `AGENTS.md`.
|
|
38
|
-
- Send product behavior, scope, requirements, success criteria, and workflow details to `ahe-
|
|
39
|
-
- Generating an empty `feature-list.json` from a template is allowed, but do not write concrete feature items until `docs/
|
|
46
|
+
- Send product behavior, scope, requirements, success criteria, and workflow details to `ahe-harness` so they are written in `docs/product.md` first.
|
|
47
|
+
- Generating an empty `feature-list.json` from a template is allowed, but do not write concrete feature items until `docs/product.md` is populated.
|
|
48
|
+
- When staged product docs exist, let `ahe-harness` derive concrete feature
|
|
49
|
+
items from only the active product stage.
|
|
40
50
|
- Ask whether the project language is Python using a Codex-supported structured response request with meaningful options and custom input.
|
|
41
51
|
- If the user answers that the project language is not Python, ask again: "Which language do you use?".
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- Copy the `docs/` folder into the backup directory when it exists.
|
|
50
|
-
- Remove the previous `docs/PRODUCT.md` and `docs/INSTRUCTIONS.md` when the chosen restart scope includes product specification after backup.
|
|
51
|
-
- Remove the previous `PROGRESS.md` when the chosen restart scope includes progress tracking after backup.
|
|
52
|
-
- Remove the previous `SESSION-HANDOFF.md` when the chosen restart scope includes session handoff after backup.
|
|
53
|
-
- Remove the previous `feature-list.json` when the chosen restart scope includes feature tracking after backup.
|
|
54
|
-
- After backup, remove only the files included in the chosen restart scope before continuing the new start flow.
|
|
52
|
+
- Do not create backup copies of the replaced harness files.
|
|
53
|
+
- When a restart scope replaces prior harness history, summarize the replaced harness history in the refreshed tracking artifacts instead of creating backups.
|
|
54
|
+
- Remove the previous `docs/product.md` and `docs/INSTRUCTIONS.md` when the chosen restart scope includes product specification.
|
|
55
|
+
- Remove the previous `progress.md` when the chosen restart scope includes progress tracking.
|
|
56
|
+
- Remove the previous `session-handoff.md` when the chosen restart scope includes session handoff.
|
|
57
|
+
- Remove the previous `feature-list.json` when the chosen restart scope includes feature tracking.
|
|
58
|
+
- Remove only the files included in the chosen restart scope before continuing the new start flow.
|
|
55
59
|
- Find all template files under `.codex/ahe-shared/templates/`.
|
|
56
|
-
- Ignore `AGENTS.md` and `
|
|
60
|
+
- Ignore `AGENTS.md` and `product.md` when copying template files.
|
|
57
61
|
- Before copying a template file into the workspace root, check whether the target file already exists and ask for explicit overwrite confirmation when needed.
|
|
58
|
-
- Execute the following three steps sequentially, updating the progress status (`current_step` in
|
|
59
|
-
1. complete the embedded init setup work (status: "
|
|
60
|
-
2. call "ahe-
|
|
61
|
-
3. call "ahe-
|
|
62
|
+
- Execute the following three steps sequentially, updating the progress status (`current_step` in `status.json`):
|
|
63
|
+
1. complete the embedded init setup work (status: "new")
|
|
64
|
+
2. call "ahe-harness" (status: "ahe-harness")
|
|
65
|
+
3. call "ahe-harness-checker" (status: "ahe-harness-checker")
|
|
62
66
|
|
|
63
67
|
### Harness Generation
|
|
64
68
|
|
|
65
69
|
- Create or refresh `AGENTS.md`.
|
|
66
70
|
- Create or refresh missing workspace-root harness files from `.codex/ahe-shared/templates/`, converting markdown filenames to uppercase when needed.
|
|
67
|
-
- Create
|
|
71
|
+
- Create `status.json` and update it at each step to indicate the active status from the three-step sequence.
|
|
68
72
|
- Create missing harness files from `.codex/ahe-shared/templates/`.
|
|
69
73
|
- Keep the generated files aligned with the installed shared templates.
|
|
70
74
|
- Only allow additions/removals/edits to `docs/INSTRUCTIONS.md` inside `## CAN CHANGE INSTRUCTIONS`; preserve `## MUST NOT CHANGE INSTRUCTIONS`.
|
|
71
75
|
|
|
72
76
|
## Clarification Rule
|
|
73
77
|
|
|
74
|
-
When the next setup step is not clear, follow the `ahe-
|
|
78
|
+
When the next setup step is not clear, follow the `ahe-think` protocol first. If `ahe-think` finds missing information, follow the `ahe-converse` protocol. Ask again recursively using a Codex-supported structured response request, provide 2-3 meaningful mutually exclusive options when possible, and allow custom input when predefined options are not enough.
|
|
75
79
|
|
|
76
80
|
### User Response Target
|
|
77
81
|
|
|
@@ -91,7 +95,7 @@ When the next setup step is not clear, follow the `ahe-thinking` protocol first.
|
|
|
91
95
|
- The answer must be specific enough to update `PROJECT_PURPOSE`.
|
|
92
96
|
- The answer must make it clear whether initialization should continue with the current `AGENTS.md` or with a new purpose.
|
|
93
97
|
- The answer must clearly identify whether Python guidance applies.
|
|
94
|
-
- The answer must make the restart scope clear when existing harness files must be
|
|
98
|
+
- The answer must make the restart scope clear when existing harness files must be replaced.
|
|
95
99
|
- The answer must make overwrite intent explicit for existing template targets.
|
|
96
100
|
- The answer must resolve any setup choice that blocks the next workflow step.
|
|
97
101
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-overview
|
|
3
|
+
description: Provides an overview of Awesome Harness Engineering (AHE), its architecture, and available commands.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Awesome Harness Engineering (AHE) Overview
|
|
7
|
+
|
|
8
|
+
AHE is a framework and set of managed skills designed to maintain project harnesses (documentation, requirements, testing) and route work systematically through AI agents.
|
|
9
|
+
|
|
10
|
+
## Public Entrypoints
|
|
11
|
+
|
|
12
|
+
You interact with AHE using the following user-facing commands:
|
|
13
|
+
- **`ahe` / `ahe <query>`**: Automatically inspects the harness state and routes to the correct next step. For example: `ahe`, `ahe update product spec`, or `ahe compress`.
|
|
14
|
+
- **`ahe new` / `ahe-new`**: Starts the initialization or reset flow for a workspace.
|
|
15
|
+
- **`ahe fix` / `ahe fix <query>`**: Starts fix planning when an error occurs or user intent shifts, skipping normal continuation. For example: `ahe fix stale tests`.
|
|
16
|
+
- **`ahe ship`**: In Codex, saves the latest Plan Mode plan into `.plans/{plan_name}.md` without automatically executing it. In Antigravity, refreshes and executes exactly one plan from `.plans/`.
|
|
17
|
+
- **`ahe-git`**: In Antigravity, safely pulls and commits all nested repositories.
|
|
18
|
+
|
|
19
|
+
## Thinker-Centered Routing Model
|
|
20
|
+
|
|
21
|
+
AHE operates through a central decision layer: **`ahe-think`**. This internal agent determines the current state of the harness and delegates tasks to specialized sub-skills:
|
|
22
|
+
- **`ahe-harness`**: Builds and maintains product docs, instructions, and tracking state.
|
|
23
|
+
- **`ahe-review`**: Explores the codebase and reads files to understand context.
|
|
24
|
+
- **`ahe-converse`**: Pauses and asks the user for clarification when blocked.
|
|
25
|
+
- **`ahe-feature`**: Sizes and extracts new features from product documentation.
|
|
26
|
+
- **`ahe-solve`**: Solves or plans specific features.
|
|
27
|
+
- **`ahe-compress`**: Handles artifact size reduction when the harness grows too large.
|
|
28
|
+
|
|
29
|
+
These internal sub-skills are not user-facing commands.
|
|
30
|
+
|
|
31
|
+
## Main Flows
|
|
32
|
+
|
|
33
|
+
### 1. `ahe` (Continuous Execution)
|
|
34
|
+
```mermaid
|
|
35
|
+
graph TD;
|
|
36
|
+
User[User: ahe] --> Hook[ahe-hook.js]
|
|
37
|
+
Hook --> Think[ahe-think]
|
|
38
|
+
Think --> State{State?}
|
|
39
|
+
State -- Harness Missing --> New[ahe-new]
|
|
40
|
+
State -- Building Features --> Solve[ahe-solve]
|
|
41
|
+
State -- Need Context --> Review[ahe-review]
|
|
42
|
+
State -- Blocked --> Converse[ahe-converse]
|
|
43
|
+
State -- Harness Work --> Harness[ahe-harness]
|
|
44
|
+
State -- Compress --> Compress[ahe-compress]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 2. `ahe new` (Initialization)
|
|
48
|
+
```mermaid
|
|
49
|
+
graph TD;
|
|
50
|
+
User[User: ahe new] --> Hook[ahe-hook.js]
|
|
51
|
+
Hook --> Think[ahe-think]
|
|
52
|
+
Think --> New[ahe-new]
|
|
53
|
+
New --> Scope{Check Scope}
|
|
54
|
+
Scope -- Clarification --> Converse[ahe-converse]
|
|
55
|
+
Scope -- Done --> Harness[ahe-harness]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### 3. `ahe fix` (Fix Planning)
|
|
59
|
+
```mermaid
|
|
60
|
+
graph TD;
|
|
61
|
+
User[User: ahe fix] --> Hook[ahe-hook.js]
|
|
62
|
+
Hook --> Think[ahe-think]
|
|
63
|
+
Think --> Fix[ahe-fix]
|
|
64
|
+
Fix --> Clarify{Clear?}
|
|
65
|
+
Clarify -- No --> Converse[ahe-converse]
|
|
66
|
+
Clarify -- Yes --> Write[Write Fix Plan]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 4. `ahe ship` (Export / Execute Plan)
|
|
70
|
+
|
|
71
|
+
**In Codex (Export):**
|
|
72
|
+
```mermaid
|
|
73
|
+
graph TD;
|
|
74
|
+
User[User: ahe ship] --> Hook[ahe-hook.js]
|
|
75
|
+
Hook --> Think[ahe-think]
|
|
76
|
+
Think --> Ship[ahe-ship]
|
|
77
|
+
Ship --> Write[Write .plans/*.md]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**In Antigravity (Execute):**
|
|
81
|
+
```mermaid
|
|
82
|
+
graph TD;
|
|
83
|
+
User[User: ahe-ship] --> Antigravity
|
|
84
|
+
Antigravity --> ShipSkill[ahe-ship skill]
|
|
85
|
+
ShipSkill --> Read[Read .plans/*.md]
|
|
86
|
+
Read --> Execute[Execute Plan]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 5. `ahe-git` (Repository Sync)
|
|
90
|
+
|
|
91
|
+
**In Antigravity:**
|
|
92
|
+
```mermaid
|
|
93
|
+
graph TD;
|
|
94
|
+
User[User: ahe-git] --> Antigravity
|
|
95
|
+
Antigravity --> GitSkill[ahe-git skill]
|
|
96
|
+
GitSkill --> Pull[Pull Remote]
|
|
97
|
+
Pull --> Commit[Commit Local Changes]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Example of How to Use
|
|
101
|
+
|
|
102
|
+
### Harness Engineering
|
|
103
|
+
1. `ahe new`
|
|
104
|
+
(initialize the workspace)
|
|
105
|
+
2. `ahe update product spec`
|
|
106
|
+
(update product documentation)
|
|
107
|
+
3. `ahe add dashboard export feature`
|
|
108
|
+
(implement a specific feature)
|
|
109
|
+
|
|
110
|
+
### ahe-ship in Codex and Antigravity
|
|
111
|
+
after planning in codex
|
|
112
|
+
1. `ahe-ship` in codex
|
|
113
|
+
(save the plan to .plans)
|
|
114
|
+
2. `ahe-ship` in antigravity
|
|
115
|
+
(implement one of plans in .plans)
|
|
116
|
+
|
|
117
|
+
### ahe-git
|
|
118
|
+
1. `ahe-git` in antigravity
|
|
119
|
+
(safely pull and commit all nested repositories)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ahe-review
|
|
3
|
+
description: Internal AHE review workflow for understanding repo code, harness files, and CodeGraph context before another agent acts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AHE Reviewer
|
|
7
|
+
|
|
8
|
+
This is an internal AHE workflow skill, not a user-facing command.
|
|
9
|
+
|
|
10
|
+
Do not treat `$ahe-review` as a user command.
|
|
11
|
+
Use it when `ahe-think` or another worker needs evidence from code or harness
|
|
12
|
+
state before deciding what to do next.
|
|
13
|
+
|
|
14
|
+
## Review Scope
|
|
15
|
+
|
|
16
|
+
- Inspect repo code, harness files, verification history, and feature progress.
|
|
17
|
+
- If `.codegraph/` exists, prefer `.codegraph` or CodeGraph-backed review
|
|
18
|
+
context when available.
|
|
19
|
+
- Check `AGENTS.md`, all existing `docs/*.md` files, `feature-list.json`,
|
|
20
|
+
`progress.md`, `session-handoff.md`, and `docs/todo.md` when the question is
|
|
21
|
+
about harness state.
|
|
22
|
+
- Treat `docs/product.md` as overview context and `docs/product{number}.md`
|
|
23
|
+
files as ordered product stages when reviewing product or feature drift.
|
|
24
|
+
- Ignore non-numeric product docs such as `docs/product-alpha.md` for stage
|
|
25
|
+
ordering.
|
|
26
|
+
- Verify that `feature-list.json` reflects only the active product stage, not
|
|
27
|
+
future product stages.
|
|
28
|
+
- Especially read `docs/product.md` and
|
|
29
|
+
`docs/product{number}.md` files when present because they explain what to do.
|
|
30
|
+
|
|
31
|
+
## Handoffs
|
|
32
|
+
|
|
33
|
+
- Report findings back to `ahe-think` by default.
|
|
34
|
+
- Call `ahe-harness` directly when review finds harness drift, stale tracking,
|
|
35
|
+
or product doc / feature-list mismatches.
|
|
36
|
+
- Call `ahe-converse` only when the missing information must come from the
|
|
37
|
+
user.
|
|
38
|
+
|
|
39
|
+
## Output
|
|
40
|
+
|
|
41
|
+
- State what was reviewed.
|
|
42
|
+
- State the relevant evidence or mismatch.
|
|
43
|
+
- State the recommended next agent.
|