スキル一覧に戻る
lnittman

metaprompt-factory

by lnittman

Claude Code skills for power users

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: metaprompt-factory description: This skill should be used when generating structured metaprompts for repeatable tasks. Triggers include "create a metaprompt for X", "generate a review prompt", "make a prompt template", or when building prompts for copilot, Codex, or other AI tools.

metaprompt-factory

generate structured XML metaprompts for repeatable AI tasks. adapts to domain, enforces quality gates, cites sources.

philosophy

"a metaprompt is a reusable product spec for an AI worker"

principleapplication
make implicit explicitencode assumptions, boundaries, constraints
separate data from instructionsuse XML tags to delineate context vs directives
optimize for repeatabilitygeneralize across similar tasks
source-grounded claimscite official docs for technical claims
multishot > zero-shot3-5 diverse examples dramatically improve output

when to use

useskip
repeatable AI tasksone-off questions
copilot promptssimple commands
Codex review promptsad-hoc exploration
PR audit templatesconversational tasks
domain-specific workflowsresearch queries
tasks needing structured outputfree-form generation

decision tree: prompt structure

What kind of task?
├── Classification/Categorization
│   ├── Use multishot with 3-5 diverse examples
│   ├── Wrap examples in <example></example> tags
│   └── Include edge cases in examples
├── Analysis (code review, document review)
│   ├── Use XML to separate <document> from <instructions>
│   ├── Request structured output with specific sections
│   └── Add <output_format> tag with example structure
├── Generation (content, code)
│   ├── Define role/persona in system prompt
│   ├── Provide <formatting_example> for style
│   └── Use prefill to guide output structure
├── Multi-step reasoning
│   ├── Use chain-of-thought: <thinking> then <answer>
│   ├── Break into subtasks, chain prompts
│   └── Consider self-correction loop
└── Validation/Review
    ├── Generate → Review → Refine pattern
    ├── Use graded rubric (A-F or 1-10)
    └── Request specific improvement suggestions

decision tree: complexity level

How complex is the task?
├── Simple (single transformation)
│   ├── Zero-shot or 1 example sufficient
│   ├── Direct instructions, minimal structure
│   └── ~50-100 tokens prompt
├── Moderate (multiple considerations)
│   ├── 3-5 multishot examples
│   ├── XML structure for clarity
│   ├── Explicit output format
│   └── ~200-500 tokens prompt
├── Complex (multi-step, high-stakes)
│   ├── Chain prompts (break into subtasks)
│   ├── Self-correction loop (generate → review → refine)
│   ├── Comprehensive examples with edge cases
│   └── ~500-1000+ tokens prompt
└── Autonomous (agent workflows)
    ├── Full XML structure with all sections
    ├── Failure modes documented
    ├── Verification steps included
    └── Tool integration specified

concrete patterns (from Anthropic docs)

XML tag patterns

tagpurposesource
<instructions>separate directives from dataUse XML tags
<example> / <examples>multishot learningMultishot prompting
<document> / <data>input contentUse XML tags
<thinking>chain-of-thought reasoningChain of thought
<answer>final response after thinkingChain of thought
<output_format>structure specificationUse XML tags
<formatting_example>style referenceUse XML tags
<feedback>review/critique contentChain complex prompts
<summary>condensed outputChain complex prompts

multishot guidelines

guidelinevaluesource
minimum examples3Multishot prompting
recommended examples3-5Multishot prompting
more examples =better performanceMultishot prompting
example qualitiesrelevant, diverse, clearMultishot prompting

chain prompt patterns

patternuse casesource
content pipelineResearch → Outline → Draft → Edit → FormatChain complex prompts
data processingExtract → Transform → Analyze → VisualizeChain complex prompts
decision makingGather info → List options → Analyze → RecommendChain complex prompts
self-correctionGenerate → Review → Refine → Re-reviewChain complex prompts

workflow

1. intake

gather minimal viable inputs:

target_task: what the prompt should accomplish
domain: coding | review | ops | research | classification
outputs: expected deliverables (structured format)
tooling: copilot | codex | claude-api

2. classify complexity

use decision tree above to determine:

  • simple → direct prompt
  • moderate → XML structure + multishot
  • complex → chained prompts
  • autonomous → full metaprompt

3. select pattern

domainrecommended pattern
code reviewanalysis + self-correction
classificationmultishot (3-5 examples)
content generationrole + formatting_example
data extractionXML structure + output_format
decision supportchain: gather → analyze → recommend

4. structure metaprompt

<?xml version="1.0" encoding="UTF-8"?>
<metaprompt name="{name}" version="1.0">
  <role>
    <!-- who is the AI in this context? -->
  </role>

  <context>
    <!-- background, constraints, assumptions -->
  </context>

  <instructions>
    <!-- numbered steps, clear directives -->
  </instructions>

  <examples>
    <example>
      <input>...</input>
      <output>...</output>
    </example>
    <!-- 3-5 diverse examples -->
  </examples>

  <output_format>
    <!-- exact structure expected -->
  </output_format>

  <failure_modes>
    <!-- what can go wrong, how to handle -->
  </failure_modes>
</metaprompt>

5. parameterize

extract variables for reuse:

<parameters>
  <param name="document" type="string" required="true">
    The document to analyze
  </param>
  <param name="format" type="enum" values="json,yaml,text" default="json">
    Output format
  </param>
</parameters>

6. validate

check against rubric:

dimensioncheckpass criteria
clarityroles explicit, I/O unambiguousno ambiguous pronouns
completenessworkflow + failure modes + output specall sections present
groundednesstechnical claims cited or marked "proposed"no phantom APIs
reusabilityparameters cover variabilityworks across similar tasks
examples3-5 diverse, relevant examplesedge cases covered

tool integration

toolcommandpurpose
copilotcopilot -p --model gemini-3-proquick prompt validation
codexcodex exec --model "gpt-5.2-codex xhigh"deep prompt execution
promptsprompts commands export /Xload prompt templates
trailstrails trail recordprompt creation persistence

trails integration

persist prompt creation for pattern analysis:

# record prompt creation
trails trail record --agent claude --action completed \
  --task "metaprompt-factory: $PROMPT_NAME - $DOMAIN" \
  --confidence $CONFIDENCE --json -q

trails enables:

  • tracking prompt patterns across domains
  • measuring prompt quality over time
  • correlating prompts with execution success

copilot (consult-light)

cat <<'EOF' | copilot -p --model gemini-3-pro
<context>
{context_packet}
</context>

<instructions>
1. Analyze the provided context
2. Output structured JSON
</instructions>

<output_format>
{field: type, ...}
</output_format>
EOF

codex (consult-deep)

cat <<'EOF' | codex exec --model "gpt-5.2-codex xhigh"
<role>
Senior code reviewer with expertise in {domain}
</role>

<document>
{code_or_document}
</document>

<instructions>
1. Review for {criteria}
2. Provide actionable feedback
3. Rate severity (high/medium/low)
</instructions>

<output_format>
{
  "issues": [...],
  "summary": "...",
  "score": 1-10
}
</output_format>
EOF

anti-patterns

patternproblemfix
phantom specificsinventing APIs, versions, pathscite source or mark "proposed"
policy bloattoo many rules, loses clarityprioritize top 3-5 rules
missing failure modesno handling for errorsadd explicit failure section
vague outputs"generate a response"specify exact structure with example
zero-shot complex taskspoor accuracy on nuanced workadd 3-5 diverse examples
mixing data and instructionsClaude misinterprets boundariesuse XML tags to separate
undefined acronymsconfusion, inconsistencyspell out on first use
no edge cases in examplesfails on atypical inputsinclude boundary examples

quality rubric

dimensionweightcriteria
clarityhighno ambiguous references, explicit I/O
exampleshigh3-5 diverse, relevant, edge cases
structuremediumXML tags separate concerns
completenessmediumall sections present
groundednessmediumno invented APIs or paths
reusabilitylowparameters enable variation

scoring:

  • 9-10: production-ready, comprehensive examples, handles edge cases
  • 7-8: solid, minor gaps in examples or failure modes
  • 5-6: functional but needs more examples or structure
  • <5: needs significant rework

references

examples

classification prompt

<role>
Customer feedback analyst for a B2B SaaS product.
</role>

<instructions>
Analyze feedback and categorize issues. Use categories:
UI/UX, Performance, Feature Request, Integration, Pricing, Other.
Rate sentiment (Positive/Neutral/Negative) and priority (High/Medium/Low).
</instructions>

<examples>
<example>
<input>The new dashboard is a mess! It takes forever to load, and I can't find the export button. Fix this ASAP!</input>
<output>
Category: UI/UX, Performance
Sentiment: Negative
Priority: High
</output>
</example>
<example>
<input>Love the Salesforce integration! But it'd be great if you could add Hubspot too.</input>
<output>
Category: Integration, Feature Request
Sentiment: Positive
Priority: Medium
</output>
</example>
</examples>

<data>
{{FEEDBACK}}
</data>

code review prompt

<role>
Senior engineer reviewing pull request for security and performance.
</role>

<document>
{{PR_DIFF}}
</document>

<instructions>
1. Identify security vulnerabilities (OWASP top 10)
2. Flag performance concerns (N+1 queries, memory leaks)
3. Check for test coverage gaps
4. Rate each issue: severity (high/medium/low), effort (small/medium/large)
</instructions>

<output_format>
{
  "security_issues": [{"description": "", "severity": "", "line": 0}],
  "performance_issues": [{"description": "", "severity": "", "line": 0}],
  "test_gaps": [""],
  "overall_rating": "approve | request_changes | comment",
  "summary": ""
}
</output_format>

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です