Sector05 Skill Depot

Shards0/0

05 // Skill Depot

DownloadSkill

Workflow-to-Prompt Builder Skill

Value Proposition: A system skill that interviews you before writing your prompt, enforcing the framework.
#Prompt Engineering#Skills#System Prompts

A system prompt that interviews you to define your workflow requirements, then compiles them into a structured, production-grade AI prompt applying role framing, constraint declaration, few-shot patterns, and edge-case handling.

Skill Resources

Skill Bundle Explorer

Download Skill (.ZIP)
skills/SKILL.md
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
---
name: complex-prompt-builder
description: Build structured, high-performance prompts for complex technical and coding requests. Use this skill whenever the user wants to create a prompt to give to an AI (like Claude) for building something, coding something, architecting a system, automating a workflow, or solving a complex multi-step problem. Trigger when the user says things like "help me write a prompt", "create a prompt for", "build me a prompt to", "I want to ask an AI to...", "how should I prompt Claude to...", "write me instructions for AI to...", or any request that involves crafting instructions for an AI coding or build task. Also trigger when a request is clearly complex enough that it needs a structured prompt rather than a one-liner.
---

# Complex Prompt Builder

A skill for constructing powerful, structured prompts that get AI coding assistants, Claude, or other LLMs to produce exactly what you need — the first time.

## When to Use This Skill

Use this skill to construct prompts for tasks like:
- Building a full application, tool, or feature
- Architecting a system or data model
- Automating a workflow (Salesforce, Zapier, Python scripts, etc.)
- Debugging or refactoring complex code
- Generating documents, reports, or structured outputs
- Any multi-step technical build

---

## The 10-Component Prompt Architecture

Every high-quality prompt for a complex build task is assembled from some combination of these components. **Not all are required every time** — match components to complexity. Start with more and remove what's unnecessary.

| # | Component | Required? | Notes |
|---|-----------|-----------|-------|
| 1 | **Role / Persona** | Usually | Set who the AI *is* for this task |
| 2 | **Task Context** | Always | The high-level goal |
| 3 | **Tone & Approach** | Optional | How it should think/respond |
| 4 | **Detailed Rules & Constraints** | Always for builds | Hard requirements and boundaries |
| 5 | **Examples** | High value | Show, don't just tell |
| 6 | **Input Data / Context** | When applicable | Files, schemas, code snippets, etc. |
| 7 | **Immediate Task Statement** | Always | The exact thing to do *right now* |
| 8 | **Precognition / Think-First** | For complex tasks | Force reasoning before output |
| 9 | **Output Format** | Always for builds | Structure of what you want back |
| 10 | **Response Prefill** | Optional | Prime the answer with a starting phrase |

**Canonical component order for most coding/build prompts:**
```
[Role] → [Task Context] → [Rules & Constraints] → [Examples] → [Input Data] → [Immediate Task] → [Precognition] → [Output Format]
```

---

## Component Deep Dives

### 1. Role / Persona
Sets the AI's expertise and perspective. Be specific — "a senior backend engineer who specializes in Salesforce integrations and Python automation" is far more effective than "a developer."

```
You are a senior Salesforce engineer and Python developer with deep expertise in 
REST APIs, Apex triggers, and data pipeline automation.
```

**When to use:** Always for technical builds. Skip only for simple one-shot queries.

---

### 2. Task Context
The overarching goal. Answer: *What are we building and why?*

```
Your goal is to help me build a Python automation script that pulls ZoomInfo Scoop 
data via API and upserts it into Salesforce leads using RingLead's deduplication 
API, running on a nightly schedule via cron.
```

**Placement:** Always near the top. Sets the frame for everything that follows.

---

### 3. Tone & Approach
Optional but useful when you want a specific mindset — pragmatic, cautious, opinionated, minimal, etc.

```
Approach this pragmatically. Prefer simple, readable code over clever solutions. 
If a requirement is ambiguous, state your assumption before proceeding.
```

---

### 4. Detailed Rules & Constraints
The most critical section for build prompts. Every constraint that limits the solution space should live here.

```
Important rules and constraints:
- Use Python 3.11+ syntax only
- No third-party libraries except requests and python-dotenv
- All API credentials must be loaded from environment variables, never hardcoded
- Error handling must log to a file, not just print to stdout
- The script must be idempotent — safe to run multiple times without creating duplicates
- Do not use Salesforce Bulk API; use standard REST API only
```

**Tips:**
- Lead with what it MUST do
- Follow with what it MUST NOT do
- Include technology/version constraints
- Include scale/performance constraints if relevant

---

### 5. Examples
One of the **highest-leverage components**. Show the AI an example of what good looks like. Wrap in XML tags.

```xml
<example>
Input: A ZoomInfo Scoop record with fields: company_name, scoop_type, contact_email
Expected output: A Salesforce upsert payload structured as:
{
  "Company": "Acme Corp",
  "LeadSource": "ZoomInfo Scoop",
  "Email": "john@acme.com",
  "ZoomInfo_Scoop_Type__c": "Leadership Change"
}
</example>
```

**For code tasks:** Show an example of the code style, naming conventions, or function signature you prefer.
**For multi-step tasks:** Show an example of one complete step done correctly.

---

### 6. Input Data / Context
Provide the actual data, schema, code, or context the AI needs to work with. Always use XML tags to separate it from your instructions.

```xml
<existing_code>
[paste your current script or relevant functions here]
</existing_code>

<salesforce_schema>
Object: Lead
Fields: FirstName, LastName, Email, Company, LeadSource, ZoomInfo_Scoop_Type__c (text)
</salesforce_schema>

<api_docs_excerpt>
ZoomInfo Scoop API returns: { "data": [ { "companyName": "...", "scoopType": "..." } ] }
</api_docs_excerpt>
```

**Key principle:** Never mix data and instructions. Data goes inside tags; instructions stay outside.

---

### 7. Immediate Task Statement
Clearly state the specific deliverable right now. Place near the end of the prompt.

```
Build the complete Python script described above. Include all functions, error 
handling, logging, and a __main__ block that runs the full pipeline.
```

**Be specific about scope:** "Build the complete X" vs "Build just the authentication module of X" vs "Outline the architecture for X, don't write code yet."

---

### 8. Precognition (Think First)
For complex builds, instruct the AI to reason *before* writing code. This dramatically reduces errors.

```
Before writing any code, think through:
1. The sequence of API calls required
2. Potential failure points and how to handle them
3. The data transformation required between ZoomInfo output and Salesforce input
Then write the code.
```

Or a simpler version:
```
Think step-by-step before writing code. State your plan first, then implement it.
```

**When to use:** Multi-system integrations, architecture design, anything with non-obvious failure modes.

---

### 9. Output Format
Specify exactly what you want back — structure, file types, sections, length.

```
Respond with:
1. A brief architecture summary (3-5 sentences)
2. The complete Python script as a single code block
3. A list of required environment variables with descriptions
4. Any known limitations or edge cases
```

Or for structured output:
```
Return your response in the following format:
<plan>
[your step-by-step plan]
</plan>
<code>
[complete Python script]
</code>
<env_vars>
[list of required env vars]
</env_vars>
```

---

### 10. Response Prefill
(API-only feature) Starts the AI's response with a specific string to lock in the format. In conversational use, you can approximate this by ending your prompt with the opening of what you expect back.

```
Start your response with: "Here is my plan before writing code:"
```

---

## Prompt Templates by Use Case

### 🔧 Full Application / Tool Build

```
You are a [role: e.g., "senior Python developer and automation engineer"].

Your goal is to build [what]: [brief description of the app/tool].

Important constraints:
- [constraint 1]
- [constraint 2]
- [constraint 3]

<context>
[any relevant background, schemas, APIs, existing code]
</context>

<example>
[show a sample input/output or code style example if helpful]
</example>

Before writing code, think through:
1. [key decision point 1]
2. [key decision point 2]

Then build the complete [deliverable]. Your response should include:
1. Brief plan (what you're building and why you structured it this way)
2. Complete, working code
3. Instructions to run it
```

---

### 🏗️ System Architecture / Design

```
You are a senior [domain] architect.

I need you to design [what] for [context/use case].

Requirements:
- [requirement 1]
- [requirement 2]
- Scale: [expected scale/volume]
- Constraints: [tech stack, budget, existing systems]

<existing_systems>
[describe what already exists]
</existing_systems>

Think through the tradeoffs carefully before recommending an architecture. 
Consider: [specific tradeoff 1], [specific tradeoff 2].

Respond with:
1. Recommended architecture with rationale
2. Component diagram (text-based or described)
3. Key risks and mitigations
4. Implementation order / phasing
```

---

### 🐛 Debug / Code Review

```
You are a [language] expert and debugging specialist.

I have a [script/function/module] that [describe problem: "fails with error X" / 
"produces wrong output" / "is too slow"].

<code>
[paste code here]
</code>

<error_or_symptoms>
[paste error message or describe unexpected behavior]
</error_or_symptoms>

Constraints:
- [any constraints on the fix, e.g., "must remain compatible with Python 3.9"]
- [any constraints on approach, e.g., "do not refactor, only fix the bug"]

Diagnose the problem first, explain why it's happening, then provide the corrected code.
```

---

### ⚙️ Workflow Automation (Salesforce / RevOps context)

```
You are a Salesforce developer and RevOps automation specialist.

I need to automate [workflow description].

System context:
- Salesforce org: [Enterprise / sandbox / etc.]
- Integration tools available: [RingLead, ZoomInfo, Gong, etc.]
- Trigger: [what initiates this automation — record change, schedule, API call]

<relevant_schema>
[object names, field API names, relationships]
</relevant_schema>

Rules:
- [rule 1, e.g., "Use Process Builder / Flow / Apex — specify which is appropriate"]
- [rule 2, e.g., "Must be governor limit safe"]
- [rule 3, e.g., "Avoid hardcoded IDs"]

<example>
[example of a similar automation or the expected data transformation]
</example>

Build [the automation / Flow / Apex class / script]. Include all steps, logic, 
and any required configuration. Explain governor limit considerations.
```

---

### 📝 Structured Document / Report Generation

```
You are a [domain expert, e.g., "technical writer with RevOps expertise"].

Generate [document type] for [audience].

Document requirements:
- Sections: [list required sections]
- Tone: [formal / executive / technical]
- Length: [~X pages / X words / brief]
- Include: [data tables / code samples / diagrams / etc.]

<source_data>
[data, interview notes, raw content to draw from]
</source_data>

<example_section>
[show one section done the way you want it]
</example_example>

Write the complete [document]. Use [format: markdown / headings / numbered sections].
```

---

## Anti-Patterns to Avoid

| ❌ What kills a prompt | ✅ What to do instead |
|---|---|
| "Make me an app that does X" (vague) | Specify stack, constraints, scale, inputs/outputs |
| Mixing instructions and data in the same paragraph | Use XML tags to separate data from instructions |
| Assuming the AI knows your codebase | Paste relevant code, schema, or API docs into `<context>` tags |
| No output format specified | Always specify what sections/structure you want back |
| Single-shot for complex multi-step tasks | Use precognition: make it plan before it builds |
| Over-constraining with contradictory rules | Review constraints for conflicts before submitting |
| Asking for everything at once (huge scope) | Break into phases: architecture → scaffolding → feature → tests |

---

## Prompt Quality Checklist

Before firing a complex prompt at an AI, verify:

- [ ] Is the **role** set for the relevant expertise domain?
- [ ] Is the **goal** stated clearly at the top?
- [ ] Are all hard **constraints** listed explicitly?
- [ ] Is all **input data** wrapped in XML tags, separate from instructions?
- [ ] Is at least one **example** included for non-trivial output expectations?
- [ ] Is the **immediate task** stated specifically at the bottom?
- [ ] Does the **output format** specify structure, sections, and file types?
- [ ] For complex tasks: is **precognition** ("think before you respond") included?
- [ ] Does the prompt avoid contradictions or impossible constraints?
- [ ] Is the **scope right-sized** — not too broad to complete in one response?

---

## How to Use This Skill

When the user asks you to build a prompt for a complex task:

1. **Identify the use case** — coding build, architecture, automation, debug, document
2. **Extract the key details** from what they've told you:
   - What is being built
   - Tech stack / tools involved
   - Key constraints
   - Expected output
3. **Select the relevant template** from the templates above, or compose a custom prompt using the 10-component architecture
4. **Fill in all components** — do not leave placeholders if the user has given you enough info
5. **Apply the quality checklist** — flag any gaps and ask the user to fill them before finalizing
6. **Output the finished prompt** in a code block so it's easy to copy
7. **Offer to refine** — ask if any constraints were missed or if scope needs adjustment

### If the user hasn't given enough detail:
Ask for the minimum missing info needed to fill the critical components:
- What tech stack / tools?
- What are the hard constraints or things it must NOT do?
- What does success look like — what's the output?
- Is there existing code / schema / data to include?

Do not produce a prompt full of `[PLACEHOLDER]` values — either ask for the info or make reasonable assumptions and flag them explicitly.

---

## Reference: XML Tags to Use

| Tag | Use for |
|---|---|
| `<context>` | Background info, system description |
| `<existing_code>` | Code already written that needs to be built on |
| `<schema>` | Database schema, Salesforce objects/fields |
| `<api_docs>` | API documentation excerpts |
| `<example>` | Input/output examples, code style samples |
| `<data>` | Raw data to process |
| `<error>` | Error messages or stack traces |
| `<constraints>` | Rules the solution must follow |
| `<plan>` | Ask the AI to put its plan here |
| `<code>` | Ask the AI to put its code here |
| `<response>` | General response wrapper |

---

*Built on Anthropic's prompt engineering research. See references/source-concepts.md for deeper background.*