π§ 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. π
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.
05 Building blocks π§±¶
SLMCode pipelines, agents, quality checks, and language packs are all YAML-configurable building blocks β versioned, shareable, and marketplace-ready.
# .slmcode/blocks/pipelines/my-lang.yaml
api_version: blocks/v1
kind: pipeline
id: my-lang
name: My Pipeline
spec:
phases:
test: { agent: my-tester, when: always }
execute:
default_role: my-worker
Discovery order: project (.slmcode/blocks/) β user (~/.slmcode/blocks/) β env β builtin. Project blocks always win, so you can override any builtin for a specific project.
Four block kinds:
| Kind | What it defines |
|---|---|
pipeline | Phase graph, loop agents, slots |
agent | Custom specialist or builtin override |
quality | Format/lint/test/build commands |
pack | Composes pipeline + quality + agents into a language pack |
Thirteen packs ship built-in β go πΉ, python π, react βοΈ, typescript π¦, web π, rust π¦, java β, kotlin πͺ, dotnet π£, ruby π, php π, swift ποΈ, cpp βοΈ. slmcode init picks one by scoring each pack's detect stanza (marker files, detect.contains proof of a file's content, source extensions, author priority), skipping nested sub-projects. Switch with slmcode blocks apply <id> or use the Studio's PackSelector.
β π§± Full blocks reference
05 Self-critic with evidence π¶
Reviewers can be flaky on SLMs. Heuristics prefer:
- clear
status: done files_changedthat 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.
Acceptance criteria: a contract, not a paragraph¶
Asking a 7B model "is this implementation correct?" is asking it to do the thing it is worst at. So a task's acceptance is split into individually checkable conditions, each with the exact command that proves it:
{
"criteria": [
{"text": "Sum returns a+b for the table cases", "priority": "must", "verify": "go test ./..."},
{"text": "exported Sum has a doc comment", "priority": "should", "verify": ""}
]
}
The harness runs each verify β through the same whitelist every auto-run command passes, so a criterion can never widen shell scope β and hands the reviewer a table with three verdicts, never two:
| Verdict | Meaning |
|---|---|
PASSED | a command ran here and exited 0. Settled. |
FAILED | it ran and did not. A failed must fails the task. |
UNVERIFIED | nothing ran. The reviewer judges this one. |
That third state is the point. A prose acceptance blob is scanned by regex for runnable commands, and a condition it finds none for is simply invisible β so "the harness did not check" silently becomes "the harness says it is fine". An UNVERIFIED row says so out loud, and it denies the reviewer fast path: disk evidence proves the worker changed something, never that the condition it was given is now true.
06 Knowledge flywheel π¦¶
After a run:
- MEMORY.md β lessons / pitfalls
- CONTEXT.md β what we touched
- SKILLS.md +
skills/learned/β conventions that stuck - 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 (interactive) or slmcode reject π |
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, a correctmodel_profiles.<family>.context_limit, patience - βοΈ Frontier β raise parallel, enjoy speed, keep inspectability
Next πΊοΈ¶
- β±οΈ Quick start β feel it
- π§ User guide β drive it daily
- ποΈ Architecture β package map for contributors
βοΈ Made with β₯ by UnicoLab