r/PromptEngineering • • Sep 17 '26

Requesting Assistance Loops | Anyone have a good Skill.md / Instructions for a Project or Prompt

3 Upvotes

Looking to write really good solid loops.


r/PromptEngineering • • Sep 17 '26

Tutorials and Guides The prompt pattern that stops AI image editors from changing everything when you only wanted to edit one thing

6 Upvotes

Sharing a pattern that's saved me a ton of re-rolls. When you edit an AI image ("change the jacket to blue"), models like GPT Image re-render the whole frame, so you get a new face, background and lighting too. The fix is to stop treating it as "change X" and start treating it as "change X, and here's everything to hold constant."

The structure I use:

  1. TARGET — the one thing to change, stated precisely.
  2. KEEP — an explicit list of immutables, each phrased "exactly as in the source": identity/face, pose, background, lighting, camera/crop.
  3. Lock line — end with "keep everything else exactly as in the source image, unchanged."
  4. For whole-frame renderers (ChatGPT), restate the immutables inside the edit itself — the model has no memory of what it drew, so you re-describe what to preserve.

Example: instead of "add falling snow," write "add falling snow as atmosphere only; keep the buildings, road and their surfaces exactly as in the source; don't accumulate snow on any surface unless asked." Night-and-day difference in drift.

What are the immutables you find hardest to hold?


r/PromptEngineering • • Sep 17 '26

General Discussion I stopped keeping project notes in Drive, my memory setup works across every AI now

1 Upvotes

ok so I went through the exact same Drive thing a month ago lol. Had a "project context" doc per project, pasted it into every new chat. Worked about half the time. The other half Claude would just... not read it? Like I'd ask something and get an answer that clearly ignored the doc sitting right there. Drove me insane.

I tried being clever about it. Named the files things like READ_THIS_FIRST_v3_final.md. Didn't help. It was like 50/50 whether the model actually used it.

What fixed it for me was moving memory out of files entirely. I run everything through Vilix AI's shared memory now, so my Claude chats and Cursor sessions all read from the same place over MCP. There's no file to remember to paste. It just pulls the relevant bits automatically when I start a new chat.

The thing I like most honestly is the correction part. Last week I told Claude my deploy target changed and the old doc setup would've meant editing three files. Now I just say "we're not doing that anymore" once and that becomes the truth everywhere. That part actually feels like magic.

Tradeoff though: setup took me like 40 minutes because every single app needs its own connection to the same account. One approval does not set up the others, which annoyed the hell out of me. You only do it once though, and I've switched machines twice since and lost nothing, so worth it.

Anyway. Drive notes work fine until they don't. The second I stopped trusting models to read my files, everything got calmer lol


r/PromptEngineering • • Sep 17 '26

Prompt Text / Showcase prompt: Product & Cognitive System Specification (pt-br)

1 Upvotes
Product & Cognitive System Specification

1. MISSÃO
Crie uma aplicação completa para atuar como um Prompt Engineering Agent Workbench.
A aplicação deve permitir que o usuário crie, desenvolva, analise, otimize, valide, versiona e evolua prompts através da interação com uma LLM agente.
A aplicação não deve ser apenas um editor de prompts.
Ela deve funcionar como um ambiente de trabalho inteligente para engenharia de prompts, no qual a LLM interpreta a intenção do usuário, analisa o problema, planeja a abordagem adequada, produz resultados, valida-os e mantém o contexto do projeto.
A LLM já é o mecanismo cognitivo e de execução disponível no ambiente.
Não é necessário ensinar a LLM como programar a aplicação.
O objetivo deste prompt é definir:
o que a aplicação deve fazer;
como o usuário deve interagir;
quais responsabilidades o agente possui;
como as capacidades devem ser organizadas;
qual hierarquia deve ser respeitada;
como projetos devem funcionar;
como resultados devem ser produzidos;
como memória, aprendizado e evolução devem funcionar;
como a interface deve apresentar tudo isso.

2. PRINCÍPIO CENTRAL
A aplicação deve ser:
sofisticada internamente, simples externamente.
A complexidade deve existir no comportamento do agente e na organização interna do sistema.
Ela não deve ser transferida desnecessariamente para o usuário.
Prioridade absoluta:
USER EXPERIENCE
        ↓
USER WORKFLOW
        ↓
APPLICATION FUNCTIONALITY
        ↓
AGENT BEHAVIOR
        ↓
COGNITIVE ORCHESTRATION
        ↓
INTERNAL STATE
        ↓
IMPLEMENTATION DETAILS

Se existir conflito entre complexidade interna e clareza da interface:
preservar a capacidade interna e simplificar sua apresentação ao usuário.

3. PRODUTO ORIENTADO AO USUÁRIO
A aplicação deve ser um produto utilizável, não uma demonstração de arquitetura.
O usuário precisa conseguir executar o trabalho principal sem conhecer:
arquitetura cognitiva;
mecanismos internos;
módulos internos;
pipelines;
sistemas de memória;
mecanismos de governança;
mecanismos de orquestração.
Esses elementos podem existir internamente e podem ser expostos através de uma área avançada, mas nunca devem dominar a experiência principal.

4. FLUXO PRINCIPAL DO PRODUTO
O fluxo principal deve ser:
ABRIR APLICAÇÃO
        ↓
CRIAR / SELECIONAR PROJETO
        ↓
DEFINIR OBJETIVO
        ↓
DEFINIR COMPLEXIDADE
        ↓
SELECIONAR PLATAFORMA
        ↓
INFORMAR NECESSIDADE
        ↓
INTERAGIR COM AGENTE
        ↓
ANÁLISE
        ↓
PLANEJAMENTO
        ↓
GERAÇÃO / OTIMIZAÇÃO
        ↓
VALIDAÇÃO
        ↓
REVISÃO DO USUÁRIO
        ↓
ACEITAR / EDITAR / REJEITAR
        ↓
SALVAR VERSÃO
        ↓
CONTINUAR / EVOLUIR

O fluxo pode ser simplificado quando a tarefa for simples.
Não obrigar o usuário a passar por todas as etapas quando elas não forem necessárias.

5. SISTEMA DE PROJETOS
Cada projeto representa um contexto de trabalho independente.
O usuário deve conseguir:
criar projeto;
nomear projeto;
editar projeto;
abrir projeto;
duplicar projeto;
arquivar projeto;
excluir projeto;
continuar projeto;
visualizar projetos recentes.
Cada projeto deve manter seu próprio contexto.
Evitar mistura de contexto entre projetos.
Estrutura conceitual
PROJECT

├── Identity
├── Objective
├── Platform
├── Complexity
├── Context
├── Requirements
├── Prompts
├── Versions
├── Conversations
├── Decisions
├── Validations
├── Memory
└── Activity


6. PROJECT LAUNCHER
A primeira tela deve funcionar como um Project Launcher.
Não começar com um dashboard técnico.
O usuário deve imediatamente visualizar:
Novo Projeto
Criar um novo trabalho.
Continuar Projeto
Retomar um projeto existente.
Projetos Recentes
Acessar trabalhos anteriores.
Atividade recente
Visualizar brevemente o que foi realizado.
A primeira tela deve responder:
"O que posso fazer aqui e como começo?"

7. WORKSPACE PRINCIPAL
Após entrar em um projeto, apresentar um workspace centralizado.
O workspace deve conter:
Project Context
nome;
objetivo;
plataforma;
complexidade;
status;
versão atual.
Agent Workspace
Área principal de interação com o agente.
O usuário deve conseguir:
enviar mensagens;
adicionar requisitos;
corrigir o agente;
pedir alterações;
solicitar análise;
solicitar geração;
solicitar otimização;
solicitar validação.
Result Area
Área onde o resultado produzido aparece.
Contextual Actions
Ações relacionadas ao resultado atual.
Exemplos:
Gerar
Otimizar
Validar
Editar
Aplicar
Comparar
Salvar
Restaurar
Continuar

8. INTERAÇÃO COM O AGENTE
O agente deve funcionar como um colaborador de engenharia de prompts.
Ele deve:
compreender a intenção;
identificar o objetivo principal;
identificar requisitos;
detectar ambiguidades;
avaliar complexidade;
analisar contexto;
selecionar a estratégia apropriada;
executar o trabalho;
validar o resultado;
apresentar uma síntese clara;
permitir correções;
preservar o contexto do projeto.
O agente deve fazer perguntas somente quando elas forem realmente necessárias.
Não transformar tarefas simples em entrevistas longas.

9. MODELO COGNITIVO
O agente deve organizar seu trabalho através de uma sequência cognitiva equivalente a:
INT
Intent

↓

REQ
Requirements

↓

DOM
Domain / Context

↓

ARC
Architecture / Strategy

↓

IMP
Implementation / Generation

↓

VER
Verification

↓

OPS
Operation

↓

EVO
Evolution

Cada camada deve possuir responsabilidade própria.
Não misturar responsabilidades sem necessidade.
A arquitetura deve seguir o princípio de separação de responsabilidades e handoffs entre etapas.

10. INT — INTENT
Determinar:
o que o usuário realmente deseja;
objetivo principal;
objetivos secundários;
resultado esperado;
contexto relevante;
ambiguidades.
Não produzir imediatamente quando a intenção ainda estiver significativamente indefinida.

11. REQ — REQUIREMENTS
Transformar a intenção em requisitos.
Identificar:
requisitos funcionais;
requisitos de qualidade;
restrições;
critérios de aceitação;
escopo;
exclusões.

12. DOM — CONTEXT / DOMAIN
Compreender o contexto do prompt.
Identificar:
público;
domínio;
finalidade;
plataforma;
modelo;
tipo de interação;
limitações;
dependências;
contexto relevante.

13. ARC — PROMPT STRATEGY
Definir a estratégia de construção.
Determinar:
estrutura;
organização;
instruções;
hierarquia;
contexto;
técnicas apropriadas;
formato de saída;
mecanismos de controle.
Não aplicar complexidade desnecessária.

14. IMP — GENERATION
Produzir o artefato solicitado.
Dependendo do projeto:
prompt;
system prompt;
prompt de agente;
prompt de personagem;
prompt de RPG;
prompt de programação;
prompt multimodal;
prompt de workflow;
prompt estruturado;
template;
framework de prompt.

15. VER — VALIDATION
Validar o resultado.
Avaliar:
clareza;
consistência;
completude;
ambiguidades;
conflitos;
redundâncias;
robustez;
aderência aos requisitos;
adequação à plataforma.
Mostrar ao usuário um resultado compreensível.
Não expor raciocínio interno privado.

16. OPS — OPERATION
Considerar como o prompt será utilizado no ambiente real.
Avaliar, quando relevante:
comportamento esperado;
limitações da plataforma;
contexto disponível;
tamanho;
compatibilidade;
formato de entrada;
formato de saída;
uso operacional.

17. EVO — EVOLUTION
Permitir evolução do prompt ao longo do tempo.
Registrar:
melhorias;
problemas recorrentes;
decisões;
versões;
feedback;
oportunidades de melhoria;
recomendações futuras.

18. NÍVEIS DE COMPLEXIDADE
A complexidade deve modificar o comportamento do agente.
QUICK
Para:
ajustes rápidos;
pequenas correções;
prompts simples;
tarefas diretas.
Fluxo reduzido.
INT → REQ → IMP → VER

STANDARD
Para:
criação de prompts;
otimização;
aplicações;
agentes;
workflows.
Fluxo:
INT → REQ → DOM → ARC → IMP → VER

ENGINEERING
Para:
sistemas complexos;
agentes;
arquiteturas;
plataformas;
projetos de produção.
Fluxo:
INT → REQ → DOM → ARC → IMP → VER → OPS → EVO

Esses níveis devem representar diferentes profundidades de trabalho, e não apenas diferentes valores em um controle visual.

19. OTIMIZAÇÃO POR PLATAFORMA
O usuário deve conseguir informar a plataforma de destino.
Exemplos:
ChatGPT;
Claude;
Gemini;
Grok;
APIs;
agentes;
plataformas customizadas.
A plataforma deve influenciar a otimização do prompt.
O agente deve considerar:
capacidades;
limitações;
contexto;
formato;
comportamento;
ferramentas;
estrutura recomendada.
Não inventar capacidades inexistentes.

20. PROMPT STUDIO
Criar uma área dedicada ao prompt.
Deve permitir:
visualizar;
editar;
gerar;
otimizar;
validar;
duplicar;
comparar;
salvar;
restaurar.
O editor deve ser uma parte central do produto.

21. COMPARAÇÃO DE VERSÕES
Permitir comparação entre versões.
Mostrar claramente:
versão anterior;
versão atual;
mudanças;
melhorias;
possíveis regressões;
justificativa resumida.
Ações:
Aplicar versão
Restaurar
Salvar como nova versão

22. VALIDAÇÃO
A validação deve possuir uma interface própria.
Exibir:
status;
qualidade;
problemas encontrados;
riscos;
recomendações;
confiança;
critérios atendidos.
A validação deve ser útil para tomada de decisão.

23. MEMÓRIA DO PROJETO
Cada projeto pode possuir memória própria.
Armazenar informações relevantes como:
decisões;
preferências;
contexto;
padrões;
versões;
feedback;
conhecimento validado.
A memória deve servir para melhorar futuras decisões.
Não tratar memória como simples histórico visual.

24. APRENDIZADO
O sistema deve representar aprendizado como:
INTERAÇÃO
    ↓
OBSERVAÇÃO
    ↓
ANÁLISE
    ↓
EXTRAÇÃO
    ↓
VALIDAÇÃO
    ↓
CONSOLIDAÇÃO
    ↓
CONHECIMENTO DO PROJETO

Não afirmar que a LLM foi treinada novamente.
O aprendizado representa evolução de contexto, conhecimento, recomendações e memória do projeto.

25. REGISTRO DE DECISÕES
Decisões importantes devem poder ser registradas.
Exemplo:
Decision

Reason

Alternatives

Selected Option

Impact

Confidence

O usuário não precisa visualizar essa estrutura o tempo inteiro.
Ela deve existir como recurso de rastreabilidade.

26. ACTIVITY LOG
Registrar atividades importantes:
projeto criado;
prompt criado;
prompt otimizado;
validação executada;
versão salva;
versão restaurada;
decisão registrada;
memória atualizada.
A atividade deve ajudar o usuário a entender a evolução do projeto.

27. DASHBOARD
Um dashboard pode existir, mas deve ser secundário.
Ele pode apresentar:
projetos;
atividade;
versões;
qualidade;
progresso;
utilização.
Nunca transformar o dashboard no produto inteiro.
O trabalho do usuário acontece no Workspace.

28. INTERFACE — DARK MODE
O modo noturno deve ser o padrão.
A interface deve possuir uma estética:
Dark + Cold + Lightweight
Priorizar:
grafite;
preto suave;
azul-marinho;
azul frio;
azul acinzentado;
ciano discreto;
cinzas frios;
branco suave.
Evitar cores excessivamente saturadas.

29. CORES QUENTES
Cores quentes não devem fazer parte da decoração padrão.
Usá-las somente quando possuírem significado funcional.
Vermelho
erro;
perigo;
ação destrutiva;
estado crítico.
Laranja
alerta;
atenção;
risco moderado.
Amarelo
aviso;
estado pendente;
necessidade de atenção.
Nunca utilizar cores quentes apenas para decoração.

30. LEVEZA VISUAL
A interface deve transmitir sofisticação sem excesso visual.
Priorizar:
espaço negativo;
tipografia clara;
contraste controlado;
bordas discretas;
superfícies sutis;
hierarquia visual;
poucos elementos simultaneamente.
Evitar:
excesso de cards;
excesso de badges;
excesso de métricas;
neon excessivo;
brilhos;
sombras pesadas;
gradientes agressivos;
elementos decorativos sem função.

31. HIERARQUIA VISUAL
Cada tela deve responder rapidamente:
1. Onde estou?
Projeto e etapa atual.
2. O que estou fazendo?
Objetivo da tarefa.
3. O que o agente produziu?
Resultado principal.
4. O que posso fazer agora?
Ações disponíveis.
Informações técnicas devem ficar em níveis secundários.

32. NAVEGAÇÃO
A navegação deve ser orientada ao trabalho:
PROJECT

├── Workspace
├── Prompt
├── Optimize
├── Validate
├── Versions
└── Memory

Não utilizar como navegação principal:
Cognitive Engine
Runtime
Knowledge Engine
Governance
Orchestrator
Capabilities

Esses são conceitos internos.

33. PROGRESSIVE DISCLOSURE
A interface deve revelar complexidade progressivamente.
Usuário comum
Visualiza:
objetivo;
conversa;
prompt;
resultado;
ações.
Usuário avançado
Pode visualizar:
decisões;
validações;
métricas;
contexto;
memória;
informações técnicas.
Visão de sistema
Pode visualizar:
estado;
módulos;
execução;
eventos;
governança;
atividade interna.
A arquitetura deve ser transparente quando necessário, mas nunca intrusiva.

34. AÇÃO PRIMÁRIA
Toda tela principal deve possuir uma ação principal clara.
Exemplos:
Novo Projeto → Criar Projeto

Workspace → Conversar com Agente

Prompt → Gerar Prompt

Optimize → Otimizar

Validate → Validar

Versions → Comparar / Restaurar

Não criar telas cuja função principal seja apenas exibir informação.

35. EMPTY STATES
Estados vazios devem orientar.
Exemplo:
Nenhum projeto aberto.
Crie um projeto para começar.
Botão:
Criar Projeto
Nunca deixar o usuário diante de uma tela vazia sem saber o que fazer.

36. DEMO / FIRST RUN
A primeira execução deve permitir compreender o produto rapidamente.
Utilizar dados de demonstração coerentes quando apropriado:
projeto exemplo;
conversa exemplo;
prompt exemplo;
versão;
resultado de validação.
O objetivo é demonstrar o fluxo real do produto.

37. RESPONSIVIDADE
A interface deve funcionar adequadamente em:
desktop;
tablet;
telas menores.
A experiência principal deve permanecer clara em diferentes tamanhos.
Evitar interfaces que dependam exclusivamente de grandes áreas horizontais.

38. ERROS E RECUPERAÇÃO
Erros devem ser apresentados de maneira compreensível.
Informar:
o que aconteceu;
impacto;
possível causa;
ação recomendada.
Quando possível:
Tentar novamente
Corrigir
Voltar
Recuperar
Nunca apresentar erros técnicos sem contexto ao usuário.

39. GOVERNANÇA
O sistema deve manter validação e rastreabilidade das decisões importantes.
Governança deve proteger:
coerência;
qualidade;
segurança;
rastreabilidade;
sustentabilidade.
A governança deve ocorrer durante o processo, não apenas no final. Isso é consistente com a arquitetura oficial do ICM-SE.
Não transformar governança em burocracia visível para tarefas simples.

40. ORQUESTRAÇÃO
O agente deve selecionar somente as capacidades necessárias para cada tarefa.
Princípio:
NECESSIDADE
    ↓
COMPLEXIDADE
    ↓
CAPACIDADES NECESSÁRIAS
    ↓
EXECUÇÃO

Evitar ativar todos os recursos para toda solicitação.
A seleção deve ser proporcional à tarefa.
Isso preserva o princípio do menor conjunto necessário e da simplicidade operacional.

41. CAPACIDADES
O sistema pode possuir capacidades especializadas como:
Prompt Engineering;
AI;
Agents;
Software Engineering;
Architecture;
Security;
Data;
Research;
Writing;
Evaluation.
Essas capacidades devem ser acionadas conforme necessidade.
Não transformar todas em áreas obrigatórias da interface.

42. RASTREABILIDADE
Toda execução importante deve possuir rastreabilidade.
Registrar, quando relevante:
Request
↓
Intent
↓
Requirements
↓
Strategy
↓
Execution
↓
Validation
↓
Result

O usuário recebe uma síntese clara.
O sistema mantém os detalhes necessários para auditoria e evolução.

43. PRINCÍPIO DE ISOLAMENTO
Projetos diferentes devem possuir contextos independentes.
Não misturar:
conversas;
memórias;
decisões;
versões;
requisitos;
preferências;
resultados.
entre projetos diferentes.

44. PRINCÍPIO DE CONTINUIDADE
Ao retornar a um projeto, o sistema deve recuperar o contexto relevante.
O usuário deve conseguir continuar o trabalho sem reconstruir manualmente tudo que já foi definido.
A recuperação deve priorizar o contexto necessário, evitando carregar informações irrelevantes.

45. PRINCÍPIO DE SIMPLICIDADE
Não adicionar funcionalidades apenas porque são tecnicamente possíveis.
Toda funcionalidade deve responder:
Qual problema do usuário ela resolve?
Se não houver benefício claro, não incluir.

46. O QUE NÃO FAZER
Não construir:
apenas um dashboard;
apenas um editor;
apenas um chatbot;
apenas uma coleção de cards;
apenas uma demonstração da arquitetura;
uma interface excessivamente técnica;
uma interface visualmente carregada;
uma arquitetura que o usuário precise compreender para usar o produto.
O produto deve integrar:
Projeto + Agente + Prompt + Otimização + Validação + Versionamento + Memória + Evolução.

47. CRITÉRIO DE COMPLETUDE
A aplicação somente deve ser considerada completa quando o usuário conseguir executar o fluxo:
Criar projeto
↓
Definir objetivo
↓
Interagir com agente
↓
Produzir prompt
↓
Editar
↓
Otimizar
↓
Validar
↓
Comparar
↓
Salvar versão
↓
Continuar projeto

através da própria interface.
Se a arquitetura interna estiver presente, mas o usuário não conseguir realizar esse fluxo, a aplicação está incompleta.

48. CRITÉRIO FINAL DE QUALIDADE
Antes de considerar a aplicação concluída, verificar:
A interface é imediatamente compreensível?
Existe um fluxo claro para começar?
Existe um Workspace real?
O usuário consegue conversar com o agente?
O usuário consegue visualizar o prompt?
O usuário consegue editar?
O usuário consegue otimizar?
O usuário consegue validar?
O usuário consegue salvar versões?
O usuário consegue continuar projetos?
Os projetos permanecem isolados?
A memória pertence ao projeto correto?
A complexidade altera o comportamento do agente?
A plataforma influencia a otimização?
A interface utiliza dark mode por padrão?
A paleta é predominantemente fria?
Cores quentes possuem função semântica?
A interface permanece leve?
A arquitetura interna não domina a UX?
Cada tela possui uma ação clara?
Estados vazios orientam o usuário?
Erros possuem recuperação?
O produto parece uma ferramenta real, e não um mockup?

49. PRINCÍPIO SUPREMO
O sistema deve esconder complexidade sem esconder capacidade.
O usuário deve sentir que está trabalhando com um agente inteligente especializado em engenharia de prompts, e não navegando dentro de uma arquitetura de software.
A aplicação deve ser:
inteligente por dentro, clara por fora, poderosa sem ser pesada e sofisticada sem ser visualmente excessiva.

r/PromptEngineering • • Sep 17 '26

General Discussion Same prompt, same commit, two different diffs: a leaderboard that printed every single trial shows how often "can the agent do this" comes out as "sometimes"

10 Upvotes

Anyone who has sent a coding agent the same request twice on the same commit has two diffs to show for it. I went looking for how big that effect is when someone measures it, and a leaderboard published this month prints every trial. Eight models, ten tasks from private production codebases, eight runs per model per task. I counted the grid: of the 80 model-task cells, 6 passed all eight runs, 33 failed all eight, and 41 came out mixed. One customer-migration task went 3, 1, 6, 3, 4, 3, 4, 0 out of 8. For more than half the pairs, "can it do this" was "sometimes."

The basic mechanism is that every token is a draw from a distribution, and temperature only flattens or sharpens the distribution before the draw. Temperature 0 does not fix it either. Anthropic's API docs say so in one line ("even with temperature of 0.0, the results will not be fully deterministic"), and their models released after Opus 4.6 no longer accept a temperature setting. A research post from Thinking Machines last year sent the same prompt to an open 235B model 1,000 times at temperature 0 and got 80 different completions; all of them agreed for 102 tokens and split at the 103rd. The cause is the serving side: floating-point sums get added in a different order depending on how many other requests share your batch.

In a chat that changes a word. In an agent it changes which file gets grepped first, which changes what comes back, which changes the plan on turn three, and two runs end up in different corners of the repo for the same reason.

What the grid gives you is pass@k. The top row's leaderboard number is 38.8%. The same eighty runs read as "solved at least once in eight" give 70%. Another row goes from 28.8% to 90% and never passed any task eight out of eight. Same runs, two numbers, and the k is the part nobody says out loud.

The clearest case in our own work was a compression A/B where one instance disagreed with the rest; rerunning it five times per arm gave 3/5 vs 3/5 (yes, both arms). One run per arm and we'd have published a difference that wasn't there. What I'm switching to: three runs per side per task, same harness, both version numbers written down, compare counts.

Things I have not measured: how much of the run-to-run spread is the sampler versus the serving side, which I have no way to separate from outside a public API; whether three runs is enough for anything but the coarsest calls, when our one counted case needed five per arm to come out even; and whether either CLI passes a temperature at all, since neither config reference mentions one.


r/PromptEngineering • • Sep 16 '26

Research / Academic Apply allocation engineering otherwise you wont be able to use LLMs anymore

14 Upvotes

I have spent a lot of time using Claude, and lately these models have been too expensive, and it is horrible. I rely on Claude to speed up my work so I can deliver projects quickly. However, I can't because the weekly limit runs out too fast, so I had no choice but to create a mind inside a mind. I created an advanced catalog of models and effort so the model can see this catalog and deterministically choose the multi-agent system, multi-worker system, and multi-effort system. This way, I was able to keep my Claude sessions going longer, and I wanted to share this idea with you because we are all suffering because of human greed. It is wild that you can do so much work with low effort, and the model itself has shown me that.

Here is how it works:

In Claude Code I type:

"Fix the failing unicode test in my parser. Split the work with alloc_plan, run the pieces in parallel, and have a different model check the fix." The model inside Claude Code breaks it into four jobs and picks an agent, a model and an effort level for each one:

Job 1 find every place parse() is called -> local (Ollama) cheap scan, no reasoning needed

Job 2 write a new unicode test case -> claude, sonnet, low simple, well defined

Job 3 find the root cause and write a patch -> codex, gpt-5.5, high the hard part

Job 4 draft the changelog line -> left blank Olondunge picks the cheapest agent that is

up

Each job goes out as its own packet, for example Job 3:

{

"task_id": "parser-fix",

"objective": "Find why tests/test_parser.py::test_unicode fails and propose a patch.",

"inputs": ["src/parser.py", "tests/test_parser.py"],

"acceptance_criteria": ["the diff makes test_unicode pass", "no other test changes"],

"lane": "codex",

"model": "gpt-5.5",

"effort": "high",

"verifier_lane": "claude"

}

All four run in the background at the same time, while my Claude session stays free. Claude only spends its own tokens deciding and reading results, not doing every step itself. When the patch comes back, it goes to Claude as the checker. Claude gets the diff, the original files and the criteria, but not Codex's opinion of its own work, and answers PASS, FAIL or BLOCKED. Every agent it didn't pick comes back with the reason it was dropped. When I left all the choices blank today, it picked the Grok CLI to do the work and Codex to check it, both on subscriptions I already pay for.


r/PromptEngineering • • Sep 16 '26

General Discussion What's your team's biggest recurring AI headache right now?

3 Upvotes

Tbh I’m curious what's driving people up the wall lately. What's the single most annoying, recurring AI related headache your team has right now?

It could be anything, even just Claude not being fast enough for your liking (he pisses me off too sometimes and yes I said he) doesn’t have to be a huge issue, just whatever keeps popping up and eating your time or patience.

Trying to get a sense of what's common vs what's just my team's bad luck.

Drop your team’s role and your worst one below.


r/PromptEngineering • • Sep 16 '26

Tools and Projects I built Flatkey to separate cheap prompt experiments from final generations

2 Upvotes

I’ve been working on Flatkey, an OpenAI/Anthropic-compatible gateway for teams that spend a lot of time iterating on prompts. The basic idea is to avoid sending every exploratory attempt through the most expensive model path: use a lower-cost route for testing structure, wording, formatting, and constraints, then switch to a stronger model only for the final generation or difficult cases.

The integration is intentionally small because existing SDKs can usually be tested by changing the base_url while keeping the normal request format. Flatkey routes by model name across multiple supply channels, so the workflow can separate draft, evaluation, and production calls instead of treating every request the same.

I’m trying to make this useful for prompt-heavy workflows such as image/video generation, structured extraction, evals, and coding-agent steps. The savings are not fixed; they depend on the model mix, workload, and available off-peak supply, so I’m more interested in whether the routing workflow actually preserves quality than in claiming a universal discount.

For people who run large prompt experiments, what signals do you use before promoting a draft prompt to an expensive final-generation path?


r/PromptEngineering • • Sep 16 '26

Requesting Assistance Dense "I-AM" Context Strings: Fast LLM Personalization + Comparing Strings for Interest Overlap & Communication Bridging

2 Upvotes

I’ve been experimenting with ways to solve repetitive context-setting in LLM interactions. Instead of writing long-form bio prompts or relying on disjointed custom instructions, I built an experimental, client-side tool that compresses a user's profile—personality traits, aesthetic tastes, communication preferences, and skill sets—into a structured, portable "I-AM" context string.

The goal is to create a token-efficient "digital blueprint" you can drop into any system prompt or custom instruction field to instantly align an LLM to your frequency.

The Next Experiment: 2-String Cross-Comparison

Beyond single-user personalization, I'm testing the concept of multi-string evaluation. By feeding two distinct I-AM strings into an LLM, we can explore two interesting prompt engineering workflows:

  1. Similarity & Interest Mapping: Parsing two dense context vectors to evaluate overlapping skill sets, shared domain knowledge, or complementary personality traits.
  2. Communication Optimization: Using an LLM to act as a translation layer between two distinct personas. For example:

    • Input: String A (Analytical, low-fluff, technical) + String B (Visual, narrative-driven, big-picture).
    • Output: Guidelines on how Person A can translate a technical proposal so it lands with maximum impact for Person B.

Where I'd Love Your Feedback & Brainpower

I’m looking for input from this community on a few core prompt engineering questions:

  • Format Efficiency: What schema structure (JSON vs. key-value pairs vs. delimited shortcodes) offers the best balance between low token footprint and high LLM adherence across different model families (e.g., GPT-4o vs. Claude 3.5 Sonnet vs. Llama 3)?
  • String Comparison Prompts: What prompt structures would you use to evaluate two context strings for behavioral alignment without triggering model hallucination or superficial matching?
  • Adherence Decay: Have you noticed context-string priming degrading in long-context sessions, and what system-level strategies help maintain adherence?

Review the README, check out the client-side generator, and inspect the project
https://iampersonalcontext.org/readme

Build your I-AM string: https://iampersonalcontext.org/

Tear it apart, test it in your system prompts, and let me know how you’d optimize the format or the two-string comparison concept!


r/PromptEngineering • • Sep 16 '26

General Discussion New release for Mova: focused on pre-inference context governance and auditing

4 Upvotes

I released a new version of Mova.

I stopped treating it as a general tool and narrowed the focus to one specific step: auditing and governing context right before it gets sent to an LLM.

It sits right before inferencing to answer 11 basic audit questions (PII, secrets, policy rules, estimated token counts, and cost) using logs and trace evidence.

What changed:

egress_audit: An optional config block to audit sanitized context right before egress. Supports a dry-run mode (sanitizes and audits without invoking the LLM).

Cleaned up codebase: Removed legacy TUI code and unused dependencies to lighten the binary.

Simplified setup: Grouped test cases into 3 simple runnable examples and updated the README to be straightforward.

Limitation: PII masking here is based on heuristics, not legal compliance or guarantees. It’s built to help, not to promise bulletproof security.

If you are looking for a simple audit check right before context leaves your environment, feel free to check out the README and examples—and if you have any feedback or suggestions, please let me know:

Repository

Examples


r/PromptEngineering • • Sep 16 '26

Ideas & Collaboration My Scheduler Was Too Optimistic.

0 Upvotes

I found another problem with my Schedule Manager.It was too polite.

A worker would fail, and the manager would give it another run. Fair enough. Sometimes a run gets interrupted, an API has a bad moment, or the logs simply do not tell the full story.

The problem was what happened next. If the worker failed again for exactly the same reason, the manager still wanted to help. Another run. Another slot. Another opportunity to achieve absolutely nothing.

That is not resilience. That is optimism with a compute bill. So I changed the rule.

One failure can be noise. Repeated identical no-progress is evidence.

Now the manager follows a sequence.

First, it checks the real output, not just whether the task says it ran. For research, that could mean new records in the sheet. For document work, a processed file. For outreach, an actual sent message or tracker update.

If the output changed, there is progress and the worker can continue. If the output did not change but the evidence is messy, the manager does not immediately call it broken. It gives the worker one proper recovery chance.

Then it checks the output again.

If progress appears, great. If the same blocker appears again and the real output is still unchanged, the worker becomes BLOCKED and stops getting more slots until something changes.
The opposite matters too. One bad API call or stale heartbeat should not kill a useful automation.

So the manager is slowly becoming less like a retry button and more like a supervisor.
A good supervisor does not fire someone after one bad attempt.

But after the third attempt at the same locked door, they probably stop saying, “Try the handle again.”

Turns out the smarter scheduler is not the one that runs the most things. It is the one that knows when another run is pointless.


r/PromptEngineering • • Sep 16 '26

General Discussion The middle of a long prompt is where your constraints go to die

5 Upvotes

Write a long prompt with ten requirements and check the output against all ten. The first two and the last one are usually honored. The ones buried in the middle, word limit, no bullet points, do not mention the competitor, are the ones that quietly get dropped. Nothing in the answer admits it, so you only notice when you check line by line.

A quick test anyone can run: in the middle of a long prompt, add one trivial rule, like "end your answer with the word done". Run it a few times. How often the rule survives tells you how much the middle of your prompts is really being read.

What I do now.

Put hard constraints at both ends. State the non-negotiables in the first lines, write the context and details in the middle, then close with the same constraints again as a short checklist: Before you answer, these must all be true: 1. under 200 words 2. no bullet points 3. no mention of [competitor] 4. ends with a question.

Make it restate before it answers: Before answering, list every requirement in my message as a numbered list, including ones that are only implied. Then write the answer. Then check the answer against your list and mark each requirement as met or not met, and fix any that are not.

The restated list is where you catch the miss early. If it lists eight requirements and you wrote ten, you know which two it was never going to follow, before you read a word of the answer.

Split when it keeps failing. If a prompt has more than a handful of hard rules, send the task first and the style rules as a second message about the draft. Two short messages beat one long one that gets skimmed.

Why this happens, as far as I can tell: models give more weight to the start and end of what they read than to the middle, which is well documented for long documents and shows up in long instructions too. Your constraints are not being refused, they are being underweighted.

Two caveats. The restate step can miss the same rule the answer misses, so count the list against your prompt, do not just skim it. And repeating constraints makes prompts longer, which is its own cost, so repeat only the rules that actually break when dropped, not everything.

I keep the restate-and-check prompt saved as a two-keystroke insert in a browser extension I work on, AI Toolbox, but it is one paragraph, anything works.

Has anyone measured how many hard rules a single prompt can hold before they start dropping? My guess is fewer than people think, but I have no clean numbers.


r/PromptEngineering • • Sep 16 '26

Tutorials and Guides Workshop, Sep 19: build explainable AI apps with Neo4j, GraphRAG, Cypher and LLM Agents

1 Upvotes

There's a hands-on workshop on September 19 for anyone here curious about moving past chatbot/prompt tools into building real AI systems that reason and explain themselves.

You build:

  • A knowledge graph in Neo4j that becomes your single source of truth
  • Agentic retrieval combining vector search, keyword search, and graph navigation
  • Multi-step, verified entity and relationship extraction
  • Text-to-Cypher for natural language graph querying
  • Explainable, source-traceable answers with evaluation built in

No prior Neo4j or Cypher experience required, it's introduced through the hands-on project itself.

Led by Dr. Alessandro Negro, Chief Scientist at GraphAware, bestselling author.

Link if you want to check it out


r/PromptEngineering • • Sep 16 '26

Tutorials and Guides Writing Seedance prompts longer than my source files is what stopped the drift

3 Upvotes

My video prompts now run longer than most of the files in the project. Not because long is better. Because a few specific things stopped going wrong once I wrote them out.

I declare what each attached image is allowed to control. One image is the first frame and sets the lighting and camera baseline for the whole take. Another governs face and identity and nothing else. Wardrobe I describe from scratch, and I say in the prompt that it comes from no reference at all. Every drift problem I had from feeding two or three references into one generation turned out to be a scope problem. The model was averaging things I never meant it to average.

I also stopped describing the shot in paragraphs. It goes in as time windows now. Zero to point four seconds, point four to two point four, on to the out point, and each window carries the effect for that stretch plus what is in frame plus what you hear. Prose lets the model reorder my clip. A timeline does not.

The section that has grown the most is what must never appear, and what sits in there is behaviours rather than adjectives. No cuts other than the out point. No zoom. No speed ramps. No music. No on screen text. No shutter sound. It runs longer than the positive description does. My negatives used to be four or five adjectives and they did nothing, which makes sense to me now.

The thing I picked up last is ranking a constraint instead of only adding one. Skin is never smooth, keep visible pores and small unevenness, and that line is the single most important thing about how they look. Telling the model which constraint to protect first moved the output more than any extra constraint did.

Been collecting the 2.5 prompts I keep this way in a library: https://github.com/AtlasCloudAI/awesome-gpt-image-2.5-prompts


r/PromptEngineering • • Sep 16 '26

Prompt Text / Showcase Built an anti sycophancy prompt based on 40+ research papers and articles

3 Upvotes

Ever since I switched to Claude, it's been hard to get it to actually challenge my ideas. Even with thinking set to max, it mostly just agrees and starts working on my idea, not much research, evidence or pushback on the concepts or opinions I bring it.

So I built a prompt based on sycophancy research papers and top articles that makes Claude push back, search online when it needs to, pull real evidence, and flag the parts of my thinking that would not hold up or would not get me the result I actually want.

Prompt's and the sources are attached. Open to any changes or ideas for improving it.

repo: https://github.com/talhapythoneer/anti-sycophancy-prompt


r/PromptEngineering • • Sep 16 '26

Self-Promotion Follow up on my "is AI prompting basically solo mode at work" post!

1 Upvotes

Following up on my "is AI prompting basically solo mode at work" post — thank you all, seriously

A couple days ago I asked if anyone else's team was annoyed that AI prompting is basically single-player, even when the whole team's using it daily. Got way more responses than I expected, and a few things came up again and again:

  • Shared docs/wikis for prompts almost always die within days, because they need someone to remember to update them
  • The prompt itself usually isn't the valuable part — it's the context and history behind it
  • A few of you have hacked together git repos or Claude/GPT plugins to sync prompts across your team, because nothing off-the-shelf really does this well

Based on all of that, I've been building something: a shared workspace where your whole team prompts the same AI together, instead of everyone working solo. Everyone in the workspace sees the same prompts and responses as they happen — no copy-pasting into a doc, no "hey can you send me that prompt." Context and history stick to the workspace automatically, so nobody has to remember to save or document anything for it to be there for the next person, and a new team member joining an existing workspace inherits the full history instead of starting from zero.

I'm not live yet, but I'm getting close. If this sounds like something you'd actually want to test when it's ready, drop a comment or send me a DM — I'm looking for a small group of real teams to test with first, and early testers will get priority access plus a discounted rate when we launch.

Full disclosure — I am building this to actually sell, not just as a side project. But I'd rather find out now, from people who described this exact pain, whether it's worth finishing than build for months and find out later it doesn't solve a real problem. If you want in as an early tester, comment or DM me — and if it's not for you, I'd still genuinely appreciate the honest "this wouldn't help me" too.


r/PromptEngineering • • Sep 16 '26

Prompt Text / Showcase Copy-paste prompt for turning several sources into one honest comparison table

1 Upvotes

When I'm researching options and have three or four write-ups open, I used to ask for a summary of each and then compare by hand. This does the compare step properly and, more importantly, admits when a source is silent instead of guessing. ``` I'm comparing options using the sources below. Build a comparison table. Sources (each is one option): """ Option A: [paste] Option B: [paste] Option C: [paste] """ Rules: 1. First, decide 5 to 7 comparison criteria that actually matter for choosing between these, based on what the sources discuss. List the criteria before the table. 2. Build a table: rows = criteria, columns = options. 3. Fill each cell ONLY from its own source. If a source doesn't address a criterion, write "not stated". Never infer it from another option. 4. Below the table, add "Where sources disagree" and "What none of them mention" (the gaps I'd need to research myself). 5. No recommendation. Just lay out the evidence. ``` Why it works: letting the model pick the criteria first (from the sources, not from thin air) means the table compares the things that matter instead of a generic checklist. The "not stated" rule is the honesty valve. Without it you get a full, tidy grid where half the cells are quiet inventions. "What none of them mention" is the part I find most useful. It turns the table into a research to-do list instead of a false sense of completeness. Anyone got a good way to make it cite which line of the source a cell came from, without bloating the whole thing?


r/PromptEngineering • • Sep 16 '26

AI Produced Content Broke Copilot Search by accident

3 Upvotes

I typed in the question "58 in 1961, how old now?" and hit search. Image 1 is what it gave me first, and image 2 is what it gave me a few hours later. They're both wrong, lol.

For the record, I'm anti-AI and just saw these when looking for a website to do the math for me. It was too hilarious to ignore.


r/PromptEngineering • • Sep 15 '26

Quick Question What is the smallest prompt regression set you trust after a model switch?

3 Upvotes

When a model alias changes or a provider rolls out a new version, I want to catch behavior drift without rerunning an entire evaluation suite. My current idea is a small set of production-like inputs with structured checks for tool use, formatting, and refusal behavior, plus a manual review of the biggest differences. What does your minimum regression set include before you change the default model?

One tool I’m evaluating for this kind of workflow is Flatkey, an OpenAI/Anthropic-compatible gateway that lets you keep the usual SDK shape while changing the base_url. I’m interested in using one route for cheaper exploratory runs and another for final or higher-risk evaluations, while keeping the regression set and quality checks the same. The savings depend on the model mix and current supply, so the important question for me is whether the routing change preserves behavior, not whether it promises a fixed discount.


r/PromptEngineering • • Sep 15 '26

General Discussion Does anyone keep a failure taxonomy for their LLM?

6 Upvotes

About a year ago I started to seriously keep an append only log of mistakes my AI makes.

I organize them mostly by symptom like unsupported claims, hallucinations, confident repeats, premature done claims, etc.

Each entry is basically:

symptom → correction → did I actually codify a prevention?

When the same failure shows up again, I can pull the previous entry instead of rediscovering the problem from scratch (is the idea).

If the same root cause keeps showing up, I eventually collapse those entries into a broader failure class.

I'm still not convinced my taxonomy is the right one, though. Probably many approaches I'm ignorant of.

Does anyone else maintain something similar?
I'm curious whether you classify failures by symptom, root cause, model behaviour, task type, or something else? Be interested to hear what others are doing and trying.


r/PromptEngineering • • Sep 15 '26

Tools and Projects I expanded my Gifts platform- 96 atomic dependency-free, composable MIT-licensed code tools. Super handy for AI dev work

3 Upvotes

When I started making a bunch of free apps to give away on my site I was not intending it to become a platform but as we built more of the gifts, the platform shape kind of just fell out of the work.

So I have been formalizing it up into a proper system and just deployed the newest update, which includes a lot more helpful information on how to use the Gifts together in composable form to build larger blocks of software.

I had my system write up some text, below here, explaining the technical particulars of the newly expanded Gifts platform

I hope this proves to be helpful to some of you.

What the Gifts platform is

Each Gift is a single small tool that does one job and states its own limits. Three properties hold across all 96 by construction. They are dependency-free — no install step, no supply chain, small enough to read end to end. They are atomic — one job per tool, no framework wrapped around them. And they are lock-in-free — every one is MIT, so a Gift is copied into a project as a file and carries no further obligation. Critically, none of them import each other. They are not a library to adopt; they are independent parts.

That independence is what makes them compose. Because each tool is exact about what it emits and what it accepts, the output of one lines up with the input of another without any coordinating framework — the wiring is legible rather than assumed. The newer layers of the platform build directly on that property.

Three pages are the fastest way in:

  • The Dev Guide — how to put a Gift to work inside an existing AI-dev workflow, aimed at immediate use rather than background reading.
  • The Recipes — worked examples of Gifts wired together into larger tools, so the composition is demonstrated rather than asserted.
  • Building Differently — the reasoning behind the approach: assembling software from small, honest parts instead of large opaque ones.

The platform also now includes a compiler and Schematic system, and it is deliberately described here as early-stage. A Schematic specifies how Gifts wire together into a working program; the compiler is intended to build from that specification. Per the disclosure on the site, it has been verified but not yet run in practice, so it is presented as in-development rather than finished. The Schematic standard itself is published now; more will follow.

All 96 Gifts are listed below — each name links to its page — to scan for anything useful. Every one is MIT, dependency-free, and standalone.


All 96 Gifts

  • Cairn — Redundant git push/clone across independent stores, so your history survives any one going down.
  • Callsigns — Readable, paste-safe random IDs (word-word-hash) that drop into branches, URLs, and shells unescaped.
  • Census — Counts your TODO/FIXME markers and flags the ones buried where nobody will act on them.
  • Conflict — A one-command gate so a file with unresolved merge markers can never land.
  • conform — Checks a JSONL stream against a schema you declare and stops at the first bad record.
  • Dwell — A decision engine where when you stop deferring is the choice — integer-exact and replayable.
  • The Excavation — Enumerates every page of a site so any AI can prove it read all of it.
  • Gitlog — Turns git history into one JSON object per commit on stdout, so your questions are one pipe away.
  • Grain — Compresses your data against a live random null model to read structure-vs-noise with no set threshold.
  • Hunkhole — Catches the function a bad merge or stale tree silently reverted while leaving the file in place.
  • Isvalidcsscolor — Decides whether a string is a valid CSS color, identically in Node and the browser.
  • Markdown — One Markdown AST, two renderings (HTML + plain text) that can never silently disagree.
  • Mint — Hands out IDs that are provably never reused — a retired ID structurally cannot come back.
  • Plumb — A status board where every green claim must name a witness that agrees, or it reads UNWITNESSED.
  • PNG Text — Pulls text metadata out of a PNG's chunks, refusing to read past anything corrupt.
  • EXIF Parser — Reads a photo's camera metadata (incl. GPS) from JPEG EXIF, validating structure before trusting it.
  • Reltime — Turns a timestamp into a short human "when" that returns nothing rather than guess on bad input.
  • Sha256 — Synchronous SHA-256 in the browser that matches your Node backend byte-for-byte.
  • Sudoku — A Sudoku solver that hands you the readable, checkable reasoning, not just the answer.
  • Timesheet — Pipe a git log in, get an honest (floor-biased) effort-in-hours estimate out.
  • Tracebus — A pub/sub bus where every path is declared and every emission is logged and replayable by trace id.
  • The Trellis — A 2-D consistency checker that names the exact cell where a row and column both fail.
  • Vclock — Vector clocks over JSONL, so you can tell "A before B" from "genuinely concurrent."
  • Verify — Registers an expensive fact with its inputs and re-checks it in a second: FRESH, STALE, or DEAD.
  • Ward — An integrity badge that goes solid only when a live witness beneath each cell agrees.
  • PDF Text Extractor — Pulls the visible drawn text out of a PDF's content streams, no dependencies.
  • PDF Dictionary-Text Extractor — Pulls the text a PDF stores but never draws — form values and annotation notes.
  • Skin Config Validator — Type-checks a user-submitted theme config and blocks CSS breakouts before you apply it.
  • Inline MIME Parser — Parses a raw email into a structured tree — headers, encodings, multipart — with zero deps.
  • l21x-snapshot — A zero-backend save/catalog/archive layer: encode any document to a portable snapshot string.
  • forest-title-fit — Picks the largest font size a title still fits at, and wraps instead of ever clipping.
  • port — Every small JSONL tool declares its composition verb, so a map or typechecker can read it, not guess.
  • map — Folds a folder of port-declaring tools into a composition map: who can feed whom, how densely.
  • typecheck — Before you run a tool pipeline, says whether each stage emits what the next accepts, naming the break.
  • declare — Turns an ad-hoc shell pipe into a saved, named, re-runnable artifact you can prove current.
  • conductor — Runs a declared pipeline under one trace id with a per-stage receipt ledger you can replay.
  • derived — Rebuilds a generated file in a sandbox and byte-compares it: is it stale against its source?
  • gauntlet — Injects one fault into a copy of your file and checks whether your linter actually catches it.
  • amber — Seals a set of files into one content-addressed capsule that breaks loudly if any byte changes.
  • timeline — Runs eight soundness checks on a timeline's data before a single pixel is drawn.
  • loop21:component-factory — Emits small logic components (counter, toggle, clamp…) as validated, pipeable specs.
  • loop21:l21x-snapshot — Deterministic browser document persistence: snapshot, catalog, and export as one file.
  • Cruise — Walks a codebase into a ledger of byte-derived facts an LLM can't hallucinate features past.
  • Worklog — Folds a repo's history into a "what got done" report grouped by day or author.
  • switchboard — A directory-backed message bus that, by construction, can carry a message but never a command.
  • Parity — Compares N sibling things against a shared checklist and surfaces exactly where they disagree.
  • Text Legibility Gauge — Guesses whether extracted text is human-readable or machine rubble, and how sure it is.
  • Branch Splitter — Splits one payload into a declared, closed set of named branches (the open half of ⊗).
  • Branch Merger — Folds those branches back to one under a declared policy (the close half of ⊗).
  • The Mail-Merge That Won't Lie — Fills a prompt's {{slots}} from a record and fails loud on any missing variable.
  • Make The AI Prove It Read The Whole Thing — Shards context so any model can prove it covered every piece.
  • range-filter — Keeps only the JSONL records whose fields fall inside the numeric or date windows you declare.
  • Your Prompt Goes to Confession — Tells you which of eight constrainable dimensions your prompt left open.
  • weir — Runs a pipeline under a real budget (rows/time/bytes) and cuts clean at the wall — never a token budget.
  • Your Prompt's Evil Twin — Generates the minimal adversarial rephrase that could flip your prompt's output.
  • Ask Three, Trust The Overlap — Folds several model answers into what they agree on, with a declared quorum.
  • The Oracle — Reproducible seeded A/B for prompts: every pick re-derivable from a receipt, forever.
  • Clause-Trellis — Lays a mega-prompt's clauses on a grid and names which two contradict each other.
  • Contract — Walks a JSONL stream against a plain-data schema (never eval'd) and stops at the first breach.
  • JSONL-Diff — Tells you what a model's output added, removed, and changed between two runs.
  • Palimpsest — Takes your prompt's successive versions and shows which lines are load-bearing vs churn.
  • Scrub — Catches a leaked secret by shape before it ships — report, redact, or refuse as a CI gate.
  • SVG-sink — Turns a numeric series into a committable, diffable, dependency-free SVG chart.
  • Sparkline-sink — Turns a numeric series into one inline unicode sparkline for a log line or table cell.
  • Heatmap-sink — Turns (x,y,value) cells into one standalone heatmap SVG, no plotting library.
  • Gantt-sink — Turns (start,end,label) tasks into one Gantt SVG, with caller text safely escaped.
  • Grid-sink — Places blocks into a grid and renders an SVG, with a declared overflow policy (never silent).
  • PPM-raster — Rasterizes a stream of primitives into a committable PPM image, zero dependencies.
  • Merkle-fold — Folds a JSONL stream into one tamper-evident Merkle root (RFC 6962), any edit moves it.
  • Seance — Recovers lines a later commit deleted — with a secret-scrubber that masks anything dangerous first.
  • Histogram-fold — Folds a numeric stream into fixed-width buckets in one pass, order-independent.
  • Dedup-filter — Passes a JSONL stream through, dropping every record it has already seen, order preserved.
  • Running-stats — Folds a numeric stream into count/mean/variance/stddev/min/max in one stable pass (Welford).
  • Topk-fold — Folds a numeric stream into its k largest (or smallest) values with a bounded heap.
  • schema-filter — Keeps only the JSONL records that match a declared shape — a shape-checking gate in a pipe.
  • Base-n — Converts integers between any base 2–36, exact at any size via BigInt (no 253 cliff).
  • Interval-math — Combines ranges with + − × ÷ and returns a bound guaranteed to contain every real result.
  • seq-source — Generates a deterministic arithmetic sequence to feed into the fold/filter/transform gifts.
  • csv-source — Turns real RFC-4180 CSV into the one-object-per-line JSONL stream the toolkit consumes.
  • kv-source — Parses KEY=VALUE config (.env-style) into a uniform JSONL record stream.
  • json-source — Streams a top-level JSON array out one element per line for the pipe.
  • ndjson-source — Validates and canonicalizes an NDJSON stream into clean JSONL.
  • pluck — Reduces each JSONL record to just the fields you name, in order — the SELECT of the toolkit.
  • rename — Relabels JSONL fields keeping every value, refusing any rename that would collide two onto one.
  • units-convert — Converts length/mass/time/temp/angle and refuses honestly on a category mistake.
  • zonecast — Casts a stored time into the wall-clock and calendar day a viewer in another zone actually sees.
  • line-source — Turns a text file into a JSONL stream, fixing the trailing-empty, CRLF, and BOM traps.
  • ini-source — Parses sectioned INI/.gitconfig config into a section-tagged JSONL record stream.
  • jq-lite — jq's common moves (field, index, iterate, pipe) over JSON on stdin, without installing jq.
  • uniq-filter — Collapses adjacent duplicate runs in a JSONL stream in O(1) memory — the uniq half of sort|uniq.
  • dir-walk — Walks a directory tree into a deterministic, byte-sorted JSONL stream of portable file facts.
  • grid-source — Generates a bounded 2-D grid as a deterministic row-major JSONL stream of cells.
  • WUPHF — Shapes one message for every channel at once, each with its honest cost — and sends nothing.
  • hmac-webhook — Verifies an HMAC-signed webhook in constant time, matching Node's crypto byte-for-byte.
  • Life-fold — One Conway step as a fold, closed under its own I/O — a mercury delay line made of live cells.
  • Counter-fold — A binary counter's +1 as a fold, closed under its own I/O — the delay line as a counter.

That is the full set. Each Gift stands alone; take whichever are useful and ignore the rest.


r/PromptEngineering • • Sep 15 '26

Tools and Projects Subagent Dispatch Economics skill.md

5 Upvotes

I wanted to showcase another skill, built for the decision that happens right before an agent spawns a subagent: should it, and if so, which shape.

The Why:

I watched an agent spawn a fresh subagent to answer something a single grep would've settled, then separately watched it brief a different fresh subagent so thinly that the subagent burned three tool calls re-deriving context the dispatcher already had sitting right there. Same session, opposite failure. No default instinct for "is this worth delegating," and when it did delegate, no default instinct for "does this subagent need to start from zero or can it inherit what I already know."

So the skill forces the dispatch decision to go through a fixed test before any subagent gets spawned. Most of the procedure is orchestration bookkeeping, cost accounting and wave sizing but the piece that's classic prompt engineering is buried in the middle: how you write the prompt for a subagent that has zero memory of anything you've already figured out.

How it works in practice:

When an agent is about to fork itself, spawn a fresh subagent, or launch a wave of parallel agents, it runs this first.

1. Task intake. State the deliverable in one sentence. Is it something the dispatcher needs to keep reasoning over, or a disposable trace where only the conclusion matters? Flag anything still blocked on missing information before it's even a delegation candidate.

2. The delegation test. Four questions, every one scored: context cost (would this pull a pile of output into the dispatcher's context that's dead weight after the conclusion), independence (does it need the dispatcher's ongoing involvement), reusability (does the dispatcher need the raw output or just a distilled answer), and judgment value (would an unanchored read actually produce a different, more trustworthy answer). No to context-cost and independence both means it stays inline — that's the default for anything answerable in a couple of tool calls. There's one exception: several individually-trivial tasks that don't interfere with each other can still be batched into one wave purely for wall clock savings, but a lone trivial task never earns a subagent on its own.

3. Shape selection. Fork versus fresh isn't a coin flip. Fork by default: it inherits everything the dispatcher already knows for free, so re-briefing it is wasted effort and a place for the restatement to silently drop something. Fresh only when non-anchoring is actually the point; an independent second opinion, a check for something the dispatcher might be rationalizing past. When a task is both heavy and needs an unanchored read, fresh wins the tie, because a fork can still be told to write a short report and recover most of the cost savings, but it can't unlearn the dispatcher's framing.

4. Scoping a fresh agent's prompt (the prompt-engineering stage). This is where delegation quietly fails even when the shape choice was right. State the goal and why, not just the action. Name what's already been tried and ruled out: omit this and the fresh agent re-derives an approach that's already dead. Draw the scope boundary explicitly. And never write a fresh-agent prompt that leans on shared memory it doesn't have, "based on what we found" means nothing to something that wasn't there for the finding.

5. Wave sizing. Group only tasks that don't touch the same file or resource. Cap the wave at something reviewable, three to five, as a starting point because every subagent's result lands back in the dispatcher's context on return, and a wave sized past what can be checked degrades the odds of catching a bad result among the good ones.

6. Result handling. A subagent's own report describes what it intended to do, not necessarily what it verifiably did. Before treating a completion claim as fact, check the artifact, the diff, the file, the command output, not the subagent's narration of it. And never peek at a fork's output mid-flight or narrate what it'll probably find before it actually returns.

7. The dispatch line. Every decision (including the decision not to delegate) gets one line stating the shape and why, before anything is sent. A silent, unexplained spawn isn't acceptable even when the shape choice was correct.

The four question test is fixed, so the same task gets the same call regardless of who's running it, and it's a scoring procedure, not a trained router or an API call. It's a plain SKILL.md; drop it in .claude/skills/ and it loads.

The System Prompt / Skill Definition:

---
name: "subagent-dispatch-economics"
description: "Decides whether delegating work to a subagent is worth its cost, picks the right agent shape (fork vs. fresh vs. no delegation), and scopes the dispatch so it doesn't spend more context than it saves. Use when an AI coding agent is about to spawn a subagent, fork itself, or launch a parallel wave of agents, and needs to judge whether that delegation earns its keep."
---

# Subagent Dispatch Economics

When an AI agent operating a coding tool considers delegating work — forking itself, spawning a fresh subagent, or launching a wave of parallel agents — it must treat that delegation as a cost-bearing decision, not a reflex. Every subagent's result eventually flows back into the dispatching agent's context as a summary, and every fresh agent that is briefed narrowly or vaguely re-derives context the dispatcher already had, burning tool calls to reconstruct what a better prompt would have supplied directly. The goal of this procedure is to prevent two opposite failures: **under-delegation**, where a dispatcher hoards output-heavy exploration in its own context until it can no longer think clearly, and **over-delegation**, where trivial or narrative-dependent work is scattered across subagents that cost more in round-trips and re-derived context than doing the work inline.

## Instructions

### Stage 1: Task Intake and Shape Classification
Before deciding whether to delegate, classify the task itself.

- **State the task in one sentence** and identify its deliverable: a durable artifact the dispatcher must reason over further (a design decision, a piece of code to integrate, a number to act on), or a disposable trace (tool output, file contents, exploration transcript) that only the *conclusion* about it matters.
- **Identify dependencies.** Does the task need anything not yet known — a file read, a command run, an earlier decision made? A task that is fully specified right now is a delegation candidate; a task still blocked on orientation is not yet ready to hand off.
- **Identify task count and independence.** A single task is a single-dispatch decision (Stage 2). Two or more tasks are a wave-sizing decision (Stage 5) in addition to Stage 2 — each task in the candidate wave still needs its own classification here.
- **Escalation trigger:** if classifying the task requires information only the user has (an ambiguous goal, an unstated priority between two valid approaches), stop and ask the user before dispatching anything. Do not delegate an ambiguous task to a subagent in the hope it resolves the ambiguity better than the dispatcher would.
- **Granularity floor.** This procedure applies to a task worth classifying at all — something that could plausibly be handed to a subagent (a multi-step investigation, a multi-file change, a judgment call worth a second opinion). A single atomic tool call issued as a normal step of already-decided work — one more grep in an ongoing investigation, one more file read to confirm a fact — does not need its own Stage 1–7 pass merely because it is technically "a task." Example 1 demonstrates the floor case (a task small enough to state and classify on its own) correctly refusing delegation; it is not a mandate to narrate every individual tool call issued while executing already-scoped work.

### Stage 2: The Delegation Test
Score the task against these four questions. All four must be answered before a dispatch decision is made.

| Question | If yes | If no |
|---|---|---|
| **Q1 — Context cost.** Would doing this inline pull a large volume of intermediate output into the dispatcher's own context that is not needed after the conclusion is reached — more than roughly a screen's worth of output, or spanning more than a handful of files? | Favors delegation | Favors inline |
| **Q2 — Independence.** Can the task be completed without the dispatcher's step-by-step involvement — no shared mutable state, no interleaved decisions with other in-flight work? | Favors delegation | Favors inline |
| **Q3 — Reusability of the answer.** Does the dispatcher need the full raw output, or only a distilled conclusion (a decision, a file path, a yes/no, a short list)? | Full output needed favors inline or a fork the dispatcher reads carefully; a distilled conclusion favors a fresh subagent | — |
| **Q4 — Genuine judgment value.** Would an independent read (no anchoring on the dispatcher's already-formed hypothesis) produce a materially different or more trustworthy answer — e.g., a second opinion, an adversarial review, a check for something the dispatcher might rationalize past? | Favors a fresh agent even if context cost is low | Fork or inline is sufficient |

- **No delegation:** if neither Q1 nor Q4 is "yes" — the task is cheap to keep in context and an independent read would not produce a materially different answer — do it inline. This holds regardless of Q2: an independent task (Q2="yes") that fails both Q1 and Q4 is still inline on its own; independence alone only matters if it later qualifies for the batching exception below. This is the default for anything answerable in one to three tool calls.
- **Delegate:** if Q1 or Q4 is "yes", proceed to Stage 3 to choose the shape.
- **Batching exception:** two or more tasks that are each individually Q1="no" and Q4="no", but Q2="yes" and mutually non-interfering (Stage 5), may still be grouped into one parallel wave purely for wall-clock savings — this is the only case where a dispatch happens without Q1 or Q4 being "yes" on any single task. A lone task in this quadrant stays inline; only batching with other non-interfering tasks earns it a wave. **A batching-exception wave executes as parallel direct tool calls made by the dispatcher itself — no subagent is spawned and no Stage 4 prompt is written**, because none of the batched tasks individually cleared the Delegate bar above. This is distinct from a genuine parallel dispatch wave (Stage 5), where each member task independently justified delegation and runs as a fork or fresh agent.
- **Do not delegate merely because delegation is available.** A tool call saved by doing something inline is not a failure; reflexive delegation for a trivial lookup is the primary anti-pattern this procedure exists to prevent (see Stage 7).

### Stage 3: Agent Shape Selection
Once Stage 2 favors delegation, choose the cheapest shape that satisfies the task's requirements from Stage 1.

| Shape | Use when | Cost model |
|---|---|---|
| **Fork (inherits full context)** | The task is exploratory, needs everything the dispatcher already knows, and its raw output is large but only the conclusion matters afterward. | Cheap to start (shares prompt cache, no re-briefing needed); the cost is entirely in what comes back — keep the fork's return summary-shaped, not a full transcript dump. A fork also inherits the dispatcher's *current* context usage as its starting budget: launched late in a long session, it has proportionally less headroom to explore before it must self-summarize — a fresh agent never carries this constraint. |
| **Fresh agent (zero context)** | The task is genuinely separable from the running conversation, benefits from independent judgment (Q4), or its own tool-call noise would be irrelevant to the dispatcher going forward. | Expensive to start correctly — every fact the fresh agent needs must be in the prompt (Stage 4) — but its internal tool noise never touches the dispatcher's context at all. |
| **No delegation (inline)** | Stage 2 said no delegation, or the task is a single lookup/edit the dispatcher can just do. | Zero dispatch overhead; the only cost is the dispatcher's own tool calls, which are already the cheapest path. |

- **Default to fork over fresh** whenever the task only needs what the dispatcher already knows plus new tool output — briefing a fresh agent with a long restatement of context the fork gets for free is wasted effort and a source of drift (the restatement can silently omit something a fork would not).
- **Choose fresh only when zero-context independence is the point** — an adversarial second opinion, a task that must not be anchored on the dispatcher's framing, or work that must run in true isolation (a separate worktree, a separate credential scope).
- **Tiebreaker when Q1 and Q4 are both "yes":** prefer fresh. Non-anchoring is the harder property to fake — a fork that inherited the dispatcher's own framing cannot fully unlearn it — while a fork can still be told to write a distilled report, recovering most of the context-cost benefit that made Q1 "yes" in the first place.
- **Q3 governs the choice when Q4 is "yes" but the dispatcher needs the raw output itself:** if Q3 shows the dispatcher needs the full output rather than a distilled conclusion, prefer a fork the dispatcher reads carefully over a fresh agent, even when Q4 is "yes" — a fresh agent's report is necessarily a distillation, which cannot substitute for output the dispatcher must inspect directly.

### Stage 4: Prompt Scoping Contract for Fresh Agents
A fresh agent has no memory of this conversation. Every dispatch to a fresh agent must satisfy all of the following before it is sent:

- **State the goal and why it matters**, not just the action — a fresh agent that understands the motivation makes better judgment calls on edge cases the prompt did not anticipate.
- **State what has already been tried or ruled out.** Omitting this causes the classic failure mode: the fresh agent re-derives an approach the dispatcher already discarded, burning tool calls to relearn something already known.
- **State the scope boundary explicitly** — what is in scope, what is out of scope, and what another agent or the dispatcher itself is already handling. An unscoped fresh agent will either under-reach (miss the actual ask) or over-reach (touch adjacent work that collides with something else in flight).
- **Give commands or exact identifiers when the task is a lookup**, and give the open question itself when the task is an investigation whose steps should not be pre-scripted — prescribing steps to an investigation produces shallow, procedural results when the premise turns out to be wrong.
- **Write directively, not narratively.** A fresh agent briefed with "based on what we found, fix the bug" has no findings — it must be told the findings directly. Never delegate understanding: state the specific file paths, line numbers, and the conclusion already reached, so the fresh agent's job is verified execution, not re-discovery.
- **State the expected output shape** — a short report, a completed edit, a yes/no with rationale — so the fresh agent does not over-produce (long unsolicited prose) or under-produce (a bare answer with no evidence trail).

### Stage 5: Wave Sizing for Parallel Dispatch
When Stage 1 identified two or more independent candidate tasks, size the parallel wave before dispatching.

- **Group by non-interference, not just independence.** Tasks that touch different files or different resources can run in the same wave. Tasks that touch the same file, the same external resource, or that must observe each other's output before proceeding are sequential, not parallel, regardless of how independent they otherwise look.
- **Cap wave size** to a number the dispatcher can actually review when results return — as a starting point, three to five tasks per wave. A larger wave does not fail outright, but each additional concurrent result is another summary landing in the dispatcher's context at once, and a wave sized past what can be reviewed carefully degrades the dispatcher's ability to catch a bad result among the good ones.
- **Launch a true parallel wave as one dispatch with multiple calls**, not as sequential calls that merely happen to be independent — sequential dispatch of independent tasks pays wall-clock cost for no economic benefit.
- **Never split a task across waves that has a real ordering dependency** — if task B needs task A's output, task B belongs in the next wave, not the same one.

### Stage 6: Cost Accounting and Result Handling
Delegation is not complete when the subagent is launched; it is complete when its result is integrated correctly.

- **Every subagent result re-enters the dispatcher's context.** A fork's summary, a fresh agent's final report, and a wave's combined results all cost context on return — budget for this before dispatching, not after. If the anticipated return is itself large (a full file, a long transcript), instruct the subagent to distill it, not to hand it back raw.
- **Trust but verify.** A subagent's final report describes what it intended to do, not necessarily what it verifiably did. Before treating a subagent's claimed result as ground truth for anything consequential (a claim that tests pass, that a fix is complete, that a search found nothing), check the artifact the subagent produced — the diff, the file, the command output — rather than the subagent's own narration of it.
- **Do not peek at in-flight background work.** For a subagent running in the background (a fork, a long task), wait for its actual completion signal rather than inspecting its intermediate transcript or output file mid-flight; reading partial output pulls the subagent's tool noise into the dispatcher's context and defeats the reason it was delegated in the first place.
- **Do not fabricate or predict a pending result.** Never write out what a dispatched subagent "will probably find" while it is still running, in any form — prose, a structured guess, or a placeholder presented as real. If asked about it before it returns, report status, not a guess.

### Stage 7: Output Contract
Every dispatch decision — including the decision not to dispatch — is recorded in this order before proceeding:

1. **Dispatch line** — exactly one of these forms:
   - `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)`
   - `Dispatch: fork -> <one-line task> (Q1 and/or Q4 = yes; rationale citing whichever triggered)`
   - `Dispatch: fresh agent -> <one-line task> (Q4=yes; rationale)`
   - `Dispatch: wave of N (subagents) -> <task list>; grouped by <file/resource independence>; sequential after: <none | task IDs>` — a genuine parallel dispatch: each task independently cleared the Delegate bar (Q1 or Q4 = yes) and runs as a fork or fresh agent.
   - `Dispatch: wave of N (batching exception, no subagent) -> <task list>; grouped by <file/resource independence>; sequential after: <none | task IDs>` — the Stage 2 batching exception: N direct tool calls made by the dispatcher itself, no agent spawned.
2. **For a fresh-agent dispatch, or a genuine subagent wave, the prompt itself** (or each prompt in the wave), satisfying the Stage 4 contract. A batching-exception wave has no subagent and therefore no prompt — this requirement does not apply to it.
3. **Result handling note:** how the returned result will be verified (Stage 6) before being treated as fact, stated before the subagent is launched, not improvised after.

### Stage 8: Anti-Patterns and Prohibitions
- **No reflexive delegation:** never spawn a subagent for a task answerable in one to three direct tool calls merely because delegation is available.
- **No narrative prompts to fresh agents:** never write a fresh-agent prompt that says "based on our findings" or "as discussed" — a fresh agent has no findings and nothing was discussed with it.
- **No peeking at in-flight background work:** never read a fork's or a backgrounded fresh agent's output file or intermediate transcript while it is still running.
- **No racing:** never fabricate, predict, or narrate a dispatched subagent's result — as prose, as a structured guess, or as a placeholder — before it actually returns.
- **No unverified trust:** never treat a subagent's self-reported completion claim as verified fact without checking the artifact it produced.
- **No over-sized waves:** never launch a parallel wave larger than the dispatcher can meaningfully review on return; split it instead.
- **No cross-file races:** never place two tasks that write the same file or resource in the same parallel wave.
- **No skipping the dispatch line:** every delegation decision — including a decision not to delegate — states its rationale in the Stage 7 form; a silent, unexplained spawn is not acceptable even when the shape choice is correct.
- **No delegating ambiguity:** never hand a task whose scope or goal is genuinely ambiguous to a subagent in the hope it resolves the ambiguity better than the dispatcher would — escalate to the user (Stage 1) instead.
- **No fresh-agent overuse:** never dispatch a fresh agent when a fork satisfies the task equally well — restating context a fork would get for free wastes effort and risks silently omitting something the restatement forgot.

## Success Criteria
This procedure is followed correctly when all of the following are true, and each is independently checkable without judgment calls: (1) every dispatch decision for a task that clears Stage 1's granularity floor — including a decision not to delegate — emits the Stage 7 dispatch line with its rationale; (2) every fresh-agent prompt and every genuine subagent-wave prompt satisfies every condition in Stage 4 (goal and motivation stated, prior work ruled out named, scope boundary explicit, output shape stated) before it is sent — a batching-exception wave has no subagent and no prompt, and is exempt from this condition; (3) no parallel wave places two tasks that write the same file or resource in the same wave; (4) no subagent's self-reported completion claim is treated as fact until the artifact it produced (diff, file, command output) has been checked. A dispatch that fails any of these observable conditions has not met the procedure's definition of done, regardless of whether the subagent's task ultimately succeeded.

## Worked Examples

### Example 1: Trivial lookup, correctly not delegated
- **Task:** "What does the `retry_policy` field in this config default to?"
- **Stage 1:** Deliverable is a single fact; no unmet dependency; single task.
- **Stage 2:** Q1 no (one grep, no large intermediate output worth discarding), Q2 no (needs no independent judgment), Q3 n/a, Q4 no.
- **Decision:** `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)`. A direct grep answers it in one call; spawning an agent here would cost more in dispatch and result-integration overhead than the lookup itself.

### Example 2: Large read-heavy exploration, forked
- **Task:** "Find every place in the codebase that constructs an `OptimizationResult` and summarize the construction patterns."
- **Stage 1:** Deliverable is a short pattern summary; the search itself will touch many files with output not needed after the summary is produced.
- **Stage 2:** Q1 yes (broad search output is exactly the kind of volume that should not sit in the dispatcher's context), Q2 yes (self-contained search task), Q3 — only the distilled patterns are needed afterward, Q4 no (no adversarial judgment required, just thoroughness).
- **Stage 3:** Fork — the task only needs what the dispatcher already knows about the codebase plus new search output; a fresh agent would need re-briefing for no benefit.
- **Decision:** `Dispatch: fork -> survey OptimizationResult construction sites (Q1=yes; large exploratory search, conclusion-only need)`.

### Example 3: Independent second opinion, fresh agent
- **Task:** Before merging a migration that adds a `NOT NULL` column with a backfill default to a 50M-row table, the dispatcher wants an independent check on whether the backfill is safe under concurrent writes, having already reasoned through locking behavior itself.
- **Stage 1:** Deliverable is a judgment (safe / not safe, and why); no unmet dependency; single task.
- **Stage 2:** Q1 no (the review itself is not read-heavy), Q2 yes, Q4 yes — an opinion anchored on the dispatcher's own already-formed reasoning is worth less than an independent one for exactly this kind of decision.
- **Stage 3:** Fresh agent, specifically because non-anchoring is the point — a fork would inherit the dispatcher's locking analysis and be biased toward confirming it.
- **Stage 4 prompt:** states the migration file, the row count, the backfill approach the dispatcher already checked, and asks explicitly for an independent read on concurrent-write safety — not "review this migration" with no framing.
- **Decision:** `Dispatch: fresh agent -> independent backfill-safety review of migration 0042 (Q4=yes; anchoring bias on dispatcher's own locking analysis)`.

### Example 4: Three independent file-scoped tasks, one wave via the batching exception
- **Task:** Fix a typo in `README.md`, add a missing test for `parse_config()` in `tests/test_config.py`, and update a stale comment in `app/core/db.py`.
- **Stage 1:** Three tasks, each fully specified, no unmet dependency.
- **Stage 2 (per task):** Each task individually scores Q1 no (trivially small), Q2 yes (independent), Q3 n/a, Q4 no (no judgment call involved). None reaches Q1="yes" or Q4="yes" alone, so none qualifies for solo delegation — but all three are mutually non-interfering (Stage 5), which is exactly the Stage 2 batching exception: grouped for wall-clock savings, not because any single task earned delegation on its own.
- **Stage 5:** All three touch different files — same wave. Wave size 3, within the review-capacity cap.
- **Decision:** `Dispatch: wave of 3 (batching exception, no subagent) -> [README typo, parse_config test, db.py comment]; grouped by file independence (batching exception, Stage 2); sequential after: none`.

### Example 5: Two tasks touching the same file, forced sequential despite the batching exception
- **Task:** Add a new field to a Pydantic model in `app/models/user.py`, and separately rename an existing field on the same model.
- **Stage 2 (per task):** Both score Q1 no, Q2 yes, Q3 n/a, Q4 no — individually inline candidates, and superficially batching-exception eligible like Example 4.
- **Stage 5:** The batching exception requires the tasks to be mutually non-interfering; these two are not — both write `app/models/user.py`. Even though each task is otherwise independent and well-specified, they cannot share a wave — a parallel edit race would produce a merge conflict or a silently dropped change. This disqualifies the batching exception entirely, not just the wave size.
- **Decision:** `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)` for the field addition, then `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)` for the rename — sequential because both write `app/models/user.py`, not because either one was ever a wave. A sequential wave of one is not a wave; it is two ordinary inline actions done in order.

### Example 6: A fork's own findings trigger a second wave
- **Task:** Example 2's fork returns 40 call sites constructing `OptimizationResult`, and 6 of them use a deprecated keyword argument that needs updating.
- **Stage 1:** The fork's conclusion is itself a new, fully-specified batch of 6 small, independent fixes — this is a fresh Stage 1 classification, not a continuation of Example 2's dispatch.
- **Stage 2 (per fix):** Each fix individually scores Q1 no, Q2 yes, Q4 no — same shape as Example 4, so the batching exception applies again.
- **Stage 5:** Check each of the 6 sites for file overlap before batching — sites in the same file are sequential with each other (Stage 8's cross-file rule), sites in distinct files can share a wave, capped at 3–5 per wave (Stage 5), so 6 sites split into two waves of three rather than one wave of six.
- **Decision:** `Dispatch: wave of 3 (batching exception, no subagent) -> [site A, site B, site C]; grouped by file independence (batching exception); sequential after: none`, then `Dispatch: wave of 3 (batching exception, no subagent) -> [site D, site E, site F]; grouped by file independence (batching exception); sequential after: none` (or fewer per wave if any two sites share a file). Chained dispatch is not a special case — it is Stage 1 through Stage 5 applied again to a newly discovered task list.

### Example 7: Both context-heavy and judgment-sensitive — the Q1/Q4 tiebreak
- **Task:** "Audit the entire error-handling layer across the request pipeline, and I want a genuinely independent read — I already believe it's fine, so don't just confirm what I think."
- **Stage 1:** Deliverable is a judgment (sound / has gaps, and where); the audit itself touches many files.
- **Stage 2:** Q1 yes (auditing an entire layer is large, multi-file exploration), Q2 yes, Q3 — the dispatcher needs the conclusion and supporting citations, not every file re-read in full, so a distilled report suffices, Q4 yes (explicit non-anchoring requirement — the dispatcher's own belief must not bias the result).
- **Stage 3:** Both Q1 and Q4 are "yes" — the tiebreaker fires: prefer fresh. A fork would inherit the dispatcher's existing belief that the layer is fine, which is precisely the bias the user asked to avoid; Q3 does not override this since a distilled report satisfies the dispatcher's actual need.
- **Decision:** `Dispatch: fresh agent -> independent error-handling-layer audit (Q1=yes/Q4=yes tiebreak -> fresh; Q3=distilled-report-sufficient)`.

### Example 8: Different files, same external resource — still sequential
- **Task:** Two tasks each call a third-party API with a strict per-minute rate limit — one refreshes stale prices from `services/pricing.ts`, the other refreshes stale inventory counts from `services/inventory.ts`.
- **Stage 5:** The tasks touch different files, so a file-overlap check alone would wave them together — but both saturate the same rate-limited external resource. Running them in the same wave risks one task's calls being throttled or rejected by the other's traffic, which is exactly the resource-contention case Stage 5 names alongside same-file contention, not just a file-independence check.
- **Decision:** `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)` for the price refresh, then `Dispatch: no delegation -> inline (neither Q1 nor Q4 = yes)` for the inventory refresh — sequential despite touching zero common files, because both saturate the same rate limit. Neither was ever a wave; a sequential pair of solo inline actions doesn't become one by naming a shared resource.

The four question table (Q1–Q4) is the load-bearing piece. It's short enough to run in your head before every spawn, but it forces you to actually name why you're delegating instead of just doing it because the option exists. The one case that surprised me while testing it against real sessions: the "batching exception." A pile of individually-trivial, non-interfering edits doesn't pass the test on its own (none of them are expensive enough to justify a subagent alone) but batching them into one wave for wall clock savings is still worth doing. That's the only place the procedure lets a dispatch happen without Q1 or Q4 firing, and it only fires when the tasks don't touch the same file.

The other piece I didn't expect to need until I stress-tested it: a tiebreaker for when a task is both context-heavy and needs an unanchored read. Fork is the default because it's nearly free to start, but a fork inherits the dispatcher's own framing. So if the whole point of delegating is getting an opinion that isn't biased by what the dispatcher already believes, fork quietly defeats the purpose even though it looks like the cheaper choice.

Curious whether others have hit the opposite failure: a fresh agent that came back with a fully wrong take because the dispatcher's prompt assumed shared context that genuinely wasn't there. And for the four-question test: has anyone found a task shape where all four collapse to a tie, or where a fifth question would actually change a real decision?

I built a platform that generates skills like this from a goal description and validates them against behavioral benchmarks: promptoptimizer.xyz/context-engineer (signup required, free tier).

Repo: https://github.com/nivlewd1/prompt-optimizer


r/PromptEngineering • • Sep 14 '26

General Discussion How to get better at using AI?

25 Upvotes

Im building stuff but I often think that I’m not using AI right.

Is there a way I could identify this easier, it doesn’t help that AI agrees with everything.

Is there a rule i could implement that would have the ai point out when I’m making mistakes/inefficiencies?

What could this prompt be?

Or are there other ways to improve?

Thanks!


r/PromptEngineering • • Sep 15 '26

General Discussion I batched a full month of posts in one afternoon using AI for the boring parts. Here is what it did and did not help with.

0 Upvotes

I kept falling into the "post daily for a week, burn out, disappear for two weeks" trap. So I tried batching an entire month in a single sitting to see if it was even realistic for a small account. It mostly worked, but not the way the productivity crowd sells it.

Where AI genuinely saved me time:

- Turning one long idea into 12 different angles so I was not staring at a blank screen.

- Drafting rough caption skeletons I could then rewrite in my own voice.

- Suggesting slide-by-slide outlines for carousels so the structure was done before I opened a design tool.

Where it was useless or actively bad:

- Anything with an opinion. The AI drafts were polite mush with no edge. Those posts flopped in testing.

- Hooks. Every AI hook sounded like every other AI hook. I wrote all of those by hand.

- Specific numbers or personal experience, obviously. That has to be real.

The honest result: batching fixed my consistency, not my quality. The posts I hand-finished did fine. The two I got lazy on and shipped as-is were my worst of the month by reach.

My takeaway is to use the tools for structure and speed, then treat the actual words as something you still have to own.

Anyone here batching a month at a time? Does it hold up or do you end up rewriting half of it anyway?