claude-dev-env 1.10.0 → 1.11.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,6 +11,8 @@ When authoring or refining prompts, ground decisions in these sources. If guidan
11
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
12
  - https://www.anthropic.com/research/emotion-concepts-function -- blog summary of the above paper.
13
13
  - https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking -- adaptive thinking reference; replaces manual budget_tokens with effort-based control.
14
+ - https://claude.com/blog/harnessing-claudes-intelligence -- harness evolution: primitives Claude already knows, what to stop doing in the harness, deliberate boundaries (context economics, caching, typed tools). Local inventory: `docs/references/anthropic-harnessing-claudes-intelligence-technique-inventory.md`.
15
+ - https://github.com/anthropics/skills/tree/main/skills/claude-api -- Anthropic `claude-api` Agent Skill for hands-on API/tool patterns from that post (Hook 10). Platform entry: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/claude-api-skill
14
16
 
15
17
  ### Tier 2: Major labs (strong secondary, often transfers across models)
16
18
 
@@ -37,6 +39,56 @@ When authoring or refining prompts, ground decisions in these sources. If guidan
37
39
 
38
40
  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
41
 
42
+ ## Harness design patterns (Anthropic blog, April 2026)
43
+
44
+ Primary URL: https://claude.com/blog/harnessing-claudes-intelligence. Structured inventory: `docs/references/anthropic-harnessing-claudes-intelligence-technique-inventory.md`.
45
+
46
+ ### Mechanism doc map (Hook 11)
47
+
48
+ Jump from concept to the platform specs the post names:
49
+
50
+ - [Bash tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/bash-tool) / [Text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool)
51
+ - [Code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool) / [Programmatic tool calling](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling)
52
+ - [Memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)
53
+ - [Agent Skills overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)
54
+ - [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows) / [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) / [Compaction](https://platform.claude.com/docs/en/build-with-claude/compaction)
55
+ - [Subagents](https://code.claude.com/docs/en/sub-agents)
56
+ - [System prompts](https://platform.claude.com/docs/en/release-notes/system-prompts) / [Working with the Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) / [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
57
+ - [Model migration guide — hard-coded filters](https://platform.claude.com/docs/en/about-claude/models/migration-guide#additional-recommended-changes)
58
+ - [Harness design for long-running applications](https://www.anthropic.com/engineering/harness-design-long-running-apps)
59
+ - [Claude Code auto-mode](https://www.anthropic.com/engineering/claude-code-auto-mode)
60
+ - [Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents)
61
+
62
+ ### Context stack (Hook 5)
63
+
64
+ - **Context editing:** Remove stale tool results and thinking blocks selectively ([Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing)).
65
+ - **Subagents:** Fork fresh windows for isolated subtasks; post cites **+2.8%** BrowseComp vs best single-agent for Opus 4.6 ([Subagents](https://code.claude.com/docs/en/sub-agents)).
66
+ - **Compaction:** Summarize prior context for long horizons ([Compaction](https://platform.claude.com/docs/en/build-with-claude/compaction)); effectiveness varies by model generation (see Hook 9 table).
67
+ - **Memory folder:** Persist agent-chosen state via the memory tool / files ([Memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)).
68
+
69
+ ### Prompt caching (Hook 6)
70
+
71
+ The [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) is stateless—re-supply prior actions, tool definitions, and instructions each turn. Maximize [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) hits: **stable prefix first, dynamic tail last**; **append** new content via **messages** instead of rewriting the cached prompt; **avoid mid-session model switches** (caches are model-specific—use a **subagent** for a cheaper model); **treat the tool list as part of the cached prefix** and avoid churn; use **tool search** so dynamic discovery **appends** without invalidating the prefix; for multi-turn agents, **advance breakpoints** toward the latest message (**auto-caching**). Cached input tokens are priced at **10% of base input** per [pricing](https://platform.claude.com/docs/en/about-claude/pricing).
72
+
73
+ ### Typed tools vs bash strings (Hook 7)
74
+
75
+ Promote actions to **dedicated tools** with typed arguments when the harness must intercept, gate, render (e.g., **modals**), or audit—**hard-to-reverse** steps (e.g., external API calls) for user confirmation; **write/edit** paths with **staleness checks** so concurrent edits are not blindly overwritten ([Harnessing Claude's intelligence](https://claude.com/blog/harnessing-claudes-intelligence)).
76
+
77
+ ### Standing review: dedicated tools vs general bash + policy (Hook 8)
78
+
79
+ Re-evaluate promotions as models improve—e.g., Claude Code **auto-mode** (secondary reviewer over bash strings) can **reduce** bespoke tools **only** where users accept that trust profile; **high-stakes** actions still warrant dedicated tools ([Claude Code auto-mode](https://www.anthropic.com/engineering/claude-code-auto-mode)).
80
+
81
+ ### Benchmark vignettes — motivation only, not guarantees (Hook 9)
82
+
83
+ | Vignette | Outcome stated in the post |
84
+ |----------|----------------------------|
85
+ | SWE-bench Verified | Claude 3.5 Sonnet **49%** with bash + editor only (then SOTA framing) |
86
+ | BrowseComp + output filtering | Opus 4.6 **45.3% → 61.6%** |
87
+ | BrowseComp + subagents | Opus 4.6 **+2.8%** vs best single-agent |
88
+ | BrowseComp + compaction | Sonnet 4.5 **43%** flat; Opus 4.5 **68%**; Opus 4.6 **84%** (same setup) |
89
+ | BrowseComp-Plus + memory folder | Sonnet 4.5 **60.4% → 67.2%** |
90
+ | Prompt caching | Cached tokens **10%** the cost of base input tokens |
91
+
40
92
  ## NotebookLM Audio Overview customization (example)
41
93
 
42
94
  Adapt `[FOCUS AREA]` per notebook. Pair with Deep Dive + Longer in the product UI when that matches the user's plan.
@@ -19,6 +19,8 @@ description: >-
19
19
 
20
20
  **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).
21
21
 
22
+ **Harness hygiene:** Re-test harness assumptions about what Claude cannot do alone on each model generation or major product release—stale compensations bottleneck performance as capabilities improve (Hook 1; [Harnessing Claude's intelligence](https://claude.com/blog/harnessing-claudes-intelligence), inventory `docs/references/anthropic-harnessing-claudes-intelligence-technique-inventory.md`).
23
+
22
24
  **Eval contract:** The user-visible behavior this skill must satisfy is defined in `packages/claude-dev-env/skills/prompt-generator/TARGET_OUTPUT.md`. Automated evals live in `packages/claude-dev-env/skills/prompt-generator/evals/prompt-generator.json`.
23
25
 
24
26
  **Terminology:** **Prompt artifact** — the full XML inside the single user-facing `xml` fence (the paste-ready handoff). **Scope block** — the five-key contract in §3A that grounds instructions. **Default refinement pipeline** — §10: base draft → section refine → merge → 14-row compliance audit → capped fixes (subagent-internal unless draft-only). **Light self-check** — §8: fast pre-return sanity pass (shape, tools, scope, patterns); *not* the compliance audit. **Compliance audit (14-row)** — §11: hook-keyed rows that set the `Audit: pass|fail` numerator. **Execution handoff** — `/agent-prompt` after explicit user intent to run work.
@@ -59,16 +61,17 @@ Match `TARGET_OUTPUT.md`. Summary:
59
61
  |----------|---------|-------------|-----------------|
60
62
  | **1 — Fresh brief goal** | `/prompt-generator` with short goal; little session context | **3–5** parallel Glob/Grep (or equivalent) **before** any question | **One** form, **2–4** questions |
61
63
  | **2 — Session handoff** | User wants a prompt so a **new** session can continue this thread | **Conversation only** — skip redundant repo tools for facts already stated | **One** form, **1–2** questions |
62
- | **3 — Long unstructured input** | Many requirements / paths in one message | Verify repo references (packages, shared utils, configs) with targeted tools **before** questions | First question **confirms extracted intent**; ambiguities as **specific** options |
64
+ | **3 — Long unstructured input** | Many requirements / paths in one message | Verify repo references (packages, shared utils, configs) with targeted tools **before** questions | First question **confirms extracted intent**; ambiguities as **specific** options; **every** user-stated requirement captured in the generated XML by name — track all requirements from the unstructured input and confirm coverage before shipping |
63
65
  | **4 — Noisy context** | Long unrelated thread before `/prompt-generator` | Build the subagent brief from: the user’s literal `/prompt-generator` text, a **≤120-word** summary of on-topic facts, and discovery notes—**exclude** raw stack traces and unrelated tangents | As needed (often Scenario 1-shaped) |
64
66
 
65
- **Handoff (Scenario 2):** `<context>` must be **self-contained** — state, **decisions**, files touched, next steps, constraints — so a new session needs no prior chat.
67
+ **Handoff (Scenario 2):** `<context>` must be **self-contained** — state, **decisions**, files touched, next steps, constraints — so a new session needs no prior chat. Preserve prior decisions verbatim in the handoff; quote the exact decision text where precision matters rather than paraphrasing it away.
66
68
 
67
69
  ## Phase ordering (structural invariant A)
68
70
 
69
71
  For the **final** user-visible turn that ships the artifact:
70
72
 
71
73
  - Compose the message as **audit line → opening fence → XML → closing fence → end**; keep the byte stream free of `tool_use` blocks **between** the opening and closing fences.
74
+ - **Completeness:** End every numbered step inside `<instructions>` with a complete sentence and a fully written list item. Balance every XML tag explicitly (open and close each `<role>`, `<context>`, `<instructions>`, `<constraints>`, `<output_format>`). The artifact must be copy-pasteable into a new file with zero manual repair.
72
75
  - Global pipeline: **discovery tools** (when applicable) → **AskUserQuestion** → **subagent** (draft + refinement + internal audit) → **one** orchestrator reply containing only audit line + fence.
73
76
 
74
77
  ## Interactive discovery mode (default)
@@ -109,7 +112,7 @@ Match specificity to task fragility:
109
112
 
110
113
  - **High:** Multiple valid approaches; numbered goals and acceptance criteria.
111
114
  - **Medium:** Preferred pattern exists; pseudocode or parameterised template.
112
- - **Low:** Fragile or safety-critical; numbered steps with explicit file paths, command names, and **allowed / disallowed action lists** (e.g. “Allowed: `pytest packages/foo/tests`; Disallowed: `git push --force` without user approval”).
115
+ - **Low:** Fragile or safety-critical; numbered steps with explicit file paths, command names, and **permitted-action-only lists** (e.g. “Permitted: `pytest packages/foo/tests`; requires explicit user approval before: `git push --force`”).
113
116
 
114
117
  ### 3. Collect required missing facts
115
118
 
@@ -131,13 +134,13 @@ Use this scope block as the grounding contract for all generated instructions. E
131
134
 
132
135
  Apply principles from Anthropic’s prompting guide (see REFERENCE.md): XML sections, role, motivation in `<context>`, positive framing, emotion-informed collaborative tone where appropriate, **commit-and-execute** for multi-step agent prompts.
133
136
 
134
- **Structural invariant D:** Write `<instructions>` / `<constraints>` as direct imperatives (“Open `path/to/file.ts` and …”). Park unresolved items in `<open_question>` tags—one distinct question per tag with the exact decision you need.
137
+ **Structural invariant D:** Write `<instructions>` / `<constraints>` as direct imperatives (“Open `path/to/file.ts` and …”). Park unresolved items in `<open_question>` tags—one distinct question per tag with the exact decision you need. Inside the fenced XML artifact, use only confident, definitive language: replace hedging phrases (“let me also check”, “actually”, “one more consideration”) and tentative qualifiers (“might be”, “possibly”, “I think”, “could be”) with direct assertions or move genuine uncertainty into `<open_question>` tags.
135
138
 
136
139
  **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."
137
140
 
138
141
  **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.
139
142
 
140
- **Frame positively.** Anthropic: state the desired outcome directly. "Your response should be composed of smoothly flowing prose paragraphs" provides clearer guidance than a prohibition-only instruction.
143
+ **Frame positively (zero-negative-keyword rule).** Anthropic: state the desired outcome directly. "Your response should be composed of smoothly flowing prose paragraphs" provides clearer guidance than a prohibition-only instruction. Apply this rule absolutely inside the fenced XML artifact across all sections (`<role>`, `<context>`, `<instructions>`, `<constraints>`, `<output_format>`): every instruction states what to do, what to produce, what to enforce. Use affirmative directives exclusively: "only X", "always X", "ensure X", "require X." Banned keywords inside generated XML: "no", "not", "don't", "do not", "never", "avoid", "without", "refrain", "stop", "prevent", "exclude", "prohibit", "forbid", "reject." Also banned: indirect negative patterns such as "instead of X", "rather than X", "as opposed to." Example pass: "Ensure all functions have explicit return types." Example fail: "Do not leave return types implicit." When a boundary is needed, phrase it as what is permitted: "only run commands within the scoped paths" rather than a prohibition.
141
144
 
142
145
  **Emotion-informed framing.** Anthropic's emotion concepts research (2026) shows that internal activation patterns causally influence output quality. Apply: explicit success criteria with "say so if you're unsure" as an accepted answer; collaborative language ("help figure out", "work on this together"); framing tasks as interesting problems rather than chores; constructive, forward-looking tone. Cross-model caveat: studied on Sonnet 4.5; the patterns align with Anthropic's prompting best practices independently. Full pattern catalog and citations: `packages/claude-dev-env/docs/emotion-informed-prompt-design.md`.
143
146
 
@@ -145,6 +148,12 @@ Apply principles from Anthropic’s prompting guide (see REFERENCE.md): XML sect
145
148
 
146
149
  **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.
147
150
 
151
+ **Tool-return policy (agent-harness / tool-use prompts):** Require explicit justification before the harness tokenizes full tool outputs; when the next hop needs only a slice or a tool-to-tool handoff, steer authors toward code execution (bash/REPL) so only execution output reaches model-visible context—not every intermediate payload (Hook 2; [Harnessing Claude's intelligence](https://claude.com/blog/harnessing-claudes-intelligence)).
152
+
153
+ **Bash + text-editor foundation:** Prefer bash and the text editor for file work; treat Agent Skills, programmatic tool calling, and the memory tool as compositions of those primitives—state which primitive stack the harness assumes (Hook 3; same post).
154
+
155
+ **Progressive disclosure:** Avoid monolithic system prompts packed with rarely used task branches; keep short always-on summaries and load full bodies via a read path when relevant (skills YAML frontmatter pattern per [Agent Skills overview](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview)) (Hook 4; same post).
156
+
148
157
  **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.
149
158
 
150
159
  ### 5. Control output format
@@ -172,6 +181,7 @@ Expand the light self-check with this internal checklist when useful:
172
181
  - [ ] **Code prompts** include read-before-claim grounding ("read files first; say 'I don't know' when uncertain") and anti-test-fixation (general solutions, flag bad tests)
173
182
  - [ ] **Research prompts** include the structured-investigation pattern with competing hypotheses, confidence tracking, and self-critique
174
183
  - [ ] **Agentic prompts** that span multiple context windows address state management (context awareness, multi-window workflow, structured state files)
184
+ - [ ] **Agent-harness prompts** for long browse/search or multi-window work cite the context stack levers in **REFERENCE.md → Harness design patterns** (context editing, subagents, compaction, memory folder) (Hook 5)
175
185
  - [ ] Emotion-informed framing is present: collaborative language, explicit success criteria, and explicit permission to express uncertainty ("say so if unsure")
176
186
  - [ ] Constraints are surfaced upfront (proactive constraint awareness) so the model can incorporate them into its plan, and each non-obvious constraint carries its motivation
177
187
  - [ ] Self-correction chaining is considered when the prompt must hold up over time (generate → review → refine)
@@ -239,6 +249,7 @@ When the user explicitly asks for debug / full audit, emit the markdown table, `
239
249
  ### 14. Source anchors for pipeline requirements
240
250
 
241
251
  - Anthropic Prompting Best Practices: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
252
+ - Harness economics (context stack, caching, typed tools, benchmarks): **REFERENCE.md → Harness design patterns**
242
253
  - Autonomy / reversibility / no safety-bypass: same + “Autonomy and safety pattern” below
243
254
  - Evidence-grounding / read-before-claim policy: `packages/claude-dev-env/skills/prompt-generator/REFINEMENT_PIPELINE_RUNBOOK.md`
244
255
 
@@ -280,14 +291,16 @@ For `agent-harness` and `tool-use` prompt types, embed this **reversibility ladd
280
291
  ```text
281
292
  Default: take local, reversible actions first—read files, run targeted tests, apply patches under paths the user scoped.
282
293
 
283
- Before running any command that deletes data, rewrites shared history, or notifies other people, stop and ask the user for explicit approval. Concrete categories:
294
+ For commands that delete data, rewrite shared history, or notify other people, obtain explicit user approval first. Concrete categories requiring approval:
284
295
  - File or branch deletion, database drops, `rm -rf`
285
296
  - `git push --force`, `git reset --hard`, rewriting published commits
286
297
  - Pushes, PR comments, chat messages, or emails visible outside this workspace
287
298
 
288
- When tests fail or tooling blocks progress, prefer iterative fixes inside the allowed scope. Keep safety hooks (`--verify`, linters) enabled; surface unfamiliar files as questions instead of deleting them.
299
+ When tests fail or tooling blocks progress, prefer iterative fixes inside the allowed scope. Keep safety hooks (`--verify`, linters) enabled; surface unfamiliar files as questions.
289
300
  ```
290
301
 
302
+ **Positive rewrite guidance:** When embedding this pattern into a generated XML artifact, rephrase each line using affirmative directives only (per the zero-negative-keyword rule in §4). Example rewrite for generated output: "Prioritize local, reversible actions: read files, run targeted tests, apply patches within scoped paths. Obtain explicit user approval before running commands that delete data, rewrite shared history, or send external notifications. Keep safety hooks enabled (`--verify`, linters). Surface unfamiliar files as questions for the user."
303
+
291
304
  ## Research prompt pattern
292
305
 
293
306
  For `research` prompt types:
@@ -302,4 +315,6 @@ Search for this information in a structured way. As you gather data, develop sev
302
315
  2. **Tier 2:** OpenAI, Google DeepMind, Microsoft Research
303
316
  3. **Tier 3:** Community / blogs
304
317
 
318
+ **Out-of-scope guard (Hook 12):** [Harnessing Claude's intelligence](https://claude.com/blog/harnessing-claudes-intelligence) and `docs/references/anthropic-harnessing-claudes-intelligence-technique-inventory.md` cover harness evolution, context economics, caching, and declarative boundaries—not a substitute for a full security threat model or product-specific compliance catalog unless paired with other Tier 1 or governance sources.
319
+
305
320
  Full links: `REFERENCE.md`.
@@ -118,6 +118,21 @@
118
118
  "All uncertainty expressed as <open_question> tags, not inline hedges",
119
119
  "Prompt reads as confident complete instructions, not a draft-in-progress"
120
120
  ]
121
+ },
122
+ {
123
+ "id": 9,
124
+ "name": "zero_negative_phrasing_in_output",
125
+ "scenario": "Content quality gate A (anti-pattern elimination)",
126
+ "prompt": "/prompt-generator Write a system prompt for an agent that reviews TypeScript code for type safety, enforces strict null checks, and ensures all function signatures have complete type annotations",
127
+ "files": [],
128
+ "expected_behavior": [
129
+ "Fenced prompt artifact contains zero hard anti-pattern keywords: 'no', 'not', 'don't', 'do not', 'never', 'avoid', 'without', 'refrain', 'stop', 'prevent', 'exclude', 'prohibit', 'forbid', 'reject'",
130
+ "Zero indirect anti-patterns: 'instead of X' (implies X is bad), 'rather than X', 'as opposed to'",
131
+ "Every instruction phrased as a positive directive: what TO do, what TO produce, what TO enforce",
132
+ "Constraints section uses affirmative boundaries: 'only X', 'always X', 'ensure X', 'require X' — positive framing throughout",
133
+ "Example: 'Ensure all functions have explicit return types' passes; 'Do not leave return types implicit' fails; 'Avoid missing return types' fails",
134
+ "Applies to all sections inside the fenced block: <role>, <context>, <instructions>, <constraints>, <output_format>"
135
+ ]
121
136
  }
122
137
  ]
123
138
  }