AI, Cursor and speeding up development
I was able to make this blog from zero to production in 1 hour. Including:
- Blog engine with Jekyll (Markdown ❤️)
- Hosting on Github for availability
- CSS inspired by my personal website
- Support to code highlight
- Mapping and SEO revision
- 3 Posts (including this one)
- DNS forwarding from blog.leonardopereira.com to dantetekanem.github.io
How? Ruby and Cursor are the answer. The first one needs no introduction, Jekyll is an amazing gem that has been around for a long time, Github Pages also provides several ways to easily start a new one. You just need to have a repo of username/username.github.io.
But without Cursor, this would have taken me the entire day, or maybe even a couple of days. Instead, using the power of Composer, claude-3.7-sonnet-thinking and a few good instructions, it bootstrapped everything, auto-corrected any issues, and provided a perfect first draft.
There was no magic in my commands. I don’t have the exact set of instructions, but it was something like this:
- Let’s bootstrap a new blog using Jekyll, I want it to look like my personal website: leonardopereira.com
- ~ Claude started working and got all the gems, ran the commands and more.
- I stopped some of the progress and asked not to use comments right now, as I want to evaluate them better.
- ~ In the first debug session, the CSS was not working. I complained and it did some debugging itself and identified that SASS was not working. After a few tries, it decided to use plain CSS (a great choice, actually).
- Added about 10 instructions to get the CSS right the way I wanted it, after navigating and fixing.
- For the posts, I rewrote them using my own voice, and asked to fix any grammar or bad communication, so I could improve the quality of this blog.
And yeah, that’s it. Half of the other time was spent pointing the correct DNS on Squarespace and Github.
A few takeaways
Now this is an interesting post from my side. I had some issues with Cursor in the past. Most of them I’ve fixed with Rules and learning better ways to use the platform. But the technology is undoubtedly one of the best things we have. Many of my problems fell under one thing: bad engineers. I have seen many people writing horrible code using AI, deploying to production, calling it a day, and then PagerDuty calling me back explaining everything went down. AI is not a panacea; it hallucinates constantly. You need to feed it good directions, but more than that. You need to read what’s happening, you need to question whether the code produced makes sense and if it’s actually solving the problem the correct way. Asking for something, starting the server and seeing the results are amazing. But that is not production-ready code. A good engineer needs to write good code, understand design, and use AI for what it is: A fantastic tool to help improve your job.
I had a prejudice against Cursor for a while based on bad experiences. Happily, this is not the case anymore. I am creating a new app with features that otherwise would take me years, and I should have a prototype in the upcoming months, working on it only in my free time.
On scoping
Another extremely valuable thing to do in order to get the best from AI is: Isolating your scope. I am using ChatGPT heavily for this. I open a new session and give all the context of what I want to accomplish - fix a bug, create a new feature, etc. Later, I provide the files and start iterating with this information. This isolation diminishes the level of hallucinations greatly, helping a lot with fixing issues and getting shit done. And again, I review everything. If I don’t know something, I ask the model what it means. It is helping me build something, but I still hold responsibility for everything.
Use AI, improve your game. Take responsibility. Happy coding!
Consegui levar este blog do zero à produção em 1 hora. Incluindo:
- Motor do blog com Jekyll (Markdown ❤️)
- Hospedagem no Github para disponibilidade
- CSS inspirado no meu site pessoal
- Suporte a highlight de código
- Mapeamento e revisão de SEO
- 3 posts (incluindo este)
- Encaminhamento de DNS de blog.leonardopereira.com para dantetekanem.github.io
Como? Ruby e Cursor são a resposta. O primeiro dispensa apresentações: Jekyll é uma gem incrível que existe há muito tempo, e o Github Pages também oferece várias formas fáceis de começar um novo site. Você só precisa ter um repositório username/username.github.io.
Mas, sem o Cursor, isso teria levado o dia inteiro, ou talvez até alguns dias. Em vez disso, usando o poder do Composer, claude-3.7-sonnet-thinking e algumas boas instruções, ele criou tudo do zero, autocorrigiu os problemas e entregou um primeiro rascunho perfeito.
Não houve mágica nos meus comandos. Eu não tenho o conjunto exato de instruções, mas foi algo mais ou menos assim:
- Vamos criar um novo blog usando Jekyll; quero que ele pareça com meu site pessoal: leonardopereira.com
- ~ O Claude começou a trabalhar, pegou todas as gems, rodou os comandos e mais um pouco.
- Parei parte do progresso e pedi para não usar comentários por enquanto, porque eu queria avaliá-los melhor.
- ~ Na primeira sessão de debug, o CSS não estava funcionando. Reclamei, e ele fez o próprio debugging e identificou que o SASS não estava funcionando. Depois de algumas tentativas, decidiu usar CSS puro (uma ótima escolha, na verdade).
- Adicionei umas 10 instruções para deixar o CSS exatamente do jeito que eu queria, depois de navegar e corrigir.
- Para os posts, reescrevi tudo com a minha própria voz e pedi para corrigir qualquer problema de gramática ou comunicação ruim, para que eu pudesse melhorar a qualidade deste blog.
E sim, é isso. Metade do outro tempo foi gasto apontando o DNS correto no Squarespace e no Github.
Alguns aprendizados
Agora este é um post interessante da minha parte. Eu tive alguns problemas com o Cursor no passado. A maioria deles eu resolvi com Rules e aprendendo formas melhores de usar a plataforma. Mas a tecnologia é, sem dúvida, uma das melhores coisas que temos. Muitos dos meus problemas caíam em uma coisa: engenheiros ruins. Eu já vi muitas pessoas escrevendo código horrível usando AI, fazendo deploy em produção, chamando de pronto, e depois o PagerDuty me chamando de volta explicando que tudo caiu. AI não é uma panaceia; ela alucina o tempo todo. Você precisa alimentá-la com boas direções, mas mais do que isso. Você precisa ler o que está acontecendo, precisa questionar se o código produzido faz sentido e se ele realmente está resolvendo o problema da forma correta. Pedir algo, subir o servidor e ver os resultados é incrível. Mas isso não é código pronto para produção. Um bom engenheiro precisa escrever bom código, entender design e usar AI pelo que ela é: uma ferramenta fantástica para ajudar a melhorar seu trabalho.
Eu tive preconceito contra o Cursor por um tempo, baseado em experiências ruins. Felizmente, esse não é mais o caso. Estou criando um novo app com funcionalidades que, de outra forma, levariam anos, e devo ter um protótipo nos próximos meses, trabalhando nele apenas no meu tempo livre.
Sobre escopo
Outra coisa extremamente valiosa para tirar o melhor da AI é: isolar seu escopo. Tenho usado bastante o ChatGPT para isso. Abro uma nova sessão e dou todo o contexto do que quero realizar — corrigir um bug, criar uma nova funcionalidade etc. Depois, forneço os arquivos e começo a iterar com essa informação. Esse isolamento diminui muito o nível de alucinações, ajudando bastante a corrigir problemas e fazer a coisa acontecer. E, de novo, eu reviso tudo. Se não sei alguma coisa, pergunto ao modelo o que significa. Ele está me ajudando a construir algo, mas eu ainda mantenho a responsabilidade por tudo.
Use AI, eleve o seu jogo. Assuma responsabilidade. Happy coding!