A plain-language guide

OpenCode Handbook — Learn, Find, Ask, Build

OpenCode is a program that reads what you type and then does work on your computer. This page explains what that means, in plain words, for someone who has never used an AI tool before. It also shows you the five ways people actually use it, and which part of the program does the work in each one.

14 sections Written for a beginner Language: Simplified Technical English

01How to read this page

This page has fourteen sections. You do not have to read all of them. Choose one of the three paths below. Each path gives you an honest estimate of how long it takes.

Path Read Time You end up with
Just curious Sections 1, 2 and 3 About 5 minutes An idea of what OpenCode is
I want to set it up The above, then section 4 About 20 minutes A working install you have checked
I want to use it well Everything, in order About 90 minutes All five flows, plus the exact files behind them
Your next step

A friend sent you this link. You do not have OpenCode on your computer yet. Go straight to section 4 and install it. Do not read the rest first. Section 4 takes five minutes and it gives you something to try.

If you already have OpenCode, then read section 2 next. It is the shortest section in this page and it explains the one idea everything else depends on.

One thing to know up front

Every flow in this page has the same seven headings. The order never changes. You will read the full explanation in section 6. After that, you can skim sections 7 to 10 and still find everything you need.

02What OpenCode is

OpenCode is a program you run in a terminal window. A terminal is the plain text window on your computer that shows commands. You type a request in ordinary English. The program reads the request and then acts on it.

What makes this useful is that the program can do things, not only talk. It can read a file, change a file, make a new file, and run commands on your computer. It does these things on its own. You do not click each step.

What makes this risky is that the same power can damage work you care about. That is why the first thing to understand is modes.

The idea to remember

The mode you choose decides whether the program is allowed to change your files.

Pick a mode that only reads, and the program cannot alter your work. Pick a mode that writes, and it can. This is not a guess. It is set in the program and you can see it.

The words you need first

Agent

An agent is one named way of working. Each agent has its own rules about what it may do. OpenCode has four agents you can choose: ask, Plan, Build, and deep-research.

Mode

A mode is the same thing as an agent. You pick the mode at the start of a conversation. The program then follows that mode's rules for the whole conversation.

Tool

A tool is one action the program can perform, such as reading a file or searching the web. The program chooses which tool to use for each part of your request.

Session

A session is one conversation. It has a start, and it ends when you close it or start a new one. The program remembers the session while it is open.

Skill

A skill is a folder of instructions that the program reads before it starts a job. A skill tells it how to do one kind of task well. See section 3 for more detail.

How OpenCode talks to you

You type a message. The program writes a reply. The program can also stop and ask you a question in the middle of a task. It does this when your request is ambiguous. Answering the question is how you steer the work.

What we measured, so you do not have to guess

The numbers below are real. They come from 663 messages that a person actually sent to OpenCode. The table shows which tools each mode used, and how many times each mode wrote to a file.

Mode Tools it used most Times it wrote a file
ask websearch 40, webfetch 27, read 24, bash 9 0
Plan bash 37, read 34, webfetch 18, websearch 15, glob 13, question 3 0
Build bash 396, edit 234, read 227, write 155 389
Explore read 10, bash 4, glob 1 0

The ask and Plan modes never wrote to a file. Not once. The Build mode wrote to a file 389 times. Across the same 663 messages, a person switched modes 78 times in 28 separate conversations. That is not accidental. Switching modes by hand is one of the three habits in section 11.

Be honest about the limits

These counts are a habit, not a wall. The ask and Plan modes are also allowed to run commands in the terminal. The reason they did not change anything is a rule in their setup, plus the person choosing them on purpose.

If you need a real guarantee, keep your only copy of important work somewhere the program cannot reach. See section 13.

What it is bad at

OpenCode is not a search engine and it is not always right. It writes confident sentences the same way whether it is certain or guessing. It cannot see your screen unless a tool lets it. It forgets everything when a session ends, unless it wrote something down.

Treat every answer as a draft from a capable but fallible helper. Check the parts that matter before you rely on them.

03Words used on this page

This page uses technical words. Every one of them is defined here in one sentence. If you meet a word later that is not here, the fault is in this page. It is not in your reading.

Word What it means here
AgentOne named way of working, with its own rules about what it may do.
ModeThe same thing as agent. You pick it at the start of a conversation.
SessionOne conversation, from its first message to its end.
ToolOne action the program can take, such as reading a file.
SkillA folder of instructions the program reads before it begins a task.
PromptAnything you type to the program.
ModelThe part of the program that produces the words. Other parts run commands.
Plan fileA text file where you and the program agree on the work before it starts.
ReportA finished text file that the program writes after it researches a question.
Read-onlyDescribes a mode that may look at your files but cannot change them.
PermissionA rule that says what a mode is allowed to do.
PlaceholderA marker in an example, such as <name>, that you replace.
MCPModel Context Protocol. A standard that lets the program connect to other tools.
TerminalThe plain text window on your computer where you type commands.
CommandOne instruction you type into the terminal.
FolderA directory that holds files. The plans live in one folder.
File pathThe name and folder of one file, such as ~/Notes/today.md.
MarkdownA plain text format that uses simple marks to show headings and lists.
HTMLHyperText Markup Language. The format that web pages are written in.
JSONA plain text format for lists of names and values.
BrowserThe program that shows web pages, such as Chrome or Safari.
ExtensionAn add-on that gives the program a new ability.
Node.jsThe free program that runs JavaScript on your computer. You need it to install OpenCode.
GitA free system that records the history of your files.
Source codeThe instructions you write that make a program work.
WebsiteA set of pages you open in a browser.
HostingPutting a website on the public internet so other people can open it.
DeployThe act of sending a website to its hosting.
STE100Simplified Technical English. A rule set for clear short English. See the last section.

04Install and verify

You need two things: Node.js, and then OpenCode itself. You also need a terminal. If you use a Mac, Terminal is already installed.

What you need first

Install

Run these commands one at a time. Press Return after each one. Wait for the next prompt before you start the next.

# 1. Check that Node.js is there. You must see a number.
node --version

# 2. Install OpenCode.
npm install -g opencode-ai

# 3. Start OpenCode.
opencode

Node.js must be version 24 or later. If step 1 gives you an error, install Node.js first, then run these commands again.

Check that it worked

Inside OpenCode, the / key opens a list of commands. Type agents and press Return. You must see four names in the list:

NameWhat it is for
askAnswering questions. It cannot change your files.
PlanWriting a plan file. It cannot change your files.
BuildDoing the work. It can change your files.
deep-researchResearching a hard question. It writes a report file.

Type config in the same list to see your settings file. You do not need to understand it. You only need to know the command works.

If a name is missing

Close OpenCode and open it again. The program reads its settings only when it starts.

If the name is still missing, ask whoever gave you this page. Something in the setup did not finish.

05The five-flow map

People use OpenCode in five ways. Each way needs a different mode, and most need a different skill. This section names all five. The next five sections explain each one in full.

Read the Mode and Skill lines first. Those two lines tell you everything about where to go next.

Section 6Ask
Mode: ask · Skill: none
You want to understand something. You get an answer in the chat. No file changes.
Section 7Search
Mode: deep-research · Skill: deep-research
You want facts from many sources, with links. You get a report file on disk.
Section 8Plan
Mode: Plan · Skill: none
You want to agree on the work before it starts. You get one plan file.
Section 9Build
Mode: Build · Skill: frontend-design for visual work
You want something made. You get files, and you look at them in a browser.
Section 10Learn
Mode: Build · Skill: teach
You want to learn something over weeks. You get a folder of lesson files.

How the three main flows chain together

Ask, Plan and Build are a chain. Search and Learn feed the chain. You do not need all of them every day.

ask → Plan → Build (understand) (agree) (make) deep-research → a report you can paste into a plan teach → a workspace you learn in, one lesson at a time

Which flow do I want?

06Flow: Ask

What you want

You want to understand something, and you do not want anything changed on your computer.

Who does the work

Mode: ask. Skill: none. This flow uses no skill.

The ask mode has a rule that denies every tool which writes. In 143 real messages it wrote to a file zero times.

What you type

I am choosing between <option A> and <option B>.
Tell me the real differences, not the marketing ones.
Be real: which one do you pick, and why?

The last line is the important one. It asks for a preference, not a summary. A model that must commit to an answer gives a much more useful one.

What comes back

A long answer in the chat, with file names and web links. No file changes.

The steps

  1. Start OpenCode.

  2. Choose the ask mode before you type anything.

  3. Type your question. Add a line that asks for a firm opinion.

  4. Read the answer. Open any file name the answer mentions.

  5. Ask a second question about the part that still does not make sense.

How you know it is done

Two tests. Both must pass.

The usual mistake

Treating it as a search engine. A search engine gives you links. This mode gives you one opinionated answer.

That is usually what you want, and it is wrong when you need to see all the options. Switch to Search in section 7 when you need to check a claim yourself.

07Flow: Search

What you want

You want facts from many sources, and you want to check them yourself later.

Who does the work

Mode: deep-research. Skill: deep-research.

The order matters. The mode must load the skill by name before it begins. The skill is a 12-step protocol that the mode then follows exactly.

This flow never starts by itself

Both the skill and the mode are set to manual only. The program will not choose them unless you ask by name.

This is deliberate. Research is slow and it costs money. You should decide when it is worth the wait.

What you type

@deep-research research <the question>, in <geography>,
under <budget or time limit>

What comes back

A report file, dated, in this folder:

~/Documents/research-reports/YYYY-MM-DD-<topic>.md

The report has eight parts. The one most people skip is Limitations and Uncertainty. Read it. It is where the program tells you what it could not find.

The steps

  1. Write the question. Add where it applies and any limit on time or cost.

  2. Type @deep-research and then your question.

  3. Wait. Twelve steps run in order, so this takes several minutes.

  4. Open the report file when the program gives you the path.

  5. Read the limitations part first, then the conclusion.

  6. Open two or three of the links yourself.

How you know it is done

The usual mistake

Reading only the summary at the top. The summary is the program's conclusion. The evidence is in the middle, and the limits are at the end.

If you only read the top, you have read an opinion, not a report.

08Flow: Plan

What you want

You want to agree on the work before any of it starts.

Who does the work

Mode: Plan. Skill: none. This flow uses no skill.

The Plan mode reads your files and writes one plan file. It does not change your work. In 148 real messages it wrote to a source file zero times.

What you type

I want to <state the goal in one sentence>.
Read the files in <folder or path> and write me a plan.
Do not change anything yet.

What comes back

One plan file in this folder:

~/.opencode/plan/<short-name>.md

A good plan file names the files to change, the order of the work, and what it will not change. The last part is the most useful and the most often left out.

The steps

  1. Describe the goal in one sentence. Add the folder to work in.

  2. Choose the Plan mode before you type.

  3. Ask for a plan. Tell it not to change anything.

  4. Read the plan. Look for a section that says what will not change.

  5. Edit the plan if you disagree. It is a text file. Use any editor.

  6. Do nothing else yet. Wait for the next section.

How you know it is done

The usual mistake

Treating the plan as an order. It is not. It is a proposal.

Read it, change what is wrong, and only then switch to Build. Section 11 explains the exact words to use for that hand-off.

09Flow: Build

What you want

You want something made: a page, a file, or a program.

Who does the work

Mode: Build. Skill: frontend-design, but only for visual work such as a page's look.

This is the only mode that changes your files. It wrote to files 389 times in our sample. It uses a browser tool, so it can open what it made and check it.

What you type

implement this plan ~/.opencode/plan/<plan-file-name>.md

That one line is the whole hand-off. It names the file. Section 11 explains why this works better than a long instruction.

What comes back

Changed files, a summary of what changed, and a check in the browser. If the work is code, also a branch in Git that you merge when the work looks right.

The steps

  1. Check your plan file has been read and agreed.

  2. Choose the Build mode.

  3. Type the hand-off line from the box above, with the plan file's name.

  4. Let it work. Do not interrupt to change direction mid-way.

  5. Open the result yourself. A text file cannot show you a page.

  6. Ask for a change only after you have seen it.

How you know it is done

The hardest habit here

Judge the work in a browser, not in a list of changed lines. A list of lines tells you what the machine did. A browser tells you whether it is any good.

Only one of those answers your question.

The usual mistake

Asking for a small change while it is still working on the first one. Every new instruction makes it restart part of the job.

Let it finish. Look at the result. Then give one clear instruction at a time.

10Flow: Learn

What you want

You want to learn something over weeks, not in one sitting.

Who does the work

Mode: Build. Skill: teach.

The teach skill comes from another author. It carries a setting that stops it from starting by itself. You must name it.

It is the only skill in this setup used more than twice. It carries this entire flow.

What you type

teach me <the topic>

Then, at the end of each lesson, when you finish it:

I am done with lesson <number>. proceed to lesson <number + 1>

What comes back

A folder that grows over time. It holds these files:

File or folderWhat it holds
MISSION.mdWhy you want to learn this. Every lesson links back to it.
RESOURCES.mdTrusted sources, each with a note on when to use it.
NOTES.mdYour preferences, such as how you like to be taught.
lessons/NNNN-*.htmlOne short lesson per file. This is the main product.
reference/*.htmlCheat sheets you keep and come back to.
learning-records/NNNN-*.mdWhat you proved you understood, and why it matters.
assets/Shared style and quiz files, written once and reused.

The steps, in the order they run

This order is fixed. We measured it in two separate learning folders and it was the same both times.

1 read the skill's 4 format files 2 check the machine (what is already installed) 3 ask you why you want this <- it asks, it does not assume 4 check the facts on the web 5 write MISSION.md 6 write RESOURCES.md 7 write NOTES.md 8 write assets/style.css <- shared once, not per lesson 9 write assets/quiz.js 10 write reference/*.html 11 write lessons/0001-*.html 12 open it in your browser --- you do the lesson --- 13 read what you actually made 14 ask you a recall question <- checks, does not assume 15 write learning-records/0001.md 16 update NOTES.md and RESOURCES.md 17 write lessons/0002-*.html <- then repeat from 13

Steps 3 and 14 are the ones that matter. A tool that teaches without ever checking whether you learned anything is just printing pages.

How you know it is done

One lesson is done when all three of these are true.

The usual mistake

Skipping the lesson and asking for the next one. The lesson is the point. The files are bookkeeping.

If you skip it, the program has no evidence about what you know. It then starts again from the same place.

11Three rituals

Three habits hold the five flows together. They take a minute each.

1. Switch the mode by hand

Do not stay in Build for everything. Switch to ask before you ask a question. Switch back when you want work done.

Across 28 conversations, a person switched mode 78 times. The mode is the main safety control you have. Use it.

2. Treat the plan file as a contract

When you are happy with a plan, hand it over with one line:

implement this plan ~/.opencode/plan/<plan-file-name>.md

This line appeared 13 times in our sample. It works because it names one file. The program reads the file, and the file already says what to do and what not to do.

3. Judge the work where it will be seen

A diff shows what the machine did. It cannot show you whether the result is any good.

12Asset library

How to read this section

Every block below is an exact copy of a real file from this setup. Nothing is reworded.

This page is written in Simplified Technical English. Its rules apply to the words this page authors. They do not apply to these blocks, because these blocks are copies of files that somebody else wrote.

You do not need to read any of this section to use OpenCode. Read it only if you want to see how the flows in sections 6 to 10 are built. Read it also if you want to copy a setup for yourself.

Group A — the files in this setup

The ask mode definition ~/.config/opencode/agent/ask.md

Copied exactly from this setup. 16 lines.

This file creates the read-only mode used in section 6. Line 5 is the rule that denies every write.

---
description: Answers questions in detail without making edits. Use for explanations and Q&A.
mode: primary
permission:
  edit: deny
---

You are the ask agent. Your sole job is to answer the user's question.

Rules:
- Only answer the question sent in the current message. Do not perform tasks, refactor, or modify files.
- Never call edit/write tools. If an edit would help, describe it in text or as a code block instead of applying it.
- You MAY use read-only tools (read, glob, grep, list, bash for inspection, webfetch, websearch, lsp) to research the answer.
- Answer in detail by default: explain reasoning, give examples, cite file paths as `path:line` where relevant.
- Only give a brief answer if the user explicitly asks for brevity.
- If the request implies edits, refuse that part and offer the answer/explanation instead.
The deep-research mode definition ~/.config/opencode/agents/deep-research.md

Copied exactly from this setup. 154 lines.

This file creates the mode used in section 7. Lines 2 and 28 are the manual-only gate. Line 52 sets the output folder.

---
description: Manual-only deep research lead. Use only when user explicitly invokes @deep-research. Never auto-select or auto-delegate.
mode: primary
steps: 30
permissions:
  - action: websearch
    resource: "*"
    effect: allow
  - action: webfetch
    resource: "*"
    effect: allow
  - action: skill
    resource: deep-research
    effect: allow
  - action: edit
    resource: "*"
    effect: allow
  - action: write
    resource: "*"
    effect: allow
  - action: subagent
    resource: "*"
    effect: deny
---

You are the Deep Research Lead.

MANUAL-ONLY GATE: Only activate when the user explicitly invokes `@deep-research` or asks for deep-research by name in the current message. Never auto-select this agent for general research questions. Other agents must not delegate to you automatically.

Your job is to conduct rigorous, multi-stage research. Do not optimize for speed. Optimize for reducing uncertainty and producing a report whose important claims can be independently verified.

## Required behavior

For every non-trivial research task:

1. Parse the user's actual objective, not merely the surface wording.
2. Establish scope: geography, timeframe, population, definitions, and intended use.
3. Break the question into a research matrix of independent subquestions.
4. Identify which subquestions require primary sources, quantitative evidence, expert interpretation, or current reporting.
5. Load the `deep-research` skill explicitly by ID before beginning substantial research (it is hidden from auto-invoke, so call the `skill` tool with `{"id": "deep-research"}`).
6. Do source discovery and source reading yourself, in-context. There are no separate `source-researcher` subagents in this install. Parallelize with sequential passes yourself when the task is large.
7. Read underlying sources. Search-result snippets are leads, not evidence.
8. Build an internal evidence ledger: claim → evidence → source → source type → date → limitations.
9. Do not count multiple articles repeating the same underlying source as independent corroboration.
10. After the first research pass, perform gap analysis.
11. Run additional searches specifically for missing evidence and contradictory evidence.
12. Perform an adversarial contradiction pass yourself (the `contradiction-finder` role is folded into you — see skill Phase 7). Do not launch a subagent.
13. Perform an evidence review yourself (the `evidence-reviewer` role is folded into you — see skill Phase 8). Test whether evidence actually supports each claim.
14. Synthesize only after the evidence review.
15. Perform a citation audit yourself before finalizing (the `citation-auditor` role is folded into you — see skill Phase 10).
16. Correct the report after the citation audit.
17. Save the audited final report per Skill Phase 12 (`~/Documents/research-reports/YYYY-MM-DD-<slug>.md`), then present the same body in chat.
18. Clearly mark unresolved uncertainty instead of filling gaps with speculation.

You may not launch subagents (permission denied). Do all phases in this session.

## Source strategy

Prefer, in order when applicable:
- primary documents and original datasets,
- government/regulatory sources,
- standards bodies,
- original academic research,
- official company/institutional material,
- high-quality journalism,
- expert analysis,
- secondary summaries,
- blogs/forums/social posts for discovery or anecdotal context.

Do not mechanically follow this hierarchy when the research question specifically calls for another type of evidence. Explain source limitations when relevant.

## Adversarial research

After developing a preliminary understanding, explicitly ask:

- What evidence would make this conclusion wrong?
- Which credible sources disagree?
- Is there a competing explanation?
- Are the statistics measuring the same thing?
- Could the result be caused by selection, survivorship, reporting, or measurement bias?
- Am I treating correlation as causation?
- Am I mistaking repetition for independent confirmation?
- Is there a more authoritative source behind the secondary reporting?

Research the strongest counterarguments, not straw men.

## Research stopping rule

Continue researching until:
- all major subquestions have adequate evidence,
- major claims have appropriate sources,
- important counterevidence has been investigated,
- important gaps are documented,
- further searches produce mostly duplicate or low-value information.

Do not stop merely because you have found an answer that sounds plausible.

## Evidence discipline

Never:
- invent a citation,
- invent a quote,
- invent a statistic,
- attribute a claim to a source without checking it,
- imply certainty unsupported by evidence,
- cite a source for a claim it does not actually support.

When evidence is mixed, say so.

When evidence is insufficient, say so.

## Final report

Use this structure unless the user asks for another format. After synthesizing, follow Skill Phase 12 to save to `~/Documents/research-reports/` in addition to chat output:

# Executive Summary

Give the answer and the most important evidence in concise form.

# Research Scope & Method

State what was investigated, the timeframe, important definitions, and how evidence was evaluated.

# Key Findings

Organize the main findings by research question.

# Detailed Analysis

Explain the evidence, source quality, important quantitative details, and reasoning.

# Conflicting Evidence / Alternative Explanations

Present credible disagreements and explain why they differ where the evidence allows.

# Limitations & Uncertainty

Identify missing evidence, source limitations, measurement limitations, and unresolved questions.

# Conclusion

Synthesize what the evidence supports. Do not overstate.

# Sources

List the principal sources with enough information for verification.

Cite claims close to where they appear. Prefer direct links/citations to the underlying source.

## Output quality

The final answer should be detailed enough that another researcher could reproduce the major findings from the cited sources.

Do not dump your internal chain-of-thought. Provide concise research methodology, evidence, reasoning summaries, uncertainty, and conclusions.
The deep-research protocol ~/.config/opencode/skills/deep-research/SKILL.md

Copied exactly from this setup. 152 lines. The only skill written by the person who made this setup.

This is the 12-step protocol from section 7. Line 6 is the setting that hides the skill from automatic starting.

---
name: deep-research
description: Manual-only rigorous multi-stage research protocol. Use only when user explicitly invokes @deep-research or requests deep-research by name. Never auto-load.
compatibility: opencode
metadata:
  opencode/autoinvoke: false
---

# Deep Research Protocol

MANUAL-ONLY GATE: This skill is hidden from auto-invoke. It applies only when the user explicitly invokes `@deep-research` or requests the deep-research protocol by name. The lead agent must load it explicitly by ID. Never apply it to general research questions unprompted.

Use this skill for substantial research questions where accuracy, breadth, source quality, and traceability matter.

## Required phases

### Phase 1 — Scope

Define:
- research question,
- user objective,
- geography,
- timeframe,
- population,
- definitions,
- output requirements,
- decision/use context.

If an ambiguity would materially change the research, ask the user. Otherwise make a reasonable assumption and state it.

### Phase 2 — Research matrix

Break the question into independent dimensions.

Typical dimensions:
- current state,
- historical context,
- primary evidence,
- quantitative data,
- mechanisms/causes,
- competing explanations,
- risks/limitations,
- market or institutional context,
- stakeholder perspectives,
- recent developments.

Do not force irrelevant dimensions.

### Phase 3 — Discovery

Search broadly using different query formulations.

Use:
- primary-source searches,
- academic searches,
- institutional sources,
- reputable reporting,
- targeted searches for objections and criticism.

### Phase 4 — Source inspection

Open important sources.

Extract:
- exact claim,
- supporting data,
- methodology/context,
- date,
- scope,
- limitations,
- references to other useful sources.

A search snippet alone is not evidence.

### Phase 5 — Evidence ledger

Maintain an internal ledger following:

`Claim → Evidence → Source → Source type → Date → Scope → Limitations → Confidence`

For important claims, prefer direct evidence over summaries.

### Phase 6 — Gap analysis

Ask:
- Which research questions are unanswered?
- Which important claims rely on only one source?
- Which sources are derivative?
- What primary documents have not been checked?
- What current information is missing?
- What definitions or denominators could change the conclusion?

### Phase 7 — Contradiction search

Search explicitly for:
- opposing evidence,
- failed replications,
- corrections,
- competing datasets,
- alternative interpretations,
- credible criticism.

### Phase 8 — Evidence review

Test whether each proposed conclusion is actually supported.

Remove unsupported claims or qualify them.

### Phase 9 — Synthesis

Synthesize evidence rather than merely concatenating source summaries.

Distinguish:
- established fact,
- evidence-supported interpretation,
- estimate,
- disputed claim,
- unresolved question.

### Phase 10 — Citation audit

Before final output:
- check major factual claims,
- check citation proximity,
- check source quality,
- check date relevance,
- check that citations support the exact wording.

### Phase 11 — Final report

Use the report template in `references/report-template.md` unless the user specifies another structure.

### Phase 12 — Persist report

After the Phase 10 audit, save the final markdown report to disk AND show it in chat.

1. Target directory: `~/Documents/research-reports/` — create it if missing.
2. Filename: `YYYY-MM-DD-<topic-slug>.md` e.g. `2026-09-27-vector-db-pricing.md`. Use lowercase, hyphens, max ~60 chars. If file exists, append `-v2`, `-v3`.
3. Use the `write` tool. Include full report body identical to chat output.
4. After saving, print: `Saved to: <absolute path>`.
5. Never save search snippets, ledger drafts, or unaudited content — only the audited final report.
6. If the user gave an explicit output path in the request, use that instead of the default directory.

## Research stopping rule

Stop when:
1. major subquestions have adequate evidence,
2. important counterevidence has been investigated,
3. major gaps are documented,
4. additional searches mostly return duplicate/low-value material.

Do not equate a large source count with high research quality.
The report template ~/.config/opencode/skills/deep-research/references/report-template.md

Copied exactly from this setup. 69 lines.

This is the shape of every report from section 7. It is a template, so the brackets are waiting to be filled in.

# [Research Title]

## Executive Summary

Summarize the most important findings, evidence, and uncertainty.

## Research Scope & Method

### Question

### Scope

### Timeframe

### Definitions

### Method

Explain the broad source strategy and important limitations.

## Key Findings

### 1. [Finding]

Evidence and citations.

### 2. [Finding]

Evidence and citations.

### 3. [Finding]

Evidence and citations.

## Detailed Analysis

Organize by research subquestion.

For important claims:
- state the claim,
- present the strongest evidence,
- identify source quality,
- explain relevant limitations,
- distinguish evidence from interpretation.

## Conflicting Evidence / Alternative Explanations

Present credible disagreements and explain the source of disagreement.

## Evidence Gaps

Identify what could not be established and why.

## Limitations & Uncertainty

Discuss:
- data limitations,
- source limitations,
- timeframe limitations,
- methodological uncertainty,
- unresolved disputes.

## Conclusion

State what the evidence supports without overstating certainty.

## Sources

List principal sources with title, publisher, date, and URL/citation.
The evidence record shape ~/.config/opencode/skills/deep-research/references/evidence-schema.md

Copied exactly from this setup. 31 lines.

Each fact in a report gets one of these records while it is being checked. The field named limitations is the reason this flow is slow, and the reason it is worth doing.

# Evidence Record

Use this conceptual structure when tracking research:

```json
{
  "claim": "Precise factual claim",
  "evidence": "Faithful summary of what the source establishes",
  "source": {
    "title": "Source title",
    "publisher": "Organization",
    "date": "YYYY-MM-DD or unknown",
    "url": "https://..."
  },
  "source_type": "primary|academic|government|official|journalism|analysis|other",
  "scope": "Population/geography/timeframe covered",
  "strength": "high|medium|low",
  "limitations": "Relevant limitations",
  "supports_claim": true,
  "independent_from": ["source identifiers if applicable"],
  "contradictions": ["Related evidence that conflicts"]
}
```

## Rules

- `claim` should be atomic where practical.
- `evidence` should describe what the source supports, not what you wish it supported.
- `strength` is evidence quality, not confidence in a broad theory.
- `limitations` are mandatory for important or contested claims.
- Do not invent fields that cannot be verified.
The source quality tiers ~/.config/opencode/skills/deep-research/references/source-quality.md

Copied exactly from this setup. 47 lines.

This decides which sources count. The last rule is the important one: ten articles that all repeat one press release are not ten confirmations.

# Source Quality Framework

## Tier A — Primary / authoritative

Use preferentially for factual claims when applicable:
- government publications,
- regulatory filings and decisions,
- court documents,
- official statistics,
- original datasets,
- original scientific papers,
- standards organizations,
- official technical documentation,
- audited institutional reports.

## Tier B — High-quality secondary

Useful for context, synthesis, and current developments:
- reputable journalism,
- systematic reviews,
- major research institutions,
- established industry research with transparent methodology.

## Tier C — Expert/secondary analysis

Useful for interpretation:
- domain experts,
- specialist publications,
- professional analysis,
- think-tank reports with transparent methodology.

## Tier D — Discovery/anecdotal

Use cautiously:
- blogs,
- forums,
- social posts,
- unsourced aggregators,
- SEO content.

These can identify leads or illustrate experiences but should not normally carry major factual conclusions when stronger evidence exists.

## Independence rule

Ten sources repeating the same press release, study, or dataset are not ten independent confirmations.

Trace important claims to the underlying source.
The global rule ~/.config/opencode/AGENTS.md

Copied exactly from this setup. 1 line.

Rules in this file apply to every conversation. Most setups have one of these files. It is how you give the program a standing instruction.

When interacting with Cloudflare, use the cf CLI unless the project has a Wrangler configuration file.
The browser extension setup ~/.config/opencode/opencode.json

Copied exactly from this setup. 16 lines.

This file adds the browser tool. It is the tool that lets the program open what it made, which is the ritual in section 11.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "playwright": {
        "type": "local",
        "command": [
          "npx",
          "-y",
          "@playwright/mcp@latest",
          "--browser=chrome"
        ]
      }
    }
  }
}
The permissions and the Cloudflare extension ~/.config/opencode/opencode.jsonc

Copied exactly from this setup. 12 lines.

This is the safety part. Line 7 turns a delete command into a question before it runs. That is the single most valuable line in this whole page.

{
  "$schema": "https://opencode.ai/config.json",
  "permission": {
    "external_directory": { "*": "ask" },
    "bash": {
      "*": "allow",
      "rm *": "ask"
    }
  },
  "mcp": {
    "cloudflare": { "type": "remote", "url": "https://mcp.cloudflare.com/mcp", "enabled": true, "oauth": {} }
  }
}
A real plan file ~/.opencode/plan/crack-table-two-columns.md

Copied exactly from this setup. 302 lines. Use it as the shape for the plan files from section 8.

Read lines 1 to 18 first. That is the whole contract: where the work is, when it was written, what was decided. Then skim the headings below.

# Plan — fix the crack-time table's layout (Option B: two columns)

**Repo:** `~/Desktop/personal_projects/password_generator` (`local-password-generator`)
**Written:** 4 Oct 2026 · Node v24.14.1 · against `dist/index.html` sha256 `72e292574183b` / source digest `2187a2371262` · HEAD `2c0d95d`
**Decision:** Option B of two offered — collapse three columns to two, fold `detail` under `label`, let the time column shrink-wrap.

---

## Goal

The crack-time table in the `▸ Verify this page` disclosure renders as three
unlabelled equal-width columns, and the time figure overflows the right edge.
Fix the formatting without touching the arithmetic (`entropy.crackTimeRows()` is
correct and stays correct) and without touching any other section.

Three source files, then a mandatory rebuild.

## The defect, measured

Reproduced live in Chromium at 1100px against the built `dist/index.html`.

**1. The time figure is clipped.** `table-layout: fixed` with no column widths
gives three equal `239px` columns. `.c-time` is `white-space: nowrap` and
right-aligned, so `10^30 years` runs past the container and is cut off:

```
Online, rate-limited   guessing through a login form,     10^30 years
                       which the site throttles            ^^^^^^^^^^^^ clipped
```

**2. Three unlabelled columns.** The table has a `<caption>` and zero `<th>`.
There is no way to tell what `10^30 years` measures, and a screen reader
announces a bare grid with no column names. This is the substance of the report.

**3. The caption is a UA-styled orphan.** There is no `caption` rule anywhere in
`styles.css`. It computes to `text-align: center`, `13px`, `font-weight: 400`,
`margin: 0` — centred, while every other line of prose in that disclosure is a
left-aligned `.lede` (`.styles.css:1256`). It reads as a floating artifact
rather than the section's introduction.

**4. No row rules.** Rows blur together, and since the detail column wraps to two
lines the eye has nothing to track across.

**5. Narrow viewports drop the definitions.** `styles.css:1590` sets
`.crack .c-detail { display: none }`. At 390px the reader gets
`Online, rate-limited | 10^30 years` and nothing else. The `detail` string is
the *only* place "rate-limited" and "slow hash" are ever defined, so the
interesting half of the table is the half that disappears.

**6. Stale comment.** `styles.css:1588` says `"Offline, rate-limited" is the
longest label`. No such label exists — `ATTACK_MODELS` (`src/lib/entropy.js:22`)
has `Online, rate-limited`, `Offline, slow hash`, `Offline, fast hash`.

### Explicitly *not* a defect

The report's paste reads `10^28 years`; the live page renders `10^30 years`.
`formatDurationFromLog10` (`src/lib/entropy.js:173`) derives that exponent from
the current password's bit count, so it moves every time you regenerate. Leave
the numbers alone.

## Why Option B

Collapsing to two columns fixes 1, 2, 4 and 5 at once, structurally:

- The overflow becomes impossible. `width: 1%` + `white-space: nowrap` on the
  time column makes it shrink-wrap its content; the label column absorbs the
  remainder at any viewport, font size or zoom level.
- The definitions survive 390px, so the `display: none` hack is deleted outright
  rather than relocated.
- It matches the idiom already in the file. `.counters` (`.styles.css:1270`) is a
  ruled schedule sharing hairlines; this becomes the same object.

The cost is giving up an explicit "what is this column" label — recovered by a
two-cell `<thead>`, which is cheap.

---

## Changes

### 1. `src/index.html` — the table shell (around lines 272-279)

Add a `<thead>` and go from three columns to two. `<caption>` text is unchanged.

```html
<table class="crack">
  <caption>
    Time to crack, if an attacker already holds the hash and is allowed to guess
    at a fixed rate. Guesses are independent, so a human who reuses a pattern
    beats these numbers.
  </caption>
  <thead>
    <tr>
      <th scope="col">Attack</th>
      <th scope="col" class="c-time">Time to crack</th>
    </tr>
  </thead>
  <tbody id="crack-rows"></tbody>
</table>
```

The `id="crack-rows"` on `<tbody>` must survive — `app.js` looks it up by id.

### 2. `src/app.js` — `paintCrackRows()` (lines 280-305)

Build two cells instead of three. `detail` becomes a `<span>` inside the label
cell, set with `textContent` — `tools/build.mjs:50` forbids `innerHTML` outright.

```js
rows.forEach(function (row) {
  var tr = document.createElement('tr');

  var label = document.createElement('td');
  label.className = 'c-label';

  var name = document.createElement('span');
  name.className = 'c-name';
  name.textContent = row.label;

  var detail = document.createElement('span');
  detail.className = 'c-detail';
  detail.textContent = row.detail;

  label.appendChild(name);
  label.appendChild(detail);

  var time = document.createElement('td');
  time.className = 'c-time';
  time.textContent = row.seconds;

  tr.appendChild(label);
  tr.appendChild(time);
  body.appendChild(tr);
});
```

Everything else in the function — `show(document.querySelector('.crack'), true)`,
the `textContent = ''` reset, the doc comment — stays. `entropy.crackTimeRows()`
and `ATTACK_MODELS` are untouched.

### 3. `src/styles.css` — the structural half (lines 253-267)

Replace the current `.crack` block. Note this half sits **before** `:root`
(line 369) and must stay free of `var()` — `styles.css:19-26` is explicit that
moving rules between the halves is how the page half-stops responding, and
`:root` tokens do not exist yet above line 369.

```css
/* The time column shrink-wraps, so the figures stay in one column and the label
   column takes whatever is left. table-layout: fixed is what used to clip them. */
.crack {
  width: 100%;
  border-collapse: collapse;
}

.crack .c-time {
  width: 1%;
  white-space: nowrap;
}
```

`table-layout: fixed` goes. With it gone, the old comment's claim — that fixed
layout is "what keeps the numbers in a column" — is what actually needs
replacing: `width: 1%` + `nowrap` is the mechanism, and it is zoom-proof in a
way fixed percentages are not.

`.crack .c-detail { vertical-align: top }` is deleted; `detail` is no longer a
column.

### 4. `src/styles.css` — the design half (after `:root`, around line 1256)

New rules, next to the `.lede` and `.counters` blocks they echo. All `var()`
usage belongs here.

```css
.crack caption {
  caption-side: top;
  text-align: left;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-bottom: 10px;
}

.crack thead th {
  padding: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-mute);
  border-bottom: 2px solid var(--ink);
}

.crack tbody td {
  padding: 9px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.crack tbody tr:last-child td {
  border-bottom: 0;
}

.crack .c-name {
  display: block;
}

.crack .c-detail {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-mute);
}
```

Two references worth honouring so this reads as the same drawing:

- `border-bottom: 2px solid var(--ink)` is the masthead rule (`.styles.css:458`)
  and `border-top: 2px solid var(--ink)` at `.styles.css:1389`. Reusing the
  double-weight rule for a header is the existing convention.
- `.c-time` keeps `text-align: right` from the structural half; add
  `padding-left: 12px` on `.crack tbody td.c-time` so the figure is not flush
  against the label at desktop widths.

### 5. `src/styles.css` — delete the narrow-viewport override (lines 1588-1600)

Remove all of it:

```css
  /* "Offline, rate-limited" is the longest label; drop the middle column and let
     it break rather than crushing both remaining ones. */
  .crack .c-detail {
    display: none;
  }

  .crack .c-label {
    width: 54%;
  }

  .crack .c-time {
    width: 46%;
  }
```

This is the load-bearing deletion. With two columns and a shrink-wrapping time
column, 347px of table width is enough — which is the whole argument for Option B
over Option A, where the detail column still had to be hidden or relocated. The
stale comment goes with it.

### 6. Rebuild and verify — `dist/` is never hand-edited

```
npm run build     # dist/index.html + dist/index.html.sha256
npm run check     # build + node --test + tools/verify.mjs
```

Editing `styles.css` and `app.js` changes the source digest *and* both CSP
hashes, because `tools/build.mjs:206-207` hashes the assembled script and
stylesheet text into `script-src` / `style-src`. The build does this; a manual
edit to `dist/index.html` would break `verify.mjs`'s hash checks and the page's
own tamper self-check at `src/index.html:310`.

## Not in scope

- **`entropy.js`.** `ATTACK_MODELS`, `crackTimeRows()` and
  `formatDurationFromLog10()` are correct. `row.id` and `row.guessesPerSecond`
  are already returned and unused by the renderer — surfacing the guesses/second
  figure would be a genuine content improvement, but it is a separate decision
  from fixing the layout.
- **`README.md`.** Line 151 lists "the six counters, the watched channels, the
  policy in force, the self-test and the crack-time table". Still a table, still
  in the same disclosure. No edit needed.
- **Tests.** No test touches this DOM. `test/dom-stub.mjs:216` loads only
  `lib/random.js` and `lib/integrity.js`, so there is no harness for `app.js`
  and `controls.test.mjs` never mentions the crack table. `npm run check` should
  pass with no test changes — expect no new failures, and do not treat an
  unexpected failure here as caused by this work.

## Verification

1. `npm run check` — all of `verify.mjs`'s 16 checks green, `dist` not stale.
2. Re-screenshot `dist/index.html` at **1100px**, `▸ Verify this page` expanded:
   - `10^30 years` fully inside the container, no clipping
   - header row `Attack | Time to crack` visible with a 2px rule under it
   - hairlines between rows; no vertical gaps between row borders
   - caption left-aligned, matching `.lede`, not centred
3. Re-screenshot at **390px**: the `detail` sentence is visible under each label.
   This is the regression that Option B exists to prevent.
4. Regenerate a few passwords and confirm the time column still aligns and the
   figures change (`10^30` → `10^18` etc.) — proves `paintCrackRows` still
   repaints rather than the first render being cached in the markup.
5. Confirm the page's own `Check a copy of this file` digest compare still
   succeeds against the value the build printed.

## Files

| File | Change |
| --- | --- |
| `src/index.html` | `<thead>` + two columns; `id="crack-rows"` preserved |
| `src/app.js` | `paintCrackRows()`: two cells, `detail` nested in the label |
| `src/styles.css` | structural block rewritten; design rules added after `:root`; narrow-viewport override deleted |
| `dist/index.html` | rebuilt only — never hand-edited |

Group B — the teach skill, from another author

Credit

The five files in Group B come from the repository mattpocock/skills, by Matt Pocock. They are copied here without change. This page does not claim them.

They are here because one of them, the teaching protocol, is the engine behind section 10. Copying it means you can see exactly what a skill is.

The teaching protocol ~/.agents/skills/teach/SKILL.md

Copied exactly. From mattpocock/skills. 140 lines.

This is section 10 in full. Line 4 is the setting that stops it from starting by itself.

---
name: teach
description: Teach the user a new skill or concept, within this workspace.
disable-model-invocation: true
argument-hint: "What would you like to learn about?"
---

The user has asked you to teach them something. This is a stateful request - they intend to learn the topic over multiple sessions.

## Teaching Workspace

Treat the current directory as a teaching workspace. The state of their learning is captured in this directory in several files:

- `MISSION.md`: A document capturing the _reason_ the user is interested in the topic. This should be used to ground all teaching. Use the format in [MISSION-FORMAT.md](./MISSION-FORMAT.md).
- `./reference/*.html`: A directory of reference materials. These are the compressed learnings from the lessons - cheat sheets, reference algorithms, syntax, yoga poses, glossaries. They are the raw units of learning. They should be beautiful documents which print out well, and are designed for quick reference.
- `RESOURCES.md`: A list of resources which can be explored to ground your teaching in contextual knowledge, or to acquire knowledge and wisdom. Use the format in [RESOURCES-FORMAT.md](./RESOURCES-FORMAT.md).
- `./learning-records/*.md`: A directory of learning records, which capture what the user has learned. These are loosely equivalent to architectural decision records in software development - they capture non-obvious lessons and key insights that may need to be revised later, or drive future sessions. These should be used to calculate the zone of proximal development. They are titled `0001-<dash-case-name>.md`, where the number increments each time. Use the format in [LEARNING-RECORD-FORMAT.md](./LEARNING-RECORD-FORMAT.md).
- `./lessons/*.html`: A directory of lessons. A **lesson** is a single, self-contained HTML output that teaches one tightly-scoped thing tied to the mission. This is the primary unit of teaching in this workspace.
- `./assets/*`: Reusable **components** shared across lessons. See [Assets](#assets).
- `NOTES.md`: A scratchpad for you to jot down user preferences, or working notes.

## Philosophy

To learn at a deep level, the user needs three things:

- **Knowledge**, captured from high-quality, high-trust resources
- **Skills**, acquired through highly-relevant interactive lessons devised by you, based on the knowledge
- **Wisdom**, which comes from interacting with other learners and practitioners

Before the `RESOURCES.md` is well-populated, your focus should be to find high-quality resources which will help the user acquire knowledge. Never trust your parametric knowledge.

Some topics may require more skills than knowledge. Learning more about theoretical physics might be more knowledge-based. For yoga, more skills-based.

### Fluency vs Storage Strength

You should be careful to split between two types of learning:

- **Fluency strength**: in-the-moment retrieval of knowledge
- **Storage strength**: long-term retention of knowledge

Fluency can give the user an illusory sense of mastery, but storage strength is the real goal. Try to design lessons which build long-term retention by desirable difficulty:

- Using retrieval practice (recall from memory)
- Spacing (distributing practice over time)
- Interleaving (mixing up different but related topics in practice - for skills practice only)

## Lessons

A lesson is the main thing you produce: the unit in which knowledge and skills reach the user. Each lesson is one self-contained HTML file, saved to `./lessons/` and titled `0001-<dash-case-name>.html` where the number increments each time.

A lesson should be **beautiful**, with clean, readable typography and layout, since the user will return to these later to review. Think Tufte.

The lesson should be short, and completable very quickly. Learners' working memory is very small, and we need to stay within it. But each lesson should give the user a single tangible win that they can build on. It should be directly tied to the mission, and should be in the user's zone of proximal development.

If possible, open the lesson file for the user by running a CLI command.

Each lesson should link via HTML anchors to other lessons and reference documents.

Each lesson should recommend a primary source for the user to read or watch. This should be the most high-quality, high-trust resource you found on the topic.

Each lesson should contain a reminder to ask followup questions to the agent. The agent is their teacher, and can assist with anything that's unclear.

## Assets

Lessons are built from reusable **components**, stored in `./assets/`: stylesheets, quiz widgets, simulators, diagram helpers, and anything else a second lesson could reuse.

Reuse is the default, not the exception. Before authoring a lesson, read `./assets/` and build from the components already there. When a lesson needs something new and reusable, write it as a component in `./assets/` and link to it; never inline code a future lesson would duplicate.

A shared stylesheet is the first component every workspace earns: every lesson links it, so the lessons look like one consistent course rather than a pile of one-offs. As the workspace grows, so should the component library.

## The Mission

Every lesson should be tied into the mission - the reason that the user is interested in learning about the topic.

If the user is unclear about the mission, or the `MISSION.md` is not populated, your first job should be to question the user on why they want to learn this.

Failing to understand the mission will mean knowledge acquisition is not grounded in real-world goals. Lessons will feel too abstract. You will have no way of judging what the user should do next.

Missions may change as the user develops more skills and knowledge. This is normal - make sure to update the `MISSION.md` and add a learning record to capture the change. Confirm with the user before changing the mission.

## Zone Of Proximal Development

Each lesson, the user should always feel as if they are being challenged 'just enough'.

The user may specify an exact thing they want to learn. If they don't, figure out their zone of proximal development by:

- Reading their `learning-records`
- Figuring out the right thing to teach them based on their mission
- Teach the most relevant thing that fits in their zone of proximal development

## Knowledge

Lessons should be designed around a skill the user is going to learn. The knowledge in the lesson should be only what's required to acquire that skill. You teach the knowledge first, then get the user to practice the skills via an interactive feedback loop.

Knowledge should first be gathered from trusted resources. Use `RESOURCES.md` to keep track of them. Lessons should be littered with citations - links to external resources to back up any claim made. This increases the trustworthiness of the lesson.

For acquiring knowledge, difficulty is the enemy. It eats working memory you need for understanding.

## Skills

If knowledge is all about acquisition, skills are about durability and flexibility. Make the knowledge stick.

For skill acquisition, difficulty is the tool. Effortful retrieval is what builds storage strength. Skills should be taught through interactive lessons. There are several tools at your disposal:

- Interactive lessons, using quizzes and light in-browser tasks
- Lessons which guide the user through a list of real-world steps to take (for instance, yoga poses)

Each of these should be based on a **feedback loop**, where the user receives feedback on their performance. This feedback loop should be as tight as possible, giving feedback immediately - and ideally automatically.

For quizzes, each answer should be exactly the same number of words (and characters, if possible). Don't give the user any clues about the answer through formatting.

## Acquiring Wisdom

Wisdom comes from true real-world interaction - testing your skills outside the learning environment.

When the user asks a question that appears to require wisdom, your default posture should be to attempt to answer - but to ultimately delegate to a **community**.

A community is a place (online or offline) where the user can test their skills in the real world. This might be a forum, a subreddit, a real-world class (budget permitting) or a local interest group.

You should attempt to find high-reputation communities the user can join. If the user expresses a preference that they don't want to join a community, respect it.

## Reference Documents

While creating lessons, you should also create reference documents. Lessons can reference these documents - they are useful for tracking raw units of knowledge useful across lessons.

Lessons will rarely be revisited later - reference documents will be. They should be the compressed essence of the lesson, in a format designed for quick reference.

Some learning topics lend themselves to reference:

- Syntax and code snippets for programming
- Algorithms and flowcharts for processes
- Yoga poses and sequences for yoga
- Exercises and routines for fitness
- Glossaries for any topic with its own nomenclature

Glossaries, in particular, are an essential reference. Once one is created, it should be adhered to in every lesson.

## `NOTES.md`

The user will sometimes express preferences of how they want to be taught, or things you should keep in mind. This is the place to record those preferences, so you can refer back to them when designing lessons or working with the user.
The mission file format ~/.agents/skills/teach/MISSION-FORMAT.md

Copied exactly. From mattpocock/skills. 31 lines.

This is the shape of MISSION.md. The last rule is the one that matters: if the purpose is vague, the file is useless.

# MISSION.md Format

`MISSION.md` lives at the workspace root. It captures the _reason_ the user is learning this topic. Every teaching decision (what to teach next, which resources to surface, which exercises to design) should trace back to this document.

## Template

```md
# Mission: {Topic}

## Why
{1-3 sentences. The concrete real-world goal the user is chasing. What changes in their life or work when they have this skill? Avoid abstract framings like "to understand X"; push for the underlying outcome.}

## Success looks like
- {A specific, observable thing the user will be able to do}
- {Another specific thing}
- {…}

## Constraints
- {Time, budget, prior commitments, learning preferences, anything that bounds the approach}

## Out of scope
- {Adjacent topics the user explicitly does not want to chase right now, protecting the zone of proximal development}
```

## Rules

- **One mission per workspace.** If the user wants to learn two unrelated things, that is two workspaces.
- **Concrete over abstract.** "Run a half marathon by October" beats "get fitter." "Ship a Rust CLI to my team" beats "learn Rust."
- **Push back on vagueness.** If the user cannot articulate why, interview them before writing anything. A bad mission is worse than no mission.
- **Revise when reality shifts.** Missions change. When the user's goal moves, update this file: don't leave a stale mission steering future sessions.
- **Keep it short.** If `MISSION.md` runs past a screen, it has stopped being a compass and started being a plan.
The resources file format ~/.agents/skills/teach/RESOURCES-FORMAT.md

Copied exactly. From mattpocock/skills. 32 lines.

This is the shape of RESOURCES.md. Line 28 is the rule that makes it useful three months later: every entry gets a note.

# RESOURCES.md Format

`RESOURCES.md` is the curated set of trusted sources for this topic. Knowledge for explainers should be drawn from here, not from parametric guesses. Wisdom comes from the communities listed here.

## Structure

```md
# {Topic} Resources

## Knowledge

- [Book: _The Science and Practice of Strength Training_ by Zatsiorsky & Kraemer](https://example.com)
  Foundational text on programming and adaptation. Use for: anything to do with periodisation, recovery, intensity zones.
- [Article: "How Much Should I Train?" by Greg Nuckols (Stronger By Science)](https://example.com)
  Evidence-based review of volume landmarks. Use for: weekly set targets per muscle group.

## Wisdom (Communities)

- [r/weightroom](https://reddit.com/r/weightroom)
  High-signal subreddit, moderated against bro-science. Use for: programme critique, plateau troubleshooting.
- Local: Tuesday strength class at {gym name}
  Use for: real-time coaching feedback on lifts.
```

## Rules

- **High-trust only.** Prefer primary sources, recognised experts, peer-reviewed work, and communities with strong moderation. If a resource is marketing dressed as education, leave it out.
- **Annotate every entry.** A bare link is useless in three months. Add one line: what it covers and when to reach for it.
- **Group by Knowledge / Wisdom.** Mirrors the philosophy in [SKILL.md](./SKILL.md). It is fine for a resource to appear in only one group.
- **Surface gaps explicitly.** If no good resource exists for an area the mission needs, write a `## Gaps` section listing what is missing. This drives future search.
- **Prune ruthlessly.** A resource that turned out to be wrong, shallow, or off-mission should be removed, not buried. Better five sharp sources than thirty mediocre ones.
- **Record community preferences.** If the user has opted out of joining communities, note it here so future sessions don't keep proposing them.
The learning record format ~/.agents/skills/teach/LEARNING-RECORD-FORMAT.md

Copied exactly. From mattpocock/skills. 46 lines.

This is the shape of a file in learning-records/. The section called "What does not qualify" is the important one: coverage is not learning.

# Learning Record Format

Learning records live in `./learning-records/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc. Create the directory lazily: only when the first record is written.

They are the teaching equivalent of ADRs: they capture non-obvious lessons, key insights, and stated prior knowledge that will steer future sessions. They are used to calculate the zone of proximal development.

## Template

```md
# {Short title of what was learned or established}

{1-3 sentences: what was learned (or what prior knowledge was established), and why it matters for future sessions.}
```

That is the whole format. A learning record can be a single paragraph. The value is recording _that_ this is now known and _why_ it changes what to teach next, not in filling out sections.

## Optional sections

Only include these when they add genuine value. Most records won't need them.

- **Status** frontmatter (`active | superseded by LR-NNNN`): useful when an earlier understanding turns out to be wrong and is replaced.
- **Evidence**: how the user demonstrated the understanding (a question answered, an exercise completed, prior experience cited). Useful when the claim might be revisited.
- **Implications**: what this unlocks or rules out for future sessions. Worth recording when non-obvious.

## Numbering

Scan `./learning-records/` for the highest existing number and increment by one.

## When to write a learning record

Write one when any of these is true:

1. **The user demonstrated genuine understanding of something non-trivial**: not just exposure, but evidence they can use the concept correctly. This sets a new floor for what to teach next.
2. **The user disclosed prior knowledge**: "I already know X." Record it so future sessions don't re-teach it. Also record the _depth_ claimed.
3. **A misconception was corrected**: the user previously believed something wrong and now sees why. These are high-value: they predict future stumbling blocks for related topics.
4. **The mission shifted in response to learning**: the user discovered they cared about something different than they thought. Cross-link to [[MISSION.md]] and update it.

### What does _not_ qualify

- Material that was merely covered. Coverage is not learning. Wait for evidence.
- Anything already captured tersely in [[GLOSSARY.md]] as a term definition. Don't duplicate.
- Session-by-session activity logs. Learning records are not a journal: they are decision-grade insights.

## Supersession

When a later record contradicts an earlier one (the user's understanding deepened or corrected), mark the old record `Status: superseded by LR-NNNN` rather than deleting it. The history of how understanding evolved is itself useful signal.
The glossary format ~/.agents/skills/teach/GLOSSARY-FORMAT.md

Copied exactly. From mattpocock/skills. 35 lines.

This is the shape of a glossary file. Line 29 explains why section 3 of this page works this way. Add a word only after the person can use it.

# GLOSSARY.md Format

`GLOSSARY.md` is the canonical language for this teaching workspace. All explainers, exercises, and learning records should adhere to its terminology. Building it is itself part of learning: compressing a concept into a tight definition is evidence the user understands it.

## Structure

```md
# {Topic} Glossary

{One or two sentence description of the topic this glossary covers.}

## Terms

**Hypertrophy**:
Muscle growth driven by mechanical tension and metabolic stress over repeated training sessions.
_Avoid_: Bulking, getting big

**Progressive overload**:
Systematically increasing the demand on a muscle over time, via load, volume, or intensity.
_Avoid_: Pushing harder, levelling up

**RPE (Rate of Perceived Exertion)**:
A 1–10 self-rating of how hard a set felt, where 10 is failure and 8 means two reps left in the tank.
_Avoid_: Effort score, intensity rating
```

## Rules

- **Add a term only when the user understands it.** The glossary is a record of compressed knowledge, not a dictionary the user reads to learn. If the user has just been introduced to a concept, wait until they can use it correctly before promoting it here.
- **Be opinionated.** When several words exist for the same concept, pick the best one and list the rest as aliases to avoid. This is how language compresses.
- **Keep definitions tight.** One or two sentences. Define what the term IS, not what it does or how to do it.
- **Use the glossary's own terms inside definitions.** Once a term is in the glossary, prefer it everywhere, including inside other definitions. This is what makes complex terms easier to grasp later.
- **Group under subheadings** when natural clusters emerge (e.g. `## Anatomy`, `## Programming`). A flat list is fine when terms cohere.
- **Flag ambiguities explicitly.** If a term is used loosely in the wider field, note the resolution: "In this workspace, 'set' always means a working set; warm-ups are tracked separately."
- **Revise as understanding deepens.** A definition the user wrote in week one may be wrong by week six. Update in place; do not leave stale entries.

Group C — installing more skills

Only four skills were ever used in this setup. Here they are, with where each came from.

SkillWhere it came fromWhat it did
deep-researchWritten by handThe search flow, section 7
teachmattpocock/skillsThe learning flow, section 10
frontend-designanthropics/skillsThe look of a page, section 9
find-skillsvercel-labs/skillsFinding new skills

A fifth was tried three times and never worked. It is called customize-opencode. It is not in the install record, so it did not reach OpenCode. The lesson is small. If a skill is not in the list when you start OpenCode, it is not installed.

How to get more

A skill is a folder of instructions. You can install someone else's, or write your own.

# Search for a skill
npx skills find <words to search for>

# Install one, for every project on this computer
npx skills add <owner/repo@skill> -g -y

# Update the ones you have
npx skills update

# Start an empty one of your own
npx skills init <name-for-your-skill>

You can browse at https://skills.sh/. Installed skills land in ~/.agents/skills/, and the list of what you installed is written to ~/.agents/.skill-lock.json.

The highest-value move

Write your own skill. It is the best return on your time of anything in this page.

The deep-research skill in Group A is one. It is the only skill in this setup that a person wrote from nothing. It is also the one that makes section 7 work.

13Cost, safety, limits

Cost

Some models cost money for each message. Others do not. Start with a model that does not cost money. You can change it later.

Research is the flow that costs the most. It reads many pages, and it may run for several minutes. Read the report before you ask for another one.

Safety

Three settings do most of the work. All three are in Group A.

Before any large job, ask the program what it is about to do. Read the answer. If it does not match what you asked, stop it there.

Never do these three things

  1. Never paste a password, a key, or a card number into the chat. Store them in a password manager or a separate file the program cannot read.

  2. Never trust a report you have not opened. Check two or three of the links yourself.

  3. Never let a large change happen without a backup. A copy of the folder first costs you nothing.

A real limit you should plan around

The program is confident in the same tone whether it is right or guessing. There is no signal in the text that tells you which one you are reading.

So build the check into your process, not into your judgement. Open the file. Open the link. Look at it yourself.

When something goes wrong

14Hosting this page

If you want to send this page to a friend, you must put it online first. A file on your own computer is visible to nobody else.

Hosting means putting the file on a public website. You send the one file, and the service makes it available at an address that anyone can open.

Option 1 — Cloudflare Pages, the one to use

This is the best fit, because the page is one file with no build step. Cloudflare Pages takes the file as it is.

cd ~/Documents/opencode-handbook
npx wrangler pages deploy . --project-name opencode-handbook

The command prints a web address when it finishes. You need a Cloudflare account, and you must sign in once when the command asks.

Option 2 — Netlify Drop

You drag the file onto a web page in your browser. No command line. That is the whole method. It works well for a single file like this one.

Option 3 — GitHub Pages

You put the file in a repository and turn on Pages in the settings. This takes more steps than the other two, and it only helps if you already use GitHub for the file.

Why not surge.sh

It was easy once, and it still is. But it needs you to make an account and it does not give you a proper address. For a page you may send to other people, use one of the three above.

Before you send it to anyone

Open the page in your browser and read it all the way through. Check it on a phone as well. If you would be embarrassed to have your friend read a mistake, fix it first.