PromptShield

Manage and enhance prompt quality for Claude Code with a comprehensive suite of tools.

PromptShield

Prompt quality management for Claude Code

한국어 문서 (Korean)

License: MIT Version

ps_demo_02

Core Features:

  • 8-Point Quality Check (LINT / BUILD / Review / Intercept)
  • Eval Mode: A/B testing with test datasets
  • Long Context: 200K token optimization
  • Token Management: Cost estimation & context validation
  • Structured Outputs: 100% JSON validity

When to Use Which Mode?

SituationRecommendedCommand
"Is this prompt good enough?"LINT/ps:lint <prompt>
"Make this prompt better"Review/ps:r <prompt>
"Just fix it and run"Intercept/ps:a <prompt>
"Design a new prompt"BUILD/ps:build <goal>
"Compare prompt variants"EvalSee Eval Mode

Quick Start

Commands at a Glance

CommandDescriptionBest For
/ps:r <prompt>Review Mode - Show improvements, await approvalDaily use (safe)
/ps:lint <prompt>LINT Mode - Full diagnosis with test casesDebugging prompts
/ps:a <prompt>Intercept Mode - Auto-improve and execute immediatelyQuick tasks
/ps:build <goal>BUILD Mode - Design from requirementsNew prompts
/ps:help [topic]Help - Show usage guide and command referenceGetting started

Quick Example:

/ps:r Write a function to parse JSON

Shows score (3/10 → 8/10), changes, asks "Proceed? (y/n/e)"


Option 1: Plugin Install (slash commands enabled)

  1. In VS Code, type /plugin to open plugin terminal
  2. Press Tab to navigate to "Add Marketplace"
  3. Enter: joseph0926/prompt-shield
  4. Press Tab to navigate to "Install Plugin"
  5. Select ps@prompt-shield

Install Guide

Option 2: Local Plugin (development)

git clone https://github.com/joseph0926/prompt-shield
claude --plugin-dir ./prompt-shield

Option 3: Skill Only (natural language triggers)

git clone https://github.com/joseph0926/prompt-shield
cp -r prompt-shield/skills/prompt-shield ~/.claude/skills/

Note: This method only enables natural language triggers (use prompt-shield -r), not slash commands.

Usage

Slash Commands (recommended):

/ps:r your prompt here            # Review Mode (single line)
/ps:r your prompt here
with multiple lines               # Review Mode (multiline)
/ps:a your prompt here            # Intercept Mode
/ps:lint your prompt              # LINT Mode
/ps:build requirements            # BUILD Mode

Note: Triple backticks (```) are optional. Plain text and multiline input are fully supported.

Natural Language (alternative):

use prompt-shield -r Your prompt here

Real Examples

LINT Mode (Diagnose)

/ps:lint Analyze user feedback

Output: Score 3/10 → Top 3 issues → Improved prompt → 5 test cases

Review Mode (Safe Improvement)

/ps:r Write a function to parse JSON

Output:

+----------------------------------------------------------+
| Score: 3/10 -> 8/10 (+5)                                 |
+----------------------------------------------------------+
Changes:
- [+] Added: Software engineer role
- [+] Added: Error handling examples
- [~] Modified: Specified return format

Proceed? (y/n/e)

Intercept Mode (Auto-fix)

/ps:a Summarize this document

Output: Auto-improved if +2 points possible → Executes immediately

What's New in v3.x

v3.3.1 (Latest)

FeatureDescription
Examples & TOCsExpanded examples and added TOCs to long references
Structured OutputsStronger guidance for schema mismatch and JSON mode caution

v3.3.0

FeatureDescription
ps:a Token EfficiencyMinimal output: [PromptShield] 활성화됨 (X→Y점)
ps:r Intent CaptureAskUserQuestion for format/detail/constraints/goals

v3.2.0

FeatureDescription
Eval ModeA/B prompt comparison with test datasets
Long Context200K token optimization (chunking, placement)
Token ManagementCost estimation, context window validation
Structured Outputs100% JSON validity techniques

v3.0.0 - v3.1.0

FeatureDescription
Progressive LoadingSkills load on-demand
HooksAuto-LINT on prompt submit (optional)
Agents3 specialized: optimizer, reviewer, test-generator
GitHub ActionsCI/CD integration

See CHANGELOG.md for full release notes.

Modes

ModeSlash CommandNatural LanguageDescription
Review/ps:r <prompt>use prompt-shield -rShow improvements, await approval
Intercept/ps:a <prompt>use prompt-shield -aAuto-improve and execute
LINT/ps:lint <prompt>lint this promptDiagnose existing prompts
BUILD/ps:build <goal>build a prompt for...Design from requirements

8-Point Quality Check

#DimensionScoreNote
1ROLE0-2Base
2CONTEXT0-2Base
3INSTRUCTION0-2Base
4EXAMPLE0-2Base
5FORMAT0-2Base
6SUCCESS_CRITERIA0-2Base (v2.7+)
7STATE_TRACKING0-2Extended
8TOOL_USAGE0-2Extended

Base Score: Dimensions 1-6 (max 12 → normalized to 10) Extended Score: All 8 dimensions (normalized)

Documentation

Getting Started

Mode Guides

Advanced (v3.2.0)

Enterprise / Team Ops

Reference

Troubleshooting

Slash commands not working

  1. Verify plugin: In VS Code, type /plugin → check installed list
  2. Restart VS Code or reload Claude Code extension
  3. Try reinstalling: Remove plugin, then reinstall

Score seems wrong

  • Extended items (STATE_TRACKING, TOOL_USAGE) only apply to multi-step or tool-using prompts
  • If N/A, they're excluded from score calculation

Platform

  • Claude Code (CLI / VS Code extension)

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE