con un clic
prompt-engineering
Prompt engineering best practices - invoke with @prompt-engineering
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Prompt engineering best practices - invoke with @prompt-engineering
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
How to reuse ANY integration check's results in a feature via the universal CheckResultsService (apps/api integration-platform). Use whenever a feature needs data produced by an integration check — "show 2FA status on People", "surface AWS S3 findings in X", "reuse a check's results", "per-user/per-resource results from a connected integration", "which integrations feed task T". Read this BEFORE writing your own IntegrationCheckResult / CheckRunRepository query — don't hand-roll it.
MANDATORY for any UI work in apps/app, apps/portal, or packages/design-system — every component, page, or layout change must work on mobile (~375px), tablet (~768px), desktop (~1280px), and large desktop (~1920px) BY DEFAULT, without being asked. Read this before writing or editing any JSX/TSX that renders visible UI. Triggers on: new component, page, layout, table, toolbar, form, modal/sheet, dashboard, "build UI", "add a column", "add a filter", any styling change.
Use when building or editing frontend UI components, layouts, styling, design system usage, colors, dark mode, or icons.
The contract every new or modified API endpoint must follow so it is correct for the public OpenAPI spec, the MCP server (npm @trycompai/mcp-server), the ValidationPipe, and the docs. Triggers on "new endpoint", "add API", "new DTO", "@Body", "@RequirePermission", "MCP tool", "edit controller in apps/api", "OpenAPI", or whenever editing controllers under apps/api/src/.
Use when SDK generation failed or seeing errors. Triggers on "generation failed", "speakeasy run failed", "SDK build error", "workflow failed", "Step Failed", "why did generation fail"
Use when generating an MCP server from an OpenAPI spec with Speakeasy. Triggers on "generate MCP server", "MCP server", "Model Context Protocol", "AI assistant tools", "Claude tools", "speakeasy MCP", "mcp-typescript"
| name | prompt-engineering |
| description | Prompt engineering best practices - invoke with @prompt-engineering |
Source Cursor rule: .cursor/rules/prompt-engineering.mdc.
Original file scope: .cursor/rules/*.mdc.
Original Cursor alwaysApply: false.
Based on Claude's Prompt Engineering Documentation
Before writing prompts:
Prompt engineering is preferred because:
Principle: Provide explicit, unambiguous instructions.
❌ Bad: "Tell me about it"
✅ Good: "Summarize the following article in three bullet points, focusing on key findings"
❌ Bad: "Help with code"
✅ Good: "Debug this Python function that should return the sum of even numbers in a list"
Tips:
Principle: Show the model what you want through examples.
<examples>
<example>
<input>The movie was absolutely terrible, waste of time</input>
<output>{"sentiment": "negative", "confidence": 0.95}</output>
</example>
<example>
<input>Decent film, not great but watchable</input>
<output>{"sentiment": "neutral", "confidence": 0.7}</output>
</example>
<example>
<input>Best movie I've seen this year!</input>
<output>{"sentiment": "positive", "confidence": 0.9}</output>
</example>
</examples>
Now analyze: "The special effects were amazing but the plot was confusing"
Tips:
Principle: Encourage step-by-step reasoning for complex tasks.
<instruction>
Solve this problem step by step. Show your reasoning before giving the final answer.
</instruction>
<problem>
A train leaves Station A at 9:00 AM traveling at 60 mph. Another train leaves
Station B at 10:00 AM traveling at 80 mph toward Station A. The stations are
280 miles apart. When will the trains meet?
</problem>
<thinking>
[Let Claude work through the problem here]
</thinking>
<answer>
[Final answer after reasoning]
</answer>
Tips:
<thinking> tags to separate reasoning from outputPrinciple: Structure prompts with clear delimiters for better parsing.
<context>
You are helping debug a penetration testing tool that automates security scans.
</context>
<task>
Analyze the following error log and identify the root cause.
</task>
<error_log>
[2024-01-15 10:23:45] ERROR: Connection timeout after 30s
[2024-01-15 10:23:45] DEBUG: Target: 192.168.1.1:443
[2024-01-15 10:23:45] DEBUG: Retry attempt 3 of 3
</error_log>
<output_format>
Provide your analysis in this format:
- Root cause: [one sentence]
- Evidence: [relevant log lines]
- Recommended fix: [actionable steps]
</output_format>
Common XML Tags:
<context> - Background information<task> or <instruction> - What to do<examples> - Sample inputs/outputs<constraints> - Limitations or rules<output_format> - Expected response structure<thinking> - Reasoning section<answer> - Final responsePrinciple: Assign a persona to influence response style and expertise.
<role>
You are a senior security researcher with 15 years of experience in penetration
testing. You specialize in web application security and have discovered multiple
CVEs. You communicate findings clearly and prioritize actionable recommendations.
</role>
<task>
Review this HTTP response and identify potential security vulnerabilities.
</task>
Effective Role Elements:
Principle: Start the response to guide format and direction.
Human: List the top 3 security vulnerabilities in this code.