[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-84200":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":9,"updatedAt":30,"readmeContent":31,"aiSummary":9,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":32,"discoverSource":33},84200,"prompt-refine-skill","Li-Bailiang\u002Fprompt-refine-skill","Li-Bailiang","Agent Skill that silently refines prompts for the currently running model",null,"Python",63,11,15,2,0,7,12,26,3.24,"MIT License",false,"main",true,[25,26,27,28,29],"agent-skill","agent-skills","ai-tools","prompt-engineering","prompt-refine","2026-06-12 02:04:38","\u003Cp align=\"center\">\n  \u003Ca href=\"README.md\">\u003Cb>English\u003C\u002Fb>\u003C\u002Fa> |\n  \u003Ca href=\"README.zh.md\">中文\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Ch1 align=\"center\">Prompt Refine\u003C\u002Fh1>\n\n\u003Cp align=\"center\">\n  \u003Cb>A model-aware Agent Skill that silently refines your prompt for the model currently answering.\u003C\u002Fb>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  You just ask. The active model reshapes the request for itself, preserves your language,\n  and answers without showing the rewrite.\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"LICENSE\">\n    \u003Cimg alt=\"MIT license\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green?style=for-the-badge\">\n  \u003C\u002Fa>\n  \u003Ca href=\"SKILL.md\">\n    \u003Cimg alt=\"Agent Skill\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAgent%20Skill-SKILL.md-blue?style=for-the-badge\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fprompt-refine-skill\">\n    \u003Cimg alt=\"npm version\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fprompt-refine-skill?style=for-the-badge&logo=npm&color=cb3837\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FLi-Bailiang\u002Fprompt-refine-skill\u002Fstargazers\">\n    \u003Cimg alt=\"GitHub stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FLi-Bailiang\u002Fprompt-refine-skill?style=for-the-badge&logo=github&label=stars&color=dab500\">\n  \u003C\u002Fa>\n  \u003Cimg alt=\"Zero dependencies\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdependencies-zero-lightgrey?style=for-the-badge\">\n  \u003Cimg alt=\"No optimizer call\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Foptimizer%20call-none-brightgreen?style=for-the-badge\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#project-introduction\">Project Introduction\u003C\u002Fa> |\n  \u003Ca href=\"#quick-start\">Quick Start\u003C\u002Fa> |\n  \u003Ca href=\"#feature-demonstration\">Feature Demonstration\u003C\u002Fa> |\n  \u003Ca href=\"#built-in-strategies\">Strategies\u003C\u002Fa> |\n  \u003Ca href=\"#evaluation\">Evaluation\u003C\u002Fa> |\n  \u003Ca href=\"#compatible-platforms\">Platforms\u003C\u002Fa> |\n  \u003Ca href=\"examples\u002FREADME.md\">Examples\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## Project Introduction\n\n**Prompt Refine** is a lightweight, cross-platform Agent Skill. After activation, it detects **which model is currently running the conversation** and applies that model family's prompting strategy before answering.\n\nThe core design is simple but important: **route by host model, not by task**. If Claude is answering, Prompt Refine uses the Anthropic strategy for the whole conversation. If GPT is answering, it uses the OpenAI strategy. A coding task never switches Claude into GPT-style prompting, and a writing task never switches GPT into Claude-style XML.\n\nThat makes the skill useful anywhere Agent Skills are supported: Claude Code, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot, Windsurf, CodeBuddy, and other compatible tools.\n\nIt is context-aware: follow-up requests can inherit the relevant goal, constraints, terminology, and preferences from the conversation, while the newest user instruction still wins.\n\nIt is intentionally lightweight: no runtime dependencies, no app server, no extra optimizer call, and only a short skill file plus one selected strategy file in context. The goal is better structure without spending a pile of extra tokens.\n\n## Feature Demonstration\n\nThe same user request gets a different internal shape depending on the **host model**. These examples show the hidden rewrite style; in normal mode the user only sees the final answer.\n\n### 1. Vague Request: Add The Missing Shape\n\nUser request:\n\n```text\nHelp me analyze this market.\n```\n\nAnthropic Claude shape:\n\n```xml\n\u003Crole>You are a senior market analyst specializing in competitive intelligence.\u003C\u002Frole>\n\u003Ccontext>\nThe user has not named the market, geography, customer segment, or timeframe.\nPreserve uncertainty; make practical assumptions explicit instead of inventing facts.\n\u003C\u002Fcontext>\n\u003Ctask>\nAnalyze the competitive landscape for the most likely intended market.\n\u003C\u002Ftask>\n\u003Cconstraints>\n- Start by naming assumptions about market, audience, geography, and timeframe.\n- Separate confident analysis from unknowns.\n- Do not claim current market data unless it was provided or can be verified.\n- Ask only the one or two follow-up questions that would most improve the analysis.\n\u003C\u002Fconstraints>\n\u003Cformat>\nUse these sections: Assumptions, Competitive Map, Barriers And Switching Costs,\nStrategic Implications, Unknowns, Next Questions.\n\u003C\u002Fformat>\n\u003Csuccess_criteria>\nThe answer should be useful before the user clarifies the market, while making clear\nwhich parts depend on assumptions.\n\u003C\u002Fsuccess_criteria>\n```\n\nOpenAI GPT shape:\n\n```text\nGoal: Turn an underspecified market-analysis request into a useful first-pass competitive landscape.\n\nUser request:\n\"\"\"Help me analyze this market.\"\"\"\n\nRelevant context:\n- Market, geography, audience, and timeframe are missing.\n- Preserve uncertainty and make assumptions explicit.\n\nInstructions:\n1. State the assumed market scope first.\n2. Identify likely player categories and competitive dynamics.\n3. Compare barriers, switching costs, and strategic implications.\n4. Flag unknowns instead of inventing facts.\n\nHard constraints:\n- Do not claim current market data unless it was provided or can be verified.\n- Ask only 1-2 follow-up questions.\n\nOutput format: Markdown headings for Assumptions, Competitive Map, Barriers,\nStrategic Implications, Unknowns, and Next Questions.\n```\n\n### 2. Clear Request: Preserve The Constraints\n\nUser request:\n\n```text\nWrite a 5-item npm release checklist. Keep each item under 8 words.\n```\n\nAnthropic Claude shape:\n\n```xml\n\u003Ccontext>\nThe user gave a tightly constrained formatting request. Do not expand the task.\n\u003C\u002Fcontext>\n\u003Ctask>Write exactly five npm release checklist items.\u003C\u002Ftask>\n\u003Cconstraints>\n- Each item must be under 8 words.\n- Cover package.json, README, LICENSE, version, and dry-run publishing.\n- Return checklist items only; no intro or explanation.\n\u003C\u002Fconstraints>\n\u003Cformat>Use a numbered list with one short imperative phrase per item.\u003C\u002Fformat>\n\u003Csuccess_criteria>\nExactly 5 items, each under 8 words, with all requested topics covered.\n\u003C\u002Fsuccess_criteria>\n```\n\nOpenAI GPT shape:\n\n```text\nTask: Write exactly five npm release checklist items.\n\nContext: The user already provided clear hard constraints, so preserve them and do not add scope.\n\nHard constraints:\n- Under 8 words per item.\n- Cover package.json, README, LICENSE, version, and dry-run publishing.\n- Return only the checklist.\n\nOutput contract:\n- Numbered list.\n- Exactly 5 lines.\n- No intro or outro.\n\nQuality check before answering: each item is under 8 words and covers one requested release topic.\n```\n\n### What The User Sees\n\nOnly the final answer. The rewrite stays silent unless `\u002Frefine verbose` is enabled. For clear prompts, Prompt Refine should stay minimal and protect the user's exact constraints.\n\nThe strategy always follows the **host model**, not the topic: Claude gets Claude-shaped structure, GPT gets GPT-shaped structure.\n\n## Quick Start\n\nInstall this repository into your tool's project-level skills directory. For Claude Code:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FLi-Bailiang\u002Fprompt-refine-skill.git .claude\u002Fskills\u002Fprompt-refine\n```\n\nTo avoid copying the `.git` folder, use a release archive or:\n\n```bash\nnpx degit Li-Bailiang\u002Fprompt-refine-skill .claude\u002Fskills\u002Fprompt-refine\n```\n\nThe skill is also published on npm as\n[`prompt-refine-skill`](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fprompt-refine-skill) (versioned\nreleases). npm does not auto-register an Agent Skill; use it as a versioned source and\nunpack the package into your tool's skills directory:\n\n```bash\nmkdir -p .agents\u002Fskills\u002Fprompt-refine\nnpm pack prompt-refine-skill\ntar -xzf prompt-refine-skill-*.tgz --strip-components=1 -C .agents\u002Fskills\u002Fprompt-refine\n```\n\nThe `git clone` and `degit` commands above place the files directly in your tool's skills\ndirectory.\n\nActivate it in a conversation:\n\n```text\n\u002Fprompt-refine\n```\n\nAvailable in-session controls:\n\n```text\n\u002Frefine verbose    # Show a compact original -> refined diff before each answer\n\u002Frefine off        # Stop refining for the rest of the conversation\n\u002Fprompt-refine     # Re-activate after context compaction or a new session\n```\n\n## Install Paths\n\n| Tool | Project-level skill path |\n|---|---|\n| Claude Code | `.claude\u002Fskills\u002Fprompt-refine` |\n| Cursor | `.cursor\u002Fskills\u002Fprompt-refine` or `.agents\u002Fskills\u002Fprompt-refine` |\n| OpenAI Codex | `.agents\u002Fskills\u002Fprompt-refine` |\n| Gemini CLI | `.gemini\u002Fskills\u002Fprompt-refine` or `.agents\u002Fskills\u002Fprompt-refine` |\n| GitHub Copilot (VS Code) | `.github\u002Fskills\u002Fprompt-refine` or `.agents\u002Fskills\u002Fprompt-refine` |\n| Windsurf | `.windsurf\u002Fskills\u002Fprompt-refine` |\n| CodeBuddy | `.codebuddy\u002Fskills\u002Fprompt-refine` |\n\nMost tools also accept the shared `.agents\u002Fskills\u002F` convention. User-level paths differ by platform, so use each tool's official docs when installing globally.\n\n## Built-in Strategies\n\n| Host model | Strategy file | Source family |\n|---|---|---|\n| OpenAI GPT (GPT-5 family) | `strategies\u002Fopenai.md` | OpenAI prompting guidance |\n| Anthropic Claude | `strategies\u002Fanthropic.md` | Anthropic prompt engineering |\n| Google Gemini | `strategies\u002Fgoogle-gemini.md` | Gemini prompt design |\n| Meta Llama | `strategies\u002Fmeta-llama.md` | Llama prompting guidance |\n| DeepSeek V4 (+ R1) | `strategies\u002Fdeepseek.md` | DeepSeek prompt library |\n| Mistral \u002F Codestral | `strategies\u002Fmistral.md` | Mistral best practices |\n| Qwen | `strategies\u002Fqwen.md` | Alibaba Model Studio guidance |\n| xAI Grok | `strategies\u002Fxai-grok.md` | xAI Grok prompting references |\n| Cohere Command | `strategies\u002Fcohere.md` | Cohere docs |\n| Amazon Nova | `strategies\u002Famazon-nova.md` | Nova prompt guide |\n| Microsoft Phi | `strategies\u002Fmicrosoft-phi.md` | Phi Cookbook |\n| Unknown host | `strategies\u002Funiversal.md` | Conservative fallback |\n\n## Evaluation\n\nPrompt Refine was evaluated in a blind, position-swapped A\u002FB test on **120 vague prompts** (60 English, 60 Chinese, 32 domains). The same generator model answered each prompt twice — once raw, once with Prompt Refine active — and an independent judge scored the two answers without knowing which was which. Each pair was judged twice with the answers swapped to cancel order bias.\n\n### Headline results\n\n| | Result |\n|---|---|\n| Refine vs raw win-rate | **74.0%** (167 wins \u002F 52 losses \u002F 21 ties of 240 judgments) |\n| 95% bootstrap CI (per prompt, n = 120) | **[66.9%, 80.6%]** |\n| Sign test | **p \u003C 0.0001** |\n| English \u002F Chinese split | 75.0% \u002F 72.9% |\n| Length-matched win-rate | **64.7%** (refine answer within ±25% of raw length) |\n\nThe length-matched figure is reported alongside the headline to rule out a length preference in the judge. On length-matched pairs the current release wins **64.7%**, versus **50.5%** for the previous version of the skill — evidence of a genuine quality gain, not just longer answers.\n\n### Per-dimension delta (refine − raw, 1–5 scale)\n\n| Dimension | Δ |\n|---|---|\n| actionability | **+0.96** |\n| completeness | **+0.81** |\n| structure | **+0.49** |\n| clarification | **+0.35** |\n| language fidelity | +0.03 |\n\n### Robustness\n\n| Check | Result |\n|---|---|\n| scaffold leakage (`\u003Crole>` \u002F `\u003Ctask>` \u002F rewritten prompt in output) | **0 \u002F 120** |\n| prose-language switches on Chinese prompts (code stripped) | **0 \u002F 60** |\n| parse fallbacks · skipped prompts | 0 · 0 |\n\n### Guard suite\n\nPrompt Refine also has a small non-regression suite for clear or constraint-heavy prompts:\nJSON\u002Fconfig output, word limits, language fidelity, and direct-answer tasks. On the\ncurrent 6-prompt guard suite, refine wins **66.7%** of 12 position-swapped judgments\n(8 wins \u002F 4 losses \u002F 0 ties). Treat this as an early guardrail, not a broad proof.\n\nModels: generator `claude-sonnet-4-6`, judge `claude-opus-4-8`. The host-model strategy under test is Anthropic (`strategies\u002Fanthropic.md`); other strategy files ship with the same design but have not yet been evaluated at this scale.\n\nThe evaluation harness, prompts, rubrics, anonymized answer pairs, judge JSON, run\ncommands, and checked-in result summaries are available in the GitHub repository under\n[`eval\u002F`](eval\u002F). The eval files are kept out of the npm package so normal skill\ninstallation stays lightweight.\n\n## Limitations\n\nPrompt Refine is deliberately simple, and it is honest about what it is not:\n\n- **Best-effort, not deterministic.** It refines while the activation stays in the model's\n  context. On a long, compacted conversation it can lapse until you re-run `\u002Fprompt-refine`.\n- **Depends on the host model following meta-instructions.** Models that do not reliably\n  follow \"silently restructure, then answer\" will benefit less.\n- **Only the Anthropic strategy is evaluated at scale.** The other strategy files ship with\n  the same design but have not been benchmarked equivalently (see Evaluation).\n- **Strategies track fast-moving vendor docs.** They summarize official guidance and need\n  periodic updates as that guidance changes.\n- **Little benefit on already-clear prompts.** By design the intervention can be *none* —\n  it is most useful on vague or underspecified requests.\n\n## Why Prompt Refine?\n\n| | Prompt Refine | Standalone prompt optimizers |\n|---|:---:|:---:|\n| Form | Agent Skill | Web or desktop app |\n| Model fit | Uses the currently running model's strategy | Generic or manually selected |\n| Output | Silent final answer | Shows optimized prompt |\n| Activation | Conversation-scoped and toggleable | Usually one-off |\n| Language | Preserves original language and intent | Depends on implementation |\n| Token cost | Low: short skill + one strategy | Often another full prompt pass |\n| Dependencies | None | Often app-specific |\n\n## Compatible Platforms\n\nPrompt Refine follows the `SKILL.md` Agent Skill convention and is designed for tools that can load project-level skills, including Claude Code, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot, Windsurf, CodeBuddy, and compatible agents.\n\n## License\n\nMIT License. Free to use, modify, and distribute.\n\n## Contributing\n\nIssues and pull requests are welcome. For new or improved model strategies, read [CONTRIBUTING.md](CONTRIBUTING.md) first.\n\n## Show your support\n\nIf Prompt Refine saves you time, please consider giving the repo a ⭐ — it genuinely helps\nother people discover the project.\n\n## Star History\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#Li-Bailiang\u002Fprompt-refine-skill&Date\">\n    \u003Cimg alt=\"Star History Chart\" src=\"https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=Li-Bailiang\u002Fprompt-refine-skill&type=Date&size=desktop\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n","2026-06-11 04:12:34","CREATED_QUERY"]