---
name: context-pack
description: Build and maintain a project context pack so the AI stops being re-briefed: a sources index, approved memory, expiring candidate notes and a task context file, with update and retrieval rules. Use at project start, when the designer says "you forgot", or before any other skill runs on the project.
version: 0.1.0
---

# Context pack

You separate three kinds of context and keep them in `context/`. Other skills read from here.

| File | Holds | Who writes |
| --- | --- | --- |
| `context/sources.md` | Index of source documents: file, revision or date, what it covers, confidentiality | You, from the folder listing |
| `context/approved.md` | Decisions and facts a human has promoted. The only memory other skills may rely on | A human promotes; you draft |
| `context/candidates.md` | Your notes and proposed memory. Each has an expiry date | You |
| `context/task.md` | The current task: goal, inputs, constraints, approval point | You, at the start of each task |

## Procedure — first run
1. List the project folders the designer names. Do not read outside them.
2. Fill `sources.md` from `templates/sources.md`: one row per document. Mark anything labelled
   confidential, NDA, personal data or draft. Do not quote confidential content into any file.
3. Draft `approved.md` from `templates/approved.md` with **zero** entries, plus a header that says
   who may promote entries.
4. Put everything you learned while indexing into `candidates.md`, each line with its source and
   an expiry 30 days out.
5. Write `task.md` for the task at hand from `templates/task.md`.
6. Append the ledger entry (`../_shared/run-ledger.md`). Gate: "Human promotes candidates".

## Procedure — every later run
1. Read `approved.md` first, then `task.md`, then `sources.md`. Read `candidates.md` last and
   treat it as unreliable.
2. When you learn something new, add it to `candidates.md` with source and expiry. Never write
   into `approved.md` yourself.
3. When a source changes revision, update its row in `sources.md` and add a candidate note
   "Rev B supersedes Rev A: <what changed>".
4. Remove expired candidates on each run and say how many you removed.

## Retrieval rules (apply when answering any question about the project)
- Quote the source: file, revision or date, page or line.
- If two sources disagree, say so and cite both. Do not pick one silently.
- If the answer is not in the sources, say "not in the sources" and propose the question for
  `brief/questions.md`.
- Respect confidentiality marks: refer to a confidential document by name only.

## Permissions and gate
- Read: named project folders. Write: `context/` and `runs/ledger.md` only.
- Gate: a named person moves lines from `candidates.md` to `approved.md`, with their name and
  date. That is the only way memory becomes approved.

## Checks
- Every line in `candidates.md` has a source and an expiry.
- `approved.md` contains no line without a promoter's name and date.
- `sources.md` lists every file in the named folders, including the ones you could not open.

## Anti-patterns
- Writing straight into `approved.md` because the fact is obvious.
- Keeping candidate notes alive past their expiry 'in case'.
- Answering from memory of a previous session instead of the pack.

## Never
- Never promote your own notes. Never delete an approved entry; mark it superseded with the date.
- Never copy confidential content into the pack.
