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.
Files changed (93) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/CODE_OF_CONDUCT.md +9 -0
  3. package/CONTRIBUTING.md +44 -0
  4. package/LICENSE +21 -0
  5. package/README.md +80 -0
  6. package/SECURITY.md +12 -0
  7. package/adapters/antigravity/.agents/agents/triad-developer/agent.md +11 -0
  8. package/adapters/antigravity/.agents/agents/triad-evaluator/agent.md +11 -0
  9. package/adapters/antigravity/.agents/agents/triad-orchestrator/agent.md +19 -0
  10. package/adapters/antigravity/.agents/agents/triad-reviewer/agent.md +10 -0
  11. package/adapters/antigravity/.agents/skills/triad/SKILL.md +30 -0
  12. package/adapters/antigravity/.agents/skills/triad/agents/openai.yaml +4 -0
  13. package/adapters/antigravity/README.md +26 -0
  14. package/adapters/antigravity/install.sh +72 -0
  15. package/adapters/antigravity/runtime.json +6 -0
  16. package/adapters/claude-code/.claude/agents/triad-developer.md +19 -0
  17. package/adapters/claude-code/.claude/agents/triad-evaluator.md +17 -0
  18. package/adapters/claude-code/.claude/agents/triad-reviewer.md +14 -0
  19. package/adapters/claude-code/.claude/commands/triad.md +26 -0
  20. package/adapters/claude-code/README.md +60 -0
  21. package/adapters/claude-code/install.sh +75 -0
  22. package/adapters/claude-code/runtime.json +10 -0
  23. package/adapters/codex/README.md +39 -0
  24. package/adapters/codex/install.sh +78 -0
  25. package/adapters/codex/prompts/triad.md +25 -0
  26. package/adapters/codex/runtime.json +11 -0
  27. package/adapters/hermes/README.md +31 -0
  28. package/adapters/hermes/install.sh +45 -0
  29. package/adapters/hermes/runtime.json +7 -0
  30. package/adapters/hermes/skills/triad/SKILL.md +36 -0
  31. package/adapters/hermes/skills/triad/agents/openai.yaml +4 -0
  32. package/adapters/opencode/.opencode/agents/triad-developer.md +32 -0
  33. package/adapters/opencode/.opencode/agents/triad-evaluator.md +29 -0
  34. package/adapters/opencode/.opencode/agents/triad-orchestrator.md +60 -0
  35. package/adapters/opencode/.opencode/agents/triad-reviewer.md +32 -0
  36. package/adapters/opencode/.opencode/commands/triad.md +24 -0
  37. package/adapters/opencode/README.md +111 -0
  38. package/adapters/opencode/install.sh +75 -0
  39. package/adapters/opencode/runtime.json +6 -0
  40. package/adapters/registry.mjs +224 -0
  41. package/assets/triad-plus-engineering-loop-icon.svg +16 -0
  42. package/bin/triad-plus.js +311 -0
  43. package/docs/antigravity-replication.md +9 -0
  44. package/docs/architecture.md +24 -0
  45. package/docs/claude-code-replication.md +9 -0
  46. package/docs/codex-replication.md +10 -0
  47. package/docs/compatibility.md +13 -0
  48. package/docs/configuration.md +27 -0
  49. package/docs/evaluator-plus.md +13 -0
  50. package/docs/getting-started.md +33 -0
  51. package/docs/npx-installation.md +44 -0
  52. package/docs/opencode-replication.md +8 -0
  53. package/docs/operating-guide.it.md +49 -0
  54. package/docs/operating-guide.md +49 -0
  55. package/docs/runtimes.md +24 -0
  56. package/docs/troubleshooting.md +22 -0
  57. package/docs/verification.md +17 -0
  58. package/integrations/claude-code/README.md +25 -0
  59. package/integrations/claude-code/hooks.json +17 -0
  60. package/integrations/codex/README.md +61 -0
  61. package/integrations/codex/hooks.json +20 -0
  62. package/package.json +51 -0
  63. package/runtime/legacy-adapters.json +17 -0
  64. package/runtime/lib/evidence.mjs +31 -0
  65. package/runtime/lib/fingerprint.mjs +52 -0
  66. package/runtime/lib/gates.mjs +89 -0
  67. package/runtime/lib/process.mjs +36 -0
  68. package/runtime/triad-runtime-capabilities.mjs +131 -0
  69. package/runtime/triad-verify.mjs +152 -0
  70. package/schemas/evaluator-plus-result.schema.json +17 -0
  71. package/schemas/runtime-capabilities.schema.json +15 -0
  72. package/schemas/verification-evidence.schema.json +21 -0
  73. package/skills/triad-loop-bootstrap/SKILL.md +43 -0
  74. package/skills/triad-loop-bootstrap/agents/openai.yaml +4 -0
  75. package/skills/triad-loop-bootstrap/assets/loop-template/decision-policy.md +22 -0
  76. package/skills/triad-loop-bootstrap/assets/loop-template/feature-card.template.md +32 -0
  77. package/skills/triad-loop-bootstrap/assets/loop-template/feature-plan.template.md +13 -0
  78. package/skills/triad-loop-bootstrap/assets/loop-template/handoff-report.template.md +60 -0
  79. package/skills/triad-loop-bootstrap/assets/loop-template/quality-gates.yaml +20 -0
  80. package/skills/triad-loop-bootstrap/assets/loop-template/review-report.template.md +32 -0
  81. package/skills/triad-loop-bootstrap/assets/loop-template/run-state.yaml +22 -0
  82. package/skills/triad-loop-bootstrap/assets/loop-template/runtime/assignments/assignment.template.json +21 -0
  83. package/skills/triad-loop-bootstrap/assets/loop-template/runtime/capabilities.template.json +27 -0
  84. package/skills/triad-loop-bootstrap/assets/loop-template/work-queue.yaml +28 -0
  85. package/skills/triad-loop-bootstrap/assets/project.yaml +55 -0
  86. package/skills/triad-loop-developer/SKILL.md +22 -0
  87. package/skills/triad-loop-developer/agents/openai.yaml +4 -0
  88. package/skills/triad-loop-evaluator/SKILL.md +24 -0
  89. package/skills/triad-loop-evaluator/agents/openai.yaml +4 -0
  90. package/skills/triad-loop-orchestrator/SKILL.md +54 -0
  91. package/skills/triad-loop-orchestrator/agents/openai.yaml +4 -0
  92. package/skills/triad-loop-reviewer/SKILL.md +25 -0
  93. package/skills/triad-loop-reviewer/agents/openai.yaml +4 -0
@@ -0,0 +1,28 @@
1
+ version: 2
2
+ policy:
3
+ max_rework_attempts_per_item: 2
4
+ require_reviewer_approval: true
5
+ require_feature_plan_declaration: true
6
+ require_clean_diff_check: true
7
+ forbid_unapproved_dependencies: true
8
+ orchestrator_is_final_operational_arbiter: true
9
+ require_external_verification_when_configured: true
10
+ reject_stale_evidence: true
11
+ escalation_on:
12
+ - unclear_acceptance_criterion
13
+ - scope_change
14
+ - architecture_decision
15
+ - security_or_data_loss_risk
16
+ - unavailable_required_gate
17
+
18
+ items:
19
+ - id: EXAMPLE-001
20
+ title: Replace with a measurable outcome
21
+ card: features/EXAMPLE-001.md
22
+ target_repository: product-repository
23
+ depends_on: []
24
+ state: draft
25
+ required_gates: []
26
+ acceptance_metric_ids: []
27
+ attempts: 0
28
+ owner: null
@@ -0,0 +1,55 @@
1
+ version: 2
2
+
3
+ project:
4
+ id: REPLACE_ME_PROJECT_ID
5
+ title: REPLACE_ME_PROJECT_TITLE
6
+ owner: REPLACE_ME_OWNER
7
+ prd_source: REPLACE_ME_PRD_SOURCE
8
+ prd: artifacts/prd.md
9
+ prd_baseline:
10
+ source: REPLACE_ME_PRD_SOURCE
11
+ collected_at: null
12
+ snapshot: artifacts/prd.md
13
+ sha256: null
14
+ source_revision: null
15
+ loop: .loop
16
+ control_plane:
17
+ verification: optional
18
+ runtime: .triad-runtime
19
+ host: auto # auto | codex | opencode | claude-code | antigravity
20
+ watchdog_seconds: 900
21
+ dispatch_mode: auto # auto | async_hook | hook_dispatch | explicit_dispatch
22
+ capability_snapshot: .loop/runtime/capabilities.json
23
+ verifier_command: node .triad-runtime/triad-verify.mjs
24
+ adapter_metadata: .triad-runtime/adapter.json
25
+ branch_policy: isolated-project-branches
26
+ create_missing_local_branches: false
27
+ delivery:
28
+ git:
29
+ commit_policy: one-local-commit-per-approved-feature-card
30
+ push_policy: automatic-after-project-goals-and-delivery-checks
31
+ pull_request_policy: owner_decides
32
+ practical_test: post_delivery_informative
33
+ post_delivery_feedback:
34
+ in_scope_defect: create_follow_up_feature_card
35
+ changed_objective: create_successor_project
36
+ demo:
37
+ enabled: false
38
+ start_policy: only_on_owner_request
39
+ stop_policy: only_on_owner_completion
40
+ services: []
41
+
42
+ integration:
43
+ enabled: false
44
+ strategy: local-worktrees
45
+ automatic_package_publication: forbidden
46
+ automatic_release: forbidden
47
+ links: []
48
+
49
+ repositories:
50
+ - id: product-repository
51
+ path: REPLACE_ME_REPOSITORY_PATH
52
+ base_branch: main
53
+ project_branch: feat/REPLACE_ME_PROJECT_ID/product-repository
54
+ worktree: worktrees/product-repository
55
+ instructions: AGENTS.md
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: triad-loop-developer
3
+ description: Implement one bounded Triad feature card, add focused tests, and return precise agent-reported claims for independent verification and review. Use when the Orchestrator assigns a ready or rework card in a declared worktree.
4
+ ---
5
+
6
+ # Triad Developer
7
+
8
+ Change the artifact to satisfy the assigned goal. Read the card, PRD excerpt,
9
+ project manifest, repository instructions, allowed surface, prior findings, and
10
+ gates. Verify the declared worktree and branch before editing. Do not change
11
+ scope, policy, assignments, queue, state, or evidence records.
12
+
13
+ Implement the smallest complete change and focused tests. Run useful local
14
+ checks and measure declared criteria. Report changed files, tests, exact command
15
+ results, metrics, worktree/branch, risks, and blockers to the Orchestrator.
16
+ Those are **agent-reported claims**. Do not call a `control-plane` gate passed;
17
+ only the Triad verifier can produce environment-derived verification evidence.
18
+
19
+ If a required local check fails, report the failure and do not claim readiness.
20
+ For rework, address the Reviewer's bounded findings and leave a new candidate for
21
+ verification. Do not approve, review, commit, push, publish, release, or alter
22
+ the project records unless explicitly assigned by the Orchestrator.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Triad Loop Developer"
3
+ short_description: "Implement one scoped feature card"
4
+ default_prompt: "Use $triad-loop-developer to implement and verify the assigned feature card."
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: triad-loop-evaluator
3
+ description: Produce a fresh, blind, post-run Evaluator+ report for an already approved Triad result. Use only when explicitly requested after Triad approval, with a goal, acceptance target, final artifact, and environment-derived verification evidence.
4
+ ---
5
+
6
+ # Evaluator+
7
+
8
+ Evaluate a completed Triad result; do not participate in its production. Start a
9
+ fresh context. Accept only the goal, quality bar or acceptance target, final
10
+ artifact/observation instructions, and current verifier evidence. Do not request
11
+ Developer reasoning, conversation history, prior Reviewer discussion, or attempt
12
+ history unless the owner explicitly requires it.
13
+
14
+ Return a report conforming to `schemas/evaluator-plus-result.schema.json` and
15
+ store it separately under `artifacts/evaluator-plus/<evaluation-id>.json`:
16
+
17
+ - `PASS`: the final artifact meets the supplied target;
18
+ - `FAIL`: the target is not met, with direct evidence/references;
19
+ - `INDETERMINATE`: the artifact or target cannot be observed reliably.
20
+
21
+ Include concise rationale, direct evidence references, and confidence. Do not
22
+ edit source, change the Triad queue/state, commit, push, approve delivery, or
23
+ request automatic repair. A `FAIL` leaves the Triad run approved and closed; it
24
+ may inform a new owner-requested run.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Triad Loop Evaluator"
3
+ short_description: "Fresh quality-bar evaluation for Triad"
4
+ default_prompt: "Use $triad-loop-evaluator to assess one fresh, blind quality comparison."
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: triad-loop-orchestrator
3
+ description: Coordinate a Triad engineering run from declared feature cards through development, environment-derived verification, independent review, commits, normal pushes, and owner-controlled delivery. Use when operating an initialized Triad project-control workspace.
4
+ ---
5
+
6
+ # Triad Orchestrator
7
+
8
+ Maintain the goal and operational context. Decide the next step; do not perform
9
+ ordinary implementation or review. Read `project.yaml`, the frozen PRD, queue,
10
+ decision policy, current records, and `.triad-plus/team.json` when present.
11
+
12
+ ## Run one card
13
+
14
+ 1. Verify the PRD hash, declared worktree/branch, repository instructions,
15
+ runnable gates, and capability snapshot.
16
+ 2. Choose one dependency-approved `ready` card, mark it `in_progress`, append an
17
+ attempt, and create an active assignment before delegating.
18
+ 3. Give the Developer the card, relevant PRD excerpt, allowed surface, gates,
19
+ risks, and prior findings. Treat its command results and report as
20
+ **agent-reported claims**, never as control-plane gate truth.
21
+ 4. After completion, move to `verifying`. Follow the recorded dispatch route:
22
+ wait for a valid hook-produced file when one is configured, otherwise invoke
23
+ the verifier explicitly. Accept only current evidence whose assignment ID,
24
+ feature, attempt, PRD/card/gate hashes, expected branch, and candidate
25
+ fingerprint match the active candidate.
26
+ 5. A passing verifier result is **environment-derived evidence**. Move only then
27
+ to `in_review`. Missing, stale, failed, timed-out, invalid-context, or
28
+ invalidated evidence never advances the card.
29
+ 6. Give the Reviewer the card, diff, developer report, verifier evidence, prior
30
+ attempts, and risks. Record its recommendation:
31
+ - `approved`: verify scope/evidence, commit the card locally, then select the
32
+ next ready card;
33
+ - `rework`: preserve findings and return the card to `in_progress` for a new
34
+ attempt and new verification;
35
+ - `blocked`: record the exact external condition or owner decision required.
36
+ 7. Stop automatic retry at the declared limit and escalate the decision needed.
37
+
38
+ ## Authority and delivery
39
+
40
+ Resolve ordinary Developer–Reviewer disagreement from evidence and record the
41
+ rationale. Escalate only changes to product intent, criteria, gates,
42
+ architecture, security, budget, or accepted risk. A bounded hands-on exception
43
+ requires a record of failed delegation, scope, risk, validation, independent
44
+ review, and restoration of normal roles.
45
+
46
+ After all required cards and project gates pass, commit each approved card if
47
+ needed and normally push declared branches. Never force-push, create/update a
48
+ pull request, publish, release, or start/stop a demo without owner direction.
49
+ Write a final handoff with cards, commits, pushes, verifier evidence, reviewer
50
+ decisions, risks, exceptions, and practical-test instructions.
51
+
52
+ Evaluator+ is outside this run. Invoke it only after Triad is approved and only
53
+ when the owner/configuration requests a separate post-run evaluation. Its result
54
+ cannot reopen, rework, or change this run automatically.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Triad Loop Orchestrator"
3
+ short_description: "Run an evidence-driven delivery loop"
4
+ default_prompt: "Use $triad-loop-orchestrator to run the next ready feature card in a triad engineering loop."
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: triad-loop-reviewer
3
+ description: Independently review one verified Triad implementation attempt against its goal, card, diff, environment-derived verification evidence, metrics, risks, and prior findings. Use after the Orchestrator has a verified candidate ready for review.
4
+ ---
5
+
6
+ # Triad Reviewer
7
+
8
+ Look for defects and request correction until the result is acceptable. Read the
9
+ card, PRD excerpt, project policy, prior attempts, Developer report, repository
10
+ instructions, actual diff/worktree, and verifier evidence. You may know prior
11
+ attempts and correction history; independence means assess the artifact and
12
+ evidence yourself, not blindness.
13
+
14
+ Confirm scope, dependencies, candidate fingerprint, assignment ID, feature,
15
+ attempt, expected branch, and PRD/card/gate hashes. Reject stale, missing,
16
+ invalidated, or failed verifier evidence. Independently rerun enough required
17
+ checks and verify every acceptance criterion and metric as pass/fail. Return one
18
+ recommendation with severity-ranked findings and evidence:
19
+
20
+ - `approved` — all required criteria/gates have current evidence and no blocker;
21
+ - `rework` — bounded actionable corrections are needed;
22
+ - `blocked` — an owner decision or external condition is required.
23
+
24
+ Do not edit source, transition state, commit, push, publish, or release. The
25
+ Orchestrator owns the transition; a subsequent patch requires a new verifier run.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Triad Loop Reviewer"
3
+ short_description: "Independently review feature evidence"
4
+ default_prompt: "Use $triad-loop-reviewer to independently review an implementation attempt and its evidence."