Step 2: Ask & Plan First#
What Usually Goes Wrong#
People often call bad AI code "hallucination", when in reality the AI is simply giving the best answer it can from incomplete context. Everyday prompts usually fail in two opposite ways:
- Jumping straight to code with zero intent ("Add expiring links and
stats"): With no why and no plan step, the AI silently guesses product
rules (
404vs.410 Gone, default TTL, expired stats) and dumps 250 lines of Go you did not ask for. - Prescribing how instead of what ("Run a 1-second
time.Tickergoroutine to delete expired map entries..."): AI models try hard to give you what they think you asked for. Over-specifying the mechanism locks the AI into clunky concurrency, and deleting expired entries from the map silently wipes out final promo click counts.
Plain English + Auto-Loaded Skills#
You do not need a code editor open or a paragraph of meta-instructions on every
prompt. Each installed skill has a short
description header exposed to the model on every turn alongside your standing
workflow-policy.md:
- Skip repeating repo facts: Your harness already reads
AGENTS.md,go.mod, andshortener.go, so it already knowsshortyis in-memory and stdlib-only. Only mention stack choices when introducing something not in the repo yet (for example, "and let's usesqlite"). - Supply why, leave the API & how open: State what you want and the use
case ("for temporary promo links"). Let
planner,create-issue, andstepwise-interviewinspect existing routes, propose the cleanest API and mechanism, and ask one plain-English question at a time for genuine edge cases. - Probabilistic prose vs. deterministic slash commands: Matching skills from
plain English is a model judgment call. Strong reasoning models load
plannerandcreate-issuereliably from natural prose, while smaller or faster models can occasionally skip a tool call. Use slash commands (/plan,/create-issue,/wait-what,/finish-issue) whenever you want a 100% deterministic override.
Result: No use case and no plan gate. The AI guesses three product rules and writes 250 lines of Go immediately.
Result: AI builds your ticker goroutine instead of a simpler lazy check, and deleting expired entries wipes out final click totals.
Result: create-issue and planner inspect shortener.go, clarify edge cases one at a time, and draft a two-layer issue for your review.
Walk Through It#
Launch your coding harness inside the repository
From the root of
sln-agentic-code, start OpenCode (oragy):opencodeDescribe what you want & review the two-layer issue draft
Paste this plain-English prompt:
Let's create an issue for shorty to support optional expiring links (for temporary promo links) and a way to check click counts.What happens under the hood:
- Your harness loads
create-issue,stepwise-interview, andlocal-issues, inspectsexamples/go-app/, and seesMemoryStore+ Go stdlib-only on its own. - Looking at existing
POST /linksandGET /{code}, it proposes a clean API (expires_inseconds onPOST /linksandGET /links/{code}/statsso stats never collide with 6-character codes) and asks one plain-English question at a time for the edge cases:- Expired redirect status:
410 Gone(ErrExpired), keeping404 Not Foundfor unknown codes. - Omitted
expires_in: Optional (0or omitted lives forever; negative numbers return400 Bad Request). - Stats after expiry: Because promo creators care about final campaign
results,
GET /links/{code}/statsstill returns200 OKwith{"code":"...","url":"...","clicks":N,"expired":true}.
- Expired redirect status:
- Before saving,
create-issuepreviews a two-half draft in chat:- Top half in Plain English (for you): Summary & Why, Agreed Behavior & Edge Cases, and Acceptance Criteria, so you can verify intent in 20 seconds without reading Go code.
- Bottom half with Technical Context (for the AI): relevant packages, existing test patterns, constraints, and verification seams, giving Step 3's coding session grounded context without locking it into brittle line-by-line code prescriptions.
- Once you confirm,
local-issuessavestemp/issues/001-expiring-links-and-stats.mdso you can practice locally without needing write access to the upstream GitHub repo.
Same issue format across Local files, GitHub Issues, and Jira: The starter bundle pairs
create-issuewith three tracker skills (local-issues,github-issues, andjira-issuesvia Atlassian MCP). On real projects you can say "create a GitHub issue for..." or "create a Jira ticket in PROJ for..." (or configure your repo's default inAGENTS.mdviainit-repo).Confused by a term? Reply
"what do you mean?"or"I don't follow". Your standing policy and thewait-whatskill cue the AI to drop jargon and re-explain in plain sentences (or type/wait-whatto force it explicitly).- Your harness loads
Start a fresh session & skeptically plan from the issue
Start a clean session (
/new, or exit and launchopencodeagain) so brainstorming chatter is cleared, then pointplannerat the issue:Have a look at issue 001 and come up with a detailed plan to implement it.(On a GitHub or Jira project, use the same prompt with
issue #42orPROJ-123.)What you should see: Even when an AI helped draft the issue,
plannertreats it as a hypothesis: verifying every assumption againstshortener.go(file:line), recommending a lazy expiration check via an injectable clock seam instead of a background goroutine, and breaking the work into two small testable steps without modifying a single file yet.
In Step 3, you will build those two steps and verify them with tests, linters, and a live local run, still without opening a code editor.