claude-dev-env 1.2.1 → 1.7.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.
- package/agents/project-context-loader.md +1 -1
- package/bin/install.mjs +76 -0
- package/docs/PR_DESCRIPTION_GUIDE.md +95 -0
- package/hooks/blocking/block-main-commit.py +13 -1
- package/hooks/blocking/pr-description-enforcer.py +68 -43
- package/hooks/hooks.json +0 -20
- package/hooks/validation/mypy_validator.py +35 -0
- package/hooks/workflow/auto-formatter.py +40 -1
- package/package.json +8 -2
- package/skills/npm-creator/SKILL.md +7 -3
- package/skills/skill-writer/REFERENCE.md +160 -122
- package/skills/skill-writer/SKILL.md +131 -197
- package/LICENSE +0 -21
- package/README.md +0 -247
- package/hooks/blocking/docker-settings-guard.py +0 -44
- package/hooks/blocking/parallel-task-blocker.py +0 -69
- package/hooks/blocking/pyautogui-scroll-blocker.py +0 -74
- package/hooks/session/bulk-edit-reminder.py +0 -30
- package/hooks/session/code-rules-reminder.py +0 -97
- package/hooks/session/compact-context-reinject.py +0 -39
- package/hooks/session/hook-structure-context.py +0 -140
- package/hooks/validation/code-style-validator.py +0 -145
- package/hooks/validation/e2e-test-validator.py +0 -142
- package/skills/agent-prompt/SKILL.md +0 -102
- package/skills/prompt-generator/REFERENCE.md +0 -150
- package/skills/prompt-generator/SKILL.md +0 -154
|
@@ -1,154 +0,0 @@
|
|
|
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.
|