Accept, Reject, Iterate: A Healthy Workflow with AI Suggestions
Build the habit of evaluating suggestions — the loop that prevents Copilot-induced bugs.
What You Will Learn
- Adopt the read-evaluate-accept-or-iterate loop.
- Define a personal rule for when to accept vs reject.
- Use follow-up prompts to iterate on bad suggestions.
- Build verification into every acceptance.
- Recognize anti-patterns like Tab-Tab-Tab.
Why This Matters
The single biggest source of Copilot-induced bugs is accepting suggestions without reading them. The single biggest source of Copilot disappointment is rejecting good suggestions because the prompt was vague. This lesson gives you a loop that prevents both.
Concept Explained
Every Copilot suggestion deserves a deliberate read. The mental loop is: read → evaluate → accept or iterate → verify. Reading means understanding what the code does. Evaluating means judging it against your intent and conventions. Accepting means committing; iterating means refining the prompt. Verifying means running tests or checking output.
How It Works
The loop runs on every suggestion. Reading is mental, takes 2–10 seconds. Evaluating compares the suggestion to: correctness, idioms, security, performance, edge cases. Accepting = Tab. Iterating = follow-up prompt. Verifying = run tests or execute. The loop closes when the suggestion is correct and verified.
Step-by-Step Tutorial
1. Read
Read the suggestion word-by-word. Don't skim. Identify what each line does.2. Evaluate
Ask: is it correct? Idiomatic? Secure? Handles edge cases? Matches our conventions?3. Accept or iterate
If yes, accept. If no, write a follow-up prompt that targets the issue.4. Verify
After accepting, run tests or execute. Don't trust until verified.5. Document
For non-trivial suggestions, note why you accepted — helps with code review later.Real-World Example
A developer accepted a Copilot suggestion for a JWT validation function without reading it carefully. The function looked correct but accepted tokens with `alg: none` — a known JWT vulnerability. Two weeks later a security audit caught it. The fix was a one-line change, but the trust cost was higher. A 30-second read would have caught the issue.
Example Prompts / Commands / Code
# Initial prompt:
function authenticate(token) { ... }
# Copilot suggests:
function authenticate(token) {
const decoded = jwt.decode(token);
return decoded.user;
}
# Iterate (reject, then):
Add signature verification. Reject alg=none. Throw on invalid token.
# Better suggestion:
function authenticate(token) {
const decoded = jwt.verify(token, SECRET, { algorithms: ['HS256'] });
if (!decoded.user) throw new Error('Invalid token');
return decoded.user;
}
Common Mistakes
- Tab-Tab-Tab — accepting without reading.
- Rejecting good suggestions because the prompt was vague.
- Iterating endlessly — sometimes the model just can't help; write it yourself.
- Accepting without verifying — tests catch what your eyes miss.
Best Practices
- Read every suggestion; don't skim.
- Define a personal rule: accept if correct, idiomatic, secure, and matches conventions.
- Iterate via follow-up prompts rather than starting over.
- Verify every acceptance with tests or execution.
- For non-trivial code, document why you accepted for code review.
Troubleshooting
| Problem | How to Fix |
|---|---|
| Iteration isn't improving | The model can't help with this task. Write it yourself or try a different model. |
| Always rejecting | Your prompts may be too vague. See BE-15 on specificity. |
| Accepting but tests fail | Verify immediately after accepting. Don't accumulate untested code. |
Practical Exercise
Your Turn
Pick a function you need to write. Use Copilot to generate a first draft. Apply the read-evaluate-accept-or-iterate loop until you have a version you'd commit. Write down how many iterations it took.
Key Takeaways
- Loop: read → evaluate → accept or iterate → verify.
- Reading is non-negotiable — never Tab without reading.
- Iterate via follow-up prompts, not by starting over.
- Verify every acceptance with tests or execution.
- Document non-trivial acceptances for code review.
Frequently Asked Questions
How long should I spend reading?
What if I'm not sure if a suggestion is correct?
Is rejecting bad for the model?
Further Reading
Official References
Related lessons: BE-07, BE-15, BE-31
SEO Metadata
SEO title: Accept, Reject, Iterate: A Healthy Workflow with AI Suggestions
Meta description: Build the habit of evaluating suggestions — the loop that prevents Copilot-induced bugs.
Primary keyword: accept, reject, iterate
Secondary keywords: accept, reject, iterate: a healthy workflow with ai suggestions
Search intent: Informational
URL slug: /accept-reject-iterate-copilot-workflow
Categories: AI Tools, GitHub Copilot
Tags: GitHub Copilot, Beginner, Workflow, Verification, IMCSEIAN, Tutorial, IMCSEIAN
Featured image concept: IMCSEIAN lesson card for Accept, Reject, Iterate: A Healthy Workflow with AI Suggestions
Comments
Comments
Post a Comment