claude-dev-env 2.8.0 → 2.10.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 (323) hide show
  1. package/CLAUDE.md +8 -2
  2. package/_shared/pr-loop/CLAUDE.md +1 -1
  3. package/_shared/pr-loop/audit-contract.md +17 -6
  4. package/_shared/pr-loop/audit-reply-template.md +4 -4
  5. package/_shared/pr-loop/code-rules-gate.md +3 -5
  6. package/_shared/pr-loop/fix-protocol.md +2 -3
  7. package/_shared/pr-loop/gh-payloads.md +1 -1
  8. package/_shared/pr-loop/scripts/CLAUDE.md +1 -1
  9. package/_shared/pr-loop/scripts/README.md +1 -1
  10. package/_shared/pr-loop/scripts/code_rules_gate.py +2 -0
  11. package/_shared/pr-loop/scripts/code_rules_gate_parts/gate_running.py +16 -1
  12. package/_shared/pr-loop/scripts/code_rules_gate_parts/git_blob_readers.py +11 -5
  13. package/_shared/pr-loop/scripts/preflight.py +9 -4
  14. package/_shared/pr-loop/scripts/reviews_disabled.py +50 -22
  15. package/_shared/pr-loop/scripts/tests/conftest.py +20 -0
  16. package/_shared/pr-loop/scripts/tests/test_claude_permissions_common.py +6 -6
  17. package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +50 -6
  18. package/_shared/pr-loop/scripts/tests/test_revoke_project_claude_permissions.py +1 -1
  19. package/_shared/pr-loop/state-schema.md +5 -14
  20. package/agents/CLAUDE.md +2 -2
  21. package/agents/clean-coder.md +62 -562
  22. package/agents/code-quality-agent.md +10 -2
  23. package/agents/code-verifier.md +1 -1
  24. package/agents/test_agent_frontmatter.py +58 -40
  25. package/audit-rubrics/CLAUDE.md +2 -1
  26. package/audit-rubrics/audit-categories.json +704 -0
  27. package/audit-rubrics/prompts/category-i-concurrency.md +1 -1
  28. package/bin/CLAUDE.md +16 -5
  29. package/bin/ever-shipped-skills.mjs +2 -0
  30. package/bin/install-plan.mjs +402 -0
  31. package/bin/install-transaction.mjs +455 -0
  32. package/bin/install.mjs +593 -147
  33. package/bin/install.plan.test.mjs +194 -0
  34. package/bin/install.profile-root.test.mjs +154 -0
  35. package/bin/install.profiles.test.mjs +253 -0
  36. package/bin/install.settings-defaults.test.mjs +200 -0
  37. package/bin/install.transaction.test.mjs +400 -0
  38. package/bin/install.uninstall-transaction.test.mjs +418 -0
  39. package/bin/merge_managed_permissions.mjs +130 -0
  40. package/bin/resolve-install-root.mjs +181 -0
  41. package/bin/select-install-targets.mjs +401 -0
  42. package/commands/CLAUDE.md +0 -2
  43. package/docs/CODE_RULES.md +4 -2
  44. package/docs/references/CLAUDE.md +3 -2
  45. package/docs/references/advisor-tool.md +44 -6
  46. package/docs/references/prose-style-enforcement.md +25 -0
  47. package/docs/references/team-advisor-skill.md +14 -8
  48. package/hooks/blocking/CLAUDE.md +6 -6
  49. package/hooks/blocking/_path_setup.py +9 -5
  50. package/hooks/blocking/code_rules_docstrings.py +124 -30
  51. package/hooks/blocking/code_rules_enforcer.py +161 -16
  52. package/hooks/blocking/code_rules_shared.py +40 -23
  53. package/hooks/blocking/config/CLAUDE.md +3 -5
  54. package/hooks/blocking/config/prose_style_enforcement_constants.py +38 -0
  55. package/hooks/blocking/config/test_prose_style_enforcement_constants.py +45 -0
  56. package/hooks/blocking/eli11_reply_enforcer.py +70 -113
  57. package/hooks/blocking/hedging_language_blocker.py +103 -20
  58. package/hooks/blocking/hook_prose_detector_consistency.py +6 -0
  59. package/hooks/blocking/intent_only_ending_blocker.py +6 -0
  60. package/hooks/blocking/plain_language_blocker.py +139 -20
  61. package/hooks/blocking/pre_tool_use_dispatcher.py +102 -20
  62. package/hooks/blocking/state_description_blocker.py +7 -1
  63. package/hooks/blocking/tdd_enforcer.py +8 -0
  64. package/hooks/blocking/test__path_setup.py +28 -0
  65. package/hooks/blocking/test_code_rules_enforcer_agent_home_tooling.py +99 -0
  66. package/hooks/blocking/test_code_rules_enforcer_docstring_args_span_scope.py +232 -10
  67. package/hooks/blocking/test_code_rules_enforcer_ephemeral.py +1 -1
  68. package/hooks/blocking/test_code_rules_enforcer_join_separator_magic.py +41 -0
  69. package/hooks/blocking/test_code_rules_enforcer_string_magic.py +98 -0
  70. package/hooks/blocking/test_eli11_reply_enforcer.py +98 -165
  71. package/hooks/blocking/test_hedging_language_blocker.py +120 -1
  72. package/hooks/blocking/test_hook_prose_detector_consistency.py +28 -8
  73. package/hooks/blocking/test_intent_only_ending_blocker.py +27 -2
  74. package/hooks/blocking/test_package_inventory_stale_blocker.py +11 -4
  75. package/hooks/blocking/test_plain_language_blocker.py +129 -19
  76. package/hooks/blocking/test_plain_language_blocker_allowlist.py +70 -26
  77. package/hooks/blocking/test_pre_tool_use_dispatcher.py +99 -26
  78. package/hooks/blocking/test_pre_tool_use_dispatcher_native.py +87 -50
  79. package/hooks/blocking/test_state_description_blocker.py +45 -2
  80. package/hooks/blocking/test_stop_dispatcher.py +11 -7
  81. package/hooks/blocking/test_volatile_path_in_post_blocker.py +12 -12
  82. package/hooks/blocking/volatile_path_in_post_blocker.py +2 -2
  83. package/hooks/hooks.json +15 -0
  84. package/hooks/hooks_constants/CLAUDE.md +14 -3
  85. package/hooks/hooks_constants/ask_user_question_shape.py +281 -0
  86. package/hooks/hooks_constants/code_rules_enforcer_constants.py +2 -1
  87. package/hooks/hooks_constants/code_rules_path_utils_constants.py +1 -0
  88. package/hooks/hooks_constants/eli11_reply_enforcer_constants.py +5 -12
  89. package/hooks/hooks_constants/hedging_uncertainty_constants.py +42 -0
  90. package/hooks/hooks_constants/issue_tracker_session_starter_constants.py +23 -0
  91. package/hooks/hooks_constants/orchestrator_auto_starter_constants.py +23 -0
  92. package/hooks/hooks_constants/piped_pytest_blocker_constants.py +4 -1
  93. package/hooks/hooks_constants/plain_language_blocker_constants.py +4 -1
  94. package/hooks/hooks_constants/pre_tool_use_dispatcher_constants.py +6 -0
  95. package/hooks/hooks_constants/project_paths_reader.py +31 -4
  96. package/hooks/hooks_constants/prose_matcher_precision_constants.py +40 -0
  97. package/hooks/hooks_constants/pytest_invocation.py +354 -0
  98. package/hooks/hooks_constants/session_start_injector.py +163 -0
  99. package/hooks/hooks_constants/session_start_injector_constants.py +46 -0
  100. package/hooks/hooks_constants/shell_command_pipeline.py +397 -0
  101. package/hooks/hooks_constants/shell_command_segments.py +5 -0
  102. package/hooks/hooks_constants/test_ask_user_question_shape.py +167 -0
  103. package/hooks/hooks_constants/test_project_paths_reader.py +29 -0
  104. package/hooks/hooks_constants/test_prose_metrics_parity.py +8 -0
  105. package/hooks/hooks_constants/test_pytest_invocation.py +130 -0
  106. package/hooks/hooks_constants/test_session_start_injector.py +168 -0
  107. package/hooks/hooks_constants/test_shell_command_pipeline.py +135 -0
  108. package/hooks/hooks_constants/volatile_path_in_post_blocker_constants.py +1 -1
  109. package/hooks/hooks_constants/working_style_prompt_constants.py +30 -0
  110. package/hooks/observability/CLAUDE.md +2 -0
  111. package/hooks/observability/prose_matcher_advisory.py +237 -0
  112. package/hooks/observability/test_prose_matcher_advisory.py +143 -0
  113. package/hooks/session/CLAUDE.md +9 -1
  114. package/hooks/session/_path_setup.py +13 -0
  115. package/hooks/session/issue_tracker_session_starter.py +135 -0
  116. package/hooks/session/orchestrator_auto_starter.py +100 -0
  117. package/hooks/session/test__path_setup.py +28 -0
  118. package/hooks/session/test_issue_tracker_session_starter.py +104 -0
  119. package/hooks/session/test_orchestrator_auto_starter.py +99 -0
  120. package/hooks/session/test_working_style_prompt.py +47 -0
  121. package/hooks/session/untracked_repo_detector.py +1 -24
  122. package/hooks/session/working_style_prompt.py +36 -0
  123. package/hooks/validators/_path_setup.py +19 -0
  124. package/hooks/validators/run_all_validators.py +8 -13
  125. package/installable-surfaces.manifest.json +21 -0
  126. package/output-styles/CLAUDE.md +15 -0
  127. package/package.json +5 -2
  128. package/rules/CLAUDE.md +1 -0
  129. package/rules/code-standards.md +33 -7
  130. package/rules/durable-post-artifacts.md +2 -2
  131. package/rules/eli11-replies.md +7 -2
  132. package/rules/hedging-claims.md +4 -2
  133. package/rules/long-horizon-autonomy.md +3 -1
  134. package/rules/opus5-communication-contract.md +45 -0
  135. package/rules/plain-language.md +2 -2
  136. package/rules/research-mode.md +1 -1
  137. package/scripts/CLAUDE.md +13 -2
  138. package/scripts/Sync-RepoMain.ps1 +215 -0
  139. package/scripts/active_capability_references.py +218 -0
  140. package/scripts/ci/windows-installer-lifecycle.ps1 +78 -0
  141. package/scripts/claude_chain_runner.py +394 -6
  142. package/scripts/claude_chain_usage.py +1 -1
  143. package/scripts/codex_compat_materializer.py +105 -85
  144. package/scripts/dev_env_scripts_constants/CLAUDE.md +3 -1
  145. package/scripts/dev_env_scripts_constants/active_capability_constants.py +46 -0
  146. package/scripts/dev_env_scripts_constants/claude_chain_constants.py +74 -0
  147. package/scripts/dev_env_scripts_constants/grok_run_ledger_constants.py +50 -0
  148. package/scripts/dev_env_scripts_constants/grok_worker_constants.py +104 -0
  149. package/scripts/dev_env_scripts_constants/verify_installable_package_constants.py +116 -0
  150. package/scripts/grok_patch_artifacts.py +123 -0
  151. package/scripts/grok_run_ledger.py +318 -0
  152. package/scripts/profile-isolation-launchers/config/mcp-bundles.json +25 -0
  153. package/scripts/profile-isolation-launchers/config/profile-isolation-constants.mjs +60 -0
  154. package/scripts/profile-isolation-launchers/config/profiles.manifest.json +54 -0
  155. package/scripts/profile-isolation-launchers/config/shared-allowlist.json +64 -0
  156. package/scripts/profile-isolation-launchers/launcher-runtime.mjs +180 -0
  157. package/scripts/profile-isolation-launchers/lib/profile-manifest.mjs +288 -0
  158. package/scripts/profile-isolation-launchers/mcp-bundles.mjs +275 -0
  159. package/scripts/profile-isolation-launchers/profile-isolation-contract.test.mjs +221 -0
  160. package/scripts/profile-isolation-launchers/tests/launcher-runtime.test.mjs +108 -0
  161. package/scripts/profile-isolation-launchers/tests/mcp-bundles.test.mjs +147 -0
  162. package/scripts/profile-isolation-launchers/tests/shortcut-contract.test.ps1 +102 -0
  163. package/scripts/profile-isolation-launchers/tests/version-compatibility.test.mjs +210 -0
  164. package/scripts/profile-isolation-launchers/version-compatibility.mjs +299 -0
  165. package/scripts/profile-isolation-launchers/windows/shortcut-inventory.ps1 +127 -0
  166. package/scripts/profile-isolation-launchers/windows/shortcut-manifest.json +51 -0
  167. package/scripts/profile-isolation-launchers/windows/shortcut-reconcile.ps1 +77 -0
  168. package/scripts/spawn_grok_batch.py +556 -9
  169. package/scripts/test_active_capability_references.py +108 -0
  170. package/scripts/test_claude_chain_runner.py +414 -82
  171. package/scripts/test_claude_chain_usage.py +12 -12
  172. package/scripts/test_grok_patch_artifacts.py +82 -0
  173. package/scripts/test_grok_run_ledger.py +116 -0
  174. package/scripts/test_resolve_worker_spawn.py +2 -2
  175. package/scripts/test_spawn_grok_batch.py +295 -0
  176. package/scripts/test_verify_installable_package.py +208 -0
  177. package/scripts/tests/test_codex_compat_materializer.py +33 -0
  178. package/scripts/verify_installable_package.py +612 -0
  179. package/settings.json +10 -0
  180. package/skills/CLAUDE.md +6 -2
  181. package/skills/_shared/CLAUDE.md +37 -4
  182. package/skills/_shared/advisor/CLAUDE.md +9 -0
  183. package/skills/_shared/advisor/advisor-protocol.md +5 -0
  184. package/skills/_shared/advisor/scripts/README.md +9 -0
  185. package/skills/_shared/end-of-run-gotcha-recommendations.md +156 -0
  186. package/skills/_shared/pr-loop/CLAUDE.md +18 -1
  187. package/skills/_shared/pr-loop/audit-contract.md +5 -0
  188. package/skills/_shared/pr-loop/audit-reply-template.md +5 -0
  189. package/skills/_shared/pr-loop/code-rules-gate.md +5 -0
  190. package/skills/_shared/pr-loop/fix-protocol.md +5 -0
  191. package/skills/_shared/pr-loop/gh-payloads.md +5 -0
  192. package/skills/_shared/pr-loop/post-audit-thread-contract.md +5 -0
  193. package/skills/_shared/pr-loop/precatch-rubric.md +5 -0
  194. package/skills/_shared/pr-loop/scripts/CLAUDE.md +9 -1
  195. package/skills/_shared/pr-loop/scripts/RUNTIME_SCRIPTS.md +29 -0
  196. package/skills/_shared/pr-loop/scripts/audit_category_schema.py +355 -0
  197. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/CLAUDE.md +1 -0
  198. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/audit_category_schema_constants.py +32 -0
  199. package/skills/_shared/pr-loop/scripts/skills_pr_loop_constants/path_resolver_constants.py +7 -19
  200. package/skills/_shared/pr-loop/scripts/test_audit_category_schema.py +94 -0
  201. package/skills/_shared/pr-loop/scripts/test_build_audit_prompt.py +21 -0
  202. package/skills/_shared/pr-loop/state-schema.md +5 -0
  203. package/skills/_shared/pr-loop/worker-spawn.md +5 -0
  204. package/skills/autoconverge/reference/convergence.md +2 -1
  205. package/skills/autoconverge/reference/stop-conditions.md +5 -3
  206. package/skills/beat-sheet/SKILL.md +54 -0
  207. package/skills/beat-sheet/reference/visual-beats.md +29 -0
  208. package/skills/bugteam/CONSTRAINTS.md +4 -4
  209. package/skills/bugteam/EXAMPLES.md +1 -1
  210. package/skills/bugteam/reference/README.md +1 -1
  211. package/skills/e-code-review/SKILL.md +29 -3
  212. package/skills/e-code-review/reference/effort-evaluation.md +35 -0
  213. package/skills/e-code-review/reference/medium.md +15 -4
  214. package/skills/e-code-review/reference/runner-selection.md +40 -0
  215. package/skills/e-code-review/scripts/config/e_code_review_effort_constants/__init__.py +41 -0
  216. package/skills/e-code-review/scripts/config/e_code_review_effort_constants/effort_constants.py +40 -0
  217. package/skills/e-code-review/scripts/e_code_review_scripts_constants/__init__.py +1 -0
  218. package/skills/e-code-review/scripts/e_code_review_scripts_constants/finding_pipeline_constants.py +49 -0
  219. package/skills/e-code-review/scripts/e_code_review_scripts_constants/grok_code_review_constants.py +55 -0
  220. package/skills/e-code-review/scripts/effort_defaults_evidence.json +186 -0
  221. package/skills/e-code-review/scripts/effort_evaluation.py +362 -0
  222. package/skills/e-code-review/scripts/finding_pipeline.py +140 -0
  223. package/skills/e-code-review/scripts/fixtures/demanding.json +26 -0
  224. package/skills/e-code-review/scripts/fixtures/easy.json +14 -0
  225. package/skills/e-code-review/scripts/fixtures/medium.json +20 -0
  226. package/skills/e-code-review/scripts/grok_code_review.py +230 -0
  227. package/skills/e-code-review/scripts/test_effort_evaluation.py +180 -0
  228. package/skills/e-code-review/scripts/test_finding_pipeline.py +197 -0
  229. package/skills/e-code-review/scripts/test_grok_code_review.py +289 -0
  230. package/skills/grok-spawn/SKILL.md +5 -0
  231. package/skills/orchestrator/SKILL.md +5 -0
  232. package/skills/plan-to-pr/scripts/create_packet.py +4 -4
  233. package/skills/plan-to-pr/scripts/load_skill_constants.py +41 -0
  234. package/skills/plan-to-pr/scripts/validate_packet.py +4 -4
  235. package/skills/plan-to-pr/scripts/validate_protocol.py +4 -1
  236. package/skills/plan-to-pr/scripts/validate_run.py +4 -1
  237. package/skills/pr-converge/scripts/check_convergence.py +21 -19
  238. package/skills/pr-converge/scripts/check_convergence_availability.py +50 -7
  239. package/skills/pr-converge/scripts/conftest.py +35 -0
  240. package/skills/pr-converge/scripts/test_check_convergence_availability.py +65 -0
  241. package/skills/pr-converge/scripts/test_check_convergence_codex.py +11 -1
  242. package/skills/pr-converge/scripts/test_check_convergence_contract.py +9 -2
  243. package/skills/pr-loop-cloud-transport/SKILL.md +1 -1
  244. package/skills/rebase/SKILL.md +15 -3
  245. package/skills/reviewer-gates/SKILL.md +2 -2
  246. package/skills/show/SKILL.md +51 -0
  247. package/skills/show/references/accessibility.md +7 -0
  248. package/skills/show/references/art.md +3 -0
  249. package/skills/show/references/charts.md +3 -0
  250. package/skills/show/references/core-design.md +14 -0
  251. package/skills/show/references/erds.md +3 -0
  252. package/skills/show/references/flowcharts.md +3 -0
  253. package/skills/show/references/host-and-html.md +3 -0
  254. package/skills/show/references/illustrative-diagrams.md +10 -0
  255. package/skills/show/references/interaction.md +3 -0
  256. package/skills/show/references/mockups.md +3 -0
  257. package/skills/show/references/quality-gates.md +7 -0
  258. package/skills/show/references/structural-diagrams.md +3 -0
  259. package/skills/show/references/subject-inventory.md +21 -0
  260. package/skills/show/references/svg-contract.md +22 -0
  261. package/skills/show/routing.yaml +30 -0
  262. package/skills/show/samples/pr1262-v2.svg +222 -0
  263. package/skills/show/scripts/README.md +6 -0
  264. package/skills/show/scripts/validate-artifact.py +91 -0
  265. package/skills/show/scripts/validate-package.py +18 -0
  266. package/skills/show/templates/html-widget.html +4 -0
  267. package/skills/show/templates/svg-base.svg +19 -0
  268. package/skills/show/tests/fixtures/css-var.svg +6 -0
  269. package/skills/show/tests/fixtures/dead-ref.svg +7 -0
  270. package/skills/show/tests/fixtures/filled-glyph.svg +8 -0
  271. package/skills/show/tests/fixtures/inherited-fill.svg +18 -0
  272. package/skills/show/tests/fixtures/invalid.svg +1 -0
  273. package/skills/show/tests/fixtures/large-canvas.svg +21 -0
  274. package/skills/show/tests/fixtures/unfilled-connector.svg +15 -0
  275. package/skills/show/tests/fixtures/valid.html +1 -0
  276. package/skills/show/tests/test_validate-artifact.py +74 -0
  277. package/skills/show/tests/test_validators.py +59 -0
  278. package/skills/show/workflows/create-visual.md +13 -0
  279. package/skills/show/workflows/review-visual.md +20 -0
  280. package/skills/split-pr/SKILL.md +85 -0
  281. package/skills/split-pr/reference/path-layers.md +16 -0
  282. package/skills/split-pr/reference/proposal-format.md +15 -0
  283. package/skills/split-pr/reference/split-further-loop.md +10 -0
  284. package/skills/split-pr/reference/splitting-principles.md +26 -0
  285. package/skills/split-pr/scripts/analyze_pr.py +279 -0
  286. package/skills/split-pr/scripts/categorize_files.py +106 -0
  287. package/skills/split-pr/scripts/config/__init__.py +1 -0
  288. package/skills/split-pr/scripts/config/dependency_constants.py +14 -0
  289. package/skills/split-pr/scripts/config/git_operations_constants.py +36 -0
  290. package/skills/split-pr/scripts/config/packing_constants.py +61 -0
  291. package/skills/split-pr/scripts/config/plan_constants.py +49 -0
  292. package/skills/split-pr/scripts/config/split_pr_constants.py +110 -0
  293. package/skills/split-pr/scripts/execute_split_slices.py +82 -0
  294. package/skills/split-pr/scripts/pack_files_into_slices.py +212 -0
  295. package/skills/split-pr/scripts/split_pr_dependency_graph.py +70 -0
  296. package/skills/split-pr/scripts/split_pr_git_operations.py +184 -0
  297. package/skills/split-pr/scripts/split_pr_layer_order.py +58 -0
  298. package/skills/split-pr/scripts/split_pr_paginate.py +119 -0
  299. package/skills/split-pr/scripts/split_pr_process_runner.py +52 -0
  300. package/skills/split-pr/scripts/split_pr_script_types.py +126 -0
  301. package/skills/split-pr/scripts/split_pr_title.py +41 -0
  302. package/skills/split-pr/scripts/test_analyze_pr.py +228 -0
  303. package/skills/split-pr/scripts/test_categorize_files.py +55 -0
  304. package/skills/split-pr/scripts/test_categorize_files_packing.py +59 -0
  305. package/skills/split-pr/scripts/test_execute_split_slices.py +99 -0
  306. package/skills/split-pr/scripts/test_split_pr_dependency_graph.py +47 -0
  307. package/skills/split-pr/scripts/test_split_pr_git_operations.py +125 -0
  308. package/skills/split-pr/scripts/test_split_pr_layer_order.py +36 -0
  309. package/skills/split-pr/scripts/test_split_pr_paginate.py +65 -0
  310. package/skills/split-pr/scripts/test_split_pr_script_types.py +73 -0
  311. package/skills/split-pr/scripts/test_split_pr_title.py +28 -0
  312. package/skills/split-pr/scripts/test_verify_dependency_graph.py +46 -0
  313. package/skills/split-pr/scripts/test_verify_plan.py +56 -0
  314. package/skills/split-pr/scripts/test_verify_plan_contract.py +50 -0
  315. package/skills/split-pr/scripts/test_verify_plan_path_normalization.py +45 -0
  316. package/skills/split-pr/scripts/verify_dependency_graph.py +111 -0
  317. package/skills/split-pr/scripts/verify_plan.py +139 -0
  318. package/skills/task-build/reference/tool-routing.md +3 -0
  319. package/skills/team-advisor/SKILL.md +23 -44
  320. package/system-prompts/software-engineer.xml +17 -5
  321. package/commands/initialize.md +0 -90
  322. package/commands/stubcheck.md +0 -88
  323. package/skills/test_markdown_link_integrity.py +0 -107
@@ -2,63 +2,42 @@
2
2
  name: team-advisor
3
3
  description: >-
4
4
  Spawn one warm session-advisor at the strongest reachable tier and consult
5
- it before big decisions, completion, commits, or when stuck. Triggers:
5
+ it before substantive work, completion, commits, or when stuck. Triggers:
6
6
  'team-advisor', 'team advisor', 'second opinion', 'advisor', 'consult',
7
7
  'verify', 'validate', 'commit', 'push'.
8
8
  ---
9
9
 
10
10
  # Team Advisor
11
11
 
12
- ## Principle
12
+ One warm advisor at the strongest tier this session can reach. This session is the sole consumer.
13
13
 
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.
14
+ ## Refs
15
15
 
16
- ## Follow the shared protocol
17
-
18
- **Detect the host profile first** (Host profiles in
19
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md)
20
- e.g. %USERPROFILE%\.claude\_shared\advisor\advisor-protocol.md). Do not start a model-floor
21
- walk until the host is known.
22
-
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.
16
+ | Doc | Holds |
17
+ |---|---|
18
+ | [`docs/references/advisor-tool.md`](../../docs/references/advisor-tool.md) | **Consult cadence and weight** — when to call, hard rule before first write, how to treat advice. Read this for every consult. |
19
+ | [`~/.claude/_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md) | **Bind and lifecycle** — host detect, model floor, warm-up or CLI bind, charter, drift re-bind, CLI fallback, executor paste blocks. |
20
+ | [`agents/session-advisor.md`](../../agents/session-advisor.md) | **Reply contract** ENDORSE / CORRECTION / PLAN / STOP; SendMessage only. |
25
21
 
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). A **Fable**-tier attempt
31
- carries the exact token `FABLE-SPAWN-AUTHORIZED` in its spawn prompt, as the
32
- protocol's warm-up rule states; `hooks/blocking/fable_spawn_gate.py` denies a
33
- fable spawn whose prompt lacks it.
22
+ ## Bind
34
23
 
35
- **Third-party host:** bind a max-tier Claude advisor through the shared CLI Claude-chain
36
- in the protocol (Fable max, then Opus max; `claude_chain_runner.py` ranks
37
- `~/.claude/claude-chain.json` accounts by weekly remaining via `claude_chain_usage`
38
- and fails over on usage limits). Consult via
39
- `--resume <session_id>` on that bind. This session is the sole consumer of that
40
- CLI advisor; skip the multi-consumer opener. When the chain cannot bind or
41
- reply, fail closed and report to the user — do **not** answer ENDORSE /
42
- CORRECTION / PLAN / STOP as this third-party session.
24
+ 1. Detect the host profile first (protocol **Host profiles**), then walk the model floor.
25
+ 2. Floor: this session's own tier on Claude; Opus floor with Fable first on a third-party host.
26
+ 3. Name: `team-advisor-agent` on Claude (Agent spawn of `session-advisor`); one CLI `session_id` on a third-party host via the protocol Claude-chain.
27
+ 4. A Fable-tier spawn or re-spawn carries the exact token `FABLE-SPAWN-AUTHORIZED` in its prompt (protocol warm-up; `fable_spawn_gate` requires it).
28
+ 5. Skip the multi-consumer "who you are" opener sole consumer.
29
+ 6. When the bind or reply path fails, fail closed and report to the user. On a third-party host, only the bound Claude advisor issues ENDORSE / CORRECTION / PLAN / STOP.
43
30
 
44
- ## Constraints
31
+ Full walk, charter, consult message shape, and drift re-bind live in the protocol.
45
32
 
46
- - One advisor bind per session (`team-advisor-agent` on Claude; one CLI
47
- `session_id` on a third-party host), owned by this session for its whole lifecycle
48
- (spawn or CLI bind, drift re-bind, shutdown) — see
49
- [`_shared/advisor/advisor-protocol.md`](../../_shared/advisor/advisor-protocol.md).
50
- - Never bind the advisor, or its CLI path, at a tier below the protocol floor
51
- for this host (Claude: this session's own tier; a third-party host: Opus floor
52
- with Fable first).
53
- - The advisor only answers. It never edits a file, never runs a build or
54
- test, and never posts anything on the session's behalf.
33
+ ## Consult
55
34
 
56
- ## File Index
35
+ Follow **When to call**, **Hard rule**, and **How to treat advice** in `advisor-tool.md`.
57
36
 
58
- | File | Purpose |
59
- |---|---|
60
- | `SKILL.md` | Pointer to the shared advisor protocol; this session's consumer-specific wiring and constraints. |
37
+ Each brief: delta since last consult, live decision or blocker, paths or excerpts needed. Protocol owns the full consult format.
61
38
 
62
- ## Folder Map
39
+ ## Constraints
63
40
 
64
- - `SKILL.md` complete team-advisor workflow instructions.
41
+ - One bind per session; this session owns spawn or CLI bind, drift re-bind, and shutdown.
42
+ - Bind at or above the protocol floor for this host.
43
+ - The advisor only answers (messaging); the session runs tools and posts.
@@ -28,8 +28,8 @@
28
28
  Lead every response with the direct answer or result. Open with the substance — the
29
29
  conclusion, the fix, the decision — before any supporting context or explanation. Expand
30
30
  depth in proportion to the complexity of the ask: a direct question earns a sentence; a
31
- multi-file investigation earns structured explanation. Depth scales with the ask; a fixed
32
- reply-length cap is wrong.
31
+ multi-file investigation or requested full audit earns structured explanation long enough
32
+ to cover the substance. Depth scales with the ask; a fixed reply-length cap is wrong.
33
33
 
34
34
  Reference specific code locations using the pattern `file_path:line_number` so the user can
35
35
  navigate directly to the source.
@@ -90,8 +90,10 @@
90
90
  </problem_solving>
91
91
 
92
92
  <code_quality>
93
- Apply the system-prompt code-quality checklist as the canonical naming and style source for
94
- all code you write or modify. ~/.claude/docs/CODE_RULES.md is a pointer to this source.
93
+ Canonical code-quality policy is repository-root AGENTS.md (installed review contract).
94
+ ~/.claude/docs/CODE_RULES.md is the compact projection of AGENTS.md for generation load —
95
+ when the two disagree, AGENTS.md wins. The checklist below is a short reminder, not a
96
+ second canonical source.
95
97
 
96
98
  Naming — full words only:
97
99
  - Use "context" over "ctx", "configuration" over "cfg", "message" over "msg",
@@ -109,7 +111,8 @@
109
111
  Types — complete coverage required:
110
112
  - Every parameter and return value carries an explicit type hint
111
113
  - Replace Any with the most specific type available
112
- - Replace every # type: ignore annotation with correct typing
114
+ - Prefer a real type over `# type: ignore`; when an ignore is required, add a second
115
+ trailing `#` justification of at least five characters (AGENTS Types)
113
116
 
114
117
  Configuration — one source of truth:
115
118
  - Every constant lives in config/ only
@@ -378,6 +381,15 @@
378
381
  work around tool limitations — are removed when the task is done.
379
382
  </cleanup>
380
383
 
384
+ <communication_contract>
385
+ Visible output is concise by default. The first progress update is one sentence.
386
+ Later updates mark only important discoveries or direction changes. The final
387
+ response begins with the outcome. When thinking is disabled, speak one brief
388
+ natural-language sentence before a tool call that needs context, state when no
389
+ fitting tool exists, and never emit internal-system XML in visible output.
390
+ Full contract: rules/opus5-communication-contract.md (opus5-communication-contract-v1).
391
+ </communication_contract>
392
+
381
393
  <help_and_feedback>
382
394
  When the user asks for help with this tool or wants to report a problem:
383
395
  - For usage help, direct them to: /help
@@ -1,90 +0,0 @@
1
- # Initialize Session
2
-
3
- You are starting a new task. Before proceeding, you MUST read and internalize the critical protocols from CLAUDE.md.
4
-
5
- ## MANDATORY PROTOCOL REVIEW
6
-
7
- Read CLAUDE.md now and focus on:
8
-
9
- ### 1. AGENT-FIRST WORKFLOW (CRITICAL)
10
-
11
- **BEFORE RESPONDING TO ANY USER MESSAGE:**
12
- - ☐ What is the user asking for?
13
- - ☐ Does ANY agent match this request?
14
- - ☐ If yes → INVOKE THE AGENT via Task tool
15
- - ☐ If no agent matches → Proceed with skills/direct implementation
16
-
17
- **Agent Decision Tree:**
18
- - Automation work → check available agents for automation patterns
19
- - Web App Development → check available agents for framework-specific patterns
20
-
21
- **Never skip agent check to "save time" or because request "seems simple"**
22
-
23
- ### 2. SKILLS WORKFLOW (CRITICAL)
24
-
25
- **Before ANY task:**
26
- - ☐ List available skills in your mind
27
- - ☐ Does ANY skill match this request?
28
- - ☐ If yes → Use Skill tool to read and run it
29
- - ☐ Announce which skill you're using
30
- - ☐ Follow the skill exactly
31
-
32
- **Mandatory skills to remember:**
33
- - `code-standards` - For ALL code generation, planning, implementation
34
- - `superpowers:test-driven-development` - For ANY feature/bugfix
35
- - `superpowers:brainstorming` - BEFORE coding on design tasks
36
- - `superpowers:systematic-debugging` - For bugs/failures
37
- - `superpowers:verification-before-completion` - Before claiming work is done
38
-
39
- ### 3. TDD IS NON-NEGOTIABLE
40
-
41
- **Red-Green-Refactor:**
42
- 1. **Red**: Write failing test FIRST. NO production code.
43
- 2. **Green**: MINIMUM code to pass test only.
44
- 3. **Refactor**: Assess improvements after green.
45
-
46
- **If writing production code without failing test, STOP immediately.**
47
-
48
- ### 4. CODE STANDARDS (ENFORCED)
49
-
50
- - No `Any` types - Use Union/Optional/generics
51
- - No `# type: ignore` without justification
52
- - All imports at top
53
- - No files in project root
54
- - Immutable data (frozen dataclasses)
55
- - Small functions (5-15 lines, max 30)
56
- - Max 2 nesting levels
57
- - No comments (self-documenting code)
58
- - No Unicode in print/debug (Windows compatibility)
59
-
60
- ### 5. RIGHT-SIZED ENGINEERING
61
-
62
- **Always Do:**
63
- - Extract constants and configuration
64
- - Create reusable functions
65
- - DRY from the start
66
- - Single responsibility
67
-
68
- **Never Do (Solo Scale):**
69
- - Abstract base classes for single implementations
70
- - Dependency injection frameworks
71
- - Complex patterns
72
- - Over-abstracted interfaces
73
-
74
- ## Common Rationalizations That Mean Failure
75
-
76
- If you think:
77
- - "This is too simple" → WRONG. Check agents/skills.
78
- - "Let me just implement quickly" → WRONG. Check agents/skills first.
79
- - "I'll gather context first" → WRONG. Agents/skills tell you HOW.
80
- - "This doesn't need formal process" → WRONG. Process prevents mistakes.
81
-
82
- ## NOW PROCEED
83
-
84
- You have reviewed the critical protocols. Apply them to the current task.
85
-
86
- **Remember:**
87
- 1. Check agents FIRST
88
- 2. Check skills SECOND
89
- 3. Follow TDD ALWAYS
90
- 4. Build it right, but build it simple
@@ -1,88 +0,0 @@
1
- ---
2
- description: Detect and fix stub implementations in code and plans with agent/skill recommendations
3
- allowed-tools: Read, Grep, Glob, Skill
4
- ---
5
-
6
- Execute comprehensive stub detection using the stub-detector skill to identify incomplete implementations and recommend appropriate solutions.
7
-
8
- ## Process
9
-
10
- 1. **Invoke stub-detector skill** to scan current project
11
- 2. Identify all stubs in:
12
- - Python code (pass, NotImplementedError, TODO comments)
13
- - Plan documents (incomplete steps, TBD markers)
14
- - Configuration (placeholder values)
15
- 3. Classify by severity (CRITICAL/HIGH/MEDIUM/LOW)
16
- 4. Recommend specific agents or skills based on:
17
- - Project type (Web Automation, Django, etc.)
18
- - Stub category (config, automation, business logic)
19
- - Available implementations (check for existing solutions first)
20
- 5. Present actionable report with:
21
- - file:line references for each stub
22
- - Severity and impact assessment
23
- - Specific recommendations with rationale
24
- - Batch operation opportunities
25
- 6. Offer immediate actions to fix CRITICAL stubs
26
-
27
- ## Stub Detection Patterns
28
-
29
- **Code stubs to find:**
30
- ```
31
- pass statements
32
- NotImplementedError
33
- TODO/FIXME/HACK comments
34
- Empty functions with only docstrings
35
- Placeholder returns (return None when type suggests otherwise)
36
- ```
37
-
38
- **Documentation stubs to find:**
39
- ```
40
- [TODO] or [TBD] markers
41
- "To be implemented" sections
42
- Incomplete step descriptions
43
- Placeholder text in plans
44
- Missing details in implementation guides
45
- ```
46
-
47
- ## Agent/Skill Recommendation Logic
48
-
49
- **Web Automation stubs →**
50
- - Automation: automation-agent or automation skill
51
- - Google Sheets: sheets orchestrator agent
52
- - Config issues: clean-coder agent (extracts magic values to `config/` per CODE_RULES.md)
53
-
54
- **Web framework stubs →**
55
- - Models/views/forms: domain-specific agent
56
- - Business logic: domain-specific agent
57
- - Domain features: domain-specific agent
58
-
59
- **General stubs →**
60
- - Follow TDD workflow from CLAUDE.md
61
- - Follow CODE_RULES.md standards (via clean-coder agent)
62
- - Check for existing shared utilities first
63
-
64
- ## Output Format
65
-
66
- Provide a clear summary report showing:
67
- - Total stubs found with severity breakdown
68
- - Grouped by category for batch processing
69
- - Specific recommendations for each stub
70
- - Immediate action options for user
71
-
72
- Example:
73
- ```
74
- Found 7 stubs (3 CRITICAL, 2 HIGH, 2 MEDIUM)
75
-
76
- [CRITICAL] services/file_processor.py:45
77
- Incomplete matching logic
78
- → Recommendation: Use FileProcessor (already available)
79
- → Action: Refactor to use shared utility
80
-
81
- [HIGH] tests/test_integration.py:234
82
- Missing integration test
83
- → Recommendation: Follow TDD workflow
84
-
85
- Would you like me to fix CRITICAL stubs now?
86
- ```
87
-
88
- **IMPORTANT:** Always check if solutions already exist (like we just implemented FileProcessor) before recommending new development.
@@ -1,107 +0,0 @@
1
- """Link-integrity check for the skills tree and shared protocol docs.
2
-
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.
8
- """
9
-
10
- from __future__ import annotations
11
-
12
- import re
13
- from pathlib import Path
14
-
15
-
16
- SKILLS_ROOT = Path(__file__).parent
17
- SHARED_PR_LOOP_ROOT = SKILLS_ROOT.parent / "_shared" / "pr-loop"
18
- SHARED_ADVISOR_ROOT = SKILLS_ROOT.parent / "_shared" / "advisor"
19
-
20
- MARKDOWN_LINK_PATTERN = re.compile(r"\]\(([^)\s]+)\)")
21
- FENCE_MARKER = "```"
22
-
23
- SKIPPED_TARGET_PREFIXES = (
24
- "http://",
25
- "https://",
26
- "mailto:",
27
- "#",
28
- "/",
29
- "$",
30
- "~",
31
- "<",
32
- )
33
-
34
-
35
- def _iter_markdown_files() -> list[Path]:
36
- """List every markdown file the integrity check covers.
37
-
38
- Returns:
39
- All ``.md`` files under the skills tree, the shared pr-loop tree, and
40
- the shared advisor tree.
41
- """
42
- all_markdown_files = sorted(SKILLS_ROOT.rglob("*.md"))
43
- all_markdown_files.extend(sorted(SHARED_PR_LOOP_ROOT.rglob("*.md")))
44
- all_markdown_files.extend(sorted(SHARED_ADVISOR_ROOT.rglob("*.md")))
45
- return all_markdown_files
46
-
47
-
48
- def _is_checkable_target(link_target: str) -> bool:
49
- """Decide whether a markdown link target names a local relative path.
50
-
51
- Args:
52
- link_target: The raw text between ``](`` and ``)`` in a markdown link.
53
-
54
- Returns:
55
- True when the target is a relative filesystem path this check can
56
- resolve; False for URLs, anchors, absolute paths, environment-variable
57
- paths, home-relative paths, and angle-bracket placeholders.
58
- """
59
- if link_target.startswith(SKIPPED_TARGET_PREFIXES):
60
- return False
61
- if "\\" in link_target and link_target.count(":") > 0:
62
- return False
63
- return True
64
-
65
-
66
- def _collect_broken_links(markdown_path: Path) -> list[str]:
67
- """Resolve every relative link in one markdown file.
68
-
69
- Fenced code blocks are skipped, and a ``#fragment`` suffix is stripped
70
- before resolution.
71
-
72
- Args:
73
- markdown_path: The markdown file whose links are resolved.
74
-
75
- Returns:
76
- One ``file:line -> target`` description per unresolvable link.
77
- """
78
- all_broken_links: list[str] = []
79
- is_inside_fence = False
80
- for line_number, each_line in enumerate(
81
- markdown_path.read_text(encoding="utf-8").splitlines(), start=1
82
- ):
83
- if each_line.lstrip().startswith(FENCE_MARKER):
84
- is_inside_fence = not is_inside_fence
85
- continue
86
- if is_inside_fence:
87
- continue
88
- for each_match in MARKDOWN_LINK_PATTERN.finditer(each_line):
89
- link_target = each_match.group(1).split("#", 1)[0]
90
- if not link_target or not _is_checkable_target(link_target):
91
- continue
92
- resolved_target = (markdown_path.parent / link_target).resolve()
93
- if not resolved_target.exists():
94
- all_broken_links.append(
95
- f"{markdown_path}:{line_number} -> {each_match.group(1)}"
96
- )
97
- return all_broken_links
98
-
99
-
100
- def test_every_relative_markdown_link_resolves() -> None:
101
- all_broken_links: list[str] = []
102
- for each_markdown_path in _iter_markdown_files():
103
- all_broken_links.extend(_collect_broken_links(each_markdown_path))
104
- broken_link_report = "\n".join(all_broken_links)
105
- assert not all_broken_links, (
106
- f"Unresolvable relative markdown links:\n{broken_link_report}"
107
- )