lean-agents 0.0.0-stage → 1.0.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 (148) hide show
  1. package/CHANGELOG.md +407 -0
  2. package/LICENSE +21 -0
  3. package/README.es.md +560 -0
  4. package/README.md +559 -2
  5. package/core/AGENTS.es.md +60 -0
  6. package/core/AGENTS.md +60 -0
  7. package/core/README.md +8 -0
  8. package/core/agents/debug.md +14 -0
  9. package/core/agents/explore.md +13 -0
  10. package/core/agents/planner.md +14 -0
  11. package/core/agents/research.md +13 -0
  12. package/core/agents/review.md +13 -0
  13. package/core/copilot-usage-tui.js +189 -0
  14. package/core/mcp.json +38 -0
  15. package/core/pins.json +39 -0
  16. package/core/tiers.json +4 -0
  17. package/node_modules/@clack/core/LICENSE +9 -0
  18. package/node_modules/@clack/core/README.md +22 -0
  19. package/node_modules/@clack/core/dist/index.d.mts +503 -0
  20. package/node_modules/@clack/core/dist/index.mjs +1003 -0
  21. package/node_modules/@clack/core/package.json +63 -0
  22. package/node_modules/@clack/prompts/LICENSE +9 -0
  23. package/node_modules/@clack/prompts/README.md +396 -0
  24. package/node_modules/@clack/prompts/dist/index.d.mts +949 -0
  25. package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
  26. package/node_modules/@clack/prompts/package.json +67 -0
  27. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  28. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  29. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  30. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  31. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  32. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  33. package/node_modules/fast-string-truncated-width/license +21 -0
  34. package/node_modules/fast-string-truncated-width/package.json +35 -0
  35. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  36. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  37. package/node_modules/fast-string-width/dist/index.js +14 -0
  38. package/node_modules/fast-string-width/license +21 -0
  39. package/node_modules/fast-string-width/package.json +34 -0
  40. package/node_modules/fast-string-width/readme.md +42 -0
  41. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  42. package/node_modules/fast-wrap-ansi/README.md +26 -0
  43. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  44. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  45. package/node_modules/fast-wrap-ansi/package.json +51 -0
  46. package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  47. package/node_modules/jsonc-parser/LICENSE.md +21 -0
  48. package/node_modules/jsonc-parser/README.md +364 -0
  49. package/node_modules/jsonc-parser/SECURITY.md +41 -0
  50. package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  51. package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  52. package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  53. package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  54. package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  55. package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  56. package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  57. package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  58. package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  59. package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  60. package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  61. package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  62. package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  63. package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  64. package/node_modules/jsonc-parser/package.json +37 -0
  65. package/node_modules/sisteransi/license +21 -0
  66. package/node_modules/sisteransi/package.json +34 -0
  67. package/node_modules/sisteransi/readme.md +113 -0
  68. package/node_modules/sisteransi/src/index.js +58 -0
  69. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  70. package/package.json +30 -4
  71. package/profiles/README.md +10 -0
  72. package/profiles/anthropic-api/gsd-defaults.json +26 -0
  73. package/profiles/anthropic-api.json +18 -0
  74. package/profiles/antigravity.json +12 -0
  75. package/profiles/claude-subscription/gsd-defaults.json +26 -0
  76. package/profiles/claude-subscription.json +17 -0
  77. package/profiles/github-copilot/gsd-defaults.json +26 -0
  78. package/profiles/github-copilot.json +17 -0
  79. package/profiles/openai-api/gsd-defaults.json +26 -0
  80. package/profiles/openai-api.json +17 -0
  81. package/profiles/opencode-go/gsd-defaults.json +26 -0
  82. package/profiles/opencode-go.json +17 -0
  83. package/profiles/vertex-gemini/gsd-defaults.json +26 -0
  84. package/profiles/vertex-gemini.json +18 -0
  85. package/scripts/adhd-skill.mjs +12 -0
  86. package/scripts/behavior-diff.sh +47 -0
  87. package/scripts/bump-pins.mjs +115 -0
  88. package/scripts/check-private.sh +52 -0
  89. package/scripts/check-readme.mjs +131 -0
  90. package/scripts/ci-download.sh +20 -0
  91. package/scripts/ci-install-opencode-v2.sh +6 -0
  92. package/scripts/ci-latest-report.mjs +38 -0
  93. package/scripts/ci-timing.mjs +61 -0
  94. package/scripts/copilot-context-mode.mjs +33 -0
  95. package/scripts/labels.sh +56 -0
  96. package/scripts/lean.mjs +1319 -0
  97. package/scripts/lib/adapters/antigravity.mjs +83 -0
  98. package/scripts/lib/adapters/claude.mjs +127 -0
  99. package/scripts/lib/adapters/copilot-cli.mjs +82 -0
  100. package/scripts/lib/adapters/cursor.mjs +60 -0
  101. package/scripts/lib/adapters/opencode-v1.mjs +79 -0
  102. package/scripts/lib/adapters/opencode-v2.mjs +216 -0
  103. package/scripts/lib/adapters/vscode-copilot.mjs +56 -0
  104. package/scripts/lib/adhd.mjs +28 -0
  105. package/scripts/lib/adopt.mjs +619 -0
  106. package/scripts/lib/agent-lifecycle.mjs +280 -0
  107. package/scripts/lib/backup-stamp.mjs +25 -0
  108. package/scripts/lib/copilot-usage.mjs +49 -0
  109. package/scripts/lib/doctor.mjs +279 -0
  110. package/scripts/lib/feedback.mjs +48 -0
  111. package/scripts/lib/fsops.mjs +319 -0
  112. package/scripts/lib/gsd.mjs +42 -0
  113. package/scripts/lib/inventory.mjs +196 -0
  114. package/scripts/lib/lean-update.mjs +30 -0
  115. package/scripts/lib/logins.mjs +28 -0
  116. package/scripts/lib/migrate.mjs +407 -0
  117. package/scripts/lib/network.mjs +119 -0
  118. package/scripts/lib/node-runtime.mjs +85 -0
  119. package/scripts/lib/opencode-backup.mjs +204 -0
  120. package/scripts/lib/opencode-upgrade.mjs +441 -0
  121. package/scripts/lib/opencode1.mjs +203 -0
  122. package/scripts/lib/parallel.mjs +270 -0
  123. package/scripts/lib/pins-diff.mjs +33 -0
  124. package/scripts/lib/pins.mjs +52 -0
  125. package/scripts/lib/plugin-health.mjs +191 -0
  126. package/scripts/lib/prereqs.mjs +203 -0
  127. package/scripts/lib/project.mjs +38 -0
  128. package/scripts/lib/redact.mjs +30 -0
  129. package/scripts/lib/render.mjs +101 -0
  130. package/scripts/lib/shell-path.mjs +22 -0
  131. package/scripts/lib/summary-data.mjs +30 -0
  132. package/scripts/lib/summary-html.mjs +159 -0
  133. package/scripts/lib/system.mjs +269 -0
  134. package/scripts/lib/terminals.mjs +316 -0
  135. package/scripts/lib/ui.mjs +34 -0
  136. package/scripts/lib/unverified.mjs +49 -0
  137. package/scripts/lib/update-plan.mjs +60 -0
  138. package/scripts/lib/upgrade.mjs +231 -0
  139. package/scripts/lib/verify-commit.mjs +16 -0
  140. package/scripts/lib/verify-prompt.mjs +46 -0
  141. package/scripts/lib/verify-sha256.mjs +20 -0
  142. package/scripts/lint-workflows.mjs +25 -0
  143. package/scripts/models-refresh.mjs +58 -0
  144. package/scripts/parallel.mjs +59 -0
  145. package/scripts/pins-latest.mjs +66 -0
  146. package/scripts/release.mjs +71 -0
  147. package/scripts/verify-pins.mjs +36 -0
  148. package/scripts/version-watch.mjs +124 -0
package/README.md CHANGED
@@ -1,3 +1,560 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="docs/assets/banner.svg" alt="lean-agents: your agent is only as good as its setup" width="640">
4
+
5
+ # lean-agents
6
+
7
+ **Your agent is only as good as its setup. lean-agents does the setup.**
8
+
9
+ [![npm](https://img.shields.io/npm/v/lean-agents.svg)](https://www.npmjs.com/package/lean-agents) [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![CI](https://github.com/estebanmr99/lean-agents/actions/workflows/ci.yml/badge.svg)](https://github.com/estebanmr99/lean-agents/actions/workflows/ci.yml) [![Secret scan](https://github.com/estebanmr99/lean-agents/actions/workflows/secret-scan.yml/badge.svg)](https://github.com/estebanmr99/lean-agents/actions/workflows/secret-scan.yml) ![GitHub stars](https://img.shields.io/github/stars/estebanmr99/lean-agents?style=social)
10
+
11
+ [Leer en español](README.es.md)
12
+
13
+ </div>
14
+
15
+ What your agent writes is only as good as what you give it: your prompt, and the setup around it. Rules. Cheap subagents for the boring work. Tools that save tokens. Privacy you chose.
16
+
17
+ You should not have to perfect every prompt. lean-agents sets the rest up for you, once, on top of the agents you already use.
18
+
19
+ ### Paste this into your agent
20
+
21
+ It asks you each choice, shows a dry run, and waits for your OK.
22
+
23
+ ```text
24
+ Install lean-agents for me from https://github.com/estebanmr99/lean-agents.
25
+ Follow docs/install-with-an-agent.md in that repo. Ask before every change.
26
+ Never read, print or store my API keys or tokens, and never run gh auth login for me.
27
+ If you cannot run terminal commands, print them for me to run.
28
+ ```
29
+
30
+ ### Or run it yourself
31
+
32
+ Needs Node.js 22.20+ and git. `--dry-run` lists every file and command; nothing changes:
33
+
34
+ ```bash
35
+ npx lean-agents@latest --dry-run
36
+ ```
37
+
38
+ PowerShell takes the same command. New machine? See [Fresh Mac or Windows PC](#fresh-mac-or-windows-pc---everything). No Node.js yet? See [Fallback: bootstraps](#fallback-bootstraps). Flags and pinning: [Quick start](#quick-start).
39
+
40
+ ### What's new
41
+
42
+ Read the [latest release notes](https://github.com/estebanmr99/lean-agents/releases/latest) and the [CHANGELOG](CHANGELOG.md). Already installed? Paste this to update; it also takes over an install you made by hand:
43
+
44
+ ```text
45
+ Update lean-agents for me from https://github.com/estebanmr99/lean-agents.
46
+ Use the lean-update skill, or follow docs/install-with-an-agent.md "Update with an agent". Show me a table first and ask before every change.
47
+ Never read, print or store my API keys or tokens.
48
+ ```
49
+
50
+ <div align="center">
51
+
52
+ <img src="docs/assets/agents.svg" alt="Works with Claude Code, OpenCode, Copilot CLI, Antigravity CLI, VS Code Copilot and Cursor" width="520">
53
+
54
+ <img src="docs/assets/demo.gif" alt="install.sh --dry-run listing every file and command it would change" width="720">
55
+
56
+ </div>
57
+
58
+ ## Supported agents
59
+
60
+ | Agent | macOS | Linux | Windows | Rules | Subagents | MCP tools | Real-binary CI job |
61
+ | --- | --- | --- | --- | --- | --- | --- | --- |
62
+ | Claude Code | VERIFY | ✅ | ✅ | ✅ | ✅ | ✅ | `real-claude` |
63
+ | OpenCode 1.x | VERIFY | ✅ | ✅ | ✅ | ✅ | ✅ | `real-opencode-v1`, `real-windows`, `real-opencode-shell` |
64
+ | OpenCode 2.x | VERIFY | ✅ | ✅ | ✅ | ✅ | ✅ | `real-opencode`, `real-opencode-shell`, `real-windows` |
65
+ | Copilot CLI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | `real-copilot`, `real-copilot-windows` |
66
+ | Antigravity CLI | ✅ | ✅ | ✅ | ⚠️ | ✅ | ✅ | `real-antigravity`, `real-antigravity-windows` |
67
+ | VS Code Copilot | ✅ | ✅ | VERIFY | ⚠️ | ⚠️ | ✅ | `real-vscode` |
68
+ | Cursor | VERIFY | ✅ | ✅ | ➖ (`--project` only) | ⚠️ | ✅ | `real-cursor`, `real-cursor-windows` |
69
+
70
+ On Windows, agents work best with Git Bash installed (RTK and bash-style commands need it); the install summary and `--doctor` tell you which shell is found and what to do if not. For OpenCode, lean-agents also sets its `shell` key to Git Bash when found, so the bash tool runs there by default (`--shell default` opts out; a `shell` you already set is kept).
71
+
72
+ ✅ a CI job runs the real binary on that OS (OS columns) or lean-agents writes it (feature columns) · ⚠️ written, load unproven · ➖ not available · VERIFY not proven yet. Per-agent files and verification dates: [docs/compatibility.md](docs/compatibility.md).
73
+
74
+ **Who it's for:** solo developers · teams (`--project` writes the setup into the repo) · work PCs behind a proxy ([details](#on-a-work-pc-proxy-network-and-security-review)).
75
+
76
+ <!-- details -->
77
+ ## Details
78
+
79
+ lean-agents works with Claude Code, OpenCode 1.x and 2.x, GitHub Copilot CLI, Antigravity CLI, VS Code Copilot and Cursor on macOS, Linux and Windows. Star the repo to get notified when `v1.0.0` ships.
80
+
81
+ **Contents**
82
+
83
+ - [Demo: OpenCode with GitHub Copilot models](#demo-opencode-with-github-copilot-models)
84
+ - [Quick start](#quick-start)
85
+ - [Why](#why) · [What you get](#what-you-get)
86
+ - [Warp and Orca](#warp-and-orca) · [Signed-in browser](#signed-in-browser-opt-in) · [VS Code Copilot and Cursor](#vs-code-copilot-and-cursor)
87
+ - [Team mode](#team-mode---project) · [Migrate](#migrate-from-another-tool---migrate) · [Parallel agent sessions](#parallel-agent-sessions) · [Claude through GitHub Copilot](#claude-through-github-copilot)
88
+ - [Install tiers](#install-tiers) · [On a work PC](#on-a-work-pc-proxy-network-and-security-review) · [Models that stay current](#models-that-stay-current)
89
+ - [Safety](#safety) · [Credits](#credits) · [Roadmap](#roadmap) · [Contributing](#contributing) · [License](#license)
90
+
91
+ ## At a glance
92
+
93
+ - **Rules:** one short global rule set, rendered for each agent.
94
+ - **Cheap subagents:** exploration, research and review run on the cheapest fitting model tier.
95
+ - **Context-saving tools:** RTK, Context Mode, Serena and Playwright MCP.
96
+ - **Privacy presets:** `--privacy strict` or `off` for telemetry, updates and outbound calls.
97
+
98
+ ```mermaid
99
+ flowchart LR
100
+ A["Your agents<br>Claude Code, OpenCode, Copilot CLI,<br>Antigravity, VS Code, Cursor"] --> L["lean-agents"]
101
+ L --> R["Rules"]
102
+ L --> S["Cheap subagents"]
103
+ L --> M["MCP tools"]
104
+ ```
105
+
106
+ ## Demo: OpenCode with GitHub Copilot models
107
+
108
+ 1. Install OpenCode. macOS, Linux or Git Bash:
109
+ ```bash
110
+ curl -fsSL https://opencode.ai/v2/install | bash
111
+ ```
112
+ Windows PowerShell (the upstream script runs through Git Bash and only edits `~/.bashrc`, so this adds the folder to your user PATH; open a new terminal afterwards):
113
+ ```powershell
114
+ curl.exe -fsSL https://opencode.ai/v2/install -o "$env:TEMP\opencode-install.sh"
115
+ & "$env:ProgramFiles\Git\bin\bash.exe" -l (($env:TEMP -replace '\\','/') + '/opencode-install.sh') --no-modify-path
116
+ $bin = "$HOME\.opencode\bin"; $u = [Environment]::GetEnvironmentVariable('Path','User')
117
+ if (($u -split ';') -notcontains $bin) { [Environment]::SetEnvironmentVariable('Path', "$u;$bin", 'User') }
118
+ opencode --version
119
+ ```
120
+ 2. Preview what lean-agents would change (`--yes` takes the defaults, so the preview asks nothing). macOS, Linux or Git Bash:
121
+ ```bash
122
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --agents opencode-v2 --profile github-copilot --dry-run --yes
123
+ ```
124
+ Windows PowerShell:
125
+ ```powershell
126
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -Agents opencode-v2 -Profile github-copilot -DryRun -Yes
127
+ ```
128
+ 3. Run the same without the dry run; in a terminal it asks you the questions you skipped with `--yes`. macOS, Linux or Git Bash:
129
+ ```bash
130
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --agents opencode-v2 --profile github-copilot
131
+ ```
132
+ Windows PowerShell:
133
+ ```powershell
134
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -Agents opencode-v2 -Profile github-copilot
135
+ ```
136
+ 4. Start `opencode`, run `/connect`, pick GitHub Copilot and sign in with your GitHub account (it needs a Copilot plan). lean-agents never handles the login.
137
+ - Subagents use the `github-copilot` profile: `fast` = claude-haiku-5.5, `balanced` = claude-sonnet-5.5, `strong` = claude-opus-5.5.
138
+ - No free OpenCode models are used.
139
+ 5. Check the result:
140
+ ```bash
141
+ npx lean-agents@latest --doctor
142
+ ```
143
+
144
+ Claude Desktop and Cursor demo paths come later.
145
+
146
+ ## Quick start
147
+
148
+ Needs Node.js 22.20+ and git (Context Mode 2 and GSD Core need Node.js 24, see the Node.js 24 bullet below). The commands run the latest release from [npm](https://www.npmjs.com/package/lean-agents):
149
+
150
+ ```bash
151
+ npx lean-agents@latest --dry-run # every file and command; changes nothing
152
+ npx lean-agents@latest # the real install, after your OK
153
+ npx lean-agents@latest --doctor # check the install
154
+ npx lean-agents@latest --update # re-apply with your saved choices
155
+ npx lean-agents@latest --uninstall # undo everything lean-agents changed
156
+ ```
157
+
158
+ The agent prompts have [a guide](docs/install-with-an-agent.md) with the steps and `--json` output; [the update steps](docs/install-with-an-agent.md#update-with-an-agent) work without the `lean-update` skill too. The skill plans with `--update --dry-run`, asks, applies and checks with `--doctor`. Peer on a work PC with VS Code Copilot agent mode? Run the [logged-in proof checklist](docs/vscode-agent-checklist.md) once.
159
+
160
+ Use `--lang es` to get the rules and replies in Spanish.
161
+
162
+ Always start with `--dry-run`: it shows every file and command before anything changes. Then run it again without `--dry-run`; it asks which agents, tools, privacy level, language and model profile you want.
163
+
164
+ - Useful flags: `--all-tools`, `--privacy strict`, `--lang es`, `--profile vertex-gemini`, `--update`, `--uninstall`, `--doctor`, `--json` (with `--dry-run`, `--doctor` or `--adopt`, for agents) (`--help` lists them all).
165
+ - `--adopt`: lists what a hand-built machine already has (MCP servers, Claude hooks and plugins, OpenCode plugins, skills, npm copies under each nvm Node, OpenCode session count), marks each one managed, user, stale, duplicate, drift or wrong-node, and prints the planned action. Alone it changes nothing; env and header values are never read. `--adopt --yes` applies the plan: it backs up every file it edits to `~/.config/lean-agents/adopt-<time>/` (owner-only), re-registers managed MCPs as `<tool Node> <entry>`, checks that each one answers `initialize` and that your own files and the OpenCode session count are unchanged, runs `--doctor`, and undoes itself if anything fails. Removing an old npm copy, a duplicate skill folder or a hand-made stopgap needs a yes (a menu on a terminal, `--confirm-removals` without one); otherwise they are listed and kept. `--keep-backup` keeps the backup after a good run; `--adopt --undo` restores every edited file byte for byte from it.
166
+ - `--upgrade-agent opencode`: dry run for moving OpenCode 1.x to 2.x. Sorts your 1.x config into managed (lean-agents reinstalls it), translatable (a verified 1.x key has a 2.x key: `agent` to `agents`, `mcp` to `mcp.servers`, `compaction.reserved` to `compaction.buffer`, ...) and manual (no proven 2.x equivalent, with the reason); prints the translation table; changes nothing (`--json` for one JSON object). `--upgrade-agent opencode --yes` applies it after a verified backup, and `--upgrade-agent opencode --undo --yes` goes back (below). `--upgrade-agent opencode --backup` (plan first, `--yes` to copy) is the first real step: a permanent backup of your OpenCode 1.x sessions and config, every file sha256-checked and the sessions counted on a copy, then a frozen copy for a later `opencode1`. It only reads the live data, refuses while OpenCode runs or free space is under 2 x size + 1 GB, and never deletes a backup. The opt-in `lean-migrate` skill (`--tools lean-migrate`) walks an agent through it: backup, dry run, apply, doctor, port the manual items, undo on a failure. Guide: [docs/migrate-opencode-v1-to-v2.md](docs/migrate-opencode-v1-to-v2.md).
167
+ - `--install-agent a,b` / `--uninstall-agent a,b` (opt-in): install an agent CLI (`claude`, `opencode-v2`, `copilot-cli`, `cursor`, `antigravity`) from its pinned installer (SHA256-checked before it runs; Linux and macOS, plus Copilot CLI on Windows) or remove it again. It shows the plan first (`--dry-run` stops there; `--yes` skips the question). Install records the files the installer created with their SHA256; uninstall deletes only those that still match, or runs `npm uninstall -g`, never the agent's own uninstaller, and leaves your config and data alone. An agent you installed yourself is reported as "not installed by lean-agents" and left alone. OpenCode 1.x is never installed or removed.
168
+ - In PowerShell the common flags are PascalCase: `-DryRun`, `-AllTools`, `-Privacy strict`, `-Profile vertex-gemini`. Any other flag is passed as it is, for example `-DryRun --network off`.
169
+ - Context Mode 2 needs Node.js 24.15 and GSD Core needs Node.js 24 (`engines.node` in `core/pins.json`). On an older active Node, lean-agents runs them on an nvm Node 24 without changing your default (nvm-windows: one already installed) and registers it with its absolute path; on Claude Code that means an MCP server instead of the Context Mode plugin, so its hooks and skills are not installed. Without nvm it skips them with one line. Everything else works on Node.js 22.20 or newer.
170
+ - With Context Mode, the installer also sets up Bun by default (faster `ctx_execute`); add `--no-bun` (`-NoBun` in PowerShell) to skip it. With Antigravity, `--no-app` (`-NoApp`) skips installing the app. See the Bun row in [Install tiers](#install-tiers).
171
+
172
+ ### All flags
173
+
174
+ Every flag from `--help`. In PowerShell the same flags are PascalCase (`-DryRun`).
175
+
176
+ | Flag | What it does |
177
+ | --- | --- |
178
+ | `--dry-run` | Show every file change and command; change nothing |
179
+ | `--yes` | Accept defaults without asking |
180
+ | `--agents a,b` | Agents to set up: claude, opencode-v1, opencode-v2, copilot-cli, antigravity, vscode-copilot, cursor (default: the ones installed) |
181
+ | `--tools a,b` | Optional tools on top of RTK and Context Mode: serena, playwright, ponytail, caveman, i-have-adhd, dcp, codeburn, copilot-usage, gsd, autoskills, playwright-extension, coordinate, lean-migrate, code-mode |
182
+ | `--all-tools` | Every optional tool except gsd, autoskills, playwright-extension, coordinate, lean-migrate and code-mode |
183
+ | `--no-tools` | No optional tools |
184
+ | `--everything` | Fresh-machine preset: plans the missing prerequisites first (Homebrew, nvm, Node 24 under nvm, uv, RTK, jq, Bun), then Claude Code + OpenCode 2 (installs their CLIs if missing; on Windows it also configures the Copilot CLI, VS Code Copilot and Antigravity that are already on the PC, skipping any that are missing) with every optional tool, shows one plan and asks once (`--yes` accepts; `--dry-run --json` prints it; a rerun resumes). Your own Node stays the default. `--agents` and `--tools` still override it |
185
+ | `--no-core` | Leave out RTK and Context Mode; install only the `--tools` you list |
186
+ | `--privacy` standard or strict | Same as `--network on` (standard) or `--network off` (strict) |
187
+ | `--network` on or off | Preset for telemetry, auto-updates and other outbound calls |
188
+ | `--telemetry`, `--auto-update`, `--outbound` on or off | One category; overrides the preset |
189
+ | `--profile <name>` | Model profile for OpenCode |
190
+ | `--lang` en or es | Language for rules and replies |
191
+ | `--terminal` warp, orca, both or none | Agent integrations for a terminal you already have (default: the detected ones) |
192
+ | `--gh` / `--no-gh` | Install GitHub CLI (`gh`) if it is missing (default: on) |
193
+ | `--bun` / `--no-bun` | Install Bun for Context Mode (default: on) |
194
+ | `--no-app` | Do not install the Antigravity app (the CLI is still installed when missing) |
195
+ | `--no-exec` | Run no external command (no installs, no version probes); `--uninstall` refuses it when commands need undoing |
196
+ | `--probe-plugins` | With `--doctor` or `--adopt`: start a short-lived `opencode serve` (throwaway state dir, loopback) and check that a plugin's command registers |
197
+ | `--project <dir>` | Write the shared team files into one repository |
198
+ | `--migrate <from>` or `auto` | Copy rules, agents, skills, prompts and MCP servers from another harness; never overwrites |
199
+ | `--adhd-always` | Turn on i-have-adhd for every answer |
200
+ | `--ponytail-mode` lite, full, ultra or off | Ponytail level |
201
+ | `--shell` default or git-bash | OpenCode on Windows: use Git Bash when found (default: git-bash); never overwrites a shell you set yourself |
202
+ | `--json` | With `--dry-run`, `--doctor`, `--adopt` or `--yes` (a real apply: `{ ok, files, commands, errors, version }`, see [docs/install-json.md](docs/install-json.md)): print one JSON object on stdout |
203
+ | `--feedback-draft` | After a failed install: read the error on stdin and print a redacted issue draft as JSON. Needs `--failed-command` |
204
+ | `--failed-command <text>` | The command that failed, for `--feedback-draft` |
205
+ | `--feedback-kind update` | With `--feedback-draft`: the text is a finding from an update, not an error |
206
+ | `--update` | Re-apply with your saved choices; the plan lists `tool: installed -> release pin`, what stays held (OpenCode 1.x, agent CLIs across a major, tools you installed yourself) and the release notes since your version (`--dry-run [--json]` shows it without changing anything). After the one confirm it also moves the Claude Code, OpenCode 2 and Copilot CLI that lean-agents installed to the release pin, inside the same major (Cursor and Antigravity have no pin, so they stay); each step saves the previous version in `state.json`, and a failed step is reported while the rest continue |
207
+ | `--update --undo [--yes]` | Put each agent CLI that `--update` upgraded back on the version it had before its first upgrade (the oldest saved `from` per agent, never OpenCode 1.x or across a major): plan first, then a confirm (or `--yes`); a failed step is reported, the rest continue, and the records of restored agents are dropped from `state.json`. `--uninstall` leaves upgraded agent CLIs alone (`--uninstall-agent` removes the ones lean-agents installed) |
208
+ | `--doctor` | Check the install |
209
+ | `--summary` | Write the summary page (`summary.html` in `~/.config/lean-agents/`; `--uninstall` removes it): log-in checklist, the verify prompt with a copy button, what was installed, next steps. The install writes it too and asks once before opening it (never under CI, `--yes`, `--json` or `--no-open`). `--filed-issue "item=issue url"` records an issue the verify prompt filed |
210
+ | `--uninstall` | Undo everything lean-agents changed |
211
+ | `--adopt` | List what a hand-built machine already has and what each item is; with `--yes` it applies the plan |
212
+ | `--confirm-removals` | With `--adopt --yes` and no terminal: also remove old npm copies, duplicate skill folders and hand-made stopgaps (all backed up) |
213
+ | `--keep-backup` | Keep the backup after a verified `--adopt --yes` |
214
+ | `--undo` | With `--adopt`: restore what the last `--adopt --yes` changed |
215
+ | `--upgrade-agent opencode` | Dry run for moving OpenCode 1.x to 2.x; changes nothing |
216
+ | `--upgrade-agent opencode --backup [--yes]` | Permanent sha256-checked backup of the 1.x sessions and config, then a frozen copy; plan only without `--yes` |
217
+ | `--upgrade-agent opencode --opencode1 [--yes]` | After `--backup`: adds `opencode1`, which runs OpenCode 1.x on the frozen copy only; `--uninstall` removes it |
218
+ | `--upgrade-agent opencode --yes` | Apply, only with a verified backup stamp from `--backup --yes`: `opencode1`, OpenCode 2, the translated config, DCP. Every step is journaled; a failed step undoes the finished ones |
219
+ | `--upgrade-agent opencode --undo [--yes]` | Back to 1.x: undoes each step, moves the 2.x-migrated db aside (never deleted), copies the frozen copy back; the backup and the frozen copy are kept |
220
+ | `--install-agent a,b` / `--uninstall-agent a,b` | Install or remove agent CLIs that lean-agents installed; plan first, `--yes` runs it; never OpenCode 1.x. `vscode-copilot` only writes or removes its config files: VS Code owns the Copilot extension |
221
+ | `--upgrade-agent vscode-copilot` | Report only: the extension updates from VS Code; `--update` refreshes the files lean-agents wrote |
222
+ | `--usage` | Print the Copilot credits left (one `gh` call, no model request) |
223
+ | `--version` | Print the lean-agents version |
224
+ | `--home <dir>` | Treat this folder as your home directory; use a temp folder to try things safely |
225
+
226
+ ### Fresh Mac or Windows PC (`--everything`)
227
+
228
+ One command from a machine with no Node.js, git or Homebrew. It detects what you have, plans, asks once, applies, and you finish with `--doctor`. Plan only first:
229
+
230
+ ```bash
231
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --dry-run --everything
232
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --everything
233
+ ```
234
+
235
+ ```powershell
236
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -DryRun --everything
237
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) --everything
238
+ ```
239
+
240
+ - **Plans:** only what is missing. Prerequisites first: Xcode Command Line Tools and Homebrew (macOS), git and unzip (Linux, apt-get), nvm and Node.js 24 under nvm (your own Node stays the default), uv, RTK, jq, Bun. Then Claude Code and OpenCode 2 (installing their CLIs if missing) with every optional tool. On Windows it also sets up the Copilot CLI, VS Code Copilot and Antigravity that are already on the PC. `--agents` and `--tools` override it.
241
+ - **PATH (macOS, Linux):** the folders it installs into (`~/.local/bin`, `~/.opencode/bin`, Homebrew's, and `install.sh`'s own Node.js, last so your Node stays the default) go into one marked block in your shell rc file (`~/.zshrc`, `~/.bashrc`, `~/.bash_profile` or `~/.profile`), leaving out any already on PATH. Open a new terminal afterwards. `--uninstall` removes the block. Windows uses the user PATH.
242
+ - **Asks:** one question, `Apply these changes?` (`--yes` accepts it). Homebrew's own installer asks for your macOS password. On Windows nothing is meant to need admin (nvm-windows without admin is still **VERIFY**).
243
+ - **Corporate PC or proxy, in five lines:** (1) read [docs/SECURITY-REVIEW.md](docs/SECURITY-REVIEW.md) first; (2) set `HTTPS_PROXY`, `NO_PROXY` and `NODE_EXTRA_CA_CERTS` in your own terminal (never written to disk); (3) add `--network off` for a work PC; (4) `--dry-run` shows every host and command before anything runs; (5) already on OpenCode 1.x? Use `--adopt`, not `--everything`. More: [On a work PC](#on-a-work-pc-proxy-network-and-security-review).
244
+ - **Interrupted?** Run the same command again: finished steps are skipped.
245
+ - **Undo:** `--uninstall` removes what lean-agents changed. Prerequisites you already had stay; Homebrew has no automatic undo (its uninstaller is interactive); `~/.nvm` goes only when every Node under it is v24.
246
+
247
+ The walkthrough with the prompts and what each step prints: [docs/fresh-machine.md](docs/fresh-machine.md). What CI proves and what stays **VERIFY**: [docs/compatibility.md](docs/compatibility.md).
248
+
249
+ ### Fallback: bootstraps
250
+
251
+ Use these only when you have no Node.js 22.20+ yet. They check for Node.js 22.20+ (git is not needed to run the release). If it is missing, `install.sh --dry-run` prints the plan and stops. Otherwise `install.sh` shows the options and asks first: on macOS `brew install node`, or the official Homebrew installer (it asks for your password and installs the Xcode Command Line Tools) when Homebrew is missing, or a Node.js download from nodejs.org checked against its `SHASUMS256.txt` into `~/.config/lean-agents/node` (no admin; `--yes` accepts only this one; remove the folder to undo). A Node.js you already have, even an old one, is never replaced. `install.ps1` does not need git; with no Node.js it asks first (unless you pass `-Yes`), tries `winget`, and without `winget` downloads the Node.js 24 zip from nodejs.org (SHA-256 checked) into `%USERPROFILE%\tools\node` for your user only, with no admin rights. A `-DryRun` with no Node.js uses a temporary copy and changes nothing. Downloads use TLS 1.2 and honor `HTTPS_PROXY` and `NO_PROXY`, or else the Windows system proxy. `install.sh` also honors `NODE_EXTRA_CA_CERTS` from your shell; neither script writes any of them to disk. Then they download the latest release, check it against the release's `SHA256SUMS`, and only then run it.
252
+
253
+ ```bash
254
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --dry-run
255
+ ```
256
+
257
+ ```powershell
258
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -DryRun
259
+ ```
260
+
261
+ `LEAN_AGENTS_VERSION=1.0.0` pins a release. Once installed, `--dry-run`, `--doctor` and `--uninstall` need no network. A local checkout (`bash install.sh` from a clone) is trusted as it is; only the release download is checksum-verified.
262
+
263
+ ## Why
264
+
265
+ - **Fewer tokens.** Exploration, research and review go to cheap subagents. Big outputs stay out of the context window. Agents search symbols instead of reading whole files.
266
+ - **Clearer answers.** One short set of global rules: answer first, state assumptions, surgical changes, verify before saying done.
267
+ - **Same behavior everywhere.** Rules are written once in `core/` and rendered for each agent.
268
+
269
+ ## What you get
270
+
271
+ | Feature | Claude Code | OpenCode 2.x | OpenCode 1.x | Copilot CLI | Antigravity CLI |
272
+ | --- | --- | --- | --- | --- | --- |
273
+ | Global rules (AGENTS.md) | ✅ | ✅ | ✅ | ✅ | ⚠️ written, load unproven |
274
+ | Subagents by cost tier | ✅ | ✅ | ✅ | ✅ | ✅ flash, pro |
275
+ | RTK (shell output compression) | ✅ | ➖ plugin refused (#179) | ✅ | ✅ | ✅ |
276
+ | Context Mode | ✅ plugin | ✅ MCP | ✅ plugin | ✅ MCP | ➖ skipped (no v2 setup) |
277
+ | Serena + Playwright MCP | ✅ | ✅ | ✅ | ✅ | ✅ |
278
+ | Signed-in browser (opt-in) | ➖ Claude in Chrome | ✅ opt-in | ✅ opt-in | ✅ opt-in | ➖ |
279
+ | Ponytail | ✅ | ✅ | ✅ | ➖ | ➖ |
280
+ | i-have-adhd | ✅ | ✅ | ✅ | ✅ | ⚠️ written, load unproven |
281
+ | Caveman and other skills | ✅ | ✅ | ✅ | ✅ | ⚠️ written, load unproven |
282
+ | Own skills only on undo; `agy` found outside PATH | ➖ | ➖ | ➖ | ➖ | ✅ keeps your same-name skill |
283
+ | Node 22.20 floor check (engine, not per agent) | ✅ | ✅ | ✅ | ✅ | ✅ |
284
+ | Context compaction | ✅ auto 80% | ✅ native | ✅ native, optional DCP | ➖ | ➖ |
285
+ | Network presets (telemetry, updates, outbound) | ✅ | ✅ updates, sharing | ✅ | ⚠️ updates; telemetry is a reminder | ⚠️ reminders only |
286
+ | Proxy passed to every install command | ✅ | ✅ | ✅ | ✅ | ⚠️ checked in CI, undocumented upstream |
287
+
288
+ ✅ supported · ⚠️ partial · ➖ not available for this agent. Details and verification dates: [docs/compatibility.md](docs/compatibility.md).
289
+
290
+ | Feature | VS Code Copilot | Cursor (IDE and CLI) | Team repo (`--project`) |
291
+ | --- | --- | --- | --- |
292
+ | Rules | ⚠️ written, load unproven | ➖ settings UI only, use `--project` | ✅ `AGENTS.md` |
293
+ | Subagents | ⚠️ written, load unproven | ⚠️ written, load unproven | ✅ `.github/agents`; ⚠️ `.cursor/agents` (Cursor CLI loading unverified) |
294
+ | RTK | ⚠️ through Copilot CLI only | ✅ | ➖ per user |
295
+ | Context Mode, Serena, Playwright | ✅ MCP | ✅ MCP | ✅ `.vscode/mcp.json`, `.cursor/mcp.json` |
296
+ | Signed-in browser (opt-in) | ✅ opt-in | ✅ opt-in | ➖ per user |
297
+ | Caveman, i-have-adhd skills | ⚠️ written, load unproven | ⚠️ written, load unproven | ➖ per user |
298
+
299
+ **Antigravity app and CLI.**
300
+
301
+ - The app and the CLI read the same `~/.gemini/config` files, so one setup serves both on macOS, Linux and Windows (the CLI on Windows is proven in CI with real `agy`).
302
+ - With Antigravity selected, lean-agents installs the CLI and the app with Homebrew (macOS) or the app with winget (Windows); otherwise it prints the vendor link.
303
+ - **VERIFY:** that the app loads the rules, subagents, skills and MCP servers, where its MCP file is, and its settings keys. CI cannot run the app or log in, so these are unproven.
304
+
305
+ ## Warp and Orca
306
+
307
+ <details>
308
+ <summary>What the Warp and Orca integrations add</summary>
309
+
310
+ If you already use [Warp](https://www.warp.dev) or [Orca](https://github.com/stablyai/orca), lean-agents adds their agent integrations for the agents you chose. You can also ask lean-agents to install the terminals themselves (`--install-terminal warp|orca|both`, or interactively). It looks for the app (or `warp-terminal` / `orca` on PATH), preselects what it finds, and asks nothing when neither is there. `--terminal warp|orca|both|none` overrides; `none` opts out.
311
+
312
+ - **Warp:** the Claude Code plugin `warp@claude-code-warp` (needs `jq`) and the OpenCode plugin `@warp-dot-dev/opencode-warp`.
313
+ - **Orca:** the `orca-cli` skill for your agents. Orca manages its own status hooks (Settings > Agents, or `orca agent hooks on`); lean-agents does not touch them, but Orca's first launch writes them into `~/.claude/settings.json` and `~/.cursor/hooks.json`, and `--doctor` reports them. Its Agent Session Search indexes every agent chat on the machine and is on by default (Settings > Session History).
314
+ - **Windows:** with the all-off preset it sets `DO_NOT_TRACK=1` and `ORCA_TELEMETRY_DISABLED=1` in your user env (only if unset), and behind a proxy it adds `localhost`, `127.0.0.1` and `::1` to `NO_PROXY` so Orca's status hooks reach the app. With Git Bash it adds a marked `~/.bashrc` block (the Cursor `agent` aliases, and the same `NO_PROXY` entries). `--uninstall` removes only what it added.
315
+ - After an install it prints a "Still needed from you" list (Cursor login, User Rules, Orca's **Install CLI & Skills** and first launch); `--doctor` shows the same list with what is done.
316
+ - `--uninstall` removes what it added. With the all-off network preset it prints the telemetry switches (Warp `telemetry_enabled = false`, Orca `DO_NOT_TRACK=1`) and never edits the apps' settings.
317
+
318
+ Sources and unverified GUI facts: [docs/compatibility.md](docs/compatibility.md#terminals).
319
+
320
+ </details>
321
+
322
+ ## Signed-in browser (opt-in)
323
+
324
+ <details>
325
+ <summary>How the signed-in browser works</summary>
326
+
327
+ The default `playwright` MCP opens a fresh headless browser, which fails on pages behind single sign-on. `--tools playwright-extension` adds `@playwright/mcp --extension` instead. It attaches to your own signed-in Chrome or Edge through the [Playwright Extension](https://chromewebstore.google.com/detail/playwright-extension/mmlmfjhmonkocbjadbfplnigmagldckm).
328
+
329
+ - Install the extension yourself. Extensions cannot be installed silently without an admin policy.
330
+ - Each session asks you to approve the connection. Auto-approve with a token is optional: see [docs/browser-extension.md](docs/browser-extension.md). The installer never asks for, stores or prints the token.
331
+ - Works with OpenCode, Copilot CLI, VS Code Copilot and Cursor. Claude Code and Claude Desktop use Claude in Chrome instead.
332
+
333
+ </details>
334
+
335
+ ## VS Code Copilot and Cursor
336
+
337
+ <details>
338
+ <summary>What lands in VS Code Copilot and Cursor</summary>
339
+
340
+ lean-agents sets up the Copilot chat in VS Code and Cursor (the editor and its `agent` CLI) like the other agents:
341
+
342
+ - **VS Code Copilot:** rules in `~/.copilot/copilot-instructions.md`, subagents in `~/.copilot/agents/`, MCP servers in your VS Code user `mcp.json`, and skills. Copilot CLI reads the same `~/.copilot` files, so with both they are written once.
343
+ - **Cursor:** subagents in `~/.cursor/agents/`, MCP servers in `~/.cursor/mcp.json`, the RTK hook and skills. Cursor keeps user rules in its settings screen, not in a file, so lean-agents cannot write them. Use team mode below to give Cursor the rules through the repo's `AGENTS.md`.
344
+
345
+ ```bash
346
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --dry-run --agents vscode-copilot,cursor
347
+ ```
348
+
349
+ ```powershell
350
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -DryRun -Agents vscode-copilot,cursor
351
+ ```
352
+
353
+ Drop `--dry-run` (`-DryRun`) to apply. `--uninstall` removes it all again.
354
+
355
+ </details>
356
+
357
+ ## Team mode (`--project`)
358
+
359
+ <details>
360
+ <summary>Files written and commands</summary>
361
+
362
+ Puts the shared setup into one repository, so everyone on the team gets it with `git pull`:
363
+
364
+ | File | What it does |
365
+ | --- | --- |
366
+ | `AGENTS.md` | The rules, in a marked block; your own text stays |
367
+ | `.github/copilot-instructions.md`, `.cursor/rules/lean-agents.mdc` | One line pointing to `AGENTS.md`, so rules load once |
368
+ | `.github/agents/*.agent.md`, `.cursor/agents/*.md` | Tiered subagents for VS Code Copilot and Cursor |
369
+ | `.vscode/mcp.json`, `.cursor/mcp.json` | Context Mode, plus Serena and Playwright if you pick them |
370
+
371
+ Run it from the repository root, check the plan, apply, and commit:
372
+
373
+ ```bash
374
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --project . --dry-run --tools serena --yes
375
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --project . --tools serena
376
+ git add AGENTS.md .github .vscode .cursor && git commit -m "chore: add lean-agents team setup"
377
+ ```
378
+
379
+ On Windows:
380
+
381
+ ```powershell
382
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -Project . -DryRun -Tools serena -Yes
383
+ ```
384
+
385
+ - Later, `--project . --update` re-applies your saved choices, and `--project . --uninstall` removes only what lean-agents added.
386
+ - Team mode writes files only. Each teammate still runs the installer once for the tools the rules mention (RTK, Context Mode and the rest).
387
+ - Each teammate's state stays in their own home folder, never in the repo.
388
+
389
+ </details>
390
+
391
+ ## Migrate from another tool (`--migrate`)
392
+
393
+ <details>
394
+ <summary>What is copied and what is not</summary>
395
+
396
+ Copies the setup you already have in one tool to the agents you pick (`--agents`), for your user or, with `--project`, inside a repository. Sources: `claude`, `vscode-copilot`, `cursor`, `copilot-cli`, `opencode-v1`, `opencode-v2`, `antigravity` (user scope only), or `auto` (every one found). Paths and upstream sources: [compatibility notes](docs/compatibility.md).
397
+
398
+ | Item | What happens |
399
+ | --- | --- |
400
+ | Rules, subagents, skills, prompts | Copied to the target's folders. Nothing is moved or overwritten: a name that already exists is skipped and listed |
401
+ | MCP servers | Command, arguments and URL are copied. Env and header values never are: only the variable names, with a line telling you to set them |
402
+ | Hooks | Listed only. Formats differ, so you copy them by hand |
403
+
404
+ Preview first, then drop `--dry-run` to apply:
405
+
406
+ ```bash
407
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --migrate auto --agents claude --dry-run
408
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --migrate vscode-copilot --project . --agents claude,opencode-v2 --dry-run
409
+ ```
410
+
411
+ On Windows:
412
+
413
+ ```powershell
414
+ & ([scriptblock]::Create((irm https://github.com/estebanmr99/lean-agents/releases/latest/download/install.ps1))) -Migrate auto -Agents claude -DryRun
415
+ ```
416
+
417
+ - The dry run prints a table: item, source, target, and whether it was migrated, skipped or only reported.
418
+ - `--uninstall` removes only what the migration wrote.
419
+ - Claude Code user-scope MCP servers go through `claude mcp add`, so `~/.claude.json` is never edited.
420
+
421
+ </details>
422
+
423
+ ## Parallel agent sessions
424
+
425
+ <details>
426
+ <summary>Commands and model tiers</summary>
427
+
428
+ One agent per task, each in its own git worktree, merged one at a time. Orca is used when installed, plain `git worktree` otherwise. Each task picks a model tier (`role: plan|build|explore|research` in its prompt file: strong, balanced, cheap), mapped through the model profiles.
429
+
430
+ ```bash
431
+ node scripts/parallel.mjs start api.md ui.md # from inside your repo
432
+ node scripts/parallel.mjs status
433
+ node scripts/parallel.mjs merge api --yes # in start order
434
+ node scripts/parallel.mjs clean
435
+ ```
436
+
437
+ Playbook: `skills/parallel-sessions`. Details: [docs/parallel-sessions.md](docs/parallel-sessions.md).
438
+
439
+ </details>
440
+
441
+ ## Claude through GitHub Copilot
442
+
443
+ If your company pays for GitHub Copilot, the official way to use Claude as an agent is the **Claude coding agent**, a Copilot partner agent that an admin turns on. lean-agents installs nothing for it, because it is a policy switch, not a package. Tools that reuse a Copilot token to run the Claude Code CLI are not official and not supported. Steps and admin settings: [docs/claude-with-copilot.md](docs/claude-with-copilot.md).
444
+
445
+ ## Install tiers
446
+
447
+ | Tier | What | Default |
448
+ | --- | --- | --- |
449
+ | Minimal | Rules, tiered subagents, compaction, output limits, RTK, Context Mode | Always; `--no-core` (`-NoCore` in PowerShell) leaves out RTK and Context Mode |
450
+ | Optional tools | Serena, Playwright, Ponytail, Caveman, i-have-adhd, DCP (OpenCode 1.x, AGPL-3.0), Codeburn, Copilot usage (credits left in the OpenCode sidebar and the Claude Code status line, read with `gh`; `lean-agents --usage` prints them) | Asked one by one |
451
+ | Opt-in tools | GSD Core, AutoSkills (CC BY-NC 4.0: non-commercial use only), the `coordinate` skill (coordinator playbook, session prompt and worker watcher: [docs/agent-workflow.md](docs/agent-workflow.md)), Claude Code Code Mode (`code-mode`, experimental: direct Anthropic login only, sessions started with it resume only with it on) | Asked one by one, never in `--all-tools` |
452
+ | Strict privacy | No telemetry, no auto-updates, no session sharing, no providers that train on your prompts | Off, opt in with `--privacy strict` |
453
+ | Agent self-updaters | Off for every managed install (Claude Code `DISABLE_AUTOUPDATER`, OpenCode `update` / `autoupdate`, Copilot CLI `autoUpdate`), unless you pass `--auto-update on` (or pick auto-updates in the per-category menu), which writes no switch and leaves the agent's own updater alone: `--update` is the one way agents get updated. A value you already set is kept and reported; `--uninstall` removes ours | Off; `--auto-update on` leaves the agent's updater as it is |
454
+ | Network preset | All off (work PC), all on, or per category: telemetry, auto-updates, other outbound calls. Off sets switches only: install downloads and chosen tools are not blocked ([privacy.md](docs/privacy.md#what-each-preset-does-not-block)) | All on; `--network off` (same as `--privacy strict`) or `--telemetry`, `--auto-update`, `--outbound` |
455
+ | GitHub CLI (`gh`) | Installed with brew or winget at user scope; you run `gh auth login` | On when missing; `--no-gh` (`-NoGh` in PowerShell) skips it |
456
+ | Bun (for Context Mode) | Faster `ctx_execute` JavaScript and TypeScript; see below | On; `--no-bun` (`-NoBun` in PowerShell) |
457
+
458
+ **Bun details.**
459
+
460
+ - Linux: the pinned release zip into `~/.bun`, SHA256 checked before it is extracted, no shell-profile edit. macOS: `brew install oven-sh/bun/bun`. Windows: the same pinned zip (user PATH, no admin).
461
+ - A Bun you already have is reused and never removed. If the install fails, Context Mode runs on Node.
462
+ - With telemetry off, `~/.bunfig.toml` gets a marked `telemetry = false` block. `--uninstall` removes only what lean-agents installed.
463
+
464
+ ## Antigravity pilot
465
+
466
+ Antigravity has three parts: the CLI (`agy`), the IDE and the VS Code extension `Google.google-antigravity`. Upstream docs say the IDE and CLI read the same `~/.gemini/config` folders; this is not tested in the IDE yet.
467
+
468
+ - **lean-agents configures** (through the CLI adapter, user scope): rules, agents, skills and MCP servers in `~/.gemini/config`, and RTK, i-have-adhd and Caveman where supported.
469
+ - **It does not**: install the IDE or the extension, edit IDE or extension settings, write `hooks.json` or the telemetry setting (`antigravity.enableTelemetry` is deprecated and on by default; set it yourself in team mode).
470
+ - **Read-only checks**: `--doctor` and `--adopt` report which of `~/.gemini/antigravity-ide`, `antigravity-cli`, the legacy `antigravity` and the extension exist. `--doctor` also lists the proxy and CA variables the extension and `agy` read (`HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, `NODE_EXTRA_CA_CERTS`, `SSL_CERT_FILE`, `NODE_USE_SYSTEM_CA`) as set or not set, never their values.
471
+ - **Unverified**: Windows and Linux paths, whether the IDE runs `hooks.json` or loads `.agents/mcp_config.json`, Open VSX, auto-update. See [docs/compatibility.md](docs/compatibility.md).
472
+
473
+ ## On a work PC: proxy, network and security review
474
+
475
+ <details>
476
+ <summary>Proxy, network presets and unverified settings</summary>
477
+
478
+ 1. **Review first.** Paste the prompt from [docs/SECURITY-REVIEW.md](docs/SECURITY-REVIEW.md) into your agent. It lists every file, command, host and tool, checks them against the code, and asks for your company's IT or proxy pages when it cannot read them itself.
479
+ 2. **Set your proxy in your own shell** before you run the installer, in either letter case:
480
+ ```bash
481
+ export HTTPS_PROXY=http://proxy.example:8080 NO_PROXY=localhost,127.0.0.1
482
+ export NODE_EXTRA_CA_CERTS=/path/to/company-ca.pem # if your company inspects TLS
483
+ ```
484
+ The installer passes both cases to every command it runs (brew and git read lowercase, uv uppercase) and shows them in `--dry-run` and `--doctor` with any password replaced by `***`. It never writes them to disk. Which CA variable each tool reads: [docs/compatibility.md](docs/compatibility.md#proxy-and-corporate-ca).
485
+ 3. **Pick a network preset.** The installer asks: **all off** (enterprise PC), **all on** (personal PC) or **per category**. For scripted runs:
486
+ ```bash
487
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --dry-run --network off # everything off
488
+ curl -fsSL https://github.com/estebanmr99/lean-agents/releases/latest/download/install.sh | bash -s -- --yes --network off --telemetry on # off, but keep telemetry
489
+ ```
490
+ The per-category flags are `--telemetry on|off`, `--auto-update on|off` and `--outbound on|off`. `--network off` is the same as `--privacy strict`. In PowerShell they pass as they are, for example `-DryRun --network off`. What each category turns off per agent: [docs/privacy.md](docs/privacy.md). The choice is saved and reused by `--update`.
491
+ 4. **`gh`**: GitHub CLI is installed without admin rights when missing (`--no-gh` skips it); then run `gh auth login` yourself.
492
+ 5. **Run-time fetches.** Besides install-time commands, agents download code each time they start an MCP server or use a skill. Every one is pinned to an exact version in [core/pins.json](core/pins.json) (Playwright MCP, Context Mode, Codeburn, AutoSkills, GSD Core, DCP, the Skills CLI and the skills Caveman, i-have-adhd and orca-cli), so nothing changes under you until you update. `--doctor` reports `changed` when the installed pins differ from that file. Not pinned yet: Serena (`git+https` source), RTK and `gh` (brew or winget), the Ponytail plugin and the Claude plugin marketplaces. Use `--no-core` to leave out RTK and Context Mode when your PC allows only specific tools. RTK, uv, `gh` (Homebrew and winget cannot install a fixed version) and the Antigravity cask are tracked in the same file as a known-good version and a minimum: the update plan reports them and the daily watch flags newer releases, but lean-agents never forces a version on them. Bun is tracked too (its checksums stay by hand).
493
+
494
+ In a real terminal the installer shows menus (arrow keys, space to toggle), a progress list and a summary. With `--yes`, a pipe or no terminal, it asks plain questions or none, as before.
495
+
496
+ **Settings upstream does not document** (Antigravity telemetry and auto-updates, Serena's config, winget's persistent proxy, download hosts, DCP, GSD and AutoSkills telemetry): lean-agents never guesses them.
497
+
498
+ - In a real terminal it asks per item: **paste your docs or IT notes** (one line, or a path to a file) or **keep the tool's default**.
499
+ - Notes are saved, with any proxy password hidden, to `~/.config/lean-agents/notes/<item>.md` and never applied automatically: ask your agent to apply them and show you each change first.
500
+ - If another agent already set the tool up, the question is skipped and lean-agents adds no notes for it.
501
+ - `--yes` always keeps the default.
502
+
503
+ </details>
504
+
505
+ ## Models that stay current
506
+
507
+ Subagents ask for a tier (`fast`, `balanced`, `strong`), not a model ID. Claude Code maps tiers to the `haiku`, `sonnet` and `opus` aliases, which always point to the newest models. Other agents use dated [profiles](profiles/) per subscription, and the `update-models` skill refreshes them with your approval.
508
+
509
+ ## Safety
510
+
511
+ - Backs up every file before touching it. `--uninstall` restores them.
512
+ - Never overwrites your `AGENTS.md` or `CLAUDE.md`: it imports or appends a marked block.
513
+ - Never asks for, stores or prints API keys. You log in to providers yourself.
514
+ - No admin rights needed, so it works on locked-down work laptops.
515
+ - Reviewable before install: [docs/SECURITY-REVIEW.md](docs/SECURITY-REVIEW.md) is a prompt your agent runs on this repo.
516
+
517
+ ## Credits
518
+
519
+ lean-agents is glue. The heavy lifting is done by these projects; please star them too:
520
+
521
+ - [RTK](https://github.com/rtk-ai/rtk)
522
+ - [Context Mode](https://github.com/mksglu/context-mode)
523
+ - [Serena](https://github.com/oraios/serena)
524
+ - [Playwright MCP](https://github.com/microsoft/playwright-mcp)
525
+ - [Ponytail](https://github.com/DietrichGebert/ponytail)
526
+ - [Caveman](https://github.com/juliusbrussee/caveman)
527
+ - [i-have-adhd](https://github.com/ayghri/i-have-adhd)
528
+ - [OpenCode DCP](https://github.com/Opencode-DCP/opencode-dynamic-context-pruning)
529
+ - [GSD Core](https://github.com/open-gsd/gsd-core)
530
+ - [andrej-karpathy-skills](https://github.com/multica-ai/andrej-karpathy-skills)
531
+ - [Codeburn](https://github.com/getagentseal/codeburn)
532
+ - [AutoSkills](https://github.com/midudev/autoskills)
533
+ - [Skills CLI](https://vercel.com/changelog/introducing-skills-the-open-agent-skills-ecosystem)
534
+
535
+ ## Roadmap
536
+
537
+ - [x] Spec, rules and subagent definitions
538
+ - [x] Installer for Claude Code and OpenCode 2.x (macOS, Linux)
539
+ - [x] Windows installer and OpenCode 1.x
540
+ - [x] Copilot CLI, Antigravity CLI, Codeburn, AutoSkills, GSD, original skills, model profiles
541
+ - [x] VS Code Copilot, Cursor, team mode (`--project`), Claude through Copilot
542
+ - [x] Parallel agent sessions (`scripts/parallel.mjs`)
543
+ - [x] Warp and Orca agent integrations for users who already have them
544
+ - [x] Antigravity app and CLI on macOS, Linux and Windows (app loading stays VERIFY)
545
+ - [x] `v1.0.0` (latest): fresh-machine `--everything`, guided OpenCode 1.x to 2.x upgrade with backup and undo, install by the VS Code Copilot agent, update plan and `--update --undo`, summary page; Node.js 22.20 or newer
546
+ - [x] `v0.8.0`: optional agent install and uninstall, the coordinator playbook, adopt a hand-built machine, Node runtime per tool in `--doctor`
547
+ - [x] `v0.6.0` (includes the planned 0.5.1): fixes from real Windows installs behind a proxy, `--no-core`, pinned MCP and skill versions, migrate from another harness, install with an agent; Node.js 22.20 or newer
548
+ - [x] Installable CLI on npm (`npx lean-agents@latest`)
549
+ - [ ] Next release (on hold): use-case GIFs, update from verified pins
550
+ - Later: Codex CLI, Gemini CLI
551
+
552
+ Details and linked issues: [docs/ROADMAP.md](docs/ROADMAP.md).
553
+
554
+ ## Contributing
555
+
556
+ Issues and PRs are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) first; every PR runs a secret and privacy scan.
557
+
558
+ ## License
559
+
560
+ [MIT](LICENSE)
@@ -0,0 +1,60 @@
1
+ # Reglas globales
2
+
3
+ {{LANG_RULE}} Estas reglas aplican a todos los proyectos; las de cada proyecto mandan si chocan.
4
+
5
+ ## 1. Explicar bien
6
+
7
+ - Empieza por la respuesta o la decisión. Agrega solo el contexto necesario.
8
+ - Estructura escaneable: títulos cortos, listas, pasos numerados, una idea por punto.
9
+ - Frases completas y concretas. Nada de relleno, disculpas ni repetir la pregunta.
10
+ - Explica el porqué de cada decisión no obvia en una línea.
11
+ - Si algo es incierto, dilo y di cómo lo verificarías. No inventes APIs, flags ni versiones.
12
+ - Cuando muestres un cambio, di qué cambió, dónde (`archivo:línea`) y cómo verificarlo.
13
+ - Estilo comprimido (Caveman) solo cuando se pida o la respuesta sea trivial. Nunca para depuración, seguridad ni explicaciones complejas.
14
+
15
+ ## 2. Pensar antes de programar
16
+
17
+ - No asumas en silencio. Escribe tus supuestos.
18
+ - Si el pedido se puede leer de varias formas, enuméralas y elige la más probable, o pregunta si equivocarse es caro.
19
+ - Si existe un camino más simple que el pedido, dilo antes de hacerlo.
20
+ - Nombra lo que no esté claro.
21
+
22
+ ## 3. Simplicidad primero
23
+
24
+ - El código mínimo que resuelve el problema. Nada de features no pedidas, abstracciones de un solo uso ni configuración especulativa.
25
+ - No manejes casos imposibles.
26
+ - Prueba: ¿un ingeniero senior diría que está sobrecomplicado? Entonces simplifica.
27
+
28
+ ## 4. Cambios quirúrgicos
29
+
30
+ - Toca solo lo que la tarea requiere. No reformatees, no "mejores" código vecino, no refactorices lo que funciona.
31
+ - Sigue el estilo existente del archivo.
32
+ - Menciona el código muerto ajeno a la tarea; no lo borres.
33
+ - Borra solo lo que tu propio cambio dejó huérfano.
34
+ - Cada línea cambiada debe poder justificarse con el pedido.
35
+
36
+ ## 5. Ejecución guiada por objetivos
37
+
38
+ - Convierte tareas vagas en criterios verificables (por ejemplo, un test que reproduce el bug y luego pasa).
39
+ - Para trabajo de varios pasos, un plan corto con una verificación por paso.
40
+ - No declares terminado sin verificar. Si no pudiste verificar, dilo.
41
+
42
+ ## 6. Ahorro de tokens
43
+
44
+ - Lee lo mínimo: busca primero (grep{{SERENA_HINT}}) y abre solo las partes relevantes.
45
+ {{TOOL_RULES}}- No repitas en la respuesta contenido que ya está en archivos o en la conversación.
46
+ - Delega exploración y tareas acotadas a subagentes baratos (`explore`, `research`, `review`). El nivel fuerte solo para planear, arquitectura o bugs difíciles, y solo cuando se pida o se justifique.
47
+ - Subagentes en paralelo solo si no tocan los mismos archivos; si chocan, en secuencia.
48
+ - Cada subagente recibe objetivo, límites, archivos permitidos y formato de salida. Al final, un paso de `review`.
49
+
50
+ ## 7. Seguridad
51
+
52
+ - Nunca leas, muestres, copies ni registres secretos (API keys, tokens, contraseñas, archivos de auth).
53
+ - Pide confirmación antes de algo irreversible: push, deploy, migraciones, borrados masivos, sobrescrituras.
54
+ - Respaldo antes de editar configuración del sistema o del usuario.
55
+ - No instales plugins, hooks ni MCPs nuevos sin revisión de seguridad explícita.
56
+
57
+ ## 8. Reporte final
58
+
59
+ - Qué hice, qué verifiqué (comando o resultado), qué queda pendiente.
60
+ - Máximo una sugerencia de siguiente paso.