Onboarding An Existing Codebase
In this tutorial you will add Slipway to an existing repository without changing application behavior. The goal is to create durable, source-backed repo context before you ask an AI agent to plan feature work.
What You Will Build
Section titled “What You Will Build”You will create or refresh the codebase map under artifacts/codebase/, then
run one small pilot governed change that uses that map.
Prerequisites
Section titled “Prerequisites”- A working
slipwaybinary. - An existing Git repository.
- An AI coding tool that can read files and run the Slipway CLI.
Start in the existing repo:
cd path/to/existing-repogit status --short --branchIf the repo is already dirty, decide whether the dirty files belong to your onboarding work. Preserve unrelated edits.
Step 1: Initialize Slipway
Section titled “Step 1: Initialize Slipway”slipway init --tools codexUse the adapter IDs for your team:
slipway init --tools claude,codex,opencodeInspect what was generated:
git status --shortStep 2: Build The Baseline Codebase Map
Section titled “Step 2: Build The Baseline Codebase Map”slipway codebase-map --jsonThis creates durable repo-scoped context under:
artifacts/codebase/The generated baseline is detected facts, not final authored analysis. Inspect the files:
find artifacts/codebase -maxdepth 1 -type f | sortStep 3: Ask The AI To Author Source-Backed Context
Section titled “Step 3: Ask The AI To Author Source-Backed Context”Paste this prompt into your AI coding tool:
Use Slipway's codebase-map instructions to refine artifacts/codebase/. Preservereal baseline facts from `slipway codebase-map`, but add only source-backedconventions and risks. Cite file paths for every convention. Do not refactor oredit application code during onboarding.
Start with:- slipway instructions stack --json- slipway instructions architecture --json- slipway instructions testing --json- slipway instructions concerns --jsonReview the result like code. Remove any rule that is not tied to a current file, test, build script, config file, or existing doc.
Step 4: Create A Small Pilot Change
Section titled “Step 4: Create A Small Pilot Change”Pick the smallest useful change that can prove the map helps. Good pilots:
- Add a missing test around an existing helper.
- Update one docs page to match current commands.
- Fix a small bug with a known reproduction.
- Add a health check endpoint only if the repo’s routing and test patterns are already clear.
Create the governed change:
slipway new "pilot change using the codebase map" --preset standardInspect the handoff:
slipway next --json --diagnosticsThe input_context.codebase_map_status field tells you whether Slipway sees
the map as missing, scaffold-only, baseline, partial, or populated. If it is
baseline-only and the task depends on conventions, stop and improve the map
before planning.
Step 5: Plan With The Map In Context
Section titled “Step 5: Plan With The Map In Context”Paste this prompt:
Continue the active Slipway change. During intake and planning, useartifacts/codebase/ as advisory repo context. Do not invent conventions that arenot in the map or supported by current files. Keep the pilot small enough thatone task can verify whether the map improved planning.After each handoff:
slipway validateslipway next --json --diagnosticsIf a planning skill warns that the codebase map is missing or baseline-only, decide whether to enrich the map or narrow the task. Do not proceed by assuming the AI remembers the repo from a previous session.
Step 6: Execute And Review The Pilot
Section titled “Step 6: Execute And Review The Pilot”Let Slipway drive implementation and review:
slipway run --json --diagnosticsWhen implementation reaches a task executor, use this prompt:
Execute the active Slipway task using the codebase map as context. Touch onlythe target files declared in tasks.md. Run the task's verification command. Ifthe map contradicts current source, stop and report the discrepancy instead ofguessing.After implementation:
git diff --statslipway validateslipway next --json --diagnosticsReview findings should be repaired through slipway fix --json, not by mixing
review and repair in the same context.
Step 7: Promote Useful Learnings
Section titled “Step 7: Promote Useful Learnings”If the pilot revealed a durable convention, update the matching
artifacts/codebase/ file with source-backed wording. Keep it narrow:
- Good: “HTTP route tests use
httptest.NewRecorderininternal/http/*_test.go.” - Bad: “Always write comprehensive tests.”
Run a final read-only check:
slipway validateWhen done-ready:
slipway doneCommit the pilot diff and archived governed record together.
What You Learned
Section titled “What You Learned”slipway codebase-mapcreates durable brownfield context.slipway instructions <codebase-map-doc>is the authoring contract for map refinement.- Baseline context is useful, but authored source-backed context is stronger.
- Planning should cite current code, not assumed conventions.
- A small pilot reveals whether the map is useful before a team-wide rollout.