Prompt Engineering Patterns
wshobson/agents
Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.
Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces.
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-context --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .claude/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .claude/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-contextType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-context --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .agents/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .agents/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-context --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .cursor/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .cursor/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/kayba-ai/agentic-context-engine.git --path .claude/skills/kayba-pipeline/stage-2-domain-context--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-context --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .gemini/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .gemini/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-contextInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .github/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .github/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install kayba-ai/agentic-context-engine kayba-stage-2-domain-context --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kayba-ai/agentic-context-engine.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/kayba-pipeline/stage-2-domain-context .opencode/skills/kayba-stage-2-domain-context && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "kayba-stage-2-domain-context" agent skill from https://github.com/kayba-ai/agentic-context-engine/tree/main/.claude/skills/kayba-pipeline/stage-2-domain-context into .opencode/skills/kayba-stage-2-domain-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "kayba-stage-2-domain-context", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
kayba-stage-2-domain-contextGather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces.
Kayba Stage 2 Domain Context is an agent skill from kayba-ai/agentic-context-engine. Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces. Trigger when the user says "run stage 2", "gather context", "domain context", or when invoked by the kayba-pipeline orchestrator.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering Prompt engineering and Structured output and tool calling. It works with Python. The repository describes itself as: 🧠 Make your agents learn from experience. Now available as a hosted solution at kayba.ai. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 3a31983. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Kayba Stage 2 Domain Context loads about 1.9k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 765 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from kayba-ai/agentic-context-engine at commit 3a31983, republished under its Apache-2.0 licence (© kayba-ai). 765 words, ~1,877 tokens.
.claude/skills/kayba-stage-2-domain-context/SKILL.md (or your agent's skills folder).Understand the agent's world — what it does, what tools it has, and what "success" looks like.
TRACES_FOLDER — path to directory containing trace JSON filesBefore reading traces, identify the framework that produced them. Read 1 trace file and check:
| Signal | Framework |
|---|---|
info.agent_info.implementation, info.environment_info, simulation.messages[] with role/tool_calls/turn_idx | tau2-bench |
runs[].steps[] with type: "tool", lc_kwargs | LangChain / LangSmith |
events[] with event_type, span_id, parent_id | LlamaIndex |
choices[].message.tool_calls[] at top level | Raw OpenAI API logs |
trace.spans[] with attributes, trace_id | OpenTelemetry / Arize / Langfuse |
Record the detected format in the output under Trace Format. All subsequent trace-reading steps use the field paths appropriate for that format.
If the format is unrecognized, note the top-level keys and structure, then proceed best-effort with field names found in the data.
Read 2-3 traces and determine if this is a single-agent or multi-agent system:
agent_info entry, one conversation thread, tool calls from one identityagent_info entries, routing tool calls (e.g., transfer_to_*, delegate_to_*), sub-conversation arrays, or distinct system prompts per agent identityIf multi-agent: document each agent separately (name, role, tools, handoff triggers) and note the routing logic. The remaining steps apply per-agent.
Use a fallback chain — stop at the first hit:
system_prompt, system_message, instructions, AGENT_INSTRUCTION, SYSTEM_PROMPT in YAML/JSON/TOML/Python/JS files.format() calls that build the system message (look in agent implementation files){TRACES_FOLDER}:info.environment_info.policy (tau2-bench format)role: "system" in the messages arrayraw_data fields for system-level contentSYSTEM_PROMPT_STATUS: NOT_FOUND in the output and flag this for the orchestrator. Do not fabricate or guess.When found, record both the prompt content and its source location (file path + line, or trace field path).
Two-pass approach: source code first (ground truth), then traces (usage evidence).
Pass 1 — Source code discovery:
@tool, @is_tool, def tool_, function schema arrays, OpenAPI specs, tools=[] argumentsPass 2 — Trace usage evidence:
tool_calls[].name from assistant messagesrole: "tool" response to document actual output shapesReconcile the two passes:
Output the full tool inventory as a table with columns: Name, Category, Input Schema, Output Schema, Observed in Traces (Y/N), Unvalidated Rules.
data/*/policy.md, domain-specific docs)Trace selection — stratified sampling (do not just grab "5-10 random traces"):
{TRACES_FOLDER}. If <= 20, read ALL of them.termination_reason — include at least 2 per unique reasonFor each selected trace, document:
Write all findings to eval/stage2_domain_context.md:
# Domain Context
## Trace Format
- Framework: [detected framework name]
- Key field paths: [e.g., simulation.messages[], info.environment_info.policy]
## Architecture
- Type: [single-agent | multi-agent]
- [If multi-agent: agent roster with roles and handoff triggers]
## Agent Purpose
[1-2 sentence summary of what this agent does]
## System Prompt
- **Source**: [file path + line, or trace field path, or NOT_FOUND]
- **Status**: [verbatim | reconstructed | not_found]
[The system prompt content, or "NOT_FOUND — downstream stages should account for missing system prompt"]
## Tools
| Tool | Category | Input Schema | Output Schema | In Traces? | Unvalidated Rules |
|------|----------|-------------|---------------|------------|-------------------|
| tool_name | READ/WRITE/GENERIC | `{param: type}` | `{field: type}` | Y/N | "API does not check X" |
### Tools available but never called in traces
- [tool_name — why it matters]
## Domain Rules
[Key business rules, constraints, policies the agent must follow]
## Behavior Patterns
### Success patterns
- [pattern 1]
### Failure patterns
- [pattern 1]
### Policy violation patterns
- [violation with frequency: N/M turns]
### Error patterns
| Error | Frequency | Root cause |
|-------|-----------|------------|
| error string | N traces | cause |
### User feedback signals
- [signal 1]eval/stage2_domain_context.md© kayba-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/kayba-pipeline/stage-2-domain-context of kayba-ai/agentic-context-engine.
Open the folder on GitHubat commit 3a31983
Kayba Stage 2 Domain Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Kayba Stage 2 Domain Context this skillkayba-ai/agentic-context-engine | 2.6k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Prompt Engineering Patternswshobson/agents | 40k | — | ~1.3k | Automated safety check: Pass | MIT | |
| Lintlanghermes-labs-ai/lintlang | 140 | — | ~719 | Automated safety check: Pass | Apache-2.0 | |
| Lintlang Audithermes-labs-ai/lintlang | 140 | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Senior Prompt Engineeralirezarezvani/claude-skills | 28k | 1 repos | ~2.5k | Automated safety check: Pass | MIT | |
| Claude Cookbooks Reference2025Emma/vibe-coding-cn | 23k | 1 repos | ~2.2k | Automated safety check: Pass | MIT |
wshobson/agents
Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.
hermes-labs-ai/lintlang
A skill your agent uses when writing or reviewing AI agent configs, system prompts, or tool definitions (JSON/YAML/Python) and you need to catch ambiguous tool descriptions, missing stop conditions…
hermes-labs-ai/lintlang
Audit a named AI agent config, system prompt, tool definition, or instruction file (YAML, JSON, Markdown, text, or Python) with the released LintLang CLI in GitHub Copilot CLI.
alirezarezvani/claude-skills
A skill your agent uses when the user asks to optimize prompts, design prompt templates, evaluate LLM outputs with an eval set, measure RAG retrieval quality, validate agent/tool configurations…
2025Emma/vibe-coding-cn
Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.
Orchestra-Research/AI-Research-SKILLs
Constrains language model output with regex, selections and grammars using the Guidance library, so JSON, XML, code or formatted fields come out valid.
kayba-ai/agentic-context-engine
End-to-end agent evaluation and improvement pipeline. An agent skill from kayba-ai/agentic-context-engine.
kayba-ai/agentic-context-engine
Fetch pre-computed insights from the Kayba API and build a structured summary.
kayba-ai/agentic-context-engine
Define metrics from Kayba insights, implement them as Python measurement code, run against traces, and iterate until the metrics are clean and meaningful.
kayba-ai/agentic-context-engine
Organize computed metrics into a tiered evaluation rubric with leading, lagging, and quality indicators.
kayba-ai/agentic-context-engine
Triage each insight into discard/code-fix/prompt-fix and produce a prioritized action plan with specific recommendations.
kayba-ai/agentic-context-engine
Human-In-The-Loop gate that presents the action plan with full context, collects an informed approval/modification/rejection decision, and records the outcome.
Works with
Categories
Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces. Kayba Stage 2 Domain Context is an agent skill from kayba-ai/agentic-context-engine. Gather domain context about the repository and agent — system prompt, tool definitions, domain docs, and behavior patterns from traces.
Kayba Stage 2 Domain Context fits situations like: the user says run stage 2; invoked by the kayba-pipeline orchestrator.
Run `npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a claude-code`. Or copy the skill folder (.claude/skills/kayba-pipeline/stage-2-domain-context in kayba-ai/agentic-context-engine) into .claude/skills/kayba-stage-2-domain-context in your project. Claude Code loads it when a task matches its description.
Run `npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a codex`. Or copy the skill folder (.claude/skills/kayba-pipeline/stage-2-domain-context in kayba-ai/agentic-context-engine) into .agents/skills/kayba-stage-2-domain-context in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kayba-ai/agentic-context-engine --skill kayba-stage-2-domain-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kayba-stage-2-domain-context, .gemini/skills/kayba-stage-2-domain-context, .github/skills/kayba-stage-2-domain-context and .opencode/skills/kayba-stage-2-domain-context in your project.
SKILL.md names no scripts, command-line tools or credentials: Kayba Stage 2 Domain Context is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Kayba Stage 2 Domain Context is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Kayba Stage 2 Domain Context: Prompt Engineering Patterns (wshobson/agents, 40k stars), Lintlang (hermes-labs-ai/lintlang, 140 stars), Lintlang Audit (hermes-labs-ai/lintlang, 140 stars) and Senior Prompt Engineer (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
kayba-ai (a GitHub organization) maintains it in kayba-ai/agentic-context-engine, which has 2,590 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 24, 2026.
Source: kayba-ai/agentic-context-engine on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.