Skip to content

🧠 Concepts

The ideas behind SLMCode β€” so the rest of the docs feel inevitable instead of magical. Also: fewer β€œwhy is it like this?” Slack threads. πŸ˜…

🏠

House metaphor: don’t ask the intern to also be the architect, QA, and filing cabinet. Give them a desk, a ticket, and a checklist. Then maybe a snack.


01 Harness β‰  model 🧰

A model predicts tokens. A harness decides what the model sees, when it acts, how failures recover, and where knowledge sticks.

Frontier tools often hide the harness behind a chat box. SLMCode makes the harness explicit β€” like leaving the kitchen lights on.

Layer Owner Job
🧭 Routing / board Go Plan, schedule, stop/resume
🧩 Specialists Prompts + tools One role, one pack
πŸ” Critic Reviewer + disk evidence Catch fiction
πŸ’Ύ Memory .slmcode/*.md Compound lessons

🎀 UnicoLab watercooler

Models are the talent. Harnesses are the stage managers. Never let the talent rearrange the set mid-show.


02 Scoped packs (the turkey rule) πŸ¦ƒ

Stuffing the whole repo into context is how small models fall asleep mid-sentence.

Each specialist receives a TaskPack:

  • slices of PROJECT / CONTEXT / MEMORY / skills
  • a few focus files
  • one atomic task
  • tool allowlists that match the role
flowchart TD
  Repo[Whole repo 🏒] -.->|never wholesale| Model[Model 😴]
  Pack[TaskPack πŸ“¦] --> Model2[Model 😎]
  Pack --> MD[.slmcode markdown]
  Pack --> Files[Focus files]
  Pack --> Skill[Matched skills]
  Pack --> Task[Atomic task]

Bigger models still benefit: less noise, clearer acceptance criteria, cheaper runs. (Your CFO’s favorite sentence.)


03 Plan β†’ split β†’ coordinate πŸ“‹

query
  β†’ instructions (AGENTS.md / PROJECT.md)
  β†’ skills match
  β†’ context agent
  β†’ explore OR reuse memory
  β†’ clarify (interview: ask|auto recommended β†’ Locked PRD)
  β†’ scope judge (every task gets concrete acceptance / PRD)
  β†’ planner (multipass) β†’ splitter β†’ sanitize (+ auto tester task)
  β†’ coordinator advice
  β†’ parallel execute (worker smoke + acceptance smoke + static/claims)
  β†’ review ↔ correct (≀ max_retries)
  β†’ escalate HITL if stuck (timeout β†’ @escalate SLM decides)
  β†’ placeholder polish β†’ completeness bar
  β†’ finalize tester (real commands required)
  β†’ QA gate (install deps + pytest preferred β€” not compileall alone)
  β†’ continue-ask if work remains
  β†’ learn β†’ evolve skills β†’ session snapshot

The coordinator doesn't write code. It steers the kanban: promote, reassign, add tasks, note risks. Think air-traffic control, not pilot. ✈️


04 Explore reuse ♻️

Deep exploration is expensive (especially on slow local inference).

If CONTEXT is rich, MEMORY/PROJECT exist, and discovery finds relevant paths, SLMCode skips the deep dive and reuses knowledge. Your fans thank you. Your GPU fans thank you louder.

# When memory feels stale or wrong:
SLMCODE_FORCE_EXPLORE=1 slmcode run -v "…"

05 Self-critic with evidence πŸ”

worker/deep β†’ reviewer β†’ (reject) β†’ corrector β†’ reviewer …

Reviewers can be flaky on SLMs. Heuristics prefer:

  • clear status: done
  • files_changed that match disk
  • rename satisfaction when paths already moved

πŸ“œ Disk beats vibes

Always. If the file says hello and the model says goodbye β€” trust the file.


06 Knowledge flywheel πŸ¦‹

After a run:

  1. MEMORY.md β€” lessons / pitfalls
  2. CONTEXT.md β€” what we touched
  3. SKILLS.md + skills/learned/ β€” conventions that stuck
  4. sessions/ β€” resumable snapshots

Tomorrow's run starts smarter than today's. That's the product. (Also: please don’t rm -rf .slmcode for sport.)


07 Permissions are a feature πŸ›‘οΈ

Mode Use when
auto You trust the loop (or it's a playground) πŸ›
dry-run Demos, CI dry checks, β€œwhat would you do?” 🎭
review Real repos β€” stage patches, then slmcode apply πŸ‘€

Shell is separate: shell_permission: allow | ask | deny. Files and shells have different blast radii. Treat them that way.


08 Any LLM, same loop πŸ”Œ

Providers are adapters. The harness stays constant.

  • 🏠 Local SLM β†’ more think_passes, smaller max_context_kb, patience
  • ☁️ Frontier β†’ raise parallel, enjoy speed, keep inspectability

See Providers and Config.


Next πŸ—ΊοΈ

β˜€οΈ Made with β™₯ by UnicoLab