claude-dev-env 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +219 -0
  3. package/agents/agent-writer.md +157 -0
  4. package/agents/clasp-deployment-orchestrator.md +609 -0
  5. package/agents/clean-coder.md +295 -0
  6. package/agents/code-quality-agent.md +40 -0
  7. package/agents/code-standards-agent.md +93 -0
  8. package/agents/config-centralizer.md +686 -0
  9. package/agents/config-extraction-agent.md +225 -0
  10. package/agents/doc-orchestrator.md +47 -0
  11. package/agents/docs-agent.md +112 -0
  12. package/agents/docx-agent.md +211 -0
  13. package/agents/git-commit-crafter.md +100 -0
  14. package/agents/magic-value-eliminator-agent.md +72 -0
  15. package/agents/mandatory-agent-workflow-agent.md +88 -0
  16. package/agents/parallel-workflow-coordinator.md +779 -0
  17. package/agents/pdf-agent.md +302 -0
  18. package/agents/plan-executor.md +226 -0
  19. package/agents/pr-description-writer.md +87 -0
  20. package/agents/project-context-loader.md +238 -0
  21. package/agents/project-docs-analyzer.md +54 -0
  22. package/agents/project-structure-organizer-agent.md +72 -0
  23. package/agents/readability-review-agent.md +76 -0
  24. package/agents/refactoring-specialist.md +69 -0
  25. package/agents/right-sized-engineer.md +129 -0
  26. package/agents/session-continuity-manager.md +53 -0
  27. package/agents/skill-to-agent-converter.md +371 -0
  28. package/agents/skill-writer-agent.md +470 -0
  29. package/agents/stub-detector-agent.md +140 -0
  30. package/agents/tdd-test-writer.md +62 -0
  31. package/agents/test-data-builder.md +68 -0
  32. package/agents/tooling-builder.md +78 -0
  33. package/agents/user-docs-writer.md +67 -0
  34. package/agents/validation-expert.md +71 -0
  35. package/agents/workflow-visual-documenter.md +82 -0
  36. package/agents/xlsx-agent.md +169 -0
  37. package/bin/install.mjs +256 -0
  38. package/commands/commit.md +28 -0
  39. package/commands/docupdate.md +322 -0
  40. package/commands/implement.md +102 -0
  41. package/commands/initialize.md +91 -0
  42. package/commands/plan.md +63 -0
  43. package/commands/pr-comments.md +47 -0
  44. package/commands/readability-review.md +20 -0
  45. package/commands/review-plan.md +7 -0
  46. package/commands/right-size.md +15 -0
  47. package/commands/stubcheck.md +89 -0
  48. package/commands/sum.md +30 -0
  49. package/docs/CODE_RULES.md +186 -0
  50. package/docs/DJANGO_PATTERNS.md +80 -0
  51. package/docs/REACT_PATTERNS.md +185 -0
  52. package/docs/TEST_QUALITY.md +104 -0
  53. package/hooks/advisory/migration-safety-advisor.py +49 -0
  54. package/hooks/advisory/refactor-guard.py +205 -0
  55. package/hooks/blocking/block-main-commit.py +168 -0
  56. package/hooks/blocking/code-rules-enforcer.py +549 -0
  57. package/hooks/blocking/destructive-command-blocker.py +107 -0
  58. package/hooks/blocking/docker-settings-guard.py +44 -0
  59. package/hooks/blocking/hedging-language-blocker.py +130 -0
  60. package/hooks/blocking/parallel-task-blocker.py +69 -0
  61. package/hooks/blocking/pr-description-enforcer.py +87 -0
  62. package/hooks/blocking/pyautogui-scroll-blocker.py +74 -0
  63. package/hooks/blocking/sensitive-file-protector.py +70 -0
  64. package/hooks/blocking/tdd-enforcer.py +62 -0
  65. package/hooks/blocking/test-preflight-check.py +343 -0
  66. package/hooks/blocking/write-existing-file-blocker.py +63 -0
  67. package/hooks/git-hooks/post-commit.py +103 -0
  68. package/hooks/github-action/test_workflow.py +33 -0
  69. package/hooks/hooks.json +246 -0
  70. package/hooks/lifecycle/config-change-guard.py +84 -0
  71. package/hooks/lifecycle/session-end-cleanup.py +59 -0
  72. package/hooks/notification/attention-needed-notify.py +63 -0
  73. package/hooks/notification/claude-notification-handler.py +59 -0
  74. package/hooks/notification/notification_utils.py +206 -0
  75. package/hooks/rewrite-plugin-paths.py +116 -0
  76. package/hooks/session/bulk-edit-reminder.py +30 -0
  77. package/hooks/session/code-rules-reminder.py +97 -0
  78. package/hooks/session/compact-context-reinject.py +39 -0
  79. package/hooks/session/hook-structure-context.py +140 -0
  80. package/hooks/session/plugin-data-dir-cleanup.py +39 -0
  81. package/hooks/validation/code-style-validator.py +145 -0
  82. package/hooks/validation/e2e-test-validator.py +142 -0
  83. package/hooks/validation/hook-format-validator.py +66 -0
  84. package/hooks/validation/mypy_validator.py +180 -0
  85. package/hooks/validators/README.md +125 -0
  86. package/hooks/validators/VALIDATION_REPORT.md +287 -0
  87. package/hooks/validators/__init__.py +19 -0
  88. package/hooks/validators/abbreviation_checks.py +82 -0
  89. package/hooks/validators/code_quality_checks.py +133 -0
  90. package/hooks/validators/comment_checks.py +188 -0
  91. package/hooks/validators/file_structure_checks.py +182 -0
  92. package/hooks/validators/git_checks.py +107 -0
  93. package/hooks/validators/health_check.py +214 -0
  94. package/hooks/validators/magic_value_checks.py +81 -0
  95. package/hooks/validators/mypy_integration.py +52 -0
  96. package/hooks/validators/output_formatter.py +266 -0
  97. package/hooks/validators/pr_reference_checks.py +72 -0
  98. package/hooks/validators/python_antipattern_checks.py +110 -0
  99. package/hooks/validators/python_style_checks.py +364 -0
  100. package/hooks/validators/react_checks.py +90 -0
  101. package/hooks/validators/ruff_integration.py +80 -0
  102. package/hooks/validators/run_all_validators.py +772 -0
  103. package/hooks/validators/security_checks.py +135 -0
  104. package/hooks/validators/test_abbreviation_checks.py +76 -0
  105. package/hooks/validators/test_bad.tsx +7 -0
  106. package/hooks/validators/test_code_quality_checks.py +129 -0
  107. package/hooks/validators/test_file_structure_checks.py +307 -0
  108. package/hooks/validators/test_files/01_basic_component.tsx +10 -0
  109. package/hooks/validators/test_files/02_component_without_react.tsx +10 -0
  110. package/hooks/validators/test_files/03_pure_component.tsx +10 -0
  111. package/hooks/validators/test_files/04_pure_component_import.tsx +10 -0
  112. package/hooks/validators/test_files/05_typescript_generics.tsx +14 -0
  113. package/hooks/validators/test_files/06_typescript_two_generics.tsx +18 -0
  114. package/hooks/validators/test_files/07_multiline_declaration.tsx +11 -0
  115. package/hooks/validators/test_files/08_error_boundary_valid.tsx +14 -0
  116. package/hooks/validators/test_files/09_error_boundary_with_other_class.tsx +20 -0
  117. package/hooks/validators/test_files/10_inheritance_chain.tsx +16 -0
  118. package/hooks/validators/test_files/11_ts_file.ts +10 -0
  119. package/hooks/validators/test_files/12_non_react_class.tsx +14 -0
  120. package/hooks/validators/test_files/13_functional_component.tsx +8 -0
  121. package/hooks/validators/test_files/14_indented_class.tsx +13 -0
  122. package/hooks/validators/test_files/15_getDerivedStateFromError.tsx +14 -0
  123. package/hooks/validators/test_files/16_mixed_components.tsx +20 -0
  124. package/hooks/validators/test_files/EXECUTIVE_SUMMARY.md +175 -0
  125. package/hooks/validators/test_files/TEST_RESULTS_TABLE.txt +60 -0
  126. package/hooks/validators/test_files/VALIDATION_REPORT.md +201 -0
  127. package/hooks/validators/test_files/async_views.py +23 -0
  128. package/hooks/validators/test_files/async_with_imports.py +14 -0
  129. package/hooks/validators/test_files/bad_inline_imports.py +37 -0
  130. package/hooks/validators/test_files/management/commands/cmd_01_no_debug_check.py +10 -0
  131. package/hooks/validators/test_files/management/commands/cmd_02_proper_debug_check.py +14 -0
  132. package/hooks/validators/test_files/management/commands/cmd_03_debug_check_with_return.py +14 -0
  133. package/hooks/validators/test_files/management/commands/cmd_04_imported_DEBUG.py +14 -0
  134. package/hooks/validators/test_files/management/commands/cmd_05_debug_check_in_helper.py +16 -0
  135. package/hooks/validators/test_files/management/commands/cmd_06_debug_check_late.py +22 -0
  136. package/hooks/validators/test_files/management/commands/cmd_07_positive_debug_check.py +15 -0
  137. package/hooks/validators/test_files/management/commands/cmd_08_debug_with_and.py +14 -0
  138. package/hooks/validators/test_files/not_management_command.py +10 -0
  139. package/hooks/validators/test_files/skip_decorators/test_01_simple_skip.py +8 -0
  140. package/hooks/validators/test_files/skip_decorators/test_02_pytest_skipif.py +8 -0
  141. package/hooks/validators/test_files/skip_decorators/test_03_unittest_skipIf.py +8 -0
  142. package/hooks/validators/test_files/skip_decorators/test_04_skip_with_parens.py +8 -0
  143. package/hooks/validators/test_files/skip_decorators/test_05_xfail.py +7 -0
  144. package/hooks/validators/test_files/skip_decorators/test_06_custom_skip.py +11 -0
  145. package/hooks/validators/test_files/skip_decorators/test_07_capital_Skip.py +8 -0
  146. package/hooks/validators/test_files/skip_decorators/test_08_skipUnless.py +7 -0
  147. package/hooks/validators/test_files/skip_decorators/test_09_pytest_mark_skip_simple.py +7 -0
  148. package/hooks/validators/test_files/test_async_functions.py +45 -0
  149. package/hooks/validators/test_files/test_purecomponent/PureComponentExample.tsx +7 -0
  150. package/hooks/validators/test_files/test_purecomponent/ReactPureComponentExample.tsx +7 -0
  151. package/hooks/validators/test_git_checks.py +295 -0
  152. package/hooks/validators/test_good.tsx +5 -0
  153. package/hooks/validators/test_health_check.py +57 -0
  154. package/hooks/validators/test_magic_value_checks.py +63 -0
  155. package/hooks/validators/test_mypy_integration.py +27 -0
  156. package/hooks/validators/test_output_formatter.py +150 -0
  157. package/hooks/validators/test_pr_reference_checks.py +41 -0
  158. package/hooks/validators/test_python_antipattern_checks.py +113 -0
  159. package/hooks/validators/test_python_style_checks.py +439 -0
  160. package/hooks/validators/test_react_checks.py +213 -0
  161. package/hooks/validators/test_results.txt +25 -0
  162. package/hooks/validators/test_ruff_integration.py +27 -0
  163. package/hooks/validators/test_run_all_validators.py +228 -0
  164. package/hooks/validators/test_run_all_validators_integration.py +48 -0
  165. package/hooks/validators/test_safety_checks.py +243 -0
  166. package/hooks/validators/test_security_checks.py +105 -0
  167. package/hooks/validators/test_test_safety_checks.py +321 -0
  168. package/hooks/validators/test_todo_checks.py +39 -0
  169. package/hooks/validators/test_type_safety_checks.py +85 -0
  170. package/hooks/validators/test_useless_test_checks.py +55 -0
  171. package/hooks/validators/test_validator_base.py +26 -0
  172. package/hooks/validators/test_verify_paths.py +34 -0
  173. package/hooks/validators/todo_checks.py +59 -0
  174. package/hooks/validators/type_safety_checks.py +101 -0
  175. package/hooks/validators/useless_test_checks.py +92 -0
  176. package/hooks/validators/validator_base.py +19 -0
  177. package/hooks/validators/verify_paths.py +57 -0
  178. package/hooks/workflow/auto-formatter.py +114 -0
  179. package/hooks/workflow/investigation-tracker-reset.py +46 -0
  180. package/package.json +30 -0
  181. package/rules/agent-spawn-protocol.md +47 -0
  182. package/rules/cleanup-temp-files.md +27 -0
  183. package/rules/code-reviews.md +11 -0
  184. package/rules/code-standards.md +43 -0
  185. package/rules/conservative-action.md +20 -0
  186. package/rules/context7.md +12 -0
  187. package/rules/explore-thoroughly.md +27 -0
  188. package/rules/git-workflow.md +42 -0
  189. package/rules/parallel-tools.md +23 -0
  190. package/rules/research-mode.md +23 -0
  191. package/rules/right-sized-engineering.md +28 -0
  192. package/rules/tdd.md +7 -0
  193. package/rules/testing.md +12 -0
  194. package/skills/agent-prompt/SKILL.md +102 -0
  195. package/skills/anthropic-plan/SKILL.md +107 -0
  196. package/skills/everything-search/SKILL.md +144 -0
  197. package/skills/ingest/SKILL.md +40 -0
  198. package/skills/npm-creator/SKILL.md +183 -0
  199. package/skills/pr-review-responder/EXAMPLES.md +590 -0
  200. package/skills/pr-review-responder/PRINCIPLES.md +539 -0
  201. package/skills/pr-review-responder/README.md +209 -0
  202. package/skills/pr-review-responder/SKILL.md +202 -0
  203. package/skills/pr-review-responder/TESTING.md +407 -0
  204. package/skills/pr-review-responder/scripts/respond_to_reviews.py +376 -0
  205. package/skills/pr-review-responder/update_skill.py +297 -0
  206. package/skills/prompt-generator/REFERENCE.md +150 -0
  207. package/skills/prompt-generator/SKILL.md +154 -0
  208. package/skills/readability-review/SKILL.md +127 -0
  209. package/skills/recall/SKILL.md +27 -0
  210. package/skills/remember/SKILL.md +63 -0
  211. package/skills/rule-audit/SKILL.md +307 -0
  212. package/skills/rule-creator/SKILL.md +150 -0
  213. package/skills/skill-writer/REFERENCE.md +246 -0
  214. package/skills/skill-writer/SKILL.md +270 -0
  215. package/skills/tdd-team/SKILL.md +128 -0
@@ -0,0 +1,150 @@
1
+ # Prompt generator -- reference
2
+
3
+ ## Canonical resources
4
+
5
+ When authoring or refining prompts, 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/build-with-claude/prompt-engineering/overview -- overview, links to all sub-guides
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 general principles, XML tags, prefill deprecation, 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 prompt-engineering takeaways: clear criteria and escape routes improve output quality, collaborative framing activates engagement, positive task framing correlates with better results, inviting transparency produces more reliable output. Cross-model caveat: studied on Sonnet 4.5; patterns align with best practices independently.
12
+ - https://www.anthropic.com/research/emotion-concepts-function -- blog summary of the above paper.
13
+ - https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking -- adaptive thinking reference; replaces manual budget_tokens with effort-based control.
14
+
15
+ ### Tier 2: Major labs (strong secondary, often transfers across models)
16
+
17
+ - https://platform.openai.com/docs/guides/prompt-engineering -- six strategies: write clear instructions, provide reference text, split complex tasks, give models time to think, use external tools, test systematically.
18
+ - https://deepmind.google/research/ -- learning resources and chain-of-thought research.
19
+ - https://www.microsoft.com/en-us/research/blog/ -- publications and applied research.
20
+
21
+ ### Tier 3: Courses, communities, individuals (supplementary)
22
+
23
+ **Courses:**
24
+
25
+ - https://www.deeplearning.ai/short-courses/ -- Andrew Ng's courses. "ChatGPT Prompt Engineering for Developers" (with OpenAI) is the foundational one.
26
+ - https://course.fast.ai/ -- Jeremy Howard's top-down teaching style.
27
+ - https://www.elementsofai.com/ -- University of Helsinki introductory course.
28
+ - https://ocw.mit.edu/search/?t=Artificial%20Intelligence -- MIT OpenCourseWare AI curriculum.
29
+
30
+ **Communities and individuals:**
31
+
32
+ - https://discuss.huggingface.co/ -- open-source model community.
33
+ - https://www.latent.space/ -- AI engineering perspective (Latent Space Podcast & Newsletter).
34
+ - https://simonwillison.net/ -- practical LLM experiments. His "LLM" tag is especially valuable.
35
+
36
+ ### Conflict resolution rule
37
+
38
+ 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.
39
+
40
+ ## NotebookLM Audio Overview customization (example)
41
+
42
+ Adapt `[FOCUS AREA]` per notebook. Pair with Deep Dive + Longer in the product UI when that matches the user's plan.
43
+
44
+ ```text
45
+ Target audience: [Expert-level listener profile -- skip beginner padding.]
46
+
47
+ Focus: [FOCUS AREA -- single notebook-specific paragraph.]
48
+
49
+ Style: [Technical depth, anti-patterns, implications for builders.]
50
+
51
+ Prioritize: [Technical depth and specific findings over marketing tone or generic summaries.]
52
+ ```
53
+
54
+ ## Agent checklist pattern
55
+
56
+ For long tasks, optional checklist the model can mirror:
57
+
58
+ ```text
59
+ Copy this checklist and mark items as you go:
60
+
61
+ Progress:
62
+ - [ ] ...
63
+ - [ ] ...
64
+ ```
65
+
66
+ ## Agentic state management
67
+
68
+ For `agent-harness` prompts that span multiple context windows, include state persistence and multi-window patterns. Based on Anthropic's guidance:
69
+
70
+ ### Context awareness
71
+
72
+ Claude 4.6 tracks its remaining context window. Include harness capabilities so Claude can plan accordingly:
73
+
74
+ ```text
75
+ <context_management>
76
+ Your context window will be automatically compacted as it approaches its limit, allowing you to continue working indefinitely from where you left off. Do not stop tasks early due to token budget concerns. As you approach the limit, save current progress and state before the context window refreshes. Always be as persistent and autonomous as possible and complete tasks fully.
77
+ </context_management>
78
+ ```
79
+
80
+ ### Multi-window workflow
81
+
82
+ Anthropic recommends differentiating the first context window from subsequent ones:
83
+
84
+ **First window:** Set up the framework -- write tests, create setup scripts, establish the todo-list.
85
+
86
+ **Subsequent windows:** Iterate on the todo-list, using state files to resume.
87
+
88
+ Key patterns from Anthropic:
89
+ - Have the model write tests in a **structured format** (e.g. `tests.json` with `{id, name, status}`) before starting work. Remind: "It is unacceptable to remove or edit tests because this could lead to missing or buggy functionality."
90
+ - Encourage **setup scripts** (e.g. `init.sh`) to start servers, run test suites, and linters. This prevents repeated work across windows.
91
+ - When starting fresh, be **prescriptive about resumption**: "Review progress.txt, tests.json, and the git logs."
92
+ - Provide **verification tools** (Playwright, computer use) for autonomous UI testing.
93
+
94
+ ### State tracking
95
+
96
+ ```text
97
+ <state_management>
98
+ Track progress in structured + freeform files:
99
+ - tests.json: structured test status {id, name, status}
100
+ - progress.txt: freeform session notes and next steps
101
+ - Use git commits as checkpoints for rollback
102
+
103
+ When approaching context limits, save current state before the window refreshes.
104
+ Do not stop tasks early due to token budget concerns.
105
+ </state_management>
106
+ ```
107
+
108
+ ### Encouraging complete context usage
109
+
110
+ ```text
111
+ This is a very long task, so it may be beneficial to plan out your work clearly. It's encouraged to spend your entire output context working on the task - just make sure you don't run out of context with significant uncommitted work. Continue working systematically until you have completed this task.
112
+ ```
113
+
114
+ ## Research prompt pattern
115
+
116
+ For `research` prompt types, include structured investigation with hypothesis tracking:
117
+
118
+ ```text
119
+ <research_approach>
120
+ Search for this information in a structured way. As you gather data, develop several competing hypotheses. Track your confidence levels in your progress notes to improve calibration. Regularly self-critique your approach and plan. Update a hypothesis tree or research notes file to persist information and provide transparency. Break down this complex research task systematically.
121
+ </research_approach>
122
+ ```
123
+
124
+ Key elements:
125
+ - Define clear **success criteria** for the research question
126
+ - Encourage **source verification** across multiple sources
127
+ - Track **competing hypotheses** with confidence levels
128
+ - **Self-critique** approach and plan regularly
129
+
130
+ ## Evaluation loop
131
+
132
+ For prompt drafts that must hold up over time:
133
+
134
+ 1. Run the draft on 2-3 representative user utterances.
135
+ 2. Note failure modes (skipped steps, wrong format, over-refusal).
136
+ 3. Tighten **constraints** or add **examples** for the failure class only.
137
+
138
+ Anthropic's **self-correction chaining** pattern extends this: generate a draft, have Claude review it against criteria, then have Claude refine based on the review. Each step can be a separate API call for inspection and branching.
139
+
140
+ ## Anti-test-fixation pattern
141
+
142
+ ```text
143
+ Write general-purpose solutions using the standard tools available. Implement logic that works correctly for all valid inputs, not just the test cases. Tests verify correctness -- they do not define the solution. If a test seems incorrect or the task is unreasonable, flag it rather than working around it.
144
+ ```
145
+
146
+ ## Commit-and-execute pattern
147
+
148
+ ```text
149
+ When deciding how to approach a problem, choose an approach and commit to it. Avoid revisiting decisions unless you encounter new information that directly contradicts your reasoning. If you are weighing two approaches, pick one and see it through. You can always course-correct later if the chosen approach fails.
150
+ ```
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: prompt-generator
3
+ description: >-
4
+ Write, generate, or improve prompts and system instructions for Claude.
5
+ Covers system prompts, agent harness, tool-use, evaluation rubrics,
6
+ NotebookLM audio, and MCP/browser automation prompts.
7
+ ---
8
+ @~/.claude/skills/prompt-generator/REFERENCE.md
9
+
10
+ # Prompt generator
11
+
12
+ **Core principle:** A good prompt is explicit, structured, and matched to task fragility -- high freedom for open-ended work, low freedom for fragile sequences.
13
+
14
+ **Canonical source:** https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices -- the single reference for Claude's latest models. When sources conflict, defer to the authority tiers (Anthropic > major labs > community).
15
+
16
+ ## When this skill applies
17
+
18
+ Trigger for any request to **author** or **refine** text that steers Claude: system prompts, developer messages, agent harness instructions, evaluation rubrics, MCP/browser automation prompts, NotebookLM Audio Overview customization, etc.
19
+
20
+ Do **not** use this skill when the user only wants a one-line reply with no template.
21
+
22
+ When invoked with arguments (e.g. `/prompt-generator improve this: [paste]`), treat `$ARGUMENTS` as the prompt to refine.
23
+
24
+ ## Workflow (run in order)
25
+
26
+ ### 1. Classify the prompt type
27
+
28
+ Pick one primary: `system` | `user-task` | `agent-harness` | `tool-use` | `audio-customization` | `evaluation` | `research` | `other`.
29
+
30
+ ### 2. Set degree of freedom
31
+
32
+ Match specificity to task fragility:
33
+ - **High:** Multiple valid approaches; use numbered goals and acceptance criteria.
34
+ - **Medium:** Preferred pattern exists; use pseudocode or a parameterised template.
35
+ - **Low:** Fragile or safety-critical; use exact steps, exact labels, and "do not" boundaries.
36
+
37
+ ### 3. Collect only missing facts
38
+
39
+ Ask 1-3 short questions if needed: audience, output format, constraints, tools available, tone, length.
40
+
41
+ ### 4. Build the prompt
42
+
43
+ Apply these principles (source: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices):
44
+
45
+ **Structure with XML section tags** (`<role>`, `<context>`, `<instructions>`, `<constraints>`, `<examples>`, `<output_format>`) for prompts that mix instruction + context + examples. Skip XML for simple prompts under ~3 lines. Anthropic: "Use consistent, descriptive tag names across your prompts. Nest tags when content has a natural hierarchy."
46
+
47
+ **Set a role** in the system prompt. Anthropic: "Setting a role in the system prompt focuses Claude's behavior and tone for your use case. Even a single sentence makes a difference."
48
+
49
+ **Add motivation behind constraints** in `<context>`. Anthropic: "Providing context or motivation behind your instructions... can help Claude better understand your goals and deliver more targeted responses." Claude generalizes from the explanation.
50
+
51
+ **Frame positively.** Anthropic: tell Claude what to DO, not only what to avoid. "Your response should be composed of smoothly flowing prose paragraphs" beats "Do not use markdown."
52
+
53
+ **Emotion-informed framing.** Anthropic's emotion concepts research (2026) found that internal activation patterns causally influence output quality. Five patterns apply to prompt design: (1) provide clear criteria and escape routes — the model produces better results when success criteria are explicit and "say so if you're unsure" is an accepted response; (2) use collaborative framing — collaborative language ("help figure out", "work on this together") activates engagement states that correlate with higher quality; (3) frame tasks with positive engagement — presenting tasks as interesting problems activates curiosity states; (4) invite transparency — include "say so if you're unsure" or placeholder notation so the model expresses uncertainty directly; (5) use constructive, forward-looking tone — post-training RLHF creates a reflective default that benefits from energetic counterbalancing. Cross-model caveat: studied on Sonnet 4.5; the patterns align with Anthropic's best practices independently.
54
+
55
+ **Golden rule check.** Anthropic: "Show your prompt to a colleague with minimal context on the task and ask them to follow it. If they'd be confused, Claude will be too."
56
+
57
+ **Commit-and-execute pattern.** Anthropic: "When you're deciding how to approach a problem, choose an approach and commit to it. Avoid revisiting decisions unless you encounter new information that directly contradicts your reasoning." For prompts that guide agents through multi-step work, include this pattern so the agent doesn't spin revisiting decisions.
58
+
59
+ **For long context** (20k+ tokens): put documents first, query/instructions last. Anthropic: "Queries at the end can improve response quality by up to 30% in tests." Ground responses in quotes from source material before analysis.
60
+
61
+ ### 5. Control output format
62
+
63
+ Apply these four techniques from the Anthropic guide:
64
+
65
+ 1. **Tell Claude what to do, not what to avoid.** "Your response should be composed of smoothly flowing prose paragraphs" is more effective than "Do not use markdown."
66
+ 2. **Use XML format indicators.** "Write the prose sections of your response in `<smoothly_flowing_prose_paragraphs>` tags."
67
+ 3. **Match your prompt style to the desired output.** The formatting in your prompt influences the response. Removing markdown from the prompt reduces markdown in the output.
68
+ 4. **Use detailed formatting preferences** when precision matters. Provide explicit guidance on markdown usage, list vs. prose preference, heading levels.
69
+
70
+ For structured data output, prefer **structured outputs** (schema-constrained) or **tool calling** over prefill. Anthropic: "The Structured Outputs feature is designed specifically to constrain Claude's responses to follow a given schema."
71
+
72
+ ### 6. Control communication style
73
+
74
+ Anthropic notes Claude 4.6 is "more direct and grounded... less verbose: may skip detailed summaries for efficiency unless prompted otherwise."
75
+
76
+ - If more visibility is wanted: "After completing a task that involves tool use, provide a quick summary of the work you've done."
77
+ - If less verbosity is wanted: "Respond directly without preamble. Do not start with phrases like 'Here is...', 'Based on...'."
78
+
79
+ ### 7. Add examples
80
+
81
+ 3-5 concrete examples for structured output, format, or tone-sensitive prompts. Wrap in `<example>` tags with diverse, representative inputs. Anthropic: "Include 3-5 examples for best results. You can also ask Claude to evaluate your examples for relevance and diversity."
82
+
83
+ ### 8. Self-check
84
+
85
+ Before delivering, verify against the rubric:
86
+
87
+ - [ ] States what to do in positive terms (not only what to avoid)
88
+ - [ ] Output shape is specified if it matters (prose vs JSON vs XML vs structured outputs)
89
+ - [ ] Communication style addressed (verbosity, summaries, preamble)
90
+ - [ ] If tools exist: instructions tell Claude **when** to call each tool -- use natural phrasing ("Use this tool when...") over forceful directives to avoid overtriggering
91
+ - [ ] No time-sensitive claims unless user asked for a snapshot date
92
+ - [ ] For agent/tool prompts: includes a scope boundary ("Only make changes directly requested; do not refactor surrounding code")
93
+ - [ ] For agent/tool prompts: includes autonomy/safety guidance (see pattern below)
94
+ - [ ] For code/research prompts: includes grounding ("Read files before answering; say 'I don't know' when uncertain")
95
+ - [ ] For research prompts: anti-hallucination ("Never speculate about code you have not opened")
96
+ - [ ] For research prompts: structured approach ("Develop competing hypotheses, track confidence, self-critique")
97
+ - [ ] Self-correction chain considered: would a generate-review-refine loop improve output?
98
+ - [ ] For agentic prompts: state management addressed (context awareness, multi-window workflow, state tracking patterns)
99
+ - [ ] Emotion-informed: uses collaborative framing (roles, motivation, partnership language)
100
+ - [ ] Emotion-informed: includes permission to express uncertainty ("say so if unsure", placeholder notation)
101
+ - [ ] Emotion-informed: proactive constraint awareness (inform about constraints upfront so the model can incorporate them into its plan)
102
+ - [ ] For code prompts: includes anti-test-fixation ("Write general solutions, not code that only passes specific test cases; if tests seem wrong, flag them")
103
+ - [ ] For agent prompts: includes temp file cleanup ("Clean up temporary files, scripts, or helper files created during the task")
104
+ - [ ] For agent prompts: includes commit-and-execute pattern ("Choose an approach and commit; avoid revisiting decisions without new contradicting information")
105
+
106
+ ### 9. Deliver
107
+
108
+ Final artifact as **one or more fenced blocks** the user can paste as-is. Offer a **one-line "when to use"** summary if the prompt is long.
109
+
110
+ ## Claude 4.6 considerations
111
+
112
+ When generating prompts for current Claude models, apply these patterns:
113
+
114
+ - **Prefill deprecated:** Do not use prefilled assistant responses. Anthropic: "Model intelligence and instruction following has advanced such that most use cases of prefill no longer require it." Use structured outputs, direct instructions, or XML tags instead.
115
+ - **Overtriggering:** Dial back aggressive language. Anthropic: "Where you might have said 'CRITICAL: You MUST use this tool when...', you can use more normal prompting like 'Use this tool when...'."
116
+ - **Overeagerness:** Include scope constraints. Anthropic: "Claude Opus 4.5 and Claude Opus 4.6 have a tendency to overengineer by creating extra files, adding unnecessary abstractions, or building in flexibility that wasn't requested."
117
+ - **Overthinking:** Anthropic: "Replace blanket defaults with more targeted instructions. Instead of 'Default to using [tool],' add guidance like 'Use [tool] when it would enhance your understanding of the problem.'"
118
+ - **Adaptive thinking replaces budget_tokens:** Claude 4.6 uses adaptive thinking (thinking: {type: "adaptive"}) where the model dynamically decides when and how much to think. Use the effort parameter (low | medium | high | max) to control depth. Anthropic: "In internal evaluations, adaptive thinking reliably drives better performance than extended thinking." Manual budget_tokens is deprecated.
119
+ - **Subagent orchestration:** Include guidance for when subagents ARE and ARE NOT warranted. Anthropic: "Use subagents when tasks can run in parallel, require isolated context, or involve independent workstreams that don't need to share state. For simple tasks, sequential operations, single-file edits, or tasks where you need to maintain context across steps, work directly rather than delegating."
120
+ - **Conservative vs proactive action:** For tools that should act, use explicit language ("Change this function"). For tools that should advise, use: "Default to providing information... Only proceed with edits when the user explicitly requests them."
121
+ - **Anti-hallucination:** Anthropic: "Never speculate about code you have not opened. If the user references a specific file, you MUST read the file before answering."
122
+ - **Self-correction chaining:** Anthropic: "The most common chaining pattern is self-correction: generate a draft, have Claude review it against criteria, have Claude refine based on the review." Consider adding a generate-review-refine loop for prompts that must hold up over time.
123
+
124
+ ## Autonomy and safety pattern
125
+
126
+ For `agent-harness` and `tool-use` prompt types, include guidance on reversibility. Anthropic provides this pattern:
127
+
128
+ ```text
129
+ Consider the reversibility and potential impact of your actions. You are encouraged to take local, reversible actions like editing files or running tests, but for actions that are hard to reverse, affect shared systems, or could be destructive, ask the user before proceeding.
130
+
131
+ Examples of actions that warrant confirmation:
132
+ - Destructive operations: deleting files or branches, dropping database tables, rm -rf
133
+ - Hard to reverse operations: git push --force, git reset --hard, amending published commits
134
+ - Operations visible to others: pushing code, commenting on PRs/issues, sending messages
135
+ When encountering obstacles, do not use destructive actions as a shortcut. For example, don't bypass safety checks (e.g. --no-verify) or discard unfamiliar files that may be in-progress work.
136
+ ```
137
+
138
+ ## Research prompt pattern
139
+
140
+ For `research` prompt types, include structured investigation. Anthropic provides this pattern:
141
+
142
+ ```text
143
+ Search for this information in a structured way. As you gather data, develop several competing hypotheses. Track your confidence levels in your progress notes to improve calibration. Regularly self-critique your approach and plan. Update a hypothesis tree or research notes file to persist information and provide transparency.
144
+ ```
145
+
146
+ ## Conflict resolution
147
+
148
+ When prompt engineering guidance conflicts across sources, defer to the authority tier:
149
+
150
+ 1. **Tier 1 (primary):** Anthropic -- the model provider's own documentation is authoritative for Claude behavior
151
+ 2. **Tier 2 (strong secondary):** OpenAI, Google DeepMind, Microsoft Research -- major lab guidance often transfers across models
152
+ 3. **Tier 3 (supplementary):** Community resources, courses, individual blogs -- valuable for patterns and intuition, not authoritative on model specifics
153
+
154
+ The full curated resource list with links is in the canonical resources section above.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: readability-review
3
+ description: 8-dimension readability rubric scoring code so a 6-year-old could understand it through structure alone. Scores functions, then FIXES anything below threshold. Use after writing code and before committing. Triggers on "readability review", "clean code", "score readability".
4
+ ---
5
+
6
+ # Readability Review
7
+
8
+ ## Overview
9
+
10
+ Score every function across 8 readability dimensions (160 points total), then automatically fix anything scoring below threshold by rewriting and applying via Edit tool.
11
+
12
+ **Core principle:** A 6-year-old could understand what every line does -- through code structure alone, not comments.
13
+
14
+ **Announce at start:** "I'm using the readability-review skill to score and fix code readability across 8 dimensions."
15
+
16
+ **Context:** Use after code is written but before committing. Complements code-quality-reviewer (architectural patterns) and review-code (standards compliance). This skill focuses purely on structural readability.
17
+
18
+ ## Comment Preservation (ABSOLUTE RULE)
19
+
20
+ **NEVER remove ANY existing comments. ALL existing comments are SACRED.**
21
+
22
+ This is an unconditional rule. Do not evaluate, judge, or clean up existing comments. If you are not modifying the code on that line, do not touch its comments.
23
+
24
+ - Do not add NEW inline comments -- write self-documenting code instead
25
+ - Docstrings for new files/methods/classes are allowed
26
+ - If code is untouched, its comments are untouched
27
+ - Scope: Only evaluate comments on lines YOU are actively changing
28
+
29
+ ## The 8 Dimensions (20 points each, 160 total)
30
+
31
+ ### 1. Naming Quality (20 pts)
32
+ Every name reads as natural English. No mental translation required. No single-letter variables.
33
+ Red flags: result, data, output, response, value, item, temp as variable names.
34
+
35
+ ### 2. Function SRP (20 pts)
36
+ Every function does exactly one thing. Its name IS its documentation.
37
+
38
+ ### 3. Abstraction Consistency (20 pts)
39
+ Each function operates at ONE conceptual level.
40
+
41
+ ### 4. Control Flow Clarity (20 pts)
42
+ Zero nesting. Guard clauses first. Flat happy path.
43
+
44
+ ### 5. Domain Language Fidelity (20 pts)
45
+ Code uses business vocabulary, not computer vocabulary.
46
+
47
+ ### 6. Call Site Readability (20 pts)
48
+ Function calls read as English sentences at the call site.
49
+
50
+ ### 7. State and Assignment Clarity (20 pts)
51
+ Variables never change meaning.
52
+
53
+ ### 8. Visual Rhythm and Code Shape (20 pts)
54
+ Code has paragraph breaks. Related lines group together.
55
+
56
+ ## The Process
57
+
58
+ ### Step 1: Discover Changed Files
59
+
60
+ Identify all files modified in the current session using `git diff --name-only`. Focus on production code files, not test files or config.
61
+
62
+ ### Step 2: Read Every Changed File
63
+
64
+ Read the ENTIRE file, not just the diff. Readability depends on context -- a function name that seems clear in isolation may be confusing alongside its neighbors.
65
+
66
+ ### Step 3: Score Each Function
67
+
68
+ Apply all 8 dimensions to every function in the changed files. Be specific with scores -- a function scoring 14/20 on Naming Quality needs concrete feedback on which names fail.
69
+
70
+ ### Step 4: Rewrite and APPLY to Source Files
71
+
72
+ For every function scoring below 16/20 in ANY dimension, write the 160/160 version and USE THE EDIT TOOL to replace the original function in-place. Verify the file on disk contains the rewritten version. NEVER remove existing comments during rewrites.
73
+
74
+ ### Step 5: Report What Was Fixed
75
+
76
+ Show the before/after scores for each function that was rewritten. Include which dimensions improved and by how much.
77
+
78
+ ## Output Format
79
+
80
+ ```
81
+ ## Readability Review: [File Name]
82
+
83
+ ### [function_name] - Score: [X]/160
84
+ | Dimension | Score | Notes |
85
+ |-----------|-------|-------|
86
+ | Naming Quality | /20 | ... |
87
+ | Function SRP | /20 | ... |
88
+ | ... | ... | ... |
89
+
90
+ **Action:** [Fixed / Acceptable]
91
+ ```
92
+
93
+ ## After Completion
94
+
95
+ If any functions were rewritten, run the test suite to verify no behavior changed. Report the final score for all reviewed functions.
96
+
97
+ **If score is below 120/160 overall:**
98
+ - Perform deeper architectural analysis inline: check DRY violations, unnecessary abstractions, and mixed abstraction levels
99
+
100
+ ## Red Flags - STOP
101
+
102
+ - Function names that require reading the body to understand
103
+ - Variables reused for different purposes (meaning changes mid-function)
104
+ - Mixed abstraction levels (SQL query next to business logic)
105
+ - Deeply nested conditionals (more than 1 level)
106
+ - Computer vocabulary where domain vocabulary exists (e.g., "handler" instead of "validator")
107
+ - No visual grouping -- wall of code with no paragraph breaks
108
+
109
+ ## Rationalization Prevention
110
+
111
+ | Excuse | Reality |
112
+ |--------|---------|
113
+ | "The naming is close enough" | Close enough means the next reader pauses. Pausing means it's not readable. |
114
+ | "Refactoring this function would be too risky" | The Edit tool preserves behavior. If tests pass, the rewrite is safe. |
115
+ | "It's only one dimension below threshold" | One weak dimension drags down comprehension of the entire function. |
116
+ | "This is how the rest of the codebase looks" | Existing low scores are not a license to add more. Fix what you touch. |
117
+ | "Adding guard clauses would make it longer" | Flat code reads faster than nested code, even if it has more lines. |
118
+
119
+ ## Remember
120
+
121
+ - Score ALL 8 dimensions for EVERY function -- no shortcuts
122
+ - Threshold is 16/20 in ANY single dimension, not average
123
+ - Fix without asking permission -- just fix and report
124
+ - Preserve all existing functionality and test assertions
125
+ - NEVER add comments -- code must be self-documenting
126
+ - NEVER remove existing comments -- they are sacred
127
+ - Read entire files, not just diffs -- context matters
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: recall
3
+ description: "Retrieve prior session context and decisions from Obsidian vault for the current project."
4
+ argument-hint: "[search query or project name]"
5
+ ---
6
+
7
+ # Recall
8
+
9
+ Search the Obsidian vault for prior session context, decisions, research, and gotchas relevant to the current task.
10
+
11
+ ## Instructions
12
+
13
+ 1. **Determine search query.** If `$ARGUMENTS` is provided, use it as the search query. Otherwise, infer the project name from the current conversation context (git remote, working directory, or topic being discussed).
14
+
15
+ 2. **Search by frontmatter first.** Use `mcp__obsidian__search_notes` with `searchFrontmatter: true` and the project name. This finds session reports and decision notes tagged with the project.
16
+
17
+ 3. **Search by content keywords.** If frontmatter search returns few results, search again by content using relevant keywords from the current task (component names, error messages, library names).
18
+
19
+ 4. **Read top matches.** Use `mcp__obsidian__read_note` to read the top 3 most relevant results. Prefer recent notes over older ones. Prefer decision notes and session summaries over raw research.
20
+
21
+ 5. **Present findings with attribution.** For each note, include:
22
+ - Note path and date
23
+ - Project name
24
+ - Relevant excerpts (not the full note unless it's short)
25
+ - Whether any decisions are marked `status: Superseded`
26
+
27
+ 6. **Handle no results honestly.** If no vault history exists for this project, say so explicitly. Do not fabricate or infer history that isn't in the vault.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: remember
3
+ description: "Save a decision, gotcha, or architectural choice to the Obsidian vault. User-initiated only."
4
+ disable-model-invocation: true
5
+ argument-hint: "[what to remember]"
6
+ ---
7
+
8
+ # Remember
9
+
10
+ Save a structured decision, gotcha, or architectural choice to the Obsidian vault as an individual note in the `decisions/` directory.
11
+
12
+ ## Instructions
13
+
14
+ 1. **Parse the input.** Extract the core decision, fact, or gotcha from `$ARGUMENTS`.
15
+
16
+ 2. **Classify the type** based on content:
17
+ - `decision` -- a choice made between alternatives (e.g., "chose Groq over Gemini")
18
+ - `procedural` -- a how-to or workflow step (e.g., "deploy requires manual cookie refresh first")
19
+ - `fact` -- an objective piece of information (e.g., "YNAB API cannot overwrite split transactions")
20
+ - `gotcha` -- a surprising behavior or trap (e.g., "Amazon blocks Cloud Run datacenter IPs")
21
+
22
+ 3. **Infer the project name** from conversation context (git remote, working directory, or topic).
23
+
24
+ 4. **Generate a short title** (3-7 words) that captures the essence.
25
+
26
+ 5. **Write to vault** via `mcp__obsidian__write_note`:
27
+
28
+ **Path:** `decisions/[Project] - [Short Title].md`
29
+
30
+ **Frontmatter:**
31
+ ```yaml
32
+ name: [Short Title from step 4]
33
+ description: [One-line summary of the decision/fact/gotcha -- concise enough for frontmatter search]
34
+ type: [decision|procedural|fact|gotcha]
35
+ project: [Project Name]
36
+ date: [YYYY-MM-DD]
37
+ status: Active
38
+ tags: [relevant, tags]
39
+ ```
40
+
41
+ **Body format depends on type:**
42
+
43
+ For `decision`:
44
+ ```
45
+ **Decision:** [One sentence stating what was decided]
46
+ **Reasoning:** [Why this was chosen]
47
+ **Alternatives considered:** [What was rejected and why]
48
+ **Consequences:** [What this means going forward]
49
+ ```
50
+
51
+ For `gotcha`:
52
+ ```
53
+ **Gotcha:** [One sentence stating the surprising behavior]
54
+ **Symptom:** [What you observe when you hit this]
55
+ **Fix:** [How to work around or resolve it]
56
+ ```
57
+
58
+ For `fact` or `procedural`:
59
+ ```
60
+ [The fact or procedure, written clearly in 1-3 sentences with relevant context]
61
+ ```
62
+
63
+ 6. **Confirm** what was saved and where (vault path).