draht-codex 2026.11.23-1 → 2026.11.24-1
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-plugin/plugin.json +1 -1
- package/CHANGELOG.md +14 -0
- package/README.md +3 -0
- package/commands/create-verification-skill.md +1 -1
- package/commands/grill.md +4 -2
- package/commands/orchestrate-loop.md +0 -1
- package/commands/orchestrate.md +2 -2
- package/commands/questionnaire.md +57 -0
- package/package.json +2 -2
- package/skills/create-verification-skill/SKILL.md +1 -1
- package/skills/create-verification-skill/command.md +1 -1
- package/skills/draht/SKILL.md +16 -11
- package/skills/grill/SKILL.md +2 -2
- package/skills/grill/command.md +4 -2
- package/skills/gsd-workflow/SKILL.md +1 -2
- package/skills/loop-workflow/SKILL.md +1 -1
- package/skills/orchestrate/command.md +2 -2
- package/skills/orchestrate-loop/command.md +0 -1
- package/skills/questionnaire/SKILL.md +15 -0
- package/skills/questionnaire/agents/openai.yaml +2 -0
- package/skills/questionnaire/command.md +57 -0
- package/skills/saga-spawner/SKILL.md +5 -6
- package/skills/unslop/SKILL.md +1 -1
- package/skills/writing-for-agents/SKILL.md +83 -0
- package/skills/writing-for-agents/references/skill-mechanics.md +25 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2026.11.24-1] - 2026-11-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- add the /questionnaire command and the writing-for-agents skill
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- separate sagas, orchestrate, and loops from GSD
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- give /grill a done condition and route test-audit in the draht router
|
|
16
|
+
|
|
3
17
|
## [2026.11.21-1] - 2026-11-21
|
|
4
18
|
|
|
5
19
|
### Fixed
|
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ Ad-hoc:
|
|
|
51
51
|
- `commands/grill.md` - whole-frontier interrogation of any subject; output form chosen at the end
|
|
52
52
|
- `commands/why.md` - code archaeology: design rationale and history via parallel evidence investigators, synthesized with confidence tiers and citations
|
|
53
53
|
- `commands/triage.md` - external issue-report triage: classify, bounded cause trace, dedupe against GitHub Issues, fail-closed ticket creation
|
|
54
|
+
- `commands/questionnaire.md` - turn a decision you can't answer alone into a questionnaire for someone else to fill in async
|
|
54
55
|
- `commands/create-verification-skill.md` - generate a committed project-local `verify-<app>` skill that drives the real app and captures proof artifacts
|
|
55
56
|
- `commands/speak.md` - speak text aloud via the ElevenLabs text-to-speech helper
|
|
56
57
|
|
|
@@ -118,6 +119,7 @@ The plugin ships a command prompt wrapper for each `commands/*.md` template:
|
|
|
118
119
|
- `grill`
|
|
119
120
|
- `why`
|
|
120
121
|
- `triage`
|
|
122
|
+
- `questionnaire`
|
|
121
123
|
- `create-verification-skill`
|
|
122
124
|
- `speak`
|
|
123
125
|
|
|
@@ -157,6 +159,7 @@ Creative:
|
|
|
157
159
|
- `model-tiering`
|
|
158
160
|
- `saga-spawner`
|
|
159
161
|
- `unslop` — cut AI tells from prose deliverables, then add voice back; includes an STE-lite register for procedures
|
|
162
|
+
- `writing-for-agents` — writing skills, prompts, and AGENTS.md for agents: context pointers, information hierarchy, completion criteria, leading words, pruning
|
|
160
163
|
- `explainers` — evidence-built Mermaid diagrams and HTML explainers for graph-shaped reports
|
|
161
164
|
- `epistemics` — confidence calibration for investigation findings
|
|
162
165
|
- `typescript-discipline` — make illegal states unrepresentable
|
|
@@ -30,7 +30,7 @@ If the checkout doesn't build or start as-is, resolve in-scope prerequisites or
|
|
|
30
30
|
|
|
31
31
|
Write `.draht/skills/verify-<app>/SKILL.md`. `.draht/skills/` is the project-level skills directory, and project skills win name collisions against installed or shipped skills — the generated skill is authoritative for its repo. (If the target project's agents discover project skills at a different path, write the identical content there instead; the skill body is host-neutral.)
|
|
32
32
|
|
|
33
|
-
Frontmatter is `name: verify-<app>` plus a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers. Then these six sections, each grounded in what the interview actually found (no placeholders left):
|
|
33
|
+
Frontmatter is `name: verify-<app>` plus a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers. Word the description and the body by `writing-for-agents`. Then these six sections, each grounded in what the interview actually found (no placeholders left):
|
|
34
34
|
|
|
35
35
|
- **Launch:** the exact command that starts the app for verification, and how to tell it's ready (a log line, a port answering, a prompt). Include teardown. For a short-lived CLI or TUI there is no server to keep alive: launch means build the binary (or install deps) once, then start each drive in its own isolated PTY or tmux session.
|
|
36
36
|
- **Doctor:** one read-only check that answers "is this instance worth driving?" — process up, right version/build, port owned by us, auth valid. Run it before the first drive and again whenever anything looks off.
|
package/commands/grill.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Grill any subject
|
|
2
|
+
description: Grill any subject — an idea, a spec, raw tickets, an architecture decision, or an open discussion; the output form is chosen at the end, not presumed at the start
|
|
3
3
|
argument-hint: "[subject]"
|
|
4
4
|
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
5
|
---
|
|
@@ -14,8 +14,10 @@ Read the relevant context before asking for repository facts. Use the `architect
|
|
|
14
14
|
|
|
15
15
|
Group related open decisions and ask the questions whose answers would change the result. Offer a recommendation with its trade-off when helpful. Defer questions that depend on unresolved answers. Preserve what the user decided, label assumptions, and follow new evidence that challenges the leading approach.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The grill is done when every open question whose answer would change the result is decided by the user or labelled an assumption, or when the user stops it. Respect requests to narrow scope or proceed with authorized work.
|
|
18
18
|
|
|
19
19
|
End with the decisions, consequential assumptions, remaining risks, and recommended next action. Produce the artifact the user requested; otherwise a chat summary is sufficient. Use project conventions for files, and `.planning/` only when that workflow is selected. Follow `unslop` for prose and preserve quoted user decisions exactly.
|
|
20
20
|
|
|
21
|
+
When an open decision belongs to someone outside the session, such as a client or another team, offer `/questionnaire` to send it to them.
|
|
22
|
+
|
|
21
23
|
A request to discuss alone does not authorize implementation. When the user subsequently asks to implement, use that authorization without requiring another ceremonial approval.
|
|
@@ -17,7 +17,6 @@ Goal: $ARGUMENTS
|
|
|
17
17
|
| Situation | Command |
|
|
18
18
|
|---|---|
|
|
19
19
|
| Decomposition is known, sub-tasks dispatch once | `/orchestrate` |
|
|
20
|
-
| Phase plans exist in `.planning/phases/` | `/execute-phase` |
|
|
21
20
|
| Goal needs iteration until a measurable criterion holds | `/orchestrate-loop` |
|
|
22
21
|
|
|
23
22
|
Loops trade tokens for persistence: use one when the work is too large or too uncertain for a single pass AND success is checkable without human judgment.
|
package/commands/orchestrate.md
CHANGED
|
@@ -64,7 +64,7 @@ Dispatch several Codex subagent calls in a single assistant turn when the sub-ta
|
|
|
64
64
|
Dispatch Codex subagent calls sequentially when later work depends on earlier output. Example: architect produces plan → implementer executes plan → verifier runs tests → reviewer audits the diff.
|
|
65
65
|
|
|
66
66
|
### Fan-out / Fan-in
|
|
67
|
-
Architect decomposes independent work → dispatch implementers in parallel → collect results for verification and review. When both reviews are selected, spec review precedes quality review
|
|
67
|
+
Architect decomposes independent work → dispatch implementers in parallel → collect results for verification and review. When both reviews are selected, spec review precedes quality review.
|
|
68
68
|
|
|
69
69
|
### Two-Stage Review (spec → quality)
|
|
70
70
|
When the requested workflow needs separate spec and quality review, use this order:
|
|
@@ -75,7 +75,7 @@ implementer → spec-reviewer → reviewer
|
|
|
75
75
|
re-dispatch implementer with required fixes
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Never run quality review on a spec-non-compliant diff.
|
|
78
|
+
Never run quality review on a spec-non-compliant diff.
|
|
79
79
|
|
|
80
80
|
### Loop (iterate until a check passes)
|
|
81
81
|
When the work cannot land in one dispatch but success is provable by a deterministic check, do not improvise retries here — hand off to `/orchestrate-loop`. It runs fresh worker iterations gated by an independent re-run of the check, with max-iteration and stall bounds. See the `loop-workflow` skill for the discipline.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Turn a decision you can't fully answer into a questionnaire for someone else to fill in async
|
|
3
|
+
argument-hint: "[topic]"
|
|
4
|
+
allowed-tools: Read, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /questionnaire
|
|
8
|
+
|
|
9
|
+
Topic: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Turn something the user can't answer alone into a **questionnaire**: a Markdown document they hand to one person to fill in async, or fill out together over a meeting. The recipient holds knowledge the user lacks; the questionnaire pulls it out of them.
|
|
12
|
+
|
|
13
|
+
**Grill the send, not the subject.** Interview the user only about the _send_, which they can always answer: who it goes to, and what they need back. The questions in the document then target the **gap** between what the recipient knows and what the user needs.
|
|
14
|
+
|
|
15
|
+
1. **Who is it going to?** Ask, in one exchange, the recipient's role, expertise, language, and relationship to the user. This fixes the questionnaire's tone and how much context it must carry. Done when you know who the recipient is and what they know that the user doesn't.
|
|
16
|
+
|
|
17
|
+
2. **What do you need back?** Ask, in one exchange, the specific decisions or facts the user can't resolve alone and needs from this person. When the topic or the session already lists them, confirm that list instead. Done when you have a concrete list of what the user must walk away able to do or decide.
|
|
18
|
+
|
|
19
|
+
3. **Write the questionnaire.** Draft questions aimed at the gap from steps 1–2, following the Document structure below, in the recipient's language and by `unslop`. Write it to `questionnaire-<slug>.md` in the current directory (slug from the topic; when that file exists, add a numeric suffix rather than replace it) and report the path. Done when the file exists and every item the user named in step 2 is covered by a question.
|
|
20
|
+
|
|
21
|
+
## Document structure
|
|
22
|
+
|
|
23
|
+
Frame the document as a **discovery questionnaire**: the user lacks context, the recipient holds it. Order questions most-important-first, since async means you may only get one pass, and group them under `##` headings by theme once there are more than a handful. Write it using the template below.
|
|
24
|
+
|
|
25
|
+
<questionnaire-template>
|
|
26
|
+
|
|
27
|
+
# <Questionnaire title>
|
|
28
|
+
|
|
29
|
+
**Purpose:** why this questionnaire exists and the decision riding on it.
|
|
30
|
+
|
|
31
|
+
**From:** <the user>, **To:** <the recipient>, **How your answers will be used:** <where they go>
|
|
32
|
+
|
|
33
|
+
## Context
|
|
34
|
+
|
|
35
|
+
One paragraph orienting a recipient who wasn't in the user's head. Enough to answer well, not a page.
|
|
36
|
+
|
|
37
|
+
## How to answer
|
|
38
|
+
|
|
39
|
+
Deadline and rough effort. Partial answers and "I don't know" are useful: flag anything you're unsure of rather than skipping it.
|
|
40
|
+
|
|
41
|
+
## <Theme heading>
|
|
42
|
+
|
|
43
|
+
One `##` section per theme. Under each, its questions, most-important-first. Every question is one idea, never compound, with an answer stub directly beneath, and a one-line _why this matters_ only where the question could be misread or invite a throwaway answer.
|
|
44
|
+
|
|
45
|
+
<question-example>
|
|
46
|
+
### What load is the system expected to handle at launch?
|
|
47
|
+
|
|
48
|
+
_Why this matters: it decides whether we provision for burst traffic now or defer it._
|
|
49
|
+
|
|
50
|
+
>
|
|
51
|
+
</question-example>
|
|
52
|
+
|
|
53
|
+
## Anything else?
|
|
54
|
+
|
|
55
|
+
A closing catch-all: anything we didn't ask that we should know?
|
|
56
|
+
|
|
57
|
+
</questionnaire-template>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "draht-codex",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.24-1",
|
|
4
4
|
"description": "Draht GSD, multi-agent, TDD and DDD workflows as a Codex plugin. Install with `npx draht-codex install`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepublishOnly": "node ../../scripts/sync-draht-tools.mjs && node ../../scripts/generate-skills-artifacts.mjs --check && node ../../scripts/sync-checks-runtime.mjs --check"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@draht/tools": "2026.11.
|
|
30
|
+
"@draht/tools": "2026.11.24-1"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"codex",
|
|
@@ -11,4 +11,4 @@ When invoked:
|
|
|
11
11
|
1. Read `./command.md` in this skill's directory.
|
|
12
12
|
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
13
|
3. Follow that command template as the active workflow.
|
|
14
|
-
4. Use Draht support skills such as `
|
|
14
|
+
4. Use Draht support skills such as `writing-for-agents` or `verification-gate` when the command template calls for that discipline.
|
|
@@ -30,7 +30,7 @@ If the checkout doesn't build or start as-is, resolve in-scope prerequisites or
|
|
|
30
30
|
|
|
31
31
|
Write `.draht/skills/verify-<app>/SKILL.md`. `.draht/skills/` is the project-level skills directory, and project skills win name collisions against installed or shipped skills — the generated skill is authoritative for its repo. (If the target project's agents discover project skills at a different path, write the identical content there instead; the skill body is host-neutral.)
|
|
32
32
|
|
|
33
|
-
Frontmatter is `name: verify-<app>` plus a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers. Then these six sections, each grounded in what the interview actually found (no placeholders left):
|
|
33
|
+
Frontmatter is `name: verify-<app>` plus a `description` that names the app, the surface, and when to reach for it — without frontmatter the skill never registers. Word the description and the body by `writing-for-agents`. Then these six sections, each grounded in what the interview actually found (no placeholders left):
|
|
34
34
|
|
|
35
35
|
- **Launch:** the exact command that starts the app for verification, and how to tell it's ready (a log line, a port answering, a prompt). Include teardown. For a short-lived CLI or TUI there is no server to keep alive: launch means build the binary (or install deps) once, then start each drive in its own isolated PTY or tmux session.
|
|
36
36
|
- **Doctor:** one read-only check that answers "is this instance worth driving?" — process up, right version/build, port owned by us, auth valid. Run it before the first drive and again whenever anything looks off.
|
package/skills/draht/SKILL.md
CHANGED
|
@@ -13,21 +13,21 @@ This catalog routes to sibling skills; it does not activate them all.
|
|
|
13
13
|
|
|
14
14
|
## Two Kinds of Sibling Skills
|
|
15
15
|
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
16
|
+
- **18 support skills** — load the relevant discipline or explicitly chosen workflow: `atomic-reasoning`, `blast-radius`, `brainstorming`, `ddd-workflow`, `debugging-workflow`, `epistemics`, `explainers`, `gsd-workflow`, `judge`, `loop-workflow`, `model-tiering`, `saga-spawner`, `tdd-workflow`, `test-audit`, `typescript-discipline`, `unslop`, `verification-gate`, `writing-for-agents`.
|
|
17
|
+
- **25 command skills** — explicit actions, including ad-hoc work and optional GSD lifecycle stages: `new-project`, `init-project`, `map-codebase`, `discuss-phase`, `plan-phase`, `execute-phase`, `verify-work`, `next-milestone`, `pause-work`, `resume-work`, `progress`, `quick`, `fix`, `review`, `atomic-commit`, `orchestrate`, `orchestrate-loop`, `resolve-conflicts`, `grill`, `why`, `create-verification-skill`, `triage`, `questionnaire`, `speak`, `budget`.
|
|
18
18
|
|
|
19
19
|
Every skill's frontmatter `name` matches its directory name, so `skills/<name>/` and the name you invoke are always the same string.
|
|
20
20
|
|
|
21
21
|
## Repository Layout
|
|
22
22
|
|
|
23
23
|
- `skills/<name>/SKILL.md` — every skill has one; frontmatter (`name`, `description`) plus instructions.
|
|
24
|
-
- `skills/<name>/command.md` — the
|
|
25
|
-
- The
|
|
24
|
+
- `skills/<name>/command.md` — the 25 command skills only. This is the full prompt template; the command skill's `SKILL.md` is a thin wrapper that reads it.
|
|
25
|
+
- The 18 support skills have no `command.md` — their `SKILL.md` is self-contained.
|
|
26
26
|
- This file, `skills/draht/SKILL.md`, is itself a plain skill (no `command.md`) — it is discovered and loaded the same way any discipline skill is.
|
|
27
27
|
|
|
28
28
|
## How the Catalog Composes
|
|
29
29
|
|
|
30
|
-
An explicitly selected command may use supporting disciplines; ordinary requests do not need a command workflow. `plan-phase` and `execute-phase` both assume `atomic-reasoning` and `tdd-workflow`; every command that ends with a completion claim assumes `verification-gate`; `fix` applies the `debugging-workflow` protocol; `orchestrate-loop` is `loop-workflow` applied to one goal; `why` leans on `epistemics` for every claim it reports; `triage` borrows `debugging-workflow`'s cause-first discipline for its bounded trace and `epistemics` for labeling what it carries into a ticket; `create-verification-skill` generates the project-local harness whose evidence `verification-gate` demands and `verify-work`'s verifier drives; `review`'s refutation step escalates to `blast-radius`'s rung-4 script when a Critical finding hinges on library or runtime behavior; `why`, `review`, `plan-phase`, `verify-work`, and `blast-radius` reach for `explainers` when their output is a graph
|
|
30
|
+
An explicitly selected command may use supporting disciplines; ordinary requests do not need a command workflow. `plan-phase` and `execute-phase` both assume `atomic-reasoning` and `tdd-workflow`; every command that ends with a completion claim assumes `verification-gate`; `fix` applies the `debugging-workflow` protocol; `orchestrate-loop` is `loop-workflow` applied to one goal; `why` leans on `epistemics` for every claim it reports; `triage` borrows `debugging-workflow`'s cause-first discipline for its bounded trace and `epistemics` for labeling what it carries into a ticket; `create-verification-skill` generates the project-local harness whose evidence `verification-gate` demands and `verify-work`'s verifier drives; `review`'s refutation step escalates to `blast-radius`'s rung-4 script when a Critical finding hinges on library or runtime behavior; `why`, `review`, `plan-phase`, `verify-work`, and `blast-radius` reach for `explainers` when their output is a graph; `grill` offers `questionnaire` for a decision that belongs to someone outside the session; `create-verification-skill` words its generated skill by `writing-for-agents`. When in doubt about which disciplines a command skill pulls in, open that command skill's `command.md` — the disciplines it expects are named in its own text.
|
|
31
31
|
|
|
32
32
|
## Situation → Skill
|
|
33
33
|
|
|
@@ -61,9 +61,10 @@ An explicitly selected command may use supporting disciplines; ordinary requests
|
|
|
61
61
|
| Decomposing a task and dispatching the right mix of specialists | `orchestrate` |
|
|
62
62
|
| Running one goal in a deterministic-check-gated loop until it passes | `orchestrate-loop` |
|
|
63
63
|
| Resolving an in-progress merge/rebase conflict — including a failed `agent/<taskId>` worktree merge-back | `resolve-conflicts` |
|
|
64
|
-
| Stress-testing any subject — an idea, a spec, tickets, a decision —
|
|
64
|
+
| Stress-testing any subject — an idea, a spec, tickets, a decision — with questions until every decision that changes the result is made | `grill` |
|
|
65
|
+
| Sending a decision you can't answer alone to someone else — a client, another team — as an async questionnaire | `questionnaire` |
|
|
65
66
|
| Recovering why code is the way it is — design rationale, decision history, rejected alternatives | `why` |
|
|
66
|
-
| Generating a
|
|
67
|
+
| Generating a project-local `verify-<app>` skill that drives the real app as a user and captures proof artifacts | `create-verification-skill` |
|
|
67
68
|
| Classifying an external issue report — dedupe, file, reroute, or answer — without fixing it | `triage` |
|
|
68
69
|
|
|
69
70
|
### Supporting disciplines and optional workflows
|
|
@@ -81,8 +82,10 @@ An explicitly selected command may use supporting disciplines; ordinary requests
|
|
|
81
82
|
| Putting a human in the loop — permission prompts and finished turns queued as cards to swipe through | `judge` |
|
|
82
83
|
| Advancing a repo unattended — saga graph, beats, scheduled or cloud routines | `saga-spawner` |
|
|
83
84
|
| Writing testable code — the red → green → refactor cycle | `tdd-workflow` |
|
|
85
|
+
| Writing, changing, reviewing, or sweeping tests — gating new tests and cutting low-value ones | `test-audit` |
|
|
84
86
|
| Writing or editing TypeScript — modelling state, narrowing, casts, exhaustiveness | `typescript-discipline` |
|
|
85
87
|
| Editing prose deliverables — cutting AI tells from docs, reports, handoffs, commit bodies | `unslop` |
|
|
88
|
+
| Writing or editing text an agent reads — skills, command and agent prompts, AGENTS.md, CLAUDE.md | `writing-for-agents` |
|
|
86
89
|
| About to claim "done", "fixed", "passing", "ready", or "complete" | `verification-gate` |
|
|
87
90
|
|
|
88
91
|
## Disambiguation
|
|
@@ -93,18 +96,20 @@ A few sibling pairs are easy to reach for incorrectly:
|
|
|
93
96
|
- `quick` vs `execute-phase` — `quick` completes an ad-hoc task without planning artifacts; `execute-phase` explicitly selects execution of existing phase plans and their review gates.
|
|
94
97
|
- `orchestrate` vs `orchestrate-loop` — `orchestrate` fans a task out to specialists once; `orchestrate-loop` re-runs one worker against a deterministic check until it passes or a bound is hit.
|
|
95
98
|
- `review` vs `verify-work` — `review` is ad hoc, any time; `verify-work` is the phase-level acceptance gate and additionally checks the diff against the phase's plan files.
|
|
96
|
-
- `grill` vs `brainstorming` — `brainstorming`
|
|
99
|
+
- `grill` vs `brainstorming` — `brainstorming` helps the user choose an approach to a goal; `grill` stress-tests a subject the user already has, with no presumed outcome — the artifact (spec, tickets, decision record, notes, or nothing) is chosen at the end.
|
|
100
|
+
- `grill` vs `questionnaire` — `grill` questions the user in the session; `questionnaire` writes a document for someone else to answer async and asks the user only who it goes to and what they need back.
|
|
97
101
|
- `why` vs `fix`/`debugging-workflow` — `why` reconstructs intent and history when nothing is misbehaving ("why is it built this way"); `fix` and the debugging protocol answer defects ("why is it doing the wrong thing right now"). A `why` run that uncovers a live defect hands off to `fix`; a `fix` that needs design intent consults `why`.
|
|
98
102
|
- `blast-radius` vs `review` — `review` audits a diff for defects across the board and merges subagent findings; `blast-radius` investigates one change's impact beyond the diff, reducing its safety to a single fact proven by running real code. `review`'s refutation step borrows blast-radius's rung-4 bar for Critical findings; the phrase "uncertainty × blast radius" in the planning commands is a risk-ordering heuristic, not this skill.
|
|
99
|
-
- `create-verification-skill` vs `verify-work` — `verify-work` is the recurring phase acceptance gate; `create-verification-skill` is the one-time generator of the
|
|
103
|
+
- `create-verification-skill` vs `verify-work` — `verify-work` is the recurring phase acceptance gate; `create-verification-skill` is the one-time generator of the `verify-<app>` skill that `verify-work`'s verifier then drives. Generate once, drive every phase.
|
|
100
104
|
- `triage` vs `fix` — `fix` starts from a bug you already own and ends in a landed fix; `triage` starts from someone else's report and ends in one verdict: a classification, a typed dedupe outcome, and at most one tracker issue. A `[triage:bug]` marker with its tracker link is a ready entry into `fix`; `triage` never fixes, and `fix` never files tickets.
|
|
105
|
+
- `unslop` vs `writing-for-agents` — `unslop` edits prose a person reads; `writing-for-agents` covers text an agent reads, where the wording decides what the agent does and when it loads the material.
|
|
101
106
|
|
|
102
107
|
## Host Invocation
|
|
103
108
|
|
|
104
109
|
| Host | How to invoke a draht skill |
|
|
105
110
|
|---|---|
|
|
106
|
-
| Claude Code | `/draht:<command>` slash commands for the
|
|
107
|
-
| Codex | `$draht:<command>` prompts, or `/skills` and pick the wrapper, for the
|
|
111
|
+
| Claude Code | `/draht:<command>` slash commands for the 25 command skills (for example `/draht:plan-phase`); the 18 discipline skills load automatically by description match or on request |
|
|
112
|
+
| Codex | `$draht:<command>` prompts, or `/skills` and pick the wrapper, for the 25 command skills; discipline skills load automatically or by name |
|
|
108
113
|
| Any Agent-Skills-compatible host | invoke the sibling skill directly by name — every `SKILL.md` in this tree is self-contained and portable |
|
|
109
114
|
| draht CLI (`@draht/coding-agent`) | work directly with the coding tools, or explicitly invoke a bundled command |
|
|
110
115
|
|
package/skills/grill/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: grill
|
|
3
|
-
description:
|
|
3
|
+
description: Grill an idea, spec, plan, or decision with critical questions. Use when the user asks to grill or stress-test it.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Draht Command: grill
|
|
@@ -11,4 +11,4 @@ When invoked:
|
|
|
11
11
|
1. Read `./command.md` in this skill's directory.
|
|
12
12
|
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
13
13
|
3. Follow that command template as the active workflow.
|
|
14
|
-
4. Use Draht
|
|
14
|
+
4. Use Draht skills such as `unslop` or `questionnaire` when the command template calls for them.
|
package/skills/grill/command.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Grill any subject
|
|
2
|
+
description: Grill any subject — an idea, a spec, raw tickets, an architecture decision, or an open discussion; the output form is chosen at the end, not presumed at the start
|
|
3
3
|
argument-hint: "[subject]"
|
|
4
4
|
allowed-tools: Bash, Read, Write, Edit, Task
|
|
5
5
|
---
|
|
@@ -14,8 +14,10 @@ Read the relevant context before asking for repository facts. Use the `architect
|
|
|
14
14
|
|
|
15
15
|
Group related open decisions and ask the questions whose answers would change the result. Offer a recommendation with its trade-off when helpful. Defer questions that depend on unresolved answers. Preserve what the user decided, label assumptions, and follow new evidence that challenges the leading approach.
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
The grill is done when every open question whose answer would change the result is decided by the user or labelled an assumption, or when the user stops it. Respect requests to narrow scope or proceed with authorized work.
|
|
18
18
|
|
|
19
19
|
End with the decisions, consequential assumptions, remaining risks, and recommended next action. Produce the artifact the user requested; otherwise a chat summary is sufficient. Use project conventions for files, and `.planning/` only when that workflow is selected. Follow `unslop` for prose and preserve quoted user decisions exactly.
|
|
20
20
|
|
|
21
|
+
When an open decision belongs to someone outside the session, such as a client or another team, offer `/questionnaire` to send it to them.
|
|
22
|
+
|
|
21
23
|
A request to discuss alone does not authorize implementation. When the user subsequently asks to implement, use that authorization without requiring another ceremonial approval.
|
|
@@ -8,7 +8,7 @@ description: Optional GSD milestone and phase workflow with .planning/ artifacts
|
|
|
8
8
|
|
|
9
9
|
GSD is an optional milestone → phase → plan → task hierarchy in `.planning/`, selected through explicit project-management commands. It is not required for ordinary coding, debugging, review, or verification. The presence of `.planning/` alone does not select this workflow; it may hold only a codebase graph or historical context.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
The user runs phases by hand, one at a time, through `/discuss-phase`, `/plan-phase`, `/execute-phase`, and `/verify-work`. Sagas (`saga-spawner`), `/orchestrate`, and `/orchestrate-loop` are separate workflows and never drive GSD phases.
|
|
12
12
|
|
|
13
13
|
## Directory Structure
|
|
14
14
|
|
|
@@ -78,7 +78,6 @@ Session resets are optional. Carry relevant plans, evidence, and unresolved work
|
|
|
78
78
|
- **`/fix`** — investigate a bug, test the leading explanation, then fix and verify it. Stops after 3 failed fix attempts without treating that retry limit as a diagnosis.
|
|
79
79
|
- **`/review`** — parallel `reviewer` + `security-auditor`, plus `spec-reviewer` when a plan is in scope.
|
|
80
80
|
- **`/atomic-commit`** — analyze the diff and create authorized atomic conventional commits.
|
|
81
|
-
- **`/orchestrate`** — general-purpose specialist dispatch with parallel / chain / fan-out / two-stage modes.
|
|
82
81
|
|
|
83
82
|
## Subagent Roster
|
|
84
83
|
|
|
@@ -5,7 +5,7 @@ description: Design bounded agent loops with explicit stopping conditions, deter
|
|
|
5
5
|
|
|
6
6
|
# Loop Workflow
|
|
7
7
|
|
|
8
|
-
Use a loop when repeated work has an observable stopping condition. A small task can finish in one pass;
|
|
8
|
+
Use a loop when repeated work has an observable stopping condition. A small task can finish in one pass; fresh sessions are an optional coordination choice.
|
|
9
9
|
|
|
10
10
|
Define the check, iteration/time budget, and stall condition before starting. Completion depends on the check's actual outcome, not the worker's status text. A check proves only the property it tests; review its adequacy for the goal.
|
|
11
11
|
|
|
@@ -64,7 +64,7 @@ Dispatch several Codex subagent calls in a single assistant turn when the sub-ta
|
|
|
64
64
|
Dispatch Codex subagent calls sequentially when later work depends on earlier output. Example: architect produces plan → implementer executes plan → verifier runs tests → reviewer audits the diff.
|
|
65
65
|
|
|
66
66
|
### Fan-out / Fan-in
|
|
67
|
-
Architect decomposes independent work → dispatch implementers in parallel → collect results for verification and review. When both reviews are selected, spec review precedes quality review
|
|
67
|
+
Architect decomposes independent work → dispatch implementers in parallel → collect results for verification and review. When both reviews are selected, spec review precedes quality review.
|
|
68
68
|
|
|
69
69
|
### Two-Stage Review (spec → quality)
|
|
70
70
|
When the requested workflow needs separate spec and quality review, use this order:
|
|
@@ -75,7 +75,7 @@ implementer → spec-reviewer → reviewer
|
|
|
75
75
|
re-dispatch implementer with required fixes
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
Never run quality review on a spec-non-compliant diff.
|
|
78
|
+
Never run quality review on a spec-non-compliant diff.
|
|
79
79
|
|
|
80
80
|
### Loop (iterate until a check passes)
|
|
81
81
|
When the work cannot land in one dispatch but success is provable by a deterministic check, do not improvise retries here — hand off to `/orchestrate-loop`. It runs fresh worker iterations gated by an independent re-run of the check, with max-iteration and stall bounds. See the `loop-workflow` skill for the discipline.
|
|
@@ -17,7 +17,6 @@ Goal: $ARGUMENTS
|
|
|
17
17
|
| Situation | Command |
|
|
18
18
|
|---|---|
|
|
19
19
|
| Decomposition is known, sub-tasks dispatch once | `/orchestrate` |
|
|
20
|
-
| Phase plans exist in `.planning/phases/` | `/execute-phase` |
|
|
21
20
|
| Goal needs iteration until a measurable criterion holds | `/orchestrate-loop` |
|
|
22
21
|
|
|
23
22
|
Loops trade tokens for persistence: use one when the work is too large or too uncertain for a single pass AND success is checkable without human judgment.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
disable-model-invocation: true
|
|
3
|
+
name: questionnaire
|
|
4
|
+
description: Run the Draht questionnaire command when the user explicitly selects it to turn a decision they cannot answer alone into a questionnaire for someone else to fill in.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Draht Command: questionnaire
|
|
8
|
+
|
|
9
|
+
This skill exposes the Draht prompt command template to Codex's `$draht` and `/skills` surfaces.
|
|
10
|
+
|
|
11
|
+
When invoked:
|
|
12
|
+
1. Read `./command.md` in this skill's directory.
|
|
13
|
+
2. Treat the user's text after the skill mention as `$ARGUMENTS`. If the template uses `$1`, use the first positional argument.
|
|
14
|
+
3. Follow that command template as the active workflow.
|
|
15
|
+
4. Use Draht support skills such as `unslop` when the command template calls for that discipline.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Turn a decision you can't fully answer into a questionnaire for someone else to fill in async
|
|
3
|
+
argument-hint: "[topic]"
|
|
4
|
+
allowed-tools: Read, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /questionnaire
|
|
8
|
+
|
|
9
|
+
Topic: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
Turn something the user can't answer alone into a **questionnaire**: a Markdown document they hand to one person to fill in async, or fill out together over a meeting. The recipient holds knowledge the user lacks; the questionnaire pulls it out of them.
|
|
12
|
+
|
|
13
|
+
**Grill the send, not the subject.** Interview the user only about the _send_, which they can always answer: who it goes to, and what they need back. The questions in the document then target the **gap** between what the recipient knows and what the user needs.
|
|
14
|
+
|
|
15
|
+
1. **Who is it going to?** Ask, in one exchange, the recipient's role, expertise, language, and relationship to the user. This fixes the questionnaire's tone and how much context it must carry. Done when you know who the recipient is and what they know that the user doesn't.
|
|
16
|
+
|
|
17
|
+
2. **What do you need back?** Ask, in one exchange, the specific decisions or facts the user can't resolve alone and needs from this person. When the topic or the session already lists them, confirm that list instead. Done when you have a concrete list of what the user must walk away able to do or decide.
|
|
18
|
+
|
|
19
|
+
3. **Write the questionnaire.** Draft questions aimed at the gap from steps 1–2, following the Document structure below, in the recipient's language and by `unslop`. Write it to `questionnaire-<slug>.md` in the current directory (slug from the topic; when that file exists, add a numeric suffix rather than replace it) and report the path. Done when the file exists and every item the user named in step 2 is covered by a question.
|
|
20
|
+
|
|
21
|
+
## Document structure
|
|
22
|
+
|
|
23
|
+
Frame the document as a **discovery questionnaire**: the user lacks context, the recipient holds it. Order questions most-important-first, since async means you may only get one pass, and group them under `##` headings by theme once there are more than a handful. Write it using the template below.
|
|
24
|
+
|
|
25
|
+
<questionnaire-template>
|
|
26
|
+
|
|
27
|
+
# <Questionnaire title>
|
|
28
|
+
|
|
29
|
+
**Purpose:** why this questionnaire exists and the decision riding on it.
|
|
30
|
+
|
|
31
|
+
**From:** <the user>, **To:** <the recipient>, **How your answers will be used:** <where they go>
|
|
32
|
+
|
|
33
|
+
## Context
|
|
34
|
+
|
|
35
|
+
One paragraph orienting a recipient who wasn't in the user's head. Enough to answer well, not a page.
|
|
36
|
+
|
|
37
|
+
## How to answer
|
|
38
|
+
|
|
39
|
+
Deadline and rough effort. Partial answers and "I don't know" are useful: flag anything you're unsure of rather than skipping it.
|
|
40
|
+
|
|
41
|
+
## <Theme heading>
|
|
42
|
+
|
|
43
|
+
One `##` section per theme. Under each, its questions, most-important-first. Every question is one idea, never compound, with an answer stub directly beneath, and a one-line _why this matters_ only where the question could be misread or invite a throwaway answer.
|
|
44
|
+
|
|
45
|
+
<question-example>
|
|
46
|
+
### What load is the system expected to handle at launch?
|
|
47
|
+
|
|
48
|
+
_Why this matters: it decides whether we provision for burst traffic now or defer it._
|
|
49
|
+
|
|
50
|
+
>
|
|
51
|
+
</question-example>
|
|
52
|
+
|
|
53
|
+
## Anything else?
|
|
54
|
+
|
|
55
|
+
A closing catch-all: anything we didn't ask that we should know?
|
|
56
|
+
|
|
57
|
+
</questionnaire-template>
|
|
@@ -32,7 +32,7 @@ beats:
|
|
|
32
32
|
attempts: 0
|
|
33
33
|
spec: |
|
|
34
34
|
One-paragraph spec of the shippable increment. The PR is mergeable
|
|
35
|
-
exactly when this holds.
|
|
35
|
+
exactly when this holds.
|
|
36
36
|
check: "npm run check && npx tsx ../../node_modules/vitest/dist/cli.js --run test/stream.test.ts"
|
|
37
37
|
```
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ Rules for the graph:
|
|
|
42
42
|
- `check` is a deterministic command whose exit code proves the spec. No check, no beat — a beat without a check is a wish, and per `loop-workflow` the loop is only as good as its check.
|
|
43
43
|
- Only `ready | done | blocked` are ever written to the file. In-flight and in-review are **derived** from GitHub each run, never stored — stored liveness lies the moment a session dies.
|
|
44
44
|
- `deps` are satisfied only by `status: done` **on main**. An unmerged PR satisfies nothing.
|
|
45
|
-
-
|
|
45
|
+
- A beat is self-contained: the run plans, builds, and verifies it from its `spec` and `check` alone.
|
|
46
46
|
|
|
47
47
|
## Coordination: the branch is the lease
|
|
48
48
|
|
|
@@ -57,7 +57,7 @@ Concurrent runs are real — a nightly trigger and a PR-merge trigger can fire m
|
|
|
57
57
|
|
|
58
58
|
One reconciliation iteration. Every step is safe to kill and safe to repeat.
|
|
59
59
|
|
|
60
|
-
1. **Orient** — read `.planning/saga-graph.yaml
|
|
60
|
+
1. **Orient** — read `.planning/saga-graph.yaml`. `gh pr list --state all` filtered to `beat/*` heads. Graph-first: if `.planning/codebase/MAP.json` exists, use `draht-tools graph-context` / `graph-impact` before grepping.
|
|
61
61
|
2. **Reconcile** — compute truth from GitHub:
|
|
62
62
|
- merged PR for `beat/<id>` → beat is `done` (the work PR already flipped it; verify main agrees)
|
|
63
63
|
- closed-unmerged PR → `attempts + 1`; at `max_attempts` → `status: blocked` (needs human)
|
|
@@ -65,7 +65,7 @@ One reconciliation iteration. Every step is safe to kill and safe to repeat.
|
|
|
65
65
|
- durable mutations (attempts, blocked flips, new audit beats) land as one graph-file-only PR from `saga/reconcile-<YYYYMMDD-HHmm>`. No mutations, no PR.
|
|
66
66
|
3. **Select** — ready set = `status: ready` ∧ all deps `done` ∧ (`risk` < high ∨ `approved`) ∧ not in-flight. Order riskiest-first — highest uncertainty × blast radius fails the graph cheapest, before effort is sunk into work it would obsolete (`/orchestrate` rule). Take up to `max_in_flight − |in-flight|`. Zero selected and zero in-flight → **Idle mode** below.
|
|
67
67
|
4. **Spawn** — per selected beat: acquire the lease, then drive the inner cycle on the branch through Codex subagents with `spawn_agent`, `/orchestrate` discipline throughout:
|
|
68
|
-
- `architect` turns the spec into an atomic plan
|
|
68
|
+
- `architect` turns the spec into an atomic plan
|
|
69
69
|
- `implementer` fan-out per plan — TDD red → green → refactor inside each task; tasks within a plan sequential, independent plans parallel
|
|
70
70
|
- two-stage review: `spec-reviewer` first, `reviewer` second — never quality-review a spec-non-compliant diff
|
|
71
71
|
- `verifier` runs the beat's `check` plus the suite; the orchestrating context **re-runs the check itself** — subagent claims are inputs, not verdicts (`verification-gate`)
|
|
@@ -85,7 +85,7 @@ Bounded, read-mostly audit pass:
|
|
|
85
85
|
| Coverage gaps | `.planning/TEST-STRATEGY.md` vs actual coverage |
|
|
86
86
|
| Docs drift | README / `docs/` claims vs current code |
|
|
87
87
|
| Dependency staleness | lockfile vs upstream, majors flagged high risk |
|
|
88
|
-
| Flaky or slow checks |
|
|
88
|
+
| Flaky or slow checks | CI history |
|
|
89
89
|
|
|
90
90
|
Emit at most `audit_max_new` findings as `kind: audit` beats in the reconcile PR — each with spec, check, risk tier, deps if ordering matters. Dedupe against existing beats and the `declined` list. `risk` ≤ `audit_auto_risk` beats are spawn-eligible next run; everything above waits for a human `approved: true`. A human deleting an audit beat moves its id to `declined` — it is never re-emitted.
|
|
91
91
|
|
|
@@ -117,7 +117,6 @@ Run this command's session on the strongest available Codex reasoning tier and l
|
|
|
117
117
|
|
|
118
118
|
- `loop-workflow` — the spawner is the session-based loop at repo scope; consult it before adding any retry behaviour here
|
|
119
119
|
- `atomic-reasoning` — cuts the beats; the well-cut test above is its acceptance bar
|
|
120
|
-
- `gsd-workflow` — supplies the inner per-beat cycle and the `.planning/` structure beats map onto
|
|
121
120
|
- `verification-gate` — evidence labeling for everything quoted in PR bodies and run reports
|
|
122
121
|
- `model-tiering` — orchestrator/executor economics for the fan-out
|
|
123
122
|
|
package/skills/unslop/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Edit requested prose for clarity, specificity, and the reader's reg
|
|
|
7
7
|
|
|
8
8
|
Apply to prose you are writing or were asked to edit: documentation, reports, handoffs, specs, commit bodies, and client-facing text. Preserve meaning and the author's intended tone. Do not sweep unrelated repository text.
|
|
9
9
|
|
|
10
|
-
Exclude code, identifiers, code comments, quoted evidence, and user-authored text outside the request. Draht's prompt and skill corpus is outside this skill's scope. Keep fixed formats exact, including conventional commit subjects, `red:`/`green:`/`refactor:`, `STATUS:` lines, frontmatter, and verdict-first reports.
|
|
10
|
+
Exclude code, identifiers, code comments, quoted evidence, and user-authored text outside the request. Draht's prompt and skill corpus is outside this skill's scope; `writing-for-agents` covers it. Keep fixed formats exact, including conventional commit subjects, `red:`/`green:`/`refactor:`, `STATUS:` lines, frontmatter, and verdict-first reports.
|
|
11
11
|
|
|
12
12
|
Lead with the concrete fact or action. Name actors, mechanisms, and evidence. Replace promotional claims, vague attribution, filler, repeated conclusions, and unnecessary jargon with specific information or remove them. Preserve established project terminology.
|
|
13
13
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: writing-for-agents
|
|
3
|
+
description: Write or edit text an agent consumes. Use when creating or editing a skill, a command or agent prompt, AGENTS.md or CLAUDE.md, or a doc one of them points at.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing for agents
|
|
7
|
+
|
|
8
|
+
Reference for writing any document an agent consumes: a skill, a command or agent prompt, an `AGENTS.md` / `CLAUDE.md`, a doc reached by a pointer. The packaging differs; the writing does not: the same levers make each one predictable, since the agent takes the same _process_ every run rather than producing the same output. Prose a person reads is `unslop`'s job.
|
|
9
|
+
|
|
10
|
+
When the document you're writing is a skill, read [`references/skill-mechanics.md`](references/skill-mechanics.md) for frontmatter, invocation choice, and router skills.
|
|
11
|
+
|
|
12
|
+
## Context pointers
|
|
13
|
+
|
|
14
|
+
A **context pointer** is a reference held in the agent's context that names some out-of-context material and encodes the condition for reaching it. A skill's description is one; a line in `AGENTS.md` naming a doc is the same object. The pointer's _wording_, not its target, decides when the agent reaches the material, and how reliably. A must-have target behind a weakly worded pointer is a variance bug: sharpen the wording first, and inline the material only if sharpening fails.
|
|
15
|
+
|
|
16
|
+
A pointer does two jobs: state what the material is, and list the **branches** that should trigger reaching it (a branch is a distinct case the document handles, so different runs take different paths through it). Every word of an always-loaded pointer costs on every turn, so it earns even harder pruning than the body:
|
|
17
|
+
|
|
18
|
+
- **Front-load the leading word**: the pointer is where it does its triggering work.
|
|
19
|
+
- **One trigger per branch.** Synonyms that rename a single branch are one branch written twice; collapse them and keep only genuinely distinct branches.
|
|
20
|
+
- **Cut identity the body already carries.**
|
|
21
|
+
|
|
22
|
+
## The two loads
|
|
23
|
+
|
|
24
|
+
Every document and pointer you add spends one of two budgets:
|
|
25
|
+
|
|
26
|
+
- **Context load** is the cost of always-loaded material on the agent's window: an `AGENTS.md` line, a skill description, anything sitting in context every turn, spending tokens and attention whether or not it fires.
|
|
27
|
+
- **Cognitive load** is the cost on the human: which documents exist and when to reach for each. The human is the index. Not a cost to minimise: it is the price of human agency; spend it where human judgement matters, remove it where it does not.
|
|
28
|
+
|
|
29
|
+
Material reached only through a pointer escapes context load at the price of the pointer's own line; material with no pointer at all rides entirely on cognitive load.
|
|
30
|
+
|
|
31
|
+
## Information hierarchy
|
|
32
|
+
|
|
33
|
+
A document is built from two content types: **steps** (the ordered actions the agent performs) and **reference** (definitions, rules, facts consulted on demand). The two mix freely: all steps (a recipe), all reference (a review's rules, this skill), or both. The core decision is where each piece sits on the **information hierarchy**, a ladder ranked by how immediately the agent needs the material:
|
|
34
|
+
|
|
35
|
+
1. **In-file step** is the primary tier: what the agent does, in order.
|
|
36
|
+
2. **In-file reference** is consulted on demand. Often a legitimately flat peer-set (every rule of a review on one rung), which is a fine arrangement, not a smell.
|
|
37
|
+
3. **Disclosed reference** is pushed out into a separate file, reached by a context pointer, loaded only when the pointer fires. Spans a sibling file in the same folder through fully external reference that lives anywhere and any document can point at.
|
|
38
|
+
|
|
39
|
+
Push too little down and the top bloats; push too much and you hide material the agent actually needs. That tension is the whole decision.
|
|
40
|
+
|
|
41
|
+
**Progressive disclosure** is the move down the ladder (out of the main file and behind a pointer) so the top stays legible. Not primarily a token optimisation: it is how the hierarchy is protected. Branching is the cleanest disclosure test: inline what every branch needs, and push behind a pointer what only some branches reach. When a document has steps, in-file reference that should be disclosed buries them and turns attending to them into a coin-flip: a variance lever, not just a legibility one.
|
|
42
|
+
|
|
43
|
+
**Co-location** is the within-file companion: where the ladder decides _how far down_ a piece sits, co-location decides _what sits beside it_ once there. Keep a concept's definition, rules, and caveats under one heading rather than scattered, so reading one part brings its neighbours with it. The test: the document should read like documentation written for the agent. Grouped material reads that way; scattered material does not. (Distinct from duplication: that repeats one meaning in two places; scattering fragments one meaning across many.)
|
|
44
|
+
|
|
45
|
+
**Sprawl** is the failure mode here: a document simply too long, even when every line is live and unique. Attention thins across the excess, and every extra line is one more to keep relevant. The cure is the ladder: disclose reference behind pointers, and split by branch or sequence so each path carries only what it needs.
|
|
46
|
+
|
|
47
|
+
## Steps and completion criteria
|
|
48
|
+
|
|
49
|
+
Every step ends on a **completion criterion**, the condition that tells the agent the work is done. Two properties make it a lever:
|
|
50
|
+
|
|
51
|
+
- **Clarity**: can the agent tell done from not-done? A vague bound ("understanding reached") invites **premature completion**: ending the step before it is genuinely done, attention slipping to _being done_. The visible steps still ahead (the **post-completion steps**) supply the pull; the criterion's clarity is the resistance. Defend in order: **sharpen the bound first** (local and cheap); only if it is irreducibly fuzzy _and_ you observe the rush, hide the later steps by splitting the sequence. Hiding only works across a real context boundary (a hand-off or a subagent dispatch; an inline call leaves the later steps in context and clears nothing).
|
|
52
|
+
- **Demand**: how much it requires. "Every modified model accounted for" forces thorough work where "produce a change list" does not. Demand drives **legwork** (the digging the agent does within the work, latent in the wording rather than written as its own step), and it is not step-bound: "every rule applied" binds a body of flat reference just as "every step done" binds a sequence, which is how an all-reference document still carries an exhaustiveness bar.
|
|
53
|
+
|
|
54
|
+
The strongest criteria are both checkable and exhaustive.
|
|
55
|
+
|
|
56
|
+
## When to split
|
|
57
|
+
|
|
58
|
+
Splitting one document into two spends one of the two loads, so split only when the cut earns it:
|
|
59
|
+
|
|
60
|
+
- **By sequence**: split a run of steps where the post-completion steps tempt the agent to rush the one in front of it. Keeping them out of view drives more legwork on the current task. Beware the reverse: merging sequences exposes each step's later steps to what follows, inviting premature completion.
|
|
61
|
+
- **By invocation**, skill-specific: see [`references/skill-mechanics.md`](references/skill-mechanics.md).
|
|
62
|
+
|
|
63
|
+
## Leading words
|
|
64
|
+
|
|
65
|
+
A **leading word** is a compact concept already living in the model's pretraining that the agent thinks with while running the document (_lesson_, _fog of war_, _tracer bullets_). Repeated as a token, never as a sentence, it accumulates a distributed definition and anchors a whole region of behaviour in the fewest tokens, by recruiting priors the model already holds. Coining your own works if you define it clearly, but a made-up word recruits no priors: you pay in definition tokens what a pretrained word gives free; reach for an existing word first.
|
|
66
|
+
|
|
67
|
+
It anchors twice. In the body, _execution_: the agent reaches for the same behaviour every time the word appears, and inside flat reference it focuses attention on a class of thing to look for. In a pointer, _invocation_: when the same word lives in your prompts, your docs, and your codebase, the agent links that shared language to the material and reaches it more reliably.
|
|
68
|
+
|
|
69
|
+
Hunt for opportunities to refactor with leading words. A triad spelled out at three sites, a pointer spending a sentence to gesture at one idea. Each is a passage begging to collapse into a single token:
|
|
70
|
+
|
|
71
|
+
- "fast, deterministic, low-overhead" → _tight_ (a _tight_ loop).
|
|
72
|
+
- "a loop you believe in" → _red_, turning a fuzzy gate into a binary observable state (the loop goes _red_ on the bug, or it doesn't).
|
|
73
|
+
|
|
74
|
+
You win twice: fewer tokens, and a sharper hook for the agent to hang its thinking on. Assume every document is carrying restatements that leading words retire. Go find them.
|
|
75
|
+
|
|
76
|
+
**Negation** is the failure mode beside this lever: steering by prohibition drags the forbidden behaviour into context and makes it _more_ available, not less. _Don't think of an elephant_, and the elephant is all there is; the negation is a weak modifier the strongly-activated concept overruns, so the ban half-reads as an instruction to do the thing. Prompt the **positive**: state the target behaviour ("write one-line comments") so the banned one is never spoken. A prohibition earns its place only as a hard guardrail you cannot phrase positively; even then, pair it with the positive target so attention lands on what to do.
|
|
77
|
+
|
|
78
|
+
## Pruning
|
|
79
|
+
|
|
80
|
+
- Keep each meaning in a **single source of truth**: one authoritative place, so changing the behaviour is a one-place edit. **Duplication** (the same meaning in more than one place) costs maintenance and tokens, and inflates a meaning's prominence on the ladder past its real rank. (The accidental inverse of a leading word, which repeats a token on purpose, never the meaning.)
|
|
81
|
+
- The **environment** is a source of truth too (`package.json` scripts, config files, the directory layout, `--help` output), and a document that restates it is a **cache**: a copy of a lookup, earning its load only when the lookup is expensive. Cache what the agent cannot find by looking: the unwritten convention, the reason behind a choice, the gotcha no config confesses. Leave the one-file, one-command lookups to the environment, where they cannot go stale.
|
|
82
|
+
- Check every line for **relevance**: does it still bear on what the document does? A line loses relevance by never bearing on the task (mere exposition, or a branch that should be disclosed) or by going stale as the behaviour or world it describes changes. Shorter documents are easier to keep relevant. Without a pruning discipline the default fate is **sediment**: stale layers that settle because adding feels safe and removing feels risky, until you must core down through them to find what is still live.
|
|
83
|
+
- Hunt **no-ops** sentence by sentence: an instruction the model already obeys by default pays load to say nothing. The test (does it change behaviour versus the default?) is model-relative, not reader-relative: two people disagreeing about a no-op disagree about the default, and settle it by running the document, not by debate. When a sentence fails, delete the whole sentence rather than trim words from it. The test also grades leading words: a word too weak to beat the default (_be thorough_ when the agent is already thorough-ish) is a no-op, and the fix is a stronger word (_relentless_), not a different technique.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Skill mechanics
|
|
2
|
+
|
|
3
|
+
The skill-specific branch of [`writing-for-agents`](../SKILL.md): what changes when the document is a skill (frontmatter, the invocation choice, and router skills). Everything else about writing it is the universal reference in `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
## Invocation
|
|
6
|
+
|
|
7
|
+
Two choices, trading the two loads:
|
|
8
|
+
|
|
9
|
+
- A **model-invoked** skill keeps a `description`, so the agent can fire it autonomously, and other skills can reach it. You can still type its name: model-invocation always _includes_ user reach, unless a host flag hides the skill from people (Claude Code's `user-invocable: false`); a description only ever adds agent discovery, never removes the human's. The description is the skill's top-level context pointer, forced to stay loaded at all times: permanent context load in exchange for discoverability. A model-invoked skill whose content is all reference is also one home for shared reference: another skill can invoke it, so reference needed by several skills lives in one place. Mechanics: omit `disable-model-invocation`, and write a model-facing description carrying the trigger branches (the pointer-writing rules in `SKILL.md` apply in full).
|
|
10
|
+
- A **user-invoked** skill strips the description from the agent's reach: only the human typing its name can invoke it, and no other skill can. Zero context load, but it spends cognitive load: you are the index that must remember it exists. Mechanics: set `disable-model-invocation: true` in the frontmatter, and add `agents/openai.yaml` beside `SKILL.md` setting `policy.allow_implicit_invocation: false`, the control Codex reads. Keep the two together: a skill carrying only one is explicit on some hosts and model-invoked on others. The `description` becomes human-facing: a one-line summary, trigger lists stripped.
|
|
11
|
+
|
|
12
|
+
Pick model-invocation only when the agent must reach the skill on its own, or another skill must. If it only ever fires by hand, make it user-invoked and pay no context load.
|
|
13
|
+
|
|
14
|
+
Shared reference that two user-invoked skills both need can live in neither: with no descriptions, neither can fire the other. Push it to a plain file outside the skill system: external reference any skill can point at.
|
|
15
|
+
|
|
16
|
+
## Splitting by invocation
|
|
17
|
+
|
|
18
|
+
The invocation cut of splitting (the sequence cut lives in `SKILL.md`): split off a model-invoked skill when you have a distinct leading word that should trigger it on its own (a trigger word you actually use in your prompts), or another skill must reach it. You pay context load for the new always-loaded description, so that independent reach has to be worth it.
|
|
19
|
+
|
|
20
|
+
## Router skills
|
|
21
|
+
|
|
22
|
+
When skills multiply past what you can remember, that piled-up cognitive load is cured by a **router skill**: one skill that names the others and when to reach for each, so the human has one skill to remember instead of many. Its invocation is the same trade as any skill's:
|
|
23
|
+
|
|
24
|
+
- A **user-invoked** router costs no context load but can only hint: it names user-invoked siblings, and nothing but the human can fire them.
|
|
25
|
+
- A **model-invoked** router pays one description's context load so the agent can consult it on its own, for example when the user asks which skill fits. It can then load any model-invoked sibling it names; user-invoked siblings it can still only recommend to the human.
|