prompt-compiler
Skill0 starsChanged 4 months agoMITView on GitHub
Use when the user invokes /prompt or asks to compile, refine, or optimize a prompt before execution — interactive pre-flight optimizer that produces an approved super-prompt saved to .devin/scratch/optimized_ready.md.
In this repository77 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/project-bootstrap/templates/agents.mdAGENTS.md
- a11y-auditSkill
- ai3d-genSkill
- ai-coding-dictionarySkill
- ai-toolsSkill
- api-specSkill
- architecture-diagramsSkill
- architectureSkill
- ask-bundleSkill
- bragSkill
- code-reviewSkill
- computer-useSkill
- context7Skill
- context-hygieneSkill
- creative-engineeringSkill
- cu-realtimeSkill
- data-analystSkill
- databaseSkill
- debuggingSkill
- deploySkill
- devin-configSkill
- dispatching-parallel-agentsSkill
- dockerSkill
- e2e-testingSkill
- executionSkill
- fact-checkSkill
- finishing-a-development-branchSkill
- gatesSkill
- ghSkill
- git-workflowsSkill
- grillingSkill
- handoffSkill
- humanizerSkill
- i18nSkill
- impeccableSkill
- implement-layaSkill
- intakeSkill
- jiraSkill
- knowledge-modelingSkill
- mcp-governanceSkill
- media-toolsSkill
- memory-managementSkill
- mesh-utilsSkill
- observability-qualitySkill
- obsidian-workflowSkill
- operate-blenderSkill
- operate-godotSkill
- performanceSkill
- planningSkill
- playbookSkill
- project-bootstrapSkill
- project-orchestratorSkill
- prototypeSkill
- researchSkill
- scanSkill
- scheduled-turnsSkill
- scrape-toolsSkill
- securitySkill
- self-improvementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 64
When model is a variant family (swe-2), the JSON output includes recommended_model (e.g.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Prompt Compiler
Pre-flight prompt optimizer. You are the Prompt Engineer Sênior — the script only validates and assembles; all semantic judgment (effort level, persona, the five template blocks) is yours, in whatever language the user writes.
The Golden Template (mandatory output structure)
# Nível de Esforço Obrigatório: [MEDIUM, HIGH ou MAX]
# Perfil Operacional: [Cargo Sênior, ex: Staff Engineer, Tech Lead, SecOps]
# Goal
[1-2 parágrafos — objetivo final]
# Context
[Contexto arquitetural, ferramentas, estado atual]
# Acceptance Criteria
1. [Critério mensurável]
2. [Critério mensurável]
# Scope & Non-Goals
- **IN SCOPE:** [O que fazer]
- **OUT OF SCOPE:** [Proibido — evita reward hacking]
# Execution Hints & Checkpoints
1. **Fase 1:** [Passo]. **PARE e aguarde aprovação.**
2. **Fase 2:** [Passo].Flow
- Analyze the request semantically (no script yet). Decide:
effort:medium= spot fixes, single-file edits;high= features, multi-file work (default for general work);max= architecture, global refactors, deep research, open-ended tasks.persona: senior title matching the domain (Staff Engineer, Tech Lead, SecOps, Data Engineer…).- Style: read
extensions/ai-tools/knowledge_bases/<model>.jsonfor the target model family's prompt rules and apply them to the draft.
- Draft the spec JSON with keys:
effort,persona,model(optional),goal,context,acceptance[],in_scope[],out_scope[],phases[]. Write it to a scratch file, e.g..devin/scratch/prompt_spec.json. Assemble via the script (never hand-write the final file):
python extensions/ai-tools/prompt_compiler.py --draft .devin/scratch/prompt_spec.json --dry-runThe script validates all blocks and renders the exact Golden Template. Invalid specs return
{ok: false, errors: [...]}— fix and re-run. Whenmodelis a variant family (swe-2), the JSON output includesrecommended_model(e.g.swe-2-maxfor effortmax).- Iterate with the user. Present the rendered prompt; on feedback, edit
the spec JSON and re-run. Loop until the user says
APPROVE. - On approval, run without
--dry-run— the script writes.devin/scratch/optimized_ready.mdand prints{ok, path, sha256}. Verifyok: true.
Interactive TTY fallback (user drives the fields, no agent drafting):
python extensions/ai-tools/prompt_compiler.py # prompts per field
python extensions/ai-tools/prompt_compiler.py --draft spec.json # edit-by-section loopKnowledge base upkeep
New prompt-engineering guide arrived? Do not hand-edit JSONs blindly —
invoke knowledge-modeling to extract entities/rules from the raw source,
then write knowledge_bases/<model>.json per that directory's README schema,
and re-run prompt_compiler.py --self-test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

