Best for
- Activation Triggers
- Use Cases
- Text Prompt Enhancement
MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory/.opencode/skills/sk-prompt/SKILL.md
Prompt engineering: transforms a request into a structured, scored AI prompt via 7 frameworks, DEPTH thinking and CLEAR scoring.
Decision brief
Transforms vague or basic inputs into highly effective, structured AI prompts. Provides 7 text frameworks with automatic framework selection and CLEAR quality scoring.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory --skill ".opencode/skills/sk-prompt"Inspect the Agent Skill "sk-prompt" from https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory/blob/3d386ee21366523774d89c0aff3ebbbc8fa7ff10/.opencode/skills/sk-prompt/SKILL.md at commit 3d386ee21366523774d89c0aff3ebbbc8fa7ff10. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “Phase Detection” section in the pinned source before continuing.
Read: Load reference files from references/ directory
Use when: - Enhancing or improving an AI prompt for any purpose - Evaluating prompt quality with CLEAR scoring - Selecting the right prompt framework for a given task - Transforming vague requests into structured, effective prompts - Supporting indirect invocation from @prompt-i…
Use when: - Enhancing or improving an AI prompt for any purpose - Evaluating prompt quality with CLEAR scoring - Selecting the right prompt framework for a given task - Transforming vague requests into structured, effective prompts - Supporting indirect invocation from @prompt-i…
Transform vague requests into structured prompts using RCAF, COSTAR, RACE, CIDI, TIDD-EC, CRISPE, or CRAFT frameworks with CLEAR scoring (40+/50 threshold).
Permission review
The documentation asks the agent to read local files, directories, or repositories.
**Read**: Load reference files from references/ directoryEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 97/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 34 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Transforms vague or basic inputs into highly effective, structured AI prompts. Provides 7 text frameworks with automatic framework selection and CLEAR quality scoring.
Core Principle: Clarity, logic, expression, and reliability through structured methodology.
Use when:
@prompt-improver agent dispatches (the deep-path escalation target for CLI fast-path prompt cards)Keyword Triggers:
$improve, $text, $short, $refine, $json, $yaml$raw (skip DEPTH, fast pass-through)Transform vague requests into structured prompts using RCAF, COSTAR, RACE, CIDI, TIDD-EC, CRISPE, or CRAFT frameworks with CLEAR scoring (40+/50 threshold).
Construct a grounded, anti-default generation brief for a design-generation run. Covers the brief shape, the String Seed of Thought anti-median variation technique, pre-answering a multi-turn discovery form, and the handoff to sk-code. This skill owns the prompt only, never the measured design-reference extraction (sk-design-md-generator) or the run transport.
Skip this skill when:
The primary routing signal is the command prefix ($improve, $text, $refine, $short, $json, $yaml, $raw). When present, the prefix determines the operating mode directly. When absent, the router falls back to keyword-weighted intent scoring against the request text, selecting the top-scoring intent (or top-2 when scores are close). A zero-score fallback defaults to TEXT_ENHANCE with a disambiguation checklist.
USER REQUEST
|
+- STEP 0: Detect mode ($command prefix or keyword signals)
+- STEP 1: Score intents (top-2 when ambiguity is small)
+- Phase 1: Framework Selection (7 frameworks evaluated)
+- Phase 2: DEPTH Processing (3-10 rounds based on mode)
+- Phase 3: Scoring & Validation (CLEAR)
+- Phase 4: Output Delivery (formatted prompt)
This skill uses a simple intent router, not a keyed resource-subdirectory router. Its real resources are flat markdown files under references/ and assets/; there are no references/<key>/ or assets/<key>/ runtime-key directories to select. The router therefore discovers markdown resources recursively from references/ and assets/, then applies command-prefix and intent scoring against the discovered inventory.
references/ for DEPTH methodology, framework definitions, and CLEAR scoring.assets/ for format-specific deep-dives (Markdown, JSON, YAML).references/depth-framework.md - DEPTH methodology, RICCE integration
references/patterns-evaluation.md - 7 frameworks, CLEAR scoring
assets/format-guide-markdown.md - Markdown format deep-dive
assets/format-guide-json.md - JSON format deep-dive
assets/format-guide-yaml.md - YAML format deep-dive
| Level | When to Load | Resources |
|---|---|---|
| ALWAYS | Every skill invocation | SKILL.md (this file) |
| CONDITIONAL | If intent signals match | references/depth-framework.md, references/patterns-evaluation.md |
| CONDITIONAL | If design-generation signals match | references/patterns-evaluation.md |
| ON_DEMAND | Only on explicit request | assets/format-guide-markdown.md, assets/format-guide-json.md, assets/format-guide-yaml.md |
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets")
DEFAULT_RESOURCE = "references/depth-framework.md"
PATTERNS_RESOURCE = "references/patterns-evaluation.md"
COMMAND_INTENTS = {
"$text": "TEXT_ENHANCE",
"$improve": "TEXT_ENHANCE",
"$refine": "TEXT_ENHANCE",
"$short": "TEXT_ENHANCE",
"$json": "FORMAT_JSON",
"$yaml": "FORMAT_YAML",
"$raw": "RAW",
}
INTENT_MODEL = {
"TEXT_ENHANCE": {"keywords": [("improve", 4), ("enhance", 4), ("prompt", 3), ("text", 3), ("refine", 4)]},
"FRAMEWORK": {"keywords": [("framework", 4), ("rcaf", 5), ("costar", 5), ("tidd-ec", 5), ("scoring", 3)]},
"DESIGN_GEN": {"keywords": [("design generation", 5), ("generate ui", 4), ("canvas", 3), ("design brief", 4), ("variations", 3)]},
"FORMAT_MARKDOWN": {"keywords": [("markdown", 4), ("md", 2), ("readme", 3)]},
"FORMAT_JSON": {"keywords": [("json", 5), ("schema", 3), ("api-ready", 3)]},
"FORMAT_YAML": {"keywords": [("yaml", 5), ("frontmatter", 3), ("config", 2)]},
}
RESOURCE_MAP = {
"TEXT_ENHANCE": ["references/depth-framework.md", "references/patterns-evaluation.md"],
"FRAMEWORK": ["references/patterns-evaluation.md"],
"DESIGN_GEN": ["references/patterns-evaluation.md"],
"FORMAT_MARKDOWN": ["assets/format-guide-markdown.md", "references/patterns-evaluation.md"],
"FORMAT_JSON": ["assets/format-guide-json.md", "references/patterns-evaluation.md"],
"FORMAT_YAML": ["assets/format-guide-yaml.md", "references/patterns-evaluation.md"],
"RAW": [],
}
ON_DEMAND_KEYWORDS = ["deep dive", "full template", "all frameworks", "format guide", "overnight-agent prompt", "system prompt", "prompt package", "prompt variant", "operator prompt", "evaluator prompt", "dispatch prompt"]
UNKNOWN_FALLBACK_CHECKLIST = [
"Is this a prompt enhancement request or a different task?",
"Does the user want a specific framework applied?",
"Is the user asking about scoring or evaluation?",
"Should this route to sk-doc or sk-code instead?",
]
AMBIGUITY_DELTA = 1
def _guard_in_skill(relative_path: str) -> str:
resolved = (SKILL_ROOT / relative_path).resolve()
resolved.relative_to(SKILL_ROOT)
if resolved.suffix.lower() != ".md":
raise ValueError(f"Only markdown resources are routable: {relative_path}")
return resolved.relative_to(SKILL_ROOT).as_posix()
def discover_markdown_resources() -> set[str]:
docs = []
for base in RESOURCE_BASES:
if base.exists():
docs.extend(path for path in base.rglob("*.md") if path.is_file())
return {doc.relative_to(SKILL_ROOT).as_posix() for doc in docs}
def _task_text(task) -> str:
if isinstance(task, str):
return task.lower()
return " ".join(
str(task.get(f, "")) for f in ("text", "query", "description", "keywords")
).lower()
def detect_command_intent(task):
text = _task_text(task).strip()
for prefix, intent in COMMAND_INTENTS.items():
if text.startswith(prefix):
return intent
return None
def score_intents(task) -> dict[str, float]:
text = _task_text(task)
scores = {intent: 0 for intent in INTENT_MODEL}
for intent, cfg in INTENT_MODEL.items():
for keyword, weight in cfg["keywords"]:
if keyword in text:
scores[intent] += weight
return scores
def select_intents(task, scores, ambiguity_delta=AMBIGUITY_DELTA, max_intents=2):
command_intent = detect_command_intent(task)
if command_intent:
return (command_intent, None)
ranked = sorted(scores.items(), key=lambda pair: pair[1], reverse=True)
primary, primary_score = ranked[0]
if primary_score == 0:
return ("TEXT_ENHANCE", None)
secondary, secondary_score = ranked[1]
if secondary_score > 0 and (primary_score - secondary_score) <= ambiguity_delta:
return (primary, secondary)
return (primary, None)
def route_prompt_improver_resources(task):
inventory = discover_markdown_resources()
text = _task_text(task)
scores = score_intents(task)
command_intent = detect_command_intent(task)
primary, secondary = select_intents(task, scores)
intents = [primary] + ([secondary] if secondary else [])
loaded = []
seen = set()
def load_if_available(relative_path: str):
guarded = _guard_in_skill(relative_path)
if guarded in inventory and guarded not in seen:
load(guarded)
loaded.append(guarded)
seen.add(guarded)
# Prefixes are authoritative; RAW skips DEPTH and reference loading.
if command_intent == "RAW":
return {"intents": intents, "intent_scores": scores, "resources": loaded, "load_level": "RAW"}
# Unknown fallback: when no command prefix or keywords match at all.
if not command_intent and scores.get(primary, 0) == 0:
load_if_available(DEFAULT_RESOURCE)
return {
"intents": intents,
"intent_scores": scores,
"load_level": "UNKNOWN_FALLBACK",
"resources": loaded,
"needs_disambiguation": True,
"disambiguation_checklist": UNKNOWN_FALLBACK_CHECKLIST,
}
# Standard routing: DEPTH default + intent-mapped resources.
if primary != "FRAMEWORK":
load_if_available(DEFAULT_RESOURCE)
else:
load_if_available(PATTERNS_RESOURCE)
for intent in intents:
for relative_path in RESOURCE_MAP.get(intent, []):
load_if_available(relative_path)
# ON_DEMAND: load all mapped markdown resources when trigger keywords are present.
if any(kw in text for kw in ON_DEMAND_KEYWORDS):
for paths in RESOURCE_MAP.values():
for relative_path in paths:
load_if_available(relative_path)
return {"intents": intents, "intent_scores": scores, "resources": loaded}
Every prompt enhancement follows this pipeline:
STEP 1: Mode Detection
├─ Command prefix check ($text, $improve, $refine, $short, etc.)
├─ Keyword signal analysis (>=80% confidence = auto-route)
└─ Ambiguous? Ask ONE comprehensive question
↓
STEP 2: Framework Selection
├─ Evaluate 7 frameworks against request characteristics
├─ Score: complexity, urgency, audience, creativity, precision
└─ Select primary framework + alternative
↓
STEP 3: DEPTH Processing (5-10 rounds)
├─ Discover: 5 perspectives, assumption audit, RICCE Role & Context
├─ Engineer: Framework application, RICCE Constraints & Instructions
├─ Prototype: Template build, RICCE validation
├─ Test: Scoring (CLEAR), quality gates
└─ Harmonize: Final polish, RICCE completeness
↓
STEP 4: Scoring & Delivery
├─ Apply context-appropriate scoring system
├─ Verify threshold met (CLEAR 40+/50)
└─ Deliver enhanced prompt with transparency report
See the Smart Routing pseudocode (Section 2) for the complete routing logic.
| Mode | Command | DEPTH Rounds | Scoring | Use Case |
|---|---|---|---|---|
| Interactive | (default) | 10 | CLEAR | Guided enhancement |
| Text | $text | 10 | CLEAR | Standard text prompt |
| Short | $short | 3 | CLEAR | Quick refinement |
| Improve | $improve | 10 | CLEAR | Standard enhancement |
| Refine | $refine | 10 | CLEAR | Maximum optimization |
| JSON | $json | 10 | CLEAR | API-ready format |
| YAML | $yaml | 10 | CLEAR | Config format |
| Raw | $raw | 0 | None | Skip DEPTH |
| Complexity | Primary Need | Framework | Success Rate |
|---|---|---|---|
| 1-3 | Speed | RACE | 88% |
| 1-4 | Clarity | RCAF | 92% |
| 3-6 | Audience | COSTAR | 94% |
| 4-6 | Instructions | CIDI | 90% |
| 5-7 | Creativity | CRISPE | 87% |
| 6-8 | Precision | TIDD-EC | 93% |
| 7-10 | Comprehensive | CRAFT | 91% |
| See patterns-evaluation.md for complete framework details. | |||
| See depth-framework.md for the DEPTH methodology. |
CLEAR (50-point scale): Correctness (10) + Logic (10) + Expression (15) + Arrangement (10) + Reusability (5). Threshold: 40+.
ALWAYS ask ONE comprehensive question before processing
$raw mode skips questions entirelyALWAYS apply DEPTH processing for the detected mode
ALWAYS enforce minimum 3 perspectives during DEPTH Discover phase
ALWAYS validate with RICCE before delivery
ALWAYS apply scoring and verify threshold met
ALWAYS provide a transparency report after delivering the enhanced prompt
NEVER answer own questions
NEVER skip framework evaluation
NEVER deliver without scoring
NEVER use second-person voice in enhanced prompts
NEVER exceed context with full reference loading
ESCALATE IF mode detection confidence < 50%
ESCALATE IF CLEAR score below threshold after DEPTH
ESCALATE IF request conflicts with prompt engineering scope
@prompt-improver is the fresh-context escalation surface for this skill. The agent loads the references in this skill, applies the same framework-selection and CLEAR rules, and returns a structured block that the caller can inject into a CLI dispatch without loading the full skill inline.
| Field | Required | Description |
|---|---|---|
raw_task | Yes | Raw task description or draft prompt to improve |
task_type | No | One of generation, review, research, edit, analyze |
target_cli | No | One of claude-code, opencode, copilot |
complexity_hint | No | Integer 1-10 used to choose Quick vs Standard DEPTH energy |
constraints | No | Compliance, security, audience, or output requirements |
references/patterns-evaluation.md as the framework-selection source of truth.references/depth-framework.md for DEPTH flow and CLEAR dimension floors.CLEAR >= 40/50 and all per-dimension floors before returning success.FRAMEWORK: <name>
CLEAR_SCORE: <n>/50 (C:<n> L:<n> E:<n> A:<n> R:<n>)
RATIONALE: <1-2 lines>
ENHANCED_PROMPT: |
<multi-line ready-to-dispatch prompt>
ESCALATION_NOTES: <remaining ambiguity, risk, or follow-up>
This skill operates within the behavioral framework defined in AGENTS.md.
Key integrations:
skill_advisor.py with prompt-related intent boostersThe router discovers reference, asset, and script docs dynamically. Start with references/depth-framework.md, references/patterns-evaluation.md, assets/format-guide-json.md, assets/format-guide-markdown.md, assets/format-guide-yaml.md, then load task-specific resources from references/, templates from assets/, and automation from scripts/ when present.
Manual validation lives at manual-testing-playbook/manual-testing-playbook.md.
Related skills: sk-doc for documentation outputs, sk-code for code-generation prompt context, and the cli-* skills that use the prompt quality card before dispatch.
Frequently asked questions
Transforms vague or basic inputs into highly effective, structured AI prompts. Provides 7 text frameworks with automatic framework selection and CLEAR quality scoring.
The source record exposes this install command: npx skills add https://github.com/MichelKerkmeester/opencode--skilled-agent-loops-with-spec-kit-memory --skill ".opencode/skills/sk-prompt". Inspect the command and pinned source before running it.
Static rules flagged read-files in the source; the page lists the matching lines and excerpts.
Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing