Skip to content

Prompting Skills

The prompt-* family designs, improves, and validates the prompts used throughout the skill system. These skills are meta-tools — they operate on prompts, not on product code.

Skill IDDescriptionModel Class
prompt-engineeringDesigns new prompts from scratch: system message, user message, output format, stop tokenscheap
prompt-chainingBuilds multi-step prompt chains where each step’s output feeds the nextcheap
prompt-refinementIteratively improves an existing prompt based on failure analysis or eval scorescheap
prompt-hierarchyDesigns a prompt hierarchy: system → instruction → user layers with clear override rulesstrong
SituationSkill(s)
Building a new AI feature’s promptprompt-engineering
Chain of thought requires multiple stepsprompt-chaining
Prompt is producing inconsistent resultsprompt-refinement
Complex multi-layer prompt systemprompt-hierarchy
  • prompt-engineering — primary consumer; all four coordinated
  • evaluate — uses prompt-refinement after eval scores reveal weaknesses
  • govern — uses prompt-hierarchy to enforce policy layers

prompt-engineering produces a full prompt specification:

system: |
You are a senior TypeScript engineer. You produce clean, typed, testable code.
Follow ESM conventions. Never use `any`. Use `zod` for runtime validation.
user_template: |
Implement a function that {{task}}.
Requirements: {{requirements}}
Constraints: {{constraints}}
output_format: typescript_fenced_codeblock
temperature: 0.2
max_tokens: 2048
stop_tokens: ["```\n\n"]
Initial prompt → eval-prompt score
prompt-refinement → identify failure mode
Modified prompt → eval-prompt re-score
Repeat until score ≥ threshold

prompt-engineering ships an internal technique catalog with a deterministic selector (src/skills/prompt/technique-catalog.ts + technique-selector.ts). These are internal modules consumed by the skill — they are not registered as public MCP tools and therefore do not appear in src/generated/graph/**.

The catalog is ported under MIT from Anselmoo/universal-creator’s skills/shared/techniques.json.

Tier 1 — First-Class (7, with worked cards)

Section titled “Tier 1 — First-Class (7, with worked cards)”

These techniques have a full worked-example card in technique-examples.ts and are the primary selection targets of the deterministic selector.

IDNameCategoryEscalates To
reactReAct (Reason + Act)agenticrag, reflexion
ragRetrieval-Augmented Generationretrievalreflexion
reflexionReflexionself-improvementmeta-prompting
tree-of-thoughtsTree of Thoughtsreasoningself-consistency
palProgram-Aided Language Modelsreasoningself-consistency
self-consistencySelf-Consistencyreasoningtree-of-thoughts
meta-promptingMeta-Promptingself-improvementreflexion

Tier 2 — Catalog-Only (5, no worked cards)

Section titled “Tier 2 — Catalog-Only (5, no worked cards)”

These techniques are present in the catalog for keyword scoring and escalation routing, but do not have worked-example cards.

IDNameCategoryEscalates To
zero-shotZero-Shot Promptingbaselinefew-shot
few-shotFew-Shot Promptingbaselinecot, reflexion
cotChain-of-Thoughtreasoningpal, self-consistency, tree-of-thoughts
prompt-chainingPrompt Chainingbaselinereact
generate-knowledgeGenerate Knowledgeretrievalrag

These techniques are documented here for completeness but are not in the catalog. Each has a specific infrastructure prerequisite that must be met before implementation.

IDNamePrerequisite
apeAutomatic Prompt EngineerRequires a prompt/example pool + evaluator to score candidate prompts at classify time
active-promptActive-PromptRequires an example pool + uncertainty-based selection (no pool available at classify time)
multimodal-cotMultimodal Chain-of-ThoughtRequires image input in baseSkillInputSchema
graph-promptingGraph PromptingRequires knowledge-graph / triple-store input
dspDecomposed Structured PromptingRequires RAG composition (decompose from orch-* skills + retrieve from RAG)
artAutomatic Reasoning and Tool-useFunctionally overlaps ReAct; deferred until a differentiating trigger exists

The selector (src/skills/prompt/technique-selector.ts) is fully deterministic — it uses keyword and signal scoring, consistent with ADR 0001: Remove Sampler Round-Trip. There is no LLM sampler involved.

Selection algorithm:

1. Extract signals from InstructionInput (request + context)
2. Score every catalog entry by keyword match count
3. Pick the highest-scoring entry as primary
4. Add up to 2 supplementary techniques from the same category
5. Attach structural requirements from primary.structureSignals
6. Build rationale string (category + score + escalation edges)
7. Set confident: false if score == 0 → unclassified
interface TechniqueSelection {
category: TechniqueCategory | "unclassified";
primary: string | null; // technique id
supplementary: string[]; // up to 2 same-category ids
structureRequirements: string[]; // from primary.structureSignals
rationale: string; // human-readable explanation
confident: boolean;
exampleRef: string | null; // worked card id, null for catalog-only
}

Each catalog entry carries escalatesTo edges pointing to higher-capability techniques within the same or an adjacent category. The selector surfaces these edges in the rationale field — they are suggestions, not automatic transitions.

zero-shot → few-shot → cot → pal / self-consistency / tree-of-thoughts
↘ reflexion
generate-knowledge → rag → reflexion → meta-prompting
prompt-chaining → react → rag / reflexion

Graph boundary: escalation edges live in catalog data and selector rationale only. Because these techniques are internal skill modules (not registered MCP tools), they do not appear in src/generated/graph/instruction-skill-edges.ts or any other generated graph file. The public tool graph reflects only registered instructions and skills.

Each first-class technique specifies 3–5 structural requirements (structureSignals) that constrain prompt shape. For example, react requires:

  • Interleave Thought → Action → Observation steps explicitly.
  • Name the tool/action namespace the model may call.
  • Require the model to stop and observe before the next action.
  • Define a termination condition (answer found or budget exhausted).

The selector passes these requirements directly to the skill as structureRequirements so the prompt author receives concrete constraints, not just a technique name.

The catalog data (technique definitions, keywords, structural signals, escalation edges, and worked-example cards) is ported under the MIT License from Anselmoo/universal-creator. See src/skills/prompt/technique-catalog.ts and src/skills/prompt/technique-examples.ts for the source headers.