claude-dev-env 1.93.1 → 1.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/_shared/pr-loop/CLAUDE.md +1 -0
  2. package/_shared/pr-loop/audit-contract.md +1 -1
  3. package/_shared/pr-loop/gh-payloads.md +3 -3
  4. package/_shared/pr-loop/post-audit-thread-contract.md +51 -0
  5. package/_shared/pr-loop/scripts/README.md +2 -2
  6. package/_shared/pr-loop/scripts/fix_hookspath.py +47 -12
  7. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -69
  8. package/_shared/pr-loop/scripts/tests/test_fix_hookspath.py +497 -374
  9. package/_shared/pr-loop/state-schema.md +3 -22
  10. package/bin/CLAUDE.md +1 -1
  11. package/bin/install.mjs +2 -7
  12. package/bin/install.test.mjs +10 -4
  13. package/hooks/blocking/CLAUDE.md +2 -0
  14. package/hooks/blocking/pii_commit_command.py +398 -0
  15. package/hooks/blocking/pii_payload_scan.py +133 -0
  16. package/hooks/blocking/pii_prevention_blocker.py +151 -449
  17. package/hooks/blocking/test_pii_prevention_blocker.py +299 -0
  18. package/hooks/blocking/test_verdict_directory_write_blocker.py +42 -7
  19. package/hooks/hooks_constants/CLAUDE.md +2 -2
  20. package/hooks/hooks_constants/code_rules_path_utils_constants.py +0 -2
  21. package/hooks/hooks_constants/local_identity.py +65 -15
  22. package/hooks/hooks_constants/pii_prevention_constants.py +16 -0
  23. package/hooks/hooks_constants/pr_description_enforcer_constants.py +1 -1
  24. package/hooks/hooks_constants/test_local_identity.py +68 -0
  25. package/package.json +1 -1
  26. package/scripts/CLAUDE.md +10 -1
  27. package/scripts/Get-SessionAccount.ps1 +210 -0
  28. package/scripts/tests/CLAUDE.md +15 -1
  29. package/scripts/tests/Get-SessionAccount.Tests.ps1 +350 -0
  30. package/skills/CLAUDE.md +3 -25
  31. package/skills/anthropic-plan/SKILL.md +1 -13
  32. package/skills/autoconverge/CLAUDE.md +5 -2
  33. package/skills/autoconverge/SKILL.md +112 -387
  34. package/skills/autoconverge/reference/CLAUDE.md +4 -1
  35. package/skills/autoconverge/reference/closing-report.md +9 -2
  36. package/skills/autoconverge/reference/convergence.md +26 -22
  37. package/skills/autoconverge/reference/headless-safety.md +44 -0
  38. package/skills/autoconverge/reference/multi-pr.md +88 -0
  39. package/skills/autoconverge/reference/self-closing-loop.md +84 -0
  40. package/skills/autoconverge/reference/stop-conditions.md +21 -13
  41. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +87 -27
  42. package/skills/autoconverge/workflow/converge.contract.test.mjs +40 -10
  43. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +179 -47
  44. package/skills/autoconverge/workflow/converge.fix-progress.test.mjs +1 -1
  45. package/skills/autoconverge/workflow/converge.mjs +284 -94
  46. package/skills/bugteam/CLAUDE.md +1 -1
  47. package/skills/bugteam/CONSTRAINTS.md +3 -3
  48. package/skills/bugteam/PROMPTS.md +8 -19
  49. package/skills/bugteam/SKILL.md +13 -14
  50. package/skills/bugteam/reference/CLAUDE.md +1 -1
  51. package/skills/bugteam/reference/audit-and-teammates.md +2 -2
  52. package/skills/bugteam/reference/copilot-gap-analysis.md +2 -0
  53. package/skills/bugteam/reference/github-pr-reviews.md +56 -38
  54. package/skills/bugteam/reference/team-setup.md +11 -11
  55. package/skills/bugteam/scripts/CLAUDE.md +6 -6
  56. package/skills/bugteam/scripts/README.md +20 -8
  57. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +13 -1463
  58. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +23 -358
  59. package/skills/bugteam/scripts/bugteam_preflight.py +13 -315
  60. package/skills/bugteam/scripts/bugteam_scripts_constants/CLAUDE.md +2 -3
  61. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +34 -1053
  62. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +30 -347
  63. package/skills/bugteam/scripts/test_bugteam_preflight.py +30 -305
  64. package/skills/copilot-finding-triage/SKILL.md +80 -28
  65. package/skills/copilot-finding-triage/reference/tier-rubric.md +70 -11
  66. package/skills/copilot-finding-triage/templates/notification.md +8 -3
  67. package/skills/everything-search/SKILL.md +1 -2
  68. package/skills/grokify/SKILL.md +58 -0
  69. package/skills/grokify/templates/handoff-template.md +92 -0
  70. package/skills/orchestrator/SKILL.md +12 -8
  71. package/skills/orchestrator-refresh/SKILL.md +3 -3
  72. package/skills/pr-converge/SKILL.md +132 -233
  73. package/skills/pr-converge/reference/convergence-gates.md +102 -66
  74. package/skills/pr-converge/reference/examples.md +37 -25
  75. package/skills/pr-converge/reference/fix-protocol.md +7 -7
  76. package/skills/pr-converge/reference/multi-pr-orchestration.md +10 -4
  77. package/skills/pr-converge/reference/per-tick.md +64 -41
  78. package/skills/pr-converge/reference/state-schema.md +27 -2
  79. package/skills/pr-converge/scripts/CLAUDE.md +8 -0
  80. package/skills/pr-converge/scripts/README.md +4 -3
  81. package/skills/pr-converge/scripts/_pr_converge_path_setup.py +23 -0
  82. package/skills/pr-converge/scripts/check_convergence.py +189 -645
  83. package/skills/pr-converge/scripts/check_convergence_gates.py +235 -0
  84. package/skills/pr-converge/scripts/check_convergence_thread_gates.py +219 -0
  85. package/skills/pr-converge/scripts/conftest.py +8 -0
  86. package/skills/pr-converge/scripts/pr_converge_scripts_constants/CLAUDE.md +1 -0
  87. package/skills/pr-converge/scripts/pr_converge_scripts_constants/convergence_gate_constants.py +36 -0
  88. package/skills/pr-converge/scripts/test__pr_converge_path_setup.py +26 -0
  89. package/skills/pr-converge/scripts/test_check_convergence.py +73 -228
  90. package/skills/pr-converge/scripts/test_check_convergence_contract.py +321 -0
  91. package/skills/pr-converge/scripts/test_check_convergence_gates.py +68 -0
  92. package/skills/pr-converge/scripts/test_check_convergence_thread_gates.py +75 -0
  93. package/skills/privacy-hygiene/SKILL.md +4 -3
  94. package/skills/reviewer-gates/SKILL.md +26 -8
  95. package/skills/session-log/SKILL.md +11 -12
  96. package/skills/session-tidy/SKILL.md +40 -30
  97. package/skills/skill-builder/CLAUDE.md +13 -10
  98. package/skills/skill-builder/SKILL.md +31 -31
  99. package/skills/skill-builder/references/CLAUDE.md +10 -6
  100. package/skills/skill-builder/references/delegation-map.md +13 -4
  101. package/skills/skill-builder/references/description-field.md +113 -0
  102. package/skills/skill-builder/references/self-audit-checklist.md +21 -4
  103. package/skills/skill-builder/references/skill-modularity.md +113 -0
  104. package/skills/skill-builder/references/skill-types.md +4 -0
  105. package/skills/skill-builder/templates/CLAUDE.md +4 -4
  106. package/skills/skill-builder/templates/gap-analysis.md +25 -1
  107. package/skills/skill-builder/workflows/CLAUDE.md +6 -4
  108. package/skills/skill-builder/workflows/improve-skill.md +17 -16
  109. package/skills/skill-builder/workflows/new-skill.md +34 -10
  110. package/skills/skill-builder/workflows/polish-skill.md +59 -43
  111. package/skills/usage-pause/SKILL.md +10 -14
  112. package/skills/bdd-protocol/CLAUDE.md +0 -26
  113. package/skills/bdd-protocol/SKILL.md +0 -30
  114. package/skills/bdd-protocol/references/CLAUDE.md +0 -10
  115. package/skills/bdd-protocol/references/anti-patterns.md +0 -26
  116. package/skills/bdd-protocol/references/example-mapping.md +0 -23
  117. package/skills/bg-agent/CLAUDE.md +0 -17
  118. package/skills/bg-agent/SKILL.md +0 -69
  119. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +0 -55
  120. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_fix_hookspath_constants.py +0 -26
  121. package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_preflight_constants.py +0 -35
  122. package/skills/caveman/CLAUDE.md +0 -15
  123. package/skills/caveman/SKILL.md +0 -38
  124. package/skills/code/CLAUDE.md +0 -17
  125. package/skills/code/SKILL.md +0 -178
  126. package/skills/deep-research/CLAUDE.md +0 -17
  127. package/skills/deep-research/SKILL.md +0 -80
  128. package/skills/findbugs/CLAUDE.md +0 -20
  129. package/skills/findbugs/SKILL.md +0 -241
  130. package/skills/fixbugs/CLAUDE.md +0 -19
  131. package/skills/fixbugs/SKILL.md +0 -142
  132. package/skills/gh-paginate/CLAUDE.md +0 -18
  133. package/skills/gh-paginate/SKILL.md +0 -84
  134. package/skills/gotcha/CLAUDE.md +0 -33
  135. package/skills/gotcha/SKILL.md +0 -73
  136. package/skills/implement/CLAUDE.md +0 -27
  137. package/skills/implement/SKILL.md +0 -66
  138. package/skills/implement/scripts/CLAUDE.md +0 -22
  139. package/skills/implement/scripts/append_note.py +0 -133
  140. package/skills/implement/scripts/implement_scripts_constants/CLAUDE.md +0 -22
  141. package/skills/implement/scripts/implement_scripts_constants/__init__.py +0 -0
  142. package/skills/implement/scripts/implement_scripts_constants/notes_constants.py +0 -12
  143. package/skills/implement/scripts/test_append_note.py +0 -191
  144. package/skills/log-audit/CLAUDE.md +0 -20
  145. package/skills/log-audit/SKILL.md +0 -66
  146. package/skills/log-audit/reference/CLAUDE.md +0 -9
  147. package/skills/log-audit/reference/charter.md +0 -52
  148. package/skills/log-audit/scripts/CLAUDE.md +0 -27
  149. package/skills/log-audit/scripts/cluster_recurrences.py +0 -261
  150. package/skills/log-audit/scripts/collect_log_window.py +0 -199
  151. package/skills/log-audit/scripts/log_audit_constants/CLAUDE.md +0 -12
  152. package/skills/log-audit/scripts/log_audit_constants/__init__.py +0 -0
  153. package/skills/log-audit/scripts/log_audit_constants/cluster_recurrences_constants.py +0 -23
  154. package/skills/log-audit/scripts/log_audit_constants/collect_log_window_constants.py +0 -24
  155. package/skills/log-audit/scripts/log_audit_constants/mine_copilot_findings_constants.py +0 -49
  156. package/skills/log-audit/scripts/mine_copilot_findings.py +0 -302
  157. package/skills/log-audit/scripts/test_cluster_recurrences.py +0 -160
  158. package/skills/log-audit/scripts/test_collect_log_window.py +0 -111
  159. package/skills/log-audit/scripts/test_mine_copilot_findings.py +0 -126
  160. package/skills/logifix/CLAUDE.md +0 -36
  161. package/skills/logifix/SKILL.md +0 -69
  162. package/skills/logifix/scripts/CLAUDE.md +0 -16
  163. package/skills/logifix/scripts/logifix.ps1 +0 -205
  164. package/skills/monitor-open-prs/CLAUDE.md +0 -34
  165. package/skills/monitor-open-prs/SKILL.md +0 -88
  166. package/skills/monitor-open-prs/scripts/CLAUDE.md +0 -17
  167. package/skills/monitor-open-prs/scripts/discover_open_prs.py +0 -69
  168. package/skills/monitor-open-prs/scripts/test_discover_open_prs.py +0 -149
  169. package/skills/monitor-open-prs/test_skill_contract.py +0 -27
  170. package/skills/post-audit-findings/SKILL.md +0 -80
  171. package/skills/pr-consistency-audit/CLAUDE.md +0 -34
  172. package/skills/pr-consistency-audit/SKILL.md +0 -116
  173. package/skills/pr-consistency-audit/reference/CLAUDE.md +0 -16
  174. package/skills/pr-consistency-audit/reference/detection-rules.md +0 -96
  175. package/skills/pr-consistency-audit/reference/illustrations.md +0 -78
  176. package/skills/pr-fix-protocol/SKILL.md +0 -65
  177. package/skills/pr-review-responder/CLAUDE.md +0 -35
  178. package/skills/pr-review-responder/EXAMPLES.md +0 -590
  179. package/skills/pr-review-responder/PRINCIPLES.md +0 -533
  180. package/skills/pr-review-responder/README.md +0 -168
  181. package/skills/pr-review-responder/SKILL.md +0 -203
  182. package/skills/pr-review-responder/TESTING.md +0 -350
  183. package/skills/pr-scope-resolve/SKILL.md +0 -45
  184. package/skills/pre-compact/CLAUDE.md +0 -24
  185. package/skills/pre-compact/SKILL.md +0 -134
  186. package/skills/qbug/CLAUDE.md +0 -40
  187. package/skills/qbug/SKILL.md +0 -387
  188. package/skills/qbug/test_qbug_skill_audit_schema.py +0 -152
  189. package/skills/qbug/test_qbug_skill_post_fix_audit.py +0 -103
  190. package/skills/refine/CLAUDE.md +0 -44
  191. package/skills/refine/SKILL.md +0 -262
  192. package/skills/refine/templates/CLAUDE.md +0 -17
  193. package/skills/refine/templates/implementation-notes-template.html +0 -56
  194. package/skills/refine/templates/plan-template.md +0 -60
  195. package/skills/research-mode/CLAUDE.md +0 -35
  196. package/skills/research-mode/SKILL.md +0 -53
  197. package/skills/structure-prompt/CLAUDE.md +0 -42
  198. package/skills/structure-prompt/SKILL.md +0 -44
  199. package/skills/structure-prompt/reference/CLAUDE.md +0 -28
  200. package/skills/structure-prompt/reference/adversarial-tuning.md +0 -62
  201. package/skills/structure-prompt/reference/block-classification.md +0 -27
  202. package/skills/structure-prompt/reference/canonical-case.md +0 -48
  203. package/skills/structure-prompt/reference/citation-depth.md +0 -70
  204. package/skills/structure-prompt/reference/cleanup.md +0 -33
  205. package/skills/structure-prompt/reference/constraints.md +0 -33
  206. package/skills/structure-prompt/reference/directives.md +0 -37
  207. package/skills/structure-prompt/reference/examples.md +0 -72
  208. package/skills/structure-prompt/reference/instantiation.md +0 -51
  209. package/skills/structure-prompt/reference/output-contract.md +0 -72
  210. package/skills/structure-prompt/reference/per-category.md +0 -23
  211. package/skills/structure-prompt/reference/persona.md +0 -38
  212. package/skills/structure-prompt/reference/research.md +0 -33
  213. package/skills/structure-prompt/reference/structure.md +0 -28
  214. package/skills/verified-build/CLAUDE.md +0 -33
  215. package/skills/verified-build/SKILL.md +0 -33
@@ -1,30 +0,0 @@
1
- ---
2
- name: bdd-protocol
3
- description: >-
4
- On-demand BDD depth: Example Mapping, scenario quality and anti-patterns, solo
5
- minimal BDD, and outside-in test layout. Use when expanding `<behavior_protocol>`,
6
- writing executable specifications, or giving 'the one where' examples.
7
- Triggers: bdd-protocol, Example Mapping, BDD anti-patterns, §7.6.
8
- ---
9
- @~/.claude/skills/bdd-protocol/references/example-mapping.md
10
- @~/.claude/skills/bdd-protocol/references/anti-patterns.md
11
-
12
- # BDD protocol (on-demand)
13
-
14
- The always-on sequence lives in `~/.claude/system-prompts/software-engineer.xml` under `<behavior_protocol>` (Deliberate Discovery → Illustrate → Formulate → Automate). This skill adds **depth** you load when you need algorithms, catalogs, or layout guidance.
15
-
16
- ## When to use this skill
17
-
18
- - The user or task needs **Example Mapping** steps, parking-lot questions, or "the one where …" phrasing.
19
- - You are writing or reviewing **scenarios** and need the **§7.6** quality bar and anti-patterns.
20
- - You are organizing **tests by behavior** (describe / when / should) or using **soap-opera personas** for solo work.
21
-
22
- ## Authority
23
-
24
- - John Ferguson Smart & Jan Molak, *BDD in Action* 2e (Manning, 2023) — §2.3.7 outside-in, §5.4 Deliberate Discovery, §6.4 Example Mapping, §7.6 scenario quality, §16.5.5 test layout.
25
- - Dan North, "Introducing BDD" (2006).
26
- - John Ferguson Smart, Minimal BDD (learnbdd.com; Wayback-cited in tracking issue).
27
-
28
- ## What stays in the system prompt
29
-
30
- Do not duplicate the four-phase sequence here; keep a single source of truth in `<behavior_protocol>`.
@@ -1,10 +0,0 @@
1
- # references
2
-
3
- Reference documentation loaded by the `bdd-protocol` skill. Both files are `@`-imported in `SKILL.md` and load when the skill activates.
4
-
5
- ## Key files
6
-
7
- | File | Role |
8
- |---|---|
9
- | `example-mapping.md` | Example Mapping algorithm (Smart & Molak §6.4). Covers core moves, the "The one where …" phrasing, probes, parking-lot questions, the solo chat algorithm, and time-boxing guidance. |
10
- | `anti-patterns.md` | §7.6 scenario quality catalog. Lists anti-patterns to avoid and the criteria for a well-formed BDD scenario. |
@@ -1,26 +0,0 @@
1
- # Scenario quality and anti-patterns (§7.6 and related)
2
-
3
- Use this as a **checklist** when writing or reviewing scenarios and developer-facing specifications. Phrasing follows *BDD in Action* 2e and the catalog summarized in [claude-dev-env#82](https://github.com/jl-cmd/claude-dev-env/issues/82).
4
-
5
- ## Positive targets (what "good" looks like)
6
-
7
- - **Declarative focus (§7.6.3):** Scenarios describe **business behavior** and user goals, not low-level UI click scripts.
8
- - **Single-rule focus (§7.6.4):** One **business rule** per scenario; split when a scenario grows hard to read.
9
- - **Meaningful actors (§7.6.5):** Personas can be **lightweight** (e.g. soap-opera introductions) when full UX research is unavailable — name + role, grow detail as scenarios demand.
10
- - **Essential detail (§7.6.6):** Include data and columns that **change outcomes**; omit neutral or redundant columns.
11
- - **State clarity (§7.6.6):** Make **initial** and **final** state explicit when data illustrates behavior.
12
- - **Outcome description (§7.6.7):** Outcomes are **observable and measurable** — not hidden behind vague "verify" steps.
13
- - **Independence (§7.6.8):** Each scenario sets up **its own** data and state so it can run alone.
14
-
15
- ## Anti-patterns to refuse or rewrite
16
-
17
- - **Imperative scenarios** that read like automation scripts (especially pure UI step lists).
18
- - **Multi-concern** scenarios that mix unrelated rules.
19
- - **Incidental detail** that does not serve the rule under test.
20
- - **Test scripts in disguise** — heavy use of **verify** / **check** without stating the business outcome.
21
- - **Dependent scenarios** that only pass in order.
22
- - **Gherkin without conversation** (BAs or testers writing scenarios in isolation) — structured specs are an **output** of discovery, not a substitute for it (Minimal BDD).
23
-
24
- ## Executable specs at the code level
25
-
26
- Prefer **"should …"** phrasing in names (Dan North, 2006). Nest by **behavior context** (e.g. when / given groupings) rather than mirroring production file layout when that obscures intent (§16.5.5 attitude: tests as documentation).
@@ -1,23 +0,0 @@
1
- # Example Mapping (Smart & Molak §6.4)
2
-
3
- Lightweight, breadth-first discovery before code. Sessions are typically **25–30 minutes**.
4
-
5
- ## Core moves
6
-
7
- - State **rules**, then ask for an **example of each** rule. Examples often use **"The one where …"** phrasing (Daniel Terhorst-North; sometimes called "Friends episode notation").
8
- - For each example, probe with **"What if …?"**, **"Is this always the case?"**, **"Are there examples where this rule behaves differently?"** Probes can surface **new rules**; add examples for those rules.
9
- - **Pink cards**: questions that cannot be answered yet — **park** them; do not pretend they are specifications.
10
-
11
- ## Chat algorithm (solo-friendly)
12
-
13
- 1. **Restate the rule or feature** until it is clearly defined.
14
- 2. Generate **3–5** "the one where …" examples from simple to complex.
15
- 3. For each example, run the **three probes** above.
16
- 4. If probes reveal a **new rule** or materially different behavior, add **2–3** examples for that rule and continue probing.
17
- 5. Repeat until examples for each rule are probed.
18
- 6. Compile **rules + examples + parked questions**; confirm with the user before automating tests.
19
- 7. **Time-box** discovery; proceed to failing tests only after the map is agreed.
20
-
21
- ## Parking lot discipline
22
-
23
- Unanswered questions stay **out of automated tests** until resolved or explicitly accepted as follow-up work.
@@ -1,17 +0,0 @@
1
- # bg-agent
2
-
3
- Delegates a task to a background agent so the main session stays free. Triggered by `/bg-agent`, `bg-agent`, or `background agent for this`.
4
-
5
- ## Purpose
6
-
7
- This skill picks a suitable agent type for the task, spawns it via the `Agent` tool with `run_in_background: true`, and returns control at once. The spawned agent notifies on completion. Other skills (such as `gotcha`) invoke this skill to offload their own PR-creation steps.
8
-
9
- ## Key file
10
-
11
- | File | Purpose |
12
- |---|---|
13
- | `SKILL.md` | Full instructions: how to parse the task argument, how to pick an agent type, how to write a self-contained spawn prompt, and how to report spawn to the user. |
14
-
15
- ## How this skill is invoked
16
-
17
- The user types `/bg-agent <task description>` or a calling skill invokes it by name. The skill always spawns with `run_in_background: true` — it never runs the task inline in the main session.
@@ -1,69 +0,0 @@
1
- ---
2
- name: bg-agent
3
- description: Delegates a task to a background agent. Invoked as "bg-agent [task to do]". Claude picks a suitable agent type from the available agents list and spawns it via Agent with run_in_background: true. Triggers on "/bg-agent", "bg-agent", "background agent for this".
4
- ---
5
-
6
- # bg-agent
7
-
8
- ## Overview
9
-
10
- Delegates a task to a background agent so the main session can continue without waiting. This is the programmatic invocation path for background work — other skills (e.g. gotcha) and the user can both invoke it.
11
-
12
- **Announce at start:** "Delegating to a background agent: `<one-line summary of task>`."
13
-
14
- ## Instructions
15
-
16
- ### Step 1 — Parse the task
17
-
18
- The user (or calling skill) provides a task description after `bg-agent`. Example:
19
-
20
- ```
21
- bg-agent add a gotcha to the rebase skill about force-push lease format
22
- ```
23
-
24
- Extract the full task description from the arguments.
25
-
26
- ### Step 2 — Select the right agent
27
-
28
- Review the available agent types (listed in the system prompt's Agent tool description) and pick the most suitable one for the task:
29
-
30
- - **Read-only tasks** (research, search, exploring code) → Explore agent or general-purpose agent.
31
- - **Code authoring tasks** (writing/editing skill files, creating PRs) → general-purpose agent with `run_in_background: true`.
32
- - **Specialized tasks** → pick the agent whose description best matches the task. For example, use `pr-description-writer` for PR descriptions, `git-commit-crafter` for commits.
33
-
34
- If no specialized agent fits, use the general-purpose agent.
35
-
36
- ### Step 3 — Spawn the background agent
37
-
38
- Use the `Agent` tool with `run_in_background: true`. Write a self-contained prompt that:
39
-
40
- - States the exact goal and expected output.
41
- - Lists the files or directories involved (from the caller's context).
42
- - Includes any constraints (do not create a PR, do not push, etc.).
43
- - Specifies what success looks like.
44
-
45
- Example for a gotcha-adding task:
46
-
47
- ```
48
- Agent({
49
- description: "Add gotcha to skill file",
50
- prompt: "Add a gotcha entry to packages/claude-dev-env/skills/rebase/SKILL.md. The gotcha is: 'force-push --force-with-lease requires the full <branch>:<sha> format, not just the branch name.' Add it under the ## Gotchas section. If no ## Gotchas section exists, create one at the bottom of the file.",
51
- subagent_type: "general-purpose",
52
- run_in_background: true
53
- })
54
- ```
55
-
56
- ### Step 4 — Report spawn
57
-
58
- Confirm the agent was spawned and state its task in one sentence. The caller does not need to wait for completion — background agents notify on completion automatically.
59
-
60
- ## Constraints
61
-
62
- - Always use `run_in_background: true`. This skill is specifically for background delegation.
63
- - Never run the task inline in the main session. The point is to offload it.
64
- - If the task requires a PR, the spawned agent handles the full flow (branch → commit → push → PR).
65
- - Return control to the caller immediately after spawning. Do not poll for completion.
66
-
67
- ## Gotchas
68
-
69
- See the gotcha reference at the bottom of this file. When a new gotcha is discovered during use, invoke `/gotcha` to add it here.
@@ -1,55 +0,0 @@
1
- """Configuration constants for the bugteam CODE_RULES gate script."""
2
-
3
- from __future__ import annotations
4
-
5
- import re
6
-
7
- BUGTEAM_CODE_RULES_GATE_PREFIX: str = "bugteam_code_rules_gate: "
8
- EXIT_CODE_ENFORCER_MISSING: int = 2
9
- HUNK_HEADER_RAW_PATTERN: str = r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@"
10
- MAXIMUM_ISSUES_TO_REPORT: int = 3
11
- MAX_VIOLATIONS_PER_CHECK: int = 3
12
- MAXIMUM_COLUMN_TUPLE_ELEMENT_COUNT: int = 2
13
- PYTHON_FILE_EXTENSION: str = ".py"
14
- VIOLATION_LINE_RAW_PATTERN: str = r"^Line (\d+):"
15
-
16
- FUNCTION_LENGTH_VIOLATION_PATTERN: re.Pattern[str] = re.compile(
17
- r"\(defined at line (\d+)\) is (\d+) lines"
18
- )
19
- FUNCTION_LENGTH_DEFINITION_LINE_GROUP_INDEX: int = 1
20
- FUNCTION_LENGTH_SPAN_GROUP_INDEX: int = 2
21
-
22
- ISOLATION_VIOLATION_PATTERN: re.Pattern[str] = re.compile(
23
- r"\(defined at line (\d+), spanning (\d+) lines\)"
24
- )
25
- ISOLATION_DEFINITION_LINE_GROUP_INDEX: int = 1
26
- ISOLATION_SPAN_GROUP_INDEX: int = 2
27
-
28
- BANNED_NOUN_VIOLATION_PATTERN: re.Pattern[str] = re.compile(
29
- r"\(binding span at line (\d+), spanning (\d+) lines\)"
30
- )
31
- BANNED_NOUN_DEFINITION_LINE_GROUP_INDEX: int = 1
32
- BANNED_NOUN_SPAN_GROUP_INDEX: int = 2
33
-
34
- INLINE_DUPLICATE_BODY_VIOLATION_PATTERN: re.Pattern[str] = re.compile(
35
- r"\(inline duplicate body spans: helper at line (\d+) spanning (\d+) lines, "
36
- r"enclosing at line (\d+) spanning (\d+) lines\)"
37
- )
38
- INLINE_DUPLICATE_BODY_HELPER_LINE_GROUP_INDEX: int = 1
39
- INLINE_DUPLICATE_BODY_HELPER_SPAN_GROUP_INDEX: int = 2
40
- INLINE_DUPLICATE_BODY_ENCLOSING_LINE_GROUP_INDEX: int = 3
41
- INLINE_DUPLICATE_BODY_ENCLOSING_SPAN_GROUP_INDEX: int = 4
42
-
43
- ALL_CODE_FILE_EXTENSIONS: frozenset[str] = frozenset(
44
- {".py", ".js", ".ts", ".tsx", ".jsx"}
45
- )
46
- ALL_COLUMN_MAGIC_FALSE_VALUES: frozenset[str] = frozenset(
47
- {"true", "false", "none", "null"}
48
- )
49
- ALL_GIT_DIFF_CACHED_ARGS: tuple[str, ...] = (
50
- "git",
51
- "diff",
52
- "--cached",
53
- "--name-only",
54
- "-z",
55
- )
@@ -1,26 +0,0 @@
1
- """Configuration constants for bugteam_fix_hookspath auto-remediation script."""
2
-
3
- from __future__ import annotations
4
-
5
- HOOKS_PATH_SUFFIX: str = "hooks/git-hooks"
6
-
7
- ALL_CANONICAL_HOOKS_DIRECTORY_COMPONENTS: tuple[str, str, str] = (
8
- ".claude",
9
- "hooks",
10
- "git-hooks",
11
- )
12
-
13
- ALL_HOME_ENV_VAR_NAMES: tuple[str, str] = ("HOME", "USERPROFILE")
14
-
15
- PREFLIGHT_NO_PYTEST_FLAG: str = "--no-pytest"
16
-
17
- PREFLIGHT_REPO_ROOT_FLAG: str = "--repo-root"
18
-
19
- ALL_GLOBAL_HOOKS_PATH_ARGUMENTS: tuple[str, ...] = (
20
- "git",
21
- "config",
22
- "--global",
23
- "--get",
24
- "core.hooksPath",
25
- )
26
- GIT_DIRECTORY_NAME: str = ".git"
@@ -1,35 +0,0 @@
1
- """Configuration constants for the bugteam preflight check script."""
2
-
3
- from __future__ import annotations
4
-
5
- BUGTEAM_PREFLIGHT_SKIP_ENV_VAR_NAME: str = "BUGTEAM_PREFLIGHT_SKIP"
6
- EXPECTED_HOOKS_PATH_SUFFIX: str = "hooks/git-hooks"
7
- ENFORCEMENT_ABSENT_MESSAGE: str = (
8
- "Git-side CODE_RULES enforcement is not active on this host.\n"
9
- "Run: npx claude-dev-env .\n"
10
- "Or set core.hooksPath at any scope, e.g.:\n"
11
- " git config --global core.hooksPath ~/.claude/hooks/git-hooks"
12
- )
13
- PYTEST_EXIT_CODE_NO_TESTS_COLLECTED: int = 5
14
- EXIT_CODE_HOOKS_PATH_CHECK_FAILED: int = 1
15
- ALL_DISCOVERY_IGNORE_DIRECTORIES: frozenset[str] = frozenset(
16
- {"site-packages", ".venv", "venv", "node_modules"}
17
- )
18
- BUGTEAM_PREFLIGHT_PREFIX: str = "bugteam_preflight: "
19
-
20
-
21
- ALL_GIT_CONFIG_HOOKS_PATH_ARGUMENTS: tuple[str, ...] = (
22
- "config",
23
- "--get",
24
- "core.hooksPath",
25
- )
26
- ALL_PRE_COMMIT_ARGUMENTS: tuple[str, ...] = (
27
- "pre-commit",
28
- "run",
29
- "--all-files",
30
- )
31
- GIT_DIRECTORY_NAME: str = ".git"
32
- PYTEST_INI_FILENAME: str = "pytest.ini"
33
- PYPROJECT_FILENAME: str = "pyproject.toml"
34
- PYPROJECT_PYTEST_SECTION_PREFIX: str = "[tool.pytest"
35
- PRE_COMMIT_CONFIG_FILENAME: str = ".pre-commit-config.yaml"
@@ -1,15 +0,0 @@
1
- # caveman
2
-
3
- Trims noise from conversational text in the current turn. Triggered by `/caveman`, `caveman this`, `trim this`, `make it terse`, or `caveman voice`.
4
-
5
- ## Purpose
6
-
7
- The inline counterpart to the `caveman` agent. When the user wants preamble, hedging, filler transitions, restatements, empty future-proofing, dead examples, or pleasantries stripped from the last assistant message or from text passed as an argument, this skill performs the trim directly in the main session — no `Agent` spawn. The entire reply is the trimmed text; no report, no commentary about what was cut.
8
-
9
- Use the `caveman` agent (`subagent_type: caveman`) when the input is a file path, a multi-section artifact that needs a structured report, or a delegated workflow.
10
-
11
- ## Key file
12
-
13
- | File | Purpose |
14
- |---|---|
15
- | `SKILL.md` | Instructions: resolve the source (argument or prior message), noise categories to cut, what to preserve verbatim, and the escape hatch for load-bearing spans. |
@@ -1,38 +0,0 @@
1
- ---
2
- name: caveman
3
- description: "Inline counterpart to the caveman agent — trim noise from `$ARGUMENTS` (or the previous assistant message) and reply with the trimmed text only, no report, no Agent spawn. Triggers: /caveman, caveman this, trim this, make it terse, caveman voice."
4
- argument-hint: "[text to trim, or omit and the model uses the previous assistant message]"
5
- ---
6
-
7
- # Caveman
8
-
9
- Inline counterpart to the `caveman` agent at `packages/claude-dev-env/agents/caveman.md`. Use this skill when the trim target is conversational text in the current turn rather than a separate file or multi-section artifact. The model performs the trim itself in the next reply — no `Agent` invocation, no structured report, just the trimmed text.
10
-
11
- ## Instructions
12
-
13
- 1. **Resolve the source.** If `$ARGUMENTS` is non-empty, that text is the trim source. Otherwise the source is the previous assistant message in the current conversation.
14
-
15
- 2. **Trim the same noise categories the agent trims:**
16
-
17
- | Noise type | Example |
18
- |---|---|
19
- | Preamble / recap | "As discussed above, this skill will..." |
20
- | Hedging | "This might, in some cases, potentially..." |
21
- | Filler transitions | "Now, moving on to..." / "It's worth noting that..." |
22
- | Restatement | the same point made twice in different words |
23
- | Empty future-proofing | parameters, sections, or fields with no current consumer |
24
- | Dead examples | examples that duplicate another example without adding coverage |
25
- | Pleasantries | "Hope this helps." / "Feel free to..." |
26
- | Vague qualifiers | "various", "several", "a number of" — replace with the actual count or cut |
27
-
28
- 3. **Preserve verbatim:** code, commands, paths, URLs, errors, JSON, schemas, frontmatter, counts, version strings, identifiers, safety/destructive-op language, and anything the user explicitly flagged as keep-as-is.
29
-
30
- 4. **Output only the trimmed text.** No `trimmed / removed / preserved-verbatim / flagged` report. No commentary about what was cut. No preamble like "Here is the trimmed version:". The trimmed text is the entire reply.
31
-
32
- ## Escape hatch
33
-
34
- If trimming would drop a safety warning, collapse a deliberate distinction, or you are unsure whether a span is load-bearing, leave that span in place verbatim. Do not flag, narrate, or ask about the preserved span — instruction 4 still applies, so the trimmed text (with the preserved span included) remains the entire reply. Terse is for noise, not for substance.
35
-
36
- ## When NOT to use
37
-
38
- Use the `caveman` agent (via `Task` / `Agent` tool with `subagent_type: caveman`) when the input is a file path, a multi-section artifact requiring the structured `trimmed / removed / preserved-verbatim / flagged` report, or any delegated workflow. This skill is for inline conversational text only.
@@ -1,17 +0,0 @@
1
- # code
2
-
3
- Activates strict code standards for the entire implementation session. Triggered by `/code`, `code standards`, `strict code`, `enforce standards`, or `implement with standards`.
4
-
5
- ## Purpose
6
-
7
- Prepends a set of binary completion criteria to every implementation task: no `Any`, no `cast()`, no `# type: ignore`, treated-as-immutable TypedDicts with explicit `_encode_*`/`_decode_*` functions, 100% statement and branch coverage, zero mocks, zero stubs, zero fallbacks, and proper module structure. Every criterion is pass-or-fail; partial credit does not exist.
8
-
9
- ## Key file
10
-
11
- | File | Purpose |
12
- |---|---|
13
- | `SKILL.md` | Sixteen numbered criteria (typing strictness, error handling, test coverage, DI hooks, DRY, TypedDict protocol, Redis boundary, TOML boundary, JSON recursive types, ASGI boundaries, dynamic import pattern, documentation, build infrastructure, lint gates, Protocol signature match, auth/credentials), plus gotchas for Windows PowerShell invocation and per-module `_test_hooks.py` placement. |
14
-
15
- ## Invocation note
16
-
17
- Invoke at the start of an implementation task. The standards persist for the full session. The skill refuses research or planning tasks and redirects them to `/anthropic-plan`.
@@ -1,178 +0,0 @@
1
- ---
2
- name: code
3
- description: >-
4
- Prepends strict code standards to every implementation session. Enforces
5
- strong typing, no Any, no casts, no type: ignore, treated-as-immutable
6
- TypedDicts, 100% test coverage, DRY, no mocks, no stubs, no fallbacks, and
7
- proper module structure. Triggers: /code, code standards, strict code, enforce
8
- standards, implement with standards.
9
- ---
10
-
11
- # Code Standards Enforcer
12
-
13
- Prepends these standards to every implementation session. Every criterion is binary — pass or fail. No partial credit.
14
-
15
- ## When this applies
16
-
17
- Invoke at the start of any implementation task. The standards persist for the entire session.
18
-
19
- **Refusal cases — first match wins:**
20
-
21
- - **Not an implementation task.** "This skill applies to code implementation. Ask me to implement something specific."
22
- - **Exploratory research or planning.** "Code standards are for implementation. Use /anthropic-plan for planning, then invoke /code when implementing."
23
-
24
- ## Gotchas
25
-
26
- - **`make check` must run from pwsh, not bash.** The Bash tool routes through Git Bash on Windows, where `make` may not be on PATH. Always use `pwsh -NoProfile -Command 'make check 2>&1 | Select-Object -Last 100; exit $LASTEXITCODE'` so the pipeline does not mask a non-zero exit code from make.
27
- - **`New-Item`, `Get-ChildItem`, `Remove-Item` are pwsh cmdlets.** Don't use them inside Bash tool calls. Use the PowerShell tool or prefix with `pwsh -NoProfile -Command`.
28
- - **`TypedDict` encode/decode must be manual.** Pydantic and similar frameworks bypass the strict validation pattern. Write `_encode_*` and `_decode_*` functions by hand.
29
- - **`_test_hooks.py` is per-module, not per-package.** Every module that has dependencies needs its own hooks file. A single `conftest.py` with mocks does not satisfy this rule.
30
- - **Protocol must match the real API exactly.** If the real class has `async def fetch(self, key: str) -> bytes`, the Protocol must declare the same signature. A mismatch is caught at type-check time by mypy strict mode.
31
-
32
- ---
33
-
34
- ## Completion criteria
35
-
36
- Every criterion below must be met before the change is complete.
37
-
38
- ### 1. Typing strictness
39
-
40
- Zero violations across the project's source, test, and script directories (adapt `src/`, `tests/`, `scripts/` to the project's actual layout):
41
-
42
- - No `Any`, `cast()`, `# type: ignore`, `# noqa`.
43
- - No `.pyi` files, stubs, or shims.
44
- - Mypy strict mode exits 0 with no errors.
45
- - All TypedDicts are treated as immutable after construction and carry explicit `_encode_*` / `_decode_*` functions.
46
- - All decode functions call `require_*` validation on every field.
47
- - Internal encoder is typed — no untyped dict intermediaries.
48
-
49
- ### 2. Error handling
50
-
51
- - No `try`/`except` in core logic that recovers, softens, or best-efforts a failure.
52
- - Failures propagate. Callers decide whether to handle.
53
- - APIs signal failure points through naming, docstrings, and test expectations — not by catching.
54
-
55
- ### 3. Test coverage
56
-
57
- - Test runner exits 0 with full statement and branch coverage (e.g. `pytest -n auto --cov --cov-branch --cov-report=term-missing` with paths adapted to the project layout) (requires pytest-xdist and pytest-cov).
58
- - Statement coverage: 100%. Branch coverage: 100%.
59
- - Zero mocks. Every test exercises actual code paths through fakes injected via DI hooks (see criterion 4).
60
- - Zero weak assertions. Every assert checks a specific, falsifiable property.
61
- - Zero fake tests (tests that pass without validating behavior).
62
-
63
- ### 4. Dependency injection
64
-
65
- - Every module that has external dependencies provides a `_test_hooks.py` with internal DI hooks (underscore = private). The hook file lives alongside the module it services.
66
- - A shared testing utility module exports public test helpers for consumers (adapt the path to the project's conventions, e.g. `Libs/testing.py`).
67
- - Production code sets hooks to real implementations at startup. Tests set them to fakes.
68
- - No `if`/`else` branching on test vs. production — call the hook directly.
69
-
70
- ### 5. Codebase standards
71
-
72
- - DRY: zero duplicate function bodies longer than 3 lines. Zero duplicate constant definitions.
73
- - No placeholder code, no dead code, no commented-out blocks.
74
- - No fallback paths, no back-compat shims, no legacy code.
75
- - No `TypeAlias`, no `TYPE_CHECKING` import guards.
76
-
77
- ### 6. TypedDict protocol
78
-
79
- - Every TypedDict has a paired `_encode_*` and `_decode_*` function.
80
- - Every decode calls `require_*` (non-null, type-check, range-check) on every field before returning.
81
- - Decode functions are the single point where untyped data becomes typed.
82
-
83
- ### 7. Redis boundary
84
-
85
- - Use module-level helper functions or a Protocol.
86
- - Never reference `Redis[Any]` in type annotations.
87
-
88
- ### 8. TOML boundary
89
-
90
- - No `TYPE_CHECKING` guard for TOML types.
91
- - Parse untyped dicts from TOML, then convert into TypedDict (no dataclasses) before use.
92
-
93
- ### 9. JSON recursive types
94
-
95
- - Bypass framework validation (e.g., Pydantic).
96
- - Parse with `json.loads()`, validate immediately with internal `_decode_*` / `_load_json_*` functions before any other use.
97
-
98
- ### 10. ASGI / framework boundaries
99
-
100
- - Define a Protocol for the minimal interface (e.g., `async def body() -> bytes`).
101
- - Never use `dict[str, Any]` in ASGI scopes.
102
- - Parse at the edge, validate immediately, propagate as strict types.
103
-
104
- ### 11. Dynamic import pattern
105
-
106
- When using `importlib.import_module()` + `getattr()`, the intermediate variables are untyped. Bind the final instance through a typed wrapper so the result carries a concrete type rather than `Any`:
107
-
108
- ```python
109
- import importlib
110
- from collections.abc import Callable
111
-
112
- mod = importlib.import_module("module_name")
113
- cls = getattr(mod, "ClassName")
114
-
115
- def _construct(klass: Callable[..., TheProtocol]) -> TheProtocol:
116
- return klass()
117
-
118
- instance = _construct(cls)
119
- ```
120
-
121
- ### 12. Documentation
122
-
123
- Google-style docstrings on every public function, method, and class:
124
-
125
- ```python
126
- def load_config(config_path: str) -> AppConfig:
127
- """Load and validate the application configuration from disk.
128
-
129
- Args:
130
- config_path: Absolute path to the TOML configuration file.
131
-
132
- Returns:
133
- A fully validated AppConfig TypedDict.
134
-
135
- Raises:
136
- FileNotFoundError: If config_path does not exist.
137
- ValidationError: If the parsed config fails require_* checks.
138
- """
139
- ```
140
-
141
- For a public function whose behavior needs a picture, lead the narrative with a diagram: one summary line, then a `::` literal block or a doctest showing a concrete input and its marked outcome, then a couple of short prose lines, then the `Args:` / `Returns:` sections. See `../../rules/plain-illustrative-docstrings.md` for the shape and a worked example.
142
-
143
- ### 13. Build infrastructure
144
-
145
- The project under development must contain:
146
-
147
- - `Makefile` with targets: `check`, `lint`, `test`, `coverage`.
148
- - `pyproject.toml` with `[tool.mypy]` strict mode, `[tool.pytest.ini_options]` with `addopts = -n auto` (requires pytest-xdist).
149
- - A lint guard script that covers the project's source, test, and script directories.
150
-
151
- ### 14. Lint gates
152
-
153
- - `make lint` runs mypy (strict), ruff, and the project's guard script.
154
- - All linters cover the project's source, test, and script directories.
155
- - `make lint` exits 0 before `make test` is valid.
156
-
157
- ### 15. Protocol signature match
158
-
159
- - Every Protocol's method signatures match the real API they abstract.
160
- - If the real API changes, the Protocol fails type-checking — no silent drift.
161
-
162
- ### 16. Auth, credentials, multi-tenancy
163
-
164
- - Auth and credential handling is explicit, typed, and testable.
165
- - Multi-tenant DB access uses typed connection factories, not string-formatted queries.
166
- - MCP-shared resources follow the same strictness as application code.
167
-
168
- ---
169
-
170
- ## Verification
171
-
172
- Each criterion returns either **at least one finding** OR **exactly one proof-of-absence** with at least 3 adversarial probes specific to that criterion. A criterion returning neither is a protocol gap.
173
-
174
- ## File index
175
-
176
- | File | Purpose |
177
- |------|---------|
178
- | `SKILL.md` | Hub — binary criteria, gotchas, when-to-apply, verification protocol |
@@ -1,17 +0,0 @@
1
- # deep-research
2
-
3
- Runs an iterative multi-source research pipeline that produces a comprehensive Obsidian report with citations. Triggered by `/deep-research [topic]`.
4
-
5
- ## Purpose
6
-
7
- The skill operates in two phases. Phase 1 (main thread) turns the raw topic into a precise research brief through a short AskUserQuestion session covering audience, scope, recency, and depth. Phase 2 delegates to the `deep-research` agent with the confirmed brief and an iteration budget (8 / 15 / 25 based on depth preference). The agent handles iteration, state tracking, and Obsidian output.
8
-
9
- ## Key file
10
-
11
- | File | Purpose |
12
- |---|---|
13
- | `SKILL.md` | Phase 1 steps (classify, ask, construct `<research_brief>` XML, set iteration budget) and Phase 2 spawn instructions, including `mode: bypassPermissions` for unrestricted web access. |
14
-
15
- ## Post-run cleanup
16
-
17
- After the agent returns, the skill summarizes the Obsidian path, source counts, and any gaps, then deletes the `.deep-research-state.md` temp file.
@@ -1,80 +0,0 @@
1
- ---
2
- name: deep-research
3
- description: "Deep Research mode — iterative multi-source research producing comprehensive Obsidian reports with citations. Official-docs-first methodology. Triggers: '/deep-research [topic]'"
4
- argument-hint: "TOPIC or RESEARCH QUESTION"
5
- ---
6
-
7
- # Deep Research
8
-
9
- You orchestrate a two-phase deep research pipeline. Phase 1 happens here (main thread). Phase 2 is delegated to the `deep-research` agent.
10
-
11
- ## Phase 1: Build the Research Prompt (Interactive Q&A)
12
-
13
- The user's raw topic is: `$ARGUMENTS`
14
-
15
- Your job is to turn this raw topic into a precise, well-scoped research brief using prompt-generator methodology. Follow these steps:
16
-
17
- ### Step 1: Classify and assess
18
-
19
- Silently determine:
20
- - **Complexity**: Is this a narrow factual question or a broad landscape survey?
21
- - **Ambiguity**: Can you research this as-is, or does it need scoping?
22
- - **Official docs**: Does this topic have official vendor/creator documentation? If yes, that is the primary source and must be consulted first.
23
-
24
- ### Step 2: Ask clarifying questions
25
-
26
- Use AskUserQuestion to ask 1-3 questions. Choose from these dimensions based on what's genuinely unclear — skip any that are obvious from context:
27
-
28
- - **Audience**: "Who is this research for?" (options: technical deep-dive, executive summary, personal learning, decision support)
29
- - **Scope**: "Should I focus on a specific angle or survey the full landscape?" (options: specific angle with description field, broad survey, compare specific alternatives)
30
- - **Recency**: "How important is recency?" (options: last 6 months only, last 1-2 years, historical overview, doesn't matter)
31
- - **Depth**: "How deep should this go?" (options: quick overview 5-10 sources, standard 15-20 sources, exhaustive 25+ sources)
32
-
33
- Skip clarification entirely only if the topic is already narrow, unambiguous, and the audience is obvious.
34
-
35
- ### Step 3: Construct the research brief
36
-
37
- From the user's answers, write a structured research brief:
38
-
39
- ```
40
- <research_brief>
41
- <topic>The original topic, cleaned up</topic>
42
- <official_docs>Known official documentation sources, or "none identified" if the topic lacks vendor docs</official_docs>
43
- <scope>Exactly what to research — boundaries, inclusions, exclusions</scope>
44
- <audience>Who this is for and what they need</audience>
45
- <depth>Target source count and iteration budget</depth>
46
- <output>What the final deliverable looks like</output>
47
- <key_questions>
48
- 1. Specific question the research must answer
49
- 2. Another specific question
50
- 3. ...
51
- </key_questions>
52
- </research_brief>
53
- ```
54
-
55
- Show the brief to the user. Ask: "Does this capture what you need, or should I adjust the scope?"
56
-
57
- ### Step 4: Set iteration budget
58
-
59
- Map the user's depth preference to iteration count:
60
- - Quick overview: 8 iterations
61
- - Standard (default): 15 iterations
62
- - Exhaustive: 25 iterations
63
-
64
- ## Phase 2: Launch the Research Agent
65
-
66
- Once the brief is confirmed, spawn the `deep-research` agent using the Agent tool with:
67
-
68
- - **subagent_type**: `deep-research`
69
- - **prompt**: The full `<research_brief>` XML block from Step 3, plus the iteration budget
70
- - **mode**: `bypassPermissions` (research agent needs unrestricted tool access for web searches)
71
- - **description**: "Deep research: [short topic summary]"
72
-
73
- The agent handles everything from here: iteration, state tracking, and Obsidian output.
74
-
75
- When the agent returns, summarize:
76
- 1. Where the report was saved (Obsidian path)
77
- 2. How many sources were consulted (official vs secondary)
78
- 3. Any gaps or limitations noted
79
-
80
- Then clean up temporary files: `.deep-research-state.md`