The Importance of Questioning When Coding with AI

jcubic1 pts0 comments

The Importance of Questioning When Using AI AgentsSkip to main contentThe other day I've seen this post in a Twitter community.

And few days before that I had this idea when the agent was thinking and struggle to follow my instructions. I was looking at his reasoning process. And think myself, to end his missery and just change the taktic.<br>I asked him to implement something in Bash, and he was "wrestling" and was thiking how to write this bash script to follow my instructions. So canceled his reasoning, and said "let's use Python".<br>Here is a transcript with collapsed thinking, same experience as I have with Agent-Shell in Emacs.<br>When I was working on my project Clarity<br>Conversation with Claude<br>## User (2026-06-27 01:03:15)<br>it doesn't make sense to install composer dependenices twice. Please modify the script to be in bash. So there is no need to have dependenices.<br>## Agent's Thoughts (2026-06-27 01:03:18) The user wants me to convert the extract-icons.php script to bash so that it doesn't require PHP (and therefore Composer dependencies) to run during the build. The extract script reads SVG files and extracts path d attributes via regex - this can easily be done with bash + grep/sed.<br>Actually wait, let me re-read. The user says "it doesn't make sense to install composer dependencies twice." The Makefile has make vendor which runs composer install, and then make icons which runs PHP scripts that don't need Composer dependencies (they're standalone PHP scripts).<br>I see now - the GitHub workflow runs make vendor and then Wasmer's --build-remote probably also runs composer install. But the real issue is that the user wants to eliminate PHP entirely from the build step so there's no need for setup-php in the workflow at all. I should convert both the extract and build icon scripts to bash, which means reading through files.txt, processing each SVG file from the theme directory, and extracting the path d attributes using standard Unix tools.<br>For the extract script, I need to output valid JSON from bash - I can either use jq or manually construct the JSON with proper comma handling. For the build script, it's mostly string replacement work where I read the icons.json, find the template files, and for each template-icon combination, replace the placeholders and optimize the SVG output.<br>The real motivation here is that converting these to bash means the GitHub workflow won't need PHP setup just to extract the icons - the Composer install is still needed for the actual web app (Slim/Twig), but that's handled separately by Wasmer's remote build or the workflow itself. So I'll convert both scripts to bash.<br>Converting extract-icons.php to bash... Writing the extraction logic...<br>I'm finishing up the JSON output and then realizing that using Perl regex might not be portable across all systems, so I should consider a more compatible approach for extracting the path data from the SVG files.<br>For the build script, I need to parse the icons.json file to get each icon's name and path data, then iterate through templates and perform string replacements for each icon combination. I'll use jq to extract the name and d attributes from the JSON in a tab-separated format that's easy to process in bash.<br>Now I'm mapping out the sed transformations needed to clean up the SVG output—removing the XML declaration, namespace attributes, metadata blocks, and various style properties. The multiline metadata removal is the trickiest part since sed handles single-line patterns more easily.<br>I'll preprocess each template once to strip out all the unnecessary elements, then use that cleaned version for the per-icon substitutions. For the path data substitution, I need to pick a sed delimiter that won't conflict with the SVG path syntax—| should work since path data only contains letters, numbers, commas, spaces, periods, and minus signs.<br>For the title generation, I'm converting the icon name by replacing hyphens with spaces and capitalizing the first letter of each word using sed's uppercase transformation.<br>Now I need to be careful when substituting the path data into the SVG template—since sed treats & as a special character representing the matched string, I'll need to escape any & characters in the path data before passing it to sed to avoid unintended replacements.<br>Actually, using bash's built-in string replacement with ${variable//pattern/replacement} is safer and cleaner than sed for this substitution, since it treats the replacement as a literal string and won't have issues with special characters like & or /. This avoids the escaping problem entirely.<br>For the template optimization, I can still use sed once per template to strip out the XML declaration, namespaces, and other metadata, then store that cleaned version in a variable to reuse for each icon substitution. Now I'm structuring the build script to read the icon data, iterate through each template variant, and optimize it once before processing all the icons.<br>Writing build script......

bash script build path icon composer

Related Articles