When optimizing prompts use prompt optimization analyzer

From DNYoussef/context-cascade · View interactive version

When optimizing prompts use prompt optimization analyzer is an AI agent skill from the GitHub repository DNYoussef/context-cascade. [assert|neutral] Active diagnostic tool for analyzing prompt quality, detecting anti-patterns, identifying token waste, and providing optimization recommendations [ground:given] [conf:0.95] [state:confirmed]

How to use this skill

Skill file

/============================================================================/

/* WHEN-OPTIMIZING-PROMPTS-USE-PROMPT-OPTIMIZATION-ANALYZER SKILL :: VERILINGUA x VERIX EDITION */

/============================================================================/


name: when-optimizing-prompts-use-prompt-optimization-analyzer

version: 1.0.0

description: |

[assert|neutral] Active diagnostic tool for analyzing prompt quality, detecting anti-patterns, identifying token waste, and providing optimization recommendations [ground:given] [conf:0.95] [state:confirmed]

category: foundry

tags:

author: ruv

cognitive_frame:

primary: evidential

goal_analysis:

first_order: "Execute when-optimizing-prompts-use-prompt-optimization-analyzer workflow"

second_order: "Ensure quality and consistency"

third_order: "Enable systematic foundry processes"


/----------------------------------------------------------------------------/

/* S0 META-IDENTITY */

/----------------------------------------------------------------------------/

[define|neutral] SKILL := {

name: "when-optimizing-prompts-use-prompt-optimization-analyzer",

category: "foundry",

version: "1.0.0",

layer: L1

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S1 COGNITIVE FRAME */

/----------------------------------------------------------------------------/

[define|neutral] COGNITIVE_FRAME := {

frame: "Evidential",

source: "Turkish",

force: "How do you know?"

} [ground:cognitive-science] [conf:0.92] [state:confirmed]

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

/----------------------------------------------------------------------------/

/* S2 TRIGGER CONDITIONS */

/----------------------------------------------------------------------------/

[define|neutral] TRIGGER_POSITIVE := {

keywords: ["when-optimizing-prompts-use-prompt-optimization-analyzer", "foundry", "workflow"],

context: "user needs when-optimizing-prompts-use-prompt-optimization-analyzer capability"

} [ground:given] [conf:1.0] [state:confirmed]

/----------------------------------------------------------------------------/

/* S3 CORE CONTENT */

/----------------------------------------------------------------------------/

<!-- SKILL SOP IMPROVEMENT v1.0 -->

Skill Execution Criteria

When to Use This Skill

When NOT to Use This Skill

Success Criteria

Edge Cases

handling: "Request clarification, document assumptions, proceed with explicit constraints"

handling: "Surface conflict to user, propose resolution options, document trade-offs"

handling: "Flag missing information, provide template for needed context, proceed with documented limitations"

Skill Guardrails

NEVER:

ALWAYS:

Evidence-Based Execution

self_consistency: "After completing this skill, verify output quality by [SKILL-SPECIFIC validation approach]"

program_of_thought: "Decompose this skill execution into: [SKILL-SPECIFIC sequential steps]"

plan_and_solve: "Plan: [SKILL-SPECIFIC planning phase] -> Execute: [SKILL-SPECIFIC execution phase] -> Verify: [SKILL-SPECIFIC verification phase]"

<!-- END SKILL SOP IMPROVEMENT -->

Prompt Optimization Analyzer

Kanitsal Cerceve (Evidential Frame Activation)

Kaynak dogrulama modu etkin.

Purpose: Analyze prompt quality and provide actionable optimization recommendations to reduce token waste, improve clarity, and enhance effectiveness.

When to Use This Skill

Analysis Dimensions

1. Token Efficiency Analysis

2. Anti-Pattern Detection

3. Trigger Issue Analysis

4. Structural Optimization

Execution Process

Phase 1: Token Waste Detection

# Analyze prompt for redundancy
npx claude-flow@alpha hooks pre-task --description "Analyzing prompt for token waste"

# Store original metrics
npx claude-flow@alpha memory store --key "optimization/original-tokens" --value "{
  \"total_tokens\": <count>,
  \"redundancy_score\": <0-100>,
  \"verbosity_score\": <0-100>
}"

Analysis Script:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.