Introduction
AI coding agents are transforming how developers approach programming tasks. Instead of starting with a blank file and a long list of requirements, you can collaborate with an intelligent assistant that can generate, review, and refine code in real time.
But here’s the problem: many developers still walk away with results that don’t quite match their intent. The AI may produce logically correct, perfectly formatted code, yet not what you actually need.
The issue isn’t with the AI’s capabilities. It’s with the process. Developers often fall into the “prompt and output” trap: write a detailed instruction, hope the AI interprets it correctly, and adjust afterward. This cycle wastes time.
The solution isn’t writing longer prompts. It’s adopting structured workflows that ensure the AI truly grasps what you want before it writes a single line of code. Two complementary workflows: Elicitation Mode and Interrogation Mode; close this gap. When combined, they form a fast, safe, and reliable way to work with coding agents.
This article covers:
- Why prompt-and-output isn’t enough
- How Elicitation Mode works (with instructions you can repeat)
- How Interrogation Mode works (with instructions you can repeat)
- How merging the two creates a Fast-and-Safe Workflow
- A worked example to tie it all together
- Limitations and pitfalls to keep in mind
Why Prompt and Output Aren’t Enough
The standard use of AI coding agents looks like this:
- You type a detailed prompt.
- The AI generates code.
- You hope it matches your expectations.
This approach breaks down because requirements are rarely fully expressed in the first prompt. Unless you spell out every edge case, assumption, and preference, the AI must guess. Sometimes it guesses right; often it doesn’t. The result is a frustrating back-and-forth of clarifications and revisions.
Workflows like Elicitation and Interrogation provide a fix: they structure how you and the AI exchange context before coding begins.
Workflow 1: Elicitation Mode
Definition: Elicitation Mode means you start with a broad request and allow the AI to interview you with clarifying questions.
How to Use It (Repeatable Steps)
- Give a high-level task (don’t over-specify).
- Pause and let the AI ask questions.
- Answer briefly, treating it like requirements gathering.
- Only after all questions are resolved, move to coding.
Why It Works
- Mirrors how human developers collect requirements.
- Reduces the burden of writing exhaustive prompts.
- Prevents the AI from guessing at missing details.
When to Use It
- You don’t have all the requirements figured out yet.
- The task is open-ended (e.g., “make me a scraper,” “build me a dashboard”).
- You want the AI to help structure your idea.
Example (Shortened)
Prompt: "I want a Python script to scrape headlines from a news site."
The AI asks:
- Which site?
- Headlines only or include summaries?
- Run once or on a schedule?
- Overwrite or append data?
After answering, the AI writes tailored code that avoids rework.
Workflow 2: Interrogation Mode
Definition: Interrogation Mode flips the dynamics. You interrogate the AI before it starts coding to confirm it understood you correctly.
How to Use It (Repeatable Steps)
- Write your main request.
- Ask the AI to summarize its plan.
- Check its outline for accuracy and missing parts.
- Approve or correct before moving to code.
Why It Works
- Surfaces the AI’s assumptions early.
- Let's validate the design before implementation.
- Prevents errors from cascading into long, unusable outputs.
When to Use It
- Tasks that involve multiple moving parts (e.g., APIs, automation pipelines).
- When accuracy matters more than speed.
- When you already know the end structure, you expect.
Example (Shortened)
Task: "Build an API for a to-do list."
Instead of coding right away, you ask:
Outline exactly how you'll structure the API.
The AI proposes routes, request methods, data structures, and error handling. You review, correct, and only then let it generate the code.
The Fast-and-Safe Workflow (Merging the Two)
The most effective approach blends both workflows:
This sequence balances speed with safety:
- Elicitation ensures nothing important is left unspoken.
- Interrogation ensures no hidden assumptions slip by.
- Together, they give you clarity, accuracy, and confidence before coding begins.
Think of it as "requirements gathering & design review" for AI.
Goal: Automate the creation of GitHub Gists from local .txt files using Python.
Step 1: Elicitation Mode
You start broad: "I need a Python tool to upload local text files to GitHub Gist."
The AI asks clarifying questions:
- Public or private?
- Authentication method?
- Single or multiple files?
- Preserve filenames?
You answer:
- Private
- Personal Access Token (PAT)
- Multiple files
- Preserve filenames
Step 2: Interrogation Mode
You ask: "Summarize your plan before coding."
The AI replies:
The AI replies:
- Use requests to hit the GitHub API
- Read .txt files from a folder
- Preserve filenames in JSON payload
- Use PAT for authentication
- Return the Gist URL You confirm.
Step 3: Code Generation
Here’s the full Python source code:
import os
import requests
# Replace with your GitHub Personal Access Token
TOKEN = "your_github_token_here"
API_URL = "https://api.github.com/gists"
def create_gist_from_folder(folder_path, public=False):
files = {}
for filename in os.listdir(folder_path):
if filename.endswith(".txt"):
file_path = os.path.join(folder_path, filename)
try:
with open(file_path, "r", encoding="utf-8") as f:
content = f.read()
files[filename] = {"content": content}
except Exception as e:
print(f"Error reading {filename}: {e}")
continue
if not files:
print("No .txt files found in the folder.")
return
payload = {
"description": "Automated Gist upload",
"public": public,
"files": files
}
try:
response = requests.post(
API_URL,
headers={"Authorization": f"token {TOKEN}"},
json=payload
)
response.raise_for_status()
gist_url = response.json().get("html_url")
print(f"Gist created successfully: {gist_url}")
except requests.exceptions.RequestException as e:
print(f"Error creating Gist: {e}")
# Example usage
if __name__ == "__main__":
folder = "path_to_your_txt_files"
create_gist_from_folder(folder, public=False)
Key Features:
- Reads all .txt files in a folder.
- Preserves filenames as Gist keys.
- Uses GitHub API with authentication.
- Includes error handling for file reading and API failures.
Limitations and Pitfalls
While powerful, these workflows are not always the right choice.
Overhead for Simple Tasks:
- If you just want a one-liner (e.g., “Write a Python function to reverse a string”), running through Elicitation + Interrogation takes longer than writing it yourself.
- Use these workflows for medium to complex tasks, not trivial snippets.
Too Many Questions:
In Elicitation Mode, the AI might over-ask or get stuck in a loop of questions. Be ready to set boundaries: “Stop asking, start coding.”
False Confidence:
Even with Interrogation Mode, the AI’s plan may look sound but still miss hidden pitfalls. Always test outputs critically.
Human Judgment Still Required:
These workflows don’t replace your technical expertise. They guide the AI, but you remain the architect of the solution.
Rule of Thumb
- Use
Elicitation
andInterrogation
for structured, multi-step coding tasks. - Skip them for trivial or exploratory tasks.
Why This Approach Works Consistently
Across multiple coding tasks, this Fast-and-Safe Workflow delivers:
- **Clarity first: **Intent is gathered and validated before coding.
- Speed: You answer questions instead of drafting exhaustive prompts.
- Accuracy: Misunderstandings are caught early.
- Confidence: You know the AI’s plan before seeing the code.
Developers report:
- Up to 40% faster time to first correct output
- Fewer frustrating back-and-forth cycles
- Higher confidence in production-ready code
Conclusion
AI coding agents can accelerate your workflow, but only if they truly understand what you want. The key is moving away from raw “prompt and output” and toward structured processes that eliminate guessing.
Elicitation Mode ensures no requirements are left unsaid.
Interrogation Mode ensures no assumptions go unchecked.
Together, they form a Fast and Safe Workflow that balances speed with reliability.
Whether you’re building prototypes, writing automation scripts, or designing APIs, this workflow transforms the AI from a code generator into a genuine coding partner.
Adopt it once, and you’ll find yourself coding faster, safer, and with fewer wasted cycles, while knowing when to skip it for small, simple tasks.
You can reach out to me via LinkedIn
Top comments (0)