@amsterdamdatalabs/enact-extensions 0.1.5 → 0.1.8
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 +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +15 -1
- package/dist/install.js.map +1 -1
- package/dist/internal/agents.d.ts +29 -0
- package/dist/internal/agents.d.ts.map +1 -0
- package/dist/internal/agents.js +83 -0
- package/dist/internal/agents.js.map +1 -0
- package/extensions/enact-context/hooks/hooks.json +20 -0
- package/extensions/enact-core/.agents/plugin.json +39 -0
- package/extensions/enact-core/hooks/hooks.json +14 -0
- package/extensions/enact-factory/.agents/plugin.json +9 -3
- package/extensions/enact-factory/agents/architect.toml +30 -0
- package/extensions/enact-factory/agents/code-reviewer.toml +29 -0
- package/extensions/enact-factory/agents/critic.toml +35 -0
- package/extensions/enact-factory/agents/executor.toml +23 -0
- package/extensions/enact-factory/agents/explore.toml +22 -0
- package/extensions/enact-factory/agents/planner.toml +23 -0
- package/extensions/enact-factory/agents/verifier.toml +29 -0
- package/extensions/enact-factory/skills/ai-slop-cleaner/SKILL.md +52 -0
- package/extensions/enact-factory/skills/azdo-ci-strategy/SKILL.md +262 -0
- package/extensions/enact-factory/skills/azdo-ci-strategy/references/build-failures.md +60 -0
- package/extensions/enact-factory/skills/azdo-ci-strategy/references/cli-reference.md +87 -0
- package/extensions/enact-factory/skills/azdo-ci-strategy/references/policies-and-pipelines.md +132 -0
- package/extensions/enact-factory/skills/azdo-ci-strategy/references/troubleshooting.md +53 -0
- package/extensions/enact-factory/skills/deep-interview/SKILL.md +72 -0
- package/extensions/enact-factory/skills/drive-loop/SKILL.md +259 -0
- package/extensions/enact-factory/skills/drive-loop/references/contract-schema.md +107 -0
- package/extensions/enact-factory/skills/hyperplan/SKILL.md +51 -0
- package/extensions/enact-factory/skills/looplan/SKILL.md +103 -0
- package/extensions/enact-factory/skills/plan/SKILL.md +71 -0
- package/extensions/enact-factory/skills/remove-deadcode/SKILL.md +41 -0
- package/extensions/enact-factory/skills/research/SKILL.md +73 -0
- package/extensions/enact-factory/skills/review/SKILL.md +48 -0
- package/extensions/enact-factory/skills/security-research/SKILL.md +54 -0
- package/extensions/enact-factory/skills/tdd/SKILL.md +56 -0
- package/extensions/enact-factory/skills/trace/SKILL.md +37 -0
- package/extensions/enact-factory/skills/ultraqa/SKILL.md +79 -0
- package/extensions/enact-factory/skills/work-with-workitem/SKILL.md +51 -0
- package/extensions/enact-factory/skills/workitem-triage/SKILL.md +15 -0
- package/extensions/enact-loop/.agents/plugin.json +46 -0
- package/extensions/enact-loop/.mcp.json +1 -0
- package/extensions/enact-loop/hooks/hooks.json +27 -0
- package/extensions/enact-loop/skills/enact-loop/SKILL.md +327 -0
- package/extensions/enact-operator/.agents/plugin.json +0 -1
- package/extensions/enact-operator/hooks/hooks.json +0 -35
- package/extensions/enact-wiki/skills/wiki/SKILL.md +42 -0
- package/extensions/plugin-dev/.agents/plugin.json +4 -6
- package/extensions/plugin-dev/agents/plugin-validator.md +1 -1
- package/extensions/plugin-dev/skills/agent-development/SKILL.md +7 -7
- package/extensions/plugin-dev/{commands/create-plugin.md → skills/create-plugin/SKILL.md} +44 -37
- package/extensions/plugin-dev/skills/plugin-dev-guide/SKILL.md +13 -14
- package/extensions/plugin-dev/skills/skill-development/SKILL.md +0 -2
- package/extensions/plugin-dev/{commands/start.md → skills/start/SKILL.md} +7 -6
- package/package.json +11 -6
- package/scripts/check-hooks.mjs +174 -0
- package/scripts/check-principles.mjs +101 -0
- package/scripts/enact-extensions.mjs +87 -3
- package/scripts/lib/run-validate.mjs +36 -2
- package/scripts/lib/ups-router.mjs +432 -0
- package/spec/enact.json +4 -0
- package/spec/enact.md +5 -2
- package/extensions/cmux/.agents/plugin.json +0 -37
- package/extensions/cmux/skills/cmux/SKILL.md +0 -82
- package/extensions/cmux/skills/cmux/agents/openai.yaml +0 -4
- package/extensions/cmux/skills/cmux/references/handles-and-identify.md +0 -35
- package/extensions/cmux/skills/cmux/references/panes-surfaces.md +0 -37
- package/extensions/cmux/skills/cmux/references/trigger-flash-and-health.md +0 -23
- package/extensions/cmux/skills/cmux/references/windows-workspaces.md +0 -31
- package/extensions/cmux/skills/cmux-vm-monitor/SKILL.md +0 -122
- package/extensions/cmux/skills/cmux-vm-monitor/agents/openai.yaml +0 -4
- package/extensions/cmux/skills/cmux-vm-monitor/references/cmux-commands.md +0 -66
- package/extensions/cmux/skills/cmux-vm-monitor/scripts/codex_vm_monitor.sh +0 -45
- package/extensions/cmux/skills/cmux-workspace/SKILL.md +0 -93
- package/extensions/devops/.agents/plugin.json +0 -36
- package/extensions/devops/skills/azure-devops-cli/SKILL.md +0 -431
- package/extensions/devops/skills/azure-devops-cli/agents/openai.yaml +0 -4
- package/extensions/devops/skills/ci-pipeline-strategy/SKILL.md +0 -217
- package/extensions/devops/skills/ci-pipeline-strategy/agents/openai.yaml +0 -4
- package/extensions/enact-factory/hooks/user-prompt-submit.mjs +0 -67
- package/extensions/enact-operator/commands/doctor.md +0 -39
- package/extensions/enact-operator/commands/setup.md +0 -51
- package/extensions/plugin-dev/.mcp.json +0 -3
- package/extensions/plugin-dev/commands/_archive/create-marketplace.md +0 -427
- package/extensions/plugin-dev/commands/_archive/plugin-dev-guide.md +0 -12
- package/extensions/plugin-dev/hooks/hooks.json +0 -3
- package/extensions/plugin-dev/skills/command-development/SKILL.md +0 -763
- package/extensions/plugin-dev/skills/command-development/examples/plugin-commands.md +0 -612
- package/extensions/plugin-dev/skills/command-development/examples/simple-commands.md +0 -527
- package/extensions/plugin-dev/skills/command-development/references/advanced-workflows.md +0 -762
- package/extensions/plugin-dev/skills/command-development/references/documentation-patterns.md +0 -769
- package/extensions/plugin-dev/skills/command-development/references/frontmatter-reference.md +0 -508
- package/extensions/plugin-dev/skills/command-development/references/interactive-commands.md +0 -966
- package/extensions/plugin-dev/skills/command-development/references/marketplace-considerations.md +0 -943
- package/extensions/plugin-dev/skills/command-development/references/plugin-features-reference.md +0 -637
- package/extensions/plugin-dev/skills/command-development/references/plugin-integration.md +0 -191
- package/extensions/plugin-dev/skills/command-development/references/skill-tool.md +0 -447
- package/extensions/plugin-dev/skills/command-development/references/testing-strategies.md +0 -723
- package/extensions/plugin-dev/skills/command-development/scripts/check-frontmatter.sh +0 -234
- package/extensions/plugin-dev/skills/command-development/scripts/validate-command.sh +0 -160
- /package/extensions/enact-operator/{skills/_variants.md → docs/skill-variants.md} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Troubleshooting & bootstrap gotchas
|
|
2
|
+
|
|
3
|
+
Assumes the **Variables** block from `../SKILL.md` is set where commands use it.
|
|
4
|
+
|
|
5
|
+
## Quick checks
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
az devops configure --list # current config
|
|
9
|
+
az account show # verify auth
|
|
10
|
+
az extension show --name azure-devops
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## PR commands live under `az repos`, not `az devops`
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
az devops pr create ... # WRONG — 'pr' is not a subcommand of az devops
|
|
17
|
+
az repos pr create --source-branch feature/x --target-branch integration --detect # CORRECT
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Extension fails with `No module named 'msrestazure'`
|
|
21
|
+
|
|
22
|
+
The `azure-devops` extension depends on `msrestazure`, not bundled in newer
|
|
23
|
+
Homebrew `azure-cli` installs. Install it into az's own Python:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
az --version 2>&1 | grep "Python location" # e.g. .../azure-cli/2.76.0/libexec/bin/python
|
|
27
|
+
/opt/homebrew/Cellar/azure-cli/<version>/libexec/bin/python -m pip install msrestazure
|
|
28
|
+
|
|
29
|
+
# If the extension directory is corrupt, remove and reinstall:
|
|
30
|
+
rm -rf ~/.azure/cliextensions/azure-devops
|
|
31
|
+
az extension add --name azure-devops
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Pipeline bootstrap gotchas
|
|
35
|
+
|
|
36
|
+
### First PR that adds `azure-pipelines.yml` will not trigger CI
|
|
37
|
+
|
|
38
|
+
AzDO evaluates the `pr:` trigger using the YAML **in the target branch**
|
|
39
|
+
(`integration`). If `azure-pipelines.yml` doesn't exist in `integration` yet
|
|
40
|
+
(because the PR adding it hasn't merged), the trigger never fires. Merge the
|
|
41
|
+
bootstrap PR manually once — subsequent PRs auto-trigger.
|
|
42
|
+
|
|
43
|
+
### First-run checklist (new pipeline bootstrap)
|
|
44
|
+
|
|
45
|
+
1. **Validate YAML locally:**
|
|
46
|
+
`python3 -c "import yaml; yaml.safe_load(open('azure-pipelines.yml')); print('OK')"`
|
|
47
|
+
2. **Check tool versions exist:** e.g. Zig at
|
|
48
|
+
`https://ziglang.org/download/<version>/zig-linux-x86_64-<version>.tar.xz`
|
|
49
|
+
(`curl -sI`, expect 200).
|
|
50
|
+
3. **Variable group authorized:** see `policies-and-pipelines.md` →
|
|
51
|
+
variable-group authorization.
|
|
52
|
+
4. **Multi-checkout repos accessible:** if `resources: repositories` is used,
|
|
53
|
+
confirm the service connection has read access to each sibling repo.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-interview
|
|
3
|
+
description: "Intent-first clarification loop for vague, risky, or product-heavy work before planning or execution."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deep Interview
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use `$deep-interview` to turn a fuzzy request into an execution-ready spec. This is not generic
|
|
11
|
+
brainstorming. It is a focused clarification loop that removes ambiguity before planning or coding.
|
|
12
|
+
|
|
13
|
+
## Use When
|
|
14
|
+
|
|
15
|
+
- the request describes outcomes, not behavior
|
|
16
|
+
- the user is still discovering what they want
|
|
17
|
+
- scope, non-goals, or decision boundaries are unclear
|
|
18
|
+
- a wrong assumption would create expensive rework
|
|
19
|
+
|
|
20
|
+
## Do Not Use When
|
|
21
|
+
|
|
22
|
+
- the request already names files, symbols, and acceptance criteria
|
|
23
|
+
- the user explicitly wants immediate execution and the risk is low
|
|
24
|
+
- the only missing work is architectural decomposition, not intent clarity
|
|
25
|
+
|
|
26
|
+
## Execution Policy
|
|
27
|
+
|
|
28
|
+
- ask one question at a time
|
|
29
|
+
- ask only the highest-leverage unresolved question
|
|
30
|
+
- use repo facts before asking about codebase internals
|
|
31
|
+
- force clarity on non-goals and decision boundaries before handoff
|
|
32
|
+
- keep the interview moving toward a durable artifact, not an endless conversation
|
|
33
|
+
|
|
34
|
+
## Question Order
|
|
35
|
+
|
|
36
|
+
1. Why does this need to exist?
|
|
37
|
+
2. What should be true when it is done?
|
|
38
|
+
3. How far should it go?
|
|
39
|
+
4. What should explicitly stay out?
|
|
40
|
+
5. What may the agent decide without checking again?
|
|
41
|
+
6. What constraints or preferences are hard?
|
|
42
|
+
|
|
43
|
+
## Workflow
|
|
44
|
+
|
|
45
|
+
1. Inspect the repo for brownfield context if relevant.
|
|
46
|
+
2. Capture the current hypothesis in `.enact/loop/plans/<phase>-requirements.md`.
|
|
47
|
+
3. Run a one-question loop until these are explicit:
|
|
48
|
+
- goal
|
|
49
|
+
- in-scope
|
|
50
|
+
- out-of-scope
|
|
51
|
+
- acceptance criteria
|
|
52
|
+
- decision boundaries
|
|
53
|
+
4. Update:
|
|
54
|
+
- `.enact/loop/plans/<phase>-requirements.md`
|
|
55
|
+
5. Hand off to `$plan` when the spec is concrete.
|
|
56
|
+
|
|
57
|
+
## Output Standard
|
|
58
|
+
|
|
59
|
+
The finished interview should leave behind:
|
|
60
|
+
|
|
61
|
+
- clear goal
|
|
62
|
+
- explicit non-goals
|
|
63
|
+
- decision boundaries
|
|
64
|
+
- testable acceptance criteria
|
|
65
|
+
- constraints that downstream execution must honor
|
|
66
|
+
|
|
67
|
+
## Stop Conditions
|
|
68
|
+
|
|
69
|
+
Do not hand off while either of these is missing:
|
|
70
|
+
|
|
71
|
+
- non-goals
|
|
72
|
+
- decision boundaries
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: drive-loop
|
|
3
|
+
description: >-
|
|
4
|
+
Teaches factory how to drive a WorkItem through the enact-loop contract runner
|
|
5
|
+
using subagents. Use when delivering a work-item, running the loop, driving a
|
|
6
|
+
work-item to closure, executing the loop contract, dispatching grader subagents,
|
|
7
|
+
or integrating factory with enact-loop. Triggers on "drive a work-item",
|
|
8
|
+
"run the loop", "deliver work-item via loop", "loop contract", "grader dispatch",
|
|
9
|
+
"loop closure".
|
|
10
|
+
metadata:
|
|
11
|
+
author: Amsterdam Data Labs
|
|
12
|
+
version: 1.0.0
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# drive-loop
|
|
16
|
+
|
|
17
|
+
## Model
|
|
18
|
+
|
|
19
|
+
**enact-loop** is a domain-neutral contract-runner. **enact-factory** is the
|
|
20
|
+
orchestrator. The relationship is process-boundary integration only — no
|
|
21
|
+
cross-repo imports, no shared types. Integration is via the `enact-loop` MCP
|
|
22
|
+
tools or CLI.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Factory builds CONTRACT (JSON)
|
|
26
|
+
→ hands to enact-loop (MCP: loop_start | CLI: enact-loop)
|
|
27
|
+
→ loop drives each STAGE to closure
|
|
28
|
+
→ boulder (Stop hook) blocks the agent until every required stage has a PASS
|
|
29
|
+
and every judgment stage has an independent GO verdict
|
|
30
|
+
→ CONTROL RETURNS TO FACTORY
|
|
31
|
+
→ factory calls pushLoopClosure (enact-factory MCP/CLI)
|
|
32
|
+
→ lifecycle booleans advance → WorkItem progresses on the board
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
No cross-repo imports. The integration boundary is the `enact-loop` MCP tools
|
|
36
|
+
and the `enact-factory` MCP/CLI.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Contract Schema
|
|
41
|
+
|
|
42
|
+
Embed the contract as plain JSON when calling `loop_start`. All fields are
|
|
43
|
+
required unless marked optional.
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"id": "<uuid>",
|
|
48
|
+
"name": "<human-readable name>",
|
|
49
|
+
"stages": [
|
|
50
|
+
{
|
|
51
|
+
"id": "<stage-id>",
|
|
52
|
+
"name": "<stage name>",
|
|
53
|
+
"type": "mechanical | judgment",
|
|
54
|
+
"required": true,
|
|
55
|
+
"command": "<shell command>",
|
|
56
|
+
"grader": {
|
|
57
|
+
"role": "architect | critic | code-reviewer | verifier",
|
|
58
|
+
"model": "<model-id — MUST differ from executor>",
|
|
59
|
+
"harness": "paseo | subagent",
|
|
60
|
+
"rounds": 1
|
|
61
|
+
},
|
|
62
|
+
"passCriteria": "<optional plain-text pass condition>"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Rules
|
|
69
|
+
|
|
70
|
+
| Stage type | Required fields | Pass condition |
|
|
71
|
+
|------------|----------------|----------------|
|
|
72
|
+
| `mechanical` | `command` | exit-0 from the command |
|
|
73
|
+
| `judgment` | `grader` (with `role`) | independent GO verdict |
|
|
74
|
+
|
|
75
|
+
- `grader.model` **MUST** differ from the executor model. Cross-vendor is
|
|
76
|
+
preferred (e.g. executor = codex, grader = claude-opus-4-8). No self-grading.
|
|
77
|
+
- `required: true` → stage must pass before closure is declared.
|
|
78
|
+
- Closure = all required stages passed.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Workflow
|
|
83
|
+
|
|
84
|
+
### Step 1 — Build the contract from the WorkItem
|
|
85
|
+
|
|
86
|
+
Inspect the WorkItem's `closureRequirements`. Map each requirement to a stage:
|
|
87
|
+
|
|
88
|
+
- Deterministic check → `type: mechanical`, set `command`.
|
|
89
|
+
- Subjective quality gate → `type: judgment`, set `grader`.
|
|
90
|
+
|
|
91
|
+
### Step 2 — Start the loop
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
MCP: loop_start({ contract: <contract JSON> })
|
|
95
|
+
CLI: enact-loop --contract ./contract.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The loop runner takes ownership of the session's Stop hook (the boulder). The
|
|
99
|
+
agent cannot stop until the loop signals closure.
|
|
100
|
+
|
|
101
|
+
### Step 3 — Drive mechanical stages
|
|
102
|
+
|
|
103
|
+
For each mechanical stage the loop surfaces:
|
|
104
|
+
|
|
105
|
+
1. Run the stage's `command`.
|
|
106
|
+
2. Capture stdout/stderr and exit code.
|
|
107
|
+
3. Record the result: `loop_grade({ stageId, pass: <bool>, output: <string> })`.
|
|
108
|
+
|
|
109
|
+
Repeat until the stage passes or the loop escalates to a retry/fail policy.
|
|
110
|
+
|
|
111
|
+
### Step 4 — Drive judgment stages (INDEPENDENT GRADER SUBAGENT)
|
|
112
|
+
|
|
113
|
+
For each judgment stage:
|
|
114
|
+
|
|
115
|
+
1. Call `loop_grader_dispatch({ stageId, role: <grader role> })`.
|
|
116
|
+
2. Spawn an **independent subagent** on a **different model** (never the
|
|
117
|
+
executor's model or session):
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Agent({
|
|
121
|
+
subagent_type: "<role>", // architect | critic | code-reviewer | verifier
|
|
122
|
+
model: "<grader model>", // MUST differ from executor
|
|
123
|
+
prompt: "<artifact + passCriteria + GO/NO-GO instruction>"
|
|
124
|
+
})
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
3. The grader returns a GO or NO-GO verdict with rationale.
|
|
128
|
+
4. Record the verdict: `loop_grader_verdict({ stageId, verdict: "GO | NO-GO", rationale })`.
|
|
129
|
+
|
|
130
|
+
The boulder prevents the session from completing until every judgment stage
|
|
131
|
+
has a GO from an independent grader.
|
|
132
|
+
|
|
133
|
+
### Step 5 — Closure → factory lifecycle advance
|
|
134
|
+
|
|
135
|
+
When the loop signals closure (all required stages passed):
|
|
136
|
+
|
|
137
|
+
1. Control returns to factory.
|
|
138
|
+
2. Call `pushLoopClosure` (enact-factory MCP/CLI) with the loop's closure
|
|
139
|
+
record.
|
|
140
|
+
3. Factory maps closure → lifecycle booleans → WorkItem advances on the board.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Agent Roster (grader candidates)
|
|
145
|
+
|
|
146
|
+
Use these roles as `grader.role`. Each must run on a model/session distinct
|
|
147
|
+
from the executor.
|
|
148
|
+
|
|
149
|
+
| Role | Use for |
|
|
150
|
+
|------|---------|
|
|
151
|
+
| `architect` | design correctness, interface shape, system fit |
|
|
152
|
+
| `critic` | adversarial quality and risk review |
|
|
153
|
+
| `code-reviewer` | implementation correctness, test coverage, style |
|
|
154
|
+
| `verifier` | evidence that the deliverable meets acceptance criteria |
|
|
155
|
+
| `explore` | read-only scoping (typically pre-grader, not a grader itself) |
|
|
156
|
+
| `planner` | plan review (judgment on the plan artifact, not execution) |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Worked Example — Bug Delivery
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"id": "wi-2041-bug-null-crash",
|
|
165
|
+
"name": "Bug WI-2041: null crash in session handler",
|
|
166
|
+
"stages": [
|
|
167
|
+
{
|
|
168
|
+
"id": "unit-tests",
|
|
169
|
+
"name": "Unit tests pass",
|
|
170
|
+
"type": "mechanical",
|
|
171
|
+
"required": true,
|
|
172
|
+
"command": "cd codex-rs && cargo test --features codex-cli/enact --no-fail-fast -- --test-threads=2",
|
|
173
|
+
"passCriteria": "exit 0, no test failures"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "regression-evidence",
|
|
177
|
+
"name": "Regression test covers the crash path",
|
|
178
|
+
"type": "mechanical",
|
|
179
|
+
"required": true,
|
|
180
|
+
"command": "grep -r 'null_session' codex-rs/src --include='*.rs' -l",
|
|
181
|
+
"passCriteria": "at least one file references the regression path"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"id": "code-review",
|
|
185
|
+
"name": "Independent code review: GO on fix correctness",
|
|
186
|
+
"type": "judgment",
|
|
187
|
+
"required": true,
|
|
188
|
+
"grader": {
|
|
189
|
+
"role": "code-reviewer",
|
|
190
|
+
"model": "claude-opus-4-8",
|
|
191
|
+
"harness": "subagent",
|
|
192
|
+
"rounds": 1
|
|
193
|
+
},
|
|
194
|
+
"passCriteria": "fix is minimal, regression is covered, no obvious regressions introduced"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "verifier-signoff",
|
|
198
|
+
"name": "Verifier confirms acceptance criteria met",
|
|
199
|
+
"type": "judgment",
|
|
200
|
+
"required": true,
|
|
201
|
+
"grader": {
|
|
202
|
+
"role": "verifier",
|
|
203
|
+
"model": "claude-opus-4-8",
|
|
204
|
+
"harness": "subagent",
|
|
205
|
+
"rounds": 1
|
|
206
|
+
},
|
|
207
|
+
"passCriteria": "WI-2041 acceptance criteria satisfied; crash path eliminated"
|
|
208
|
+
}
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Execution trace:**
|
|
214
|
+
|
|
215
|
+
1. Factory builds this contract from WI-2041's `closureRequirements`.
|
|
216
|
+
2. `loop_start({ contract })` — boulder active.
|
|
217
|
+
3. Loop surfaces `unit-tests` → executor runs `cargo test` → exit 0 →
|
|
218
|
+
`loop_grade({ stageId: "unit-tests", pass: true, output: "..." })`.
|
|
219
|
+
4. Loop surfaces `regression-evidence` → executor runs grep → match found →
|
|
220
|
+
`loop_grade({ stageId: "regression-evidence", pass: true, output: "..." })`.
|
|
221
|
+
5. Loop surfaces `code-review` →
|
|
222
|
+
`loop_grader_dispatch({ stageId: "code-review", role: "code-reviewer" })` →
|
|
223
|
+
spawn `code-reviewer` subagent on `claude-opus-4-8` →
|
|
224
|
+
grader returns GO →
|
|
225
|
+
`loop_grader_verdict({ stageId: "code-review", verdict: "GO", rationale: "..." })`.
|
|
226
|
+
6. Loop surfaces `verifier-signoff` →
|
|
227
|
+
`loop_grader_dispatch(...)` →
|
|
228
|
+
spawn `verifier` subagent on `claude-opus-4-8` →
|
|
229
|
+
grader returns GO →
|
|
230
|
+
`loop_grader_verdict({ stageId: "verifier-signoff", verdict: "GO", rationale: "..." })`.
|
|
231
|
+
7. All required stages passed → loop signals closure → boulder lifts.
|
|
232
|
+
8. Factory calls `pushLoopClosure(closureRecord)` → WI-2041 advances to Done.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Anti-patterns
|
|
237
|
+
|
|
238
|
+
- **Never self-grade.** The executor that wrote the code cannot be the grader.
|
|
239
|
+
Grader must run on a different model and in a different session.
|
|
240
|
+
- **Never skip the boulder.** Do not call loop completion tools unless all
|
|
241
|
+
required stages have passed — the boulder enforces this, but do not attempt
|
|
242
|
+
to work around it.
|
|
243
|
+
- **Never import enact-loop types directly.** The boundary is MCP/CLI only.
|
|
244
|
+
No shared module imports between factory and loop.
|
|
245
|
+
- **Judgment without a grader spec is invalid.** Every `type: judgment` stage
|
|
246
|
+
must have a `grader` field with at least `role` set.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Related Skills
|
|
251
|
+
|
|
252
|
+
- `workitem-triage` — read-only triage of the WorkItem board (use before
|
|
253
|
+
building the contract to confirm the WorkItem is ready for delivery).
|
|
254
|
+
- `azdo-ci-strategy` — branch/PR/release strategy for integrating delivered
|
|
255
|
+
work into `integration` and `main`.
|
|
256
|
+
- `testing-strategy` — when a mechanical stage runs tests, use this skill to
|
|
257
|
+
pick the right test mode.
|
|
258
|
+
|
|
259
|
+
See `references/contract-schema.md` for the full contract schema reference.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Contract Schema Reference
|
|
2
|
+
|
|
3
|
+
Full schema for the JSON object passed to `loop_start`. This is a progressive
|
|
4
|
+
disclosure supplement to `SKILL.md`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Contract (root)
|
|
9
|
+
|
|
10
|
+
| Field | Type | Required | Description |
|
|
11
|
+
|-------|------|----------|-------------|
|
|
12
|
+
| `id` | string (uuid) | yes | Stable unique identifier. Use the WorkItem id or a derived uuid. |
|
|
13
|
+
| `name` | string | yes | Human-readable name shown in loop progress output. |
|
|
14
|
+
| `stages` | Stage[] | yes | Ordered list of stages. Mechanical stages run first; judgment stages may interleave. |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Stage
|
|
19
|
+
|
|
20
|
+
| Field | Type | Required when | Description |
|
|
21
|
+
|-------|------|---------------|-------------|
|
|
22
|
+
| `id` | string | always | Stable slug. Referenced by `loop_grade` and `loop_grader_verdict`. |
|
|
23
|
+
| `name` | string | always | Human-readable label. |
|
|
24
|
+
| `type` | `"mechanical" \| "judgment"` | always | Determines which fields are used and how pass is determined. |
|
|
25
|
+
| `required` | boolean | always | `true` → must pass before closure. `false` → informational only. |
|
|
26
|
+
| `command` | string | mechanical | Shell command run by the executor. Exit 0 = pass. |
|
|
27
|
+
| `grader` | GraderSpec | judgment | Specification for the independent grader subagent. |
|
|
28
|
+
| `passCriteria` | string | optional | Plain-text description of what constitutes a pass. Included in grader prompts. |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## GraderSpec
|
|
33
|
+
|
|
34
|
+
| Field | Type | Required | Description |
|
|
35
|
+
|-------|------|----------|-------------|
|
|
36
|
+
| `role` | `"architect" \| "critic" \| "code-reviewer" \| "verifier"` | yes | Determines the subagent type spawned. |
|
|
37
|
+
| `model` | string | recommended | Model ID for the grader. **Must differ from the executor model.** Cross-vendor preferred. Omit only if the harness selects automatically. |
|
|
38
|
+
| `harness` | `"paseo" \| "subagent"` | optional | How to dispatch. Default: `subagent`. Use `paseo` when the grader needs multi-step tool access. |
|
|
39
|
+
| `rounds` | integer | optional | Number of independent grading rounds before aggregating. Default: `1`. |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Validation Rules
|
|
44
|
+
|
|
45
|
+
1. Every `type: judgment` stage **must** have `grader` with `role` set.
|
|
46
|
+
2. Every `type: mechanical` stage **must** have `command` set.
|
|
47
|
+
3. `grader.model` must differ from the executor's model — enforced at
|
|
48
|
+
`loop_grader_dispatch` time.
|
|
49
|
+
4. At least one stage must be `required: true`, or the contract is trivially
|
|
50
|
+
closed and should not be submitted to the loop.
|
|
51
|
+
5. Stage `id` values must be unique within the contract.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Closure Definition
|
|
56
|
+
|
|
57
|
+
A contract reaches **closure** when:
|
|
58
|
+
|
|
59
|
+
- Every stage where `required: true` has status `PASSED`.
|
|
60
|
+
- `PASSED` means:
|
|
61
|
+
- `mechanical`: `loop_grade` was called with `pass: true`.
|
|
62
|
+
- `judgment`: `loop_grader_verdict` was called with `verdict: "GO"`.
|
|
63
|
+
|
|
64
|
+
Optional stages (`required: false`) do not block closure but their results
|
|
65
|
+
are included in the closure record returned to factory.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## MCP Tool Reference
|
|
70
|
+
|
|
71
|
+
| Tool | When to call | Key params |
|
|
72
|
+
|------|-------------|------------|
|
|
73
|
+
| `loop_start` | Once, at the start of the delivery | `{ contract: <Contract JSON> }` |
|
|
74
|
+
| `loop_grade` | After each mechanical stage run | `{ stageId, pass, output }` |
|
|
75
|
+
| `loop_grader_dispatch` | Before spawning the grader subagent | `{ stageId, role }` |
|
|
76
|
+
| `loop_grader_verdict` | After the grader subagent returns | `{ stageId, verdict: "GO\|NO-GO", rationale }` |
|
|
77
|
+
|
|
78
|
+
Factory-side tool (after loop closure):
|
|
79
|
+
|
|
80
|
+
| Tool | When to call | Key params |
|
|
81
|
+
|------|-------------|------------|
|
|
82
|
+
| `pushLoopClosure` | Once, after loop signals closure | `{ closureRecord }` |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Example: Minimal Contract (single mechanical stage)
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"id": "wi-9999-minimal",
|
|
91
|
+
"name": "Minimal: lint only",
|
|
92
|
+
"stages": [
|
|
93
|
+
{
|
|
94
|
+
"id": "lint",
|
|
95
|
+
"name": "Lint passes",
|
|
96
|
+
"type": "mechanical",
|
|
97
|
+
"required": true,
|
|
98
|
+
"command": "cargo clippy --workspace -- -D warnings"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Example: Full Contract (mixed mechanical + judgment)
|
|
105
|
+
|
|
106
|
+
See `SKILL.md` worked example (WI-2041 Bug Delivery) for a four-stage
|
|
107
|
+
mixed contract with two mechanical and two judgment stages.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hyperplan
|
|
3
|
+
description: "Three-round adversarial planning debate that hands a distilled bundle to $plan instead of writing the final plan directly."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hyperplan
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use `$hyperplan` when a plan needs adversarial pressure before execution starts.
|
|
11
|
+
|
|
12
|
+
## Debate Team
|
|
13
|
+
|
|
14
|
+
Use exactly this 4-agent team:
|
|
15
|
+
|
|
16
|
+
- `critic`
|
|
17
|
+
- `critic`
|
|
18
|
+
- `architect`
|
|
19
|
+
- `explore`
|
|
20
|
+
|
|
21
|
+
The original openagent placeholder names are not used here.
|
|
22
|
+
|
|
23
|
+
## Rounds
|
|
24
|
+
|
|
25
|
+
Run exactly 3 rounds:
|
|
26
|
+
|
|
27
|
+
1. independent analysis
|
|
28
|
+
2. cross-attack
|
|
29
|
+
3. defend, refine, or concede
|
|
30
|
+
|
|
31
|
+
Persist each round under:
|
|
32
|
+
|
|
33
|
+
- `.enact/loop/hyperplan/<sessionId>/round-1.md`
|
|
34
|
+
- `.enact/loop/hyperplan/<sessionId>/round-2.md`
|
|
35
|
+
- `.enact/loop/hyperplan/<sessionId>/round-3.md`
|
|
36
|
+
|
|
37
|
+
## Handoff Rule
|
|
38
|
+
|
|
39
|
+
The lead agent does not write the final implementation plan directly.
|
|
40
|
+
After round 3, hand the distilled debate bundle to a separate `$plan` invocation.
|
|
41
|
+
|
|
42
|
+
## Execution Notes
|
|
43
|
+
|
|
44
|
+
- use `explore` to gather the evidence bundle before critique
|
|
45
|
+
- use the two `critic` agents to take opposing positions in the cross-attack round
|
|
46
|
+
- use `architect` to synthesize the final structured verdict and tradeoffs
|
|
47
|
+
- do not skip a round because the first opinion looked sufficient
|
|
48
|
+
|
|
49
|
+
## Activation
|
|
50
|
+
|
|
51
|
+
Invoke with `$hyperplan` or `$enact-loop:hyperplan`. The skill is stateless — it produces a debate bundle and hands off to `$plan`. No durable workflow state is started automatically.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: looplan
|
|
3
|
+
description: "Plan-first loop execution wrapper: write a durable plan, enter the loop, drive to verified closure. Use when the work needs a reviewable plan before the loop starts."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Looplan
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Use `$looplan` when the work needs a reviewable execution plan before the loop starts. Looplan gates
|
|
11
|
+
execution behind a plan the user or reviewer can inspect, then advances into the `$loop` contract
|
|
12
|
+
runner with explicit stage verification.
|
|
13
|
+
|
|
14
|
+
Looplan is the combination of `$plan` (write artifacts, define slices and verification) and `$loop`
|
|
15
|
+
(durable contract-runner with closure gates). Neither sub-skill is optional.
|
|
16
|
+
|
|
17
|
+
## Use When
|
|
18
|
+
|
|
19
|
+
- the request is clear enough to plan but carries meaningful risk or complexity
|
|
20
|
+
- a written plan artifact needs to exist before any code changes
|
|
21
|
+
- verification stages need to be defined up front, not discovered mid-execution
|
|
22
|
+
- the user wants to review the plan before execution begins
|
|
23
|
+
|
|
24
|
+
## Do Not Use When
|
|
25
|
+
|
|
26
|
+
- the request is still ambiguous — route through `$deep-interview` first, then return here
|
|
27
|
+
- the work is trivial and a plan would add no value
|
|
28
|
+
|
|
29
|
+
## Lifecycle
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
intent → $plan (write plan + verification map) → user review → $loop start → running → verifying → completed
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Each transition is explicit. Never advance to the loop before the plan artifact exists and is reviewed.
|
|
36
|
+
|
|
37
|
+
## Workflow
|
|
38
|
+
|
|
39
|
+
### Phase 1 — Plan
|
|
40
|
+
|
|
41
|
+
1. Read current artifacts and inspect the repo for brownfield context.
|
|
42
|
+
2. Write the plan to `.enact/loop/plans/<phase>.md` following `$plan` conventions:
|
|
43
|
+
- Named files per slice
|
|
44
|
+
- Explicit verification per slice
|
|
45
|
+
- Exit conditions stated
|
|
46
|
+
3. Write the verification map to `.enact/loop/plans/<phase>-verification.md`.
|
|
47
|
+
4. Present the plan for review. Do not advance until it is approved.
|
|
48
|
+
|
|
49
|
+
### Phase 2 — Execute
|
|
50
|
+
|
|
51
|
+
5. Start the loop with the goal and stages from the plan:
|
|
52
|
+
```
|
|
53
|
+
loop_start goal="<goal>" contract=<stages from plan>
|
|
54
|
+
```
|
|
55
|
+
6. Confirm the loop is running: `loop_status`
|
|
56
|
+
7. Execute each plan slice.
|
|
57
|
+
- Mechanical stages: run the command, then `loop_grade`.
|
|
58
|
+
- Judgment stages: `loop_grader_dispatch`, await `loop_grader_verdict`.
|
|
59
|
+
8. If blocked: `loop_block` with reason, resolve, then `loop_advance` back to `running`.
|
|
60
|
+
|
|
61
|
+
### Phase 3 — Verify and Complete
|
|
62
|
+
|
|
63
|
+
9. When all stages have evidence, advance to verifying:
|
|
64
|
+
```
|
|
65
|
+
loop_advance toPhase=verifying
|
|
66
|
+
```
|
|
67
|
+
10. Run `$review` against the completed work and plan artifacts.
|
|
68
|
+
11. If review passes, complete the loop:
|
|
69
|
+
```
|
|
70
|
+
loop_complete summary="<one-line summary>"
|
|
71
|
+
```
|
|
72
|
+
12. If review returns changes requested, advance back to running and address findings.
|
|
73
|
+
|
|
74
|
+
## State Contract
|
|
75
|
+
|
|
76
|
+
Reads:
|
|
77
|
+
- `.enact/loop/plans/*` (plan and verification map written in Phase 1)
|
|
78
|
+
- `.enact/loop/state/loop.json` (loop state)
|
|
79
|
+
|
|
80
|
+
Writes:
|
|
81
|
+
- `.enact/loop/plans/<phase>.md`
|
|
82
|
+
- `.enact/loop/plans/<phase>-verification.md`
|
|
83
|
+
- Loop state via MCP tools
|
|
84
|
+
|
|
85
|
+
## MCP Tools
|
|
86
|
+
|
|
87
|
+
- `loop_start` — start a new loop with goal and stages
|
|
88
|
+
- `loop_status` — read current loop state
|
|
89
|
+
- `loop_advance` — transition to a new phase
|
|
90
|
+
- `loop_grade` — record a mechanical stage result with evidence
|
|
91
|
+
- `loop_grader_dispatch` — dispatch an independent grader for a judgment stage
|
|
92
|
+
- `loop_grader_verdict` — record an independent grader's GO/NO-GO
|
|
93
|
+
- `loop_block` — mark blocked with a reason
|
|
94
|
+
- `loop_complete` — close the loop with a summary
|
|
95
|
+
- `loop_abort` — abort with a reason
|
|
96
|
+
|
|
97
|
+
## Final Check
|
|
98
|
+
|
|
99
|
+
- Plan artifact exists at `.enact/loop/plans/<phase>.md` before loop was started
|
|
100
|
+
- All stages have evidence recorded, not just a passed status
|
|
101
|
+
- Judgment stages have valid independent grader verdicts
|
|
102
|
+
- `$review` verdict is approved
|
|
103
|
+
- `loop_status` shows phase as `completed`
|