Re-home the context
Swan's runs write every new statement to one home: a fact to the brain, a rule to the agent, a method to a skill, a lesson to memory. Older setups did not. Their automations hold facts, methods, lessons and patch notes in one file, and every run reads all of it. Running the map backwards on a whole org is too much work and too risky. This page makes it bounded: ten files per tune-up, the heaviest first, one file at a time, meaning unchanged.
The map (what goes where)
Ask these about each statement, in order. Stop at the first yes.
| # | The statement is | Its home |
|---|---|---|
| 1 | A key, token or password | A named secret; delete the text |
| 2 | True for one run only, or a result Swan already shows | Nowhere; delete |
| 3 | About one teammate: how they want Swan to work, how they sound | Their preferences file; their sender's writing instructions |
| 4 | One of many rows runs add or count (signals, visits, touches, a ledger) | A custom object, one record per row |
| 5 | About one company, person or deal | That record's field or memory |
| 6 | A guess results can prove wrong | The agent's memory, Hypotheses |
| 7 | Something Swan learned from its own results | The agent's memory, Decisions (a choice, dated) or Lessons (a conclusion, with evidence) |
| 8 | A fact about the company, product, buyers, competitors or team | Organization knowledge (SWAN.md and the files it points to) |
| 9 | A rule about what the work must always or never produce (target, sender, channel, approval, hard stop) | By scope: SWAN.md for the org, AGENT.md for the agent, the automation only for what differs |
| 10 | A value or mechanic of one trigger (cap, window, Campaign, list, payload field, event to ignore) | The automation body, one line each |
| 11 | How to do the work (steps, order of checks, how to pick the person, output shape) | The skill for that method; shared procedures in one shared skill |
| 12 | Data the method keeps between runs | A named file in the agent's memory folder |
| 13 | A long text to read, not follow | A document under the workspace |
| 14 | None of these | Nowhere |
Split a sentence that mixes kinds. "Never email companies under 50 employees; they go to self-serve" is a size fact (8), a routing rule (9) and a stop (9 or 10). A reason stays with its rule on the same line.
When to run it
Only on files the tune-up already touches or that the catalog flags: automations over 6,000 characters (G1), rules copied across three or more files (G2), dated patch notes (G3), memory files that grew into diaries (G5). Never on a file that runs clean and short. At most ten files per tune-up, the ten with the most characters read per run. The rest wait for the next tune-up.
Procedure, one file at a time
- Back up the file to the tune-up folder.
- Split the body into blocks: one block per paragraph, bullet or numbered step.
- Label each block with its map number. When a block mixes kinds, split it first.
- Move the blocks:
- 2 and 14: delete.
- 3, 5, 8: write the statement to its home, dated, with its source. Delete it from the file.
- 6, 7: write it to the agent's memory under the right section, dated. Delete it from the file.
- 9: a rule shared by every automation of the agent goes to AGENT.md once; a rule shared by every agent goes to SWAN.md once. The automation keeps only what differs. When the same rule already sits in the home, delete the copy; do not write it twice.
- 11: a method shared by two or more automations becomes one skill, or joins the skill that already covers it. The automation keeps one line: what the method is and which skill holds it. A method unique to one automation stays, shortened to its steps.
- 12 and 13: move the data or document; leave a one-line pointer.
- 10: stays, one line each.
- Rewrite dated patch notes as the current rule. "UPDATE Nov 12: no longer send to agencies" becomes "Do not send to agencies." The date goes to memory under Decisions if the why matters.
- Read the file back. It should hold: what the run is for, which event qualifies, what to read, what to decide, when to stop, where the result goes, who hears about it. Nothing else.
- Check every home you wrote. A statement written to a home that already said it is a duplicate: keep the older, clearer line.
- Count the characters a run reads before and after (the automation plus the skills it loads plus AGENT.md and MEMORY.md). Put the two numbers in the proposal.
Rules
- Meaning never changes. A stop, an exclusion, an approval or a cap moves; it does not weaken. When unsure which home a stop belongs to, leave it where it is.
- One file per pass, read back before the next.
- Use code to find duplicates. Split every automation and skill into sentences, normalize, and hash; a sentence that appears in three or more files is a G2 finding with its list of files. Do not look for duplicates by reading.
- A long file that a single automation uses and that runs clean is not a target. Length alone is not the problem; reading the same paragraph in seventeen files is.
- After the pass, suggest one real run of the automation on one record, and read its summary before you touch the next file.
What to tell the team
One line per file: the file, characters before and after, what moved where. Example: "Hiring watch: 14,200 to 2,900 characters. Six ICP rules moved to the agent, the qualification steps joined the company-moments skill, two account notes went to their records, four patch notes became rules."