Refine a prompt with AgentForge
agentforge_refine_promptRefines vague coding requests into structured, agent-specific prompts by extracting requirements, filling edge cases, and running quality checks. Ideal for under-specified tasks before handing to a coding agent.
Instructions
Turn a rough, plain-language coding request into a structured, tool-tuned prompt for an AI coding agent.
AgentForge extracts the real requirements, fills in missing edge cases, formats the prompt for the target agent's conventions, and runs it through a Quality Engine before returning it. Reach for this when a request is vague or under-specified and you want a sharper prompt before handing it to a coding agent.
Args:
request (string, required): the coding task in plain language, 1-4000 chars.
target_tool (string): one of claude-code, codex, cursor, aider, continue, windsurf, kimi, generic. Default: claude-code.
style (string): plan-first, direct-edit, or explore-first. Default: plan-first.
Returns the refined prompt as text. structuredContent additionally carries: { "prompt": string, "tier": "free" | "pro", "quality": { "score": number, "max_score": number, "passed": boolean } | null, "usage": { "used_today": number, "limit": number | null } }
Errors are returned as text, e.g.:
"API key not configured" — set AGENTFORGE_API_KEY.
"invalid or revoked API key" (401) — check the key at agentforge.sciscale.org.
"daily free limit reached" (429) — upgrade to Pro for unlimited calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | The coding task or feature request, in plain language. Rough and under-specified is fine — that is exactly what gets refined. | |
| target_tool | No | The AI coding agent the prompt is formatted for. | claude-code |
| style | No | Execution style baked into the prompt: 'plan-first' plans before coding, 'direct-edit' makes the smallest change, 'explore-first' maps the codebase first. | plan-first |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The refined, tool-tuned prompt — hand this to your coding agent. | |
| tier | Yes | Account tier that produced it: 'free' or 'pro'. | |
| quality | Yes | Quality Engine score, or null if scoring was unavailable. | |
| usage | Yes | Today's usage for this account; 'limit' is null for unlimited Pro. |