@webpresso/plugin-opencode 0.0.4

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 (37) hide show
  1. package/LICENSE +104 -0
  2. package/index.js +250 -0
  3. package/package.json +41 -0
  4. package/plugin-skill-ownership.json +99 -0
  5. package/skills/ai-deslop/SKILL.md +91 -0
  6. package/skills/autopilot/SKILL.md +77 -0
  7. package/skills/autoresearch/SKILL.md +49 -0
  8. package/skills/best-practice-research/SKILL.md +89 -0
  9. package/skills/browse/SKILL.md +25 -0
  10. package/skills/claude/SKILL.md +186 -0
  11. package/skills/codex/SKILL.md +142 -0
  12. package/skills/deep-interview/LICENSE.txt +28 -0
  13. package/skills/deep-interview/SKILL.md +269 -0
  14. package/skills/deep-research/SKILL.md +258 -0
  15. package/skills/delivery-program/SKILL.md +57 -0
  16. package/skills/design-review/SKILL.md +26 -0
  17. package/skills/devex-review/SKILL.md +28 -0
  18. package/skills/fix/SKILL.md +174 -0
  19. package/skills/grok/SKILL.md +32 -0
  20. package/skills/hooks-doctor/SKILL.md +78 -0
  21. package/skills/investigate/SKILL.md +72 -0
  22. package/skills/lore-protocol/SKILL.md +84 -0
  23. package/skills/opencode-go/SKILL.md +97 -0
  24. package/skills/plan-ceo-review/SKILL.md +27 -0
  25. package/skills/plan-design-review/SKILL.md +27 -0
  26. package/skills/plan-devex-review/SKILL.md +19 -0
  27. package/skills/plan-eng-review/SKILL.md +24 -0
  28. package/skills/plan-refine/SKILL.md +50 -0
  29. package/skills/plan-refine/references/full-methodology.md +645 -0
  30. package/skills/ralplan/SKILL.md +50 -0
  31. package/skills/team/SKILL.md +77 -0
  32. package/skills/tech-debt/SKILL.md +79 -0
  33. package/skills/testing-philosophy/SKILL.md +53 -0
  34. package/skills/testing-philosophy/references/full-testing-philosophy.md +523 -0
  35. package/skills/tph/SKILL.md +35 -0
  36. package/skills/ultragoal/SKILL.md +179 -0
  37. package/skills/verify/SKILL.md +283 -0
package/LICENSE ADDED
@@ -0,0 +1,104 @@
1
+ Elastic License 2.0
2
+ ===================
3
+
4
+ Copyright (c) 2026 Webpresso, Inc.
5
+
6
+ Acceptance
7
+ ----------
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ Copyright License
12
+ -----------------
13
+
14
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
15
+ non-sublicensable, non-transferable license to use, copy, distribute, make
16
+ available, and prepare derivative works of the software, in each case subject
17
+ to the limitations and conditions below.
18
+
19
+ Limitations
20
+ -----------
21
+
22
+ You may not provide the software to third parties as a hosted or managed
23
+ service, where the service provides users with access to any substantial set of
24
+ the features or functionality of the software.
25
+
26
+ You may not move, change, disable, or circumvent the license key
27
+ functionality in the software, and you may not remove or obscure any
28
+ functionality in the software that is protected by the license key.
29
+
30
+ You may not alter, remove, or obscure any licensing, copyright, or other
31
+ notices of the licensor in the software. Any use of the licensor's trademarks
32
+ is subject to applicable law.
33
+
34
+ Patents
35
+ -------
36
+
37
+ The licensor grants you a license, under any patent claims the licensor can
38
+ license, or becomes able to license, to make, have made, use, sell, offer for
39
+ sale, import and have imported the software, in each case subject to the
40
+ limitations and conditions in this license. This license does not cover any
41
+ patent claims that you cause to be infringed by modifications or additions to
42
+ the software.
43
+
44
+ If you or your company make any written claim that the software infringes or
45
+ contributes to infringement of any patent, your patent license for the software
46
+ granted under these terms ends immediately. If your company makes such a claim,
47
+ your patent license ends immediately for work on behalf of your company.
48
+
49
+ Notices
50
+ -------
51
+
52
+ You must ensure that anyone who gets a copy of any part of the software from
53
+ you also gets a copy of these terms.
54
+
55
+ If you modify the software, you must include in any modified copies of the
56
+ software prominent notices stating that you have modified the software.
57
+
58
+ No Other Rights
59
+ ---------------
60
+
61
+ These terms do not imply any licenses other than those expressly granted in
62
+ these terms.
63
+
64
+ Termination
65
+ -----------
66
+
67
+ If you use the software in violation of these terms, such use is not licensed,
68
+ and your licenses will automatically terminate. If the licensor provides you
69
+ with a notice of your violation, and you cease all violation of this license no
70
+ later than 30 days after you receive that notice, your licenses will be
71
+ reinstated retroactively. However, if you violate these terms after such
72
+ reinstatement, any additional violation of these terms will cause your licenses
73
+ to terminate automatically and permanently.
74
+
75
+ No Liability
76
+ ------------
77
+
78
+ As far as the law allows, the software comes as is, without any warranty or
79
+ condition, and the licensor will not be liable to you for any damages arising
80
+ out of these terms or the use or nature of the software, under any kind of
81
+ legal claim.
82
+
83
+ Definitions
84
+ -----------
85
+
86
+ The licensor is the entity offering these terms, and the software is the
87
+ software the licensor makes available under these terms, including any portion
88
+ of it.
89
+
90
+ you refers to the individual or entity agreeing to these terms.
91
+
92
+ your company is any legal entity, sole proprietorship, or other kind of
93
+ organization that you work for, plus all organizations that have control over,
94
+ are under the control of, or are under common control with that organization.
95
+ control means ownership of substantially all the assets of an entity, or the
96
+ power to direct its management and policies by vote, contract, or otherwise.
97
+ Control can be direct or indirect.
98
+
99
+ your licenses are all the licenses granted to you for the software under these
100
+ terms.
101
+
102
+ use means anything you do with the software requiring one of your licenses.
103
+
104
+ trademark means trademarks, service marks, and similar rights.
package/index.js ADDED
@@ -0,0 +1,250 @@
1
+ import { accessSync, constants, statSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+
5
+ const SESSION_START_HOOKS = ["sessionstart-routing"];
6
+ const PRE_TOOL_HOOKS = ["pretool-guard"];
7
+ const POST_TOOL_HOOKS = ["post-tool"];
8
+
9
+ function extractAdditionalContext(envelope) {
10
+ return envelope?.hookSpecificOutput?.additionalContext ?? null;
11
+ }
12
+
13
+ function extractDenyReason(envelope) {
14
+ const output = envelope?.hookSpecificOutput;
15
+ if (output?.permissionDecision === "deny") {
16
+ return output.permissionDecisionReason ?? "webpresso denied this tool call";
17
+ }
18
+
19
+ return null;
20
+ }
21
+
22
+ function extractUpdatedInput(envelope) {
23
+ const output = envelope?.hookSpecificOutput;
24
+ return output?.permissionDecision === "allow" ? (output.updatedInput ?? null) : null;
25
+ }
26
+
27
+ function hookInputForTool(tool, args, directory) {
28
+ const toolArgs = args && typeof args === "object" && !Array.isArray(args) ? args : {};
29
+ const base = {
30
+ cwd: directory,
31
+ hook_event_name: "PreToolUse",
32
+ };
33
+
34
+ switch (tool) {
35
+ case "bash":
36
+ return {
37
+ ...base,
38
+ tool_name: "Bash",
39
+ tool_input: {
40
+ ...toolArgs,
41
+ command: toolArgs.command ?? "",
42
+ },
43
+ };
44
+ case "write":
45
+ return {
46
+ ...base,
47
+ tool_name: "Write",
48
+ tool_input: {
49
+ file_path: args?.filePath ?? "",
50
+ content: args?.content ?? "",
51
+ },
52
+ };
53
+ case "edit":
54
+ return {
55
+ ...base,
56
+ tool_name: "Edit",
57
+ tool_input: {
58
+ file_path: args?.filePath ?? "",
59
+ old_string: args?.oldString ?? "",
60
+ new_string: args?.newString ?? "",
61
+ },
62
+ };
63
+ case "read":
64
+ return {
65
+ ...base,
66
+ tool_name: "Read",
67
+ tool_input: {
68
+ file_path: args?.filePath ?? "",
69
+ },
70
+ };
71
+ case "apply_patch":
72
+ return {
73
+ ...base,
74
+ tool_name: "Write",
75
+ tool_input: {
76
+ patch_text: args?.patchText ?? "",
77
+ },
78
+ };
79
+ default:
80
+ return null;
81
+ }
82
+ }
83
+
84
+ function shellQuote(value) {
85
+ return `'${String(value).replaceAll("'", "'\\''")}'`;
86
+ }
87
+
88
+ function isExecutableFile(candidate) {
89
+ try {
90
+ const stat = statSync(candidate);
91
+ if (!stat.isFile()) return false;
92
+ if (process.platform !== "win32") accessSync(candidate, constants.X_OK);
93
+ return true;
94
+ } catch {
95
+ return false;
96
+ }
97
+ }
98
+
99
+ function fixedAppWpLauncher() {
100
+ const home =
101
+ process.platform === "win32"
102
+ ? process.env.USERPROFILE || homedir()
103
+ : process.env.HOME || homedir();
104
+ return process.platform === "win32"
105
+ ? join(home, ".webpresso", "bin", "wp.exe")
106
+ : join(home, ".webpresso", "bin", "wp");
107
+ }
108
+
109
+ async function resolveWpHookCommand($, directory, hookName) {
110
+ const explicit = process.env.WEBPRESSO_WP_BIN;
111
+ const jitRoot = process.env.WP_FORCE_JIT_PATH;
112
+ if (explicit && jitRoot) {
113
+ throw new Error("WEBPRESSO_WP_BIN and WP_FORCE_JIT_PATH are both set; unset one.");
114
+ }
115
+
116
+ let candidate = null;
117
+ let label = "Webpresso app launcher";
118
+ if (explicit) {
119
+ candidate = explicit;
120
+ label = "WEBPRESSO_WP_BIN";
121
+ } else if (jitRoot) {
122
+ candidate = join(jitRoot, "bin", "wp");
123
+ label = "WP_FORCE_JIT_PATH";
124
+ } else {
125
+ candidate = fixedAppWpLauncher();
126
+ }
127
+
128
+ if (!isExecutableFile(candidate)) {
129
+ throw new Error(
130
+ `${label} points to ${candidate}, but that executable is not available. ` +
131
+ "Set WEBPRESSO_WP_BIN, set WP_FORCE_JIT_PATH to an agent-kit checkout, or install the Webpresso app.",
132
+ );
133
+ }
134
+ return `${shellQuote(candidate)} hook ${hookName}`;
135
+ }
136
+
137
+ async function runHook($, directory, hookName, payload, options = {}) {
138
+ const stdinPayload = payload === null ? "" : JSON.stringify(payload);
139
+ const command = await resolveWpHookCommand($, directory, hookName);
140
+ const result =
141
+ await $`printf '%s' ${stdinPayload} | env CLAUDE_PROJECT_DIR=${directory} WP_HOOK_HOST=opencode sh -lc ${command}`
142
+ .cwd(directory)
143
+ .quiet()
144
+ .nothrow();
145
+
146
+ const stdout = result.stdout.toString().trim();
147
+ const stderr = result.stderr?.toString().trim() ?? "";
148
+ const exitCode = result.exitCode ?? 0;
149
+ const required = options.required === true;
150
+
151
+ if (exitCode !== 0) {
152
+ if (required) {
153
+ throw new Error(
154
+ `webpresso hook ${hookName} failed with exit ${exitCode}${stderr ? `: ${stderr}` : ""}`,
155
+ );
156
+ }
157
+ return null;
158
+ }
159
+
160
+ if (stdout === "") {
161
+ if (required) {
162
+ throw new Error(`webpresso hook ${hookName} produced no JSON response`);
163
+ }
164
+ return null;
165
+ }
166
+
167
+ try {
168
+ return JSON.parse(stdout);
169
+ } catch (error) {
170
+ if (required) {
171
+ throw new Error(
172
+ `webpresso hook ${hookName} produced invalid JSON${stderr ? `: ${stderr}` : ""}`,
173
+ { cause: error },
174
+ );
175
+ }
176
+ return null;
177
+ }
178
+ }
179
+
180
+ async function collectSessionStartContext($, directory) {
181
+ const contexts = [];
182
+
183
+ for (const hookName of SESSION_START_HOOKS) {
184
+ const envelope = await runHook($, directory, hookName, null);
185
+ const message = extractAdditionalContext(envelope);
186
+ if (message === null) {
187
+ continue;
188
+ }
189
+
190
+ contexts.push(message);
191
+ }
192
+
193
+ return contexts;
194
+ }
195
+
196
+ export const WebpressoHooksPlugin = async ({ $, directory }) => {
197
+ let cachedSessionContexts = [];
198
+
199
+ return {
200
+ event: async ({ event }) => {
201
+ if (event?.type === "session.created") {
202
+ cachedSessionContexts = await collectSessionStartContext($, directory);
203
+ }
204
+ },
205
+ "shell.env": async (input, output) => {
206
+ output.env.CLAUDE_PROJECT_DIR = input.cwd;
207
+ },
208
+ "tool.execute.before": async (input, output) => {
209
+ const payload = hookInputForTool(input?.tool, output?.args ?? input?.args ?? {}, directory);
210
+ if (payload === null) {
211
+ return;
212
+ }
213
+
214
+ for (const hookName of PRE_TOOL_HOOKS) {
215
+ const envelope = await runHook($, directory, hookName, payload, { required: true });
216
+ const denyReason = extractDenyReason(envelope);
217
+ if (denyReason !== null) {
218
+ throw new Error(denyReason);
219
+ }
220
+ const updatedInput = extractUpdatedInput(envelope);
221
+ const nextCommand = updatedInput?.command;
222
+ if (input?.tool === "bash" && typeof nextCommand === "string") {
223
+ output.args.command = nextCommand;
224
+ }
225
+ }
226
+ },
227
+ "tool.execute.after": async (input, output) => {
228
+ const payload = hookInputForTool(input?.tool, output?.args ?? input?.args ?? {}, directory);
229
+ if (payload === null) {
230
+ return;
231
+ }
232
+
233
+ for (const hookName of POST_TOOL_HOOKS) {
234
+ await runHook($, directory, hookName, payload);
235
+ }
236
+ },
237
+ "experimental.session.compacting": async (_input, output) => {
238
+ cachedSessionContexts = await collectSessionStartContext($, directory);
239
+ if (output && Array.isArray(output.context)) {
240
+ for (const message of cachedSessionContexts) {
241
+ output.context.push(message);
242
+ }
243
+ }
244
+ },
245
+ };
246
+ };
247
+
248
+ const webpressoOpenCodePlugins = [WebpressoHooksPlugin];
249
+
250
+ export default webpressoOpenCodePlugins;
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@webpresso/plugin-opencode",
3
+ "version": "0.0.4",
4
+ "private": false,
5
+ "description": "OpenCode plugin adapter package for Webpresso agent-kit.",
6
+ "homepage": "https://github.com/webpresso/app#readme",
7
+ "bugs": {
8
+ "url": "https://github.com/webpresso/app/issues"
9
+ },
10
+ "license": "Elastic-2.0",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/webpresso/app.git",
14
+ "directory": "packages/plugin-opencode"
15
+ },
16
+ "files": [
17
+ "index.js",
18
+ "plugin-skill-ownership.json",
19
+ "skills/**/SKILL.md",
20
+ "skills/**/references/**",
21
+ "skills/**/LICENSE*",
22
+ "LICENSE",
23
+ "!README.md",
24
+ "!CHANGELOG.md",
25
+ "!**/*.test.js",
26
+ "!**/*.test.ts"
27
+ ],
28
+ "type": "module",
29
+ "sideEffects": false,
30
+ "main": "./index.js",
31
+ "exports": {
32
+ ".": "./index.js"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "engines": {
39
+ "node": ">=24"
40
+ }
41
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "host": "opencode",
4
+ "packageName": "@webpresso/plugin-opencode",
5
+ "packageVersion": "0.0.4",
6
+ "runtimeDirs": [],
7
+ "skills": {
8
+ "ai-deslop": {
9
+ "digest": "sha256:c1da1003009073dd3923454947e1141efc2e7df5ad8d725a511ed5cff03bfb5c"
10
+ },
11
+ "autopilot": {
12
+ "digest": "sha256:cd97b441a78e2d3253ed3f8bcb8822b37684c7c8f0adba43f1d84987b678f528"
13
+ },
14
+ "autoresearch": {
15
+ "digest": "sha256:b4d51cd53beb4a3271827172dfbd0b1d27bd58761ca07a35d49a5d6324b87fdf"
16
+ },
17
+ "best-practice-research": {
18
+ "digest": "sha256:6d26b524d206067c7305da8a9334270f2525e4323aa3faa56ef02679e4d61849"
19
+ },
20
+ "browse": {
21
+ "digest": "sha256:21fd24862e7f7c8a1feadea6bc376492b136b99fc381cf1b8927c9db80615431"
22
+ },
23
+ "claude": {
24
+ "digest": "sha256:908367f139d3c3e033248be5e4b003475b01b62d4851ad1ff271079af76a53f8"
25
+ },
26
+ "codex": {
27
+ "digest": "sha256:9cf714ed78dafbb2370e8f6e4bee5f22db7d540444c4dd96540c8b8dd22bd4a4"
28
+ },
29
+ "deep-interview": {
30
+ "digest": "sha256:e5289c1299ef12cecd35ad713d1a1cb66d7f6a6c0c8029562612d6122af90cbc"
31
+ },
32
+ "deep-research": {
33
+ "digest": "sha256:01dafd194066a2936db0b437fd5c3beef6d7ff82478d0d995393093d89496f18"
34
+ },
35
+ "delivery-program": {
36
+ "digest": "sha256:b6ef474f3636c5fcc2b53dce014c022f2635cfeb32a9c698de8c7c21b37b4018"
37
+ },
38
+ "design-review": {
39
+ "digest": "sha256:5b213735e2842568774572f36b198bccf03c03a54b2732484aadd023f04acb23"
40
+ },
41
+ "devex-review": {
42
+ "digest": "sha256:306355888da0827e3523022077f731845726bbaaf595ca12515cc91d8605b5e6"
43
+ },
44
+ "fix": {
45
+ "digest": "sha256:46d75461d262e35c5f5a7f344464ea013cc29258419db66c2a5ff881af72e196"
46
+ },
47
+ "grok": {
48
+ "digest": "sha256:796104b04f70c8dd48cf1056c8d72d9492648f89486a35515e00af1d0de42f0a"
49
+ },
50
+ "hooks-doctor": {
51
+ "digest": "sha256:c7bbfcea5822702ff8b940140eb7f79b4ab05b3e0eee6c82e79bd6cc30b27329"
52
+ },
53
+ "investigate": {
54
+ "digest": "sha256:778b3a1f38323e8dd6101c6ace26ff8aada1246b20952b3641d5d1049bc50055"
55
+ },
56
+ "lore-protocol": {
57
+ "digest": "sha256:a80fbacc765e8b886437b9fdf7dd71e1ceb1b98b939078ec90fc88d06a8b4c69"
58
+ },
59
+ "opencode-go": {
60
+ "digest": "sha256:c9d9e2c59a4e0c895ddd92c5bc5a55d9feb670a9d44cedb96a893eb2aa9cfd7b"
61
+ },
62
+ "plan-ceo-review": {
63
+ "digest": "sha256:4d426158518dd71f8998770e8d4037bcbfa3c65d7265a93a4a78a9b015ba881e"
64
+ },
65
+ "plan-design-review": {
66
+ "digest": "sha256:a8a33efe67844d0602ff595c0b7e8f5529e52f51a781112952636c91963ce19e"
67
+ },
68
+ "plan-devex-review": {
69
+ "digest": "sha256:a49b4f61f1c54a7d89111c270616684dcbf2a7236bc817fafb5919366a7cda31"
70
+ },
71
+ "plan-eng-review": {
72
+ "digest": "sha256:b728dad90254d4c9f81b3818321d34ab53519b79ce20ff3bfe08bfacb2aa3e86"
73
+ },
74
+ "plan-refine": {
75
+ "digest": "sha256:fb883aa53d933324a7979301ca452aed356a8b452827e3695703fb16ccd9e236"
76
+ },
77
+ "ralplan": {
78
+ "digest": "sha256:db285d477f43ed23df990d4c03750d9916cdc7809356c1bf025efdf6a9add9ed"
79
+ },
80
+ "team": {
81
+ "digest": "sha256:bf9843f11c2c683bb0e0929c4030a728a93c5ff8087f2c3dc43b88faa7cbd427"
82
+ },
83
+ "tech-debt": {
84
+ "digest": "sha256:8b1f30e55ec6e5ab185ff19ecf15384438dbd619f675c2c65f2e53cedecbae5c"
85
+ },
86
+ "testing-philosophy": {
87
+ "digest": "sha256:43fa05bcb7eaf8efd4a8dcc0f9fb9c30ae9f80079d9b3dbfdc926734a64a2973"
88
+ },
89
+ "tph": {
90
+ "digest": "sha256:bed3684a850651534f315d355cdeae50d951c429817df0f105cccdb7f4e1561b"
91
+ },
92
+ "ultragoal": {
93
+ "digest": "sha256:338952843c8f6b884a18be434daf5b2e190093796b3524e264e6f2c714bd01e1"
94
+ },
95
+ "verify": {
96
+ "digest": "sha256:0eaa83fa98b39aeb1b3616301cfb22fea7897a1e16c589986febb29811c5a73f"
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,91 @@
1
+ ---
2
+ type: skill
3
+ slug: ai-deslop
4
+ title: AI Deslop
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [fix, verify, investigate]
9
+ created: "2026-07-16"
10
+ last_reviewed: "2026-07-16"
11
+ name: ai-deslop
12
+ description: "Bounded anti-slop cleanup pass: simplify, delete noise, or review-only with --review."
13
+ license: MIT
14
+ upstream:
15
+ source: https://github.com/Yeachan-Heo/oh-my-claudecode/tree/590fb988931d34a12604be0ca4215c818079018e/skills/ai-slop-cleaner
16
+ last_synced: "2026-07-16"
17
+ argument-hint: "[--review] <files|path|scope>"
18
+ ---
19
+
20
+ # AI Deslop
21
+
22
+ Use this skill after behavior is already correct but the resulting code or docs
23
+ still feel bloated, repetitive, over-scaffolded, or obviously machine-shaped.
24
+
25
+ ## Boundary
26
+
27
+ - `ai-deslop` is a cleanup pass, not a feature lane.
28
+ - Preserve behavior. If the work needs a logic change, route back to `fix`.
29
+ - Prefer deletion and simplification over new abstraction.
30
+ - Keep scope bounded to the requested files, changed files, or clearly named
31
+ area. Do not expand into broad redesign.
32
+
33
+ ## When to use it
34
+
35
+ - The user explicitly asks to deslop, clean up AI slop, simplify, or trim noise.
36
+ - A completed feature still contains dead code, duplicate helpers, wrapper
37
+ layers, weak boundaries, or generated-sounding prose/comments.
38
+ - `verify` finds stale compatibility branches, cargo-cult abstractions, or
39
+ cleanup debt after the behavioral proof is already green.
40
+ - The user wants a reviewer-only anti-slop pass via `--review`.
41
+
42
+ ## When not to use it
43
+
44
+ - Behavior is still failing or root cause is not established.
45
+ - The request is really a new feature, redesign, or semantic refactor.
46
+ - Verification is too weak to protect preserved behavior.
47
+
48
+ ## Modes
49
+
50
+ ### Standard mode
51
+
52
+ 1. Lock behavior first with the narrowest regression proof available.
53
+ 2. Write a short cleanup plan naming the concrete slop to remove.
54
+ 3. Classify each smell:
55
+ - dead code / unused exports
56
+ - duplication / needless wrappers
57
+ - compatibility scaffolding that no longer serves a consumer
58
+ - noisy comments, docs, or prompts that restate the obvious
59
+ - weak boundaries or helper proliferation with no clear owner
60
+ 4. Apply the smallest safe deletions and consolidations first.
61
+ 5. Re-run the same scoped verification after each meaningful pass.
62
+
63
+ ### Review mode (`--review`)
64
+
65
+ Use this to review a drafted cleanup pass without writing code.
66
+
67
+ 1. Inspect the cleanup plan, changed files, and verification evidence.
68
+ 2. Look specifically for leftover dead code, duplicate logic, needless
69
+ abstraction, and accidental behavior drift.
70
+ 3. Return a verdict plus required follow-ups.
71
+ 4. Do not both write and self-approve the same high-impact cleanup pass.
72
+
73
+ ## Verification
74
+
75
+ Run only the narrowest checks that protect preserved behavior:
76
+
77
+ - targeted tests
78
+ - targeted lint/typecheck
79
+ - any changed docs or command-surface checks
80
+
81
+ If the cleanup touches shared/public surfaces or broad repo-owned docs, hand the
82
+ result to `verify` before calling it done.
83
+
84
+ ## Output
85
+
86
+ Return:
87
+
88
+ - cleanup scope
89
+ - slop classes removed
90
+ - proof that behavior stayed locked
91
+ - remaining follow-ups, if any
@@ -0,0 +1,77 @@
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, ultragoal, fix]
9
+ created: "2026-07-10"
10
+ last_reviewed: "2026-07-21"
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`
19
+ using `wp_ultragoal_run` / `wp ultragoal run` and the current handoff.
20
+
21
+ ## Outside-voice (required)
22
+
23
+ After each ultragoal **phase or plan-gate milestone**, run an **OpenCode Go** outside-voice review and pick the model by purpose. The purpose→family ordering lives in one place — the committed reviewer policy rendered into the `opencode-go` skill — so follow that skill and do not restate the ordering here. Resolve IDs from live `opencode models opencode-go`. `wp_review_gate` is only for exact-version draft plan approval/auto-promotion; `wp_review_run` is advisory for implementation/phase review and never mutates blueprint approval state. Never self-approve. Full protocol: the `ultragoal` skill. Respect `review_budget` (default owned by `workflow-skills-routing.md`): one sequential path, no multi-host stampede.
24
+
25
+ ## Vague gate
26
+
27
+ A brief is anchored when it includes a file path, symbol, issue number, test name, or numbered steps
28
+ (blueprint slug and explicit budgets also count). Route any unanchored brief through
29
+ `plan-refine` before execution.
30
+
31
+ **Reject** (unless rewritten with scope + budgets): “complete all”, “full autopilot”,
32
+ “go to sleep”, “elegantly merge everything” without a named blueprint/PR set.
33
+
34
+ A leading `force:` is the only explicit bypass; strip it before creating the goal and
35
+ record the bypass in the blueprint.
36
+
37
+ Default budgets if the user omits them: `concurrency=4`, `fix_budget=1`, no
38
+ `/loop`; `review_budget` per `workflow-skills-routing.md`. See `ultragoal`
39
+ skill.
40
+
41
+ ## Tooling map
42
+
43
+ | Pipeline step | Tools |
44
+ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
45
+ | Plan | `plan-refine`, `wp_blueprint_*`, `wp_session_capture` for decisions |
46
+ | Create controller | `wp_ultragoal_new`, `wp_worktree` |
47
+ | Execute | ready-set via blueprint tools; `/goal` or parallel subagents; `wp_session_context` for delegates; `wp_blueprint_task_verify` only to complete tasks |
48
+ | Opportunistic repair | `/fix` up to `fix_budget`; else handoff backlog |
49
+ | QA | `wp_qa` / `wp_lint` / `wp_typecheck` / `wp_test`; PR checks via `wp_pr_status` / `wp_pr_wait` |
50
+ | Validate | one outside voice if merge-bound (OpenCode Go by purpose, or claude/codex/grok); `wp review gate` for authority |
51
+ | Land | `wp_pr_upsert`, green required checks, merge + owner cleanup |
52
+ | Blocked / stop | `wp_ultragoal_handoff` ≤40 lines; `wp_ultragoal_cancel` if abandoned |
53
+
54
+ ## Pipeline
55
+
56
+ 1. **Plan:** refine blueprints and satisfy provenance-backed promotion approvals.
57
+ 2. **Execute:** implement current **ready** tasks in parallel up to `concurrency`; use only
58
+ `wp_blueprint_task_verify` to mark them done.
59
+ 3. **QA:** run affected checks and `wp_qa`; preserve normalized failure evidence. Prefer
60
+ PR-bound CI when a PR exists.
61
+ 4. **Validate:** obtain verification + code-review evidence within `review_budget`. Each
62
+ lane appends a tracked `reviews.md` record in one of these exact forms:
63
+
64
+ ```text
65
+ <!-- wp:goal-validation {"kind":"verify","reviewer":"<identity>","artifact":"<tracked-path>"} -->
66
+ <!-- wp:goal-validation {"kind":"code-review","reviewer":"<different-identity>","artifact":"<tracked-path>"} -->
67
+ ```
68
+
69
+ 5. **Land:** require green PR checks, complete the blueprint in the same PR, merge, and
70
+ run owner cleanup.
71
+ 6. **Complete:** stop only when `wp_ultragoal_run` records terminal evidence.
72
+
73
+ Resume from durable state after interruption. Obey `WP_ULTRAGOAL_DISABLE=1`,
74
+ iteration/error/validation caps, and repository ownership. Never self-approve, directly
75
+ mark tasks done, bypass evidence, push to main, or increase timeouts (keep every loop bounded and never increase timeouts). After every phase
76
+ transition recorded by `wp ultragoal run`, obtain a fresh OpenCode Go outside review
77
+ before treating the milestone as closed (see Outside-voice above and the `ultragoal` skill).