Step 1: Run the Starter App#

What Usually Goes Wrong#

Most AI coding guides make you read ten pages of setup options before you ever run a program. Worse, teams often check one person's personal AI shortcuts into the shared Git repo, forcing every teammate to work the exact same way.

What to Do Instead#

First, get the sample Go app running in two commands so you know everything works. Second, keep two kinds of AI files cleanly separated:

  • Repo Contract (AGENTS.md, REVIEW.md): lives inside the Git repository and states what the project requires (test commands, coverage, Go rules) without forcing how anyone works.
  • Personal AI Workflow (~/.config/opencode/ or ~/.gemini/config/): lives in your home folder and holds how you like to work with your harness (OpenCode or Antigravity agy).

Both are installed safely by scafctl, an open-source CLI to declaratively discover data, shape configuration, and run portable workflows for humans and AI agents without stepping on an existing configuration.


Walk Through It#

Works natively on Linux, macOS, and Windows: Every tool in this guide runs across all three operating systems. Before Step 1, install two CLIs:

  • scafctl (packaged for Linux, macOS, and Windows on amd64 and arm64): follow the scafctl Installation Guide (brew install oakwood-commons/tap/scafctl on macOS/Linux, or .tar.gz / Windows .zip binaries from GitHub Releases).
  • OpenCode (Linux, macOS, Windows): install from opencode.ai and run opencode auth once to connect your cloud model provider (or use Antigravity agy with -r harness=agy).
  • Go 1.26+: if Go 1.26+ is already installed, you are set. If Go is missing or older, Step 1 includes a one-line scafctl action (--action install-go) that installs Go 1.26+ for Linux, macOS, or Windows without sudo or admin rights.
  1. Initialize your harness setup (and Go 1.26+ if needed) with agentic-code

    With scafctl installed on Linux, macOS, or Windows, initialize your starter skills and make sure Go 1.26+ is ready:

    # Preview without writing any files
    scafctl run solution agentic-code --dry-run
    
    # Add missing starter skills, agents, commands & CEL-merge MCP/policy into ~/.config/opencode
    # (preserves your existing models, providers & plugins, and creates a .bak backup before merging)
    scafctl run solution agentic-code
    
    # Using Antigravity (agy) instead of (or alongside) OpenCode?
    # Pass -r harness=agy (or -r harness=both) to generate ~/.gemini/config skills, agents, rules & MCP:
    # scafctl run solution agentic-code -r harness=agy
    
    # Ensure Go 1.26+ is installed (no-op if already 1.26+; otherwise installs into ~/.local/go)
    scafctl run solution agentic-code --action install-go

    Already have your own OpenCode or Antigravity (agy) config?

    • Smart CEL merge (no manual copy-pasting): On OpenCode, scafctl parses any existing opencode.json or opencode.jsonc in place, keeps 100% of your "model", "providers", "agents", "plugins", and custom skills untouched, and merges in only the missing "instructions", scafctl MCP server, and safety permissions (gh pr merge: deny) with a .bak backup. With -r harness=agy (or both), it converts role agents and standalone commands into the extra SKILL.md playbooks agy needs and non-destructively merges scafctl into ~/.gemini/config/mcp_config.json.
    • Want 100% isolation or a later refresh? Install into a temporary folder (scafctl run solution agentic-code -r config_dir=./temp/opencode-config, or -r agy_config_dir=./temp/agy-config for agy) and launch OpenCode with OPENCODE_CONFIG_DIR=$PWD/temp/opencode-config opencode ($env:OPENCODE_CONFIG_DIR="$PWD\temp\opencode-config"; opencode in PowerShell). OpenCode still reuses your existing opencode auth logins while leaving ~/.config/opencode untouched. To refresh bundled skills after a future release, pass -r overwrite=true (.bak backups are saved automatically).

    What you should see: agentic-code adds the starter skills (planner, create-issue, github-issues, jira-issues, local-issues, stepwise-interview, tdd, go, security-audit, finish-issue), subagents, and commands (browse all playbooks and see how prompts, rules, skills, subagents, and commands differ in Skills, Agents & Commands), verifies gh CLI, and confirms Go 1.26+ is ready.

  2. Clone this repository to get the shorty practice app & local tools

    Now clone sln-agentic-code so you have the shorty starter Go app on your machine. scafctl reads actions.yaml, detects whether you are on Linux, macOS, or Windows, and verifies or downloads the pinned repo tools (go 1.26+, hugo, gh, golangci-lint, and gosec) into .tool/ with no sudo or admin rights required:

    git clone https://github.com/oakwood-commons/sln-agentic-code.git
    cd sln-agentic-code
    
    scafctl run action install-tools

    (Working offline or testing uncommitted edits to the starter? Run scafctl run solution -f ./scafctl/solution.yaml from inside the clone.)

    What you should see: hugo, gh, golangci-lint, and gosec are verified or downloaded into .tool/bin in a few seconds.

  3. Run the starter Go tests & try shorty live

    Verify that the sample Go URL shortener in examples/go-app/ passes its starter checks:

    scafctl run action go-ci

    Notice the 87%+ test coverage already guarding POST /links and GET /{code}. Those existing behavior tests are why you can let AI add new features in Step 3 with confidence: every test run proves existing links and error cases still work without regressions. (Adopting this workflow on an older codebase with weak test coverage? Make adding public-behavior tests your very first AI task before building new features.)

    Now start shorty in one terminal tab and shorten a URL from a second tab (click Bash or PowerShell below if your shell differs; your choice sticks across the rest of the guide):

    # Terminal 1: start the URL shortener on port 8080
    cd examples/go-app
    go run ./cmd/shorty -addr :8080
    # Terminal 2: create a short link, then follow the redirect headers
    curl -s -X POST http://localhost:8080/links \
      -H "Content-Type: application/json" \
      -d '{"url":"https://github.com/oakwood-commons/scafctl"}'
    
    # Replace <code> below with the 6-character code printed above:
    curl -i http://localhost:8080/<code>
    

    What you should see: POST /links returns {"code":"...","url":"..."}, and GET /<code> returns HTTP/1.1 302 Found with a Location: header pointing back to the original URL. Press Ctrl+C in Terminal 1 when done.


Why shorty Needs a New Feature#

shorty works, and the whole server is ~150 lines of plain Go in examples/go-app/internal/shortener/shortener.go. Right now it has two obvious gaps:

  1. Every link lives forever, even temporary promo or invite links.
  2. There is no click counter, so you cannot check whether anyone ever used your link.

In Step 2, you will scope optional link expiration and click counts, starting with a quick plain-English conversation instead of a blind code dump.