agentleFS
LeostrukaLeostruka/devin-bundle/skills/prompt-compiler/SKILL.md

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.

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
  1. Very specific:

    When model is a variant family (swe-2), the JSON output includes recommended_model (e.g.

    line 64

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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>.json for the target model family's prompt rules and apply them to the draft.
  2. 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.
  3. Assemble via the script (never hand-write the final file):

    python extensions/ai-tools/prompt_compiler.py --draft .devin/scratch/prompt_spec.json --dry-run

    The script validates all blocks and renders the exact Golden Template. Invalid specs return {ok: false, errors: [...]} — fix and re-run. When model is a variant family (swe-2), the JSON output includes recommended_model (e.g. swe-2-max for effort max).

  4. Iterate with the user. Present the rendered prompt; on feedback, edit the spec JSON and re-run. Loop until the user says APPROVE.
  5. On approval, run without --dry-run — the script writes .devin/scratch/optimized_ready.md and prints {ok, path, sha256}. Verify ok: 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 loop

Knowledge 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.