Pairing structured Agent Skills with custom CLI tools gave me the biggest reliability jump I've seen in LLM workflows. Before that clicked, the agent kept skipping discovery steps, guessing flags, or improvising fixes mid-run.
Here are the design rules that actually fixed it.
1. Control the todo list, and don't read ahead
When an agent builds its initial todo list while holding mistaken assumptions, it carries those misconceptions straight into execution. Splitting workflows into numbered protocol files (where the agent must read only the current step, complete it, summarize what it learned, and only then read the next) keeps discovery ahead of action:
IMPORTANT: Do not read these files ahead of time. Work through them in order:
1. [acknowledge mandatory halt protocol](001_mandatory_halt.md)
2. [do foundational learning](002_foundational_learning.md)
3. [do project discovery](003_project_discovery.md)
4. [take project actions](004_project_action.md)
Each protocol opens with an explicit Trigger Condition (such as halting immediately on any non-zero CLI exit code) and focuses on one stage at a time.
2. Teach how to learn; avoid concrete examples
Including concrete examples in workflow instructions makes the agent far more likely to parrot that example instead of inspecting the real project. Replacing "how to run project X" with "how to inspect any project's config before running", and keeping future-stage details out of early steps, stopped premature execution.
3. Drop the shouting and keep files short
Repeating CRITICAL!! MOST IMPORTANT!! NEVER FORGET!! everywhere flattens emphasis: if everything is urgent, nothing is. Trimming instructions under ~200 lines and cutting all-caps lecturing improved adherence and made skills far nicer to maintain.
4. Handle shorthand and explicit acknowledgments
- Fuzzy project resolution: Adding a brief instruction telling the agent to list directories first and resolve typos or acronyms against real folder names made short natural-language prompts work reliably.
- Explicit acknowledgment: Asking the agent to explicitly acknowledge future stop/halt rules up front noticeably improved compliance when errors occurred later in the run.
5. Make your CLIs agent-friendly
"The best possible tool for any situation is Bash: if your agent can run arbitrary shell commands, it can do anything."
Small CLI improvements made a huge difference in agent reliability:
- Non-TTY
--prettyoutput: Machine-parsable bare lists are great for pipes, while--prettytables with active markers (*) and one-line descriptions let the agent understand available flags in a single call. - Clear confirmation messages: Commands that succeed silently (
exit 0with empty stdout) often caused the agent to doubt whether anything happened. Printing a shortinfo: clearedline fixed that loop. - Actionable errors with
pwd: Instead ofinvalid config, printing"Must be run from a project directory (pwd: /path/to/code)"tells the agent both what failed and where it actually is. - TTY detection: Interactive commands (log tails, auth prompts) can detect non-TTY execution and spawn an interactive terminal cleanly instead of hanging in a headless shell.