when-optimizing-prompts-use-prompt-architect
Comprehensive framework for analyzing, creating, and refining prompts for AI systems using evidence-based techniques
от majiayu000★ 31 звезда на GitHub
Установить when-optimizing-prompts-use-prompt-architect в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Prompt Architect - Evidence-Based Prompt Engineering
Overview
Comprehensive framework for analyzing, creating, and refining prompts for AI systems (Claude, GPT, etc.). Applies structural optimization, self-consistency patterns, and anti-pattern detection to transform prompts into highly effective versions.
When to Use This Skill
- Creating new prompts for AI systems
- Existing prompts produce poor results
- Inconsistent AI outputs
- Need to improve prompt clarity
- Applying evidence-based prompt engineering
- Optimizing agent instructions
- Building prompt libraries
Theoretical Foundation
Evidence-Based Techniques
- Chain-of-Thought (CoT): Explicit reasoning steps
- Self-Consistency: Multiple reasoning paths
- ReAct: Reasoning + Acting pattern
- Program-of-Thought: Structured logic
- Plan-and-Solve: Decomposition strategy
- Role-Playing: Persona assignment
- Few-Shot Learning: Example-based instruction
Prompt Structure Principles
[System Context] → [Role Definition] → [Task Description] →
[Constraints] → [Format Specification] → [Examples] → [Quality Criteria]
Phase 1: Analyze Current Prompt
Objective
Identify weaknesses and improvement opportunities
Agent: Researcher
Step 1.1: Structural Analysis
const promptAnalysis = {
components: {
hasSystemContext: checkForContext(prompt),
hasRoleDefinition: checkForRole(prompt),
hasTaskDescription: checkForTask(prompt),
hasConstraints: checkForConstraints(prompt),
hasFormatSpec: checkForFormat(prompt),
hasExamples: checkForExamples(prompt),
hasQualityCriteria: checkForCriteria(prompt)
},
metrics: {
length: prompt.length,
clarity: calculateClarity(prompt),
specificity: calculateSpecificity(prompt),
completeness: calculateCompleteness(prompt)
},
antiPatterns: detectAntiPatterns(prompt)
};
await memory.store('prompt-architect/analysis', promptAnalysis);
Step 1.2: Detect Anti-Patterns
const antiPatterns = [
{
name: 'Vague Instructions',
pattern: /please|try to|maybe|possibly/gi,
severity: 'HIGH',
fix: 'Use imperative commands: "Analyze...", "Generate...", "Create..."'
},
{
name: 'Missing Context',
pattern: absence of background info,
severity: 'HIGH',
fix: 'Add system context and domain information'
},
{
name: 'No Output Format',
pattern: absence of format specification,
severity: 'MEDIUM',
fix: 'Specify exact output format (JSON, markdown, etc.)'
},
{
name: 'Conflicting Instructions',
pattern: detectContradictions(prompt),
severity: 'HIGH',
fix: 'Resolve contradictions, prioritize requirements'
},
{
name: 'Implicit Assumptions',
pattern: detectImplicitAssumptions(prompt),
severity: 'MEDIUM',
fix: 'Make all assumptions explicit'
}
];
const foundAntiPatterns = antiPatterns.filter(ap =>
ap.pattern.test ? ap.pattern.test(prompt) : ap.pattern
);
await memory.store('prompt-architect/anti-patterns', foundAntiPatterns);
Step 1.3: Identify Missing Components
const missingComponents = [];
if (!promptAnalysis.components.hasSystemContext) {
missingComponents.push({
component: 'System Context',
importance: 'HIGH',
recommendation: 'Add background info, domain knowledge, constraints'
});
}
if (!promptAnalysis.components.hasExamples) {
missingComponents.push({
component: 'Examples',
importance: 'MEDIUM',
recommendation: 'Add 2-3 examples showing desired behavior'
});
}
// ... check other components
await memory.store('prompt-architect/missing', missingComponents);
Validation Criteria
- All 7 components checked
- Anti-patterns identified
- Missing components listed
- Severity assigned to issues
Hooks Integration
npx claude-flow@alpha hooks pre-task \
--description "Analyze prompt structure and quality" \
--complexity "medium"
npx claude-flow@alpha hooks post-task \
--task-id "prompt-analysis" \
--output "analysis-report.json"
Phase 2: Structure Optimization
Objective
Reorganize prompt for logical flow and clarity
Agent: Coder (Prompt Specialist)
Step 2.1: Apply Template Structure
const optimizedStructure = {
systemContext: {
domain: extractDomain(prompt),
background: generateContextualBackground(),
constraints: extractOrInferConstraints(prompt)
},
roleDefinition: {
persona: definePersona(task),
expertise: listRequiredExpertise(),
perspective: defineWorkingPerspective()
},
taskDescription: {
primary: extractPrimaryTask(prompt),
secondary: extractSecondaryTasks(prompt),
scope: defineScope(),
outOfScope: defineWhatNotToDo()
},
constraints: {
required: extractRequirements(prompt),
forbidden: extractProhibitions(prompt),
optional: extractPreferences(prompt)
},
formatSpecification: {
outputFormat: sp
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- metadata.json
FAQ
Что делает скилл when-optimizing-prompts-use-prompt-architect?
Comprehensive framework for analyzing, creating, and refining prompts for AI systems using evidence-based techniques
Как установить скилл when-optimizing-prompts-use-prompt-architect?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл when-optimizing-prompts-use-prompt-architect запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…