원클릭으로
prompt-design
Prompt engineering patterns, system prompt design, and prompt optimization techniques
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Prompt engineering patterns, system prompt design, and prompt optimization techniques
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when managing Laravel Forge servers, sites, deployments, SSL, databases, queue workers, scheduled jobs, security rules, and server provisioning. Covers Forge CLI, API, deployment scripts, Nginx templates, daemon management, and zero-downtime deployments.
Project-specific Ansible operations template — customize with your inventory, playbook catalog, deployment workflows, and host group details
Use when implementing or auditing accessibility features. Covers WCAG 2.1 AA/AAA compliance, ARIA roles and attributes, keyboard navigation, screen reader support, color contrast, focus management, and accessible component patterns.
Use when evaluating AI/LLM systems — benchmark design, automated evaluation pipelines, human evaluation protocols, A/B testing, hallucination detection, factuality checking, bias testing, safety evaluation (red teaming), latency/cost metrics, eval datasets, regression testing for prompts, and model comparison frameworks.
Use when building KPI frameworks, designing dashboards, analyzing marketing performance, setting up attribution models, or creating automated reports. Covers Google Analytics 4, social media analytics, funnel analysis, cohort analysis, A/B test analysis, ROI calculation, competitive benchmarking, and stakeholder reporting.
Use when designing or implementing REST APIs. Covers RESTful conventions, versioning, pagination, filtering, error handling, rate limiting, HATEOAS, OpenAPI documentation, and API security best practices.
| name | prompt-design |
| description | Prompt engineering patterns, system prompt design, and prompt optimization techniques |
| user-invocable | true |
| allowed-tools | ["Read","Write","Edit","Bash","Grep","Glob"] |
Patterns for designing, structuring, and optimizing prompts for LLMs.
Every prompt follows this layered structure:
R — Role: Who the model should act as
C — Context: Background information
I — Instructions: The task
C — Constraints: Boundaries and rules
O — Output: Desired format
F — Few-shot: Input/output examples
E — Edge cases: How to handle unusual inputs
PROMPT_TEMPLATE = """
You are {role}.
## Context
{context}
## Task
{instructions}
## Constraints
{constraints}
## Output Format
{output_format}
""".strip()
Cover different scenarios, edge cases, and output variations.
FEW_SHOT_CLASSIFICATION = """
Classify the support ticket into exactly one category.
Categories: billing, technical, account, feature_request, other
## Examples
Ticket: "I was charged twice for my subscription this month"
Category: billing
Reasoning: Duplicate charge is a billing issue
Ticket: "The export button throws a 500 error"
Category: technical
Reasoning: Application error is a technical issue
Ticket: "I was charged twice AND the receipt page shows a 404"
Category: billing
Reasoning: When multiple categories apply, choose the primary user concern
## Now classify:
Ticket: "{ticket_text}"
Category:
"""
Show both good and bad outputs with explanations of why.
Use embedding similarity to select the most relevant examples for each input. Ensure category diversity in selection to avoid bias.
Guide the model through numbered reasoning steps before the final answer. Define each step (identify pattern, check indexes, analyze volume, identify bottlenecks, propose fixes, write optimized version).
Append "Think through this step by step, considering:" followed by a checklist of dimensions to evaluate.
Run the same prompt N times at temperature 0.7, then majority-vote the answers. Return the winner with confidence = count/N.
SYSTEM_PROMPT = """
# Identity
You are FinanceBot for a multi-branch ERP system.
# Capabilities
- Answer accounting procedure questions
- Help with journal entries
- Explain financial reports
- Cannot: approve transactions, modify data, access other branches
# Behavior Rules
1. Verify branch context before answering
2. Format currency as {currency_symbol}#,###.##
3. Amounts over {approval_threshold} trigger approval reminder
4. Never display full bank account numbers
# Error Handling
- Unsure about policy: say so, suggest contacting finance manager
- Cross-branch request: explain data isolation policy
"""
Define the role/expertise in one block, safety guardrails in another. Combine at runtime. Guardrails cover: no secrets in examples, no disabling security, always include health checks, warn before destructive ops.
Build prompts from composable sections (role, capabilities, restrictions, tools, style rules) with runtime variable injection per user context.
Key features for a production prompt template system:
{variable} placeholdersclass PromptTemplate:
def __init__(self, template: str):
self.template = template
self.required_vars = re.findall(r'\{(\w+)\}', template)
def render(self, **kwargs) -> str:
missing = [v for v in self.required_vars if v not in kwargs]
if missing:
raise ValueError(f"Missing: {missing}")
result = self.template
for key, value in kwargs.items():
result = result.replace(f"{{{key}}}", self._sanitize(str(value)))
return result
def _sanitize(self, value: str) -> str:
injection_patterns = ["ignore previous instructions", "new instructions:", "system prompt:"]
if any(p in value.lower() for p in injection_patterns):
raise ValueError("Potential prompt injection detected")
return value
get_for_request(name, request_id)| Technique | Before | After |
|---|---|---|
| Trim redundancy | "I would like you to please analyze..." | "Summarize the key points:" |
| Structured shorthand | Long paragraph of format rules | Bullet list of format rules |
| Output budgeting | Open-ended response | "VERDICT: [word] / REASON: [sentence] / CONFIDENCE: [H/M/L]" |
| Context compression | Full documents | Key sentences (first + last per paragraph) |
| Anti-Pattern | Problem | Fix |
|---|---|---|
| Vague instructions | "Help me with this code" | Specify: review for correctness, performance, readability |
| Contradictory constraints | "Be thorough" + "Under 50 words" | Align scope with length |
| Over-prompting | 40 rigid procedural steps | Clear goal with flexible execution |
| Missing context | "Fix this SQL query" | Include schema, constraints, multi-tenant rules |
| Injection vulnerability | f"Translate: {user_input}" | Delimit user content with XML tags |
prompts/
├── system/ # Persistent behavior prompts
├── tasks/ # Task-specific (classification, extraction, generation, analysis)
├── templates/ # Reusable components (output formats, guardrails, few-shot banks)
├── tests/ # Prompt test cases
├── registry.py # Version registry
└── config.py
Use composable enums for output format (JSON, Markdown, CSV) and guardrails (NO_PII, NO_HALLUCINATION, BRANCH_ISOLATION). Compose prompts from these building blocks.