claude-dev-env 1.92.0 → 1.93.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 (216) hide show
  1. package/CLAUDE.md +5 -39
  2. package/_shared/CLAUDE.md +2 -1
  3. package/_shared/advisor/CLAUDE.md +21 -0
  4. package/_shared/advisor/advisor-protocol.md +142 -0
  5. package/_shared/advisor/scripts/config/advisor_scripts_constants/__init__.py +1 -0
  6. package/_shared/advisor/scripts/config/advisor_scripts_constants/model_tier_run_validator_constants.py +86 -0
  7. package/_shared/advisor/scripts/model_tier_run_validator.py +246 -0
  8. package/_shared/advisor/scripts/pyproject.toml +3 -0
  9. package/_shared/advisor/scripts/tests/test_model_tier_run_validator.py +302 -0
  10. package/_shared/advisor/scripts/tests/test_tier_model_ids.py +180 -0
  11. package/_shared/advisor/scripts/tier_model_ids.py +164 -0
  12. package/_shared/pr-loop/CLAUDE.md +1 -0
  13. package/_shared/pr-loop/precatch-rubric.md +65 -0
  14. package/_shared/pr-loop/scripts/CLAUDE.md +1 -1
  15. package/_shared/pr-loop/scripts/code_rules_gate.py +137 -5
  16. package/_shared/pr-loop/scripts/post_audit_thread.py +1 -1
  17. package/_shared/pr-loop/scripts/pr_loop_shared_constants/CLAUDE.md +1 -1
  18. package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +16 -0
  19. package/_shared/pr-loop/scripts/pr_loop_shared_constants/reviews_disabled_constants.py +2 -1
  20. package/_shared/pr-loop/scripts/reviewer_availability.py +42 -12
  21. package/_shared/pr-loop/scripts/reviews_disabled.py +65 -21
  22. package/_shared/pr-loop/scripts/terminology_sweep.py +69 -21
  23. package/_shared/pr-loop/scripts/tests/CLAUDE.md +1 -1
  24. package/_shared/pr-loop/scripts/tests/fixtures/{copilot_internal_user_jonecho.json → copilot_internal_user_example.json} +1 -1
  25. package/_shared/pr-loop/scripts/tests/test_agent_config_carveout.py +1 -1
  26. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +146 -2
  27. package/_shared/pr-loop/scripts/tests/test_copilot_quota.py +8 -8
  28. package/_shared/pr-loop/scripts/tests/test_reviewer_availability.py +18 -5
  29. package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +56 -5
  30. package/_shared/pr-loop/scripts/tests/test_terminology_sweep.py +104 -17
  31. package/agents/CLAUDE.md +3 -2
  32. package/agents/clasp-deployment-orchestrator.md +2 -2
  33. package/agents/code-advisor.md +7 -5
  34. package/agents/code-verifier.md +6 -2
  35. package/agents/session-advisor.md +27 -0
  36. package/audit-rubrics/category_rubrics/category-j-code-rules-compliance.md +1 -1
  37. package/audit-rubrics/category_rubrics/category-k-codebase-conflicts.md +1 -1
  38. package/audit-rubrics/prompts/category-a-api-contracts.md +2 -2
  39. package/audit-rubrics/prompts/category-b-selector-engine-compat.md +2 -2
  40. package/audit-rubrics/prompts/category-c-resource-cleanup.md +2 -2
  41. package/audit-rubrics/prompts/category-d-scoping-and-ordering.md +2 -2
  42. package/audit-rubrics/prompts/category-e-dead-code.md +2 -2
  43. package/audit-rubrics/prompts/category-f-silent-failures.md +2 -2
  44. package/audit-rubrics/prompts/category-g-bounds-and-overflow.md +2 -2
  45. package/audit-rubrics/prompts/category-h-security-boundaries.md +2 -2
  46. package/audit-rubrics/prompts/category-i-concurrency.md +2 -2
  47. package/audit-rubrics/prompts/category-j-code-rules-compliance.md +2 -2
  48. package/audit-rubrics/prompts/category-k-codebase-conflicts.md +2 -2
  49. package/audit-rubrics/prompts/category-l-behavior-equivalence.md +2 -2
  50. package/audit-rubrics/prompts/category-m-producer-consumer-cardinality.md +2 -2
  51. package/audit-rubrics/prompts/category-n-test-name-scenario-verifier.md +2 -2
  52. package/audit-rubrics/prompts/category-o-docstring-vs-impl-drift.md +2 -2
  53. package/audit-rubrics/prompts/category-p-name-vs-behavior-contract.md +2 -2
  54. package/bin/CLAUDE.md +1 -0
  55. package/bin/expand_home_directory_tokens.mjs +75 -0
  56. package/bin/install.mjs +21 -7
  57. package/bin/install.test.mjs +220 -10
  58. package/hooks/CLAUDE.md +1 -1
  59. package/hooks/blocking/CLAUDE.md +4 -1
  60. package/hooks/blocking/_path_setup.py +13 -0
  61. package/hooks/blocking/bash_pre_tool_use_dispatcher.py +281 -0
  62. package/hooks/blocking/code_rules_dead_module_constant.py +88 -16
  63. package/hooks/blocking/code_rules_enforcer.py +6 -0
  64. package/hooks/blocking/code_rules_imports_logging.py +34 -1
  65. package/hooks/blocking/code_rules_paths_syspath.py +1 -1
  66. package/hooks/blocking/code_rules_test_layout.py +272 -0
  67. package/hooks/blocking/nas_ssh_binary_enforcer.py +22 -12
  68. package/hooks/blocking/pii_prevention_blocker.py +781 -0
  69. package/hooks/blocking/pii_scanner.py +340 -0
  70. package/hooks/blocking/pre_tool_use_dispatcher.py +3 -3
  71. package/hooks/blocking/stop_dispatcher.py +84 -0
  72. package/hooks/blocking/test__path_setup.py +39 -0
  73. package/hooks/blocking/test_bash_dispatcher_interpreter_starts.py +61 -0
  74. package/hooks/blocking/test_bash_pre_tool_use_dispatcher.py +294 -0
  75. package/hooks/blocking/test_code_rules_enforcer_cross_skill_duplicate.py +1 -1
  76. package/hooks/blocking/test_code_rules_enforcer_dead_module_constant.py +51 -0
  77. package/hooks/blocking/test_code_rules_enforcer_dead_module_constant_read_cap.py +103 -0
  78. package/hooks/blocking/test_code_rules_enforcer_dot_test_pattern.py +1 -1
  79. package/hooks/blocking/test_code_rules_enforcer_file_global_constants.py +1 -1
  80. package/hooks/blocking/test_code_rules_enforcer_hardcoded_user_path.py +11 -11
  81. package/hooks/blocking/test_code_rules_enforcer_naive_datetime.py +1 -1
  82. package/hooks/blocking/test_code_rules_enforcer_same_file_inline_duplicate.py +1 -1
  83. package/hooks/blocking/test_code_rules_enforcer_test_layout.py +111 -0
  84. package/hooks/blocking/test_code_rules_enforcer_type_checking_scope.py +76 -0
  85. package/hooks/blocking/test_destructive_command_blocker.py +29 -9
  86. package/hooks/blocking/test_gh_body_arg_blocker.py +3 -3
  87. package/hooks/blocking/test_nas_ssh_binary_enforcer.py +96 -39
  88. package/hooks/blocking/test_pii_prevention_blocker.py +905 -0
  89. package/hooks/blocking/test_pii_prevention_windows_git_path.py +41 -0
  90. package/hooks/blocking/test_pii_scanner.py +165 -0
  91. package/hooks/blocking/test_pr_description_enforcer_pr_number.py +1 -1
  92. package/hooks/blocking/test_pre_tool_use_dispatcher.py +14 -13
  93. package/hooks/blocking/test_stop_dispatcher.py +187 -0
  94. package/hooks/blocking/test_verdict_directory_write_blocker.py +1 -1
  95. package/hooks/blocking/test_volatile_path_in_post_blocker.py +3 -3
  96. package/hooks/blocking/volatile_path_in_post_blocker.py +54 -5
  97. package/hooks/diagnostic/migrations/README.md +25 -26
  98. package/hooks/diagnostic/test_hook_log_extractor.py +10 -10
  99. package/hooks/hooks.json +10 -120
  100. package/hooks/hooks_constants/CLAUDE.md +12 -3
  101. package/hooks/hooks_constants/bash_pre_tool_use_dispatcher_constants.py +78 -0
  102. package/hooks/hooks_constants/dead_module_constant_constants.py +1 -0
  103. package/hooks/hooks_constants/hosted_hook_runner.py +73 -0
  104. package/hooks/hooks_constants/local_identity.py +182 -0
  105. package/hooks/hooks_constants/nas_ssh_binary_enforcer_constants.py +4 -37
  106. package/hooks/hooks_constants/pii_prevention_constants.py +299 -0
  107. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +4 -0
  108. package/hooks/hooks_constants/python_style_checks_constants.py +15 -0
  109. package/hooks/hooks_constants/stop_dispatcher_constants.py +26 -0
  110. package/hooks/hooks_constants/test_bash_pre_tool_use_dispatcher_constants.py +87 -0
  111. package/hooks/hooks_constants/test_hardcoded_user_path_constants.py +2 -2
  112. package/hooks/hooks_constants/test_hosted_hook_runner.py +101 -0
  113. package/hooks/hooks_constants/test_layout_constants.py +28 -0
  114. package/hooks/hooks_constants/test_local_identity.py +88 -0
  115. package/hooks/hooks_constants/test_session_env_cleanup_constants.py +1 -1
  116. package/hooks/hooks_constants/test_stop_dispatcher_constants.py +32 -0
  117. package/hooks/validators/README.md +5 -6
  118. package/hooks/validators/__init__.py +2 -2
  119. package/hooks/validators/python_style_checks.py +298 -243
  120. package/hooks/validators/run_all_validators.py +6 -0
  121. package/hooks/validators/test_python_style_checks.py +278 -163
  122. package/package.json +2 -2
  123. package/rules/CLAUDE.md +7 -1
  124. package/rules/bdd.md +1 -1
  125. package/rules/nas-ssh-invocation.md +6 -4
  126. package/rules/no-justification-noise.md +61 -0
  127. package/rules/testing.md +0 -2
  128. package/scripts/test_setup_project_paths.py +1 -1
  129. package/skills/CLAUDE.md +6 -3
  130. package/skills/_shared/pr-loop/scripts/_path_resolver.py +2 -2
  131. package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +1 -1
  132. package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +1 -1
  133. package/skills/_shared/pr-loop/scripts/test__path_resolver.py +42 -3
  134. package/skills/_shared/pr-loop/scripts/test_build_audit_prompt.py +11 -11
  135. package/skills/_shared/pr-loop/scripts/test_build_fix_prompt.py +26 -3
  136. package/skills/_shared/pr-loop/scripts/test_preflight_worktree.py +49 -25
  137. package/skills/autoconverge/CLAUDE.md +3 -3
  138. package/skills/autoconverge/SKILL.md +113 -35
  139. package/skills/autoconverge/reference/CLAUDE.md +2 -2
  140. package/skills/autoconverge/reference/convergence.md +44 -22
  141. package/skills/autoconverge/reference/gotchas.md +11 -0
  142. package/skills/autoconverge/reference/stop-conditions.md +23 -13
  143. package/skills/autoconverge/workflow/CLAUDE.md +2 -1
  144. package/skills/autoconverge/workflow/converge.clean-audit.test.mjs +15 -19
  145. package/skills/autoconverge/workflow/converge.contract.test.mjs +43 -42
  146. package/skills/autoconverge/workflow/converge.copilot-gate.test.mjs +141 -16
  147. package/skills/autoconverge/workflow/converge.fix-recovery.test.mjs +2 -2
  148. package/skills/autoconverge/workflow/converge.mjs +329 -68
  149. package/skills/autoconverge/workflow/converge.path-aware.test.mjs +1 -1
  150. package/skills/autoconverge/workflow/converge.precatch.test.mjs +152 -0
  151. package/skills/autoconverge/workflow/converge.run-input.test.mjs +3 -3
  152. package/skills/autoconverge/workflow/converge_multi.run-input.test.mjs +15 -15
  153. package/skills/autoconverge/workflow/test_convergence_summary.py +6 -6
  154. package/skills/bdd-protocol/SKILL.md +4 -5
  155. package/skills/bdd-protocol/references/anti-patterns.md +1 -1
  156. package/skills/bugteam/SKILL.md +8 -0
  157. package/skills/bugteam/reference/copilot-gap-analysis.md +20 -20
  158. package/skills/bugteam/reference/obstacles/audit-walk-categories.md +1 -1
  159. package/skills/bugteam/reference/team-setup.md +7 -5
  160. package/skills/bugteam/scripts/reflow_skill_md.py +1 -1
  161. package/skills/copilot-finding-triage/SKILL.md +124 -0
  162. package/skills/copilot-finding-triage/reference/tier-rubric.md +49 -0
  163. package/skills/copilot-finding-triage/scripts/conftest.py +8 -0
  164. package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/__init__.py +0 -0
  165. package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/config/__init__.py +0 -0
  166. package/skills/copilot-finding-triage/scripts/copilot_finding_triage_constants/config/notify_ntfy_constants.py +32 -0
  167. package/skills/copilot-finding-triage/scripts/notify_ntfy.py +192 -0
  168. package/skills/copilot-finding-triage/scripts/test_notify_ntfy.py +141 -0
  169. package/skills/copilot-finding-triage/templates/notification.md +34 -0
  170. package/skills/copilot-review/SKILL.md +8 -6
  171. package/skills/findbugs/SKILL.md +4 -0
  172. package/skills/fixbugs/SKILL.md +8 -7
  173. package/skills/gotcha/CLAUDE.md +2 -2
  174. package/skills/gotcha/SKILL.md +4 -4
  175. package/skills/log-audit/SKILL.md +4 -6
  176. package/skills/monitor-open-prs/CLAUDE.md +1 -1
  177. package/skills/monitor-open-prs/SKILL.md +6 -1
  178. package/skills/orchestrator/SKILL.md +184 -0
  179. package/skills/orchestrator-refresh/SKILL.md +37 -0
  180. package/skills/post-audit-findings/SKILL.md +5 -9
  181. package/skills/pr-consistency-audit/SKILL.md +5 -1
  182. package/skills/pr-converge/CLAUDE.md +1 -1
  183. package/skills/pr-converge/SKILL.md +86 -47
  184. package/skills/pr-converge/reference/CLAUDE.md +1 -1
  185. package/skills/pr-converge/reference/convergence-gates.md +20 -17
  186. package/skills/pr-converge/reference/examples.md +63 -47
  187. package/skills/pr-converge/reference/fix-protocol.md +15 -15
  188. package/skills/pr-converge/reference/ground-rules.md +11 -7
  189. package/skills/pr-converge/reference/multi-pr-orchestration.md +6 -5
  190. package/skills/pr-converge/reference/per-tick.md +129 -107
  191. package/skills/pr-converge/reference/state-schema.md +15 -10
  192. package/skills/pr-converge/scripts/check_convergence.py +5 -4
  193. package/skills/pr-converge/scripts/test_check_convergence.py +6 -4
  194. package/skills/pr-fix-protocol/SKILL.md +3 -8
  195. package/skills/pr-loop-cloud-transport/SKILL.md +102 -0
  196. package/skills/pr-loop-cloud-transport/reference/identity-and-hooks.md +40 -0
  197. package/skills/pr-loop-cloud-transport/reference/substitution-matrix.md +48 -0
  198. package/skills/pr-loop-lifecycle/SKILL.md +5 -9
  199. package/skills/pr-scope-resolve/SKILL.md +3 -6
  200. package/skills/privacy-hygiene/SKILL.md +114 -0
  201. package/skills/qbug/SKILL.md +8 -8
  202. package/skills/rebase/SKILL.md +5 -1
  203. package/skills/refine/SKILL.md +4 -5
  204. package/skills/reviewer-gates/SKILL.md +7 -11
  205. package/skills/session-log/SKILL.md +4 -1
  206. package/skills/skill-builder/SKILL.md +3 -6
  207. package/skills/structure-prompt/SKILL.md +4 -5
  208. package/skills/team-advisor/SKILL.md +32 -164
  209. package/skills/test_markdown_link_integrity.py +10 -6
  210. package/skills/update/SKILL.md +5 -1
  211. package/skills/usage-pause/SKILL.md +14 -5
  212. package/skills/usage-pause/scripts/resolve_usage_window.py +83 -5
  213. package/skills/usage-pause/scripts/test_resolve_usage_window.py +185 -17
  214. package/skills/usage-pause/scripts/usage_pause_constants/resolve_usage_window_constants.py +4 -3
  215. package/skills/verified-build/SKILL.md +4 -9
  216. package/skills/team-advisor-refresh/SKILL.md +0 -25
@@ -1,15 +1,11 @@
1
1
  ---
2
2
  name: pr-loop-lifecycle
3
3
  description: >-
4
- Opens and closes a PR-loop run: the .claude/** permission grant (with the
5
- auto-mode AskUserQuestion escalation when the classifier blocks it),
6
- worktree preflight and cwd routing, then the ordered close — conditional
7
- TeamDelete for team callers, worktree teardown, working-tree clean, PR
8
- description rewrite composed by the lead, the always-run permission
9
- revoke, and the caller-parameterized final report. Invoked by PR-loop
10
- orchestrators (bugteam, pr-converge, autoconverge, qbug) at run start and
11
- run end, including error exits; not for general git cleanup or permission
12
- management outside a PR loop.
4
+ Opens and closes a PR-loop run: the .claude/** permission grant, worktree
5
+ preflight, and cwd routing at the start; teardown, permission revoke, and
6
+ final report at the end. Invoked by PR-loop orchestrators (bugteam,
7
+ pr-converge, autoconverge, qbug); not for general git cleanup outside a PR
8
+ loop.
13
9
  ---
14
10
 
15
11
  # PR Loop Lifecycle
@@ -2,12 +2,9 @@
2
2
  name: pr-scope-resolve
3
3
  description: >-
4
4
  Resolves the audit/fix target for a PR-loop skill: owner, repo, PR number,
5
- head ref, base ref, PR URL, and starting head SHA via
6
- pull_request_read(method="get"), a search_pull_requests branch fallback, then a
7
- git merge-base upstream-diff fallback, ending in the canonical refusal line
8
- when no target exists. Invoked by PR-loop orchestrators (pr-converge,
9
- bugteam, qbug, findbugs, fixbugs) as their first step; not for general git
10
- questions or branch management.
5
+ head and base refs, PR URL, and head SHA, with a canonical refusal when no
6
+ target exists. Invoked by PR-loop orchestrators (pr-converge, bugteam, qbug,
7
+ findbugs, fixbugs) first; not for general git questions.
11
8
  ---
12
9
 
13
10
  # PR Scope Resolve
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: privacy-hygiene
3
+ description: Full-repo sweep for personal data and secrets before commit or durable GitHub post. Use when preparing a PR, cleaning a leak, or when `pii_prevention_blocker` denies a write, post, or commit. Triggers on "privacy hygiene", "personal data", "secret sweep", "sanitize repository", "/privacy-hygiene".
4
+ ---
5
+
6
+ # privacy-hygiene
7
+
8
+ ## Overview
9
+
10
+ Find and remove personal data and high-confidence secrets before they land in git history or a durable GitHub post. The `pii_prevention_blocker` hook blocks the common cases at write, post, and commit time. This skill is the full sweep when you need a broader pass or a remediation plan.
11
+
12
+ **Announce at start:** "Running privacy-hygiene sweep."
13
+
14
+ ## When to run a full sweep
15
+
16
+ - Before the first push of a branch that touched logs, screenshots, config samples, or machine-local paths
17
+ - After a hook block on email, home path, LAN address, or secret material
18
+ - Before opening a PR to a repository that is public (or will be made public)
19
+ - After pasting support tickets, env dumps, or terminal transcripts into the tree
20
+
21
+ ## What the automated gate blocks
22
+
23
+ | Category | Blocked examples | Allowed residual |
24
+ |---|---|---|
25
+ | Email | `person@company.io` | `user@example.com`, `user@example.org`, `user@example.net` |
26
+ | Home path | `C:/Users/realname/...`, `/Users/realname/...`, `/home/realname/...` | `C:/Users/example/...`, `C:/Users/<you>/...`, `/Users/alice/...` |
27
+ | LAN address | Unlisted `10.x` / `172.16–31.x` / `192.168.x` | Public addresses; product NAS `192.168.1.100`; other entries in `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` |
28
+ | Secret | `ghp_…`, `github_pat_…`, `AKIA…`, PEM private-key headers | Public keys, redacted `***`, env var names without values |
29
+
30
+ Surfaces:
31
+
32
+ 1. **Write / Edit / MultiEdit** — payload text about to land on disk (via PreToolUse dispatcher)
33
+ 2. **Durable posts** — `gh pr/issue create|comment|edit|review` bodies and GitHub MCP body/comment fields (Bash and PowerShell)
34
+ 3. **git commit** — staged blob text (non-exempt paths) on Bash and PowerShell, including `git.exe` and flag forms (`--no-verify`, `-c`, `-C`). Commit message bodies (`-m` / `-F`) are out of scope for the automated gate
35
+
36
+ ## Sweep procedure
37
+
38
+ ### 1. Scope the tree
39
+
40
+ ```
41
+ git status -sb
42
+ git diff --stat
43
+ git diff --cached --stat
44
+ ```
45
+
46
+ Prefer the branch diff vs `origin/main` for PR prep:
47
+
48
+ ```
49
+ git fetch origin main
50
+ git diff --name-only origin/main...HEAD
51
+ ```
52
+
53
+ ### 2. Search for high-confidence patterns
54
+
55
+ Run from the repo root (PowerShell-friendly example):
56
+
57
+ ```
58
+ rg -n --hidden -g '!node_modules' -g '!.git' -e '@[A-Za-z0-9.-]+\.[A-Za-z]{2,}' -e 'Users[/\\][^/\\]+' -e '/home/[^/]+' -e '\b(10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+)\b' -e '\b(ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{20,}\b' -e '\bgithub_pat_[A-Za-z0-9_]{20,}\b' -e '\bAKIA[0-9A-Z]{16}\b' -e '-----BEGIN [A-Z ]*PRIVATE KEY-----'
59
+ ```
60
+
61
+ Review each hit. Ignore:
62
+
63
+ - Test fixtures under `test_*.py` / `*_test.py` / `/tests/` (synthetic only)
64
+ - `LICENSE` / copyright notice identity that is intentional and public
65
+ - This package's own `pii_scanner` / `pii_prevention_constants` modules
66
+ - Documented placeholders (`user@example.com`, `C:/Users/<you>/`)
67
+
68
+ ### 3. Remediate
69
+
70
+ | Hit | Fix |
71
+ |---|---|
72
+ | Real email | Replace with `user@example.com` or remove |
73
+ | Home path | Use `Path.home()`, `~`, or `C:/Users/<you>/` |
74
+ | LAN address | Remove, use a hostname, or add to `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` only when tooling requires it |
75
+ | Credential material | Remove from the tree; rotate the credential; load from env/secret store |
76
+ | Already committed | Rewrite is not enough if already pushed — rotate secrets; scrub history only with explicit user approval |
77
+
78
+ ### 4. Re-check before commit / post
79
+
80
+ - Stage only clean files
81
+ - Prefer `--body-file` for `gh` posts (also required by the gh-body-file rule)
82
+ - Let `pii_prevention_blocker` re-run on the next Write / commit / post
83
+
84
+ ## Accepted residual (do not over-scrub)
85
+
86
+ - LICENSE copyright lines naming a legal person or org that owns the work
87
+ - Intentional public maintainer identity published on purpose
88
+ - Example domains reserved for documentation (`example.com` and siblings)
89
+ - Placeholder home users (`example`, `user`, `alice`, `<you>`, `YOUR_USER`)
90
+ - Product NAS host `192.168.1.100` (allowlisted for the NAS SSH rule/hook)
91
+ - Public addresses and docs that name private ranges without a live host (still prefer hostnames)
92
+
93
+ ## Enable on any machine / public repository
94
+
95
+ Install or reinstall the package so hooks and this skill land under `~/.claude/`:
96
+
97
+ ```
98
+ cd packages/claude-dev-env
99
+ node bin/install.mjs
100
+ ```
101
+
102
+ Hooks register via `hooks/hooks.json` into `~/.claude/settings.json`. Once installed, the same gates apply in every repository the agent touches — private or public.
103
+
104
+ ## Open knobs
105
+
106
+ - **NAS / LAN allowlist:** Unlisted private IPs are blocked. `192.168.1.100` is allowlisted for the NAS SSH enforcer. Add further hosts to `ALL_ALLOWLISTED_PRIVATE_IP_ADDRESSES` only when tooling requires them.
107
+ - **Public maintainer identity:** when a real email or name is intentional product surface, keep it and note that in the PR body so reviewers do not treat it as a leak.
108
+
109
+ ## What this skill does not do
110
+
111
+ - Does not rewrite git history without explicit user approval
112
+ - Does not rotate credentials for you
113
+ - Does not replace the write-time hook — it complements it
114
+ - Does not scan commit-message text (`-m` / `-F`); keep messages free of secrets yourself
@@ -1,14 +1,10 @@
1
1
  ---
2
2
  name: qbug
3
3
  description: >-
4
- Required baseline review for every new PR. Runs the /bugteam audit fix
5
- commit push cycle via one clean-coder subagent (not a full team), looping
6
- until convergence or stuck. Uses the same CODE_RULES gate, A–P category
7
- rubric, and per-loop PR review shape as /bugteam without TeamCreate,
8
- teammates, per-loop clean-room, or a loop cap. Invoke /bugteam instead for
9
- larger PRs that need per-loop bias isolation or a hard loop cap. Triggers:
10
- '/qbug', 'quick bug audit', 'solo bug audit', 'baseline PR review',
11
- 'bugteam without a team'.
4
+ Required baseline review for every new PR: runs the /bugteam audit, fix,
5
+ commit, and push cycle through one clean-coder subagent (not a full team),
6
+ looping until convergence or stuck. Triggers: '/qbug', 'quick bug audit',
7
+ 'solo bug audit', 'baseline PR review', 'bugteam without a team'.
12
8
  ---
13
9
 
14
10
  # qbug
@@ -25,6 +21,10 @@ Shared artifacts with /bugteam are referenced below by path, using the `${CLAUDE
25
21
  - **Audit contract** (finding schema, proof-of-absence, adversarial pass, Haiku secondary, post-fix self-audit, diagnostics JSON): [`_shared/pr-loop/audit-contract.md`](../../_shared/pr-loop/audit-contract.md)
26
22
  - PR comment lifecycle shape: [`bugteam/SKILL.md`](../bugteam/SKILL.md#audit-posting)
27
23
 
24
+ ## Transport check (before any GitHub step)
25
+
26
+ Run `command -v gh`; when it succeeds, run `gh auth status`; once the PR scope is resolved, run `gh api repos/<owner>/<repo> --jq .permissions.push` and take `true` as the pass. When any check fails, run the `pr-loop-cloud-transport` skill first and route every `gh` operation in this skill through its substitution matrix.
27
+
28
28
  ## When this skill applies
29
29
 
30
30
  `/qbug` once authorizes the full cycle (no loop cap — runs until `converged` or `stuck`; user can interrupt at any time).
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: rebase
3
- description: Rebase a branch onto its base ref with the verification gates needed to catch logically broken results before pushing. Use when the user invokes `/rebase`, says "rebase this branch", "PR has merge conflicts", "rebase onto main", or asks for a force-push to update a remote branch's history. Critical for stacked PRs where the base merged via squash, and for any rebase that includes deletions or renames.
3
+ description: >-
4
+ Rebases a branch onto its base ref with the verification gates that catch
5
+ logically broken results before pushing. Use when the user invokes `/rebase`,
6
+ says 'rebase this branch', 'PR has merge conflicts', or 'rebase onto main', or
7
+ asks for a force-push to update a remote branch's history.
4
8
  ---
5
9
 
6
10
  # /rebase
@@ -1,11 +1,10 @@
1
1
  ---
2
2
  name: refine
3
3
  description: >-
4
- Interview-driven plan refiner with built-in audit loop: fans out research agents,
5
- interviews via AskUserQuestion (mandatory survives no-question directives), writes
6
- the plan to the Obsidian vault under Research/<topic>/<slug>.md, then loops audit and
7
- fix until clean. Triggers: /refine, "refine this", "turn this into a plan", "flesh
8
- this out", "make a spec for this", "let's plan this out", or any vague idea to mature
4
+ Interview-driven plan refiner: fans out research agents, interviews through
5
+ AskUserQuestion, writes to the Obsidian vault, then loops audit and fix.
6
+ Triggers: /refine, 'refine this', 'turn this into a plan', 'flesh this out',
7
+ 'make a spec for this', 'let's plan this out', or any vague idea to mature
9
8
  into a plan.
10
9
  ---
11
10
 
@@ -1,16 +1,10 @@
1
1
  ---
2
2
  name: reviewer-gates
3
3
  description: >-
4
- Runs the availability gates a PR-loop orchestrator checks before engaging an
5
- external reviewer: the CLAUDE_REVIEWS_DISABLED opt-out parse (bugbot,
6
- bugteam, and copilot tokens via reviews_disabled.py), the once-per-run
7
- Copilot premium-quota pre-check (copilot_quota.py with copilot_down
8
- semantics), and the Cursor Bugbot trigger/acknowledge/CI-detect flow
9
- (check_bugbot_ci.py with the literal `bugbot run` comment). Invoked by
10
- PR-loop orchestrators — pr-converge, autoconverge, bugteam, qbug, findbugs,
11
- copilot-review, monitor-open-prs — at run start and at each reviewer
12
- engagement point. Not a general code-review skill; it decides whether a
13
- reviewer runs, never what the reviewer finds.
4
+ Runs the availability gates a PR-loop orchestrator checks before it starts an
5
+ external reviewer: the CLAUDE_REVIEWS_DISABLED opt-out, the once-per-run
6
+ Copilot quota pre-check, and the Cursor Bugbot trigger, acknowledge, and
7
+ CI-detect flow. Decides whether a reviewer runs, never what it finds.
14
8
  ---
15
9
 
16
10
  # Reviewer Gates
@@ -34,13 +28,15 @@ The `CLAUDE_REVIEWS_DISABLED` environment variable is a comma-separated token li
34
28
  | `bugbot` | Cursor Bugbot triggering and polling |
35
29
  | `copilot` | GitHub Copilot review requests and polling |
36
30
 
31
+ Cursor Bugbot is off by default: it runs only when `CLAUDE_REVIEWS_ENABLED` lists `bugbot`, and a `bugbot` token in `CLAUDE_REVIEWS_DISABLED` keeps it off even when the opt-in lists it.
32
+
37
33
  Run the shared parser — never an inline shell parse:
38
34
 
39
35
  ```bash
40
36
  python "$HOME/.claude/_shared/pr-loop/scripts/reviews_disabled.py" --reviewer <bugbot|bugteam|copilot>
41
37
  ```
42
38
 
43
- - **Exit 0** — the named reviewer is opted out. A skill whose whole run depends on that reviewer responds with its refusal line and stops. The template: `/<caller> is disabled via CLAUDE_REVIEWS_DISABLED.` A loop that merely includes the reviewer as one gate marks the reviewer down (`bugbot_down = true`, `copilot_down = true`) and continues on its remaining signals.
39
+ - **Exit 0** — the named reviewer is disabled for this run (opted out, or, for Bugbot, off by default without the `CLAUDE_REVIEWS_ENABLED` opt-in). A skill whose whole run depends on that reviewer responds with its refusal line and stops. A copilot- or bugteam-dependent caller names the opt-out: `/<caller> is disabled via CLAUDE_REVIEWS_DISABLED.` A Bugbot-dependent caller off by default names the opt-in the run needs: `/<caller> is disabled: Cursor Bugbot needs a bugbot token in CLAUDE_REVIEWS_ENABLED.` A loop that merely includes the reviewer as one gate marks the reviewer down (`bugbot_down = true`, `copilot_down = true`) and continues on its remaining signals.
44
40
  - **Exit 1** — the reviewer is available; continue.
45
41
 
46
42
  ## Gate 2: Copilot quota pre-check (once per run)
@@ -1,7 +1,10 @@
1
1
  ---
2
2
  name: session-log
3
3
  description: >-
4
- Log a session report by composing a self-contained HTML page and publishing it with the Artifact tool, then track vault context, extract unrecorded decisions, tidy the project's session folder, and output a /rename command. Use when the user says /session-log, journal this session, log this work, session report, or any variation of "summarize/log/record this session". Also triggers on "save session", "capture session", or "document what we did".
4
+ Logs a session report as an HTML page, tracks vault context, extracts
5
+ decisions, and outputs a /rename command. Use for /session-log, 'journal this
6
+ session', 'log this work', 'session report', 'summarize/log/record this
7
+ session', 'save session', 'capture session', or 'document what we did'.
5
8
  ---
6
9
 
7
10
  # Session Log
@@ -1,12 +1,9 @@
1
1
  ---
2
2
  name: skill-builder
3
3
  description: >-
4
- Orchestrates the complete skill-building lifecycle using best-practice-driven
5
- development. Routes through type classification, folder scaffolding, skill
6
- writing (via skill-writer), self-audit against a 38-point checklist, and
7
- iterative refinement from real usage observations. Use when creating new
8
- skills, improving existing skills, or optimizing skill descriptions.
9
- Triggers: 'build a skill', 'new skill workflow', 'improve this skill',
4
+ Runs the skill-building lifecycle: type classification, scaffolding, writing
5
+ through skill-writer, self-audit against a checklist, and refinement from real
6
+ usage. Triggers: 'build a skill', 'new skill workflow', 'improve this skill',
10
7
  'optimize skill description', 'skill development lifecycle'.
11
8
  ---
12
9
 
@@ -1,11 +1,10 @@
1
1
  ---
2
2
  name: structure-prompt
3
3
  description: >-
4
- Restructure a user-provided prompt: order blocks, replace persona framing with task
5
- constraints, enforce per-category dispositions, expand placeholder tokens via the
6
- sibling rubric or AskUserQuestion, add file:line citations, mark the canonical
7
- sub-bucket, sharpen adversarial-pass phrasing. Triggers: /structure-prompt, "optimize
8
- this prompt", "minimally invasive edit" to a prompt artifact, "tighten this prompt".
4
+ Restructures a user-provided prompt: orders blocks, swaps persona framing for
5
+ task constraints, expands placeholder tokens, and adds file:line citations.
6
+ Triggers: /structure-prompt, 'optimize this prompt', 'minimally invasive edit'
7
+ to a prompt artifact, or 'tighten this prompt'.
9
8
  ---
10
9
 
11
10
  # structure-prompt
@@ -1,188 +1,56 @@
1
1
  ---
2
2
  name: team-advisor
3
3
  description: >-
4
- Turns the session into the advisor-orchestrator the user's sole interface,
5
- to plan
6
- and delegate while workflow-backed agent spawns do the token-heavy
7
- execution with the required agent type and model for each work category.
8
- Executors do the code editing, verification, script driving, PR
9
- descriptions, and searches; the advisor answers blockers with one of three
10
- brief signals — a plan, a correction, or a stop. The advisor never edits
11
- code or runs tests itself. Caps consultations per task (default 5), reuses
12
- warm workflow agents before spawning new ones, and re-asserts the
13
- discipline every 20 minutes through the /team-advisor-refresh loop. Adapts
14
- Anthropic's coordinator pattern (plan big, execute small) to Claude Code.
15
- Triggers: '/team-advisor', 'team advisor strategy', 'run with a team
16
- advisor', 'executor-advisor mode', 'team advisor enforcement', 'agent
17
- routing', 'orchestrate'.
4
+ Spawn one warm session-advisor at the strongest reachable tier and consult
5
+ it before big decisions, completion, commits, or when stuck. Triggers:
6
+ 'team-advisor', 'team advisor', 'second opinion', 'advisor', 'consult',
7
+ 'verify', 'validate', 'commit', 'push'.
18
8
  ---
19
9
 
20
- # Team Advisor Strategy
10
+ # Team Advisor
21
11
 
22
12
  ## Principle
23
13
 
24
- A frontier model plans and synthesizes while cheap workers do the
25
- token-heavy reading and doing — Anthropic's coordinator pattern, source:
26
- https://github.com/anthropics/claude-cookbooks/blob/main/managed_agents/CMA_plan_big_execute_small.ipynb
27
- ("Coordinator pattern: big models for planning, small models for
28
- execution"). On the cookbook's own measured run, a coordinator
29
- delegating to Sonnet-5 workers came out cheaper and faster
30
- than a solo frontier agent held to the same verification rigor, with
31
- 84-98% of the team's input tokens billed at the worker rate.
14
+ One warm, addressable advisor available at the strongest model tier the session can reach. The session sends concise briefs when a decision benefits from a second opinion: before acting on a plan, at completion, before commits, when stuck, when reconsidering the approach, or when an agent deems it necessary and beneficial to the user's goals.
32
15
 
33
- Claude Code has no `multiagent` coordinator field or Managed-Agents-style
34
- `create_agent`/`send_to_agent` primitives; this skill reaches the same
35
- shape with the tools Claude Code already has. Under this skill the session
36
- is the advisor-orchestrator. In Claude Code the user always talks to the session and never to a
37
- subagent, so the session is the user's sole interface: all user-facing
38
- communication flows through it. It spawns and resumes executor subagents
39
- — `clean-coder` and the like — and those executors do every bit of the
40
- execution: the code edits, the build runs, the test runs. The advisor
41
- drives the plan and answers the executors when they get stuck.
16
+ ## Follow the shared protocol
42
17
 
43
- ## Gotchas
18
+ **Detect the host profile first** (Host profiles in
19
+ [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
20
+ — e.g. `ADVISOR_HOST_PROFILE` or `GROK_BUILD`). Do not start a model-floor
21
+ walk until the host is known.
44
22
 
45
- - **Double invocation duplicates the reminder loop.** A second `/team-advisor`
46
- in the same session schedules a second refresh loop. Check whether the loop
47
- is already running before you schedule one (see the invocation guard in
48
- Process step 1).
49
- - **The advisor never executes.** The moment it edits a file or runs the tests
50
- itself, the pairing breaks and the executor's warm context is wasted. Hand
51
- every code edit and every build or test run to an executor; keep the
52
- advisor's own tool use to orchestration and light verification reads.
53
- - **Flat ad hoc spawns bypass routing.** Every execution task goes through a
54
- workflow-backed spawn or workflow resume so the required agent type, model,
55
- prompt packet, and sidecar metadata stay attached to the work.
56
- - **Wrong agent or model is an enforcement failure.** If a task category maps
57
- to `clean-coder` on `opus`, a `general-purpose` Sonnet spawn is not a cost
58
- optimization; it is the wrong executor for the contract.
59
- - **Resuming an unnamed background agent needs its agentId.** A background
60
- spawn returns an `agentId` (format `a...-...`); keep it so `SendMessage` can
61
- reach that agent later. A named agent is reachable by name.
62
- - **Consultations past the cap signal a scoping problem.** When five
63
- consultations do not clear the blocker, the task needs re-scoping or a
64
- hand-off to the user — not a sixth round of advice.
23
+ This session is the shared advisor's sole consumer, so its model floor is
24
+ simply this session's own tier no routing table to take a max against.
65
25
 
26
+ **Claude host:** follow the shared protocol for the model-floor walk, the
27
+ warm-up spawn and charter, the consult format and cadence, drift-respawn, and
28
+ the CLI fallback — using `team-advisor-agent` as the name and this session as
29
+ the only consumer (skip the "who you are and your assignment" opener in each
30
+ consult; a single-consumer session doesn't need it).
66
31
 
67
- ## Process
68
-
69
- 1. **Check whether the refresh loop is already running this
70
- session. If it is, skip straight to orchestration — do not schedule a
71
- second loop.
72
-
73
- 2. **Register the discipline reminder.** By default, schedule it with
74
- `ScheduleWakeup` at `delaySeconds: 1200`, prompt `/team-advisor-refresh`,
75
- where each refresh re-schedules the next one — a 1200-second wakeup costs
76
- one prompt-cache miss per firing and nothing more (see Gotchas). The loop
77
- mechanism (`/loop 20m /team-advisor-refresh`) is the escape hatch when
78
- `ScheduleWakeup` is not available. Either way the reminder is the
79
- enforcement surface: each firing re-asserts the discipline while the run is
80
- in flight.
81
-
82
- 3. **Orchestrate the task.** Hold the plan and the user conversation. Execute
83
- workflow-backed spawns or resumes using the routing table below, and keep
84
- driving while they work. Your own tool use stays orchestration and light
85
- verification reads. Keep your task list updated religiously.
86
-
87
- ## Workflow Agent Routing
88
-
89
- Every delegated task runs through a workflow-backed agent invocation. Do not
90
- spawn a flat subagent directly when a workflow invocation or workflow resume is
91
- available.
92
-
93
- | Work | Agent type | Model |
94
- |---|---|---|
95
- | Feature, bug, and refactor coding | `clean-coder` | `opus` |
96
- | Verification passes | `code-verifier` | `opus` |
97
- | Script runs, GitHub posting, and backfill driving | `general-purpose` runner | `sonnet` |
98
- | PR descriptions | `pr-description-writer` | `sonnet`, with file-list grounding check |
99
- | Fan-out searches and checklist verification reads | `Explore` | `haiku`; use `sonnet` when judgment-heavy |
100
- | Escalated blockers needing a second opinion beyond the orchestrator's own judgment | `code-advisor` | Fable preferred (matches the orchestrating session); opus if Fable is unavailable. |
101
-
102
- Routing rules:
103
-
104
- - Use a workflow invocation or resume for each row above. The workflow prompt
105
- must name the selected agent type, model, work category, task scope, and
106
- expected output.
107
- - Resume a warm workflow agent before creating a new workflow run when the warm
108
- agent holds the relevant context.
109
- - `clean-coder` owns code edits. `code-verifier` owns verification. The same
110
- workflow agent never grades work it wrote.
111
- - PR-description workflows include the actual changed-file list in the prompt
112
- and verify the final body against that file list before posting or returning
113
- it.
114
- - Exploration workflows return file paths, line numbers, and direct evidence;
115
- they do not write code or mutate repo state.
116
-
117
- 4. **Executors consult at a hard decision.** Each executor's spawn prompt tells
118
- it to stop and message you — with the task, what it tried, and the exact
119
- blocker (plus any short code excerpt that helps) — when one of these holds:
120
- - It has tried the same problem twice or more and it still fails.
121
- - A decision changes the deliverable's scope or a contract that is hard to
122
- reverse.
123
- - Two constraints conflict and it cannot satisfy both.
124
- - It is unsure whether to stop or keep going.
125
-
126
- 5. **Answer with one signal.** On a consultation, reply with exactly one
127
- signal, brief (about 400 to 700 tokens):
128
- - **PLAN** — a different approach, as concrete ordered steps the executor
129
- can run. When a warm agent fits the plan, name which one to resume.
130
- - **CORRECTION** — the executor's approach is right, one thing is wrong;
131
- name the wrong step and the fix.
132
- - **STOP** — no path satisfies the task as assigned; say why so it can be
133
- reported upward.
134
- The executor resumes the moment your reply lands.
135
-
136
- A worked consultation:
137
-
138
- ```
139
- Executor → advisor
140
- Task: add a retry to the upload client.
141
- Tried: wrapped upload() in a three-attempt loop; the second attempt
142
- double-posts.
143
- Blocker: the server takes no idempotency key, so a retry after a timeout
144
- creates a duplicate record.
145
-
146
- Advisor → executor
147
- CORRECTION — the retry loop is right; the missing piece is a stable request
148
- id. Generate one client-side on the first attempt and send the same id on
149
- every retry, so the server treats the retries as one request.
150
- ```
151
-
152
- For a decision the advisor itself cannot settle, it may use a workflow
153
- escalation to the tool-less `code-advisor` agent for a second opinion — an
154
- optional escalation, not a required step.
155
-
156
- ## Agent reuse (non-negotiable)
157
-
158
- - **Resume before you spawn, always.** A warm agent carries its context and
159
- cached tokens; a fresh spawn starts cold and pays to rebuild both.
160
- Resume the existing workflow agent by name or `agentId` when it holds
161
- relevant context. Prefer that path every time an existing workflow agent
162
- matches the routing table.
163
- - **Spawn a fresh agent only when** no existing agent holds relevant context,
164
- or a genuine task switch needs a clean context.
165
- - **Name the agent to resume.** When you answer with a PLAN and a warm agent
166
- fits, say which agent to resume and where.
32
+ **Grok host:** use the self-as-advisor path in the shared protocol: this
33
+ session answers ENDORSE / CORRECTION / PLAN / STOP itself. Do not spawn a
34
+ Claude `session-advisor` subagent and do not walk the Claude multi-tier
35
+ ladder.
167
36
 
168
37
  ## Constraints
169
38
 
170
- - One `/team-advisor` per session; the invocation guard blocks a second
171
- reminder loop.
172
- - The advisor orchestrates and advises but never edits code or runs a build or
173
- test itself executors do that.
174
- - Delegated execution uses workflow-backed agent invocations and follows the
175
- Workflow Agent Routing table exactly.
176
- - Consultations are capped at five per task by default. At the cap, re-scope
177
- or hand off; do not keep answering.
178
- - Reuse a warm agent over a cold spawn whenever one holds relevant context.
39
+ - One `team-advisor-agent` per session, owned by this session for its whole
40
+ lifecycle (spawn, drift-respawn, shutdown) — see
41
+ [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
42
+ - Never spawn the warm agent, or its CLI fallback, at a tier below this
43
+ session's own tier.
44
+ - The warm agent (or its CLI equivalent) only answers. It never edits a
45
+ file, never runs a build or test, and never posts anything on the
46
+ session's behalf.
179
47
 
180
48
  ## File Index
181
49
 
182
50
  | File | Purpose |
183
51
  |---|---|
184
- | `SKILL.md` | Advisor strategy, workflow routing contract, consultation protocol, reuse rules, and constraints. |
52
+ | `SKILL.md` | Pointer to the shared advisor protocol; this session's consumer-specific wiring and constraints. |
185
53
 
186
54
  ## Folder Map
187
55
 
188
- - `SKILL.md` — complete advisor workflow instructions.
56
+ - `SKILL.md` — complete team-advisor workflow instructions.
@@ -1,9 +1,10 @@
1
- """Link-integrity check for the skills tree and the shared pr-loop docs.
1
+ """Link-integrity check for the skills tree and shared protocol docs.
2
2
 
3
- Walks every markdown file under ``skills/`` and ``_shared/pr-loop/`` and
4
- resolves each relative markdown link target against the linking file's
5
- directory. A link whose target file or directory does not exist on disk is
6
- reported with its source file and line number, and the test fails.
3
+ Walks every markdown file under ``skills/``, ``_shared/pr-loop/``, and
4
+ ``_shared/advisor/`` and resolves each relative markdown link target against
5
+ the linking file's directory. A link whose target file or directory does not
6
+ exist on disk is reported with its source file and line number, and the test
7
+ fails.
7
8
  """
8
9
 
9
10
  from __future__ import annotations
@@ -14,6 +15,7 @@ from pathlib import Path
14
15
 
15
16
  SKILLS_ROOT = Path(__file__).parent
16
17
  SHARED_PR_LOOP_ROOT = SKILLS_ROOT.parent / "_shared" / "pr-loop"
18
+ SHARED_ADVISOR_ROOT = SKILLS_ROOT.parent / "_shared" / "advisor"
17
19
 
18
20
  MARKDOWN_LINK_PATTERN = re.compile(r"\]\(([^)\s]+)\)")
19
21
  FENCE_MARKER = "```"
@@ -34,10 +36,12 @@ def _iter_markdown_files() -> list[Path]:
34
36
  """List every markdown file the integrity check covers.
35
37
 
36
38
  Returns:
37
- All ``.md`` files under the skills tree and the shared pr-loop tree.
39
+ All ``.md`` files under the skills tree, the shared pr-loop tree, and
40
+ the shared advisor tree.
38
41
  """
39
42
  all_markdown_files = sorted(SKILLS_ROOT.rglob("*.md"))
40
43
  all_markdown_files.extend(sorted(SHARED_PR_LOOP_ROOT.rglob("*.md")))
44
+ all_markdown_files.extend(sorted(SHARED_ADVISOR_ROOT.rglob("*.md")))
41
45
  return all_markdown_files
42
46
 
43
47
 
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: update
3
- description: Fast-forwards a local git repository's main branch to a remote's main, after confirming both the local repo path and the source remote through AskUserQuestion. Fetches the chosen remote, checks that the move is a true fast-forward (never a force, never a merge commit), and updates main whether or not main is the checked-out branch. When main is not the checked-out branch, it then offers to switch the checkout to main so the update reaches the files on disk. Use when the user says "/update", "update main", "fast-forward main", "sync main from origin", "pull latest main into <path>", or "bring main up to date". Triggers on "/update", "update main", "fast-forward main", "sync main".
3
+ description: >-
4
+ Fast-forwards a local repository's main branch to a remote's main after
5
+ confirming the repo path and source remote through AskUserQuestion. Use when
6
+ the user says '/update', 'update main', 'fast-forward main', 'sync main from
7
+ origin', 'pull latest main into <path>', or 'bring main up to date'.
4
8
  ---
5
9
 
6
10
  # update
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  name: usage-pause
3
- description: Waits out the account's 5-hour usage window in ScheduleWakeup stages that keep every agent context warm. Resolves the window's reset time and remaining headroom by probing the OAuth usage endpoint, or takes a manual override ('/usage-pause 10:20pm', '/usage-pause 74m'). Warns and stops when the weekly limit is near its cap. Each wakeup pings live and idle-warm agents with a one-line no-new-work checkpoint and records finished results; the final wakeup restores the crons the skill cancelled at pause time. Triggers: '/usage-pause', 'pause until the usage window resets', 'wait out the usage limit', 'usage limit pause'.
3
+ description: >-
4
+ Waits out the account's 5-hour usage window in ScheduleWakeup stages that keep
5
+ every agent context warm. Accepts a manual override like '/usage-pause
6
+ 10:20pm' or '/usage-pause 74m'. Triggers: '/usage-pause', 'pause until the
7
+ usage window resets', 'wait out the usage limit', 'usage limit pause'.
4
8
  argument-hint: "[reset time like 10:20pm | duration like 74m]"
5
9
  ---
6
10
 
@@ -39,16 +43,21 @@ On exit 2 the script prints `{"error": ...}`. Ask the user for a manual reset ti
39
43
 
40
44
  ### Probe mechanism
41
45
 
42
- The resolver reads the Claude Code CLI's OAuth access token from `~/.claude/.credentials.json` (`claudeAiOauth.accessToken`, honored only while its `expiresAt` sits in the future) and sends `GET https://api.anthropic.com/api/oauth/usage` with `Authorization: Bearer <token>` and `anthropic-beta: oauth-2025-04-20`. This is the same endpoint the interactive `/usage` panel reads. The response carries a `five_hour` bucket and a `seven_day` bucket, each with `utilization` (percent spent) and `resets_at`.
46
+ The resolver gets a bearer token from one of two sources and sends `GET https://api.anthropic.com/api/oauth/usage` with `Authorization: Bearer <token>` and `anthropic-beta: oauth-2025-04-20`. This is the same endpoint the interactive `/usage` panel reads. The response carries a `five_hour` bucket and a `seven_day` bucket, each with `utilization` (percent spent) and `resets_at`.
43
47
 
44
- Fallbacks, in order: an expired or unreadable stored token, a failed request, or a response with no readable `five_hour` reset time all end in exit 2 — the manual-override ask above. The manual path works with no probe at all, so the skill functions even when the credential file is stale.
48
+ Token sources, in order:
49
+
50
+ - The Claude Code CLI's OAuth access token in `~/.claude/.credentials.json` (`claudeAiOauth.accessToken`, honored only while its `expiresAt` sits in the future).
51
+ - The session ingress token in the file named by the `CLAUDE_SESSION_INGRESS_TOKEN_FILE` environment variable, read when the credential file token is unavailable. Claude Code cloud sessions set this variable and omit the credential file.
52
+
53
+ Fallbacks, in order: no usable token from either source, a failed request, or a response with no readable `five_hour` reset time all end in exit 2 — the manual-override ask above. The manual path works with no probe at all, so the skill functions even when both token sources are stale.
45
54
 
46
55
  Why this probe and not the others:
47
56
 
48
57
  - The interactive `/usage` panel shows the same data but has no scriptable output.
49
58
  - `claude -p --output-format json` spends usage to answer and its metadata reports per-call token counts, not the account window clock.
50
59
  - `anthropic-ratelimit-*` response headers cover API-key Messages traffic, not the subscription session window, and reading them also costs a request.
51
- - Refreshing the OAuth token from a script is out of scope: token rotation would desync the refresh token the CLI has on disk and log the CLI out. The resolver only ever reads the credential file.
60
+ - Refreshing the OAuth token from a script is out of scope: token rotation would desync the refresh token the CLI has on disk and log the CLI out. The resolver only ever reads its token sources.
52
61
 
53
62
  ## Weekly limit guard
54
63
 
@@ -101,7 +110,7 @@ Fill each `<slot>` at schedule time: `<remaining_stage_durations>` is the tail o
101
110
  | `SKILL.md` | This flow: resolve, weekly guard, stage chain, templates |
102
111
  | `scripts/resolve_usage_window.py` | The window resolver and stage planner CLI |
103
112
  | `scripts/test_resolve_usage_window.py` | Behavioral tests for parsing, staging, token reading, extraction, CLI |
104
- | `scripts/usage_pause_constants/resolve_usage_window_constants.py` | Endpoint, credential keys, stage sizing, thresholds, result keys |
113
+ | `scripts/usage_pause_constants/resolve_usage_window_constants.py` | Endpoint, credential keys, the session ingress token env var, stage sizing, thresholds, result keys |
105
114
 
106
115
  ## Gotchas
107
116