All skills
oaustegard avatar

/down-skilling

@5e58100

Distill Opus-level reasoning into optimized instructions for Haiku 4.5 (and Sonnet). Generates explicit, procedural prompts with n-shot examples that maximize smaller model performance on a given task. Use when user says "down-skill", "distill for Haiku", "optimize for Haiku", "make this work on Haiku", "generate Haiku instructions", or needs to delegate a task to a smaller model with high reliability.

Use this Skill: https://skilld.dev/gh/oaustegard/claude-skills/down-skilling

This session only. Nothing lands on disk.

examplessql-generation.md

≈606 tokens on demand. Your agent reads this file only when SKILL.md points to it.

SQL Query Generation

Task type: Code generation from natural language Key gaps addressed: code-generation, ambiguity-resolution, schema-adherence

Original (Opus-level)

"Write a SQL query for the user's request. Use the provided schema."

Distilled Haiku Prompt

<role>
You are a SQL assistant that generates queries from natural language requests.
</role>

<task>
Generate a SQL query that answers the user's question using the provided
database schema. Output the query and a brief explanation.
</task>

<rules>
1. Use ONLY tables and columns from <schema>. Never invent columns.
2. Use standard SQL (PostgreSQL dialect).
3. Always use explicit JOIN syntax (not comma-separated FROM).
4. Always qualify column names with table aliases when joining.
5. Include ORDER BY when the question implies ranking or "top N".
6. Include LIMIT when the question asks for "top N" or a specific count.
7. Default to LIMIT 10 if "a few" or "some" is requested.
8. Use COUNT/SUM/AVG with GROUP BY for aggregate questions.
9. If the schema cannot answer the question, output:
   "-- Cannot answer: [reason]. Required column/table not in schema."
10. Output format:
    ```sql
    [query]
    ```
    Explanation: [one sentence, max 20 words]
</rules>

<examples>
<example>
<input>
Schema: users(id, name, email, created_at), orders(id, user_id, total, status, created_at)
Question: "Who are our top 5 customers by total spending?"
</input>
<o>
```sql
SELECT u.name, SUM(o.total) AS total_spent
FROM users u
JOIN orders o ON o.user_id = u.id
WHERE o.status = 'completed'
GROUP BY u.id, u.name
ORDER BY total_spent DESC
LIMIT 5;

Explanation: Sums completed order totals per user, returns top 5 spenders. </o> </example>

<example> <input> Schema: users(id, name, email, created_at), orders(id, user_id, total, status, created_at) Question: "What's the average customer age?" </input> <o> -- Cannot answer: no age or birthdate column in users table. Explanation: Schema lacks age data; cannot compute average age. </o> </example> </examples><schema> {{database_schema}} </schema><context> {{user_question}} </context> ```

Why it works for Haiku

  • Rule 1 prevents column hallucination (Haiku's most common SQL failure)
  • Rule 9 with example shows correct "can't answer" behavior
  • Explicit JOIN and alias rules prevent common syntax shortcuts
  • Rules 5-7 handle vague quantifiers with concrete defaults

Source: SKILL.md on GitHub

No alerts12d4 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    The skill provides guidelines and templates for optimizing AI prompts for smaller models by distilling complex reasoning into explicit procedures and many-shot examples. No security issues were detected.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

  • Runlayer7mo

    2/37 files flagged

Signed by skilld at 5e58100. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 weeks ago
metadata
{
  "author": "Oskar Austegard and Opus",
  "version": "1.3.1"
}

README badge

README badge for oaustegard/claude-skills/down-skilling