Versão breve
- Um bom prompt de programação descreve o comportamento atual, a alteração pretendida e a forma de verificar o resultado. Dê ao assistente uma parte pequena do repositório e peça alterações que possam ser testadas.
- Nunca cole credenciais, dados privados de clientes ou repositórios proprietários completos num assistente não autorizado. Execute os comandos e os testes sugeridos no seu ambiente. Uma alteração plausível não comprova que funciona.
Um bom prompt de programação descreve o comportamento atual, a alteração pretendida e a forma de verificar o resultado. Dê ao assistente uma parte pequena do repositório e peça alterações que possam ser testadas.
Nunca cole credenciais, dados privados de clientes ou repositórios proprietários completos num assistente não autorizado. Execute os comandos e os testes sugeridos no seu ambiente. Uma alteração plausível não comprova que funciona.
Como utilizar esta coleção
Escolha a tarefa mais próxima do seu trabalho. Copie o prompt, substitua a cena genérica ou o contexto de código pelos seus dados e mantenha as restrições que ajudam a avaliar o resultado. Altere uma variável de cada vez para identificar o que melhorou.
A abordagem segue o guia de engenharia de prompts do GitHub Copilot: forneça contexto concreto e examine o resultado sem assumir que um primeiro rascunho bem apresentado está correto.
Prompts de diagnóstico
Este conjunto centra-se em o diagnóstico. Forneça o seu código real e o comando de teste antes de aceitar a resposta.
1. Um analisador de datas que falha
Help with a failing date parser in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
2. Uma consulta lenta à base de dados
Help with a slow database query in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
3. Um formulário com envios duplicados
Help with a form with duplicate submissions in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
4. Uma API com erros inconsistentes
Help with an API with inconsistent errors in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
5. Um caso limite de paginação
Help with a pagination edge case in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
6. Um teste de integração instável
Help with a flaky integration test in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
7. Um limite de envio de ficheiros
Help with a file upload limit in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
8. Um erro de invalidação da cache
Help with a cache invalidation bug in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
9. Um ciclo de novas tentativas numa fila
Help with a queue retry loop in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
10. Uma verificação de autorização
Help with an authorization check in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then state competing hypotheses, request a minimal reproduction and identify evidence that separates them. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute a reprodução proposta antes de aplicar uma correção.
Prompts de implementação
Este conjunto centra-se em a implementação. Forneça o seu código real e o comando de teste antes de aceitar a resposta.
11. Um analisador de datas que falha
Help with a failing date parser in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
12. Uma consulta lenta à base de dados
Help with a slow database query in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
13. Um formulário com envios duplicados
Help with a form with duplicate submissions in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
14. Uma API com erros inconsistentes
Help with an API with inconsistent errors in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
15. Um caso limite de paginação
Help with a pagination edge case in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
16. Um teste de integração instável
Help with a flaky integration test in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
17. Um limite de envio de ficheiros
Help with a file upload limit in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.

18. Um erro de invalidação da cache
Help with a cache invalidation bug in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
19. Um ciclo de novas tentativas numa fila
Help with a queue retry loop in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
20. Uma verificação de autorização
Help with an authorization check in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then make the smallest change that satisfies the stated behavior and show a focused diff. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Examine as diferenças para identificar alterações fora do âmbito e acesso não previsto a dados.
Prompts para testar os limites
Este conjunto centra-se em os testes dos limites. Forneça o seu código real e o comando de teste antes de aceitar a resposta.
21. Um analisador de datas que falha
Help with a failing date parser in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
22. Uma consulta lenta à base de dados
Help with a slow database query in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
23. Um formulário com envios duplicados
Help with a form with duplicate submissions in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
24. Uma API com erros inconsistentes
Help with an API with inconsistent errors in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
25. Um caso limite de paginação
Help with a pagination edge case in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
26. Um teste de integração instável
Help with a flaky integration test in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
27. Um limite de envio de ficheiros
Help with a file upload limit in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
28. Um erro de invalidação da cache
Help with a cache invalidation bug in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
29. Um ciclo de novas tentativas numa fila
Help with a queue retry loop in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
30. Uma verificação de autorização
Help with an authorization check in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then add unit or integration cases for empty, invalid and concurrent inputs as appropriate. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Execute os testes e, quando possível, confirme que falham antes da correção.
Prompts de revisão de segurança
Este conjunto centra-se em a revisão de segurança. Forneça o seu código real e o comando de teste antes de aceitar a resposta.
31. Um analisador de datas que falha
Help with a failing date parser in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
32. Uma consulta lenta à base de dados
Help with a slow database query in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
33. Um formulário com envios duplicados
Help with a form with duplicate submissions in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
34. Uma API com erros inconsistentes
Help with an API with inconsistent errors in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.

35. Um caso limite de paginação
Help with a pagination edge case in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
36. Um teste de integração instável
Help with a flaky integration test in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
37. Um limite de envio de ficheiros
Help with a file upload limit in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
38. Um erro de invalidação da cache
Help with a cache invalidation bug in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
39. Um ciclo de novas tentativas numa fila
Help with a queue retry loop in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
40. Uma verificação de autorização
Help with an authorization check in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then inspect authorization, input validation, error disclosure and rollback behavior. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Verifique as afirmações de segurança nas rotas reais e na política da base de dados.
Prompts para documentar a entrega
Este conjunto centra-se em a documentação da entrega. Forneça o seu código real e o comando de teste antes de aceitar a resposta.
41. Um analisador de datas que falha
Help with a failing date parser in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
42. Uma consulta lenta à base de dados
Help with a slow database query in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
43. Um formulário com envios duplicados
Help with a form with duplicate submissions in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
44. Uma API com erros inconsistentes
Help with an API with inconsistent errors in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
45. Um caso limite de paginação
Help with a pagination edge case in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
46. Um teste de integração instável
Help with a flaky integration test in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
47. Um limite de envio de ficheiros
Help with a file upload limit in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
48. Um erro de invalidação da cache
Help with a cache invalidation bug in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
49. Um ciclo de novas tentativas numa fila
Help with a queue retry loop in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
50. Uma verificação de autorização
Help with an authorization check in my existing codebase. Ask for the relevant file, expected behavior, actual behavior and test command if I have not supplied them. Then write a concise changelog, usage example and rollback note tied to the implementation. Preserve public interfaces unless evidence requires a change. Show assumptions, a focused diff and the exact command I should run. Do not invent files, test results or security guarantees.Verificação: Retire afirmações que não foram medidas ou testadas.
O que verificar antes de utilizar o resultado
Nunca cole credenciais, dados privados de clientes ou repositórios proprietários completos num assistente não autorizado. Execute os comandos e os testes sugeridos no seu ambiente. Uma alteração plausível não comprova que funciona.
Se o resultado não cumprir a tarefa, encurte o prompt e indique o facto ou a restrição em falta. Guarde a versão utilizada para que o recurso final ou a alteração de código possam ser reproduzidos.
Leituras adicionais
Tem uma pergunta ou uma correção?
Contactar a Thrive


