Over the past two years, I have harnessed the power of AI tools to develop 10 Obsidian plugins—a journey filled with frustration, learning, and ultimate satisfaction. Despite having little knowledge of TypeScript at the start, AI transformed the way I approach coding, enabling me to create solutions that address long-standing gaps in my workflow. This journey not only taught me valuable lessons about programming in TypeScript but also revealed the true potential of collaborating with AI.
The Initial Spark and Early Aspirations
My journey began when I found that, while taking notes at work, I constantly struggled with managing task statuses and attaching accurate timestamps. I initially believed that requesting new features from existing plugins would be the easiest path. Although some feature requests were implemented quickly, many remained on the back burner for a year or more. As an end-user with pressing needs, I realized that waiting was not an option.
The idea was simple: if I could have a tool that effortlessly changed task statuses (incomplete, complete, canceled, bookmarked, etc.) and automatically recorded when tasks were created or completed, my note-taking process would finally be streamlined. This insight drove me to explore AI-assisted development.
“I learned early on was the importance of clear, detailed communication with AI. Vague prompts often resulted in solutions that diverged from my true intentions.”
– True.
Also, a coding mindset is also necessary, because it’s you guiding the bot who helps you.
What I also found that even the best AI models can arbitrarily make syntax errors (changes my smart quotes to dumb ones without even my having asked for it or change properly working bits of code to do with slices without my asking for it) so before accepting the new edits, it’s good to go through what was changed.
Also, another tip: when you think there’s been a bog-down, take the whole code to to a different session to the same AI or maybe even another model, because it’s very hard to get out of bog-downs and the bot doesn’t seem able to forget that it must not go back to the place which led to the bog-down.
So, it’s good to keep your main objective prompts and nudging prompts to do with implementing fixes for smaller details saved and at hand for starting over in a new session.
My similar reminder is “while keeping all existing functionality of the current script, do this or do that.”
Also, another issue that crops up: many lines of long, repetitive code, e.g. to do with replacements are often omitted. Basically deletes stuff without asking.
Another: look for parts when it says “/ Same implementation as above”: it’s when it’s lazy repeating the same lines with only a little bit of difference in them.
Basically I had to tell it that “don’t give me jobs, I’ll give you jobs.”
Otherwise, when back in the day I had started out with chatGPT I always asked for full scripts, which are especially needed when one’s new at Javascript and doesn’t know where to put indents and how many. Problem is when you copy code from the browser, pasting it properly is still a hassle.
BTW, I don’t really do browser prompts and code generation anymore, only to start things off, then I save the script and continue with VSCode Editor, Cursor or other apps where I run down the monthly free tier limit for my own purposes.
It’s good to have some code to continue from, because it sets the context well enough to start off in the session.
Same with regexes: try to do it yourself on regex101, then take it to AI to help you finish it.
Complex regexes are still a bit difficult for AI, but possibly because the user doesn’t formulate well enough what is needed.