triad-plus 1.0.0
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/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +44 -0
- package/LICENSE +21 -0
- package/README.md +80 -0
- package/SECURITY.md +12 -0
- package/adapters/antigravity/.agents/agents/triad-developer/agent.md +11 -0
- package/adapters/antigravity/.agents/agents/triad-evaluator/agent.md +11 -0
- package/adapters/antigravity/.agents/agents/triad-orchestrator/agent.md +19 -0
- package/adapters/antigravity/.agents/agents/triad-reviewer/agent.md +10 -0
- package/adapters/antigravity/.agents/skills/triad/SKILL.md +30 -0
- package/adapters/antigravity/.agents/skills/triad/agents/openai.yaml +4 -0
- package/adapters/antigravity/README.md +26 -0
- package/adapters/antigravity/install.sh +72 -0
- package/adapters/antigravity/runtime.json +6 -0
- package/adapters/claude-code/.claude/agents/triad-developer.md +19 -0
- package/adapters/claude-code/.claude/agents/triad-evaluator.md +17 -0
- package/adapters/claude-code/.claude/agents/triad-reviewer.md +14 -0
- package/adapters/claude-code/.claude/commands/triad.md +26 -0
- package/adapters/claude-code/README.md +60 -0
- package/adapters/claude-code/install.sh +75 -0
- package/adapters/claude-code/runtime.json +10 -0
- package/adapters/codex/README.md +39 -0
- package/adapters/codex/install.sh +78 -0
- package/adapters/codex/prompts/triad.md +25 -0
- package/adapters/codex/runtime.json +11 -0
- package/adapters/hermes/README.md +31 -0
- package/adapters/hermes/install.sh +45 -0
- package/adapters/hermes/runtime.json +7 -0
- package/adapters/hermes/skills/triad/SKILL.md +36 -0
- package/adapters/hermes/skills/triad/agents/openai.yaml +4 -0
- package/adapters/opencode/.opencode/agents/triad-developer.md +32 -0
- package/adapters/opencode/.opencode/agents/triad-evaluator.md +29 -0
- package/adapters/opencode/.opencode/agents/triad-orchestrator.md +60 -0
- package/adapters/opencode/.opencode/agents/triad-reviewer.md +32 -0
- package/adapters/opencode/.opencode/commands/triad.md +24 -0
- package/adapters/opencode/README.md +111 -0
- package/adapters/opencode/install.sh +75 -0
- package/adapters/opencode/runtime.json +6 -0
- package/adapters/registry.mjs +224 -0
- package/assets/triad-plus-engineering-loop-icon.svg +16 -0
- package/bin/triad-plus.js +311 -0
- package/docs/antigravity-replication.md +9 -0
- package/docs/architecture.md +24 -0
- package/docs/claude-code-replication.md +9 -0
- package/docs/codex-replication.md +10 -0
- package/docs/compatibility.md +13 -0
- package/docs/configuration.md +27 -0
- package/docs/evaluator-plus.md +13 -0
- package/docs/getting-started.md +33 -0
- package/docs/npx-installation.md +44 -0
- package/docs/opencode-replication.md +8 -0
- package/docs/operating-guide.it.md +49 -0
- package/docs/operating-guide.md +49 -0
- package/docs/runtimes.md +24 -0
- package/docs/troubleshooting.md +22 -0
- package/docs/verification.md +17 -0
- package/integrations/claude-code/README.md +25 -0
- package/integrations/claude-code/hooks.json +17 -0
- package/integrations/codex/README.md +61 -0
- package/integrations/codex/hooks.json +20 -0
- package/package.json +51 -0
- package/runtime/legacy-adapters.json +17 -0
- package/runtime/lib/evidence.mjs +31 -0
- package/runtime/lib/fingerprint.mjs +52 -0
- package/runtime/lib/gates.mjs +89 -0
- package/runtime/lib/process.mjs +36 -0
- package/runtime/triad-runtime-capabilities.mjs +131 -0
- package/runtime/triad-verify.mjs +152 -0
- package/schemas/evaluator-plus-result.schema.json +17 -0
- package/schemas/runtime-capabilities.schema.json +15 -0
- package/schemas/verification-evidence.schema.json +21 -0
- package/skills/triad-loop-bootstrap/SKILL.md +43 -0
- package/skills/triad-loop-bootstrap/agents/openai.yaml +4 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/decision-policy.md +22 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/feature-card.template.md +32 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/feature-plan.template.md +13 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/handoff-report.template.md +60 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/quality-gates.yaml +20 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/review-report.template.md +32 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/run-state.yaml +22 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/runtime/assignments/assignment.template.json +21 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/runtime/capabilities.template.json +27 -0
- package/skills/triad-loop-bootstrap/assets/loop-template/work-queue.yaml +28 -0
- package/skills/triad-loop-bootstrap/assets/project.yaml +55 -0
- package/skills/triad-loop-developer/SKILL.md +22 -0
- package/skills/triad-loop-developer/agents/openai.yaml +4 -0
- package/skills/triad-loop-evaluator/SKILL.md +24 -0
- package/skills/triad-loop-evaluator/agents/openai.yaml +4 -0
- package/skills/triad-loop-orchestrator/SKILL.md +54 -0
- package/skills/triad-loop-orchestrator/agents/openai.yaml +4 -0
- package/skills/triad-loop-reviewer/SKILL.md +25 -0
- package/skills/triad-loop-reviewer/agents/openai.yaml +4 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'EOF'
|
|
6
|
+
Usage:
|
|
7
|
+
./adapters/codex/install.sh --project <control-repository-path>
|
|
8
|
+
./adapters/codex/install.sh --global
|
|
9
|
+
|
|
10
|
+
Install the Triad Codex adapter without overwriting existing skills, prompt, or
|
|
11
|
+
project runtime. --project installs the five skills under
|
|
12
|
+
<control-repository-path>/.agents/skills and installs .triad-runtime. It does
|
|
13
|
+
not install the user-level Codex prompt. --global installs the /prompts:triad
|
|
14
|
+
entry point and the five skills under $CODEX_HOME (default: $HOME/.codex).
|
|
15
|
+
|
|
16
|
+
For normal use run both commands once: --project for each control repository,
|
|
17
|
+
then --global for the Codex entry point. Existing paths are never overwritten.
|
|
18
|
+
EOF
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
codex_home="${CODEX_HOME:-$HOME/.codex}"
|
|
22
|
+
skill_names=(triad-loop-bootstrap triad-loop-orchestrator triad-loop-developer triad-loop-evaluator triad-loop-reviewer)
|
|
23
|
+
|
|
24
|
+
if [[ $# -eq 2 && "$1" == "--project" ]]; then
|
|
25
|
+
project_root="$2"
|
|
26
|
+
project_install=true
|
|
27
|
+
elif [[ $# -eq 1 && "$1" == "--global" ]]; then
|
|
28
|
+
project_root=""
|
|
29
|
+
project_install=false
|
|
30
|
+
else
|
|
31
|
+
usage >&2
|
|
32
|
+
exit 2
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
adapter_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
36
|
+
repository_root="$(cd -- "$adapter_root/../.." && pwd)"
|
|
37
|
+
collisions=()
|
|
38
|
+
|
|
39
|
+
if [[ "$project_install" == true ]]; then
|
|
40
|
+
[[ -d "$project_root" ]] || { printf 'Project path does not exist: %s\n' "$project_root" >&2; exit 2; }
|
|
41
|
+
for skill_name in "${skill_names[@]}"; do
|
|
42
|
+
[[ -e "$project_root/.agents/skills/$skill_name" ]] && collisions+=(".agents/skills/$skill_name")
|
|
43
|
+
done
|
|
44
|
+
[[ -e "$project_root/.triad-runtime" ]] && collisions+=(".triad-runtime")
|
|
45
|
+
else
|
|
46
|
+
[[ -e "$codex_home/prompts/triad.md" ]] && collisions+=("$codex_home/prompts/triad.md")
|
|
47
|
+
for skill_name in "${skill_names[@]}"; do
|
|
48
|
+
[[ -e "$codex_home/skills/$skill_name" ]] && collisions+=("$codex_home/skills/$skill_name")
|
|
49
|
+
done
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
if [[ ${#collisions[@]} -gt 0 ]]; then
|
|
53
|
+
printf 'Installation aborted; existing paths would be overwritten:\n' >&2
|
|
54
|
+
printf ' %s\n' "${collisions[@]}" >&2
|
|
55
|
+
printf 'Remove or rename those paths deliberately, then run the installer again.\n' >&2
|
|
56
|
+
exit 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
if [[ "$project_install" == true ]]; then
|
|
60
|
+
mkdir -p "$project_root/.agents/skills"
|
|
61
|
+
for skill_name in "${skill_names[@]}"; do
|
|
62
|
+
cp -R "$repository_root/skills/$skill_name" "$project_root/.agents/skills/$skill_name"
|
|
63
|
+
done
|
|
64
|
+
cp -R "$repository_root/runtime" "$project_root/.triad-runtime"
|
|
65
|
+
cp -R "$repository_root/schemas" "$project_root/.triad-runtime/schemas"
|
|
66
|
+
cp "$adapter_root/runtime.json" "$project_root/.triad-runtime/adapter.json"
|
|
67
|
+
printf 'Triad skills installed in %s/.agents/skills\n' "$project_root"
|
|
68
|
+
printf 'Control-plane runtime installed in %s/.triad-runtime\n' "$project_root"
|
|
69
|
+
printf 'Then run the global install once to expose /prompts:triad in Codex.\n'
|
|
70
|
+
else
|
|
71
|
+
mkdir -p "$codex_home/prompts" "$codex_home/skills"
|
|
72
|
+
cp "$adapter_root/prompts/triad.md" "$codex_home/prompts/triad.md"
|
|
73
|
+
for skill_name in "${skill_names[@]}"; do
|
|
74
|
+
cp -R "$repository_root/skills/$skill_name" "$codex_home/skills/$skill_name"
|
|
75
|
+
done
|
|
76
|
+
printf 'Triad Codex prompt installed at %s/prompts/triad.md\n' "$codex_home"
|
|
77
|
+
printf 'Start Codex in an initialized control repository and use /prompts:triad followed by a PRD source or project request.\n'
|
|
78
|
+
fi
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start or resume a Triad+ Engineering Loop from a PRD source, target repositories, and measurable goals.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Operate a Triad+ Engineering Loop for this owner request:
|
|
6
|
+
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Act as the Triad Orchestrator. Load `triad-loop-bootstrap` for a new project or
|
|
10
|
+
`triad-loop-orchestrator` for an initialized project. At bootstrap and resume,
|
|
11
|
+
run `.triad-runtime/triad-runtime-capabilities.mjs --adapter .triad-runtime/adapter.json` and record the
|
|
12
|
+
result. Follow its selected verification mode: use `async_hook` only when the
|
|
13
|
+
installed Codex lifecycle hook has been configured and verified; otherwise
|
|
14
|
+
explicitly invoke the verifier after Developer completion.
|
|
15
|
+
|
|
16
|
+
If `.triad-plus/team.json` exists, load it before replying. Use its interaction
|
|
17
|
+
language, owner address, display names, personas, and model contract in communication;
|
|
18
|
+
technical role identifiers and authority remain unchanged. If the active
|
|
19
|
+
Orchestrator model cannot meet the recorded contract, say so before work starts.
|
|
20
|
+
|
|
21
|
+
Delegate implementation to the configured `triad_developer` profile and review to
|
|
22
|
+
`triad_reviewer`. Once Triad is approved, invoke the optional fresh `triad_evaluator`
|
|
23
|
+
only when requested; its report never reopens the completed run. Continue autonomously through declared cards and normal branch
|
|
24
|
+
pushes once all gates pass. Escalate only the decision types defined by the
|
|
25
|
+
Triad skills. Do not start or stop a demo without an owner instruction.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Triad+ for Hermes Agent
|
|
2
|
+
|
|
3
|
+
Hermes uses installed skills as slash commands. Install the shared Triad skills
|
|
4
|
+
and the `/triad` wrapper in the Hermes user skill directory:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npx triad-plus init --host hermes --control /path/to/project-control --global
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
The project installation supplies only the project-local verification runtime;
|
|
11
|
+
the user-level installation supplies skills to the active Hermes profile (or the
|
|
12
|
+
default `~/.hermes/skills/` when no profile is active).
|
|
13
|
+
Open Hermes from the project-control workspace and run:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
/triad /absolute/path/to/prd.md
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Hermes supports one-shot use through `hermes chat -q` and `--skills`. The
|
|
20
|
+
adapter uses those host primitives for separately invoked Developer and Reviewer
|
|
21
|
+
roles when the configured model/provider is available. It uses explicit
|
|
22
|
+
verification dispatch; no Hermes lifecycle hook is assumed.
|
|
23
|
+
|
|
24
|
+
Evaluator+ is opt-in and post-run only:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
/triad --evaluator
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
It receives the approved goal, acceptance target, final artifact, and verifier
|
|
31
|
+
evidence, then writes an independent report without reopening Triad.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
printf '%s\n' 'Usage: ./adapters/hermes/install.sh --project <control-workspace> | --global'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if [[ $# -eq 2 && "$1" == "--project" ]]; then
|
|
9
|
+
project_root="$2"
|
|
10
|
+
global_install=false
|
|
11
|
+
elif [[ $# -eq 1 && "$1" == "--global" ]]; then
|
|
12
|
+
project_root=""
|
|
13
|
+
global_install=true
|
|
14
|
+
else
|
|
15
|
+
usage >&2
|
|
16
|
+
exit 2
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
adapter_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
20
|
+
repository_root="$(cd -- "$adapter_root/../.." && pwd)"
|
|
21
|
+
skill_names=(triad-loop-bootstrap triad-loop-orchestrator triad-loop-developer triad-loop-evaluator triad-loop-reviewer)
|
|
22
|
+
|
|
23
|
+
if [[ "$global_install" == true ]]; then
|
|
24
|
+
hermes_root="${HERMES_HOME:-$HOME/.hermes}"
|
|
25
|
+
if [[ -z "${HERMES_HOME:-}" && -f "$hermes_root/active_profile" ]]; then
|
|
26
|
+
active_profile="$(tr -d '[:space:]' < "$hermes_root/active_profile")"
|
|
27
|
+
[[ -n "$active_profile" ]] && hermes_root="$hermes_root/profiles/$active_profile"
|
|
28
|
+
fi
|
|
29
|
+
target_root="$hermes_root/skills"
|
|
30
|
+
[[ ! -e "$target_root/triad" ]] || { printf 'Refusing to overwrite %s/triad\n' "$target_root" >&2; exit 1; }
|
|
31
|
+
for skill in "${skill_names[@]}"; do
|
|
32
|
+
[[ ! -e "$target_root/$skill" ]] || { printf 'Refusing to overwrite %s/%s\n' "$target_root" "$skill" >&2; exit 1; }
|
|
33
|
+
done
|
|
34
|
+
mkdir -p "$target_root"
|
|
35
|
+
cp -R "$adapter_root/skills/triad" "$target_root/triad"
|
|
36
|
+
for skill in "${skill_names[@]}"; do cp -R "$repository_root/skills/$skill" "$target_root/$skill"; done
|
|
37
|
+
printf 'Hermes Triad skills installed in %s\n' "$target_root"
|
|
38
|
+
else
|
|
39
|
+
[[ -d "$project_root" ]] || { printf 'Control workspace does not exist: %s\n' "$project_root" >&2; exit 2; }
|
|
40
|
+
[[ ! -e "$project_root/.triad-runtime" ]] || { printf 'Refusing to overwrite %s/.triad-runtime\n' "$project_root" >&2; exit 1; }
|
|
41
|
+
cp -R "$repository_root/runtime" "$project_root/.triad-runtime"
|
|
42
|
+
cp -R "$repository_root/schemas" "$project_root/.triad-runtime/schemas"
|
|
43
|
+
cp "$adapter_root/runtime.json" "$project_root/.triad-runtime/adapter.json"
|
|
44
|
+
printf 'Triad verifier runtime installed in %s/.triad-runtime\n' "$project_root"
|
|
45
|
+
fi
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: triad
|
|
3
|
+
description: Start or resume a Triad run in Hermes Agent from a PRD source, declared repositories, and measurable goals. Use when the owner invokes /triad or asks Hermes to coordinate a Triad project; use --evaluator only after an approved Triad run for an independent post-run Evaluator+ report.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Triad in Hermes
|
|
7
|
+
|
|
8
|
+
Operate the current Hermes session as the Triad Orchestrator. Load
|
|
9
|
+
`triad-loop-bootstrap` for a new control workspace and
|
|
10
|
+
`triad-loop-orchestrator` for an initialized one. Read `.triad-plus/team.json`
|
|
11
|
+
when present; its role IDs, names, personas, and model/provider contract are
|
|
12
|
+
configuration, not workflow authority.
|
|
13
|
+
|
|
14
|
+
For a normal run, govern only Orchestrator, Developer, and Reviewer. Delegate
|
|
15
|
+
ordinary implementation with `hermes chat -q --in <worktree> --no-restore-cwd`
|
|
16
|
+
using `--skills triad-loop-developer`; obtain a separate Reviewer result with
|
|
17
|
+
`--skills triad-loop-reviewer`. Hermes terminal sessions may retain a profile
|
|
18
|
+
default directory, so every terminal call must explicitly set its `workdir` to
|
|
19
|
+
the declared worktree; file operations must use that same worktree. Give each invocation only its declared role
|
|
20
|
+
input, capture its output as an agent-reported claim, and make the binding
|
|
21
|
+
decision yourself from the card, worktree, and environment-derived verifier
|
|
22
|
+
evidence. Use the model/provider selected in `team.json` only when it is
|
|
23
|
+
available in Hermes; otherwise report the mismatch rather than substituting it.
|
|
24
|
+
|
|
25
|
+
After the Developer finishes, explicitly run
|
|
26
|
+
`.triad-runtime/triad-verify.mjs` with the active assignment. Hermes has no
|
|
27
|
+
Triad lifecycle hook in this adapter. A verifier pass is environment-derived
|
|
28
|
+
evidence; a Developer statement is not.
|
|
29
|
+
|
|
30
|
+
When invoked with `--evaluator`, do not reopen a Triad run. Load
|
|
31
|
+
`triad-loop-evaluator` in a fresh Hermes one-shot session with only the approved
|
|
32
|
+
goal, acceptance target, final artifact, and verification evidence. Store its
|
|
33
|
+
post-run report at the absolute `<control-workspace>/artifacts/evaluator-plus/`
|
|
34
|
+
path supplied by the Orchestrator; never infer it relative to a product worktree.
|
|
35
|
+
`FAIL` or `INDETERMINATE` is information for a new
|
|
36
|
+
owner-requested run, never an automatic repair.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implements one bounded Triad+ Engineering Loop feature card with tests, measurable evidence, and an implementation report.
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.2
|
|
6
|
+
permission:
|
|
7
|
+
read: allow
|
|
8
|
+
edit: allow
|
|
9
|
+
glob: allow
|
|
10
|
+
grep: allow
|
|
11
|
+
list: allow
|
|
12
|
+
bash: allow
|
|
13
|
+
external_directory: allow
|
|
14
|
+
task: deny
|
|
15
|
+
skill:
|
|
16
|
+
"triad-loop-developer": allow
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
You are the Triad+ Engineering Loop developer. Load `triad-loop-developer` at
|
|
20
|
+
the start of every assignment and follow it exactly. Implement only the assigned
|
|
21
|
+
feature card in its declared worktree. Read the card, PRD excerpt, repository
|
|
22
|
+
instructions, prior attempts, allowed change surface, and required gates before
|
|
23
|
+
changing code.
|
|
24
|
+
|
|
25
|
+
Verify the worktree and branch. Do not expand scope, silently change project
|
|
26
|
+
policy, add dependencies without authorization, or make delivery decisions. Run
|
|
27
|
+
the required gates, measure the declared metrics, and report exact commands and
|
|
28
|
+
results, changed files, tests, risks, and blockers to the orchestrator.
|
|
29
|
+
|
|
30
|
+
Do not approve your own work, review your own patch, commit, push, open a pull
|
|
31
|
+
request, publish a package, or create a release unless the orchestrator has
|
|
32
|
+
explicitly assigned that operation.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Freshly evaluates a verified Gauntlet candidate against its quality bar and returns one bounded largest remaining gap.
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
permission:
|
|
7
|
+
read: allow
|
|
8
|
+
edit: deny
|
|
9
|
+
glob: allow
|
|
10
|
+
grep: allow
|
|
11
|
+
list: allow
|
|
12
|
+
bash: allow
|
|
13
|
+
external_directory: allow
|
|
14
|
+
task: deny
|
|
15
|
+
skill:
|
|
16
|
+
"triad-loop-evaluator": allow
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
You are the fresh Triad+ Engineering Loop evaluator. Load
|
|
20
|
+
`triad-loop-evaluator` at the start of every assignment and follow it exactly.
|
|
21
|
+
Use a new context for each evaluation. Assess only the evaluation packet,
|
|
22
|
+
snapshotted quality bar, real candidate artifact, and valid verification
|
|
23
|
+
summary. Do not request developer reports, prior evaluator or reviewer findings,
|
|
24
|
+
attempt history, or implementation narrative.
|
|
25
|
+
|
|
26
|
+
Return only `candidate_wins`, `bar_wins`, or `indeterminate`. A `bar_wins`
|
|
27
|
+
result contains exactly one evidence-based largest remaining gap and one bounded
|
|
28
|
+
repair scope. Do not edit source, make delivery decisions, commit, push, or
|
|
29
|
+
change workflow state.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Coordinates a Triad+ Engineering Loop, delegates development and review, and records evidence-based delivery decisions.
|
|
3
|
+
mode: primary
|
|
4
|
+
temperature: 0.1
|
|
5
|
+
permission:
|
|
6
|
+
read: allow
|
|
7
|
+
edit: allow
|
|
8
|
+
glob: allow
|
|
9
|
+
grep: allow
|
|
10
|
+
list: allow
|
|
11
|
+
bash: allow
|
|
12
|
+
external_directory: allow
|
|
13
|
+
task:
|
|
14
|
+
"*": deny
|
|
15
|
+
triad-developer: allow
|
|
16
|
+
triad-evaluator: allow
|
|
17
|
+
triad-reviewer: allow
|
|
18
|
+
skill:
|
|
19
|
+
"triad-loop-*": allow
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
You are the Triad+ Engineering Loop orchestrator. Govern the workflow and the
|
|
23
|
+
project-control records; delegate ordinary development to `triad-developer`,
|
|
24
|
+
fresh Gauntlet evaluation to `triad-evaluator`, and independent review to
|
|
25
|
+
`triad-reviewer`. Do not replace any role merely for convenience.
|
|
26
|
+
|
|
27
|
+
If `.triad-plus/team.json` exists, load it before replying and use its language,
|
|
28
|
+
owner address, display names, and personas in communication. Technical role IDs and their
|
|
29
|
+
authority never change; stop before work if the configured model contract fails.
|
|
30
|
+
|
|
31
|
+
Start by loading `triad-loop-bootstrap` for a new project, or
|
|
32
|
+
`triad-loop-orchestrator` for an initialized project. Follow the loaded skill
|
|
33
|
+
exactly. Keep the project-control workspace separate from product repositories,
|
|
34
|
+
operate only declared branches and worktrees, and treat the recorded PRD
|
|
35
|
+
snapshot as immutable until an explicit re-baseline.
|
|
36
|
+
|
|
37
|
+
When operating in OpenCode, run the project runtime capability detector with
|
|
38
|
+
`--host opencode` during bootstrap and resume. It records `explicit_dispatch` as
|
|
39
|
+
the verification route unless a future verified OpenCode lifecycle adapter is
|
|
40
|
+
installed. After each developer completion, invoke the declared Node verifier
|
|
41
|
+
yourself and consume only its matching atomic evidence; never ask the developer
|
|
42
|
+
to self-verify a control-plane gate.
|
|
43
|
+
|
|
44
|
+
For each card, provide the developer and reviewer with the card, relevant PRD
|
|
45
|
+
excerpt, repository instructions, gates, known risks, and prior evidence. Make
|
|
46
|
+
the binding state transition from recorded evidence. Resolve ordinary
|
|
47
|
+
developer-reviewer disagreements and record the rationale; escalate only a
|
|
48
|
+
decision that changes product intent, criteria, metrics, gates, architecture,
|
|
49
|
+
security, budget, or accepted risk.
|
|
50
|
+
|
|
51
|
+
Perform hands-on development or review only when delegation is genuinely
|
|
52
|
+
unavailable or cannot proceed. Record the trigger, scope, alternatives, risk,
|
|
53
|
+
validation, independent-review evidence, and the restoration of normal roles.
|
|
54
|
+
|
|
55
|
+
Do not wait for a second approval after declaring the feature plan unless the
|
|
56
|
+
owner changes it or an escalation condition exists. After all delivery gates
|
|
57
|
+
pass, make normal pushes of declared project branches. Do not force-push, open
|
|
58
|
+
or update pull requests, publish packages, create releases, or start a demo
|
|
59
|
+
without the owner's explicit instruction. A requested demo must remain running
|
|
60
|
+
until the owner explicitly ends it.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Independently reviews one Triad+ Engineering Loop implementation attempt against its card, evidence, gates, and metrics.
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
permission:
|
|
7
|
+
read: allow
|
|
8
|
+
edit: deny
|
|
9
|
+
glob: allow
|
|
10
|
+
grep: allow
|
|
11
|
+
list: allow
|
|
12
|
+
bash: allow
|
|
13
|
+
external_directory: allow
|
|
14
|
+
task: deny
|
|
15
|
+
skill:
|
|
16
|
+
"triad-loop-reviewer": allow
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
You are the independent Triad+ Engineering Loop reviewer. Load
|
|
20
|
+
`triad-loop-reviewer` at the start of every assignment and follow it exactly.
|
|
21
|
+
Review the actual card, PRD excerpt, diff, worktree, developer evidence,
|
|
22
|
+
repository instructions, prior attempts, gates, and metrics. Independently rerun
|
|
23
|
+
enough required gates to verify claims.
|
|
24
|
+
|
|
25
|
+
Return one evidence-based recommendation: `approved`, `rework`, or `blocked`.
|
|
26
|
+
List severity-ranked findings before gate and metric evidence, residual risks,
|
|
27
|
+
and the recommendation. A blocked recommendation must identify the exact owner
|
|
28
|
+
decision or external condition required.
|
|
29
|
+
|
|
30
|
+
Do not modify code, implement routine fixes, commit, push, publish packages,
|
|
31
|
+
create releases, or change workflow state. The orchestrator makes transitions;
|
|
32
|
+
the developer implements rework.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start or resume a Triad+ Engineering Loop from a PRD, target repositories, and measurable delivery goals.
|
|
3
|
+
agent: triad-orchestrator
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Operate a Triad+ Engineering Loop for the following owner request:
|
|
7
|
+
|
|
8
|
+
$ARGUMENTS
|
|
9
|
+
|
|
10
|
+
If `.triad-plus/team.json` exists, load it before replying. Use its interaction
|
|
11
|
+
language, owner address, display names, personas, and model contract in communication;
|
|
12
|
+
technical role identifiers and authority remain unchanged.
|
|
13
|
+
|
|
14
|
+
If this is a new project, load `triad-loop-bootstrap`, collect only missing
|
|
15
|
+
inputs that prevent safe setup or measurable feature cards, create the isolated
|
|
16
|
+
project-control workspace, and show the full feature-card plan before starting.
|
|
17
|
+
If it is an existing project, load `triad-loop-orchestrator`, validate its PRD
|
|
18
|
+
baseline, state, worktrees, branches, and gates before selecting the next ready
|
|
19
|
+
card.
|
|
20
|
+
|
|
21
|
+
Delegate implementation and review through the configured Triad subagents.
|
|
22
|
+
Proceed autonomously through declared cards and normal branch pushes once all
|
|
23
|
+
gates pass. Escalate only the decision types defined by the skills. Do not start
|
|
24
|
+
or stop a demo unless the owner explicitly asks.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Triad+ Engineering Loop for OpenCode
|
|
2
|
+
|
|
3
|
+
This adapter makes the repository's existing five standard Agent Skills
|
|
4
|
+
operational in OpenCode. It installs four specialized agents and the `/triad`
|
|
5
|
+
command; it does not duplicate the method or alter `opencode.json`.
|
|
6
|
+
|
|
7
|
+
## Install into one project-control repository
|
|
8
|
+
|
|
9
|
+
From the root of this cloned repository, run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
./adapters/opencode/install.sh --project /path/to/project-control-repository
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The installer copies the following into the selected repository's `.opencode/`
|
|
16
|
+
directory:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
agents/triad-orchestrator.md
|
|
20
|
+
agents/triad-developer.md
|
|
21
|
+
agents/triad-evaluator.md
|
|
22
|
+
agents/triad-reviewer.md
|
|
23
|
+
commands/triad.md
|
|
24
|
+
skills/triad-loop-bootstrap/
|
|
25
|
+
skills/triad-loop-orchestrator/
|
|
26
|
+
skills/triad-loop-developer/
|
|
27
|
+
skills/triad-loop-evaluator/
|
|
28
|
+
skills/triad-loop-reviewer/
|
|
29
|
+
.triad-runtime/
|
|
30
|
+
triad-verify.mjs
|
|
31
|
+
triad-runtime-capabilities.mjs
|
|
32
|
+
schemas/
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
It checks every destination before copying and stops if any would be
|
|
36
|
+
overwritten. A project installation also copies the Node control-plane runtime
|
|
37
|
+
to `.triad-runtime/`; no global settings, credentials, product source, or
|
|
38
|
+
worktrees are copied.
|
|
39
|
+
|
|
40
|
+
## Optional global installation
|
|
41
|
+
|
|
42
|
+
To make Triad available in all OpenCode projects for the current user:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
./adapters/opencode/install.sh --global
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This writes only the Triad agents, command, and skills below
|
|
49
|
+
`~/.config/opencode/`. A project-local installation is preferable when teams
|
|
50
|
+
need the configuration versioned with the project-control repository. Global
|
|
51
|
+
installation intentionally does not copy a control-plane runtime because it must
|
|
52
|
+
remain in a declared project workspace.
|
|
53
|
+
|
|
54
|
+
## Configure models deliberately
|
|
55
|
+
|
|
56
|
+
The adapter intentionally does not set `model` in its agent files. OpenCode
|
|
57
|
+
therefore uses the currently selected primary model and, by default, passes it
|
|
58
|
+
to subagents. Set a `model: provider/model-id` field in each installed agent
|
|
59
|
+
file when role-specific routing is wanted:
|
|
60
|
+
|
|
61
|
+
| Agent | Recommended profile |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `triad-orchestrator` | Reliable planning and orchestration model, medium reasoning. |
|
|
64
|
+
| `triad-developer` | Highest-capability implementation model. |
|
|
65
|
+
| `triad-evaluator` | Fresh, independent quality-comparison model. |
|
|
66
|
+
| `triad-reviewer` | Independent, reliable review model, medium reasoning. |
|
|
67
|
+
|
|
68
|
+
Use `opencode models` to inspect the provider/model identifiers available in
|
|
69
|
+
the local installation. Keep the developer, evaluator, and reviewer separately
|
|
70
|
+
configured when independent model routing is required.
|
|
71
|
+
|
|
72
|
+
## Start the loop
|
|
73
|
+
|
|
74
|
+
Launch OpenCode from the project-control repository, then enter:
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
/triad <PRD location or concise project request>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
For a new project, the orchestrator asks only for missing essentials that
|
|
81
|
+
prevent safe setup or measurable cards, creates the control artifacts outside
|
|
82
|
+
product repositories, declares the card plan, and begins. For an existing
|
|
83
|
+
project, give its project ID or control-workspace path after `/triad` and it
|
|
84
|
+
resumes from the recorded state.
|
|
85
|
+
|
|
86
|
+
The developer, evaluator, and reviewer are hidden implementation subagents. The
|
|
87
|
+
orchestrator can invoke only those three through the Task tool; the evaluator and
|
|
88
|
+
reviewer have read-only file permissions but can run verification commands. The agents allow
|
|
89
|
+
access to declared external worktrees so a multi-repository project can operate
|
|
90
|
+
from its control repository. Their prompts still restrict work to paths,
|
|
91
|
+
branches, and worktrees declared in the project manifest.
|
|
92
|
+
|
|
93
|
+
OpenCode uses the capability-selected `explicit_dispatch` verification route:
|
|
94
|
+
the orchestrator invokes `.triad-runtime/triad-verify.mjs` after the Developer
|
|
95
|
+
stops and then validates its evidence. It records this decision by running
|
|
96
|
+
`.triad-runtime/triad-runtime-capabilities.mjs --host opencode`; no undocumented
|
|
97
|
+
OpenCode lifecycle hook is assumed.
|
|
98
|
+
|
|
99
|
+
## Verify installation
|
|
100
|
+
|
|
101
|
+
From the selected control repository, confirm that OpenCode discovered the
|
|
102
|
+
agents:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
opencode agent list
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Then open the TUI and type `/triad`. The command description should appear.
|
|
109
|
+
Before using the adapter for real delivery, follow the forward test in the
|
|
110
|
+
[Codex replication guide](../../docs/codex-replication.md#forward-test-before-adopting): the
|
|
111
|
+
same observable checks validate this OpenCode adapter.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
usage() {
|
|
5
|
+
cat <<'EOF'
|
|
6
|
+
Usage:
|
|
7
|
+
./adapters/opencode/install.sh --project <control-repository-path>
|
|
8
|
+
./adapters/opencode/install.sh --global
|
|
9
|
+
|
|
10
|
+
Install the Triad+ Engineering Loop OpenCode adapter without overwriting any
|
|
11
|
+
existing OpenCode agent, command, or Triad skill. --project installs into
|
|
12
|
+
<control-repository-path>/.opencode. --global installs into
|
|
13
|
+
$HOME/.config/opencode.
|
|
14
|
+
EOF
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if [[ $# -eq 2 && "$1" == "--project" ]]; then
|
|
18
|
+
target_root="$2/.opencode"
|
|
19
|
+
project_root="$2"
|
|
20
|
+
project_install=true
|
|
21
|
+
elif [[ $# -eq 1 && "$1" == "--global" ]]; then
|
|
22
|
+
target_root="$HOME/.config/opencode"
|
|
23
|
+
project_root=""
|
|
24
|
+
project_install=false
|
|
25
|
+
else
|
|
26
|
+
usage >&2
|
|
27
|
+
exit 2
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
adapter_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
31
|
+
repository_root="$(cd -- "$adapter_root/../.." && pwd)"
|
|
32
|
+
|
|
33
|
+
agent_names=(triad-orchestrator triad-developer triad-evaluator triad-reviewer)
|
|
34
|
+
skill_names=(triad-loop-bootstrap triad-loop-orchestrator triad-loop-developer triad-loop-evaluator triad-loop-reviewer)
|
|
35
|
+
command_name="triad"
|
|
36
|
+
collisions=()
|
|
37
|
+
|
|
38
|
+
for agent_name in "${agent_names[@]}"; do
|
|
39
|
+
[[ -e "$target_root/agents/$agent_name.md" ]] && collisions+=("agents/$agent_name.md")
|
|
40
|
+
done
|
|
41
|
+
for skill_name in "${skill_names[@]}"; do
|
|
42
|
+
[[ -e "$target_root/skills/$skill_name" ]] && collisions+=("skills/$skill_name")
|
|
43
|
+
done
|
|
44
|
+
[[ -e "$target_root/commands/$command_name.md" ]] && collisions+=("commands/$command_name.md")
|
|
45
|
+
if [[ "$project_install" == true && -e "$project_root/.triad-runtime" ]]; then
|
|
46
|
+
collisions+=(".triad-runtime")
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if [[ ${#collisions[@]} -gt 0 ]]; then
|
|
50
|
+
printf 'Installation aborted; existing paths would be overwritten:\n' >&2
|
|
51
|
+
printf ' %s\n' "${collisions[@]}" >&2
|
|
52
|
+
printf 'Remove or rename those paths deliberately, then run the installer again.\n' >&2
|
|
53
|
+
exit 1
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
mkdir -p "$target_root/agents" "$target_root/commands" "$target_root/skills"
|
|
57
|
+
|
|
58
|
+
for agent_name in "${agent_names[@]}"; do
|
|
59
|
+
cp "$adapter_root/.opencode/agents/$agent_name.md" "$target_root/agents/$agent_name.md"
|
|
60
|
+
done
|
|
61
|
+
cp "$adapter_root/.opencode/commands/$command_name.md" "$target_root/commands/$command_name.md"
|
|
62
|
+
for skill_name in "${skill_names[@]}"; do
|
|
63
|
+
cp -R "$repository_root/skills/$skill_name" "$target_root/skills/$skill_name"
|
|
64
|
+
done
|
|
65
|
+
if [[ "$project_install" == true ]]; then
|
|
66
|
+
cp -R "$repository_root/runtime" "$project_root/.triad-runtime"
|
|
67
|
+
cp -R "$repository_root/schemas" "$project_root/.triad-runtime/schemas"
|
|
68
|
+
cp "$adapter_root/runtime.json" "$project_root/.triad-runtime/adapter.json"
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
printf 'Triad+ Engineering Loop installed in %s\n' "$target_root"
|
|
72
|
+
if [[ "$project_install" == true ]]; then
|
|
73
|
+
printf 'Control-plane runtime installed in %s/.triad-runtime\n' "$project_root"
|
|
74
|
+
fi
|
|
75
|
+
printf 'Start OpenCode in the target project and use /triad followed by a PRD source or project request.\n'
|