-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
feat: add 13 Claude Code harness skills #2551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| --- | ||
| name: claude-api | ||
| description: Build, debug, and optimize Claude API / Anthropic SDK applications. Covers prompt caching, thinking, tool use, batch processing, streaming, file APIs, citations, and model migrations. Trigger when code imports anthropic or @anthropic-ai/sdk. | ||
| origin: claude-code-harness | ||
| tools: Read, Write, Edit, Bash, Glob, Grep | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Narrow the skill’s tool permissions. This API-reference skill is auto-activated by Anthropic imports but grants As per path instructions, review this skill for prompt-injection resilience and tool-permission scope. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| --- | ||
|
|
||
| # Claude API | ||
|
|
||
| Build, debug, and optimize applications using the Claude API (Anthropic SDK). All apps built with this skill should include prompt caching. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win Do not require prompt caching for every application. Caching is useful for repeated, sufficiently large prefixes, but short prompts below the model/platform threshold are simply not cached, and cache writes have their own cost. Make caching conditional on repeated stable system prompts, tools, or long context rather than an unconditional requirement. (platform.claude.com) Also applies to: 37-40 🤖 Prompt for AI Agents |
||
|
|
||
| ## When to Activate | ||
|
|
||
| **Trigger on:** | ||
| - Code that imports `anthropic` or `@anthropic-ai/sdk` | ||
| - User asks about the Claude API, Anthropic SDK, or Managed Agents | ||
| - User adds or modifies Claude features: caching, thinking, tool use, batch, files, citations, memory | ||
| - User asks about a specific model (Opus, Sonnet, Haiku) | ||
| - Questions about prompt caching or cache hit rates in an Anthropic SDK project | ||
| - Migrating between Claude model versions | ||
|
|
||
| **Skip when:** | ||
| - Code imports `openai` or another provider SDK | ||
| - Filename contains `-openai.py`, `-generic.py`, or similar | ||
| - Provider-neutral code with no Anthropic-specific patterns | ||
|
|
||
| ## Current Models (as of 2025) | ||
|
|
||
| | Model | ID | Best For | | ||
| |-------|-----|----------| | ||
| | Claude Opus 4.7 | `claude-opus-4-7` | Most capable, complex reasoning | | ||
| | Claude Sonnet 4.6 | `claude-sonnet-4-6` | Balanced capability and speed | | ||
| | Claude Haiku 4.5 | `claude-haiku-4-5-20251001` | Fast, cost-efficient | | ||
|
|
||
| Default to the latest and most capable model for new applications. | ||
|
Comment on lines
+27
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file exists and relevant content =="
if [ -f skills/claude-api/SKILL.md ]; then
nl -ba skills/claude-api/SKILL.md | sed -n '1,80p'
else
echo "skills/claude-api/SKILL.md not found"
fi
echo
echo "== repo files under skills/claude-api =="
git ls-files skills/claude-apiRepository: affaan-m/ECC Length of output: 229 🌐 Web query:
💡 Result: As of today, July 23, 2026, the status of the requested models is as follows: Active Models: - claude-opus-4-8: Active; tentative retirement not sooner than May 28, 2027 [1][2]. - claude-sonnet-5: Active; tentative retirement not sooner than June 30, 2027 [1][2]. - claude-opus-4-7: Active; tentative retirement not sooner than April 16, 2027 [1][2]. - claude-sonnet-4-6: Active; tentative retirement not sooner than February 17, 2027 [1][2]. - claude-haiku-4-5-20251001: Active; tentative retirement not sooner than October 15, 2026 [1][2]. Summary of Recent Deprecations: None of the specific models you listed are currently deprecated or retired [1][2]. Recent model deprecations occurred on June 15, 2026, for older versions, specifically Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file exists and relevant content =="
if [ -f skills/claude-api/SKILL.md ]; then
awk '{printf "%4d\t%s\n", NR, $0}' skills/claude-api/SKILL.md | sed -n '1,100p'
else
echo "skills/claude-api/SKILL.md not found"
fi
echo
echo "== repo files under skills/claude-api =="
git ls-files skills/claude-api || true
echo
echo "== precise model mentions in skill =="
python3 - <<'PY'
from pathlib import Path
p=Path("skills/claude-api/SKILL.md")
if p.exists():
text=p.read_text()
for m in ["claude-opus-4-8","claude-sonnet-5","claude-opus-4-7","claude-sonnet-4-6","claude-haiku-4-5-20251001","current models","latest"]:
print(f"{m!r}: {m in text}")
print("line 27-35:")
lines=text.splitlines()
for i in range(26, min(36, len(lines))):
print(f"{i+1}: {lines[i]}")
PYRepository: affaan-m/ECC Length of output: 4332 Refresh the Claude model catalog and default recommendation. The catalog is still dated 2025 and omits current active models such as 🤖 Prompt for AI Agents |
||
|
|
||
| ## Prompt Caching (Required) | ||
|
|
||
| Every app built with this skill must include prompt caching. Caching reduces cost and latency for repeated system prompts, tool definitions, and long documents. | ||
|
|
||
| ### Python | ||
|
|
||
| ```python | ||
| import anthropic | ||
|
|
||
| client = anthropic.Anthropic() | ||
|
|
||
| response = client.messages.create( | ||
| model="claude-opus-4-7", | ||
| max_tokens=1024, | ||
| system=[ | ||
| { | ||
| "type": "text", | ||
| "text": "Your long system prompt here...", | ||
| "cache_control": {"type": "ephemeral"} | ||
| } | ||
| ], | ||
| messages=[{"role": "user", "content": "Hello"}] | ||
| ) | ||
| ``` | ||
|
|
||
| ### TypeScript | ||
|
|
||
| ```typescript | ||
| import Anthropic from "@anthropic-ai/sdk"; | ||
|
|
||
| const client = new Anthropic(); | ||
|
|
||
| const response = await client.messages.create({ | ||
| model: "claude-opus-4-7", | ||
| max_tokens: 1024, | ||
| system: [ | ||
| { | ||
| type: "text", | ||
| text: "Your long system prompt here...", | ||
| cache_control: { type: "ephemeral" }, | ||
| }, | ||
| ], | ||
| messages: [{ role: "user", content: "Hello" }], | ||
| }); | ||
| ``` | ||
|
|
||
| ### Cache Hit Detection | ||
|
|
||
| ```python | ||
| # Check cache performance | ||
| print(response.usage.cache_creation_input_tokens) # tokens written to cache | ||
| print(response.usage.cache_read_input_tokens) # tokens read from cache | ||
| ``` | ||
|
|
||
| ## Tool Use | ||
|
|
||
| ```python | ||
| tools = [ | ||
| { | ||
| "name": "get_weather", | ||
| "description": "Get current weather for a location", | ||
| "input_schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "location": {"type": "string", "description": "City name"} | ||
| }, | ||
| "required": ["location"] | ||
| } | ||
| } | ||
| ] | ||
|
|
||
| response = client.messages.create( | ||
| model="claude-opus-4-7", | ||
| max_tokens=1024, | ||
| tools=tools, | ||
| messages=[{"role": "user", "content": "What's the weather in Paris?"}] | ||
| ) | ||
| ``` | ||
|
|
||
| ## Extended Thinking | ||
|
|
||
| ```python | ||
| response = client.messages.create( | ||
| model="claude-opus-4-7", | ||
| max_tokens=16000, | ||
| thinking={ | ||
| "type": "enabled", | ||
| "budget_tokens": 10000 | ||
| }, | ||
|
Comment on lines
+119
to
+125
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Relevant file snippet:\n'
sed -n '105,130p;165,182p' skills/claude-api/SKILL.md || true
printf '\nSearch for thinking/adaptive/opus in file:\n'
rg -n 'claude-opus-4-7|thinking|adaptive|budget_tokens|output_config|minimum|1000|1,024|1024' skills/claude-api/SKILL.md || true
printf '\nRepository files:\n'
git ls-files | rg '(^skills/|\.md$)' | head -80Repository: affaan-m/ECC Length of output: 5896 🌐 Web query:
💡 Result: Adaptive thinking is the recommended approach for managing reasoning in modern Claude models [1][2]. The manual extended thinking parameter Citations:
🌐 Web query:
💡 Result: In the Claude API, the output_config.effort parameter is used to control the depth and frequency of the model's reasoning when adaptive thinking is enabled [1][2]. It is a soft guidance parameter rather than a hard token limit [2][3]. The available effort levels are: max: Provides the absolute maximum capability with no constraints on thinking depth, intended for tasks requiring the deepest possible reasoning and thorough analysis [1][2]. xhigh: Offers extended capability for long-horizon work, such as complex agentic or coding tasks (typically over 30 minutes) [1][2]. This is recommended as the starting point for most coding and high-autonomy workloads [4][5]. high: The default level [5][6]. It provides a balance between intelligence and token usage, and is recommended as the minimum level for most intelligence-sensitive tasks [1][4]. medium: A lower effort level designed for cost-sensitive workloads, where the model may skip thinking for simpler queries [2][4]. low: Minimizes thinking, reserving it for latency-sensitive or short, scoped tasks [2][4]. Important implementation details: Configuration: Effort is set via the top-level output_config object in the API request body, not within the thinking object [2][7]. Example structure: { "model": "claude-opus-4-8", "max_tokens": 4096, "thinking": { "type": "adaptive" }, "output_config": { "effort": "high" }, "messages": [...] } Adaptive Thinking vs. Effort: You should not pass "adaptive" as an effort value, as it is a thinking mode, not an effort level [1]. Adaptive thinking must be explicitly enabled using {"thinking": {"type": "adaptive"}} [4][7]. Resource Management: Because thinking tokens count against your total max_tokens budget, you should ensure max_tokens is set high enough to accommodate both the reasoning process and the final response [2][3]. If you encounter stop_reason: "max_tokens", you can either increase your max_tokens limit or lower the effort level [2][3]. Optimization: Setting effort to the model's default (high) is functionally equivalent to omitting the parameter and does not invalidate prompt caching [3]. Conversely, changing the effort level between requests will invalidate cache breakpoints [3]. Citations:
Use adaptive thinking for the Opus 4.7 example.
🤖 Prompt for AI Agents |
||
| messages=[{"role": "user", "content": "Solve this complex problem..."}] | ||
| ) | ||
| ``` | ||
|
|
||
| ## Streaming | ||
|
|
||
| ```python | ||
| with client.messages.stream( | ||
| model="claude-opus-4-7", | ||
| max_tokens=1024, | ||
| messages=[{"role": "user", "content": "Tell me a story"}] | ||
| ) as stream: | ||
| for text in stream.text_stream: | ||
| print(text, end="", flush=True) | ||
| ``` | ||
|
|
||
| ## Batch Processing | ||
|
|
||
| ```python | ||
| # Create a batch | ||
| batch = client.messages.batches.create( | ||
| requests=[ | ||
| {"custom_id": "req-1", "params": {"model": "claude-opus-4-7", "max_tokens": 100, "messages": [...]}}, | ||
| {"custom_id": "req-2", "params": {"model": "claude-opus-4-7", "max_tokens": 100, "messages": [...]}}, | ||
| ] | ||
| ) | ||
|
|
||
| # Poll for results | ||
| import time | ||
| while True: | ||
| batch = client.messages.batches.retrieve(batch.id) | ||
| if batch.processing_status == "ended": | ||
| break | ||
| time.sleep(60) | ||
| ``` | ||
|
|
||
| ## Model Migration | ||
|
|
||
| When migrating between model versions: | ||
|
|
||
| 1. Update the `model` string to the new ID | ||
| 2. Check for deprecated parameters (some older params removed in newer models) | ||
| 3. Test with the new model — behavior may differ even with the same prompt | ||
| 4. Update any hardcoded model-specific limits (context window, max output tokens) | ||
|
|
||
| ## Common Issues | ||
|
|
||
| | Issue | Cause | Fix | | ||
| |-------|-------|-----| | ||
| | Low cache hit rate | System prompt changes between calls | Make system prompt static; move dynamic content to user turn | | ||
| | `anthropic.APIStatusError: 529` | Overloaded | Implement exponential backoff | | ||
| | Tool call not executed | Model returned `tool_use` block | Handle `stop_reason: "tool_use"` and call the tool | | ||
| | Thinking not appearing | Budget too low | Increase `budget_tokens`; minimum ~1000 | | ||
|
|
||
| ## Related Skills | ||
|
|
||
| - `agent-architecture-audit` — Audit multi-layer agent applications built on the Claude API | ||
| - `agent-harness-construction` — Build full agent harnesses using the Claude API | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| --- | ||
| name: code-review | ||
| description: Review the current diff for correctness bugs and reuse/simplification/efficiency cleanups at a given effort level. Pass --comment to post findings as inline PR comments, or --fix to apply findings to the working tree. Supports low/medium/high/max/ultra effort levels. | ||
| origin: claude-code-harness | ||
| tools: Read, Bash, Glob, Grep | ||
|
Comment on lines
+3
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Make The skill advertises applying edits, but its tool list has no 🤖 Prompt for AI Agents |
||
| --- | ||
|
|
||
| # Code Review | ||
|
|
||
| Review the current branch diff for correctness bugs, reuse opportunities, simplification wins, and efficiency improvements. Produces ranked findings with optional inline PR comments or automatic fixes. | ||
|
|
||
| ## When to Use | ||
|
Comment on lines
+8
to
+12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Add the required skill-documentation sections. Each skill has activation guidance and workflow content, but none presents the required explicit
📍 Affects 6 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| - User asks for a code review of the current branch or a specific PR | ||
| - User wants findings posted as inline PR comments (`--comment`) | ||
| - User wants findings automatically applied to the working tree (`--fix`) | ||
| - User specifies an effort level: low, medium, high, max, or ultra | ||
|
|
||
| **Invoke via:** `/code-review [effort] [--comment] [--fix] [PR#]` | ||
|
|
||
| **Ultra mode** (`/code-review ultra` or `/code-review ultra <PR#>`): launches a multi-agent cloud review. Billed and user-triggered only — do not invoke via Bash. | ||
|
|
||
| ## Effort Levels | ||
|
|
||
| | Level | Coverage | Best For | | ||
| |-------|----------|----------| | ||
| | `low` | High-confidence, obvious bugs only | Quick sanity check before merge | | ||
| | `medium` | Moderate coverage, clear wins | Standard PR review | | ||
| | `high` | Broader coverage, may include uncertain findings | Important features or risky changes | | ||
| | `max` | Maximum breadth, includes speculative findings | Critical systems, security-sensitive changes | | ||
| | `ultra` | Deep multi-agent cloud review | Large PRs, pre-release audits | | ||
|
|
||
| Default effort: `medium`. | ||
|
|
||
| ## Review Workflow | ||
|
|
||
| ### 1. Identify the Diff | ||
|
|
||
| ```bash | ||
| # Current branch vs main | ||
| git diff main...HEAD | ||
|
|
||
| # Specific PR (with gh CLI) | ||
| gh pr diff <PR#> | ||
|
|
||
| # Staged changes only | ||
| git diff --cached | ||
| ``` | ||
|
Comment on lines
+37
to
+48
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Capture the complete pending change set. These workflows use incomplete or inconsistent baselines:
📍 Affects 4 files
🤖 Prompt for AI Agents |
||
|
|
||
| ### 2. Collect Context | ||
|
|
||
| Before reviewing, read: | ||
| - Files changed in the diff | ||
| - Adjacent files that depend on changed code | ||
| - Existing tests for changed functionality | ||
| - Any CLAUDE.md conventions that apply | ||
|
|
||
| ### 3. Apply Effort-Appropriate Analysis | ||
|
|
||
| **Correctness bugs (all levels):** | ||
| - Logic errors, off-by-one errors, null/undefined dereferences | ||
| - Incorrect API usage, wrong argument order | ||
| - Race conditions, improper async/await | ||
| - Missing error handling at system boundaries | ||
|
|
||
| **Simplification/reuse (medium+):** | ||
| - Duplicated logic that could use an existing utility | ||
| - Overly complex implementations with simpler alternatives | ||
| - Dead code or unused imports | ||
|
|
||
| **Efficiency (high+):** | ||
| - N+1 queries, unnecessary re-renders, wasteful allocations | ||
| - Missing memoization or caching opportunities | ||
|
|
||
| **Speculative (max only):** | ||
| - Hypothetical future issues | ||
| - Style suggestions beyond project conventions | ||
|
|
||
| ### 4. Rank Findings | ||
|
|
||
| Order findings by: | ||
| 1. **Severity** — bugs that would break production first | ||
| 2. **Confidence** — high-confidence findings before speculative ones | ||
| 3. **Impact** — changes that affect many callsites before isolated issues | ||
|
|
||
| ### 5. Output Findings | ||
|
|
||
| For each finding: | ||
| - **File and line reference** — `path/to/file.ts:42` | ||
| - **Issue description** — what is wrong and why | ||
| - **Suggested fix** — concrete code change, not vague advice | ||
|
|
||
| ## Flags | ||
|
|
||
| ### `--comment` — Post as Inline PR Comments | ||
|
|
||
| Posts each finding as an inline comment on the GitHub PR at the relevant line. Requires `gh` CLI authenticated. Does not modify the working tree. | ||
|
|
||
| ```bash | ||
| gh pr review <PR#> --comment --body "..." | ||
| # or per-line: | ||
| gh api repos/:owner/:repo/pulls/:pr/comments ... | ||
| ``` | ||
|
|
||
| ### `--fix` — Apply Findings | ||
|
|
||
| After generating findings, applies fixes directly to the working tree. Equivalent to running `/simplify` after the review. Use only when findings are high-confidence. | ||
|
|
||
| ## What NOT to Review | ||
|
|
||
| - Formatting — let the linter handle it | ||
| - Naming preferences with no correctness impact | ||
| - Architectural changes outside the PR scope | ||
| - Hypothetical future requirements (at low/medium effort) | ||
|
|
||
| ## Related Skills | ||
|
|
||
| - `simplify` — Apply fixes from the current diff review | ||
| - `verify` — Confirm a change works by running the app | ||
| - `security-review` — Security-focused review of pending changes | ||
| - `agent-architecture-audit` — Deep audit for agent/LLM applications | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick win
Remove this file from the active ECC skill surface.
tests/ci/agent-yaml-surface.test.js:112-123explicitly asserts thatskills/claude-api/SKILL.mdmust not exist becauseclaude-apiis installed fromanthropics/skills. This file will fail that CI check; move the source elsewhere or update the packaging contract before merging.🤖 Prompt for AI Agents