@webpresso/plugin-antigravity 0.0.0-stage → 0.0.17

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 (43) hide show
  1. package/LICENSE +104 -0
  2. package/bin/wp +276 -0
  3. package/hooks.json +54 -0
  4. package/mcp_config.json +11 -0
  5. package/package.json +37 -3
  6. package/plugin-skill-ownership.json +105 -0
  7. package/plugin.json +11 -0
  8. package/skills/ai-deslop/SKILL.md +96 -0
  9. package/skills/antigravity/SKILL.md +52 -0
  10. package/skills/autopilot/SKILL.md +82 -0
  11. package/skills/autoresearch/SKILL.md +49 -0
  12. package/skills/best-practice-research/SKILL.md +102 -0
  13. package/skills/browse/SKILL.md +25 -0
  14. package/skills/claude/SKILL.md +52 -0
  15. package/skills/codex/SKILL.md +52 -0
  16. package/skills/deep-interview/LICENSE.txt +28 -0
  17. package/skills/deep-interview/SKILL.md +270 -0
  18. package/skills/deep-research/SKILL.md +259 -0
  19. package/skills/delivery-program/SKILL.md +62 -0
  20. package/skills/design-review/SKILL.md +26 -0
  21. package/skills/devex-review/SKILL.md +28 -0
  22. package/skills/fix/SKILL.md +218 -0
  23. package/skills/handoff/SKILL.md +99 -0
  24. package/skills/hooks-doctor/SKILL.md +153 -0
  25. package/skills/investigate/SKILL.md +83 -0
  26. package/skills/lore-protocol/SKILL.md +84 -0
  27. package/skills/opencode-go/SKILL.md +52 -0
  28. package/skills/plan-ceo-review/SKILL.md +27 -0
  29. package/skills/plan-design-review/SKILL.md +27 -0
  30. package/skills/plan-devex-review/SKILL.md +19 -0
  31. package/skills/plan-eng-review/SKILL.md +24 -0
  32. package/skills/plan-refine/SKILL.md +122 -0
  33. package/skills/plan-refine/references/full-methodology.md +654 -0
  34. package/skills/ralplan/SKILL.md +196 -0
  35. package/skills/team/SKILL.md +121 -0
  36. package/skills/tech-debt/SKILL.md +95 -0
  37. package/skills/testing-philosophy/SKILL.md +53 -0
  38. package/skills/testing-philosophy/references/full-testing-philosophy.md +519 -0
  39. package/skills/tooling-friction/SKILL.md +234 -0
  40. package/skills/tph/SKILL.md +35 -0
  41. package/skills/ultragoal/SKILL.md +304 -0
  42. package/skills/verify/SKILL.md +399 -0
  43. package/README.md +0 -3
@@ -0,0 +1,218 @@
1
+ ---
2
+ type: skill
3
+ slug: fix
4
+ title: Fix
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [verify, testing-philosophy]
9
+ created: "2026-05-13"
10
+ last_reviewed: "2026-07-21"
11
+ name: fix
12
+ description: "Root-cause fix (investigate first if proof missing). Use for fix, blockers, root cause not symptom."
13
+ argument-hint: '<target> where target is: file|symptom|error|test|"free-text description"'
14
+ ---
15
+
16
+ # Fix Command
17
+
18
+ ## Use when (freeform)
19
+
20
+ - "fix", "root cause not symptom", "blockers", "pre-existing issue"
21
+ - "tooling inefficiency", "MCP not bin/wp", "hook resistance" (bounded — see opportunistic budget)
22
+ - diagnosis already done or `investigate` will run inline first
23
+
24
+ Fix the issue at its root, future-proof, aligned with repo philosophy.
25
+
26
+ **Arguments**: $ARGUMENTS
27
+
28
+ This command turns "please fix it well" into an enforceable workflow: diagnose
29
+ first, repair at the owner, prove the repair, and escalate to `/verify` when
30
+ the blast radius is broader than a local fix.
31
+
32
+ ## Tooling map
33
+
34
+ | Need | Prefer |
35
+ | ---------------------- | ------------------------------------------------------------------ |
36
+ | Reproduce / large logs | `session_execute`, `session_batch_execute`, `session_execute_file` |
37
+ | Recall prior evidence | `session_search`, `session_restore`, `session_retrieve` |
38
+ | Capture decisions | `session_capture` (do not paste full reports back as user text) |
39
+ | Scoped proof | `test`, `lint`, `typecheck`, or `qa` |
40
+ | Audits | `audit` / `audits` |
41
+ | Worktree isolation | `blueprint_put` / `worktree` — never thrash primary checkout |
42
+ | PR follow-up | `pr_status`, `pr_upsert` when landing the fix |
43
+
44
+ ## Non-negotiable invariants
45
+
46
+ 1. **Root cause, not symptom.** Trace the failure to the invariant that actually broke. Do not patch callers when the owner is fixable.
47
+ 2. **Loud failures, no silent fallbacks.** No default shims, sentinel returns, or catch-and-continue behavior that hides missing config, bad state, or broken boundaries.
48
+ 3. **Use the repo's real execution surface.** Prefer wp MCP tools and repo wrappers over host Bash for search/test/lint. Use bounded session-memory paths for large output.
49
+ 4. **Regression proof is mandatory.** Add or strengthen a test or other reliable proof that would fail against the old behavior.
50
+ 5. **Raising timeouts is not a fix.** If a timeout fires, investigate the bottleneck. Only raise a bound when the repo already documents that workload and you can cite measurement.
51
+ 6. **Zero suppressions, zero papering over.** No lint disables, ts-ignore, compat aliases, or "temporary" branches to sneak the fix through.
52
+ 7. **Minimal correct diff.** Update every consumer of a changed contract in the same change, but do not bundle unrelated cleanup.
53
+ 8. **Primary checkout is sacred.** If HEAD is detached, primary is dirty with unrelated work, or you are not on a managed worktree for non-trivial edits → **stop** and move to `worktree` / blueprint owner. Never leave the primary checkout broken.
54
+
55
+ ## Opportunistic fix budget (when called from ultragoal / autopilot)
56
+
57
+ - At most **`fix_budget` (default 1)** pre-existing issues per controller phase.
58
+ - Each must have: named invariant, failing proof, owning path.
59
+ - If the repair needs its own blueprint or expands epic scope → **handoff backlog**, do not inline.
60
+ - Additional discoveries: list in the final report; do not thrash.
61
+ - **Tooling / harness findings** ("fix inefficiency you come across", MCP vs shell,
62
+ hook thrash) honor the same budget. Excess → record via the `tech-debt` skill
63
+ (or backlog handoff); do not expand the current epic unbounded.
64
+ - Prefer wp MCP tools and session-memory tools over the `wp` CLI / raw shell for
65
+ quality and discovery paths (see tooling map).
66
+
67
+ ## Protocol
68
+
69
+ ### Step 0a — Worktree preflight
70
+
71
+ Before editing: confirm you are on a managed worktree or an explicitly allowed branch.
72
+ If the primary checkout is dirty/detached with unrelated state, stop and isolate first.
73
+
74
+ ### Step 0 — Run the investigate phase when evidence is missing
75
+
76
+ Before editing, check whether the current context already contains all of the
77
+ following:
78
+
79
+ - a named root-cause hypothesis
80
+ - a failing proof tied to that hypothesis
81
+ - the owning boundary that should be repaired
82
+
83
+ If any of those are missing, run the `investigate` phase inline first:
84
+
85
+ - reproduce or capture the failure
86
+ - read the full error site and one nearby working pattern
87
+ - disconfirm cheap alternative explanations
88
+ - produce failing proof
89
+ - stop only when you can name the broken invariant and owner
90
+
91
+ Do not skip this phase because the fix "looks obvious". If the evidence is not
92
+ there, the investigation work is part of `fix`.
93
+
94
+ ### Step 1 — Reproduce and name the broken invariant
95
+
96
+ - Run the exact command, test, or user flow that surfaces the failure.
97
+ - Capture the evidence that matters: error text, file:line, exit code, failing assertion, or log path.
98
+ - Read enough surrounding code to say the broken invariant in one sentence.
99
+ - If the issue is nondeterministic, gather evidence until you can describe the slow/flaky/failing case without guessing.
100
+
101
+ **Prove the mechanism before naming it.** A cause that merely explains the
102
+ symptom is a hypothesis, not a finding. Run the failing thing with the candidate
103
+ values and read what it actually did; trace the claim to the code that executes,
104
+ not the code whose name matches the theory. If you cannot reproduce it, label it
105
+ unverified and keep investigating — do not write it into a plan, commit, or
106
+ report as the cause.
107
+
108
+ **When a cause is disproved, go back to the command, not to the next story.**
109
+ Substituting another plausible explanation without new observation is how one
110
+ dead route gets three confident, wrong diagnoses. If your second and third
111
+ explanations are still unobserved, you have not reproduced the failure yet.
112
+ Related: `catalog/agent/rules/evidence-discipline.md` § 6.
113
+
114
+ If the "issue" is actually several unrelated failures, stop and ask which one to fix first.
115
+
116
+ ### Step 2 — Decide where the fix belongs
117
+
118
+ State briefly:
119
+
120
+ - the broken invariant
121
+ - the owner that should enforce it
122
+ - whether the fix changes a public contract
123
+ - which direct consumers must change in the same diff
124
+
125
+ If the blast radius is broader than the owner + direct consumers, keep going with `/fix` only if the change is still one coherent repair. If the work becomes a broader hardening pass, plan a `/verify` handoff before claiming done.
126
+
127
+ ### Step 3 — Write failing proof first when feasible
128
+
129
+ - For a reproducible bug, write or strengthen the smallest regression test that fails on the old behavior.
130
+ - Verify that it fails for the right reason before changing production code.
131
+ - If test-first is genuinely infeasible at that boundary, record why and create the nearest reliable proof instead (for example a deterministic integration reproduction, fixture, or logged command).
132
+
133
+ Do not keep production code written before the test as "reference". If you wrote code first, throw it away and restart from the failing proof.
134
+
135
+ ### Step 4 — Implement the minimal correct fix
136
+
137
+ - Edit the file or module that owns the invariant.
138
+ - Update every changed consumer in the same diff. No half-migrations.
139
+ - Delete compat shims, dead aliases, and TODO branches made obsolete by the repair.
140
+ - Keep complexity down by extracting helpers instead of nesting conditionals.
141
+
142
+ ### Step 5 — Run scoped verification
143
+
144
+ Run the narrowest checks that prove the repaired behavior on the real repo surface:
145
+
146
+ - `test` / targeted tests for the repaired path
147
+ - `lint` / `typecheck` for changed surfaces
148
+ - `qa` only when the blast radius needs the bookend
149
+ - Before push: start `ci_preflight`, then poll `ci_preflight_wait` with
150
+ its run ID until terminal success (use global `wp ci-preflight` only when MCP
151
+ is unavailable). Run it after the final commit and do not edit or commit again
152
+ before pushing: terminal success records the exact-state receipt checked by pre-push.
153
+ Do not use remote CI re-runs as the primary fix loop (`ci-cost-local-first`).
154
+
155
+ Rules:
156
+
157
+ - Prefer wp MCP tools over raw host Bash.
158
+ - Reuse fresh logs / session-memory indexed output; do not re-run long commands just to re-read.
159
+ - Read the exit code and summary before making a claim.
160
+ - Never `git push --no-verify` to land an unproven fix.
161
+
162
+ Escalate to `/verify <target>` (local) or `/verify <target> --merge-ready` when any of these are true:
163
+
164
+ - the fix crosses packages
165
+ - the fix changes a public or shared contract
166
+ - the fix touched docs, plans, blueprints, or repo SSOT
167
+ - the fix needs dead-code / compat / broad regression review before claiming done
168
+
169
+ If the repaired behavior is already green but the diff still needs a bounded
170
+ cleanup pass, use `ai-deslop` before the final verify handoff.
171
+
172
+ ### Tool recovery and delivery intent
173
+
174
+ - Discover the managed owner's current identity with `blueprint_projects`
175
+ using its absolute `cwd`; pass the returned project ID and matching checkout
176
+ to session tools. A blueprint ID is not a project ID.
177
+ - If quality tooling refuses stale or cross-checkout execution, follow its
178
+ checkout-local recovery. Attach the escape to the actual command:
179
+ `cd <owner> && WP_MCP_UNAVAILABLE=1 wp test --files <test>`.
180
+ Attaching it to `cd` does not set it for `wp`.
181
+ - For external tools whose schema requires exactly one of command or WebSocket
182
+ input, omit the unused option entirely; an empty object still supplies it.
183
+ - When the request includes merge/landing, continue through verification,
184
+ exact-head delivery, PR merge, and managed-owner cleanup. A handoff or
185
+ continuation summary does not satisfy that request. If a required gate is
186
+ blocked, report its concrete evidence and remaining action; preserve the
187
+ persisted completion requirements. Run additional named stages only when
188
+ the user's request actually includes them.
189
+
190
+ ### Step 6 — Report with evidence
191
+
192
+ Keep it short:
193
+
194
+ - what invariant broke
195
+ - how the change restores it
196
+ - what proof ran (tests, commands, log paths, exit codes)
197
+ - adjacent issues noticed but intentionally not fixed
198
+
199
+ ## Done looks like
200
+
201
+ - [ ] Root cause named in one sentence
202
+ - [ ] Fix applied at the owning boundary
203
+ - [ ] Regression proof fails against the old behavior
204
+ - [ ] Minimal code change restores the invariant
205
+ - [ ] Scoped verification passed on the changed surface
206
+ - [ ] `/verify` handoff used when blast radius exceeded a local fix
207
+ - [ ] Report cites evidence, not intent
208
+
209
+ ## Anti-patterns this command refuses
210
+
211
+ - Fixing the nearest symptom while leaving the real invariant broken
212
+ - Catching an error and returning a sentinel to "keep things moving"
213
+ - Raising a timeout, retry count, or polling interval instead of finding the bottleneck
214
+ - Adding a deprecated alias instead of updating consumers
215
+ - Introducing `any`, suppressions, or lint disables to unblock the fix
216
+ - Bundling unrelated refactors with the repair
217
+ - Claiming done from intuition, partial output, or another agent's success message
218
+ - Writing a planning/doc artifact when the user asked for a fix
@@ -0,0 +1,99 @@
1
+ ---
2
+ type: skill
3
+ slug: handoff
4
+ title: Handoff
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: [ultragoal, team, plan-refine, fix, verify]
9
+ created: "2026-08-03"
10
+ last_reviewed: "2026-08-03"
11
+ name: handoff
12
+ description: "Cross-session handoff via session_context. Use for continue, take over, resume other host."
13
+ argument-hint: "[--host <claude|codex|opencode>] [session-id|brief]"
14
+ ---
15
+
16
+ # Handoff
17
+
18
+ Produce a **context-light continuation** for another agent, host, or fresh
19
+ session. Do **not** paste full transcripts.
20
+
21
+ ## Use when (freeform)
22
+
23
+ - "give me a continuation prompt", "take over where you left off"
24
+ - "resume", "continue from other host", "hand off to Codex/Claude"
25
+ - cross-session or cross-worktree continuity without history walls
26
+
27
+ ## Tooling map
28
+
29
+ | Need | Prefer |
30
+ | ---------------------- | -------------------------------------------------------------------------- |
31
+ | Capture decisions | `session_capture` |
32
+ | Context-light manifest | `session_context` (required for subagents) |
33
+ | Prior evidence | `session_search` / `session_retrieve` / `session_restore` |
34
+ | Other-host chat | `conversation_search` / `conversation_get` / `conversation_read` (bounded) |
35
+ | Ultragoal block | `ultragoal_handoff` (≤40 lines) when a controller is active |
36
+
37
+ ## Protocol
38
+
39
+ 1. **State the objective** in one sentence (what the next agent must finish).
40
+ 2. **Capture** short pointers via `session_capture`: done, blockers, decisions,
41
+ evidence refs (log paths, test commands, PR numbers) — not full reports.
42
+ 3. **Build** a bounded manifest with `session_context` (objective, constraints,
43
+ evidenceRefs, remainingSteps, validation, exclusions). Never copy parent history.
44
+ 4. **Optional cross-host:** resolve the conversation with conversation MCP tools;
45
+ read only a **bounded tail** (`maxMessages` / `maxBytes`). Prefer resume
46
+ commands from `conversation_get` over paste.
47
+ 5. **Emit ≤40 lines** covering:
48
+ - goal / non-goals
49
+ - done + evidence refs
50
+ - blockers
51
+ - next 3 concrete commands or skill invocations
52
+ - suggested next skill: `plan-refine` | `fix` | `verify` | `ultragoal` | `land`
53
+ 6. Stop. Do not implement the next phase inside handoff unless the user
54
+ explicitly switched the task to execution.
55
+
56
+ ## Anti-patterns
57
+
58
+ - Pasting full transcripts or multi-thousand-token "continuation prompts"
59
+ - Claiming resume without a session_context / capture pointer
60
+ - Expanding scope ("also fix everything else") without budgets
61
+ - Using handoff as a substitute for `investigate` / `fix` / `verify`
62
+
63
+ ## Done looks like
64
+
65
+ - [ ] ≤40-line handoff with evidence refs
66
+ - [ ] `session_context` (or capture ids) for the next agent
67
+ - [ ] Next skill named
68
+ - [ ] No transcript wall
69
+
70
+ ## Capped or paused host messaging
71
+
72
+ When the host messaging channel is capped or paused, the ≤40-line manifest IS
73
+ the delivery: the handoff built above carries objective, done, blockers, and
74
+ next steps even if no send lands — emit it once and treat it as sent. Include
75
+ the send-budget state (attempt count, last canary result) in the manifest
76
+ whenever the cap has been in play this session — the count's durable homes
77
+ are the outbox header and the `session_capture` record; re-read both on
78
+ resume. The leader's outbox anchor is durable in two homes: the
79
+ outbox file's own header and a `session_capture` record (`session_capture`
80
+ is registered in `src/mcp/tools/_names.ts`, implemented in
81
+ `src/mcp/tools/session-capture.ts`). When the coordinator incarnation changes,
82
+ re-anchor: write both homes plus the next handoff manifest — a recorded anchor
83
+ goes stale when the identity passes to a new session (observed 2026-10-31: a
84
+ memory-recorded live outbox path no longer existed). On the reader side, a
85
+ stale or dead anchor is not a wall: fall back to the next durable arbitration
86
+ source (`fleet_status` / blueprint task lists) and queues the staleness as
87
+ a blocker in the outbox or manifest; a control send is spent only when the
88
+ channel is open and a reserve slot remains, to surface the staleness. Before executing a resumed
89
+ or queued order, check durable state (the outbox, `fleet_status`,
90
+ blueprint task lists) for a newer arbitration — queued sends deliver late
91
+ and out of order. The manifest carries this check as a required line.
92
+ Queued orders in the manifest are one line each; if the queue would break
93
+ the ≤40-line cap, the manifest carries the count and the outbox path and
94
+ the orders stay in the outbox. Never route around a cap or
95
+ pause: no relays, no peer delegation, no new sessions, no schedulers, no
96
+ filesystem push-delivery to peers, no configuration changes, and no alternate
97
+ transport, tool, or uncapped/legacy send interface. The durable outbox is pull-read
98
+ state, not a route-around. Keep manifests context-light — do not paste full
99
+ transcripts.
@@ -0,0 +1,153 @@
1
+ ---
2
+ type: skill
3
+ slug: hooks-doctor
4
+ title: Hooks Doctor
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: []
9
+ created: "2026-05-07"
10
+ last_reviewed: "2026-11-01"
11
+ name: hooks-doctor
12
+ description: "Hook/plugin doctor for install health. Use for hook blocked, pretooluse, plugin broken."
13
+ argument-hint: "[--skip-mcp]"
14
+ allowed-tools:
15
+ - Bash
16
+ ---
17
+
18
+ # Hooks Doctor
19
+
20
+ Verify the webpresso plugin hooks installation is healthy. Run this first when:
21
+
22
+ - A hook seems not to be firing, is blocked, or PreToolUse denies unexpectedly
23
+ - The plugin was just installed or updated
24
+ - Claude Code can't find expected tools
25
+ - Any plugin integration issue arises
26
+
27
+ ## Running the Check
28
+
29
+ Run the doctor command directly:
30
+
31
+ ```
32
+ wp hooks doctor
33
+ ```
34
+
35
+ Or skip the MCP server check (for CI environments):
36
+
37
+ ```
38
+ wp hooks doctor --skip-mcp
39
+ ```
40
+
41
+ ## Interpreting Results
42
+
43
+ Each check prints `[x]` (pass) or `[ ]` (fail) with a detail line:
44
+
45
+ ```
46
+ [x] pretool-guard
47
+ [x] post-tool (lint-after-edit)
48
+ [x] stop (qa-changed-files)
49
+ [x] guard-switch
50
+ [x] sessionstart
51
+ [x] test-quality-check
52
+ [x] plugin.json integrity
53
+ [x] MCP server liveness: MCP server already running (sentinel found)
54
+ ```
55
+
56
+ ## Failure Remediation
57
+
58
+ | Check | Likely Cause | Fix |
59
+ | ------------------------------------------------ | ----------------------------------------------------------------- | ----------------------------------------------------------------- |
60
+ | `pretool-guard` / `post-tool` / etc. — not found | `wp run build` not run after install | `wp run build` |
61
+ | `pretool-guard` / etc. — not executable | `chmod +x` not persisted | Re-run `wp run prepare` or `wp run build` which runs `chmod-bins` |
62
+ | `plugin.json integrity` — missing | Claude or Antigravity adapter manifest absent from plugin package | Re-run `wp setup --host <host>` or reinstall the host plugin |
63
+ | `MCP server liveness` — timeout | MCP server cold-start too slow | Wait and retry, or run `wp hooks doctor --skip-mcp` |
64
+ | Any check — not found at `dist/esm/...` | Build artifacts missing | Run `wp run build` in the webpresso repo |
65
+
66
+ ### Updating the webpresso MCP server (monorepo authors)
67
+
68
+ `mcp` is **source-first**: in a checkout with TypeScript source the server loads
69
+ that source when it starts. After changing `src/mcp/**`, conversation catalog,
70
+ or pretool routing that MCP hosts must run:
71
+
72
+ 1. Reconnect webpresso MCP server in the agent host.
73
+ 2. Prove the refreshed server is serving the intended source.
74
+
75
+ No runtime rebuild is involved, and no `pkill` is needed — every launcher layer
76
+ owns its child's stdin, so a disconnect unwinds the whole chain. Chat-only
77
+ restart is still **not** enough: reconnect the server itself.
78
+
79
+ Use the host's named-server controls so only the webpresso server is closed and
80
+ started. Check the installed host version before using version-scoped controls.
81
+
82
+ - **Codex desktop:** Settings → MCP servers → select webpresso → **Restart**. The
83
+ in-composer `/mcp` view lists connected servers
84
+ ([host documentation](https://learn.chatgpt.com/docs/extend/mcp?surface=app);
85
+ host documentation verified 2026-10-17).
86
+ - **Claude Code:** `/mcp` → select webpresso → **Reconnect**. Use
87
+ `claude mcp list` to check the configured server; do not remove and re-add it.
88
+ Claude Code does not automatically reconnect local stdio servers
89
+ ([host documentation](https://code.claude.com/docs/en/mcp); host documentation
90
+ verified 2026-10-17).
91
+ - **OpenCode v2:** `/mcps` → select webpresso → **Disconnect**, then
92
+ **Connect**. If the OpenCode configuration changed, run `opencode reload`;
93
+ verify with `opencode mcp list` ([MCP
94
+ servers](https://dev.opencode.ai/v2/docs/mcp-servers/), [CLI
95
+ commands](https://dev.opencode.ai/v2/docs/cli/commands/); host documentation
96
+ verified 2026-10-17). These `dev.opencode.ai` paths sit on a preview domain
97
+ and can move; confirm the v2 path still resolves before following it.
98
+ - **Antigravity:** Preferences / Settings → Plugins → reload or toggle `wp` plugin,
99
+ or restart the Antigravity session. Verify with `wp hooks doctor` or `wp hooks status`.
100
+
101
+ After reconnecting, prove the loaded source rather than the connection:
102
+
103
+ 1. Call `tool_surface` with `detail: "diagnostic"`.
104
+ 2. Compare `details.diagnostic.live.sourceCommit` against the commit you expect
105
+ the checkout to be serving.
106
+ 3. Read `details.diagnostic.identity.status`, which is exactly one of `current`,
107
+ `restart_required`, `setup_required`, or `unknown`. The wrapper's
108
+ `passed: true` only means a response was built — it is **not** proof of
109
+ current identity.
110
+
111
+ If the source commit differs, or the status is `restart_required` or
112
+ `setup_required`, reconnect again or follow `details.diagnostic.identity.reason`.
113
+ If the status is `unknown`, keep that uncertainty: a source-distinguishing smoke
114
+ call can corroborate behavior but does not make the identity current. A fresh
115
+ chat is not a refresh. Reserve quitting and reopening the host for the one-time
116
+ legacy-chain upgrade below, and never kill unrelated processes.
117
+
118
+ Managed `wp hook` and `wp hooks doctor|status|dispatch` commands are
119
+ source-authoritative and require no post-merge runtime rebuild. Existing
120
+ managed installations run exact `wp sync`, then rerun `wp hooks doctor` or
121
+ `wp hooks status` until the legacy-projection warning is absent. Packed
122
+ consumers continue to use the shipped compiled runtime and repair/reinstall that
123
+ artifact if it is missing.
124
+
125
+ **One-time upgrade step:** chains started before the source-first lane shipped
126
+ ran no stdin relay, so quit and reopen each MCP host once to retire them. A
127
+ `pkill` pattern is not a substitute — it misses source-launched chains and can
128
+ kill another session's server.
129
+
130
+ **Offline shell allowlist** when webpresso MCP tools are unavailable (must
131
+ match `dev-routing-bounded-read.ts`):
132
+
133
+ ```text
134
+ rg --no-config -n pattern path 2>/dev/null | head -c 65536
135
+ head -n 200 path/to/file
136
+ git log --oneline -n 50
137
+ git show --stat HEAD
138
+ git diff --stat
139
+ ```
140
+
141
+ After fixing, re-run `wp hooks doctor` to confirm.
142
+
143
+ ## How It Works
144
+
145
+ The doctor runs five categories of checks:
146
+
147
+ 1. **Bin existence** — each hook binary exists at the expected `dist/esm/hooks/...` path
148
+ 2. **Executable bit** — bins have execute permission (skipped on Windows)
149
+ 3. **stdin response** — interactive hooks (`pretool-guard`, `guard-switch`, `sessionstart`) respond to `{}` input with valid JSON and exit 0; fire-and-forget hooks (`lint-after-edit`, `qa-changed-files`) exit 0
150
+ 4. **plugin.json integrity** — adapter manifest exists, has required fields, and all referenced bins exist on disk
151
+ 5. **MCP server liveness** — spawns the MCP server and sends a `tools/list` JSON-RPC request; times out at 5s (soft-fail — warning only, does not fail the overall check)
152
+
153
+ If `isMcpReady()` detects a live MCP sentinel, the MCP check fast-passes without spawning.
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: investigate
3
+ description: "Root-cause investigation workflow: reproduce, isolate, prove, and hand off the minimal repair scope."
4
+ license: MIT
5
+ ---
6
+
7
+ # Investigate
8
+
9
+ Use this skill when the task is to understand a bug, failure, regression,
10
+ flaky behavior, or confusing symptom before editing code.
11
+
12
+ ## Boundary
13
+
14
+ - `investigate` owns diagnosis, reproduction, hypothesis testing, and proof.
15
+ - `fix` owns repair. If the user asked to fix the problem and root-cause
16
+ evidence is still missing, `fix` should run this phase inline first.
17
+ - Stop once you can name the broken invariant, show the failing proof, and
18
+ point at the owner that should be repaired.
19
+
20
+ ## Tooling map
21
+
22
+ | Need | Prefer |
23
+ | ---------------------- | ------------------------------------------------------- |
24
+ | Reproduce / large logs | `session_execute`, `session_batch_execute` |
25
+ | Large files | `session_execute_file` |
26
+ | Prior continuity | `session_search`, `session_restore`, `session_retrieve` |
27
+ | Capture findings | `session_capture` (short pointer, not full paste-back) |
28
+ | Proof runs | `test`, `qa`, `lint`, `typecheck` |
29
+ | Code search/read | host Grep/Read first; avoid shell-as-IDE |
30
+
31
+ ## Workflow
32
+
33
+ 1. Reproduce or capture the failure.
34
+ - Run the exact failing command or trace the exact user path (prefer `session_execute`).
35
+ - Keep the evidence that matters: error text, failing assertion, exit code,
36
+ log path, or boundary mismatch.
37
+ 2. Read the whole boundary.
38
+ - Inspect the full error site, the owning module, and one nearby working
39
+ pattern.
40
+ - Do not edit code yet.
41
+ 3. State the root-cause hypothesis.
42
+ - Name the broken invariant in one sentence.
43
+ - Name the owner that should enforce it.
44
+ - Separate facts from guesses.
45
+ - **Every cause must carry the observation that proved it**: the command you
46
+ ran, its output, and the code path that produced it. A cause you have not
47
+ executed against the failing case is a guess and must be labelled as one.
48
+ 4. Disconfirm cheap alternatives.
49
+ - Test the obvious competing explanations before settling on one cause.
50
+ - Add temporary diagnostics only when needed, and remove them after one pass.
51
+ - **When a cause is disproved, return to the reproduction rather than
52
+ replacing it with the next plausible story.** Two or three confident
53
+ explanations in a row, none observed, means the failure has not been
54
+ reproduced yet — go back to step 1.
55
+ - A test fixture, capability object, or recorded tool output that asserts
56
+ behaviour is the weakest link: confirm at least one path against the real
57
+ binary, module, or service it stands in for.
58
+ - Related: `catalog/agent/rules/evidence-discipline.md` § 6.
59
+ 5. Produce failing proof.
60
+ - Prefer a targeted failing test.
61
+ - If test-first is impossible at this boundary, use the nearest deterministic
62
+ reproduction instead.
63
+ 6. Hand off the minimal repair scope.
64
+ - List the owner, direct consumers, and the smallest safe verification set.
65
+ - If the issue is broader than one coherent repair, say so before any edit.
66
+
67
+ ## Output
68
+
69
+ Return:
70
+
71
+ - reproduced symptom
72
+ - broken invariant
73
+ - root-cause hypothesis status: confirmed / likely / blocked
74
+ - failing proof
75
+ - owning file or boundary
76
+ - recommended next step: `fix`, `verify`, or a scoped blocker
77
+
78
+ ## Anti-patterns
79
+
80
+ - Editing before you can name the invariant
81
+ - Treating a stack trace as proof of root cause
82
+ - Hiding uncertainty behind broad "probably X" explanations
83
+ - Expanding a debugging pass into cleanup or refactor work
@@ -0,0 +1,84 @@
1
+ ---
2
+ type: skill
3
+ slug: lore-protocol
4
+ title: lore-protocol
5
+ status: active
6
+ scope: repo
7
+ applies_to: [agents]
8
+ related: []
9
+ created: "2026-05-07"
10
+ last_reviewed: "2026-05-07"
11
+ name: lore-protocol
12
+ description: "Manual Lore commit-message trailers with wp audit commit-message; no hook enforcement because PRs squash."
13
+ ---
14
+
15
+ # lore-protocol
16
+
17
+ Use Lore commit-message trailers manually with `wp audit commit-message`. Hook enforcement is intentionally not installed because this repo uses squash commits.
18
+
19
+ Lore is a lightweight protocol for embedding decision context directly into
20
+ commit messages — constraints, rejected alternatives, confidence, and
21
+ forward-looking directives — so future engineers understand _why_ a change
22
+ was made, not just _what_ changed.
23
+
24
+ ## Quick start
25
+
26
+ ```bash
27
+ # Validate a commit message file (hard-fail mode — exits non-zero on violations)
28
+ wp audit commit-message --message-file .git/COMMIT_EDITMSG --require-lore
29
+
30
+ # Soft-warn mode — emits warnings but always exits 0 (adoption ramp)
31
+ wp audit commit-message --message-file .git/COMMIT_EDITMSG --lore-warn
32
+
33
+ # Opt in per-commit by adding [lore] to the subject line:
34
+ # feat(auth): prevent silent session drops [lore]
35
+ ```
36
+
37
+ ## Hook policy
38
+
39
+ Lore trailers are advisory/manual. Do not install commit-msg or pre-push hooks for Lore enforcement; squash commits are the durable review boundary.
40
+
41
+ ## Trailer format
42
+
43
+ ```
44
+ <intent line: why the change was made, not what changed>
45
+
46
+ <body: narrative context — constraints, approach rationale>
47
+
48
+ Constraint: <external constraint that shaped the decision>
49
+ Rejected: <alternative considered> | <reason for rejection>
50
+ Confidence: <low|medium|high>
51
+ Scope-risk: <narrow|moderate|broad>
52
+ Directive: <forward-looking warning for future modifiers>
53
+ Tested: <what was verified>
54
+ Not-tested: <known gaps in verification>
55
+ ```
56
+
57
+ ## Required trailers (for `--require-lore` or `[lore]` subject tag)
58
+
59
+ | Trailer | Required | Allowed values |
60
+ | -------------------------------------------- | ------------ | -------------------------------- |
61
+ | `Confidence:` | yes | `low`, `medium`, `high` |
62
+ | `Constraint:` or `Rejected:` or `Directive:` | at least one | free text |
63
+ | `Scope-risk:` | optional | `narrow`, `moderate`, `broad` |
64
+ | `Reversibility:` | optional | `clean`, `messy`, `irreversible` |
65
+ | `Tested:` | optional | free text |
66
+ | `Not-tested:` | optional | free text |
67
+ | `Related:` | optional | free text |
68
+
69
+ ## Example commit
70
+
71
+ ```
72
+ Prevent silent session drops during long-running operations
73
+
74
+ The auth service returns inconsistent status codes on token
75
+ expiry, so the interceptor catches all 4xx responses.
76
+
77
+ Constraint: Auth service does not support token introspection
78
+ Rejected: Extend token TTL to 24h | security policy violation
79
+ Confidence: high
80
+ Scope-risk: narrow
81
+ Directive: Error handling is broad — do not narrow without verifying upstream behavior
82
+ Tested: Single expired token refresh (unit)
83
+ Not-tested: Auth service cold-start > 500ms behavior
84
+ ```