xonecas.io
56101
Df

dotfiles / commit ec985e4

feat: a different approach to the skills

xonecas2026-09-02 ec985e455525fa185b2a9ded637d57add48dccb5 parent 82d1318

9 files changed

hax/AGENTS.md+1−0
@@ -1,6 +1,7 @@
11 # Rules for AGENTS
22
33 - Always return exactly what was asked. Do not add scope, backwards compatibility or extras without the user explicitly asking.
4+- Do not add tests unless explicitly told to.
45 - Use `gh` for Github (it's already authenticated as me).
56 - Use `uvx hf` for HuggingFace (also already authenticated as me).
67 - Use `curl` and the environment's `EXA_API_KEY` to search and read web contents.
hax/bin/hax-adversary+3−6
@@ -1,14 +1,11 @@
11 #!/usr/bin/env bash
2-# hax-adversary — run the adversarial reviewer as an isolated hax -p subprocess.
2+# hax-adversary — run the adversarial agent as an isolated hax -p subprocess.
33 #
44 # Usage:
5-# hax-adversary <review brief...>
5+# hax-adversary <brief...>
66 # echo "<brief>" | hax-adversary
77 # hax-adversary < brief.txt
88 #
9-# The reviewer model and instructions come from the `adversary` preset in
10-# ~/.config/hax/config.json. --bare strips project instructions, skills, and
11-# subagent guidance; --no-session keeps the child out of session history.
129 set -euo pipefail
1310
1411 if [ "$#" -gt 0 ]; then
@@ -19,5 +16,5 @@ if [ ! -t 0 ]; then
1916 exec hax -p --preset=adversary --no-session
2017 fi
2118
22-echo "usage: hax-adversary <review brief> (or pipe the brief via stdin)" >&2
19+echo "usage: hax-adversary <brief> (or pipe the brief via stdin)" >&2
2320 exit 1
hax/bin/hax-implementer+20−0
@@ -0,0 +1,20 @@
1+#!/usr/bin/env bash
2+# hax-implementer — run the implementation agent as an isolated hax -p subprocess.
3+#
4+# Usage:
5+# hax-implementer <brief...>
6+# echo "<brief>" | hax-implementer
7+# hax-implementer < brief.txt
8+#
9+set -euo pipefail
10+
11+if [ "$#" -gt 0 ]; then
12+ exec hax -p --preset=implementer --no-session "$@"
13+fi
14+
15+if [ ! -t 0 ]; then
16+ exec hax -p --preset=implementer --no-session
17+fi
18+
19+echo "usage: hax-implementer <brief> (or pipe the brief via stdin)" >&2
20+exit 1
hax/bin/hax-loop+0−45
@@ -1,45 +0,0 @@
1-#!/usr/bin/env bash
2-# hax-loop — one-shot implementer → diff → adversary. No retry, no commit.
3-#
4-# Usage:
5-# hax-loop <task...>
6-# echo "<task>" | hax-loop
7-# hax-loop < task.txt
8-#
9-# Run from the project directory. The caller's task is passed verbatim.
10-# Implementer and adversary models come from presets in ~/.config/hax/config.json.
11-set -euo pipefail
12-
13-if [ -n "${HAX_LOOP:-}" ]; then
14- echo "hax-loop: refused to nest" >&2
15- exit 1
16-fi
17-export HAX_LOOP=1
18-
19-if [ "$#" -gt 0 ]; then
20- TASK="$*"
21-elif [ ! -t 0 ]; then
22- TASK=$(cat)
23-else
24- echo "usage: hax-loop <task> (or pipe the task via stdin)" >&2
25- exit 1
26-fi
27-
28-if [ -z "$TASK" ]; then
29- echo "hax-loop: empty task" >&2
30- exit 1
31-fi
32-
33-echo "==== implement ===="
34-# Skills and subagent presets stay with the overseer; the implementer would
35-# otherwise see this workflow and call hax-loop instead of doing the work.
36-printf '%s\n' "$TASK" | HAX_NO_SKILLS=1 HAX_NO_SUBAGENTS=1 \
37- hax -p --preset=implementer --no-session
38-
39-echo "==== diff ===="
40-git status --short
41-git --no-pager diff
42-
43-echo "==== review ===="
44-printf '%s\n\nReview the uncommitted diff against that task.\n' "$TASK" |
45- hax -p --preset=adversary --no-session
hax/config.json+5−5
@@ -1,19 +1,19 @@
11 {
22 "presets": {
33 "adversary": {
4- "description": "independent adversarial reviewer (read-only)",
4+ "description": "independent adversarial reviewer",
55 "provider": "opencode-go",
66 "model": "deepseek-v4-flash",
7- "effort": "high",
8- "system_prompt_append": "@~/.config/hax/prompts/adversary.md",
7+ "effort": "xhigh",
8+ "system_prompt_append": "Respond to the request taking a position of an adversary, or devil's advocate, provide adversarial feedback.",
99 "tint": "rose"
1010 },
1111 "implementer": {
1212 "description": "fast implementer: do the given task, nothing else",
1313 "provider": "opencode-go",
1414 "model": "glm-5.3-flash",
15- "effort": "low",
16- "system_prompt_append": "Implement the given task. Do not add scope, extras, or compatibility the task did not ask for. Do not commit. The caller's task is the requirement; repository docs constrain how, they do not replace the task.",
15+ "effort": "xhigh",
16+ "system_prompt_append": "Complete the given work, do not change scope, ensure you complete the request exactly.",
1717 "tint": "sage"
1818 }
1919 }
hax/prompts/adversary.md+0−28
@@ -1,28 +0,0 @@
1-# Adversarial Reviewer
2-
3-Review the requested change with a skeptical, evidence-driven mindset.
4-
5-Your job is to identify issues that would matter to the author before the change ships. Do not summarize or praise the implementation.
6-
7-Ensure that the change contains neither:
8-
9-- Poor architectural decisions.
10-- Inconsistencies with repository practices and guidelines.
11-
12-You are strictly read-only:
13-
14-- Do not edit files.
15-- Use the read/search tools and `bash` to inspect the repository, run tests, and gather evidence.
16-
17-## Standards
18-
19-- Report only concrete, actionable findings. Do not invent hypothetical concerns without a plausible failure path.
20-- Treat the stated requirements and established repository behavior as the source of truth.
21-- Do not downgrade a real issue because it existed before the change; identify it when the change introduces or worsens it.
22-- Focus on correctness and avoid nit-picking.
23-- Do not propose or apply code changes.
24-- Do not make up a severity scale or any scale of importance at all, simply state your finding and reference the exact code locations of the issue.
25-
26-## Output
27-
28-A short and concise report of the review findings or a clear statement that nothing was found.
hax/skills/adversary/SKILL.md+11−45
@@ -1,51 +1,17 @@
11 # Adversary review
22
3-Delegate a focused, read-only adversarial review to an isolated hax process running a
4-different model.
3+Create a summary of the conversation with the user, then call the adversary with that summary as the brief.
54
6-## When to use
5+Run it with:
76
8-- The user asks for an adversarial, skeptical, or independent review of work.
9-- The work is significant enough (a changeset, a design, a plan) to justify a second,
10- isolated pass with different eyes.
7+```sh
8+hax-adversary "$BRIEF"
9+```
1110
12-## How to run
11+or, for a long brief, pipe it:
1312
14-1. Build a **review brief** containing, in prose:
15-
16- - the intended behavior and requirements;
17- - the scope of the change (files, commands, tests involved);
18- - any constraints or repository practices the review should check against;
19- - pointers to the relevant context (paths) the reviewer should inspect.
20-
21- The reviewer does not have this conversation's context, so everything it needs to
22- evaluate the change must be in the brief or reachable from the working directory.
23-
24-2. Run it with:
25-
26- ```sh
27- hax-adversary "$BRIEF"
28- ```
29-
30- or, for a long brief, pipe it:
31-
32- ```sh
33- cat <<'EOF' | hax-adversary
34- <review brief>
35- EOF
36- ```
37-
38- `hax-adversary` is a wrapper around `hax -p --preset=adversary --no-session --bare`.
39- The preset (in `~/.config/hax/config.json`) fixes the reviewer model and injects the
40- reviewer instructions; `--bare` strips project instructions, skills, and subagent
41- guidance so the reviewer sees only the brief and the repository.
42-
43-3. Report the findings to the user, citing the exact code locations the reviewer gives.
44-
45-## Notes
46-
47-- The reviewer is instructed to be read-only and it runs with tools in a bare context,
48- but there is no hard tool restriction — treat its output as findings to verify, not
49- as a gate.
50-- A review may take a while: if the command detaches into a background task, wait on it
51- and collect the output before reporting.
13+```sh
14+cat <<'EOF' | hax-adversary
15+<brief>
16+EOF
17+```
hax/skills/implementer/SKILL.md+17−0
@@ -0,0 +1,17 @@
1+# Implementer
2+
3+Create a summary of the conversation with the user, then call the implementer with that summary as the brief.
4+
5+Run it with:
6+
7+```sh
8+hax-implementer "$BRIEF"
9+```
10+
11+or, for a long brief, pipe it:
12+
13+```sh
14+cat <<'EOF' | hax-implementer
15+<brief>
16+EOF
17+```
hax/skills/loop/SKILL.md+8−46
@@ -1,51 +1,13 @@
1-# Implementer / adversary loop
2-
3-Delegate a unit of work to an isolated implementer, then an isolated adversarial
4-review. This session stays the overseer: it writes the task, calls the loop, and
5-audits the result with the user.
6-
7-## When to use
8-
9-- The user asks to use this workflow, the implementer/adversary loop, or `hax-loop`.
10-- The user describes a goal, feature, or change and wants it implemented that way
11- rather than in this session.
12-
13-## How to run
14-
15-1. Stay the overseer. Do not implement the work yourself. Do not ask a subagent
16- in this session to do it either.
1+---
2+description: Use when the user explicitly asks to run the implementer/adversary loop.
3+---
174
18-2. Write the **task** in prose: intended behavior, scope, constraints, and any
19- paths that matter. Pass it **verbatim**. Do not have another model restate it
20- from the repository — that is how a wrong GOAL.md becomes the spec again.
21-
22-3. From the project directory:
23-
24- ```sh
25- hax-loop "$TASK"
26- ```
27-
28- or, for a long task, pipe it:
29-
30- ```sh
31- cat <<'EOF' | hax-loop
32- <task>
33- EOF
34- ```
5+# Implementer / adversary loop
356
36- `hax-loop` runs `hax -p --preset=implementer`, prints `git status` / `git diff`,
37- then `hax -p --preset=adversary --bare`. Presets live in `~/.config/hax/config.json`.
38- The implementer is launched without skills or subagent guidance so it cannot
39- see this workflow. Nested `hax-loop` is refused.
7+Coordinate the `implementer` and `adversary` skills to work through the user's request from opposing perspectives.
408
41-4. Report the diff and the review to the user. Audit with them. If the generation
42- is wrong, call `hax-loop` again with a corrected task. Do not auto-retry until
43- the review is empty.
9+Use the `implementer` skill to produce or update the solution. Then use the `adversary` skill to challenge its direction, assumptions, and result from an independent point of view. Do not frame the adversary as a code reviewer or limit it to finding defects.
4410
45-## Notes
11+Feed useful challenges, alternatives, and missed considerations back through the `implementer` skill while preserving the user's original intent and scope. Alternate between the two skills until another pass produces no meaningful change, or progress requires a decision from the user.
4612
47-- Never call `hax-loop` from an implementer or reviewer.
48-- The task is the requirement; repository docs constrain how, they do not replace
49- the task.
50-- A loop run may take a while: if the command detaches into a background task,
51- wait on it and collect the output before reporting.
13+Do not introduce scope or change the solution away from the user request during the loop.