claude-dev-env 1.38.1 → 1.40.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 (282) hide show
  1. package/CLAUDE.md +10 -36
  2. package/_shared/pr-loop/audit-reply-template.md +147 -0
  3. package/_shared/pr-loop/fix-protocol.md +25 -4
  4. package/_shared/pr-loop/gh-payloads.md +37 -50
  5. package/_shared/pr-loop/scripts/code_rules_gate.py +0 -60
  6. package/_shared/pr-loop/scripts/config/post_audit_thread_constants.py +199 -0
  7. package/_shared/pr-loop/scripts/config/reviews_disabled_constants.py +8 -0
  8. package/_shared/pr-loop/scripts/post_audit_thread.py +1242 -0
  9. package/_shared/pr-loop/scripts/preflight.py +129 -2
  10. package/_shared/pr-loop/scripts/reviews_disabled.py +59 -0
  11. package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +0 -19
  12. package/_shared/pr-loop/scripts/tests/test_post_audit_thread.py +1116 -0
  13. package/_shared/pr-loop/scripts/tests/test_post_audit_thread_constants.py +127 -0
  14. package/_shared/pr-loop/scripts/tests/test_preflight.py +41 -0
  15. package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +36 -0
  16. package/_shared/pr-loop/state-schema.md +1 -1
  17. package/agents/clean-coder.md +2 -2
  18. package/agents/pr-description-writer.md +150 -52
  19. package/bin/install.mjs +6 -7
  20. package/bin/install.test.mjs +8 -0
  21. package/commands/doc-gist.md +16 -0
  22. package/commands/plan.md +0 -2
  23. package/commands/review-plan.md +1 -1
  24. package/docs/CODE_RULES.md +122 -2
  25. package/docs/PR_DESCRIPTION_GUIDE.md +127 -64
  26. package/hooks/blocking/bot_mention_comment_blocker.py +75 -0
  27. package/hooks/blocking/code_rules_enforcer.py +1143 -129
  28. package/hooks/blocking/convergence_gate_blocker.py +130 -0
  29. package/hooks/blocking/destructive_command_blocker.py +74 -0
  30. package/hooks/blocking/gh_body_arg_blocker.py +30 -0
  31. package/hooks/blocking/md_to_html_blocker.py +119 -0
  32. package/hooks/blocking/pr_description_enforcer.py +57 -22
  33. package/hooks/blocking/test_bot_mention_comment_blocker.py +131 -0
  34. package/hooks/blocking/test_code_rules_enforcer.py +21 -0
  35. package/hooks/blocking/test_code_rules_enforcer_any_exempt_files.py +70 -0
  36. package/hooks/blocking/test_code_rules_enforcer_any_imports_and_cast.py +92 -0
  37. package/hooks/blocking/test_code_rules_enforcer_banned_import_alias.py +143 -0
  38. package/hooks/blocking/test_code_rules_enforcer_banned_prefixes.py +152 -0
  39. package/hooks/blocking/test_code_rules_enforcer_bare_except.py +120 -0
  40. package/hooks/blocking/test_code_rules_enforcer_boundary_types.py +175 -0
  41. package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +0 -1
  42. package/hooks/blocking/test_code_rules_enforcer_collection_prefix.py +50 -0
  43. package/hooks/blocking/test_code_rules_enforcer_docstring_format.py +255 -0
  44. package/hooks/blocking/test_code_rules_enforcer_inline_tuple_string_magic.py +130 -0
  45. package/hooks/blocking/test_code_rules_enforcer_stub_implementations.py +141 -0
  46. package/hooks/blocking/test_code_rules_enforcer_test_branching.py +143 -0
  47. package/hooks/blocking/test_code_rules_enforcer_thin_wrapper_files.py +169 -0
  48. package/hooks/blocking/test_code_rules_enforcer_todo_markers.py +99 -0
  49. package/hooks/blocking/test_code_rules_enforcer_typed_dict_pairs.py +141 -0
  50. package/hooks/blocking/test_convergence_gate_blocker.py +63 -0
  51. package/hooks/blocking/test_destructive_command_blocker.py +146 -0
  52. package/hooks/blocking/test_destructive_command_blocker_no_verify.py +102 -0
  53. package/hooks/blocking/test_gh_body_arg_blocker.py +45 -0
  54. package/hooks/blocking/test_md_to_html_blocker.py +317 -0
  55. package/hooks/blocking/test_pr_description_enforcer.py +69 -8
  56. package/hooks/config/any_type_config.py +7 -0
  57. package/hooks/config/banned_identifiers_constants.py +11 -0
  58. package/hooks/config/blocking_check_limits.py +38 -0
  59. package/hooks/config/bot_mention_comment_blocker_constants.py +20 -0
  60. package/hooks/config/code_rules_enforcer_constants.py +53 -0
  61. package/hooks/config/convergence_branch_constants.py +9 -0
  62. package/hooks/config/doc_gist_auto_publish_constants.py +18 -0
  63. package/hooks/config/html_companion_constants.py +20 -0
  64. package/hooks/config/inline_tuple_string_magic_constants.py +22 -0
  65. package/hooks/config/pr_description_enforcer_constants.py +14 -0
  66. package/hooks/config/test_banned_identifiers_constants.py +17 -0
  67. package/hooks/hooks.json +28 -20
  68. package/hooks/pyproject.toml +69 -0
  69. package/hooks/validators/mypy_integration.py +47 -1
  70. package/hooks/validators/run_all_validators.py +3 -3
  71. package/hooks/validators/test_mypy_integration.py +50 -1
  72. package/hooks/workflow/doc_gist_auto_publish.py +144 -0
  73. package/hooks/workflow/md_to_html_companion.py +365 -0
  74. package/hooks/workflow/test_doc_gist_auto_publish.py +117 -0
  75. package/hooks/workflow/test_md_to_html_companion.py +452 -0
  76. package/package.json +1 -1
  77. package/rules/gh-body-file.md +2 -0
  78. package/scripts/Install-SweepEmptyDirs.ps1 +111 -0
  79. package/scripts/check.ps1 +106 -0
  80. package/scripts/config/timing.py +11 -0
  81. package/scripts/sweep_empty_dirs.py +138 -0
  82. package/scripts/sync_to_cursor/rules.py +1 -1
  83. package/scripts/test_sweep_empty_dirs.py +183 -0
  84. package/skills/_shared/pr-loop/prompts/pr-consistency-audit.xml +323 -0
  85. package/skills/_shared/pr-loop/scripts/_cli_utils.py +22 -0
  86. package/skills/_shared/pr-loop/scripts/_path_resolver.py +165 -0
  87. package/skills/_shared/pr-loop/scripts/_xml_utils.py +20 -0
  88. package/skills/_shared/pr-loop/scripts/build_audit_prompt.py +182 -0
  89. package/skills/_shared/pr-loop/scripts/build_fix_prompt.py +185 -0
  90. package/skills/_shared/pr-loop/scripts/config/__init__.py +0 -0
  91. package/skills/_shared/pr-loop/scripts/config/path_resolver_constants.py +78 -0
  92. package/skills/_shared/pr-loop/scripts/init_loop_state.py +135 -0
  93. package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +175 -0
  94. package/skills/_shared/pr-loop/scripts/write_audit_outcomes.py +182 -0
  95. package/skills/_shared/pr-loop/scripts/write_fix_outcomes.py +206 -0
  96. package/skills/bugteam/CONSTRAINTS.md +21 -22
  97. package/skills/bugteam/EXAMPLES.md +3 -3
  98. package/skills/bugteam/PROMPTS.md +227 -67
  99. package/skills/bugteam/SKILL.md +132 -455
  100. package/skills/bugteam/reference/README.md +1 -1
  101. package/skills/bugteam/reference/audit-and-teammates.md +112 -39
  102. package/skills/bugteam/reference/audit-contract.md +4 -22
  103. package/skills/bugteam/reference/copilot-gap-analysis.md +8 -5
  104. package/skills/bugteam/reference/design-rationale.md +2 -2
  105. package/skills/bugteam/reference/github-pr-reviews.md +50 -57
  106. package/skills/bugteam/reference/obstacles/audit-assign-ids.md +13 -0
  107. package/skills/bugteam/reference/obstacles/audit-capture-excerpts.md +13 -0
  108. package/skills/bugteam/reference/obstacles/audit-walk-categories.md +13 -0
  109. package/skills/bugteam/reference/obstacles/audit-write-xml.md +13 -0
  110. package/skills/bugteam/reference/obstacles/fix-append-summary.md +13 -0
  111. package/skills/bugteam/reference/obstacles/fix-apply-fixes.md +13 -0
  112. package/skills/bugteam/reference/obstacles/fix-git-add-commit.md +13 -0
  113. package/skills/bugteam/reference/obstacles/fix-git-push.md +13 -0
  114. package/skills/bugteam/reference/obstacles/fix-post-reply.md +13 -0
  115. package/skills/bugteam/reference/obstacles/fix-publish-summary.md +13 -0
  116. package/skills/bugteam/reference/obstacles/fix-py-compile.md +13 -0
  117. package/skills/bugteam/reference/obstacles/fix-read-files.md +13 -0
  118. package/skills/bugteam/reference/obstacles/fix-resolve-thread.md +13 -0
  119. package/skills/bugteam/reference/obstacles/fix-test-suite.md +13 -0
  120. package/skills/bugteam/reference/obstacles/fix-violation-count.md +13 -0
  121. package/skills/bugteam/reference/obstacles/fix-write-xml.md +13 -0
  122. package/skills/bugteam/reference/team-setup.md +111 -9
  123. package/skills/bugteam/reference/teardown-publish-permissions.md +39 -8
  124. package/skills/bugteam/scripts/README.md +60 -0
  125. package/skills/bugteam/scripts/_claude_permissions_common.py +358 -0
  126. package/skills/bugteam/scripts/bugteam_code_rules_gate.py +976 -0
  127. package/skills/bugteam/scripts/bugteam_fix_hookspath.py +375 -0
  128. package/skills/bugteam/scripts/bugteam_preflight.py +328 -0
  129. package/skills/bugteam/scripts/config/bugteam_code_rules_gate_constants.py +25 -0
  130. package/skills/bugteam/scripts/config/bugteam_fix_hookspath_constants.py +26 -0
  131. package/skills/bugteam/scripts/config/bugteam_preflight_constants.py +35 -0
  132. package/skills/bugteam/scripts/config/claude_permissions_common_constants.py +20 -0
  133. package/skills/bugteam/scripts/config/probe_code_rules_enforcer_check_constants.py +12 -0
  134. package/skills/bugteam/scripts/config/windows_safe_rmtree_constants.py +7 -0
  135. package/skills/bugteam/scripts/grant_project_claude_permissions.py +175 -0
  136. package/skills/bugteam/scripts/probe_code_rules_enforcer_check.py +107 -0
  137. package/skills/bugteam/scripts/revoke_project_claude_permissions.py +220 -0
  138. package/skills/bugteam/scripts/test__claude_permissions_common.py +112 -0
  139. package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +400 -0
  140. package/skills/bugteam/scripts/test_bugteam_fix_hookspath.py +384 -0
  141. package/skills/bugteam/scripts/test_bugteam_preflight.py +309 -0
  142. package/skills/bugteam/scripts/test_claude_permissions_common.py +195 -0
  143. package/skills/bugteam/scripts/test_grant_project_claude_permissions.py +55 -0
  144. package/skills/bugteam/scripts/test_probe_code_rules_enforcer_check.py +76 -0
  145. package/skills/bugteam/scripts/test_revoke_project_claude_permissions.py +55 -0
  146. package/skills/bugteam/scripts/test_windows_safe_rmtree.py +108 -0
  147. package/skills/bugteam/scripts/windows_safe_rmtree.py +100 -0
  148. package/skills/bugteam/test_skill_additions.py +1 -11
  149. package/skills/code/SKILL.md +176 -0
  150. package/skills/copilot-review/SKILL.md +16 -0
  151. package/skills/doc-gist/SKILL.md +99 -0
  152. package/skills/doc-gist/references/examples/01-exploration-code-approaches.html +453 -0
  153. package/skills/doc-gist/references/examples/02-exploration-visual-designs.html +515 -0
  154. package/skills/doc-gist/references/examples/03-code-review-pr.html +638 -0
  155. package/skills/doc-gist/references/examples/04-code-understanding.html +491 -0
  156. package/skills/doc-gist/references/examples/05-design-system.html +629 -0
  157. package/skills/doc-gist/references/examples/06-component-variants.html +605 -0
  158. package/skills/doc-gist/references/examples/07-prototype-animation.html +455 -0
  159. package/skills/doc-gist/references/examples/08-prototype-interaction.html +396 -0
  160. package/skills/doc-gist/references/examples/09-slide-deck.html +592 -0
  161. package/skills/doc-gist/references/examples/10-svg-illustrations.html +492 -0
  162. package/skills/doc-gist/references/examples/11-status-report.html +528 -0
  163. package/skills/doc-gist/references/examples/12-incident-report.html +596 -0
  164. package/skills/doc-gist/references/examples/13-flowchart-diagram.html +395 -0
  165. package/skills/doc-gist/references/examples/14-research-feature-explainer.html +381 -0
  166. package/skills/doc-gist/references/examples/15-research-concept-explainer.html +368 -0
  167. package/skills/doc-gist/references/examples/16-implementation-plan.html +702 -0
  168. package/skills/doc-gist/references/examples/17-pr-writeup.html +595 -0
  169. package/skills/doc-gist/references/examples/18-editor-triage-board.html +573 -0
  170. package/skills/doc-gist/references/examples/19-editor-feature-flags.html +663 -0
  171. package/skills/doc-gist/references/examples/20-editor-prompt-tuner.html +722 -0
  172. package/skills/doc-gist/references/examples/README.md +5 -0
  173. package/skills/doc-gist/scripts/config/__init__.py +0 -0
  174. package/skills/doc-gist/scripts/config/gist_upload_constants.py +16 -0
  175. package/skills/doc-gist/scripts/gist_upload.py +177 -0
  176. package/skills/doc-gist/scripts/test_gist_upload.py +51 -0
  177. package/skills/findbugs/SKILL.md +96 -2
  178. package/skills/monitor-open-prs/SKILL.md +14 -32
  179. package/skills/monitor-open-prs/test_skill_contract.py +0 -11
  180. package/skills/pr-consistency-audit/SKILL.md +112 -0
  181. package/skills/pr-consistency-audit/reference/detection-rules.md +96 -0
  182. package/skills/pr-consistency-audit/reference/illustrations.md +78 -0
  183. package/skills/pr-converge/SKILL.md +229 -23
  184. package/skills/pr-converge/config/__init__.py +0 -0
  185. package/skills/pr-converge/config/constants.py +63 -0
  186. package/skills/pr-converge/reference/convergence-gates.md +138 -44
  187. package/skills/pr-converge/reference/examples.md +43 -11
  188. package/skills/pr-converge/reference/fix-protocol.md +6 -5
  189. package/skills/pr-converge/reference/ground-rules.md +5 -3
  190. package/skills/pr-converge/reference/multi-pr-orchestration.md +44 -19
  191. package/skills/pr-converge/reference/obstacles/fix-post-replies.md +13 -0
  192. package/skills/pr-converge/reference/obstacles/fix-publish-summary.md +13 -0
  193. package/skills/pr-converge/reference/obstacles/fix-push.md +13 -0
  194. package/skills/pr-converge/reference/obstacles/fix-read-filelines.md +13 -0
  195. package/skills/pr-converge/reference/obstacles/fix-reset-state.md +13 -0
  196. package/skills/pr-converge/reference/obstacles/fix-resolve-threads.md +13 -0
  197. package/skills/pr-converge/reference/obstacles/fix-spawn-clean-coder.md +13 -0
  198. package/skills/pr-converge/reference/obstacles/fix-stage-commit.md +13 -0
  199. package/skills/pr-converge/reference/obstacles/fix-trigger-bugbot.md +13 -0
  200. package/skills/pr-converge/reference/obstacles/fix-write-test.md +13 -0
  201. package/skills/pr-converge/reference/per-tick.md +107 -31
  202. package/skills/pr-converge/reference/state-schema.md +22 -1
  203. package/skills/pr-converge/reference/stop-conditions.md +9 -7
  204. package/skills/pr-converge/scripts/README.md +34 -46
  205. package/skills/pr-converge/scripts/check_bugbot_ci.py +279 -0
  206. package/skills/pr-converge/scripts/check_convergence.py +497 -0
  207. package/skills/pr-converge/scripts/check_pending_reviews.py +154 -0
  208. package/skills/pr-converge/scripts/config/pr_converge_constants.py +118 -0
  209. package/skills/pr-converge/scripts/fetch_copilot_reviews.py +134 -0
  210. package/skills/pr-converge/scripts/post_fix_reply.py +168 -0
  211. package/skills/pr-converge/scripts/test_check_bugbot_ci.py +312 -0
  212. package/skills/pr-converge/workflows/schedule-wakeup-loop.md +5 -12
  213. package/skills/qbug/SKILL.md +157 -27
  214. package/skills/session-log/SKILL.md +216 -114
  215. package/skills/session-tidy/SKILL.md +1 -1
  216. package/skills/skill-builder/SKILL.md +138 -56
  217. package/skills/skill-builder/references/delegation-map.md +72 -113
  218. package/skills/skill-builder/references/progressive-disclosure.md +122 -0
  219. package/skills/skill-builder/references/self-audit-checklist.md +92 -0
  220. package/skills/skill-builder/references/skill-types.md +228 -0
  221. package/skills/skill-builder/references/thariq-x-post-skills.json +33 -0
  222. package/skills/skill-builder/templates/gap-analysis.md +15 -8
  223. package/skills/skill-builder/workflows/improve-skill.md +86 -57
  224. package/skills/skill-builder/workflows/new-skill.md +80 -168
  225. package/skills/skill-builder/workflows/polish-skill.md +78 -54
  226. package/skills/structure-prompt/SKILL.md +50 -0
  227. package/skills/structure-prompt/reference/adversarial-tuning.md +62 -0
  228. package/skills/structure-prompt/reference/block-classification.md +27 -0
  229. package/skills/structure-prompt/reference/canonical-case.md +48 -0
  230. package/skills/structure-prompt/reference/citation-depth.md +70 -0
  231. package/skills/structure-prompt/reference/cleanup.md +33 -0
  232. package/skills/structure-prompt/reference/constraints.md +33 -0
  233. package/skills/structure-prompt/reference/directives.md +37 -0
  234. package/skills/structure-prompt/reference/examples.md +72 -0
  235. package/skills/structure-prompt/reference/instantiation.md +51 -0
  236. package/skills/structure-prompt/reference/output-contract.md +72 -0
  237. package/skills/structure-prompt/reference/per-category.md +23 -0
  238. package/skills/structure-prompt/reference/persona.md +38 -0
  239. package/skills/structure-prompt/reference/research.md +33 -0
  240. package/skills/structure-prompt/reference/structure.md +28 -0
  241. package/agents/code-standards-agent.md +0 -93
  242. package/agents/groq-coder.md +0 -113
  243. package/agents/plan-executor.md +0 -226
  244. package/agents/project-docs-analyzer.md +0 -53
  245. package/agents/project-structure-organizer-agent.md +0 -72
  246. package/agents/skill-to-agent-converter.md +0 -370
  247. package/agents/skill-writer-agent.md +0 -470
  248. package/agents/user-docs-writer.md +0 -67
  249. package/agents/workflow-visual-documenter.md +0 -82
  250. package/commands/readability-review.md +0 -20
  251. package/hooks/mypy.ini +0 -2
  252. package/hooks/notification/attention_needed_notify.py +0 -71
  253. package/hooks/notification/claude_notification_handler.py +0 -67
  254. package/hooks/notification/notification_utils.py +0 -267
  255. package/hooks/notification/subagent_complete_notify.py +0 -381
  256. package/hooks/notification/test_attention_needed_notify.py +0 -47
  257. package/hooks/notification/test_claude_notification_handler.py +0 -54
  258. package/hooks/notification/test_notification_utils.py +0 -91
  259. package/hooks/notification/test_subagent_complete_notify.py +0 -79
  260. package/scripts/config/groq_bugteam_config.py +0 -230
  261. package/scripts/config/test_groq_bugteam_config.py +0 -83
  262. package/scripts/config/test_spec_implementer_prompt.py +0 -32
  263. package/scripts/groq_bugteam.README.md +0 -131
  264. package/scripts/groq_bugteam.py +0 -647
  265. package/scripts/groq_bugteam_dotenv.py +0 -40
  266. package/scripts/groq_bugteam_spec.py +0 -226
  267. package/scripts/test_groq_bugteam.py +0 -529
  268. package/scripts/test_groq_bugteam_apply_fix_from_spec.py +0 -426
  269. package/scripts/test_groq_bugteam_dotenv.py +0 -66
  270. package/scripts/test_groq_bugteam_spec.py +0 -338
  271. package/skills/bugteam/SKILL_EVALS.md +0 -309
  272. package/skills/dream/SKILL.md +0 -118
  273. package/skills/ingest/SKILL.md +0 -40
  274. package/skills/npm-creator/SKILL.md +0 -187
  275. package/skills/readability-review/SKILL.md +0 -127
  276. package/skills/resume-review/SKILL.md +0 -261
  277. package/skills/rule-audit/SKILL.md +0 -307
  278. package/skills/rule-creator/SKILL.md +0 -150
  279. package/skills/searching-obsidian-vault/SKILL.md +0 -131
  280. package/skills/skill-writer/REFERENCE.md +0 -284
  281. package/skills/skill-writer/SKILL.md +0 -222
  282. package/skills/tdd-team/SKILL.md +0 -128
@@ -1,150 +0,0 @@
1
- ---
2
- name: rule-creator
3
- description: "Creates or hardens Codex rules in .Codex/rules/*.md. Analyzes behavioral patterns and converts them into persistent, enforceable rule files. Triggers: 'create rule', 'add rule', 'harden rule', 'enforce rule', 'new rule'."
4
- ---
5
-
6
- # Rule Creator
7
-
8
- ## Overview
9
-
10
- Creates well-structured `.Codex/rules/*.md` files that Codex loads into every session.
11
-
12
- **Core principle:** Rules encode "always true" behaviors. A rule eliminates repeated manual prompting by making the instruction persistent and automatic.
13
-
14
- **Announce at start:** "I'm using the rule-creator skill to [create/harden] a rule."
15
-
16
- **Context:** Rules are loaded at session start. They complement AGENTS.md (high-level project instructions) and skills (on-demand workflows). Use rules for behavioral constraints that must always be active.
17
-
18
- ## The Process
19
-
20
- ### Step 1: Understand the Need
21
-
22
- Before writing, clarify:
23
-
24
- 1. **What behavior** should this rule enforce or prevent?
25
- 2. **Why** is it needed? (What goes wrong without it? What do you manually correct?)
26
- 3. **Scope** — all projects (`~/.Codex/rules/`) or project-specific (`.Codex/rules/`)?
27
- 4. **Path-scoped?** — does it only apply to certain file types?
28
-
29
- ### Step 2: Check for Overlap
30
-
31
- Search existing rules before creating a new one:
32
-
33
- 1. Read `~/.Codex/rules/*.md` and `.Codex/rules/*.md`
34
- 2. Read AGENTS.md for related instructions
35
- 3. If overlap exists: **harden the existing rule** instead of creating a duplicate
36
-
37
- ### Step 3: Write the Rule
38
-
39
- Follow these principles from Anthropic's prompting best practices and Codex docs:
40
-
41
- **Structure:**
42
- - Optional YAML frontmatter (only if path-scoped or needs `alwaysApply`)
43
- - Markdown with headers and bullets
44
- - Target under 50 lines per rule file (rules are loaded every session — token cost matters)
45
-
46
- **Writing principles (source: [Anthropic Prompting Best Practices](https://platform.Codex.com/docs/en/build-with-Codex/prompt-engineering/Codex-prompting-best-practices)):**
47
-
48
- 1. **Tell what TO do, not what NOT to do.** Positive instructions outperform negative ones.
49
- - Instead of: "Do not guess CSS selectors"
50
- - Write: "Read the actual HTML source before writing any CSS selector"
51
-
52
- 2. **Add context/motivation (WHY).** Codex generalizes from explanations.
53
- - Instead of: "NEVER use ellipses"
54
- - Write: "Never use ellipses because the text-to-speech engine cannot pronounce them"
55
-
56
- 3. **Be specific enough to verify.** Vague rules get ignored.
57
- - Instead of: "Write clean code"
58
- - Write: "Use 2-space indentation, no trailing whitespace"
59
-
60
- 4. **Use XML tags for critical constraints.** Wrap non-negotiable rules in semantic tags.
61
- ```
62
- <investigate_before_answering>
63
- Read referenced files before making claims about their contents.
64
- </investigate_before_answering>
65
- ```
66
-
67
- 5. **Dial back aggressive language for the current model.** The model overtriggers on "CRITICAL", "MUST", "ALWAYS" — use normal prompting unless enforcement truly requires it.
68
-
69
- **Frontmatter reference:**
70
- ```yaml
71
- # Path-scoped rule (loads only when matching files are opened):
72
- ---
73
- paths:
74
- - "src/api/**/*.ts"
75
- ---
76
-
77
- # Always-apply rule (loads every session, no conditions):
78
- # Simply omit frontmatter entirely — rules without frontmatter load unconditionally.
79
-
80
- # AVOID using alwaysApply: false — it makes the rule load-on-demand only,
81
- # which means it may never activate unless Codex happens to read matching files.
82
- ```
83
-
84
- ### Step 4: Choose Filename
85
-
86
- - Lowercase, hyphens only: `investigate-first.md`, `parallel-tools.md`
87
- - Descriptive of the behavior: name after what the rule DOES, not the problem it prevents
88
- - Match naming convention of existing rules in the target directory
89
-
90
- ### Step 5: Validate
91
-
92
- Before writing the file:
93
-
94
- - [ ] Under 50 lines (concise enough to load every session without waste)
95
- - [ ] Positive instructions (tells what TO do)
96
- - [ ] Includes WHY context where non-obvious
97
- - [ ] Specific enough to verify compliance
98
- - [ ] No overlap with existing rules or AGENTS.md
99
- - [ ] No frontmatter if it should always load (omit = unconditional)
100
- - [ ] Path-scoped frontmatter only if genuinely file-type-specific
101
-
102
- ### Step 6: Write and Confirm
103
-
104
- 1. Write the rule to the target directory
105
- 2. Show the user the final content for review
106
- 3. Note: rules take effect on the NEXT session (Codex caches at startup)
107
-
108
- ## Hardening Existing Rules
109
-
110
- When a rule exists but isn't being followed:
111
-
112
- 1. **Check frontmatter** — `alwaysApply: false` prevents auto-loading. Remove it.
113
- 2. **Check for conflicts** — contradictory rules in other files cause arbitrary behavior
114
- 3. **Add WHY context** — unexplained rules get lower adherence
115
- 4. **Reframe as positive** — convert "NEVER do X" to "Always do Y instead"
116
- 5. **Add XML wrapper** — for critical rules, semantic tags improve parsing:
117
- ```xml
118
- <rule_name>
119
- Instruction here.
120
- </rule_name>
121
- ```
122
- 6. **Reduce aggressive language** — the current model overtriggers on "CRITICAL/MUST/ALWAYS". Use direct, normal language unless the rule truly requires absolute enforcement.
123
-
124
- ## Red Flags — STOP
125
-
126
- - Rule duplicates something already in AGENTS.md or another rule
127
- - Rule is over 50 lines (split it or move details to a referenced doc)
128
- - Rule uses only negative instructions ("NEVER", "DON'T") without positive alternatives
129
- - Rule has `alwaysApply: false` for something that should always be active
130
- - Rule is too vague to verify ("write good code")
131
-
132
- ## Rationalization Prevention
133
-
134
- | Excuse | Reality |
135
- |--------|---------|
136
- | "This is already in AGENTS.md" | If it's not being followed, it needs a dedicated rule with WHY context |
137
- | "The rule is short enough, no WHY needed" | WHY context improves adherence even for short rules — Codex generalizes from explanations |
138
- | "I'll use CRITICAL/MUST to make it stronger" | the current model overtriggers on aggressive language. Direct, calm instructions work better. |
139
- | "alwaysApply: false is fine, Codex will find it" | On-demand loading means the rule may never activate. Omit frontmatter for always-on rules. |
140
-
141
- ## Remember
142
-
143
- - Omit frontmatter = always loads (this is what you want for most rules)
144
- - `alwaysApply: false` = on-demand only (use sparingly)
145
- - `paths:` frontmatter = loads when matching files are opened
146
- - Positive instructions > negative instructions
147
- - WHY context > bare commands
148
- - Under 50 lines per rule file
149
- - One behavior per rule file
150
- - Rules take effect next session
@@ -1,131 +0,0 @@
1
- ---
2
- name: searching-obsidian-vault
3
- description: >-
4
- Retrieves Obsidian vault context from %USERPROFILE%/SessionLog/ via the
5
- configured mcp__obsidian__* server. Searches sessions/, decisions/, and
6
- Research/. Use when the user says "yesterday", "last night", "the other
7
- day", "earlier today", "this morning", "a few days ago", "last week",
8
- "this past week", "a while back", "recently", "recent session", "last
9
- session", or "previous session"; when the user asks why existing code
10
- was built a certain way or whether an approach was tried before; when
11
- starting a session in a git repo whose name matches a project folder
12
- under sessions/; or when the user names a specific component, decision,
13
- gotcha, or prior research note.
14
- ---
15
-
16
- # Obsidian Vault
17
-
18
- ## Overview
19
-
20
- Invoke this skill when prior session history, decisions, or research from
21
- the Obsidian vault would change how the current task is executed. Load it
22
- on demand rather than keeping the full vault policy always-on.
23
-
24
- The retrieval *mechanics* live in `/recall`. The
25
- `vault_context_retrieved` frontmatter bookkeeping lives in `/session-log`
26
- Step 2. This skill's job is to make the vault search happen at the right
27
- moments so the downstream flag can be set honestly.
28
-
29
- ## Trigger Conditions
30
-
31
- Invoke automatically when any of the following holds:
32
-
33
- - The user says "yesterday", "last night", "the other day", "earlier
34
- today", "this morning", "a few days ago", "last week", "this past
35
- week", "a while back", "recently", "recent session", "last session",
36
- or "previous session".
37
- - The user asks why existing code was built a certain way, or whether an
38
- approach was tried before.
39
- - A new session starts in a git repo whose name matches a project folder
40
- under `sessions/`.
41
- - The user names a specific component, feature, or architectural decision
42
- that a session or decision note might exist for.
43
- - The user mentions "session", "decision", "gotcha", "superseded", or
44
- "prior research" by name.
45
-
46
- Skip the skill for isolated lookups with no project history (e.g. one-off
47
- utility scripts, pure syntax questions, fresh repos with no
48
- `sessions/[project]/` folder).
49
-
50
- ## Search Algorithm
51
-
52
- 1. **Search by frontmatter first.** Call `mcp__obsidian__search_notes` with
53
- `searchFrontmatter: true` and the project name (inferred from the git
54
- remote, working directory, or topic under discussion). Then search by
55
- content keywords such as `blocked`, `superseded`, `decision`, `gotcha`,
56
- plus task-specific terms (component names, error messages, library names).
57
-
58
- Concrete example:
59
-
60
- ```xml
61
- <invoke name="mcp__obsidian__search_notes">
62
- <parameter name="query">claude-code-config</parameter>
63
- <parameter name="searchFrontmatter">true</parameter>
64
- </invoke>
65
-
66
- <invoke name="mcp__obsidian__search_notes">
67
- <parameter name="query">superseded decision themes-pr-stack</parameter>
68
- </invoke>
69
- ```
70
-
71
- 2. **Scope to the three vault folders.**
72
- - `sessions/` — session reports (`type: session-report`, `project`,
73
- `session`, `date`, `status`, `blocked`, `tags`).
74
- - `decisions/` — decision notes (`type: decision|procedural|fact|gotcha`,
75
- `project`, `date`, `status: Active|Superseded`, `tags`).
76
- - `Research/` — deep research documents.
77
-
78
- 3. **Read the top 3–5 hits.** Use `mcp__obsidian__read_note` for single notes
79
- or `mcp__obsidian__read_multiple_notes` for several at once. Prefer recent
80
- notes over older ones, and prefer decision notes and session summaries
81
- over raw research.
82
-
83
- 4. **Summarise the relevant prior context** inline before proceeding with
84
- the work, so the user can see what prior history shaped the current
85
- approach. Call out any decision marked `status: Superseded`.
86
-
87
- 5. **Record the outcome for `/session-log`.** Set
88
- `vault_context_retrieved: true` if any `mcp__obsidian__*` read or search
89
- tool was used productively (at least one relevant note surfaced and
90
- informed the work). Set it to `false` if the vault was unreachable or no
91
- relevant notes were found.
92
-
93
- ## Session-End Integration
94
-
95
- At the end of substantive sessions, offer to run `/session-log`. Step 2 of
96
- `/session-log` already auto-detects vault MCP calls and writes the
97
- `vault_context_retrieved` field into frontmatter. This skill's contribution
98
- is to ensure those MCP calls actually happen when they should, so the flag
99
- ends up `true` whenever genuine prior context exists.
100
-
101
- ## Frontmatter Requirement
102
-
103
- Any session note written via `/session-log` after invoking this skill must
104
- include:
105
-
106
- ```yaml
107
- vault_context_retrieved: true # or false
108
- ```
109
-
110
- `true` means a `mcp__obsidian__*` read or search tool was used productively
111
- during the session. `false` means the vault was unreachable or no relevant
112
- notes existed.
113
-
114
- ## Vault Location
115
-
116
- The vault lives at `%USERPROFILE%/SessionLog/` on this workspace
117
- (expanding to the user's Windows profile directory). It is accessed
118
- entirely through the `mcp__obsidian__*` MCP server, whose own
119
- configuration holds the concrete path; `OBSIDIAN_VAULT_PATH` serves the
120
- same role on systems that resolve the vault outside the MCP server. This
121
- skill does not read the filesystem directly and must not hard-code a
122
- user-specific path like `C:/Users/<name>/SessionLog/` in code it
123
- produces — expand `%USERPROFILE%` (or read `OBSIDIAN_VAULT_PATH`) at run
124
- time.
125
-
126
- ## Related Skills
127
-
128
- - `/recall` performs the retrieval mechanics end-to-end with user-facing
129
- output.
130
- - `/session-log` consumes the `vault_context_retrieved` flag this skill is
131
- responsible for keeping honest.
@@ -1,284 +0,0 @@
1
- # Skill writer -- reference
2
-
3
- ## Canonical resources
4
-
5
- When authoring or refining skills, ground decisions in these sources. If guidance conflicts, defer to the higher tier.
6
-
7
- ### Tier 1: Anthropic (primary authority for Claude)
8
-
9
- - https://platform.claude.com/docs/en/claude-code/skills -- official skill structure, frontmatter fields, progressive disclosure, string substitutions, directory layout.
10
- - https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices -- the single living reference for Claude's latest models. Covers XML tags, tool use, thinking, agentic systems, overeagerness, anti-hallucination.
11
- - https://transformer-circuits.pub/2026/emotions/index.html -- emotion concepts research (April 2026): 171 internal activation patterns that causally influence behavior. Key skill-writing takeaways: clear criteria and escape routes improve output quality, collaborative framing activates engagement, positive task framing correlates with better results.
12
- - https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking -- adaptive thinking reference; replaces manual budget_tokens with effort-based control.
13
-
14
- ### Tier 2: Major labs (strong secondary, often transfers across models)
15
-
16
- - https://platform.openai.com/docs/guides/prompt-engineering -- six strategies: clear instructions, reference text, split complex tasks, give models time to think, use external tools, test systematically.
17
- - https://deepmind.google/research/ -- chain-of-thought and structured reasoning research.
18
-
19
- ### Tier 3: Community and individuals (supplementary)
20
-
21
- - https://simonwillison.net/ -- practical LLM experiments, skill patterns, and automation insights.
22
- - https://www.deeplearning.ai/short-courses/ -- foundational prompt engineering courses.
23
- - https://www.latent.space/ -- AI engineering perspective.
24
-
25
- ### Conflict resolution rule
26
-
27
- If sources disagree on a technique, apply in order: Anthropic documentation first (it describes the actual model behavior), then OpenAI/Google/Microsoft (large-scale research with cross-model relevance), then community sources (patterns and intuition, not authoritative on model internals). When Tier 3 contradicts Tier 1, Tier 1 wins without exception.
28
-
29
- ---
30
-
31
- ## Complete frontmatter fields
32
-
33
- Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
34
-
35
- ### Required fields
36
-
37
- | Field | Type | Constraints | Description |
38
- |-------|------|-------------|-------------|
39
- | `name` | string | Lowercase, hyphens, numbers. Max 64 chars. No `anthropic` or `claude`. | Must match directory name. Prefer gerund form. |
40
- | `description` | string | Max 1024 chars. Third person. No XML tags. | What it does + when to use it + trigger phrases. |
41
-
42
- ### Optional fields
43
-
44
- | Field | Type | Default | Description |
45
- |-------|------|---------|-------------|
46
- | `allowed-tools` | string | (all tools) | Tools permitted without asking. E.g., `Read, Grep, Bash(python *)` |
47
- | `context` | string | (inline) | Set to `fork` to run in isolated subagent (no conversation history) |
48
- | `agent` | string | (default) | Subagent type when `context: fork` is set |
49
- | `model` | string | (inherits) | Model override when skill is active |
50
- | `effort` | string | (inherits) | `low`, `medium`, `high`, or `max` (Opus only) |
51
- | `user-invocable` | boolean | `true` | Set `false` to hide from `/` menu (background knowledge only) |
52
- | `disable-model-invocation` | boolean | `false` | Set `true` for manual-only via `/name` |
53
- | `paths` | string/list | (all files) | Glob patterns limiting activation. E.g., `"*.py"` or `["*.ts", "*.tsx"]` |
54
- | `argument-hint` | string | (none) | Autocomplete hint. E.g., `[filename] [format]` |
55
- | `shell` | string | `bash` | Shell for `` !`command` `` blocks. `bash` or `powershell` |
56
- | `hooks` | object | (none) | Hooks scoped to this skill's lifecycle |
57
-
58
- ### String substitutions (available in SKILL.md body)
59
-
60
- | Variable | Description |
61
- |----------|-------------|
62
- | `$ARGUMENTS` | All arguments passed when invoking |
63
- | `$ARGUMENTS[N]` | Specific argument by 0-based index |
64
- | `$N` | Shorthand for `$ARGUMENTS[N]` (e.g., `$0`, `$1`) |
65
- | `${CLAUDE_SESSION_ID}` | Current session ID |
66
- | `${CLAUDE_SKILL_DIR}` | Directory containing SKILL.md |
67
- | `` !`command` `` | Dynamic context injection -- shell command runs before Claude sees content |
68
-
69
- ### Permission syntax
70
-
71
- ```
72
- Skill(name) # Allow exact skill
73
- Skill(name *) # Allow skill with any arguments
74
- ```
75
-
76
- ---
77
-
78
- ## Progressive disclosure architecture
79
-
80
- Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
81
-
82
- Skills load in three levels to minimize context usage:
83
-
84
- | Level | What loads | Token cost | When |
85
- |-------|-----------|------------|------|
86
- | **1. Metadata** | `name` and `description` from frontmatter | ~100 tokens | Always (system prompt) |
87
- | **2. Instructions** | SKILL.md body | <5k tokens | When triggered by matching request |
88
- | **3. Resources** | Additional files, scripts, schemas | Unlimited | When referenced from instructions |
89
-
90
- ### Implications for skill authors
91
-
92
- - Many skills can coexist with minimal context cost (~100 tokens each at Level 1)
93
- - SKILL.md body should stay under 500 lines to fit the <5k token budget
94
- - Scripts execute via bash -- their code never enters context, only output does
95
- - Reference files load only when Claude reads them via `@` reference or explicit Read
96
- - Heavy lookup tables, field mappings, and long examples belong in REFERENCE.md or separate files
97
-
98
- ---
99
-
100
- ## Content templates by degree of freedom
101
-
102
- ### High freedom (advisory)
103
-
104
- For guidance where multiple approaches are valid. States goals and acceptance criteria without prescribing exact steps.
105
-
106
- ```markdown
107
- ---
108
- name: analyzing-data
109
- description: >-
110
- Analyzes datasets and generates statistical summaries. Use when working
111
- with CSV or Excel data requiring descriptive statistics, correlations,
112
- or visualizations. Triggers: 'analyze data', 'statistical summary'.
113
- ---
114
-
115
- # Analyzing data
116
-
117
- **Core principle:** Let the data structure guide the analysis approach.
118
-
119
- ## When this skill applies
120
-
121
- Trigger when the user has tabular data and wants statistical insight,
122
- trend identification, or visualization.
123
-
124
- ## Goals
125
-
126
- 1. Inspect the data structure and report shape, types, missing values
127
- 2. Generate descriptive statistics appropriate to the data types
128
- 3. Identify correlations and patterns worth highlighting
129
- 4. Produce visualizations if requested
130
-
131
- ## Output format
132
-
133
- Summary with key findings first, then supporting tables and charts.
134
- Explain statistical choices so the user can evaluate appropriateness.
135
-
136
- ## Examples
137
-
138
- **Input:** "Analyze sales_2024.csv for trends"
139
- **Output:** Monthly trend summary, top performers, seasonal patterns,
140
- with charts for the clearest visual signals.
141
- ```
142
-
143
- ### Medium freedom (structured workflow)
144
-
145
- For preferred patterns with room for adaptation. States a recommended sequence but allows deviation when justified.
146
-
147
- ```markdown
148
- ---
149
- name: reviewing-plans
150
- description: >-
151
- Validates implementation plans against code standards and TDD compliance.
152
- Use after writing plans and before executing them.
153
- Triggers: 'review plan', 'validate plan', 'check plan'.
154
- ---
155
-
156
- # Reviewing plans
157
-
158
- **Core principle:** Bad plans produce bad code. Validate before executing.
159
-
160
- ## When this skill applies
161
-
162
- Use after a plan has been written and before execution begins.
163
- This is the quality gate between planning and implementation.
164
-
165
- ## The process
166
-
167
- ### Step 1: Locate plan files
168
- Find plan files in `.planning/phases/` or `docs/plans/`.
169
-
170
- ### Step 2: Review dimensions
171
- Check each dimension: structure completeness, TDD compliance,
172
- code quality standards, right-sized engineering, task granularity.
173
-
174
- ### Step 3: Report verdict
175
- Deliver READY or NEEDS REVISION with specific issues and locations.
176
-
177
- ## Output format
178
-
179
- | Dimension | Status | Notes |
180
- |-----------|--------|-------|
181
- | Structure | PASS/FAIL | [specific finding] |
182
- | TDD | PASS/FAIL | [specific finding] |
183
- | Code quality | PASS/FAIL | [specific finding] |
184
- ```
185
-
186
- ### Low freedom (exact sequence)
187
-
188
- For fragile operations where deviation causes silent failures. States precisely what to do, in what order, with validation at each step.
189
-
190
- ```markdown
191
- ---
192
- name: filling-pdf-forms
193
- description: >-
194
- Fills PDF forms using pdf-lib with exact field mapping and validation.
195
- Use when populating PDF forms programmatically.
196
- Triggers: 'fill PDF form', 'populate form', 'form filling'.
197
- allowed-tools: Bash(node *), Read
198
- ---
199
-
200
- # Filling PDF forms
201
-
202
- **Core principle:** Extract field names first, then map, then fill.
203
- Guessing field names produces silently empty forms.
204
-
205
- ## Before filling any form
206
-
207
- 1. Read `${CLAUDE_SKILL_DIR}/FORMS.md` for the field mapping reference
208
- 2. Extract field names: `node ${CLAUDE_SKILL_DIR}/scripts/extract_fields.js input.pdf`
209
- 3. Match extracted fields against the mapping before writing any fill code
210
-
211
- ## Workflow
212
-
213
- ### Step 1: Extract fields
214
- ```bash
215
- node ${CLAUDE_SKILL_DIR}/scripts/extract_fields.js "$0"
216
- ```
217
-
218
- ### Step 2: Generate fill script
219
- Use the field mapping from FORMS.md. Set every field explicitly.
220
-
221
- ### Step 3: Execute and validate
222
- ```bash
223
- node fill_script.js && node ${CLAUDE_SKILL_DIR}/scripts/validate_fill.js output.pdf
224
- ```
225
-
226
- ### If validation fails
227
- Read error output, fix the field mapping, re-execute, re-validate.
228
- Do not proceed with a partially filled form.
229
- ```
230
-
231
- ---
232
-
233
- ## Validation checklist
234
-
235
- Source: [Claude Code Skills](https://platform.claude.com/docs/en/claude-code/skills)
236
-
237
- ### Structure
238
- - [ ] SKILL.md in correct location (matches `name` directory)
239
- - [ ] Valid YAML frontmatter with required fields
240
- - [ ] Body under 500 lines
241
- - [ ] Heavy content in separate reference files
242
-
243
- ### Description quality
244
- - [ ] Third person ("Analyzes..." not "Analyze...")
245
- - [ ] Includes what it does and when to use it
246
- - [ ] Contains trigger phrases matching natural user language
247
- - [ ] Under 1024 characters
248
- - [ ] No XML tags in description
249
-
250
- ### Content quality
251
- - [ ] Core principle stated (one sentence)
252
- - [ ] Steps are sequential and numbered
253
- - [ ] States desired behavior in positive terms
254
- - [ ] Motivation provided for constraints (why, not just what)
255
- - [ ] Examples are concrete with specific inputs and outputs
256
- - [ ] No time-sensitive claims (or clearly dated)
257
- - [ ] Consistent terminology throughout
258
- - [ ] File references are one level deep from SKILL.md
259
- - [ ] Files over 100 lines have a table of contents
260
-
261
- ### Technical correctness
262
- - [ ] `allowed-tools` specified if skill needs specific tools
263
- - [ ] `argument-hint` included if skill accepts arguments
264
- - [ ] `paths` set if skill applies only to certain file types
265
- - [ ] String substitutions use correct syntax
266
- - [ ] Script references use `${CLAUDE_SKILL_DIR}` for portability
267
- - [ ] MCP tools use fully qualified names (`ServerName:tool_name`)
268
-
269
- ### Testing readiness
270
- - [ ] At least 3 evaluation scenarios identified
271
- - [ ] Covers a typical case, an edge case, and a decline/clarify case
272
- - [ ] Golden rule: a colleague could follow this skill without extra context
273
-
274
- ---
275
-
276
- ## Evaluation loop
277
-
278
- For skill drafts that need iteration:
279
-
280
- 1. Trigger the skill with 2-3 representative user requests.
281
- 2. Note failure modes (missed triggers, wrong output format, overstepped scope).
282
- 3. Tighten trigger phrases, add examples, or adjust degree of freedom for the failure class only.
283
-
284
- Anthropic's **self-correction chaining** pattern extends this: generate a draft, have Claude review it against the validation checklist, then refine based on the review.