Prompt Alchemy
Compress vague, verbose prompts into precise concept-driven instructions. Based on the insight that a well-chosen framework name activates more knowledge in an LLM than a thousand words of description.
Modes
| Command | Mode | What it does |
|---|---|---|
/alchemy | Forward (default) | Diagnose input → select strategy → output refined prompt |
/alchemy:rev | Reverse | Given a concept/framework name → show use cases, templates, boundaries |
/alchemy:deep | Deep explore | Full candidate comparison with tradeoffs |
Execution Model
Use a single isolated Agent for forward mode to protect main context. The agent receives: user intent summary + selected strategy + loaded cards + output contract. Main context only sees the final result (~200 tokens residual).
For reverse and deep modes, execute inline (no agent needed for lookups).
Forward Mode Flow
Step 1: Task Profile (internal, not displayed)
Assess 3 dimensions from user input:
goal_mode: style (tone, voice, creativity) / structure (framework, organization, logic) / truth (accuracy, evidence, constraints)ambiguity: low / mid / highdomain_sidecar: none / career / cv / knowledge
Step 2: Select Strategy + Constraints
Pick two things:
- strategy: The reasoning framework or method (e.g., "Pyramid Principle", "STAR method", "Porter's Five Forces")
- constraints: Audience + format + length + tone derived from context
Rules:
structure-dominant→ framework/theory keys preferredstyle-dominant→ persona keys allowed as overlay only, never as primary reasoning enginetruth-dominant→ no persona keys; use "concept + explicit constraints + verification"- When ambiguity is high → append 1 clarifying question OR flag the ambiguity in output
Step 3: Output
Default format (inline annotation):
🔑 [Refined prompt here]
[strategy: goal_mode → chosen_framework | not chosen: alternative (1-line reason)]
Then immediately produce the result — don't wait for confirmation.
Example:
🔑 Use STAR method to rewrite this internship experience, quantify outcomes, target risk/quant roles
[strategy: structure → STAR | not chosen: CAR (too compact, loses situational context)]
[...rewritten content follows directly...]
Step 4: Deep Mode (/alchemy:deep)
Only when explicitly requested. Show:
- Task profile (all 3 dimensions)
- 2-3 candidates with tradeoff comparison
- Hit signals and reasoning
- Full execution contract (strategy + constraints + verification)
Reverse Mode (/alchemy:rev)
Input: a concept/framework name (e.g., "费曼学习法", "Porter's Five Forces")
Output:
🔄 [Concept Name]
What it is: [2-3 sentences]
Good for:
1. [scenario + example]
2. [scenario + example]
Not good for:
1. [scenario + reason]
Prompt templates:
- [template 1]
- [template 2]
Related: [1-2 related concepts with one-line explanation]
First check .onekey/cards/ for a matching card. If found, use card data. If not, use model knowledge.
Knowledge Base
Location: Project root .onekey/
.onekey/
index.tsv # concept index (name | aliases | domain | type)
cards/ # one .md per concept, 80-180 tokens each
local/ # cv/career sidecar indexes
profile-core.md
cv-index.tsv
career-index.tsv
Loading rules:
- L1/L2 triggers: read
index.tsv→ grep match → load 1-3 relevant cards - L3 (intent heuristic): do NOT load index; rely on model knowledge only
- Sidecar: load
profile-core.md+ relevant cv/career rows only when task is career/cv related
Index is never loaded into main context permanently. Only read inside the isolated agent.
Intent Heuristic (L3 trigger — used by CLAUDE.md routing)
When no explicit /alchemy command or keyword is present, assess input using weighted signals:
Positive signals:
+3Asks to "improve/polish/make more X" without specifying a method+2Rewrite/polish/revise task type+2Has goal/effect but missing audience/format/length/tone (≥2 missing)+12+ vague adjectives ("professional", "natural", "compelling")+1Contradictory constraints ("formal but casual", "brief but thorough")+1Recent 2 turns were about expression/writing optimization
Negative signals:
-3User already specified a method/framework-3"Just do it, don't explain"-2Pure translation / summary / extraction / code fix-2All constraints already provided (audience + format + length + tone)-1"Don't ask, just write"
Short-input special case: "rewrite verb + subjective goal + missing method/audience/format" → candidate even at 15 words.
Thresholds:
≥4: Inline alchemy annotation in output (don't ask, just annotate)2-3: No annotation, no interruption (not confident enough)≤1: Normal execution
Token Budget
| Scenario | Budget |
|---|---|
| L3 inline annotation | ~200 tokens added |
| L1/L2 standard alchemy | 1,000-1,500 tokens (in agent) |
| /alchemy:deep | 2,500-4,000 tokens (in agent) |
| Main context residual | 100-200 tokens |
What This Skill Is NOT
- Not a prompt engineering tutorial (that's the
prompt-engineeringskill) - Not a writing assistant (it refines the instruction, then executes)
- Not automatic for every input (L3 only fires at score ≥4, and just annotates)