Skip to content
ai-prompt-engineer logo

AI Prompt Engineer

ai-prompt-engineer

AI engineering skill for prompt optimization, context inference, and intelligent command routing across different models and use cases

SKILL.md

Full skill instructions

AI Prompt Engineer

An AI engineering skill focused on optimizing prompts, improving context collection, and intelligently routing requests across different models, purposes, and layers of the agent loop.

Purpose

This skill addresses the core challenge: users shouldn't need to over-provide information. Caro should infer context intelligently and serve users with minimal friction. This skill guides the systematic improvement of:

  1. Query Understanding - Categorize and understand user intent from minimal input
  2. Context Inference - Extract maximum signal from available cues (file types, platform, cwd, history)
  3. Tool Routing - Map inferred context to appropriate tools and commands
  4. Prompt Optimization - Craft prompts tailored to specific models and use cases

When to Use This Skill

Invoke this skill when working on:

  • Analyzing user query patterns to improve command generation
  • Optimizing prompts for different model sizes (SmolLM, larger models)
  • Building context inference logic that reduces user input requirements
  • Creating file-type-to-tool mappings for intelligent recommendations
  • Improving platform-aware command routing
  • Designing prompt templates for specific use case categories
  • Evaluating prompt effectiveness across different scenarios

Core Concepts

Query Taxonomy

User queries fall into distinct categories that require different handling:

CategoryDescriptionExamplesKey Signals
Terminal ExplorationNavigating, listing, searching the filesystem"what's in this folder", "find large files"Navigation verbs, location references
Runbook ExecutionProject-specific workflows based on history"run the build", "deploy to staging"Project context, command history patterns
Language DevelopmentLanguage-specific development tasks"compile this", "run tests"File extensions, project markers (Cargo.toml, package.json)
DevOps FlowDeployment, CI/​CD, infrastructure"push to prod", "check k8s pods"DevOps tools (docker, kubectl), env references
Casual ScriptingQuick one-off tasks"unzip this file", "rename these files"Simple verbs, single file/​pattern references
CLI Tool InteractionUsing specific command-line tools"git status", "npm install"Tool names, tool-specific vocabulary

Context Inference Hierarchy

Extract context in priority order:

  1. Explicit Reference - User mentions a file, tool, or path directly
  2. File Type Signals - Extension hints at appropriate tools
  3. Platform Context - OS determines available commands and conventions
  4. Working Directory - Project type, available tools, recent activity
  5. Session History - Patterns in previous commands suggest intent
  6. Default Conventions - Platform/​community standard practices

The File Type Principle

"The file type is the strongest hint for tool selection"

When a user references a file, the extension often determines the appropriate tool:

Archive Example:

  • .tar.gz, .tgz → tar -xzf (Linux/​macOS)
  • .zip → unzip (macOS), 7z x or Expand-Archive (Windows)
  • .rar → unrar (requires installation)
  • .7z → 7z x (requires 7-zip)

The Anti-Pattern:

User on macOS: "extract this archive"
File: document.zip

BAD: tar -xzf document.zip  (wrong tool for file type)
GOOD: unzip document.zip    (matches file type + platform)

Workflow

Phase 1: Analyze Query Pattern

1. Read the user query
2. Identify category from Query Taxonomy
3. Extract explicit references (files, tools, paths)
4. Note implicit signals (verbs, modifiers, context words)
5. Document the analysis

Phase 2: Gather Context Signals

1. Check if file reference exists → extract extension
2. Detect platform from ExecutionContext
3. Identify project type from cwd markers
4. Review session history for patterns
5. Build context signal map

Phase 3: Map to Tool/​Command Space

1. Use file-type-to-tool mappings (see references/​file-tool-map.md)
2. Filter by platform availability
3. Consider user preferences if known
4. Rank options by confidence
5. If ambiguous, prepare clarifying question

Phase 4: Optimize Prompt

1. Select appropriate prompt template for category
2. Inject inferred context
3. Constrain output space based on mappings
4. Add platform-specific rules
5. Format for target model (SmolLM ChatML, etc.)

Phase 5: Evaluate & Iterate

1. Run against test cases in evaluation harness
2. Measure improvement vs baseline
3. Document patterns that work
4. Update mappings and templates
5. Create regression tests for fixed cases

Reference Materials

DocumentPurpose
references/​query-taxonomy.mdDetailed breakdown of query categories with detection signals
references/​file-tool-map.mdFile extension to tool mappings by platform
references/​context-inference.mdPatterns for inferring context from minimal input
references/​prompt-templates.mdCategory-specific prompt optimization templates
examples/​case-studies.mdReal-world optimization examples

Integration Points

This skill integrates with:

  • /​src/​prompts/ - Prompt building and capability profiling
  • /​src/​context/​mod.rs - Execution context detection
  • /​src/​evaluation/ - Testing improvements against baseline
  • /​tests/​evaluation/​dataset.yaml - Test case datasets

Success Metrics

  1. Inference Accuracy - Correct tool/​command selection without explicit user specification
  2. Context Hit Rate - Percentage of queries where useful context was inferred
  3. Clarification Rate - Reduction in "what do you mean?" responses
  4. Cross-Platform Correctness - Right tool for right platform

Example Session

Scenario: User on macOS in a Rust project asks "extract the dependency archive"

Query Analysis:
- Category: Casual Scripting (simple verb, file reference)
- Explicit: "dependency archive"
- Implicit: extraction intent

Context Signals:
- Platform: macOS (BSD tools, unzip available)
- CWD: /​Users/​dev/​myproject (Cargo.toml present → Rust project)
- Files matching "archive": vendor.tar.gz, deps.zip

Ambiguity Detection:
- Multiple archive files found
- Different formats require different tools

Resolution Options:
1. Ask: "Which archive? vendor.tar.gz or deps.zip?"
2. Or list both commands with explanations

If deps.zip selected:
- Tool: unzip (matches .zip + macOS)
- Command: unzip deps.zip
- NOT: tar -xzf deps.zip (wrong tool!)

Anti-Patterns to Avoid

  1. Platform Mismatch - Using GNU flags on BSD, tar for zip files
  2. Over-Assumption - Guessing without sufficient signals
  3. Under-Inference - Asking for info that's already determinable
  4. Tool Hallucination - Suggesting tools not installed/​available
  5. Context Blindness - Ignoring obvious cues from file types, cwd

Next Steps for Development

  1. Expand file-tool-map.md with more file types and edge cases
  2. Build query classifier that maps natural language to taxonomy categories
  3. Create "context score" metric for measuring inference quality
  4. Develop prompt templates optimized for each category
  5. Add test cases to evaluation harness for new patterns

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View