ai-first-os 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +226 -0
  3. package/bin/ai-first-os.js +72 -0
  4. package/core/CLAUDE.md +148 -0
  5. package/core/VERSION +1 -0
  6. package/core/agents/ambiguous-spec.md +39 -0
  7. package/core/agents/complete-spec.md +36 -0
  8. package/core/agents/scout.md +25 -0
  9. package/core/install.sh +243 -0
  10. package/core/lib/archive.sh +347 -0
  11. package/core/lib/bootstrap.sh +276 -0
  12. package/core/lib/capture.sh +188 -0
  13. package/core/lib/check-resolvable.sh +172 -0
  14. package/core/lib/close-session.sh +741 -0
  15. package/core/lib/common.sh +1773 -0
  16. package/core/lib/focus-read.sh +282 -0
  17. package/core/lib/manual-link.sh +111 -0
  18. package/core/lib/markdown.py +304 -0
  19. package/core/lib/migrate-backlogs.sh +207 -0
  20. package/core/lib/migrate-canonicals.sh +523 -0
  21. package/core/lib/mount-repo.sh +543 -0
  22. package/core/lib/my-wiki-gates.sh +137 -0
  23. package/core/lib/my-wiki.sh +202 -0
  24. package/core/lib/my_wiki_build.py +548 -0
  25. package/core/lib/my_wiki_graph.py +137 -0
  26. package/core/lib/my_wiki_overview.py +392 -0
  27. package/core/lib/new-memory.sh +160 -0
  28. package/core/lib/new-product.sh +122 -0
  29. package/core/lib/new-workspace.sh +105 -0
  30. package/core/lib/pack-install.sh +114 -0
  31. package/core/lib/recall.sh +235 -0
  32. package/core/lib/recall_index.py +295 -0
  33. package/core/lib/remote-backup.sh +84 -0
  34. package/core/lib/rename-heads.sh +354 -0
  35. package/core/lib/rename-workspaces.sh +271 -0
  36. package/core/lib/session-read.sh +203 -0
  37. package/core/lib/session-start.sh +854 -0
  38. package/core/lib/supersede.sh +436 -0
  39. package/core/lib/sweep.sh +473 -0
  40. package/core/manual/COMO-FUNCIONA.md +251 -0
  41. package/core/manual/HOW-IT-WORKS.md +250 -0
  42. package/core/resolver.md +30 -0
  43. package/core/skills/archive.md +95 -0
  44. package/core/skills/bootstrap.md +226 -0
  45. package/core/skills/capture.md +65 -0
  46. package/core/skills/check-resolvable.md +38 -0
  47. package/core/skills/close-session.md +108 -0
  48. package/core/skills/grill.md +74 -0
  49. package/core/skills/mount-repo.md +97 -0
  50. package/core/skills/my-wiki.md +103 -0
  51. package/core/skills/new-memory.md +76 -0
  52. package/core/skills/new-product.md +55 -0
  53. package/core/skills/new-spec.md +114 -0
  54. package/core/skills/new-workspace.md +53 -0
  55. package/core/skills/recall.md +64 -0
  56. package/core/skills/rename-heads.md +72 -0
  57. package/core/skills/rename-workspaces.md +43 -0
  58. package/core/skills/supersede.md +83 -0
  59. package/core/skills/sweep.md +40 -0
  60. package/core/templates/my-wiki-graph.js +431 -0
  61. package/core/templates/my-wiki-overview.js +174 -0
  62. package/core/templates/my-wiki.html +1017 -0
  63. package/core/templates/node-folder/README.md +11 -0
  64. package/core/templates/node-folder/resolver.md +9 -0
  65. package/core/templates/node-light.md +22 -0
  66. package/core/templates/node-product/README.md +8 -0
  67. package/core/templates/node-repo/README.md +14 -0
  68. package/core/templates/node-repo/context/README.md +22 -0
  69. package/core/templates/node-repo/context/competitors.md +8 -0
  70. package/core/templates/node-repo/context/glossary.md +8 -0
  71. package/core/templates/node-repo/context/open-questions.md +9 -0
  72. package/core/templates/node-repo/context/opportunities.md +9 -0
  73. package/core/templates/node-repo/context/problem.md +8 -0
  74. package/core/templates/node-repo/context/scope.md +8 -0
  75. package/core/templates/node-repo/context/users.md +8 -0
  76. package/core/templates/node-repo/context/vision.md +8 -0
  77. package/core/templates/node-repo/resolver.md +14 -0
  78. package/core/templates/operator.md +17 -0
  79. package/core/templates/person.md +10 -0
  80. package/core/templates/repo-scaffold/ARCHITECTURE.md +3 -0
  81. package/core/templates/repo-scaffold/CLAUDE.md +23 -0
  82. package/core/templates/repo-scaffold/decisions.md +3 -0
  83. package/core/templates/repo-scaffold/evals-run.sh +14 -0
  84. package/core/templates/repo-scaffold/gitignore +3 -0
  85. package/core/templates/repo-scaffold/settings.json +8 -0
  86. package/core/templates/root-resolver.md +5 -0
  87. package/core/templates/strings.md +1361 -0
  88. package/core/templates/tree.md +59 -0
  89. package/core/templates/voice.md +5 -0
  90. package/package.json +23 -0
@@ -0,0 +1,103 @@
1
+ ---
2
+ command: my-wiki
3
+ capability: See the brain as a navigable page, and publish it
4
+ description: Project the brain as one navigable page — a workspace selector, a shelf per entity type the tree declares, the initiatives hanging from the entity each one is about, the people, and a search that runs inside the page. It opens on Overview: the Claude Code threads that are waiting for you, the open gates, who you are waiting on and what has a date this week. Generated by script from the files and git, with no tokens of the model, and regenerated in seconds every time the brain changes. The script writes the page outside the brain and never publishes: the session publishes it with the Artifact tool and a person approves that.
5
+ description_es: Proyecta el cerebro como una sola página navegable — selector de espacio de trabajo, un estante por cada tipo de entidad que declara el árbol, las iniciativas colgando de la entidad de la que tratan, las personas y una búsqueda que corre adentro de la página. Abre en Panorama: los hilos de Claude Code que te esperan, los gates abiertos, a quién estás esperando y qué tiene fecha esta semana. La genera un script a partir de los archivos y de git, sin tokens del modelo, y se regenera en segundos cada vez que el cerebro cambia. El script escribe la página fuera del cerebro y nunca publica: la sesión la publica con la herramienta Artifact y eso lo aprueba una persona.
6
+ ---
7
+
8
+ # my-wiki — the brain, projected as a page a person reads
9
+
10
+ Obsidian shows every file of the brain in the order of the folders, machinery included. This skill
11
+ shows the same brain the way its owner thinks about it: entities on their shelves, the initiatives
12
+ under the entity they are about, the people, one search box — and, first of all, Overview: what is
13
+ waiting for a person right now.
14
+
15
+ **Nothing is written twice.** The page is a projection: it reads the files and git, and writes
16
+ nothing back. What it shows is wrong only when the brain is wrong.
17
+
18
+ ## How it is run
19
+
20
+ ```
21
+ .os/core/lib/my-wiki.sh --brain .
22
+ .os/core/lib/my-wiki.sh --brain . --out /tmp/my-wiki.html
23
+ .os/core/lib/my-wiki.sh --brain . --days 7 --week 14
24
+ ```
25
+
26
+ `--out` names the destination file; with none, it goes to `$TMPDIR`. **A destination inside the
27
+ brain is refused**: the page is derived and disposable, and a generated file left inside the brain
28
+ would show up as work in every scan from then on. `--days` is the window of Overview's threads
29
+ (default 3) and `--week` the window of its dated tasks (default 7).
30
+
31
+ It prints the path it wrote, the size, and how many pages and workspaces the page carries.
32
+
33
+ ## What the page shows
34
+
35
+ - **Overview, the first screen.** The Claude Code threads of the last days whose last turn is the
36
+ agent's — grouped by the focus each session named — the specs waiting for a Gate 1 and the
37
+ branches waiting for a merge, the `waiting_on:` that is somebody else, and the tasks with a date
38
+ inside the week. **Claude Code keeps no record of what a person opened**: a thread that finished
39
+ without asking anything is shown as *finished · unread*, and the page says on screen that it is
40
+ showing it for lack of that datum, never as a fact. A machine with no local sessions says so and
41
+ shows the other three blocks.
42
+ - **A workspace selector**, one page for every workspace of the brain. The root is never shown:
43
+ what lives there is machinery, and the machinery is not the person's work.
44
+ - **A shelf per entity type the tree declares** — whatever they are called in this brain. No type
45
+ is written into the skill: a brain that declares `patients/` gets a Patients shelf, and a brain
46
+ with no entity type at all gets its workspace with a notice and no invented shelves.
47
+ - **An initiative hangs from the entity its `about:` names.** One that declares none is listed
48
+ under *No entity* — visible, never hidden.
49
+ - **The sections of a page are the `##` of its file**, each with its shape: tasks when the lines
50
+ carry checkboxes, decisions when they start with a date, people when they point at `people/`,
51
+ and rendered prose for everything else.
52
+ - **Development**, only on a node with `repo:`: the specs by state and the last merge, read from
53
+ the local path `mounts.md` declares for that remote. A repo this machine has not mounted says so
54
+ and nothing fails.
55
+ - **What changed**, from `git log` over the window, grouped by entity and initiative.
56
+ - **Graph**, one screen more of the page (spec 061, its canvas rebuilt by spec 066 to the vara of
57
+ Obsidian): every page as a node on a `<canvas>` with its own physics — nodes settle by force,
58
+ drag one and it stays where it is dropped, the background pans, the wheel zooms centred on the
59
+ cursor, a double-click fits the whole graph. An edge for every `about:`, every path to another
60
+ page inside backticks and every path into `people/` — nothing else. Hover highlights a node's
61
+ neighbours and opens its page on click, *Show documents*/*Show people* filter a type without
62
+ recomputing the rest, and *How it grew* steps the graph through the first-commit date of every
63
+ page. No library loads from outside the page.
64
+ - **Search**, inside the page, over titles and bodies of the workspace being read.
65
+ - **Appearance** — accent, type, size, theme — changed from the page and remembered by the browser.
66
+
67
+ *Edit markdown* opens the note in Obsidian (`obsidian://open?vault=…&file=…`) and copies the path
68
+ to the clipboard at the same time: a published page runs in a sandbox that may refuse the scheme,
69
+ and the path is what the person needs either way.
70
+
71
+ ## Publishing it
72
+
73
+ **The script never publishes.** The session does, with the **Artifact** tool, and the person
74
+ approves that turn:
75
+
76
+ 1. Run the script and read the path it printed.
77
+ 2. Publish that file with the Artifact tool, passing its path: title **My Wiki**, and the
78
+ comments capability, so the page can be commented on. The page carries its own favicon-less
79
+ head; the tool asks for one on a first publish.
80
+ 3. Hand the person the URL, and say the page is private until they share it.
81
+
82
+ **A second run publishes to the same URL**, not to a new one: the same file path this session, or
83
+ the artifact's URL from a later session. A new URL every time turns the wiki into a pile of stale
84
+ copies.
85
+
86
+ **Publishing puts the content of the brain on claude.ai** — private by default, and off the
87
+ machine anyway. It is offered, never done on its own.
88
+
89
+ ## Reading the comments afterwards
90
+
91
+ A comment on the published page is how the person sends something back: a correction, a task to
92
+ move, a document to rewrite. To read them, the session calls the Artifact tool with the page's URL
93
+ and the `comments` action; a thread the person sent to Claude is the one that can be replied to and
94
+ resolved.
95
+
96
+ **A comment is a request, not an edit.** What it asks for is applied to the file in the brain, in
97
+ the session, the way any other change is — and the page is regenerated and republished afterwards.
98
+
99
+ ## What it does not do
100
+
101
+ It does not edit the brain, does not capture, does not mark a task done, and does not open a
102
+ thread of its own. It does not show the archive of a node, and it does not embed images or
103
+ attachments: it links to them.
@@ -0,0 +1,76 @@
1
+ ---
2
+ command: new-memory
3
+ capability: Add a memory node of any type
4
+ description: Create a memory-node type the first time it is used —a folder plus its five lines in `tree.md`— and add a node to it. Two questions —what kind of thing this is, and what this particular one is, for whom— and it writes the head of the node. Manually triggered, once per type or per node.
5
+ description_es: Crea un tipo de nodo de memoria la primera vez que se usa —una carpeta más sus cinco líneas en `tree.md`— y le suma un nodo. Dos preguntas —de qué tipo de cosa se trata, y qué es esta en particular, para quién— y escribe la cabeza del nodo. Se dispara a mano, una vez por tipo o por nodo.
6
+ ---
7
+
8
+ # new-memory — create a memory node, of any type
9
+
10
+ A memory node holds what something is and what is known about it. It is not an initiative — an
11
+ initiative is push: state, horizon, when it closes. A memory node can outlive every initiative built
12
+ around it, and an initiative never needs one to exist.
13
+
14
+ **The folder is the type.** `products/` is the one type this system ships with its own tool (`prd`
15
+ writes its strategic layer). Any sibling folder of nodes that hold memory instead of push works the
16
+ same way: `accounts/` for client accounts, `channels/` for content channels, or a name the operator
17
+ invents. There is no `type:` field anywhere — the path already says what kind of thing a node is.
18
+
19
+ A memory node hangs off the workspace that owns it (`workspaces/<ws>/<type>/<slug>/`), or off the
20
+ root when the type belongs to the operator's own work (`<type>/<slug>/`, with `--root`) — `channels/`
21
+ of a personal brain is a case of this.
22
+
23
+ ## The interview
24
+
25
+ Two questions. Nothing else.
26
+
27
+ 1. **What kind of thing is this — an existing type, or a new one?** If the type already exists,
28
+ nothing about its tree lines is asked again; this call only names it (`--type accounts`). If it
29
+ is new, the type is born with its first node, and its five lines land in `tree.md` the same run.
30
+ 2. **What is this node, and which workspace does it belong to (or is it the operator's own work)?**
31
+ Two or three lines — what it is and what is known, not the whole strategic layer. Skip the
32
+ workspace half of the question if the session already has one loaded — use that. Otherwise ask,
33
+ and never guess it: the wrong workspace is the most expensive mistake this system can make.
34
+
35
+ ## What it writes
36
+
37
+ ```
38
+ .os/core/lib/new-memory.sh --brain . --workspace <slug> --type <type> --name "<Name>" \
39
+ --owner "<person>" [--identity-file <file>]
40
+ .os/core/lib/new-memory.sh --brain . --root --type <type> --name "<Name>" --owner "<person>" \
41
+ [--identity-file <file>]
42
+ ```
43
+
44
+ Leaves `<scope>/<type>/<slug>/README.md` with the identity. Nothing else: `context/`, `research/`,
45
+ `resolver.md` and `decisions.md` are born with their first piece of data, same as every other
46
+ canonical file in this system. The first time a type is used, its five lines of `tree.md` are added
47
+ —3 `glob:` (the head, `resolver.md`, `decisions.md`) and 2 `content:` (`context/*.md`,
48
+ `research/*.md`)— so every scan of the system reads it from the first node on; a second node of the
49
+ same type never duplicates those lines.
50
+
51
+ `--owner` comes from the title of `operator.md`, same as `new-workspace` and `new-product`: the node
52
+ is created by the operator, so they are the owner unless someone else runs it.
53
+
54
+ **The head never gets `role:` and never gets `repo:`.** `role:` activates a standing oficio and that
55
+ activation is per workspace, not per memory node. `repo:` is written by `mount-repo`, and `mount-repo`
56
+ gives a body to an initiative, never to a memory node: the two stay linked only by reference, never
57
+ by folder.
58
+
59
+ If the workspace named does not exist, the command refuses and lists the workspaces that do — it
60
+ never creates one on the spot. Running it twice with the same type and slug refuses the second time:
61
+ two nodes with the same identity are the operator's call, not a default. `--root` and
62
+ `--workspace`/`--org` together are an error, same as naming two different workspaces at once.
63
+
64
+ **Naming a type**: a type this product ships with (today, only `products`) is named in English. A
65
+ type the operator invents is named however they like — it is content of their brain, not a
66
+ component of the system. A recommended catalog, and what a type without its own tool means, is in
67
+ this manual, under "Memory nodes: any folder can be a type."
68
+
69
+ `new-product` is a shortcut for the one type that ships with a purpose-built tool (`prd`, which
70
+ writes its strategic layer): it is exactly `new-memory --type products`, and its own output never
71
+ changes.
72
+
73
+ ## When it finishes
74
+
75
+ Report what was created, in outcomes: the node now has a place to hold what is known about it, and
76
+ —if the type is new— that every scan of the system reads it from now on.
@@ -0,0 +1,55 @@
1
+ ---
2
+ command: new-product
3
+ capability: Add a product
4
+ description: Add a product to a workspace that already exists. Two questions —what the product is, and for whom— and it writes the head of the node. Manually triggered, once per product.
5
+ description_es: Suma un producto a un espacio de trabajo que ya existe. Dos preguntas —qué es el producto y para quién— y escribe la cabeza del nodo. Se dispara a mano, una vez por producto.
6
+ ---
7
+
8
+ # new-product — create a product
9
+
10
+ A product is memory: what it is, for whom, what is known about it. It is not an initiative — an
11
+ initiative is push: state, horizon, when it closes. A product can outlive every initiative built for
12
+ it, and an initiative never needs a product to exist.
13
+
14
+ The product hangs off the organization that owns it, never off the root:
15
+ `workspaces/<org>/products/<slug>/`.
16
+
17
+ ## The interview
18
+
19
+ Two questions. Nothing else.
20
+
21
+ 1. **What is this product, and who is it for?** Two or three lines — what it is and its user, not
22
+ the whole strategic layer. The deep version of that layer (vision, problem, users, scope,
23
+ competitors) is a different tool's job (`prd`), run afterwards, over the node this creates.
24
+ 2. **Which organization does it belong to?** Skip this question if the session already has one
25
+ loaded — use that. Otherwise ask, and never guess it: the wrong organization is the most
26
+ expensive mistake this system can make.
27
+
28
+ ## What it writes
29
+
30
+ ```
31
+ .os/core/lib/new-product.sh --brain . --org <slug> --name "<Name>" --owner "<person>" \
32
+ [--identity-file <file>]
33
+ ```
34
+
35
+ Leaves `workspaces/<org>/products/<slug>/README.md` with the identity. Nothing else: `context/`
36
+ (the strategic layer `prd` writes), `research/` (every dated document about the product — briefs,
37
+ analyses, inventories), `resolver.md` and `decisions.md` are born with their first piece of data,
38
+ same as every other canonical file in this system.
39
+
40
+ `--owner` comes from the title of `operator.md`, same as `new-workspace`: the product is created by
41
+ the operator, so they are the owner unless someone else runs it.
42
+
43
+ **The head never gets `role:` and never gets `repo:`.** `role:` activates a standing oficio and that
44
+ activation is per organization, not per product — a `role:` on a product's head would be a promise
45
+ nothing reads. `repo:` is written by `mount-repo`, and `mount-repo` gives a body to an initiative,
46
+ never to a product: the two stay linked only by reference, never by folder.
47
+
48
+ If the organization named does not exist, the command refuses and lists the organizations that do —
49
+ it never creates one on the spot. Running it twice with the same name refuses the second time: two
50
+ products with the same identity are the operator's call, not a default.
51
+
52
+ ## When it finishes
53
+
54
+ Report what was created, in outcomes: the product now has a place to hold what is known about it,
55
+ and any of the pack's discovery tools can be pointed at it.
@@ -0,0 +1,114 @@
1
+ ---
2
+ command: new-spec
3
+ capability: Write a new spec
4
+ description: Turn concrete build work that came out of a conversation into a spec file under the target repo's specs/, with runnable evals per criterion, decisions split by who closes them, and effects that escape the system declared. Manually triggered, before delegating implementation to an agent.
5
+ description_es: Convierte en una spec el trabajo de construcción concreto que salió de una conversación, adentro de specs/ del repo destino, con evals ejecutables por criterio, las decisiones separadas por quién las cierra y los efectos que escapan del sistema declarados. Se dispara a mano, antes de delegar la implementación en un agente.
6
+ ---
7
+
8
+ # new-spec — writing a spec an agent can implement without asking for an opinion
9
+
10
+ Out of a conversation —strategy or work— comes concrete build work: "we have to build X", "write the
11
+ spec for Y". The deliverable of this craft is a file under `specs/` of the target repo, in this
12
+ product's standard, ready for Gate 1.
13
+
14
+ ## 1. Target repo
15
+
16
+ If it was not stated, ask for it. Before writing:
17
+
18
+ - `ls specs/` of the repo → the next number (`NNN`, three digits, consecutive). Specs archived in
19
+ `specs/done/` count for the numbering.
20
+ - Read the repo's `CLAUDE.md` and `ARCHITECTURE.md` (if it exists) → that way "Prior state"
21
+ describes the real terrain and does not make the implementing agent rediscover what is already
22
+ built.
23
+ - `git rev-parse --short main` → **"Prior state" opens by naming the commit of `main` it describes.**
24
+ A spec is written in one session while other sessions keep moving `main`; by the time it is
25
+ implemented, the terrain it describes may be gone. Git catches a code conflict at merge time and
26
+ nothing catches a stale prior state, so the agent that implements it runs
27
+ `git log <commit>..main --stat` first and sees in seconds whether its terrain moved.
28
+ - If the repo has no `specs/` yet, that repo has not adopted this format. Say so and offer to write
29
+ the first spec anyway, creating the folder.
30
+
31
+ ## 2. The standard of a complete spec
32
+
33
+ A spec is complete when any agent can read it and answer "does it pass or not?" on every criterion
34
+ without asking for an opinion. Whatever is missing from this is not filled in at your own discretion:
35
+ it is asked.
36
+
37
+ **Frontmatter, two fields and no more:**
38
+
39
+ ```
40
+ ---
41
+ status: pendiente
42
+ depends_on: []
43
+ ---
44
+ ```
45
+
46
+ `status` is `pendiente | esperando Gate 1 | en curso | implementada`. `depends_on` is an **inline**
47
+ list of references to other specs (`[]` if it depends on none) — spread over several lines, a `grep`
48
+ returns the first and loses the rest. The reader reports this field; it does not change it just
49
+ because a dependency closed.
50
+
51
+ No script in `core/` parses a spec's frontmatter today — `status`/`depends_on` is a documentary
52
+ convention read by whoever opens the file, not by a lib. Specs already written in `specs/done/`
53
+ keep `estado`/`depende_de`; they are not rewritten (spec 033).
54
+
55
+ **Whatever a spec builds inside `core/`, `public/` or `evals/` is written in English** — the rule
56
+ lives once, at the top of the product's `CLAUDE.md` (`.os/core/../CLAUDE.md` from a brain); this
57
+ skill does not repeat it.
58
+
59
+ **The spec opens by saying what is going to be done**: after the title, one or two plain sentences,
60
+ free of system jargon, before any detail. A spec that cannot be understood at a glance does not get
61
+ reviewed: it gets approved blind.
62
+
63
+ **Type and flow**: `feature` | `verification` (code already written whose eval never ran) |
64
+ `residuals` (a bag of small fixes that alone do not justify a spec). `requirements-first` by
65
+ default; `design-first` if there is a hard technical constraint or dubious feasibility — there the
66
+ first step is the minimum smoke test that de-risks, not building.
67
+
68
+ **Every acceptance criterion carries a runnable eval.** Deterministic for the exact ones (a command,
69
+ an expected row, a grep); with a rubric written into the spec for the generative ones (copy, tone,
70
+ UX). A criterion without an eval is a wish, not a criterion: either you find its check, or it does
71
+ not go in.
72
+
73
+ **The three classes of decision, always separated and never mixed:**
74
+
75
+ 1. *Closed before delegating* → dated and attributed ("DECIDED by `<who>` (Gate 1, `<date>`): … because
76
+ …"), so they do not get re-litigated.
77
+ 2. *Delegated to the implementing agent* → with **the criterion for choosing** written down.
78
+ Delegating without a criterion is not delegating: it is omitting, and the agent settles it blind.
79
+ 3. *Stopping conditions* → here the agent does not decide even with a criterion: it stops and asks.
80
+ These cover contradictions between criteria, decisions neither of the two previous classes
81
+ covers, and any point where being wrong is expensive.
82
+
83
+ **Effects that escape the system**: an email that reaches a person, a charge, a message, a post. No
84
+ rollback brings them back, even when the environment says "staging". They are declared with their
85
+ containment (test recipients, provider sandbox, test data), or the spec says "none" explicitly.
86
+
87
+ **Out of scope with a reactivation condition**: it is not enough to say what does not go in; you have
88
+ to say what would bring it in, measurable where possible ("if volume goes over N", "if the first
89
+ real user of this asks for it").
90
+
91
+ ## 3. Interview only what is missing
92
+
93
+ Whatever already came out of the conversation is not asked again. Ask in short batches, with a
94
+ proposed default at every gap — correcting a default is faster than drafting from scratch.
95
+
96
+ ## 4. Write, validate and deliver
97
+
98
+ 1. Show the complete spec before writing it and wait for the go-ahead.
99
+ 2. Write it in `specs/NNN-short-name.md` with `status: pendiente`, **and commit it to `main` of
100
+ the target repo right away — from the shared checkout, by the session that wrote it.** The rule
101
+ about never working in the shared checkout belongs to the *implementing* agents, each in its own
102
+ worktree; a spec is a document, and the session that supervises writes it where `main` lives — the spec is a document, not code: it goes to `main`, and the branch
103
+ is born with the implementation. Committing is also what reserves the number: two sessions writing
104
+ a spec at the same time both run `ls specs/`, both read the same next number, and neither finds
105
+ out until the merge.
106
+ 3. Close by returning:
107
+ - The exact trigger to implement it: "implement spec NNN".
108
+ - Which agent it belongs to: `complete-spec` if every criterion has its eval and no decision was
109
+ left open; `ambiguous-spec` if unknowns or open decisions remain, or it is design-first.
110
+ - That implementation is delegated from this same session (Agent tool) over the mounted repo:
111
+ there is no need to open a separate session in that folder.
112
+
113
+ If it is worth researching before writing the spec —what something does today, how another source
114
+ solves it— use the `scout` agent: it reads and returns a synthesis, it never writes the spec for you.
@@ -0,0 +1,53 @@
1
+ ---
2
+ command: new-workspace
3
+ capability: Add a workspace
4
+ description: Add a workspace to an existing brain. Two questions —what the workspace is, and what the operator does there— and it writes the node with its identity, its empty resolver and its initiatives folder. Manually triggered, once per workspace.
5
+ description_es: Suma un espacio de trabajo a un brain que ya existe. Dos preguntas —qué es el espacio de trabajo y qué hace el operador ahí— y escribe el nodo con su identidad, su resolver vacío y su carpeta de iniciativas. Se dispara a mano, una vez por espacio de trabajo.
6
+ ---
7
+
8
+ # new-workspace — create a workspace
9
+
10
+ A workspace is each company or client you work for; a course case is one too. It is the isolation
11
+ boundary. Creating it on day 40 leaves exactly the same result as declaring it on day 1.
12
+
13
+ ## The interview
14
+
15
+ Two questions. Nothing else.
16
+
17
+ 1. **What is this workspace?** What it does, for whom and how it makes money. Three or four
18
+ lines.
19
+ 2. **What do you do here?** The answer is a title — identity, written to the body of the head,
20
+ never to `role:`. Write it down in the operator's own words —"I'm the one who decides product"—
21
+ without translating it into anything. `role:` is a different field: it activates an oficio from
22
+ the pack (today: `cpo`) and is born empty. Filling it in is a separate, deliberate step — this
23
+ interview never sets it.
24
+
25
+ ## What it writes
26
+
27
+ ```
28
+ .os/core/lib/new-workspace.sh --brain . --name "<Name>" --role "" --title "<title>" --owner "<person>" \
29
+ [--identity-file <file>]
30
+ ```
31
+
32
+ Leaves `workspaces/<slug>/` with its head `README.md`, a `resolver.md` with no rows and an empty
33
+ `initiatives/` — on a brain that still carries the previous name of that folder, or the previous
34
+ shape of the head, it lands there instead (see `rename-workspaces` and `rename-heads` to adopt the
35
+ current ones). Nothing else: whatever only stores content
36
+ is born with its first piece of data.
37
+
38
+ `--owner` comes from the title of `operator.md`: the workspace is created by the operator, so
39
+ they are the owner. If the brain does not have it yet —or the workspace is run by someone else—
40
+ ask who it is and do not deduce it. `--role` and `--owner` are mandatory because the command writes
41
+ them: the operator neither sees those fields nor has to remember they exist. `--role` is passed
42
+ empty by this interview; naming an oficio slug there is the deliberate step described above, done
43
+ later and outside of it. `--title` carries the answer to question 2 and is optional — with none, the
44
+ body's title line is left blank.
45
+
46
+ The identity comes in through `--identity-file`. You write it with what the operator answered,
47
+ without inventing what they did not say: whatever is missing is marked as a gap.
48
+
49
+ ## When it finishes
50
+
51
+ - Report what was created, in outcomes: what can be written there and what each file answers.
52
+ - If the identity cap warning appears, pass it through as is: summarizing or splitting is the
53
+ operator's call.
@@ -0,0 +1,64 @@
1
+ ---
2
+ command: recall
3
+ capability: Search everything the tree reaches for a lateral question
4
+ description: Search over every file `tree.md` reaches — not only what the startup scan and the focus load — and return the entries that match, with file, line, date and whether each is current or replaced. Expand one result to its neighbours: what it is about, what is about it, what replaced it, what it replaced. Runs on a derived, discardable index that reconciles itself on every call. Manually triggered, and the session runs it on its own before any `grep` for a lateral question.
5
+ description_es: Busca en todo lo que `tree.md` alcanza — no solo lo que carga el arranque y el foco — y devuelve las entradas que coinciden, con archivo, línea, fecha y si cada una sigue vigente o fue reemplazada. Expande un resultado a sus vecinos: de qué trata, quién trata de él, qué lo reemplazó, a qué reemplazó. Corre sobre un índice derivado y descartable que se reconcilia solo en cada llamada. Se dispara a mano, y la sesión lo corre por su cuenta antes de cualquier `grep` ante una pregunta lateral.
6
+ ---
7
+
8
+ # recall — Living Memory finds what the focus does not load
9
+
10
+ The startup scan and the focus read only ever open what a fixed list already names. A decision
11
+ written in July exists, but nothing finds it unless somebody guesses the word it was written with
12
+ and greps by hand over a thousand files. `recall` searches everything the tree reaches instead.
13
+
14
+ ## How it is run
15
+
16
+ ```
17
+ .os/core/lib/recall.sh --brain . --workspace <slug> "<query>"
18
+ .os/core/lib/recall.sh --brain . --root "<query>"
19
+ .os/core/lib/recall.sh --brain . --all "<query>" --limit 10
20
+ .os/core/lib/recall.sh --brain . --expand <path>
21
+ ```
22
+
23
+ `--workspace` (`--org` is an exact synonym) searches only under that workspace's folder. `--root`
24
+ searches only what the tree reaches outside the workspaces folder. `--all` searches everywhere the
25
+ tree reaches, in every workspace and the root together. Exactly one of the three is required — none
26
+ of them is a default, so crossing the session's own scope is always a choice made out loud. `--limit`
27
+ defaults to 5.
28
+
29
+ ## What it prints
30
+
31
+ ```
32
+ scope: acme · 3 hits · 412 files indexed
33
+ workspaces/acme/decisions.md:88 · 2026-07-11 · current · 2026-07-11 · the coupon lives in the Sheet · the promotion lives in the Sheet as its own row, never as a discount code the checkout applies on its own...
34
+ ```
35
+
36
+ One row per result, in relevance order: the file and the line the match starts at, the date, whether
37
+ it is `current` or `superseded → <path that replaced it>`, the entry's heading (or list item), and
38
+ up to 200 characters of the match in context. A file that was replaced never outranks one that is
39
+ current, however strong its match. No results prints one line saying so.
40
+
41
+ ## What it indexes
42
+
43
+ Every entry — a heading and its body up to the next one, or, for a file whose body is nothing but
44
+ top-level list items (`backlog.md`, `inbox.md`, any canonical list of the system), one entry per
45
+ item. The frontmatter block is never part of an entry. The index lives at
46
+ `.os/living-memory.sqlite`, inside the brain: derived, discardable, and never committed. There is no
47
+ hook — every call compares what `tree.md` reaches against what is stored, by size and mtime first
48
+ and by content hash only when those changed, before it searches.
49
+
50
+ ## `--expand`: the neighbours one jump away
51
+
52
+ ```
53
+ .os/core/lib/recall.sh --brain . --expand workspaces/acme/products/kit/README.md
54
+ ```
55
+
56
+ Prints the head this file's `about:` names, the files whose `about:` names this one, the file this
57
+ one's `superseded_by:` names, and the files whose `superseded_by:` names this one — one line each,
58
+ `<relation> · <path> · <title>`. One jump: what a neighbour itself declares is never followed.
59
+
60
+ ## What it does not do
61
+
62
+ It does not read meaning across two matches, and it does not follow a chain of more than one jump.
63
+ Two `current` results that contradict each other are for the session to notice and report, never
64
+ for this command to resolve on its own.
@@ -0,0 +1,72 @@
1
+ ---
2
+ command: rename-heads
3
+ capability: Adopt the single node shape in an existing brain
4
+ description: Move a brain born before the single node shape to it — every node becomes a folder with its `README.md` inside, every initiative gets its own folder, and each product's dated documents move to `research/` — rewriting the head paths everywhere the system reads them as routing and listing what it leaves untouched. Manually triggered, run only when the operator asks — never by the installer or the startup scan.
5
+ description_es: Mueve un brain nacido antes de la forma única de nodo a esa forma — cada nodo pasa a ser una carpeta con su `README.md` adentro, cada iniciativa tiene su carpeta, y los documentos fechados de cada producto van a `research/` —, reescribiendo las rutas de cabeza en todo lo que el sistema lee como ruteo y listando lo que deja sin tocar. Se dispara a mano, solo cuando el operador lo pide — nunca lo corre el instalador ni el arranque de sesión.
6
+ ---
7
+
8
+ # rename-heads — adopt the single node shape
9
+
10
+ Every node is a folder with the name of the thing, and its head inside, called `README.md`. A brain
11
+ born before that keeps its previous shape and keeps working exactly as before: the shape is read
12
+ from the brain's own tree, and nothing forces it to change. This command is how it adopts the
13
+ current shape, on the operator's own schedule.
14
+
15
+ **It runs only when the operator asks.** Nothing else in the system calls it — not the installer,
16
+ not the startup scan.
17
+
18
+ ## What it does, in order
19
+
20
+ ```
21
+ .os/core/lib/rename-heads.sh --brain .
22
+ ```
23
+
24
+ 1. Reads the shape from the tree, at both heights that declare heads — the workspace and the
25
+ initiatives. If both already declare `README.md`, it says there is nothing to do and exits,
26
+ having changed nothing. A brain with one height in each shape is not an error: it is a brain
27
+ half-migrated, and this command finishes the height that is still in the previous shape.
28
+ 2. Plans every move before making any — the heads, the initiatives, the dated documents — and
29
+ refuses if anything is already sitting at a destination: `x.md` next to `x/README.md`, the
30
+ previous head next to a `README.md` in the same folder, or a `research/` that already carries a
31
+ dated document with the same name. It names each pair and touches nothing, not one file: which
32
+ one stays is the operator's, never a guess.
33
+ 3. Moves the head of every workspace and every product to `README.md`.
34
+ 4. Moves the head of every initiative to `initiatives/<slug>/README.md`, creating the folder or
35
+ entering the one that already exists — a body that was already there stays where it is.
36
+ 5. Moves each product's dated documents (`YYYY-MM-DD-*.md`) from `context/` to `research/`, so
37
+ `context/` keeps one meaning: the product's strategic layer.
38
+ 6. Rewrites the head paths in what the system reads as structure or routing — the resolvers, the
39
+ backlogs, the decisions, the environment table and the heads themselves — **only where the text
40
+ matches exactly a path this run moved**, or that same path written relative to the node that owns
41
+ the file. Never by suffix: a path under `docs/` that ends the same way but is nobody's head is
42
+ left alone, and so is a URL carrying the same path inside — with a scheme or in `user@host:path`
43
+ form. A `#anchor`, a trailing `:line`, and a leading `./` are split off and put back.
44
+ **A bare name — no slash at all — is never resolved against the folder of the file that names
45
+ it**: inside a node's folder, `README.md` written on its own is prose about some other repo far
46
+ more often than a reference to that node's head, and rewriting it touched text nobody moved.
47
+ 7. Rewrites the tree last: while it still declares the previous shape, a run cut in the middle
48
+ still knows what the head was called and the next run finishes on its own.
49
+ 8. **Rewrites nothing else.** It lists every `.md` file that still names a head in the previous
50
+ shape, with how many times, and leaves it there. That list is the operator's, never assumed.
51
+ 9. **Does not commit.** Like everything else written during a session, the close commits it.
52
+
53
+ Every move is a `git mv` when the brain is a git repo, so the index records it as a rename, and a
54
+ `mv -n` otherwise — never one that can overwrite.
55
+
56
+ **Two known limits, both of which fail by not rewriting:**
57
+
58
+ - A path with spaces inside is not rewritten: the text is split into tokens by space. It shows up in
59
+ the list of step 8, and is reviewed by hand.
60
+ - A head named by its bare file name is not rewritten either, on purpose: see above.
61
+ - A reference that names a head without being a path —free prose, a half-written path, a link whose
62
+ text differs from its target— is not rewritten either. That is the same list.
63
+
64
+ If the tree declares no head at all, the command says so and exits without touching anything: it
65
+ does not guess what a node is in a brain it cannot read.
66
+
67
+ ## When it finishes
68
+
69
+ - Report what moved and what got rewritten, in outcomes.
70
+ - Pass through the list of files left untouched, whole — it is what the operator reviews next, not
71
+ a detail to summarize away.
72
+ - Run it twice in a row and the second run says there was nothing left to do: it is safe to repeat.
@@ -0,0 +1,43 @@
1
+ ---
2
+ command: rename-workspaces
3
+ capability: Rename the workspaces folder of an existing brain
4
+ description: Move a brain still using the previous name of the workspaces folder to the current one, rewriting the prefix everywhere the system reads it as structure or routing, and listing what it leaves untouched for the operator to review. Manually triggered, run only when the operator asks — never by the installer or the startup scan.
5
+ description_es: Mueve un brain que todavía usa el nombre anterior de la carpeta de espacios de trabajo al nombre actual, reescribiendo el prefijo en todo lo que el sistema lee como estructura o ruteo, y listando lo que deja sin tocar para que el operador lo revise. Se dispara a mano, solo cuando el operador lo pide — nunca lo corre el instalador ni el arranque de sesión.
6
+ ---
7
+
8
+ # rename-workspaces — adopt the current name of the workspaces folder
9
+
10
+ A brain born before this rename keeps its folder under the previous name and keeps working exactly
11
+ as before: nothing forces it to change. This command is how it adopts the current name, on the
12
+ operator's own schedule.
13
+
14
+ **It runs only when the operator asks.** Nothing else in the system calls it — not the installer,
15
+ not the startup scan. `install.sh` prints one line the first time it hooks up a brain still on the
16
+ previous name, naming this command; it never runs it.
17
+
18
+ ## What it does, in order
19
+
20
+ ```
21
+ .os/core/lib/rename-workspaces.sh --brain .
22
+ ```
23
+
24
+ 1. Checks the layout is valid and is the previous one. With the two folders at once, or with the
25
+ tree declaring one and the disk only carrying the other, it refuses and touches nothing — same
26
+ check every other command in the system runs first. With nothing to rename (the brain already
27
+ uses the current name), it says so and exits, having changed nothing.
28
+ 2. Moves the folder to its current name — `git mv` when the brain is a git repo, so the index
29
+ records it as a rename; a plain move otherwise.
30
+ 3. Rewrites the previous prefix to the current one in every file the system reads as structure or
31
+ routing: the tree, the root resolver, each workspace's resolver, the root backlog and each
32
+ workspace's backlog, and the environment table.
33
+ 4. **Rewrites nothing else.** Decisions, contexts, initiatives, any free prose the operator wrote —
34
+ it lists every `.md` file that still carries the previous prefix, with how many times, and
35
+ leaves it there. That list is the operator's, never assumed.
36
+ 5. **Does not commit.** Like everything else written during a session, the close commits it.
37
+
38
+ ## When it finishes
39
+
40
+ - Report what moved and what got rewritten, in outcomes.
41
+ - Pass through the list of files left untouched, whole — it is what the operator reviews next, not
42
+ a detail to summarize away.
43
+ - Run it twice in a row and the second run says there was nothing left to do: it is safe to repeat.