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:

  1. 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 (404 vs. 410 Gone, default TTL, expired stats) and dumps 250 lines of Go you did not ask for.
  2. Prescribing how instead of what ("Run a 1-second time.Ticker goroutine 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, and shortener.go, so it already knows shorty is in-memory and stdlib-only. Only mention stack choices when introducing something not in the repo yet (for example, "and let's use sqlite").
  • Supply why, leave the API & how open: State what you want and the use case ("for temporary promo links"). Let planner, create-issue, and stepwise-interview inspect 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 planner and create-issue reliably 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.
Avoid No intent, straight to code (forces silent guesses)
"Add expiring links and stats."

Result: No use case and no plan gate. The AI guesses three product rules and writes 250 lines of Go immediately.

Avoid Prescribing how (locks in a flawed mechanism)
"Add expires_in int64, run a 1s time.Ticker goroutine to delete expired map entries, and count clicks in a sync.Map."

Result: AI builds your ticker goroutine instead of a simpler lazy check, and deleting expired entries wipes out final click totals.

Do This Goal + why in plain English (skills handle the rest)
"Let's create an issue for shorty to support optional expiring links (for temporary promo links) and a way to check click counts."

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#

  1. Launch your coding harness inside the repository

    From the root of sln-agentic-code, start OpenCode (or agy):

    opencode
  2. Describe 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, and local-issues, inspects examples/go-app/, and sees MemoryStore + Go stdlib-only on its own.
    • Looking at existing POST /links and GET /{code}, it proposes a clean API (expires_in seconds on POST /links and GET /links/{code}/stats so 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), keeping 404 Not Found for unknown codes.
      • Omitted expires_in: Optional (0 or omitted lives forever; negative numbers return 400 Bad Request).
      • Stats after expiry: Because promo creators care about final campaign results, GET /links/{code}/stats still returns 200 OK with {"code":"...","url":"...","clicks":N,"expired":true}.
    • Before saving, create-issue previews a two-half draft in chat:
      1. 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.
      2. 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-issues saves temp/issues/001-expiring-links-and-stats.md so 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-issue with three tracker skills (local-issues, github-issues, and jira-issues via 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 in AGENTS.md via init-repo).

    Confused by a term? Reply "what do you mean?" or "I don't follow". Your standing policy and the wait-what skill cue the AI to drop jargon and re-explain in plain sentences (or type /wait-what to force it explicitly).

  3. Start a fresh session & skeptically plan from the issue

    Start a clean session (/new, or exit and launch opencode again) so brainstorming chatter is cleared, then point planner at 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 #42 or PROJ-123.)

    What you should see: Even when an AI helped draft the issue, planner treats it as a hypothesis: verifying every assumption against shortener.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.