@webpresso/opencode-plugin 3.1.11 → 3.1.13

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 CHANGED
@@ -3,9 +3,12 @@
3
3
  `@webpresso/opencode-plugin` is the OpenCode host adapter package for Agent
4
4
  Kit. It provides the native OpenCode npm plugin surface, registered through
5
5
  `opencode.json`, with the package module exports and metadata OpenCode expects.
6
+ It also ships the same catalog-owned default `skills/` payload as the Claude
7
+ and Codex adapter packages for host/package parity.
6
8
 
7
9
  The root `@webpresso/agent-kit` package is CLI/core only: it ships `wp`, MCP
8
10
  tools, audits, blueprints, session memory, docs, and catalog sources, but it
9
11
  does not ship this OpenCode payload from the root package. OpenCode delivery is
10
12
  native npm plugin registration only; there is no generated bridge, MCP bridge,
11
- or MCP injection payload in this package.
13
+ or MCP injection payload in this package, and no `.opencode/skills` fallback is
14
+ projected.
package/index.js CHANGED
@@ -18,7 +18,13 @@ function extractDenyReason(envelope) {
18
18
  return null;
19
19
  }
20
20
 
21
+ function extractUpdatedInput(envelope) {
22
+ const output = envelope?.hookSpecificOutput;
23
+ return output?.permissionDecision === "allow" ? (output.updatedInput ?? null) : null;
24
+ }
25
+
21
26
  function hookInputForTool(tool, args, directory) {
27
+ const toolArgs = args && typeof args === "object" && !Array.isArray(args) ? args : {};
22
28
  const base = {
23
29
  cwd: directory,
24
30
  hook_event_name: "PreToolUse",
@@ -30,7 +36,8 @@ function hookInputForTool(tool, args, directory) {
30
36
  ...base,
31
37
  tool_name: "Bash",
32
38
  tool_input: {
33
- command: args?.command ?? "",
39
+ ...toolArgs,
40
+ command: toolArgs.command ?? "",
34
41
  },
35
42
  };
36
43
  case "write":
@@ -181,6 +188,11 @@ export const WebpressoHooksPlugin = async ({ $, directory }) => {
181
188
  if (denyReason !== null) {
182
189
  throw new Error(denyReason);
183
190
  }
191
+ const updatedInput = extractUpdatedInput(envelope);
192
+ const nextCommand = updatedInput?.command;
193
+ if (input?.tool === "bash" && typeof nextCommand === "string") {
194
+ output.args.command = nextCommand;
195
+ }
184
196
  }
185
197
  },
186
198
  "tool.execute.after": async (input, output) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpresso/opencode-plugin",
3
- "version": "3.1.11",
3
+ "version": "3.1.13",
4
4
  "private": false,
5
5
  "description": "OpenCode plugin adapter package for Webpresso agent-kit.",
6
6
  "homepage": "https://github.com/webpresso/agent-kit#readme",
@@ -15,6 +15,8 @@
15
15
  },
16
16
  "files": [
17
17
  "index.js",
18
+ "plugin-skill-ownership.json",
19
+ "skills",
18
20
  "LICENSE",
19
21
  "README.md"
20
22
  ],
@@ -0,0 +1,84 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "host": "opencode",
4
+ "packageName": "@webpresso/opencode-plugin",
5
+ "packageVersion": "3.1.13",
6
+ "runtimeDirs": [],
7
+ "skills": {
8
+ "autopilot": {
9
+ "digest": "sha256:7fc1fe9f5fb5b8a3e755f8e3ac4b807e4f140288544ffcf39e4cbfdea984014d"
10
+ },
11
+ "autoresearch": {
12
+ "digest": "sha256:b4d51cd53beb4a3271827172dfbd0b1d27bd58761ca07a35d49a5d6324b87fdf"
13
+ },
14
+ "best-practice-research": {
15
+ "digest": "sha256:b0d355c7f4afe9c38be83e293788bf582bea068c1db2fa5c45400441e315735d"
16
+ },
17
+ "browse": {
18
+ "digest": "sha256:21fd24862e7f7c8a1feadea6bc376492b136b99fc381cf1b8927c9db80615431"
19
+ },
20
+ "claude": {
21
+ "digest": "sha256:b75a472594d78bd9452c07fd791a426864848a2c9c726454dc72daf3813ae22b"
22
+ },
23
+ "codex": {
24
+ "digest": "sha256:803cea9c1b37406d7bdc8e44e9d5e9f3988218277500d8d6cb0d955c933c3302"
25
+ },
26
+ "deep-research": {
27
+ "digest": "sha256:01dafd194066a2936db0b437fd5c3beef6d7ff82478d0d995393093d89496f18"
28
+ },
29
+ "design-review": {
30
+ "digest": "sha256:5b213735e2842568774572f36b198bccf03c03a54b2732484aadd023f04acb23"
31
+ },
32
+ "devex-review": {
33
+ "digest": "sha256:306355888da0827e3523022077f731845726bbaaf595ca12515cc91d8605b5e6"
34
+ },
35
+ "fix": {
36
+ "digest": "sha256:e43dfad198f7279ebc2dca9e62f43fd960c783ca0ab25f133668fca13aed96b2"
37
+ },
38
+ "goal": {
39
+ "digest": "sha256:85380b633cfaaff8ec1639dd3a88412a41920aae3e8531de95e2b79411926a18"
40
+ },
41
+ "hooks-doctor": {
42
+ "digest": "sha256:3bfb0af64ff6796c56d51e4cd2bede7fb24c869f89b292546ea13ad2f5d3bb73"
43
+ },
44
+ "lore-protocol": {
45
+ "digest": "sha256:a80fbacc765e8b886437b9fdf7dd71e1ceb1b98b939078ec90fc88d06a8b4c69"
46
+ },
47
+ "opencode-go": {
48
+ "digest": "sha256:ccb2bcf09cc1c5c0d54027b84f580e688f5f5cf624e6cdc19870bd3ce99940fc"
49
+ },
50
+ "plan-ceo-review": {
51
+ "digest": "sha256:4d426158518dd71f8998770e8d4037bcbfa3c65d7265a93a4a78a9b015ba881e"
52
+ },
53
+ "plan-design-review": {
54
+ "digest": "sha256:a8a33efe67844d0602ff595c0b7e8f5529e52f51a781112952636c91963ce19e"
55
+ },
56
+ "plan-devex-review": {
57
+ "digest": "sha256:a49b4f61f1c54a7d89111c270616684dcbf2a7236bc817fafb5919366a7cda31"
58
+ },
59
+ "plan-eng-review": {
60
+ "digest": "sha256:b728dad90254d4c9f81b3818321d34ab53519b79ce20ff3bfe08bfacb2aa3e86"
61
+ },
62
+ "plan-refine": {
63
+ "digest": "sha256:891e84ff8592b8489b59e8642f6a602c9558fd57edd171af98499c94e2f62f13"
64
+ },
65
+ "ralplan": {
66
+ "digest": "sha256:db285d477f43ed23df990d4c03750d9916cdc7809356c1bf025efdf6a9add9ed"
67
+ },
68
+ "team": {
69
+ "digest": "sha256:151ef81df917435073a2d7b41173d33c45cb8aa1e5fdf34a70043bb3a2e746ff"
70
+ },
71
+ "tech-debt": {
72
+ "digest": "sha256:8b1f30e55ec6e5ab185ff19ecf15384438dbd619f675c2c65f2e53cedecbae5c"
73
+ },
74
+ "testing-philosophy": {
75
+ "digest": "sha256:43fa05bcb7eaf8efd4a8dcc0f9fb9c30ae9f80079d9b3dbfdc926734a64a2973"
76
+ },
77
+ "tph": {
78
+ "digest": "sha256:bed3684a850651534f315d355cdeae50d951c429817df0f105cccdb7f4e1561b"
79
+ },
80
+ "verify": {
81
+ "digest": "sha256:ce0dd3a77508d1bf11c805dec2de04e75b689201d376b2ff0fa957604d584500"
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,39 @@
1
+ ---
2
+ type: skill
3
+ slug: autopilot
4
+ title: Autopilot
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [goal, plan-refine, verify, testing-philosophy]
9
+ created: "2026-07-10"
10
+ last_reviewed: "2026-07-10"
11
+ name: autopilot
12
+ description: "Drive a brief through the bounded native goal pipeline."
13
+ argument-hint: "<brief|force: brief>"
14
+ ---
15
+
16
+ # Autopilot
17
+
18
+ Drive an approved brief through `plan -> execute -> qa -> validate -> land -> complete` using `wp goal run` and the current handoff.
19
+
20
+ ## Vague gate
21
+
22
+ A brief is anchored when it includes a file path, symbol, issue number, test name, or numbered steps. Route any unanchored brief through `plan-refine` before execution. A leading `force:` is the only explicit bypass; strip it before creating the goal and record the bypass in the blueprint.
23
+
24
+ ## Pipeline
25
+
26
+ 1. Plan: refine blueprints and satisfy provenance-backed promotion approvals.
27
+ 2. Execute: implement current ready tasks; use only `wp_blueprint_task_verify` to mark them done.
28
+ 3. QA: run affected checks and `wp qa`; preserve normalized failure evidence.
29
+ 4. Validate: obtain distinct verification and code-review evidence and resolve findings. Each lane appends a tracked `reviews.md` record in one of these exact forms:
30
+
31
+ ```text
32
+ <!-- wp:goal-validation {"kind":"verify","reviewer":"<identity>","artifact":"<tracked-path>"} -->
33
+ <!-- wp:goal-validation {"kind":"code-review","reviewer":"<different-identity>","artifact":"<tracked-path>"} -->
34
+ ```
35
+
36
+ 5. Land: require green PR checks, complete the blueprint in the same PR, merge, and run owner cleanup.
37
+ 6. Complete: stop only when `wp goal run` records terminal evidence.
38
+
39
+ Resume from durable state after interruption. Obey `WP_GOAL_DISABLE=1`, iteration/error/validation caps, and repository ownership. The pipeline must never self-approve, directly mark tasks done, bypass evidence, or push to main. Keep every loop bounded and never increase timeouts.
@@ -0,0 +1,49 @@
1
+ ---
2
+ type: skill
3
+ slug: autoresearch
4
+ title: Autoresearch
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [deep-research, best-practice-research, plan-refine, verify]
9
+ created: "2026-07-13"
10
+ last_reviewed: "2026-07-13"
11
+ name: autoresearch
12
+ description: "Artifact-gated research loop with explicit validation."
13
+ argument-hint: "<research mission and validator>"
14
+ ---
15
+
16
+ # Autoresearch
17
+
18
+ Use when the user wants research to continue until a concrete validator accepts the result. This is for bounded research deliverables, not quick factual lookup or ordinary planning context.
19
+
20
+ ## Boundary
21
+
22
+ - Use `deep-research` for one-pass citation-backed reports.
23
+ - Use `best-practice-research` for focused upstream guidance.
24
+ - Use `autoresearch` when completion depends on an explicit evaluator, benchmark, review rubric, or acceptance artifact.
25
+
26
+ ## Workflow
27
+
28
+ 1. Define the research mission, output artifact path, validator, and stop condition.
29
+ 2. Choose one validation mode:
30
+ - command validator: a repo command or script must pass and write the result.
31
+ - review validator: an independent review must approve the produced artifact against the mission.
32
+ 3. Create or update the durable research artifact before iterating.
33
+ 4. Gather sources and repo context until the artifact addresses the mission and cites material claims.
34
+ 5. Run the validator. If it fails, preserve the failure evidence, revise the artifact, and repeat.
35
+ 6. Stop only when the validator passes or a blocker prevents more evidence-gathering.
36
+
37
+ ## Output
38
+
39
+ Return:
40
+
41
+ - mission
42
+ - artifact path
43
+ - validation mode
44
+ - validator command or review rubric
45
+ - evidence gathered
46
+ - pass/fail result
47
+ - remaining gaps or blocker
48
+
49
+ Do not treat elapsed turns, model confidence, or a draft report as completion evidence. Completion requires the declared validator to pass.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: best-practice-research
3
+ description: "Official/upstream best-practice research wrapper with bounded evidence and dated citations."
4
+ argument-hint: "<technology|decision|practice question>"
5
+ ---
6
+
7
+ # Best-Practice Research
8
+
9
+ Use this skill when a task depends on current external best practices, version-aware guidance, standards, official recommendations, or upstream behavior. This is a workflow wrapper: it routes evidence gathering and synthesis; it is not a new research authority and it does not replace `researcher`.
10
+
11
+ ## Purpose
12
+
13
+ Produce a cited, reusable best-practice answer or handoff that separates current external evidence from repo-local facts and dependency-selection decisions.
14
+
15
+ ## Activate When
16
+
17
+ - The user asks for best practices, recommended approach, current guidance, official recommendations, standards, or version-aware external behavior.
18
+ - `$ralplan`, `$deep-interview`, `$team`, or another workflow needs current external evidence before planning or execution can be correct.
19
+ - The task involves an already chosen technology and needs authoritative usage guidance, migration notes, API behavior, lifecycle rules, or current safety guidance.
20
+
21
+ ## Do Not Activate When
22
+
23
+ - The answer is fully repo-local; use `explore` for codebase facts.
24
+ - The main question is whether to adopt, replace, upgrade, or compare dependencies; use `dependency-expert`.
25
+ - The user only needs implementation against already-grounded requirements; use `executor`, `$ralph`, or `$team` as appropriate.
26
+ - The task can be answered from stable local project conventions without current external lookup.
27
+
28
+ ## Specialist Routing
29
+
30
+ 1. Use `explore` first for brownfield facts: current code usage, local constraints, versions, config, and integration points.
31
+ 2. Use `researcher` for official/upstream docs, release notes, standards, migration guides, source-backed examples, and current best-practice evidence for an already chosen technology.
32
+ 3. Use `dependency-expert` only for adoption/upgrade/replacement/comparison decisions.
33
+ 4. Return to the caller with explicit evidence, uncertainty, and any implementation handoff constraints.
34
+
35
+ ## Source-Quality Rules
36
+
37
+ - Prefer official documentation, upstream source, release notes, changelogs, standards, and maintainer guidance.
38
+ - Include source URLs for material claims.
39
+ - State date/version context for current best-practice claims.
40
+ - Label third-party summaries as supplemental; do not use them before official/upstream sources.
41
+ - Flag stale, conflicting, undocumented, or version-mismatched evidence.
42
+ - Do not over-fetch: gather the smallest evidence set that can support the decision.
43
+
44
+ ## Workflow
45
+
46
+ 1. Classify the question: conceptual best practice, implementation guidance, migration/version guidance, standards/compliance guidance, or mixed local + external guidance.
47
+ 2. Gather repo-local facts with `explore` when local usage or constraints affect the answer.
48
+ 3. Gather external evidence with `researcher` when current or version-aware practice affects correctness.
49
+ 4. Synthesize a concise answer with source quality, version/date context, caveats, and an implementation or planning handoff.
50
+ 5. Stop when the answer is grounded enough for the caller; otherwise report the exact blocker or specialist handoff needed.
51
+
52
+ ## Output Contract
53
+
54
+ ```md
55
+ ## Best-Practice Research: <question>
56
+
57
+ ### Direct Recommendation
58
+
59
+ <actionable guidance or decision support>
60
+
61
+ ### Evidence Used
62
+
63
+ - Official/upstream: <source URL> — <what it establishes>
64
+ - Supplemental, if any: <source URL> — <why it is secondary>
65
+
66
+ ### Version / Date Context
67
+
68
+ <versions, dates, release channels, or unknowns>
69
+
70
+ ### Repo-Local Context
71
+
72
+ <facts from explore, or "not needed">
73
+
74
+ ### Boundaries / Non-goals
75
+
76
+ <what this research does not decide>
77
+
78
+ ### Handoff
79
+
80
+ <planning/execution/test implications>
81
+ ```
82
+
83
+ ## Stop Rules
84
+
85
+ - Stop after a source-backed recommendation is reusable by the caller.
86
+ - Stop and route upward if the task becomes dependency comparison, broad architecture, or implementation.
87
+ - Do not continue researching when remaining work would only polish wording rather than change the recommendation.
88
+
89
+ Task: {{ARGUMENTS}}
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: browse
3
+ description: "Browser/page inspection via Webpresso Playwright: inspect DOM, console, network basics, screenshots, and findings."
4
+ license: MIT
5
+ allowed-tools:
6
+ - Read
7
+ - Glob
8
+ - Grep
9
+ - Bash
10
+ ---
11
+
12
+ # Browse
13
+
14
+ Use `wp browser doctor` first if browser availability is unknown; if it reports a missing browser, run `wp browser ensure chromium`. Prefer repo-local preview or dev-server URLs; if none are discoverable, ask for a URL.
15
+
16
+ ## Read-only inspection
17
+
18
+ The `allowed-tools` frontmatter is an audited disclosure for supported hosts;
19
+ pretool-guard remains the enforced mutation backstop when a host does not prove
20
+ skill-frontmatter enforcement.
21
+
22
+ 1. Identify the URL and whether headed or headless mode is needed.
23
+ 2. Use `wp browser open <url> --json` for a lightweight smoke snapshot, or a project Playwright test for deeper flows.
24
+ 3. Report URL, title, status evidence, console/page errors when available, and any screenshots/artifacts.
25
+ 4. Do not mutate app data unless the user explicitly asks for a mutating browser flow.
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: claude
3
+ description: "Claude CLI outside-voice wrapper for review, adversarial challenge, or consultation from non-Claude hosts."
4
+ license: MIT
5
+ ---
6
+
7
+ # Claude outside voice
8
+
9
+ Use when a non-Claude host needs Claude to review a diff, challenge a plan, or answer a focused repo question. Keep it bounded/read-only unless asked otherwise, and report Claude output as advice, not verified fact.
10
+
11
+ ## Auth check
12
+
13
+ Use local Claude CLI login directly; do not route through Anthropic API-key env vars.
14
+
15
+ ```bash
16
+ AUTH_STATUS_FILE=$(mktemp -t wp-claude-auth.XXXXXX)
17
+ trap 'rm -f "$AUTH_STATUS_FILE"' EXIT
18
+ if ! claude auth status --json >"$AUTH_STATUS_FILE" 2>/dev/null; then
19
+ if ! claude auth status >"$AUTH_STATUS_FILE" 2>/dev/null; then
20
+ echo "CLAUDE_AUTH=missing: run claude auth login with the intended Claude Max account"
21
+ exit 1
22
+ fi
23
+ fi
24
+ if grep -E '"(authenticated|loggedIn|success)"[[:space:]]*:[[:space:]]*true' "$AUTH_STATUS_FILE" >/dev/null; then
25
+ echo "CLAUDE_AUTH=cli-login"
26
+ else
27
+ echo "CLAUDE_AUTH=missing: claude auth status did not report a recognized Claude CLI login"
28
+ exit 1
29
+ fi
30
+ ```
31
+
32
+ ## Portable prompt file
33
+
34
+ Use a suffix-free `mktemp -t` pattern so macOS and Linux both work:
35
+
36
+ ```bash
37
+ PROMPT_FILE=$(mktemp -t wp-claude-review.XXXXXX)
38
+ trap 'rm -f "$PROMPT_FILE"' EXIT
39
+ ```
40
+
41
+ ## Dashboard helper relation
42
+
43
+ When this skill is invoked from `wp dash`, create explicit lifecycle records around the outside-voice call. The shared `wp dash-helper-*` service owns the event JSON and report shape; do not duplicate it in a skill. Outside the dashboard the block is a no-op, preserving standalone calls.
44
+
45
+ ```bash
46
+ DASH_HELPER_RUN_ID=""
47
+ if [ "${WP_DASH:-}" = "1" ] && [ -n "${WP_DASH_RUN_ID:-}" ]; then
48
+ DASH_HELPER_RUN_ID=$(wp dash-helper-start --provider claude --role reviewer)
49
+ fi
50
+ ```
51
+
52
+ Claude's managed native subagent lifecycle does not provide a reliable parent-linked completion event. It remains explicitly unsupported rather than being inferred from transcript text or timing.
53
+
54
+ ## Modes
55
+
56
+ ### Review
57
+
58
+ Use single-file / single-question first for any non-trivial diff. Do not send a whole PR unless it already fits within the bounded payload below.
59
+
60
+ **Model policy:** default to `sonnet` via `CLAUDE_REVIEW_MODEL=${CLAUDE_REVIEW_MODEL:-sonnet}`. Override to `opus` only when the review is approval evidence or the user explicitly asks for Opus. Never use `fable` for Claude outside-voice review. Any review used as blueprint approval evidence MUST run with Claude Opus and record `"model": "opus"`.
61
+
62
+ #### Bounded prompt payload
63
+
64
+ Always include:
65
+
66
+ - current branch and base branch
67
+ - `git diff --stat`
68
+ - changed file list
69
+ - one targeted file diff or one narrow snippet/hunk only, capped to a fixed size
70
+
71
+ Prefer ~12 KB or ~200 lines per call. Split large reviews instead of raising the cap.
72
+
73
+ ```bash
74
+ BASE_BRANCH=${BASE_BRANCH:-origin/main}
75
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
76
+ TARGET_FILE=${TARGET_FILE:?set TARGET_FILE to one changed file}
77
+
78
+ {
79
+ printf 'Outside review mode: focused diff review\n'
80
+ printf 'Base branch: %s\nCurrent branch: %s\n\n' "$BASE_BRANCH" "$CURRENT_BRANCH"
81
+ printf 'git diff --stat %s...HEAD\n' "$BASE_BRANCH"
82
+ git diff --stat "$BASE_BRANCH"...HEAD
83
+ printf '\nChanged files:\n'
84
+ git diff --name-only "$BASE_BRANCH"...HEAD
85
+ printf '\nTarget file: %s\n' "$TARGET_FILE"
86
+ printf 'Bounded target diff (max 12000 bytes):\n'
87
+ git diff --unified=3 "$BASE_BRANCH"...HEAD -- "$TARGET_FILE" | \
88
+ head -c 12000
89
+ printf '\n\nQuestion: Identify the highest-signal correctness, security, data-loss, or maintainability risk in %s. Quote only the smallest relevant excerpt. If context is insufficient, answer INSUFFICIENT_CONTEXT.\n' "$TARGET_FILE"
90
+ } >"$PROMPT_FILE"
91
+ ```
92
+
93
+ #### Progress-aware review runtime
94
+
95
+ Run both the availability probe and the full review through the typed `wp review run` owner. Skills must not embed subprocess supervision. The runtime consumes Claude's streaming JSON events, advances its idle clock only on monotonic semantic progress, and has no total wall-clock cutoff.
96
+
97
+ ```bash
98
+ CLAUDE_REVIEW_MODEL=${CLAUDE_REVIEW_MODEL:-sonnet}
99
+ CLAUDE_REVIEW_EFFORT=${CLAUDE_REVIEW_EFFORT:-medium}
100
+ CLAUDE_REVIEW_PROBE_IDLE_SECONDS=${CLAUDE_REVIEW_PROBE_IDLE_SECONDS:-180}
101
+ CLAUDE_REVIEW_IDLE_SECONDS=${CLAUDE_REVIEW_IDLE_SECONDS:-180}
102
+ CLAUDE_REVIEW_ARTIFACT_ROOT=${CLAUDE_REVIEW_ARTIFACT_ROOT:-"$(pwd)/.webpresso/reviews"}
103
+ PROBE_FILE=$(mktemp -t wp-claude-probe.XXXXXX)
104
+ trap 'rm -f "$PROMPT_FILE" "$PROBE_FILE"' EXIT
105
+ printf 'Reply exactly CLAUDE_OK.\n' >"$PROBE_FILE"
106
+
107
+ wp review run \
108
+ --provider claude \
109
+ --prompt-file "$PROBE_FILE" \
110
+ --model "$CLAUDE_REVIEW_MODEL" \
111
+ --effort "$CLAUDE_REVIEW_EFFORT" \
112
+ --stage probe \
113
+ --expected-marker CLAUDE_OK \
114
+ --artifact-root "$CLAUDE_REVIEW_ARTIFACT_ROOT" \
115
+ --idle-seconds "$CLAUDE_REVIEW_PROBE_IDLE_SECONDS"
116
+
117
+ wp review run \
118
+ --provider claude \
119
+ --prompt-file "$PROMPT_FILE" \
120
+ --model "$CLAUDE_REVIEW_MODEL" \
121
+ --effort "$CLAUDE_REVIEW_EFFORT" \
122
+ --stage review \
123
+ --artifact-root "$CLAUDE_REVIEW_ARTIFACT_ROOT" \
124
+ --idle-seconds "$CLAUDE_REVIEW_IDLE_SECONDS"
125
+ CLAUDE_REVIEW_CODE=$?
126
+ ```
127
+
128
+ After the review runtime exits, emit its terminal state using the same artifact path:
129
+
130
+ ```bash
131
+ if [ -n "$DASH_HELPER_RUN_ID" ]; then
132
+ if [ "$CLAUDE_REVIEW_CODE" -eq 0 ]; then
133
+ wp dash-helper-complete --provider claude --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome completed --artifact "${CLAUDE_REVIEW_ARTIFACT:-}"
134
+ else
135
+ wp dash-helper-complete --provider claude --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome failed --artifact "${CLAUDE_REVIEW_ARTIFACT:-}"
136
+ fi
137
+ fi
138
+ ```
139
+
140
+ Treat `true-idle`, `protocol-unsupported`, provider failure, abort, spawn failure, or artifact failure as unavailable review evidence. Never replace them with a static timeout, arbitrary byte-growth heartbeat, or buffered-output fallback.
141
+
142
+ #### Retry policy
143
+
144
+ Do not perform blind retries. Run the full review once. Retry only after diagnosing and changing a command-shape problem; record the reason and artifact path. Do not fall back to an unbounded whole-PR prompt.
145
+
146
+ Summarize findings with severity, evidence, model, artifact path, and whether you independently verified them.
147
+
148
+ ### Challenge
149
+
150
+ Ask Claude to argue against the current plan: hidden assumptions, failure modes, missing tests, and simpler alternatives.
151
+
152
+ ### Consult
153
+
154
+ Ask a focused repo question. Include only the necessary file paths and snippets; do not send secrets.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: codex
3
+ description: "Codex CLI outside-voice wrapper for code review, plan challenge, or consultation from non-Codex hosts."
4
+ license: MIT
5
+ ---
6
+
7
+ # Codex outside voice
8
+
9
+ Use this skill from Claude or another non-Codex host when the user wants Codex to independently review a diff, challenge a plan, or answer a repo question. Keep Codex read-only by default and treat its answer as external advice until independently verified.
10
+
11
+ ## Auth check
12
+
13
+ ```bash
14
+ if ! codex login status >/dev/null 2>&1; then
15
+ echo "CODEX_AUTH=missing: run codex login before using the codex outside-voice skill"
16
+ exit 1
17
+ fi
18
+ echo "CODEX_AUTH=ok"
19
+ ```
20
+
21
+ ## Portable prompt file
22
+
23
+ ```bash
24
+ PROMPT_FILE=$(mktemp -t wp-codex-review.XXXXXX)
25
+ trap 'rm -f "$PROMPT_FILE"' EXIT
26
+ ```
27
+
28
+ ## Dashboard helper relation
29
+
30
+ When called by `wp dash`, register the outside-voice helper through the shared service rather than writing relationship JSON in this skill. This is intentionally a no-op for standalone use.
31
+
32
+ ```bash
33
+ DASH_HELPER_RUN_ID=""
34
+ if [ "${WP_DASH:-}" = "1" ] && [ -n "${WP_DASH_RUN_ID:-}" ]; then
35
+ DASH_HELPER_RUN_ID=$(wp dash-helper-start --provider codex --role reviewer)
36
+ fi
37
+ ```
38
+
39
+ After the review command completes, report the exact terminal outcome. Supply an artifact path when the caller created one.
40
+
41
+ ```bash
42
+ if [ -n "$DASH_HELPER_RUN_ID" ]; then
43
+ if [ "${CODEX_REVIEW_CODE:-0}" -eq 0 ]; then
44
+ wp dash-helper-complete --provider codex --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome completed --artifact "${CODEX_REVIEW_ARTIFACT:-}"
45
+ else
46
+ wp dash-helper-complete --provider codex --run-id "$DASH_HELPER_RUN_ID" --role reviewer --outcome failed --artifact "${CODEX_REVIEW_ARTIFACT:-}"
47
+ fi
48
+ fi
49
+ ```
50
+
51
+ Codex native subagent events are not currently parent-linked in the managed lifecycle. They are shown as unsupported, never inferred from text, PIDs, or timestamps.
52
+
53
+ ## Modes
54
+
55
+ ### Review
56
+
57
+ 1. Capture the current branch, base branch, and `git diff --stat`.
58
+ 2. Write a concise prompt asking Codex to find correctness, security, data-loss, and maintainability risks.
59
+ 3. Run Codex non-interactively in read-only mode:
60
+
61
+ ```bash
62
+ CODEX_REVIEW_EFFORT=${CODEX_REVIEW_EFFORT:-medium}
63
+ case "$CODEX_REVIEW_EFFORT" in
64
+ medium|high) ;;
65
+ *) echo "CODEX_REVIEW_EFFORT must be one of: medium, high" >&2; exit 2 ;;
66
+ esac
67
+ CODEX_REVIEW_CODE=0
68
+ codex exec -c model_reasoning_effort="\"$CODEX_REVIEW_EFFORT\"" --sandbox read-only --cd "$PWD" - <"$PROMPT_FILE" || CODEX_REVIEW_CODE=$?
69
+ ```
70
+
71
+ 4. Summarize findings with severity, evidence, and whether you independently verified them.
72
+
73
+ ### Challenge
74
+
75
+ Ask Codex to argue against the current plan: hidden assumptions, failure modes, missing tests, and simpler alternatives.
76
+
77
+ ### Consult
78
+
79
+ Ask a focused repo question. Include only the necessary file paths and snippets; do not send secrets.