@doidor/agentrig 0.10.0 → 0.11.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/README.md +26 -6
- package/dist/cli.js +14 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/compile.js +3 -0
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +65 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/fix.js +52 -0
- package/dist/commands/fix.js.map +1 -0
- package/dist/commands/update.js +182 -16
- package/dist/commands/update.js.map +1 -1
- package/dist/core/audit.js +33 -1
- package/dist/core/audit.js.map +1 -1
- package/dist/core/compile.js +5 -1
- package/dist/core/compile.js.map +1 -1
- package/dist/core/fix.js +108 -0
- package/dist/core/fix.js.map +1 -0
- package/dist/core/install.js +50 -4
- package/dist/core/install.js.map +1 -1
- package/dist/core/markers.js +85 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/state.js +11 -0
- package/dist/core/state.js.map +1 -1
- package/dist/core/validate.js +129 -0
- package/dist/core/validate.js.map +1 -0
- package/dist/prompts/index.js +54 -175
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/loader.js +36 -0
- package/dist/prompts/loader.js.map +1 -0
- package/dist/prompts/templates/dynamic-eval.md +5 -0
- package/dist/prompts/templates/investigate.md +19 -0
- package/dist/prompts/templates/judge.md +38 -0
- package/dist/prompts/templates/producer-baseline-note.md +1 -0
- package/dist/prompts/templates/producer-handoff-checklist.md +24 -0
- package/dist/prompts/templates/producer-harness-note.md +1 -0
- package/dist/prompts/templates/producer.md +10 -0
- package/dist/prompts/templates/scaffold-scenarios.md +56 -0
- package/dist/prompts/templates/system-message.md +5 -0
- package/dist/prompts/templates/tailor.md +38 -0
- package/dist/prompts/templates/update.md +14 -0
- package/knowledge/manifest.json +1 -1
- package/knowledge/templates/AGENTS.md +1 -1
- package/knowledge/templates/agents/README.md +4 -4
- package/knowledge/templates/agents/developer.yml +1 -1
- package/knowledge/templates/agents/judge.yml +1 -1
- package/knowledge/templates/agents/reviewer.yml +1 -1
- package/knowledge/templates/agents/triager.yml +1 -1
- package/knowledge/templates/eval/checks.json +4 -3
- package/knowledge/templates/eval/static-audit.mjs +25 -1
- package/knowledge/templates/rules/coding-standards.md +1 -0
- package/knowledge/templates/skills/harness-eval/SKILL.md +4 -0
- package/knowledge/templates/skills/skill-authoring/SKILL.md +1 -1
- package/knowledge/templates/skills/skill-improver/SKILL.md +1 -1
- package/knowledge/templates/wiki/README.md +4 -8
- package/knowledge/templates/wiki/index.md +3 -8
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,gGAAgG;AAChG,kGAAkG;AAClG,iGAAiG;AAEjG,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAEhE,MAAM,UAAU,sBAAsB;IACpC,OAAO,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAkB;IAClD,MAAM,YAAY,GAAG,QAAQ,CAAC,SAAS;SACpC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,SAAS,GAAG,CAAC;SACxD,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAiB;IACjD,MAAM,WAAW,G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AAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAC9C,UAAU,EAAE,GAAG,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;KACnD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
5
|
+
/**
|
|
6
|
+
* Locate the prompt-template directory. In a built/published package the `.md` templates are
|
|
7
|
+
* copied next to the compiled loader (`dist/prompts/templates/`) by `scripts/copy-prompt-templates.mjs`.
|
|
8
|
+
* The source-tree fallback keeps the CLI working in development when a bare `tsc --watch` hasn't run
|
|
9
|
+
* the copy step yet.
|
|
10
|
+
*/
|
|
11
|
+
function templatesDir() {
|
|
12
|
+
const candidates = [
|
|
13
|
+
resolve(moduleDir, "templates"), // dist/prompts/templates (built) or src/prompts/templates
|
|
14
|
+
resolve(moduleDir, "..", "..", "src", "prompts", "templates"), // dist/prompts -> src fallback
|
|
15
|
+
];
|
|
16
|
+
for (const candidate of candidates) {
|
|
17
|
+
if (existsSync(candidate))
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
throw new Error("AgentRig: could not locate the prompts/templates directory. Is the package built correctly?");
|
|
21
|
+
}
|
|
22
|
+
const cache = new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Load a prompt template by file name. A single trailing newline is stripped so callers fully
|
|
25
|
+
* control the trailing whitespace of the assembled prompt (templates are stored with one trailing
|
|
26
|
+
* newline by convention). Results are cached since templates never change at runtime.
|
|
27
|
+
*/
|
|
28
|
+
export function loadTemplate(name) {
|
|
29
|
+
const cached = cache.get(name);
|
|
30
|
+
if (cached !== undefined)
|
|
31
|
+
return cached;
|
|
32
|
+
const text = readFileSync(resolve(templatesDir(), name), "utf8").replace(/\n$/, "");
|
|
33
|
+
cache.set(name, text);
|
|
34
|
+
return text;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/prompts/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,SAAS,YAAY;IACnB,MAAM,UAAU,GAAG;QACjB,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,0DAA0D;QAC3F,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,+BAA+B;KAC/F,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IAC9C,CAAC;IACD,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpF,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Task — Run the harness dynamic evaluation
|
|
2
|
+
|
|
3
|
+
Legacy entry point — agentrig now drives producer + judge separately via the
|
|
4
|
+
scenario runner. Run `agentrig eval --dynamic` (which calls the new orchestrator)
|
|
5
|
+
instead of relying on this prompt. Scope: {{SCOPE}}. Run id: {{RUN_ID}}.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Task 1 of 2 — Investigate this repository
|
|
2
|
+
|
|
3
|
+
Investigate the repository in your current working directory and write your findings to
|
|
4
|
+
`.agentrig/context.md` (create the file; create the .agentrig directory if needed).
|
|
5
|
+
|
|
6
|
+
Cover, with evidence from actual files:
|
|
7
|
+
1. **Purpose** — what this project is and who uses it (2-4 sentences).
|
|
8
|
+
2. **Stack** — languages, frameworks, runtimes, package manager(s).
|
|
9
|
+
3. **Commands** — the real install / build / test / lint commands (cite where you found them:
|
|
10
|
+
package.json scripts, Makefile, CI workflow, pyproject, go.mod, etc.). If a command does not
|
|
11
|
+
exist, say so explicitly rather than guessing.
|
|
12
|
+
4. **Layout** — a concise directory map of the most important folders and what they contain.
|
|
13
|
+
5. **Conventions** — notable coding conventions, testing patterns, and any "instructions are the
|
|
14
|
+
source of truth" docs (AGENTS.md, CONTRIBUTING, etc.).
|
|
15
|
+
6. **Risks for an autonomous agent** — protected areas, generated code, flaky tests, anything an
|
|
16
|
+
agent should be careful about.
|
|
17
|
+
|
|
18
|
+
Be thorough but factual. Do not modify any other files in this step. When done, reply with a short
|
|
19
|
+
confirmation and the exact install/build/test/lint commands you found.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Task — Score a completed scenario as an INDEPENDENT JUDGE
|
|
2
|
+
|
|
3
|
+
You are the **judge** for scenario `{{SCENARIO}}` (type: `{{TYPE}}`). The producer
|
|
4
|
+
agent has already finished. Read these files in your cwd to do your scoring:
|
|
5
|
+
|
|
6
|
+
- `prompt.md` — the exact task the producer was given
|
|
7
|
+
- `diff.patch` — the change the producer produced
|
|
8
|
+
- `transcript.md` — the producer's own summary of what they did (BEWARE: don't be biased by it)
|
|
9
|
+
- `oracle.json` — deterministic axes (already scored — DO NOT re-score these)
|
|
10
|
+
- `judge_brief.md` (if present) — calibration hints for soft axes only
|
|
11
|
+
|
|
12
|
+
## What to score
|
|
13
|
+
Score these soft axes against `{{RUBRIC_PATH}}`:
|
|
14
|
+
{{AXES_LIST}}
|
|
15
|
+
|
|
16
|
+
Tiers are strict: `0` / `0.5` / `1.0`. Any score < 1.0 MUST cite an issue code
|
|
17
|
+
from that axis's registry plus a one-line evidence string. Use `confidence: 0` for
|
|
18
|
+
axes you genuinely cannot observe.
|
|
19
|
+
|
|
20
|
+
## How to submit
|
|
21
|
+
Write your scores to `{{OUTPUT_JSON_PATH}}` in this exact shape:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"axes": [
|
|
26
|
+
{ "name": "self_verification", "score": 1.0, "confidence": 1 },
|
|
27
|
+
{ "name": "clarity", "score": 0.5, "confidence": 1, "code": "OQ-CLARITY-NAMING", "evidence": "function names use single letters" },
|
|
28
|
+
{ "name": "memory", "score": 0, "confidence": 0 }
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Do NOT save scores via `score.mjs` yourself — the orchestrator does that.
|
|
34
|
+
|
|
35
|
+
## Independence
|
|
36
|
+
Do NOT defer to the producer's reasoning. Decide each axis on the evidence in
|
|
37
|
+
the diff + oracle results, not what the producer claims about their own work.
|
|
38
|
+
If the diff contradicts the transcript, the diff wins.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**This is a BASELINE trial — harness OFF.** Do NOT read or follow `AGENTS.md`, `.agents/rules/`, `.agents/skills/`, or any AgentRig-installed instruction surface, even if they happen to be present in this worktree. Behave as a bare agent with only your training-data priors.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Pre-handoff checklist (read before you reply)
|
|
2
|
+
|
|
3
|
+
You are running with the AgentRig harness ON. Before declaring done, walk this checklist out loud
|
|
4
|
+
in your transcript. The harness eval scores you on each item; vague reassurances ("tests pass")
|
|
5
|
+
without the underlying evidence cost half-credit or more.
|
|
6
|
+
|
|
7
|
+
- [ ] **Baseline captured.** Did you run the project's test command BEFORE editing related code,
|
|
8
|
+
and surface the result in your transcript? For a fix scenario: explicitly note the failing
|
|
9
|
+
test name and the error. For a feature scenario: note the suite was green.
|
|
10
|
+
*Bad:* "All tests pass."
|
|
11
|
+
*Good:* "baseline: `npm test` → 1 fail (divide-by-zero); after fix: 0 fails, all 4 tests pass."
|
|
12
|
+
|
|
13
|
+
- [ ] **After captured.** Did you re-run the full test command at the end and surface the new
|
|
14
|
+
state? The transition baseline → after is the evidence that your edit did what you claim.
|
|
15
|
+
|
|
16
|
+
- [ ] **Wiki entry committed for any non-obvious lesson.** If your work revealed something
|
|
17
|
+
surprising (silent failure, library default, framework quirk, AGENTS.md rule that almost
|
|
18
|
+
bit you), use the `log-gotcha` skill to write a `.agents/wiki/<topic>.md` entry IN THE
|
|
19
|
+
SAME DIFF. Acknowledging the lesson only in your summary is half-credit. Silent is zero.
|
|
20
|
+
Run `git diff --cached --stat` to confirm the wiki file is staged.
|
|
21
|
+
|
|
22
|
+
- [ ] **Diff is on-target.** `git diff --stat` should show only files you intentionally changed.
|
|
23
|
+
|
|
24
|
+
If you can't honestly check a box, fix it before replying — that's cheaper than a re-roll.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
**This is a HARNESS trial — harness ON.** Follow `AGENTS.md`, the rules in `.agents/rules/`, and the skills in `.agents/skills/` if they are present in this worktree.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Scenario task
|
|
2
|
+
{{VARIANT_NOTE}}
|
|
3
|
+
Your entire job is described below. Work inside the current directory (this is a
|
|
4
|
+
throwaway worktree dedicated to your trial). When done, simply finish — the
|
|
5
|
+
scenario runner captures your diff, your transcript, and runs the deterministic
|
|
6
|
+
oracle automatically.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
{{SCENARIO_PROMPT}}{{HANDOFF_CHECKLIST}}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Task — Generate repository-specific eval scenarios
|
|
2
|
+
|
|
3
|
+
The 3 scenarios under `.agentrig/eval/scenarios/` are language-agnostic JS micro-fixtures. They
|
|
4
|
+
test a generic agent loop, but they do NOT exercise *this* repo's actual stack (test runner,
|
|
5
|
+
package manager, language idioms, common defect patterns). Your job: write {{COUNT}} new
|
|
6
|
+
scenario(s) that ARE specific to this repo.
|
|
7
|
+
|
|
8
|
+
## Repo investigation (from `.agentrig/context.md`)
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
{{CONTEXT_MD}}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What a scenario looks like (templates)
|
|
15
|
+
|
|
16
|
+
{{EXAMPLES_TEXT}}
|
|
17
|
+
|
|
18
|
+
## What to produce
|
|
19
|
+
|
|
20
|
+
For each new scenario:
|
|
21
|
+
|
|
22
|
+
1. Create a directory `.agentrig/eval/scenarios/<id>/` with an id that names a concrete
|
|
23
|
+
task in THIS repo's stack (e.g. `fix-pytest-failure`, `refactor-typescript-module`,
|
|
24
|
+
`review-django-migration`, `add-cargo-feature`). NO generic ids — `fix-failing-test` is taken.
|
|
25
|
+
2. Write `scenario.yml` with YAML frontmatter:
|
|
26
|
+
- `id`: matches the directory name
|
|
27
|
+
- `type`: one of `run` | `spec` | `review`
|
|
28
|
+
- `scope`: `patch` | `feature` | `epic`
|
|
29
|
+
- `principle_focus`: array of 1-3 principle numbers (1-12)
|
|
30
|
+
- `oracle_axes`: array of axis names (deterministic-scored)
|
|
31
|
+
- `judge_axes`: array of axis names (LLM-scored)
|
|
32
|
+
3. Write `prompt.md` — the exact task handed to the producer agent. NO ambiguity, NO "invent your own spec."
|
|
33
|
+
4. Build `fixture/` — a tiny synthetic mini-repo using THIS repo's actual stack:
|
|
34
|
+
- Use the **real** package manager (`requirements.txt` / `go.mod` / `package.json` / `Cargo.toml`)
|
|
35
|
+
- Use the **real** test runner (`pytest` / `go test` / `vitest` / `cargo test`)
|
|
36
|
+
- Keep it ≤10 files total; one file should be the planted defect / spec / patch under review
|
|
37
|
+
5. Write `oracle.yml` — deterministic checks (cmd, diff_stats, diff_files, file_contains, file_missing).
|
|
38
|
+
The `cmd` checks MUST use this repo's actual test command, not `npm test`.
|
|
39
|
+
6. Write `README.md` — 1-2 paragraphs describing what the scenario tests + what a defect looks like.
|
|
40
|
+
7. Write `judge_brief.md` (optional but recommended) — calibration hints for soft axes the
|
|
41
|
+
judge will score (e.g. "1.0 = wrote a wiki entry, 0.5 = mentioned in summary, 0 = silent").
|
|
42
|
+
|
|
43
|
+
## Hard constraints
|
|
44
|
+
|
|
45
|
+
- **DO NOT modify the existing generic scenarios** (`fix-failing-test`, `add-small-feature`,
|
|
46
|
+
`review-catches-bug`, `agentrig-init-on-empty-repo`). They stay as both templates AND running scenarios.
|
|
47
|
+
- **DO NOT touch any file outside `.agentrig/eval/scenarios/`.**
|
|
48
|
+
- **Axis names must come from the live registry.** Valid types: {{AXIS_TYPES}}.
|
|
49
|
+
Valid axis names (use only these): {{AXIS_NAMES}}.
|
|
50
|
+
- The fixture's package manager + test runner must be **the same toolchain this repo uses**.
|
|
51
|
+
Check `AGENTS.md` for the install/test commands.
|
|
52
|
+
- Each oracle `cmd` must be runnable from inside the worktree (`cwd: worktree, shell: true`) without
|
|
53
|
+
any `npm install` / `pip install` / equivalent first — i.e., the fixture should be self-contained
|
|
54
|
+
or rely on stdlib only. If the test command needs deps, include a tiny dependency-free alternative.
|
|
55
|
+
|
|
56
|
+
When done, summarize each new scenario id, its type, and what defect or task it exercises.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
You are AgentRig's installer agent. You are setting up and tailoring an autonomous-coding-agent
|
|
2
|
+
"harness" inside a real repository. Be precise and surgical. Prefer reading many files to understand
|
|
3
|
+
the repo before writing. Only edit the files you are explicitly asked to. Never invent build/test
|
|
4
|
+
commands — verify them against package manifests, lockfiles, CI config, and scripts you actually
|
|
5
|
+
find. Keep edits idempotent.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Task 2 of 2 — Tailor the installed harness to this repository
|
|
2
|
+
|
|
3
|
+
AgentRig has just installed a canonical best-practice harness into this repo:
|
|
4
|
+
|
|
5
|
+
{{ARTIFACT_LIST}}
|
|
6
|
+
|
|
7
|
+
Using everything you learned in Task 1 (and `.agentrig/context.md`), make the harness
|
|
8
|
+
repo-specific. Edit **only** the files listed below.
|
|
9
|
+
|
|
10
|
+
1. **`AGENTS.md`** — replace every `{{PLACEHOLDER}}` and fill the content between the
|
|
11
|
+
`<!-- AGENTRIG:...:start -->` / `:end` markers:
|
|
12
|
+
- `{{REPO_NAME}}`, `{{REPO_SUMMARY}}` — name and a 2-3 sentence description.
|
|
13
|
+
- The `commands` block — the REAL install/build/test/lint commands you verified. If one
|
|
14
|
+
genuinely does not exist, write `(none)`.
|
|
15
|
+
- The `dirmap` block — a concise directory map.
|
|
16
|
+
Do NOT change anything between the `critical-rules` markers.
|
|
17
|
+
2. **`.agents/rules/coding-standards.md`** — replace the generic baseline with standards that
|
|
18
|
+
actually match this repo's language and conventions. Keep it to a short list of imperative
|
|
19
|
+
reflexes and keep the frontmatter `globs`/`description`.
|
|
20
|
+
3. **`.agentrig/eval/scenarios/`** — adjust the existing scenario files so the setup/success
|
|
21
|
+
criteria reference this repo's real test/build commands and structure. Do not remove the axis
|
|
22
|
+
lists.
|
|
23
|
+
4. **`.github/workflows/copilot-setup-steps.yml`** — author a REAL, repo-specific setup workflow so
|
|
24
|
+
the GitHub Copilot **cloud/coding agent** has a ready environment (don't leave a generic stub).
|
|
25
|
+
Base it on your investigation:
|
|
26
|
+
- A single job named EXACTLY `copilot-setup-steps` on `runs-on: ubuntu-latest`, with
|
|
27
|
+
`permissions: contents: read`, triggered by `workflow_dispatch` + `push`/`pull_request`
|
|
28
|
+
filtered to this file.
|
|
29
|
+
- Steps that install the ACTUAL toolchain + dependencies you found: correct language runtime(s)
|
|
30
|
+
and version(s) (from `.nvmrc`/`.tool-versions`/`engines`/`go.mod`/`pyproject.toml`), the
|
|
31
|
+
correct package manager and install command (e.g. `npm ci`/`pnpm i --frozen-lockfile`/
|
|
32
|
+
`pip install -e .`/`go mod download`), dependency caching, and any system packages or
|
|
33
|
+
`services` (databases, etc.) the build/tests need. Keep it to env setup — not the task itself.
|
|
34
|
+
If you cannot determine the stack confidently, leave the generated scaffold and note what's
|
|
35
|
+
missing.
|
|
36
|
+
|
|
37
|
+
Keep all YAML frontmatter and the AgentRig markers intact. Do not touch the state machine, role
|
|
38
|
+
files, MCP config, or the eval scripts. When finished, summarize exactly which files you changed.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Task — Re-apply the latest AgentRig best practices
|
|
2
|
+
|
|
3
|
+
AgentRig refreshed these canonical artifacts to their latest version:
|
|
4
|
+
{{CHANGED_LIST}}
|
|
5
|
+
|
|
6
|
+
For each refreshed file, reconcile it with this repo:
|
|
7
|
+
- Preserve repo-specific content the team added (especially inside AgentRig markers in AGENTS.md and
|
|
8
|
+
in `coding-standards.md` and the scenarios).
|
|
9
|
+
- Adopt new structure, new sections, and new defaults from the canonical version.
|
|
10
|
+
- If there is a genuine conflict, prefer the new canonical structure but keep repo-specific facts
|
|
11
|
+
(commands, directory map, summary).
|
|
12
|
+
|
|
13
|
+
Re-read `.agentrig/context.md` first for repo context. Summarize what you merged and any conflicts
|
|
14
|
+
you resolved.
|
package/knowledge/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "agentrig-manifest/1",
|
|
3
|
-
"knowledgeVersion": "0.
|
|
3
|
+
"knowledgeVersion": "0.6.1",
|
|
4
4
|
"description": "Declares which best-practice artifacts AgentRig installs into a target repo and where. `src` is relative to the knowledge/ root; `dest` is relative to the target repo root. `kind`: file | dir | template. Templates contain {{PLACEHOLDERS}} the agent fills from its investigation; deterministic installs substitute known values and leave the rest for the agent.",
|
|
5
5
|
"artifacts": [
|
|
6
6
|
{
|
|
@@ -44,7 +44,7 @@ See `.agentrig/context.md` for the full, agent-authored investigation of this re
|
|
|
44
44
|
- **Agent roles & models:** `.agentrig/agents/` (triager, developer, reviewer, judge — each on a
|
|
45
45
|
varied model; reviewer differs from developer on purpose). See `.agentrig/agents/README.md` to add
|
|
46
46
|
new agent types.
|
|
47
|
-
- **Skills (procedural memory):** `.agents/skills/`
|
|
47
|
+
- **Skills (procedural memory):** `.agents/skills/` (the block below is auto-populated on `agentrig compile` / `update` by walking this directory — both AgentRig-bundled and user-added skills appear)
|
|
48
48
|
<!-- AGENTRIG:skills-inventory:start -->
|
|
49
49
|
{{SKILLS_INVENTORY}}
|
|
50
50
|
<!-- AGENTRIG:skills-inventory:end -->
|
|
@@ -8,10 +8,10 @@ single-model-bias mitigation surfaces problems no single model would catch alone
|
|
|
8
8
|
|
|
9
9
|
| Role | File | Default model | Drives state |
|
|
10
10
|
|------|------|---------------|--------------|
|
|
11
|
-
| **triager** | `triager.{yml,md}` | `gpt-5.5` (
|
|
12
|
-
| **developer**| `developer.{yml,md}`| `claude-opus-4.8` (
|
|
13
|
-
| **reviewer** | `reviewer.{yml,md}` | `gpt-5.5` (
|
|
14
|
-
| **judge** | `judge.{yml,md}` | `claude-opus-4.8` (
|
|
11
|
+
| **triager** | `triager.{yml,md}` | `gpt-5.5` (premium) | `ingested → queued` |
|
|
12
|
+
| **developer**| `developer.{yml,md}`| `claude-opus-4.8` (premium) | `queued → implementing → reviewing` |
|
|
13
|
+
| **reviewer** | `reviewer.{yml,md}` | `gpt-5.5` (premium) | `reviewing` |
|
|
14
|
+
| **judge** | `judge.{yml,md}` | `claude-opus-4.8` (premium) | `judging → ready_to_merge` |
|
|
15
15
|
|
|
16
16
|
> Keep the **reviewer on a different model family than the developer**. The audit
|
|
17
17
|
> (`agentrig eval --static`) checks for this.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer role (principle 2). Implements the change in the `implementing` state.
|
|
2
2
|
role: developer
|
|
3
3
|
model: claude-opus-4.8
|
|
4
|
-
model_tier:
|
|
4
|
+
model_tier: premium
|
|
5
5
|
# Skills are auto-discovered from .agents/skills; no explicit list needed.
|
|
6
6
|
allowed_tools: [read, write, edit, bash, grep, glob]
|
|
7
7
|
prompt: agents/developer.md
|
|
@@ -350,10 +350,11 @@
|
|
|
350
350
|
{
|
|
351
351
|
"id": "agents-skills-inventory",
|
|
352
352
|
"principle": 12,
|
|
353
|
-
"title": "AGENTS.md
|
|
354
|
-
"type": "
|
|
353
|
+
"title": "AGENTS.md skills-inventory block is POPULATED (not just present) with every installed skill",
|
|
354
|
+
"type": "marker-populated",
|
|
355
355
|
"path": "AGENTS.md",
|
|
356
|
-
"
|
|
356
|
+
"marker": "skills-inventory",
|
|
357
|
+
"enumerateDir": ".agents/skills",
|
|
357
358
|
"layer": "completeness",
|
|
358
359
|
"weight": 1
|
|
359
360
|
},
|
|
@@ -177,6 +177,30 @@ function scoreCheck(c) {
|
|
|
177
177
|
if (src && dst && !hasPath(adj, src, dst)) problems.push(`no path ${src}→${dst}`);
|
|
178
178
|
return problems.length === 0 ? { score: 1, evidence: "" } : { score: 0.5, evidence: problems.join("; ") };
|
|
179
179
|
}
|
|
180
|
+
case "marker-populated": {
|
|
181
|
+
// Mirror of src/core/audit.ts: assert AGENTRIG:<name> block in `path` is populated.
|
|
182
|
+
const p = c.path, name = c.marker || "";
|
|
183
|
+
const text = read(p);
|
|
184
|
+
if (text == null) return { score: 0, evidence: `missing ${p}` };
|
|
185
|
+
const esc = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
186
|
+
const pair = new RegExp(`<!--\\s*AGENTRIG:${esc}:start\\s*-->([\\s\\S]*?)<!--\\s*AGENTRIG:${esc}:end\\s*-->`);
|
|
187
|
+
const m = text.match(pair);
|
|
188
|
+
if (!m) return { score: 0, evidence: `marker pair AGENTRIG:${name} missing from ${p}` };
|
|
189
|
+
const body = m[1].trim();
|
|
190
|
+
if (!body || /\{\{[A-Z_]+\}\}/.test(body)) {
|
|
191
|
+
return { score: 0, evidence: `AGENTRIG:${name} block is empty or has unfilled placeholders` };
|
|
192
|
+
}
|
|
193
|
+
const enumerateDir = c.enumerateDir;
|
|
194
|
+
if (enumerateDir) {
|
|
195
|
+
const abs = rel(enumerateDir);
|
|
196
|
+
if (!existsSync(abs) || !statSync(abs).isDirectory()) return { score: 1, evidence: "" };
|
|
197
|
+
const required = readdirSync(abs).filter((e) => !e.startsWith(".") && !e.startsWith("_"));
|
|
198
|
+
const missing = required.filter((entry) => !body.includes(entry));
|
|
199
|
+
if (missing.length === 0) return { score: 1, evidence: "" };
|
|
200
|
+
return { score: 0.5, evidence: `block missing entries from ${enumerateDir}: ${missing.join(", ")}` };
|
|
201
|
+
}
|
|
202
|
+
return { score: 1, evidence: "" };
|
|
203
|
+
}
|
|
180
204
|
case "quality-probe": {
|
|
181
205
|
const probe = c.probe, p = c.path;
|
|
182
206
|
if (probe === "no-unfilled-placeholders") {
|
|
@@ -217,7 +241,7 @@ function scoreCheck(c) {
|
|
|
217
241
|
let j;
|
|
218
242
|
try { j = JSON.parse(text); } catch (e) { return { score: 0, evidence: `${p} not valid JSON: ${e.message}` }; }
|
|
219
243
|
const checks = j.checks || [];
|
|
220
|
-
const known = new Set(["path-exists","file-contains","dir-min","frontmatter-keys","frontmatter-keys-all","roles-distinct-models","roles-distinct-families","state-machine-dag","quality-probe"]);
|
|
244
|
+
const known = new Set(["path-exists","file-contains","dir-min","frontmatter-keys","frontmatter-keys-all","roles-distinct-models","roles-distinct-families","state-machine-dag","quality-probe","marker-populated"]);
|
|
221
245
|
const ids = checks.map((x) => x.id);
|
|
222
246
|
const dupIds = ids.filter((id, i) => id && ids.indexOf(id) !== i);
|
|
223
247
|
const badTypes = checks.filter((x) => !known.has(x.type));
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: harness-eval
|
|
3
3
|
description: Evaluate THIS repository's agent harness — a deterministic structure audit (A1) plus content quality probes (A2), plus an isolated producer/judge dynamic eval (B) with paired sign-test A/B variant comparison.
|
|
4
|
+
triggers:
|
|
5
|
+
- "evaluate / score the harness (static or dynamic)"
|
|
6
|
+
- "did a harness change improve or regress it?"
|
|
7
|
+
- before merging changes to skills/rules/agents/prompts
|
|
4
8
|
allowed-tools: Bash Read Grep Glob
|
|
5
9
|
argument-hint: "[--static|--dynamic] [--scenario id] [--variant v] [--n trials]"
|
|
6
10
|
---
|
|
@@ -4,7 +4,7 @@ description: Admission bar and structure for writing a new skill, so the skill l
|
|
|
4
4
|
triggers:
|
|
5
5
|
- "create / add a new skill"
|
|
6
6
|
- "this procedure keeps coming up"
|
|
7
|
-
allowed-tools: Read Edit Grep Glob
|
|
7
|
+
allowed-tools: Read Write Edit Grep Glob
|
|
8
8
|
argument-hint: "<skill-name>"
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ description: Turn a reviewer/judge failure into an instruction-surface change th
|
|
|
4
4
|
triggers:
|
|
5
5
|
- "a mistake recurred"
|
|
6
6
|
- "reviewer feedback points at a missing rule/skill"
|
|
7
|
-
allowed-tools: Read Edit Grep Glob
|
|
7
|
+
allowed-tools: Read Write Edit Grep Glob
|
|
8
8
|
argument-hint: "<short description of the failure>"
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -13,11 +13,7 @@ Before adding an entry, confirm no existing entry covers it. If one does, **shar
|
|
|
13
13
|
adding a near-duplicate. Each entry should be: a title, the symptom, the root cause, the fix, and a
|
|
14
14
|
one-line prevention.
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **Cause:** the real root cause
|
|
21
|
-
- **Fix:** the change that resolved it
|
|
22
|
-
- **Prevention:** the rule/skill wording that would have stopped it (feed to skill-improver)
|
|
23
|
-
```
|
|
16
|
+
## Adding an entry
|
|
17
|
+
Copy `_TEMPLATE.md` to `.agents/wiki/<slug>.md`, fill its four sections, and add a one-line link to
|
|
18
|
+
the **Index** in `index.md` (newest first). See `index.md` for what belongs in the wiki vs a skill,
|
|
19
|
+
rule, or `AGENTS.md`.
|
|
@@ -15,15 +15,10 @@ way. It is **not** a mirror of the docs or skills.
|
|
|
15
15
|
If a gotcha becomes a reusable procedure, **promote it to a skill** and leave a one-line pointer
|
|
16
16
|
here.
|
|
17
17
|
|
|
18
|
-
## Tiers (principle 8)
|
|
19
|
-
1. **Central wiki (this dir, committed):** repo-wide, reviewed gotchas. CODEOWNERS-gate it.
|
|
20
|
-
2. **Local wiki (git-ignored `*.local.md`):** machine/contributor-specific notes.
|
|
21
|
-
3. **Session scratch:** ephemeral working notes; never a substitute for the wiki.
|
|
22
|
-
|
|
23
18
|
## Index
|
|
24
19
|
_Add a one-line link per entry as you create it, newest first._
|
|
25
20
|
- (none yet)
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
---
|
|
23
|
+
Wiki **policy** (tiers + admission test) lives in `README.md`; the **entry format** lives in
|
|
24
|
+
`_TEMPLATE.md`. Don't restate them here.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doidor/agentrig",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "AgentRig — an agentic meta-harness. A CLI that investigates a repository and installs (and evaluates) a best-practice agent harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"node": ">=22.0.0"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
|
-
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"build": "tsc -p tsconfig.json && node scripts/copy-prompt-templates.mjs",
|
|
31
31
|
"dev": "tsc -p tsconfig.json --watch",
|
|
32
32
|
"clean": "rm -rf dist",
|
|
33
33
|
"prepare": "npm run build",
|