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 Antigravityagy).
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 onamd64andarm64): follow thescafctlInstallation Guide (brew install oakwood-commons/tap/scafctlon macOS/Linux, or.tar.gz/ Windows.zipbinaries from GitHub Releases).- OpenCode (Linux, macOS, Windows): install from opencode.ai and run
opencode authonce to connect your cloud model provider (or use Antigravityagywith-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
scafctlaction (--action install-go) that installs Go 1.26+ for Linux, macOS, or Windows withoutsudoor admin rights.
Initialize your harness setup (and Go 1.26+ if needed) with
agentic-codeWith
scafctlinstalled 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-goAlready have your own OpenCode or Antigravity (
agy) config?- Smart CEL merge (no manual copy-pasting): On OpenCode,
scafctlparses any existingopencode.jsonoropencode.jsoncin place, keeps 100% of your"model","providers","agents","plugins", and custom skills untouched, and merges in only the missing"instructions",scafctlMCP server, and safety permissions (gh pr merge:deny) with a.bakbackup. With-r harness=agy(orboth), it converts role agents and standalone commands into the extraSKILL.mdplaybooksagyneeds and non-destructively mergesscafctlinto~/.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-configforagy) and launch OpenCode withOPENCODE_CONFIG_DIR=$PWD/temp/opencode-config opencode($env:OPENCODE_CONFIG_DIR="$PWD\temp\opencode-config"; opencodein PowerShell). OpenCode still reuses your existingopencode authlogins while leaving~/.config/opencodeuntouched. To refresh bundled skills after a future release, pass-r overwrite=true(.bakbackups are saved automatically).
What you should see:
agentic-codeadds 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), verifiesghCLI, and confirms Go 1.26+ is ready.- Smart CEL merge (no manual copy-pasting): On OpenCode,
Clone this repository to get the
shortypractice app & local toolsNow clone
sln-agentic-codeso you have theshortystarter Go app on your machine.scafctlreadsactions.yaml, detects whether you are on Linux, macOS, or Windows, and verifies or downloads the pinned repo tools (go1.26+,hugo,gh,golangci-lint, andgosec) into.tool/with nosudoor 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.yamlfrom inside the clone.)What you should see:
hugo,gh,golangci-lint, andgosecare verified or downloaded into.tool/binin a few seconds.Run the starter Go tests & try
shortyliveVerify that the sample Go URL shortener in
examples/go-app/passes its starter checks:scafctl run action go-ciNotice the
87%+test coverage already guardingPOST /linksandGET /{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
shortyin 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># Terminal 2: create a short link, then inspect the 302 redirect headers $link = Invoke-RestMethod -Method Post -Uri http://localhost:8080/links ` -ContentType "application/json" ` -Body '{"url":"https://github.com/oakwood-commons/scafctl"}' $link # Inspect the 302 Found + Location header without following the redirect: curl.exe -i "http://localhost:8080/$($link.code)"What you should see:
POST /linksreturns{"code":"...","url":"..."}, andGET /<code>returnsHTTP/1.1 302 Foundwith aLocation:header pointing back to the original URL. PressCtrl+Cin 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:
- Every link lives forever, even temporary promo or invite links.
- 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.
- Using OpenAI, Gemini, Copilot, or local Ollama instead of Anthropic? See Customizing Models & Plugins.