by AdieuToLogic · 1y ago · 0 comments
Here is a simple example which took 4 iterations using Gemini to get a result requiring no manual changes:
# Role
You are an expert Unix shell programmer who comments their code and organizes their code using shell programming best practices.
Create a bash shell script which reads from standard input text in Markdown format and prints all embedded hyperlink URL's.
The script requirements are:
- MUST exclude all inline code elements
- MUST exclude all fenced code blocks
- MUST print all hyperlink URL's
- MUST NOT print hyperlink label
- MUST NOT use Perl compatible regular expressions
- MUST NOT use double quotes within comments
- MUST NOT use single quotes within comments
EDIT:For reference, a hand-written script satisfying the above (excluding comments for brevity) could look like:
#!/usr/bin/env bash
perl -ne 'print unless /^```/ ... /^```/' |
sed -e 's/`[^`]*`//g' |
egrep -o '\[.+?\]\(.+?\)' |
sed -e 's/^.*(//' -e 's/)$//'
0 - https://en.wikipedia.org/wiki/Constraint_programming(While we're at it, there's no need for an apostrophe when pluralising an initialism, like "URLs".)
Please read posts fully before replying:
For reference, a hand-written script satisfying the above
(excluding comments for brevity) ...EG: Step 1: Define problem in PROBLEM.md Step 2: Ask agent to gather scope from codebase and update PROBLEM.md Step 3: Ask agent to create a plan following design and architecture best practices (solid, etc) and update PROBLEM.md Step 4: Ask agent to implement PROBLEM.md
My use of MUST/MUST NOT is from experience with various web specification documents and is capitalized more for visual recognition than any other reason. Having only used this form, I cannot answer your question as to document generation impact. I would imagine use of Markdown emphasis, such as:
- _must not_ ...
Would have some effect though. Perhaps both even more?