@oxgeneral/orch 1.0.7 → 1.0.8

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 (70) hide show
  1. package/dist/{App-LEVUTWQN.js → App-5OVBVRCD.js} +1 -1
  2. package/dist/{agent-Q34L27AY.js → agent-SI4JF5MV.js} +1 -1
  3. package/dist/{agent-shop-D2RS4BZK.js → agent-shop-JHDTCWCD.js} +1 -1
  4. package/dist/chunk-3AXNSYCM.js +2 -0
  5. package/dist/{chunk-BCPUTULS.js → chunk-HWEMBO36.js} +83 -54
  6. package/dist/chunk-J7ITYXE6.js +116 -0
  7. package/dist/chunk-J7ITYXE6.js.map +1 -0
  8. package/dist/{chunk-4TDXD3LA.js → chunk-SWNSNPBO.js} +12 -2
  9. package/dist/chunk-SWNSNPBO.js.map +1 -0
  10. package/dist/chunk-U2JVMD2G.js +66 -0
  11. package/dist/chunk-U2JVMD2G.js.map +1 -0
  12. package/dist/{chunk-EH3HRQP4.js → chunk-W3J7CURM.js} +8 -116
  13. package/dist/chunk-W3J7CURM.js.map +1 -0
  14. package/dist/chunk-ZMLF5HI5.js +11 -0
  15. package/dist/cli.js +1 -1
  16. package/dist/container-SEIWOLHY.js +4 -0
  17. package/dist/doctor-Q3GHJNZL.js +2 -0
  18. package/dist/index.d.ts +32 -1
  19. package/dist/index.js +12 -5
  20. package/dist/index.js.map +1 -1
  21. package/dist/init-D4356W7G.js +73 -0
  22. package/dist/orchestrator-G3Y7THMG.js +6 -0
  23. package/dist/{orchestrator-XPEMMBOO.js.map → orchestrator-G3Y7THMG.js.map} +1 -1
  24. package/dist/{orchestrator-JOTMB5XT.js → orchestrator-GQLNLOXB.js} +8 -4
  25. package/dist/{org-WAK3CDPG.js → org-KLYK6MMJ.js} +1 -1
  26. package/dist/skill-loader-IGRIELEM.js +9 -0
  27. package/dist/skill-loader-RHCFIK74.js +4 -0
  28. package/dist/skill-loader-RHCFIK74.js.map +1 -0
  29. package/dist/{task-QFLIIRKZ.js → task-3R2IX4HM.js} +1 -1
  30. package/dist/{tui-BJHZBCIR.js → tui-47O2OCKC.js} +1 -1
  31. package/dist/{workspace-manager-5EYCMAEO.js → workspace-manager-RH24FSNT.js} +4 -3
  32. package/dist/workspace-manager-RH24FSNT.js.map +1 -0
  33. package/dist/workspace-manager-VJ4FN5PJ.js +3 -0
  34. package/package.json +1 -1
  35. package/skills/library/autoplan.md +315 -0
  36. package/skills/library/benchmark.md +242 -0
  37. package/skills/library/browse.md +266 -0
  38. package/skills/library/canary.md +248 -0
  39. package/skills/library/careful.md +42 -0
  40. package/skills/library/codex.md +431 -0
  41. package/skills/library/design-consultation.md +367 -0
  42. package/skills/library/design-review.md +744 -0
  43. package/skills/library/document-release.md +365 -0
  44. package/skills/library/freeze.md +60 -0
  45. package/skills/library/guard.md +55 -0
  46. package/skills/library/investigate.md +171 -0
  47. package/skills/library/land-and-deploy.md +636 -0
  48. package/skills/library/office-hours.md +746 -0
  49. package/skills/library/plan-ceo-review.md +1029 -0
  50. package/skills/library/plan-design-review.md +428 -0
  51. package/skills/library/plan-eng-review.md +420 -0
  52. package/skills/library/qa-only.md +388 -0
  53. package/skills/library/qa.md +766 -0
  54. package/skills/library/retro.md +532 -0
  55. package/skills/library/review.md +421 -0
  56. package/skills/library/setup-browser-cookies.md +86 -0
  57. package/skills/library/setup-deploy.md +211 -0
  58. package/skills/library/ship.md +1018 -0
  59. package/skills/library/unfreeze.md +31 -0
  60. package/skills/library/upgrade.md +220 -0
  61. package/skills/orch/SKILL.md +138 -0
  62. package/dist/chunk-4TDXD3LA.js.map +0 -1
  63. package/dist/chunk-EH3HRQP4.js.map +0 -1
  64. package/dist/chunk-WVJTXBPL.js +0 -11
  65. package/dist/container-FXUUV6PP.js +0 -4
  66. package/dist/doctor-P2J6VAUX.js +0 -2
  67. package/dist/init-PTAYCSMO.js +0 -53
  68. package/dist/orchestrator-XPEMMBOO.js +0 -6
  69. package/dist/workspace-manager-5EYCMAEO.js.map +0 -1
  70. package/dist/workspace-manager-XKOZ5WM6.js +0 -3
@@ -0,0 +1,365 @@
1
+ ---
2
+ name: document-release
3
+ version: 1.0.0
4
+ description: |
5
+ Post-ship documentation update. Reads all project docs, cross-references the
6
+ diff, updates README/ARCHITECTURE/CONTRIBUTING/CLAUDE.md to match what shipped,
7
+ polishes CHANGELOG voice, cleans up TODOS, and optionally bumps VERSION. Use when
8
+ asked to "update the docs", "sync documentation", or "post-ship docs".
9
+ Proactively suggest after a PR is merged or code is shipped.
10
+ ---
11
+
12
+ ## Step 0: Detect base branch
13
+
14
+ Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
15
+
16
+ 1. Check if a PR already exists for this branch:
17
+ `gh pr view --json baseRefName -q .baseRefName`
18
+ If this succeeds, use the printed branch name as the base branch.
19
+
20
+ 2. If no PR exists (command fails), detect the repo's default branch:
21
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
22
+
23
+ 3. If both commands fail, fall back to `main`.
24
+
25
+ Print the detected base branch name. In every subsequent `git diff`, `git log`,
26
+ `git fetch`, `git merge`, and `gh pr create` command, substitute the detected
27
+ branch name wherever the instructions say "the base branch."
28
+
29
+ ---
30
+
31
+ # Document Release: Post-Ship Documentation Update
32
+
33
+ You are running the `/document-release` workflow. This runs **after `/ship`** (code committed, PR
34
+ exists or about to exist) but **before the PR merges**. Your job: ensure every documentation file
35
+ in the project is accurate, up to date, and written in a friendly, user-forward voice.
36
+
37
+ You are mostly automated. Make obvious factual updates directly. Stop and ask only for risky or
38
+ subjective decisions.
39
+
40
+ **Only stop for:**
41
+ - Risky/questionable doc changes (narrative, philosophy, security, removals, large rewrites)
42
+ - VERSION bump decision (if not already bumped)
43
+ - New TODOS items to add
44
+ - Cross-doc contradictions that are narrative (not factual)
45
+
46
+ **Never stop for:**
47
+ - Factual corrections clearly from the diff
48
+ - Adding items to tables/lists
49
+ - Updating paths, counts, version numbers
50
+ - Fixing stale cross-references
51
+ - CHANGELOG voice polish (minor wording adjustments)
52
+ - Marking TODOS complete
53
+ - Cross-doc factual inconsistencies (e.g., version number mismatch)
54
+
55
+ **NEVER do:**
56
+ - Overwrite, replace, or regenerate CHANGELOG entries — polish wording only, preserve all content
57
+ - Bump VERSION without asking — always use AskUserQuestion for version changes
58
+ - Use `Write` tool on CHANGELOG.md — always use `Edit` with exact `old_string` matches
59
+
60
+ ---
61
+
62
+ ## Step 1: Pre-flight & Diff Analysis
63
+
64
+ 1. Check the current branch. If on the base branch, **abort**: "You're on the base branch. Run from a feature branch."
65
+
66
+ 2. Gather context about what changed:
67
+
68
+ ```bash
69
+ git diff <base>...HEAD --stat
70
+ ```
71
+
72
+ ```bash
73
+ git log <base>..HEAD --oneline
74
+ ```
75
+
76
+ ```bash
77
+ git diff <base>...HEAD --name-only
78
+ ```
79
+
80
+ 3. Discover all documentation files in the repo:
81
+
82
+ ```bash
83
+ find . -maxdepth 2 -name "*.md" -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.orch/*" -not -path "./.context/*" | sort
84
+ ```
85
+
86
+ 4. Classify the changes into categories relevant to documentation:
87
+ - **New features** — new files, new commands, new skills, new capabilities
88
+ - **Changed behavior** — modified services, updated APIs, config changes
89
+ - **Removed functionality** — deleted files, removed commands
90
+ - **Infrastructure** — build system, test infrastructure, CI
91
+
92
+ 5. Output a brief summary: "Analyzing N files changed across M commits. Found K documentation files to review."
93
+
94
+ ---
95
+
96
+ ## Step 2: Per-File Documentation Audit
97
+
98
+ Read each documentation file and cross-reference it against the diff. Use these generic heuristics
99
+ (adapt to whatever project you're in — these are generic, not project-specific):
100
+
101
+ **README.md:**
102
+ - Does it describe all features and capabilities visible in the diff?
103
+ - Are install/setup instructions consistent with the changes?
104
+ - Are examples, demos, and usage descriptions still valid?
105
+ - Are troubleshooting steps still accurate?
106
+
107
+ **ARCHITECTURE.md:**
108
+ - Do ASCII diagrams and component descriptions match the current code?
109
+ - Are design decisions and "why" explanations still accurate?
110
+ - Be conservative — only update things clearly contradicted by the diff. Architecture docs
111
+ describe things unlikely to change frequently.
112
+
113
+ **CONTRIBUTING.md — New contributor smoke test:**
114
+ - Walk through the setup instructions as if you are a brand new contributor.
115
+ - Are the listed commands accurate? Would each step succeed?
116
+ - Do test tier descriptions match the current test infrastructure?
117
+ - Are workflow descriptions (dev setup, contributor mode, etc.) current?
118
+ - Flag anything that would fail or confuse a first-time contributor.
119
+
120
+ **CLAUDE.md / project instructions:**
121
+ - Does the project structure section match the actual file tree?
122
+ - Are listed commands and scripts accurate?
123
+ - Do build/test instructions match what's in package.json (or equivalent)?
124
+
125
+ **Any other .md files:**
126
+ - Read the file, determine its purpose and audience.
127
+ - Cross-reference against the diff to check if it contradicts anything the file says.
128
+
129
+ For each file, classify needed updates as:
130
+
131
+ - **Auto-update** — Factual corrections clearly warranted by the diff: adding an item to a
132
+ table, updating a file path, fixing a count, updating a project structure tree.
133
+ - **Ask user** — Narrative changes, section removal, security model changes, large rewrites
134
+ (more than ~10 lines in one section), ambiguous relevance, adding entirely new sections.
135
+
136
+ ---
137
+
138
+ ## Step 3: Apply Auto-Updates
139
+
140
+ Make all clear, factual updates directly using the Edit tool.
141
+
142
+ For each file modified, output a one-line summary describing **what specifically changed** — not
143
+ just "Updated README.md" but "README.md: added /new-skill to skills table, updated skill count
144
+ from 9 to 10."
145
+
146
+ **Never auto-update:**
147
+ - README introduction or project positioning
148
+ - ARCHITECTURE philosophy or design rationale
149
+ - Security model descriptions
150
+ - Do not remove entire sections from any document
151
+
152
+ ---
153
+
154
+ ## Step 4: Ask About Risky/Questionable Changes
155
+
156
+ For each risky or questionable update identified in Step 2, use AskUserQuestion with:
157
+ - Context: project name, branch, which doc file, what we're reviewing
158
+ - The specific documentation decision
159
+ - `RECOMMENDATION: Choose [X] because [one-line reason]`
160
+ - Options including C) Skip — leave as-is
161
+
162
+ Apply approved changes immediately after each answer.
163
+
164
+ ---
165
+
166
+ ## Step 5: CHANGELOG Voice Polish
167
+
168
+ **CRITICAL — NEVER CLOBBER CHANGELOG ENTRIES.**
169
+
170
+ This step polishes voice. It does NOT rewrite, replace, or regenerate CHANGELOG content.
171
+
172
+ A real incident occurred where an agent replaced existing CHANGELOG entries when it should have
173
+ preserved them. This skill must NEVER do that.
174
+
175
+ **Rules:**
176
+ 1. Read the entire CHANGELOG.md first. Understand what is already there.
177
+ 2. Only modify wording within existing entries. Never delete, reorder, or replace entries.
178
+ 3. Never regenerate a CHANGELOG entry from scratch. The entry was written by `/ship` from the
179
+ actual diff and commit history. It is the source of truth. You are polishing prose, not
180
+ rewriting history.
181
+ 4. If an entry looks wrong or incomplete, use AskUserQuestion — do NOT silently fix it.
182
+ 5. Use Edit tool with exact `old_string` matches — never use Write to overwrite CHANGELOG.md.
183
+
184
+ **If CHANGELOG was not modified in this branch:** skip this step.
185
+
186
+ **If CHANGELOG was modified in this branch**, review the entry for voice:
187
+
188
+ - **Sell test:** Would a user reading each bullet think "oh nice, I want to try that"? If not,
189
+ rewrite the wording (not the content).
190
+ - Lead with what the user can now **do** — not implementation details.
191
+ - "You can now..." not "Refactored the..."
192
+ - Flag and rewrite any entry that reads like a commit message.
193
+ - Internal/contributor changes belong in a separate "### For contributors" subsection.
194
+ - Auto-fix minor voice adjustments. Use AskUserQuestion if a rewrite would alter meaning.
195
+
196
+ ---
197
+
198
+ ## Step 6: Cross-Doc Consistency & Discoverability Check
199
+
200
+ After auditing each file individually, do a cross-doc consistency pass:
201
+
202
+ 1. Does the README's feature/capability list match what CLAUDE.md (or project instructions) describes?
203
+ 2. Does ARCHITECTURE's component list match CONTRIBUTING's project structure description?
204
+ 3. Does CHANGELOG's latest version match the VERSION file?
205
+ 4. **Discoverability:** Is every documentation file reachable from README.md or CLAUDE.md? If
206
+ ARCHITECTURE.md exists but neither README nor CLAUDE.md links to it, flag it. Every doc
207
+ should be discoverable from one of the two entry-point files.
208
+ 5. Flag any contradictions between documents. Auto-fix clear factual inconsistencies (e.g., a
209
+ version mismatch). Use AskUserQuestion for narrative contradictions.
210
+
211
+ ---
212
+
213
+ ## Step 7: TODOS.md Cleanup
214
+
215
+ This is a second pass that complements `/ship`'s Step 5.5. Read `review/TODOS-format.md` (if
216
+ available) for the canonical TODO item format.
217
+
218
+ If TODOS.md does not exist, skip this step.
219
+
220
+ 1. **Completed items not yet marked:** Cross-reference the diff against open TODO items. If a
221
+ TODO is clearly completed by the changes in this branch, move it to the Completed section
222
+ with `**Completed:** vX.Y.Z.W (YYYY-MM-DD)`. Be conservative — only mark items with clear
223
+ evidence in the diff.
224
+
225
+ 2. **Items needing description updates:** If a TODO references files or components that were
226
+ significantly changed, its description may be stale. Use AskUserQuestion to confirm whether
227
+ the TODO should be updated, completed, or left as-is.
228
+
229
+ 3. **New deferred work:** Check the diff for `TODO`, `FIXME`, `HACK`, and `XXX` comments. For
230
+ each one that represents meaningful deferred work (not a trivial inline note), use
231
+ AskUserQuestion to ask whether it should be captured in TODOS.md.
232
+
233
+ ---
234
+
235
+ ## Step 8: VERSION Bump Question
236
+
237
+ **CRITICAL — NEVER BUMP VERSION WITHOUT ASKING.**
238
+
239
+ 1. **If VERSION does not exist:** Skip silently.
240
+
241
+ 2. Check if VERSION was already modified on this branch:
242
+
243
+ ```bash
244
+ git diff <base>...HEAD -- VERSION
245
+ ```
246
+
247
+ 3. **If VERSION was NOT bumped:** Use AskUserQuestion:
248
+ - RECOMMENDATION: Choose C (Skip) because docs-only changes rarely warrant a version bump
249
+ - A) Bump PATCH (X.Y.Z+1) — if doc changes ship alongside code changes
250
+ - B) Bump MINOR (X.Y+1.0) — if this is a significant standalone release
251
+ - C) Skip — no version bump needed
252
+
253
+ 4. **If VERSION was already bumped:** Do NOT skip silently. Instead, check whether the bump
254
+ still covers the full scope of changes on this branch:
255
+
256
+ a. Read the CHANGELOG entry for the current VERSION. What features does it describe?
257
+ b. Read the full diff (`git diff <base>...HEAD --stat` and `git diff <base>...HEAD --name-only`).
258
+ Are there significant changes (new features, new skills, new commands, major refactors)
259
+ that are NOT mentioned in the CHANGELOG entry for the current version?
260
+ c. **If the CHANGELOG entry covers everything:** Skip — output "VERSION: Already bumped to
261
+ vX.Y.Z, covers all changes."
262
+ d. **If there are significant uncovered changes:** Use AskUserQuestion explaining what the
263
+ current version covers vs what's new, and ask:
264
+ - RECOMMENDATION: Choose A because the new changes warrant their own version
265
+ - A) Bump to next patch (X.Y.Z+1) — give the new changes their own version
266
+ - B) Keep current version — add new changes to the existing CHANGELOG entry
267
+ - C) Skip — leave version as-is, handle later
268
+
269
+ The key insight: a VERSION bump set for "feature A" should not silently absorb "feature B"
270
+ if feature B is substantial enough to deserve its own version entry.
271
+
272
+ ---
273
+
274
+ ## Step 9: Commit & Output
275
+
276
+ **Empty check first:** Run `git status` (never use `-uall`). If no documentation files were
277
+ modified by any previous step, output "All documentation is up to date." and exit without
278
+ committing.
279
+
280
+ **Commit:**
281
+
282
+ 1. Stage modified documentation files by name (never `git add -A` or `git add .`).
283
+ 2. Create a single commit:
284
+
285
+ ```bash
286
+ git commit -m "$(cat <<'EOF'
287
+ docs: update project documentation for vX.Y.Z.W
288
+
289
+ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
290
+ EOF
291
+ )"
292
+ ```
293
+
294
+ 3. Push to the current branch:
295
+
296
+ ```bash
297
+ git push
298
+ ```
299
+
300
+ **PR body update (idempotent, race-safe):**
301
+
302
+ 1. Read the existing PR body into a PID-unique tempfile:
303
+
304
+ ```bash
305
+ gh pr view --json body -q .body > /tmp/orch-pr-body-$$.md
306
+ ```
307
+
308
+ 2. If the tempfile already contains a `## Documentation` section, replace that section with the
309
+ updated content. If it does not contain one, append a `## Documentation` section at the end.
310
+
311
+ 3. The Documentation section should include a **doc diff preview** — for each file modified,
312
+ describe what specifically changed (e.g., "README.md: added /document-release to skills
313
+ table, updated skill count from 9 to 10").
314
+
315
+ 4. Write the updated body back:
316
+
317
+ ```bash
318
+ gh pr edit --body-file /tmp/orch-pr-body-$$.md
319
+ ```
320
+
321
+ 5. Clean up the tempfile:
322
+
323
+ ```bash
324
+ rm -f /tmp/orch-pr-body-$$.md
325
+ ```
326
+
327
+ 6. If `gh pr view` fails (no PR exists): skip with message "No PR found — skipping body update."
328
+ 7. If `gh pr edit` fails: warn "Could not update PR body — documentation changes are in the
329
+ commit." and continue.
330
+
331
+ **Structured doc health summary (final output):**
332
+
333
+ Output a scannable summary showing every documentation file's status:
334
+
335
+ ```
336
+ Documentation health:
337
+ README.md [status] ([details])
338
+ ARCHITECTURE.md [status] ([details])
339
+ CONTRIBUTING.md [status] ([details])
340
+ CHANGELOG.md [status] ([details])
341
+ TODOS.md [status] ([details])
342
+ VERSION [status] ([details])
343
+ ```
344
+
345
+ Where status is one of:
346
+ - Updated — with description of what changed
347
+ - Current — no changes needed
348
+ - Voice polished — wording adjusted
349
+ - Not bumped — user chose to skip
350
+ - Already bumped — version was set by /ship
351
+ - Skipped — file does not exist
352
+
353
+ ---
354
+
355
+ ## Important Rules
356
+
357
+ - **Read before editing.** Always read the full content of a file before modifying it.
358
+ - **Never clobber CHANGELOG.** Polish wording only. Never delete, replace, or regenerate entries.
359
+ - **Never bump VERSION silently.** Always ask. Even if already bumped, check whether it covers the full scope of changes.
360
+ - **Be explicit about what changed.** Every edit gets a one-line summary.
361
+ - **Generic heuristics, not project-specific.** The audit checks work on any repo.
362
+ - **Discoverability matters.** Every doc file should be reachable from README or CLAUDE.md.
363
+ - **Voice: friendly, user-forward, not obscure.** Write like you're explaining to a smart person
364
+ who hasn't seen the code.
365
+
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: freeze
3
+ version: 0.1.0
4
+ description: |
5
+ Restrict file edits to a specific directory for the session. Blocks Edit and
6
+ Write outside the allowed path. Use when debugging to prevent accidentally
7
+ "fixing" unrelated code, or when you want to scope changes to one module.
8
+ Use when asked to "freeze", "restrict edits", "only edit this folder",
9
+ or "lock down edits".
10
+ ---
11
+
12
+ # /freeze — Restrict Edits to a Directory
13
+
14
+ Lock file edits to a specific directory. Any Edit or Write operation targeting
15
+ a file outside the allowed path will be **blocked** (not just warned).
16
+
17
+ ## Setup
18
+
19
+ Ask the user which directory to restrict edits to. Use AskUserQuestion:
20
+
21
+ - Question: "Which directory should I restrict edits to? Files outside this path will be blocked from editing."
22
+ - Text input (not multiple choice) — the user types a path.
23
+
24
+ Once the user provides a directory path:
25
+
26
+ 1. Resolve it to an absolute path:
27
+ ```bash
28
+ FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
29
+ echo "$FREEZE_DIR"
30
+ ```
31
+
32
+ 2. Ensure trailing slash and save to the freeze state file:
33
+ ```bash
34
+ FREEZE_DIR="${FREEZE_DIR%/}/"
35
+ STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.orch}"
36
+ mkdir -p "$STATE_DIR"
37
+ echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
38
+ echo "Freeze boundary set: $FREEZE_DIR"
39
+ ```
40
+
41
+ Tell the user: "Edits are now restricted to `<path>/`. Any Edit or Write
42
+ outside this directory will be blocked. To change the boundary, run `/freeze`
43
+ again. To remove it, run `/unfreeze` or end the session."
44
+
45
+ ## How it works
46
+
47
+ The hook reads `file_path` from the Edit/Write tool input JSON, then checks
48
+ whether the path starts with the freeze directory. If not, it returns
49
+ `permissionDecision: "deny"` to block the operation.
50
+
51
+ The freeze boundary persists for the session via the state file. The hook
52
+ script reads it on every Edit/Write invocation.
53
+
54
+ ## Notes
55
+
56
+ - The trailing `/` on the freeze directory prevents `/src` from matching `/src-old`
57
+ - Freeze applies to Edit and Write tools only — Read, Bash, Glob, Grep are unaffected
58
+ - This prevents accidental edits, not a security boundary — Bash commands like `sed` can still modify files outside the boundary
59
+ - To deactivate, run `/unfreeze` or end the conversation
60
+
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: guard
3
+ version: 0.1.0
4
+ description: |
5
+ Full safety mode: destructive command warnings + directory-scoped edits.
6
+ Combines /careful (warns before rm -rf, DROP TABLE, force-push, etc.) with
7
+ /freeze (blocks edits outside a specified directory). Use for maximum safety
8
+ when touching prod or debugging live systems. Use when asked to "guard mode",
9
+ "full safety", "lock it down", or "maximum safety".
10
+ ---
11
+
12
+ # /guard — Full Safety Mode
13
+
14
+ Activates both destructive command warnings and directory-scoped edit restrictions.
15
+ This is the combination of `/careful` + `/freeze` in a single command.
16
+
17
+ **Dependency note:** This skill references hook scripts from the sibling `/careful`
18
+ and `/freeze` skill directories. Both must be installed (they are installed together
19
+ by the setup script).
20
+
21
+ ## Setup
22
+
23
+ Ask the user which directory to restrict edits to. Use AskUserQuestion:
24
+
25
+ - Question: "Guard mode: which directory should edits be restricted to? Destructive command warnings are always on. Files outside the chosen path will be blocked from editing."
26
+ - Text input (not multiple choice) — the user types a path.
27
+
28
+ Once the user provides a directory path:
29
+
30
+ 1. Resolve it to an absolute path:
31
+ ```bash
32
+ FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
33
+ echo "$FREEZE_DIR"
34
+ ```
35
+
36
+ 2. Ensure trailing slash and save to the freeze state file:
37
+ ```bash
38
+ FREEZE_DIR="${FREEZE_DIR%/}/"
39
+ STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.orch}"
40
+ mkdir -p "$STATE_DIR"
41
+ echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
42
+ echo "Freeze boundary set: $FREEZE_DIR"
43
+ ```
44
+
45
+ Tell the user:
46
+ - "**Guard mode active.** Two protections are now running:"
47
+ - "1. **Destructive command warnings** — rm -rf, DROP TABLE, force-push, etc. will warn before executing (you can override)"
48
+ - "2. **Edit boundary** — file edits restricted to `<path>/`. Edits outside this directory are blocked."
49
+ - "To remove the edit boundary, run `/unfreeze`. To deactivate everything, end the session."
50
+
51
+ ## What's protected
52
+
53
+ See `/careful` for the full list of destructive command patterns and safe exceptions.
54
+ See `/freeze` for how edit boundary enforcement works.
55
+
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: investigate
3
+ version: 1.0.0
4
+ description: |
5
+ Systematic debugging with root cause investigation. Four phases: investigate,
6
+ analyze, hypothesize, implement. Iron Law: no fixes without root cause.
7
+ Use when asked to "debug this", "fix this bug", "why is this broken",
8
+ "investigate this error", or "root cause analysis".
9
+ Proactively suggest when the user reports errors, unexpected behavior, or
10
+ is troubleshooting why something stopped working.
11
+ ---
12
+
13
+ ## Iron Law
14
+
15
+ **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.**
16
+
17
+ Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find. Find the root cause, then fix it.
18
+
19
+ ---
20
+
21
+ ## Phase 1: Root Cause Investigation
22
+
23
+ Gather context before forming any hypothesis.
24
+
25
+ 1. **Collect symptoms:** Read the error messages, stack traces, and reproduction steps. If the user hasn't provided enough context, ask ONE question at a time via AskUserQuestion.
26
+
27
+ 2. **Read the code:** Trace the code path from the symptom back to potential causes. Use Grep to find all references, Read to understand the logic.
28
+
29
+ 3. **Check recent changes:**
30
+ ```bash
31
+ git log --oneline -20 -- <affected-files>
32
+ ```
33
+ Was this working before? What changed? A regression means the root cause is in the diff.
34
+
35
+ 4. **Reproduce:** Can you trigger the bug deterministically? If not, gather more evidence before proceeding.
36
+
37
+ Output: **"Root cause hypothesis: ..."** — a specific, testable claim about what is wrong and why.
38
+
39
+ ---
40
+
41
+ ## Scope Lock
42
+
43
+ After forming your root cause hypothesis, lock edits to the affected module to prevent scope creep.
44
+
45
+ ```bash
46
+ [ -x "${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh" ] && echo "FREEZE_AVAILABLE" || echo "FREEZE_UNAVAILABLE"
47
+ ```
48
+
49
+ **If FREEZE_AVAILABLE:** Identify the narrowest directory containing the affected files. Write it to the freeze state file:
50
+
51
+ ```bash
52
+ STATE_DIR="${CLAUDE_PLUGIN_DATA:-$HOME/.orch}"
53
+ mkdir -p "$STATE_DIR"
54
+ echo "<detected-directory>/" > "$STATE_DIR/freeze-dir.txt"
55
+ echo "Debug scope locked to: <detected-directory>/"
56
+ ```
57
+
58
+ Substitute `<detected-directory>` with the actual directory path (e.g., `src/auth/`). Tell the user: "Edits restricted to `<dir>/` for this debug session. This prevents changes to unrelated code. Run `/unfreeze` to remove the restriction."
59
+
60
+ If the bug spans the entire repo or the scope is genuinely unclear, skip the lock and note why.
61
+
62
+ **If FREEZE_UNAVAILABLE:** Skip scope lock. Edits are unrestricted.
63
+
64
+ ---
65
+
66
+ ## Phase 2: Pattern Analysis
67
+
68
+ Check if this bug matches a known pattern:
69
+
70
+ | Pattern | Signature | Where to look |
71
+ |---------|-----------|---------------|
72
+ | Race condition | Intermittent, timing-dependent | Concurrent access to shared state |
73
+ | Nil/null propagation | NoMethodError, TypeError | Missing guards on optional values |
74
+ | State corruption | Inconsistent data, partial updates | Transactions, callbacks, hooks |
75
+ | Integration failure | Timeout, unexpected response | External API calls, service boundaries |
76
+ | Configuration drift | Works locally, fails in staging/prod | Env vars, feature flags, DB state |
77
+ | Stale cache | Shows old data, fixes on cache clear | Redis, CDN, browser cache, Turbo |
78
+
79
+ Also check:
80
+ - `TODOS.md` for related known issues
81
+ - `git log` for prior fixes in the same area — **recurring bugs in the same files are an architectural smell**, not a coincidence
82
+
83
+ **External pattern search:** If the bug doesn't match a known pattern above, WebSearch for:
84
+ - "{framework} {generic error type}" — **sanitize first:** strip hostnames, IPs, file paths, SQL, customer data. Search the error category, not the raw message.
85
+ - "{library} {component} known issues"
86
+
87
+ If WebSearch is unavailable, skip this search and proceed with hypothesis testing. If a documented solution or known dependency bug surfaces, present it as a candidate hypothesis in Phase 3.
88
+
89
+ ---
90
+
91
+ ## Phase 3: Hypothesis Testing
92
+
93
+ Before writing ANY fix, verify your hypothesis.
94
+
95
+ 1. **Confirm the hypothesis:** Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match?
96
+
97
+ 2. **If the hypothesis is wrong:** Before forming the next hypothesis, consider searching for the error. **Sanitize first** — strip hostnames, IPs, file paths, SQL fragments, customer identifiers, and any internal/proprietary data from the error message. Search only the generic error type and framework context: "{component} {sanitized error type} {framework version}". If the error message is too specific to sanitize safely, skip the search. If WebSearch is unavailable, skip and proceed. Then return to Phase 1. Gather more evidence. Do not guess.
98
+
99
+ 3. **3-strike rule:** If 3 hypotheses fail, **STOP**. Use AskUserQuestion:
100
+ ```
101
+ 3 hypotheses tested, none match. This may be an architectural issue
102
+ rather than a simple bug.
103
+
104
+ A) Continue investigating — I have a new hypothesis: [describe]
105
+ B) Escalate for human review — this needs someone who knows the system
106
+ C) Add logging and wait — instrument the area and catch it next time
107
+ ```
108
+
109
+ **Red flags** — if you see any of these, slow down:
110
+ - "Quick fix for now" — there is no "for now." Fix it right or escalate.
111
+ - Proposing a fix before tracing data flow — you're guessing.
112
+ - Each fix reveals a new problem elsewhere — wrong layer, not wrong code.
113
+
114
+ ---
115
+
116
+ ## Phase 4: Implementation
117
+
118
+ Once root cause is confirmed:
119
+
120
+ 1. **Fix the root cause, not the symptom.** The smallest change that eliminates the actual problem.
121
+
122
+ 2. **Minimal diff:** Fewest files touched, fewest lines changed. Resist the urge to refactor adjacent code.
123
+
124
+ 3. **Write a regression test** that:
125
+ - **Fails** without the fix (proves the test is meaningful)
126
+ - **Passes** with the fix (proves the fix works)
127
+
128
+ 4. **Run the full test suite.** Paste the output. No regressions allowed.
129
+
130
+ 5. **If the fix touches >5 files:** Use AskUserQuestion to flag the blast radius:
131
+ ```
132
+ This fix touches N files. That's a large blast radius for a bug fix.
133
+ A) Proceed — the root cause genuinely spans these files
134
+ B) Split — fix the critical path now, defer the rest
135
+ C) Rethink — maybe there's a more targeted approach
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Phase 5: Verification & Report
141
+
142
+ **Fresh verification:** Reproduce the original bug scenario and confirm it's fixed. This is not optional.
143
+
144
+ Run the test suite and paste the output.
145
+
146
+ Output a structured debug report:
147
+ ```
148
+ DEBUG REPORT
149
+ ════════════════════════════════════════
150
+ Symptom: [what the user observed]
151
+ Root cause: [what was actually wrong]
152
+ Fix: [what was changed, with file:line references]
153
+ Evidence: [test output, reproduction attempt showing fix works]
154
+ Regression test: [file:line of the new test]
155
+ Related: [TODOS.md items, prior bugs in same area, architectural notes]
156
+ Status: DONE | DONE_WITH_CONCERNS | BLOCKED
157
+ ════════════════════════════════════════
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Important Rules
163
+
164
+ - **3+ failed fix attempts → STOP and question the architecture.** Wrong architecture, not failed hypothesis.
165
+ - **Never apply a fix you cannot verify.** If you can't reproduce and confirm, don't ship it.
166
+ - **Never say "this should fix it."** Verify and prove it. Run the tests.
167
+ - **If fix touches >5 files → AskUserQuestion** about blast radius before proceeding.
168
+ - **Completion status:**
169
+ - DONE — root cause found, fix applied, regression test written, all tests pass
170
+ - DONE_WITH_CONCERNS — fixed but cannot fully verify (e.g., intermittent bug, requires staging)
171
+ - BLOCKED — root cause unclear after investigation, escalated