docs: переработка витрины — светлый Apple-стиль, Athena-мотив, простой язык

- ВСЕ визуалы заменены: тёмный → светлый воздушный Apple (ivory/marble + soft blue/gold),
  единый стиль через hero-референс (мраморная Афина+сова сквозной мотив)
- 6 визуалов (nano_banana_pro): hero · three-planes · six-layers · merge · journey (новый:
  пустой Mac→система) · token-economy (новый: индекс→прямой путь)
- больше mermaid-диаграмм для новичка: journey (7 шагов), token-эконо (с картой vs без)
- текст переписан простым языком (humanizer): что это · кредит наработкам (Карпаты
  synthesis-on-write, chezmoi) · разворот-с-нуля · поддержка работы · экономия токенов
- EN + RU зеркала синхронны

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Зарубин Филипп
2026-06-17 19:40:39 +03:00
co-authored by Claude Opus 4.8
parent 968da99672
commit a0d8ff814d
8 changed files with 275 additions and 181 deletions
+138 -91
View File
@@ -5,8 +5,8 @@
<h1 align="center">Athena</h1>
<p align="center">
<strong>A portable agent operating system.</strong><br>
A clean Mac → <strong>one command</strong> → your entire system: from the <code>CLAUDE.md</code> cascade to the live runtime.
<strong>Set up your entire AI workspace on a brand-new Mac with one command.</strong><br>
From the rules your assistant follows to the live tools it runs — rebuilt in minutes, identically, every time.
</p>
<p align="center">
@@ -18,91 +18,115 @@
```bash
git clone <repo> ~/Проекты/athena && cd ~/Проекты/athena
cp athena.config.example.sh athena.config.sh # fill in your repos / values
./bootstrap.sh # or --dry-run
./bootstrap.sh # or --dry-run to preview
```
That is the whole onboarding. No manual setup, no checklist to forget, no drift between machines.
That's the whole setup. No long checklist, nothing to forget, no two machines that mysteriously behave differently.
---
## Why this exists
## What is this, really?
An AI agent is only as good as the system around it — its constitution, rules, hooks, capability registry, the projects it can see, the knowledge it can recall. Over months that system grows into hundreds of files spread across `~/.claude`, `~/.codex`, `~/.agents`, project folders, a knowledge vault, launch agents, and secrets.
A modern AI assistant is only as good as the workspace around it — the rules it follows, the habits it has, the projects it can see, the notes it can recall, the tools it can reach. Build that workspace by hand and it slowly sprawls into hundreds of small files scattered across your machine. Then you buy a new Mac, and you get to rebuild all of it from memory. It never comes out quite the same.
That growth creates three quiet failures:
**Athena packs that whole workspace into a single, repeatable recipe.** Run one command and it lays everything back down in the right order: the tools, the rules, the projects, the knowledge, the background helpers. Like restoring a phone from a backup — but for your entire way of working with AI.
1. **Non-portability.** A new Mac means days of manual re-setup, and the result never quite matches the old machine.
2. **Drift.** Two machines slowly diverge; what works on one breaks on the other.
3. **Leak risk.** Personal data and secrets get tangled into the same tree you would otherwise want to share or open-source.
It isn't built from scratch on a hunch. Athena stands on proven ideas from people who do this seriously:
Athena turns that entire system into **one reproducible artifact**. The public scaffold lives here. Your personal layer lives in a private overlay. One idempotent script reassembles both into a working machine — every time, identically.
- The **Knowledge** part follows the *synthesis-on-write* approach popularized by **Andrej Karpathy** — you don't just dump notes, you distill them as you save, so what you keep is genuinely useful later.
- The **setup** is driven by [**chezmoi**](https://www.chezmoi.io/), the well-known dotfile manager, so your configuration is versioned and portable instead of hand-copied.
- The whole thing is **idempotent** — a fancy word for *safe to run again and again*. It converges to the same result; it never piles up duplicates.
> This repository is the **generic, public scaffold**. It contains zero personal data: no `/Users/...` hardcodes, no secrets, no private content. Everything personal is injected at deploy time from a private overlay (see [Generic ⊕ private](#generic--private)).
The payoff is simple: a correct system, stood up from zero in minutes, that keeps supporting your work — and quietly **saves you tokens** every day (more on that below).
---
## Three planes — never mixed
## What happens when you run it
<p align="center">
<img src="docs/assets/three-planes.png" alt="The three planes: Consciousness, Knowledge, Work" width="90%">
<img src="docs/assets/journey.png" alt="One command turns an empty Mac into a complete system" width="92%">
</p>
Everything you own falls into exactly one of three planes. Keeping them separate is what makes the system legible as it grows — runtime junk never pollutes canon, secrets never touch code, knowledge never scatters into project folders.
```mermaid
flowchart TB
subgraph P1["🧠 Consciousness — the agent OS"]
C["~/.claude · ~/.codex · ~/.agents<br/>constitution · rules · hooks · agents · capability registry (SSOT)"]
end
subgraph P2["📚 Knowledge"]
K["~/Мозг (vault)<br/>durable knowledge · Karpathy method · graph links"]
end
subgraph P3["⚙️ Work"]
W["~/Проекты · ~/Хранилище · ~/Архив<br/>code projects · documents · media · cold archive"]
end
P1 -.governs.-> P3
P2 -.feeds.-> P1
```
| Plane | Home | What lives there | Managed by |
|---|---|---|---|
| **Consciousness** | `~/.claude` · `~/.codex` · `~/.agents` | constitution, rules, hooks, agents, registry SSOT | chezmoi |
| **Knowledge** | `~/Мозг` | durable knowledge (Karpathy method), private repo | private vault repo |
| **Work** | `~/Проекты` · `~/Хранилище` · `~/Архив` | projects, documents, media | per-project git |
The layout rules live **inside** the system: [`rules/structure.md`](rules/structure.md) (the declarative source of truth), the `organize` skill (the procedure), and a PreToolUse hook (the hard invariant). The system grows along them instead of into chaos.
---
## Six layers of deployment
<p align="center">
<img src="docs/assets/six-layers.png" alt="The six deployment layers stacking into one system" width="90%">
</p>
`bootstrap.sh` is an orchestrator. It builds the machine bottom-up in ordered, independently runnable layers. Each layer is idempotent: run it once or a hundred times, the result is the same.
You start with an empty Mac and type one command. Athena does the rest, step by step:
```mermaid
flowchart LR
L0["0 · Base<br/>Homebrew + CLI"] --> L0b["0b · Tools<br/>~/tools"]
L0b --> L1["1 · Consciousness<br/>chezmoi merged-source"]
L1 --> L2["2 · Registry<br/>capability SSOT"]
L2 --> L3["3 · Work<br/>projects"]
L3 --> L4["4 · Knowledge<br/>vault"]
L4 --> L5["5 · Runtime<br/>secrets · MCP · launchd"]
L5 --> L6["6 · Smoke<br/>parity + lint"]
A["🖥️ Empty Mac"] --> B["one command<br/>./bootstrap.sh"]
B --> C["installs the tools"]
C --> D["lays down the rules<br/>& habits"]
D --> E["clones your projects"]
E --> F["restores your knowledge"]
F --> G["starts background helpers"]
G --> H["✅ checks everything<br/>actually works"]
H --> I["🚀 A working system"]
```
| Layer | Name | What it does |
Every step is automatic, ordered, and checked. If anything fails to start, the run stops and tells you — you never end up with a half-built machine that pretends it's fine.
---
## The big idea: three planes, never mixed
<p align="center">
<img src="docs/assets/three-planes.png" alt="The three planes: Consciousness, Knowledge, Work" width="92%">
</p>
Everything you own lives in exactly one of three "planes." Keeping them apart is what stops the mess: temporary clutter never pollutes your rules, secrets never touch your code, and notes never get lost inside project folders.
```mermaid
flowchart TB
subgraph P1["🧠 Consciousness — how your assistant thinks"]
C["rules · habits · helpers · a map of every tool it can use"]
end
subgraph P2["📚 Knowledge — what you know"]
K["a personal library of distilled notes (the Karpathy method)"]
end
subgraph P3["⚙️ Work — what you do"]
W["your projects · documents · media"]
end
P1 -.guides.-> P3
P2 -.feeds.-> P1
```
| Plane | In plain terms | Where it lives |
|---|---|---|
| **0** | Base | Homebrew + CLI (`claude`, `codex`, `gh`, `node`, `python`, `uv`, `ffmpeg`) — from `Brewfile` |
| **0b** | Tools | external tools → `~/tools` (bots etc.), cloned **before** Consciousness |
| **1** | Consciousness | chezmoi deploys `~/.claude` · `~/.codex` · `~/.agents` from the merged source |
| **2** | Registry | `build_registry` → `capability-plan` SSOT |
| **3** | Work | clone + install projects from `projects.manifest` |
| **4** | Knowledge | clone the private vault repo |
| **5** | Runtime | `~/.secrets` (Keychain) · MCP reauth · launchd agents |
| **6** | Smoke | Claude = Codex parity + structure lint |
| **Consciousness** | how your assistant thinks and behaves | `~/.claude` · `~/.codex` · `~/.agents` |
| **Knowledge** | your personal, distilled library | `~/Мозг` |
| **Work** | your actual projects and files | `~/Проекты` · `~/Хранилище` · `~/Архив` |
The rules for *what goes where* live inside the system itself, so it grows tidily instead of turning into a junk drawer.
---
## How it builds: six calm layers
<p align="center">
<img src="docs/assets/six-layers.png" alt="Six layers stacking into one system" width="92%">
</p>
The setup script builds your machine from the ground up in ordered layers — like assembling floors of a building. Each layer is safe to repeat, and you can run just one if you want.
```mermaid
flowchart LR
L0["0 · Base<br/>core tools"] --> L0b["0b · Tools<br/>extras"]
L0b --> L1["1 · Consciousness<br/>rules & habits"]
L1 --> L2["2 · Registry<br/>the tool map"]
L2 --> L3["3 · Work<br/>projects"]
L3 --> L4["4 · Knowledge<br/>your library"]
L4 --> L5["5 · Runtime<br/>secrets & helpers"]
L5 --> L6["6 · Smoke<br/>final checks"]
```
| Layer | What it sets up |
|---|---|
| **0 · Base** | the core command-line tools (`claude`, `codex`, `git`, `node`, `python`…) |
| **0b · Tools** | extra tools like bots, placed before the rules so they can wire themselves up |
| **1 · Consciousness** | your assistant's rules, habits, and helpers |
| **2 · Registry** | a searchable map of every skill and tool, so the right one is found fast |
| **3 · Work** | clones and installs your projects |
| **4 · Knowledge** | restores your personal library |
| **5 · Runtime** | secrets (kept in the macOS Keychain) and background helpers |
| **6 · Smoke** | runs final checks to prove the whole thing actually works |
```bash
./bootstrap.sh --only=1 # run a single layer
@@ -111,48 +135,72 @@ flowchart LR
---
## Generic ⊕ private
## Share the structure, keep your secrets
<p align="center">
<img src="docs/assets/merge.png" alt="Generic and private sources merging into one" width="90%">
<img src="docs/assets/merge.png" alt="A public stream and a private stream merging into one" width="92%">
</p>
The hardest problem in sharing a personal system is the boundary: the structure is worth open-sourcing, the contents are not. Athena solves it with a **merged source**. Layer 1 rsyncs the generic base, lays the private overlay on top (overlay wins on conflict), then runs a single `chezmoi apply`.
Here's the tricky part of sharing a personal setup: the *structure* is worth opening up, but the *contents* — your secrets, your private notes — are not. Athena solves it by blending two sources at setup time: a **public** skeleton (this repo) and your own **private** layer. They merge into one, and your private layer always wins.
```mermaid
flowchart LR
G["Generic source<br/>./chezmoi · public"] --> M{{"merged-source"}}
P["Private overlay<br/>$ATHENA_PRIVATE_REPO · personal"] --> M
M --> A["chezmoi apply<br/>~/.claude · ~/.codex · ~/.agents"]
G["🌍 Public skeleton<br/>this repo · safe to share"] --> M{{"blend"}}
P["🔒 Your private layer<br/>secrets & personal config"] --> M
M --> A["✨ Your real machine"]
```
- Leave `ATHENA_PRIVATE_REPO` empty → a valid **generic-only** deploy.
- Set it → your `references/`, active launch agents, and secret generators are layered in.
- A `PERSONAL_RE` smoke gate fails the build if personal data ever lands in a tracked public file. The boundary is enforced, not hoped for.
- Skip the private layer → you still get a complete, working **public-only** setup.
- Add it → your personal details are layered in on top.
- A built-in guard **fails the build** if any personal data ever slips into a public file. The boundary is enforced, not just hoped for.
See the architecture decision: [`docs/decisions/0001-merged-source-generic-private.md`](docs/decisions/0001-merged-source-generic-private.md).
This repository is the **public skeleton**. It contains zero personal data — no secrets, no private content, no hardcoded paths.
---
## Why it's efficient
## Why it saves you tokens
- **One command, idempotent.** No manual steps to skip or misremember. Re-running converges instead of duplicating; launch agents are only reloaded when their plist actually changed (no flicker).
- **Fail-closed runtime.** Layer 5 counts loaded vs. failed launch agents and exits non-zero on any failure — a half-deployed machine never reports success.
- **Provable parity.** Layer 6 smoke verifies Claude and Codex see the same registry, every plist is valid, every guard hook actually blocks secrets, and no personal data is tracked.
- **Token economy by design.** A capability registry (SSOT) routes the right skill/agent/MCP quality-first, so the agent spends reasoning on the task, not on rediscovering its own tools.
- **Self-describing growth.** Layout rules, the `organize` skill, and a hard hook keep expansion legible; the constitution stays a lean router, not a junk drawer.
<p align="center">
<img src="docs/assets/token-economy.png" alt="A tidy index lighting one direct path to the right answer" width="92%">
</p>
Every time an AI assistant has to rediscover its own tools, re-read scattered instructions, or wander around looking for the right skill, it burns tokens — and tokens are money and time. Athena gives the assistant a **tidy index of everything it can do**, so it walks straight to the right tool instead of searching.
```mermaid
flowchart LR
subgraph Without["😵 Without a map"]
direction TB
Q1["task"] --> S1["search…"] --> S2["re-read…"] --> S3["guess…"] --> R1["maybe right"]
end
subgraph With["🦉 With Athena's registry"]
direction TB
Q2["task"] --> IDX["look it up in the index"] --> R2["right tool, first try"]
end
```
Less wandering means fewer tokens spent on overhead and more spent on your actual problem. The structure does the remembering, so the assistant doesn't have to.
---
## Generic vs personal
## Why it's efficient (in short)
| In the repo (publishable) | **Not** in the repo |
- **One command, idempotent.** Nothing to skip or misremember; re-running converges instead of duplicating.
- **Fail-closed.** A half-finished setup never reports success — if something doesn't start, the run fails loudly.
- **Provable.** Built-in checks confirm both assistants see the same tools, every helper is valid, and no personal data leaked.
- **Token-aware by design.** The tool map routes to the right capability first, so reasoning goes to the task, not to overhead.
- **Tidy as it grows.** Clear rules for what-goes-where keep the system legible for years.
---
## What's in the repo (and what isn't)
| In the repo (safe to share) | **Not** in the repo |
|---|---|
| `bootstrap.sh`, `Brewfile`, `smoke/` | secret **values** (Keychain / `~/.secrets`) |
| `rules/structure.md`, skills, `launchd/` | vault content (your private repo) |
| `chezmoi/` templates, `claude-starter/` | `athena.config.sh`, `projects.manifest` |
| the setup script, tool list, checks | secret **values** (Keychain / `~/.secrets`) |
| layout rules, skills, helpers | your private notes (your own repo) |
| config templates, a project starter | your personal config & project list |
A personal instance = a filled-in `athena.config.sh` + a private chezmoi overlay on top of this generic scaffold.
A personal instance = your filled-in config + your private layer, on top of this public skeleton.
---
@@ -160,13 +208,12 @@ A personal instance = a filled-in `athena.config.sh` + a private chezmoi overlay
```bash
shellcheck bootstrap.sh smoke/*.sh # lint
./bootstrap.sh --dry-run # dry run
./bootstrap.sh --only=<0|0b|1..6> # single layer
smoke/smoke.sh # parity + structure smoke
smoke/dry-validate.sh # template render validation (no chezmoi)
./bootstrap.sh --dry-run # dry run (preview, change nothing)
./bootstrap.sh --only=<0|0b|1..6> # run a single layer
smoke/smoke.sh # final checks
```
**Go deeper:** [`docs/FEATURES.en.md`](docs/FEATURES.en.md) documents every function in detail. Read [`specs/`](specs/) for the phased plan, [`docs/decisions/`](docs/decisions/) for architecture decisions, and the project [`CLAUDE.md`](CLAUDE.md) for the map.
**Go deeper:** [`docs/FEATURES.en.md`](docs/FEATURES.en.md) documents every function in detail. See [`specs/`](specs/) for the plan, [`docs/decisions/`](docs/decisions/) for architecture decisions, and [`CLAUDE.md`](CLAUDE.md) for the map.
---