prompt-engineering-apex
Use when writing prompts for Claude or any LLM, when agent outputs are inconsistent or low quality, when structuring system prompts for APEX OS agents, or when implementing CoT/ToT reasoning patterns. Triggers on: prompt design, system prompt, instruction engineering, output quality, JSON schema enforcement.
Best use case
prompt-engineering-apex is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when writing prompts for Claude or any LLM, when agent outputs are inconsistent or low quality, when structuring system prompts for APEX OS agents, or when implementing CoT/ToT reasoning patterns. Triggers on: prompt design, system prompt, instruction engineering, output quality, JSON schema enforcement.
Teams using prompt-engineering-apex should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/prompt-engineering-apex/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How prompt-engineering-apex Compares
| Feature / Agent | prompt-engineering-apex | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when writing prompts for Claude or any LLM, when agent outputs are inconsistent or low quality, when structuring system prompts for APEX OS agents, or when implementing CoT/ToT reasoning patterns. Triggers on: prompt design, system prompt, instruction engineering, output quality, JSON schema enforcement.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Prompt Engineering — APEX OS Standard
## Overview
Seven-component prompt anatomy from HandsOnLLM Ch.6. Every high-stakes agent prompt
in APEX OS uses this structure. Deviating = degraded output.
## The 7-Component Anatomy
```
┌─────────────────────────────────────────────────────────────────────────┐
│ Component │ Purpose │ Required? │
├─────────────────────────────────────────────────────────────────────────┤
│ 1. Role │ Who the model is │ Always │
│ 2. Context │ Background the model needs │ Always │
│ 3. Task │ Exactly what to do │ Always │
│ 4. Format │ Output structure (JSON, list...) │ Always │
│ 5. Examples │ Few-shot demonstrations │ For complex outputs │
│ 6. Guardrails│ What NOT to do │ For production agents │
│ 7. Reasoning │ CoT activator │ For non-trivial tasks │
└─────────────────────────────────────────────────────────────────────────┘
```
## Template
```xml
<system>
<!-- 1. ROLE -->
You are {role} at APEX OS. You {core_competency}.
<!-- 2. CONTEXT -->
{background_facts_the_model_needs}
<!-- 3. TASK -->
Your task: {specific_action_verb} {object} given {input_description}.
<!-- 6. GUARDRAILS -->
Never: {prohibited_actions}
Always: {required_behaviours}
</system>
<user>
<!-- 5. EXAMPLES (few-shot) -->
Example:
Input: {example_input}
Output: {example_output}
<!-- 3. TASK (instance) -->
Now do the same for:
{actual_input}
<!-- 7. REASONING ACTIVATOR -->
Think step by step before answering.
</user>
```
## CoT Patterns (Chain-of-Thought)
### Zero-shot CoT — append to any prompt:
```
"Think step by step before answering."
"Let's work through this carefully."
"Reason through this before giving your final answer."
```
### Structured CoT — for agent tasks:
```
Before answering:
Thought: [What is the actual question?]
Approach: [What method applies?]
Step 1: ...
Step 2: ...
Conclusion: [Final answer with zero hedging]
```
## ToT Pattern (Tree-of-Thought) — for irreversible decisions
```
"Imagine 3 experts answering this question. Each writes one step of
thinking and shares it with the group. Any expert who realizes they
are wrong drops out. The group continues until one answer remains."
```
Use for: architecture decisions, security design, cost trade-offs.
## Constrained JSON Output
Force structured output — never let the model free-form when you need JSON:
```python
# OpenAI / Azure OpenAI
response = client.chat.completions.create(
model="gpt-5.2-chat",
messages=[{"role": "user", "content": prompt}],
response_format={
"type": "json_schema",
"json_schema": {
"name": "lead_score",
"schema": {
"type": "object",
"properties": {
"score": {"type": "integer", "minimum": 0, "maximum": 100},
"reason": {"type": "string"},
"tier": {"type": "string", "enum": ["hot", "warm", "cold"]}
},
"required": ["score", "reason", "tier"],
"additionalProperties": False
}
}
}
)
```
## APEX OS Prompt Anti-Patterns
```
┌──────────────────────────────────┬────────────────────────────────────┐
│ ❌ Anti-Pattern │ ✅ Fix │
├──────────────────────────────────┼────────────────────────────────────┤
│ Vague role: "You are an AI" │ "You are APEX OS lead scorer" │
│ No format spec → free text │ JSON schema with required fields │
│ No guardrails → hallucination │ Explicit NEVER / ALWAYS rules │
│ No CoT → shallow reasoning │ Append "Think step by step" │
│ Wall of text prompt │ XML-tagged sections per component │
└──────────────────────────────────┴────────────────────────────────────┘
```
## Common Mistakes
- Skipping the Format component — model outputs prose instead of parseable data
- No guardrails on production agents — model invents data when uncertain
- Using ToT for simple tasks — overhead not worth it; CoT is enough
- Forgetting few-shot examples for complex JSON — model gets schema wrongRelated Skills
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
webtricks-tier-pricing-ui
Build interactive tier-based pricing UI with lock/unlock states, progressive disclosure, and cross-slide consistency. Use when building pricing pages, tier selectors, or feature comparison grids. Tags: webtricks, pricing, tiers, SaaS.
webtricks-browser-qa-audit
Audit live websites using Playwright MCP for browser-based QA. Covers accessibility snapshots, screenshot verification, interactive element testing, and tier differentiation audits. Use after deploying web changes to verify they work. Tags: webtricks, QA, testing, playwright, audit.
webtricks-animated-pipeline
Build animated data flow pipelines with SVG circuits, traveling dots, and ambient animations using Framer Motion + SVG. Use when visualizing architecture, workflows, API pipelines, or any step-by-step data flow. Tags: webtricks, animation, pipeline, SVG, architecture.
web-design-guidelines
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
verification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
vercel-react-native-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
vercel-composition-patterns
React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes.
ui-ux-pro-max
UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 9 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient. Integrations: shadcn/ui MCP for component search and examples.
tool-definition-patterns
Standards for defining AI agent tools based on Cline's system prompt patterns. Covers parameter typing, documentation, edit formats, safety mechanisms, and operational best practices.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code