compact-agent 1.1.0 → 1.2.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.
package/README.md CHANGED
@@ -1,394 +1,344 @@
1
- # Compact Agent
2
-
3
- Universal AI coding assistant for the terminal. Works with OpenRouter, GLM, Ollama, OpenAI, DeepSeek, LM Studio, or any OpenAI-compatible API.
4
-
5
- Ships bundled with the full **[everything-claude-code](https://github.com/Crownelius/everything-claude-code)** harness library — skills, agents, slash commands, language rules, and security hooks — automatically installed on first launch.
6
-
7
- ```
8
- npm install -g compact-agent
9
- compact-agent
10
- ```
11
-
12
- > **New here?** See [INSTALL.md](INSTALL.md) for the full setup walkthrough (prerequisites, providers, troubleshooting). Inside the REPL, type `/walkthrough` for an agent-led tour.
13
-
14
- ---
15
-
16
- ## Features
17
-
18
- Each feature is labeled with its data scope:
19
-
20
- | Label | Meaning |
21
- |-------|---------|
22
- | **LOCAL** | All data stays on your machine in `~/.crowcoder/` |
23
- | **API** | Sends data to your chosen AI provider only (required for the feature to work) |
24
- | **NONE** | No data stored or sent |
25
-
26
- ### CoreAPI
27
-
28
- | Feature | Data Scope | Description |
29
- |---------|------------|-------------|
30
- | Streaming chat | **API** | Send messages to your configured AI provider, stream responses |
31
- | Tool execution | **API** | AI calls tools (bash, read, write, edit, grep, glob, list_dir, web_fetch, web_search) |
32
- | Context compaction | **API** | Summarizes old messages via your AI provider when context grows large |
33
- | AI code review | **API** | `/review` sends diff to your AI for quality/security analysis |
34
- | AI TDD mode | **API** | `/tdd` AI writes tests first, then implementation |
35
- | AI security review | **API** | `/security-review` AI audits project for vulnerabilities |
36
- | AI commit/PR | **API** | `/commit`, `/pr` AI generates commit messages and PR descriptions |
37
- | Multi-agent orchestration | **API** | Spawn parallel sub-tasks using your AI provider |
38
- | Verification loop | **API** | `/verify` run tests, fix failures, repeat until green |
39
- | Build fix | **API** | `/build-fix` auto-detect and fix build errors for all major languages |
40
- | E2E test generation | **API** | `/e2e` — generate end-to-end tests (Playwright, Cypress, Puppeteer) |
41
- | Evaluation | **API** | `/eval` — evaluate project against custom criteria |
42
- | Documentation sync | **API** | `/update-docs` — sync documentation with code |
43
- | Coverage analysis | **API** | `/test-coverage` — analyze test coverage, suggest tests |
44
- | Refactoring | **API** | `/refactor` — dead code detection & cleanup |
45
- | Content engine | **API** | `/article`, `/slides`, `/repurpose`, `/market-research`, `/investor-deck` |
46
- | Codemap generation | **NONE** | `/codemap`, `/update-codemaps` — project structure mapping |
47
- | Skill creation | **API** | `/skill-create` create reusable skills from git patterns |
48
- | Search-first research | **API** | `/search-first` — research before coding |
49
- | Docs lookup | **API** | `/docs-lookup` search docs for answers |
50
- | Walkthrough tour | **API** | `/walkthrough` (aliases: `/tour`, `/guide`) — agent-led onboarding |
51
-
52
- ### Session & History — LOCAL
53
-
54
- | Feature | Data Scope | Storage Location |
55
- |---------|------------|------------------|
56
- | Session persistence | **LOCAL** | `~/.crowcoder/sessions/*.json` |
57
- | Auto-save | **LOCAL** | Saves after every turn to `~/.crowcoder/sessions/` |
58
- | Session resume | **LOCAL** | `/resume <id>` loads from local files |
59
- | Checkpoints | **LOCAL** | `/checkpoint` — save/restore git state |
60
-
61
- ### Cost & Usage TrackingLOCAL
62
-
63
- | Feature | Data Scope | Storage Location |
64
- |---------|------------|------------------|
65
- | Token counting | **LOCAL** | `~/.crowcoder/usage.json` |
66
- | Cost estimation | **LOCAL** | Estimated from local model cost table, never sent anywhere |
67
- | Budget alerts | **LOCAL** | `/budget` sets local daily/monthly limits |
68
- | Usage summary | **LOCAL** | `/usage` reads from local file only |
69
-
70
- ### Learning System — LOCAL
71
-
72
- | Feature | Data Scope | Storage Location |
73
- |---------|------------|------------------|
74
- | Pattern extraction | **LOCAL** | `~/.crowcoder/instincts/*.json` |
75
- | Instinct confidence | **LOCAL** | Scores stored and decayed locally |
76
- | Import/export | **LOCAL** | `/learn`, `/instincts`, `/instinct-export`, `/instinct-import`, `/prune` |
77
- | Skill evolution | **LOCAL** | `/evolve` cluster instincts into reusable skills |
78
- | Memory persistence | **LOCAL** | `~/.crowcoder/memory/` — cross-session project context |
79
-
80
- ### Security — NONE / LOCAL
81
-
82
- | Feature | Data Scope | Description |
83
- |---------|------------|-------------|
84
- | Dangerous command detection | **NONE** | Regex-based, runs in-process, no data stored |
85
- | Secret scanning | **NONE** | Regex-based, runs in-process, blocks secrets from being written |
86
- | Security threat levels | **NONE** | Critical commands (rm -rf, DROP TABLE, force push) auto-blocked |
87
-
88
- ### Hooks LOCAL
89
-
90
- | Feature | Data Scope | Storage Location |
91
- |---------|------------|------------------|
92
- | Hook configuration | **LOCAL** | `~/.crowcoder/hooks.json` |
93
- | PreToolUse / PostToolUse | **LOCAL** | User-defined scripts, run locally |
94
- | SessionStart / SessionStop | **LOCAL** | User-defined scripts, run locally |
95
- | Hook profiles | **LOCAL** | `/hook-profile` — minimal/standard/strict profiles via `CROWCODER_HOOK_PROFILE` |
96
-
97
- ### Modes NONE
98
-
99
- | Feature | Data Scope | Description |
100
- |---------|------------|-------------|
101
- | Mode switching | **NONE** | `/mode dev\|review\|tdd\|research\|plan\|debug\|architect\|hermes` — changes system prompt only, no data stored |
102
-
103
- ### Model Routing LOCAL
104
-
105
- | Feature | Data Scope | Description |
106
- |---------|------------|-------------|
107
- | Cost-aware routing | **LOCAL** | `/route` classifies task complexity locally, switches model |
108
- | Model switching | **LOCAL** | `/model`, `/models` updates `~/.crowcoder/config.json` |
109
-
110
- ### Rules Engine LOCAL
111
-
112
- | Feature | Data Scope | Storage Location |
113
- |---------|------------|------------------|
114
- | Built-in rules | **NONE** | Hardcoded for TS, Python, Go, Rust, Java, Kotlin, C++, PHP |
115
- | Custom rules | **LOCAL** | `~/.crowcoder/rules/<language>.md` |
116
- | Auto-detection | **NONE** | Scans cwd file extensions in-process |
117
-
118
- ### Project Audit — NONE
119
-
120
- | Feature | Data Scope | Description |
121
- |---------|------------|-------------|
122
- | Harness audit | **NONE** | `/audit` checks local project files (git, tests, linter, secrets) no data leaves your machine |
123
- | Project detection | **NONE** | `/detect` detect package manager, test runner, build tool |
124
-
125
- ### Configuration LOCAL
126
-
127
- | Feature | Data Scope | Storage Location |
128
- |---------|------------|------------------|
129
- | API key storage | **LOCAL** | `~/.crowcoder/config.json` (plaintext protect this file) |
130
- | Provider config | **LOCAL** | `~/.crowcoder/config.json` |
131
- | Permission mode | **LOCAL** | `~/.crowcoder/config.json` |
132
- | Theme | **LOCAL** | `full`, `compact`, or `minimal` startup display |
133
- | Dry-run mode | **LOCAL** | `/dry-run` — toggle tool execution preview |
134
- | Thinking display | **LOCAL** | `/thinking` — toggle model reasoning visibility |
135
-
136
- ---
137
-
138
- ## Privacy
139
-
140
- **Crowcoder has zero telemetry, zero analytics, and zero phone-home.**
141
-
142
- - No data is sent to Crowcoder developers or any third party
143
- - No tracking headers, no analytics SDKs, no crash reporting
144
- - The only external network calls are to **your chosen AI provider** (OpenRouter, OpenAI, etc.) when you send a message
145
- - The `web_fetch` tool only fetches URLs **you explicitly ask for**
146
- - All local data lives in `~/.crowcoder/` — delete that folder to remove everything
147
-
148
- ### What goes where
149
-
150
- ```
151
- ~/.crowcoder/
152
- config.json — API key, provider, model, permissions, theme
153
- usage.json — token counts, cost estimates (local only)
154
- hooks.json — hook definitions
155
- users.json — user management table
156
- ecc-state.json — ECC install state
157
- sessions/ — saved conversations (*.json)
158
- instincts/ — learned patterns (*.json)
159
- skills/ — reusable skill templates (*.json)
160
- memory/ — cross-session project memory (*.json)
161
- checkpoints/ — git state checkpoints (*.json)
162
- rules/ — custom coding rules (*.md)
163
- hooks/ — user hook scripts
164
- ecc-commands/ — ECC command prompt templates (*.md)
165
- ecc-agents/ — ECC agent prompt templates (*.md)
166
- ```
167
-
168
- **Your API key** is stored in plaintext in `config.json`. Keep `~/.crowcoder/` private.
169
-
170
- ---
171
-
172
- ## Supported Providers
173
-
174
- | Provider | Base URL | Default Model |
175
- |----------|----------|---------------|
176
- | OpenRouter | `openrouter.ai/api/v1` | anthropic/claude-sonnet-4 |
177
- | Anthropic (Claude) | `api.anthropic.com/v1/` | claude-sonnet-4-20250514 |
178
- | OpenAI (GPT) | `api.openai.com/v1` | gpt-4o |
179
- | Google (Gemini) | `generativelanguage.googleapis.com/v1beta/openai/` | gemini-2.5-flash |
180
- | DeepSeek | `api.deepseek.com/v1` | deepseek-chat |
181
- | GLM (ZhipuAI) | `open.bigmodel.cn/api/paas/v4` | glm-4-plus |
182
- | Ollama (Local) | `localhost:11434/v1` | qwen2.5-coder:latest |
183
- | LM Studio | `localhost:1234/v1` | loaded-model |
184
- | Custom | you provide | you provide |
185
-
186
- ---
187
-
188
- ## Slash Commands
189
-
190
- ```
191
- General Model & Provider Modes
192
- /help /model [name] /mode [name]
193
- /config /models /modes
194
- /theme [full|compact|minimal] /provider /hermes
195
- /clear /route
196
- /history Code Quality
197
- /export [md|json|txt] Session /review [target]
198
- /exit | /quit /sessions /tdd <desc>
199
- /walkthrough | /tour /save [name] /security-review
200
- | /guide /resume <id> /audit
201
- /delete <id> /verify [cmd]
202
- /build-fix
203
- Git /test-coverage
204
- /commit /refactor [target]
205
- /pr /e2e <feature>
206
- /diff /eval <criteria>
207
- /log
208
-
209
- Planning & Docs Language Reviews Language Build Fixes
210
- /plan <task> /auto-review /ts-build-fix
211
- /update-docs /ts-review /go-build-fix
212
- /checkpoint [label] /py-review /rust-build-fix
213
- /checkpoints /go-review /java-build-fix
214
- /search-first <task> /rust-review /cpp-build-fix
215
- /docs-lookup <query> /java-review /pytorch-fix
216
- /cpp-review
217
- Tools & Config /kotlin-review
218
- /tools /php-review
219
- /rules /db-review
220
- /perm <mode>
221
- /dry-run Orchestration
222
- /thinking /orchestrate <task>
223
- /cd <path> /pr-loop
224
- /hooks /multi-plan <task>
225
- /multi-execute
226
- Learning & Cost /multi-backend
227
- /usage /multi-frontend
228
- /budget <d> <m>
229
- /learn Codemaps
230
- /instincts /codemap
231
- /instinct-export /update-codemaps
232
- /instinct-import
233
- /evolve Content Engine
234
- /skills /article <topic>
235
- /memory /slides <topic>
236
- /users /repurpose <text>
237
- /count [inc|dec|reset] /market-research
238
- /detect /investor-deck
239
- /hook-profile /investor-outreach
240
- /pm2 [action] /code-quality
241
- /skill-stocktake
242
- ECC /chief-of-staff
243
- /ecc
244
- /ecc-install Skills & Patterns
245
- /ecc-skills /skill-create
246
- /ecc-agents /git-patterns
247
- /ecc-commands /git-workflow
248
- /ecc-feature-development
249
- /ecc-add-language-rules
250
- /ecc-database-migration
251
- ```
252
-
253
- ### Modes
254
-
255
- `/mode <name>` (or shorthand commands where shown):
256
-
257
- - `dev` general coding
258
- - `review` — code review
259
- - `tdd` strict RED GREEN → REFACTOR
260
- - `research`read-only exploration
261
- - `plan` design before coding (no edits)
262
- - `debug` systematic root-cause hunt
263
- - `architect` system-level design
264
- - `hermes` (`/hermes`) — **self-improving learning loop**: recall prior memory + instincts before acting, model the user across sessions, parallelize independent subtasks, distill skills from experience, nudge to persist knowledge. Inspired by [nousresearch/hermes-agent](https://github.com/nousresearch/hermes-agent).
265
-
266
- ### Theme Modes
267
-
268
- `/theme [full|compact|minimal]`:
269
-
270
- - `full` splash screen + banner (default)
271
- - `compact` banner only
272
- - `minimal` one-liner
273
-
274
- ### Permission Modes
275
-
276
- `/perm <ask|auto|yolo>`:
277
-
278
- - `ask` prompt before writes/commands (safest)
279
- - `auto` auto-approve reads, ask for destructive
280
- - `yolo` approve everything (fastest)
281
-
282
- Type `always` when prompted to permanently switch to `auto`.
283
-
284
- ### Shell Escape
285
-
286
- Prefix any line with `!` to run a shell command directly without AI involvement:
287
-
288
- ```
289
- !ls -la
290
- !git status
291
- ```
292
-
293
- ---
294
-
295
- ## Install
296
-
297
- ```bash
298
- cd "C:\Users\rsfit\OneDrive\Desktop\Crowcoder"
299
- npm install
300
- npx tsc
301
- npm install -g .
302
- ```
303
-
304
- Then open any terminal and type `compact-agent`.
305
-
306
- ## Rebuild after edits
307
-
308
- ```bash
309
- cd "C:\Users\rsfit\OneDrive\Desktop\Crowcoder" && npx tsc && npm install -g .
310
- ```
311
-
312
- ## Environment Variables
313
-
314
- | Variable | Purpose | Default |
315
- |----------|---------|---------|
316
- | `CROWCODER_HOME` | Override config directory | `~/.crowcoder` |
317
- | `CROWCODER_HOOK_PROFILE` | Hook strictness: `minimal`, `standard`, `strict` | `standard` |
318
- | `CROWCODER_DISABLED_HOOKS` | Comma-separated hook IDs to disable | (none) |
319
- | `CROWCODER_PACKAGE_MANAGER` | Override package manager detection | (auto-detect) |
320
-
321
- ---
322
-
323
- ## everything-claude-code (ECC) integration
324
-
325
- Crowcoder ships with the full ECC library — imported from
326
- [Crownelius/everything-claude-code](https://github.com/Crownelius/everything-claude-code) — and
327
- installs it automatically on first launch. The library lives at `resources/ecc/`
328
- inside the install and is materialized into your Crowcoder data dir as:
329
-
330
- | Resource | Source | Destination | Used by |
331
- |----------|---------------------------------|-----------------------------------|----------------------------------------|
332
- | Skills | `resources/ecc/skills/*/SKILL.md` | `~/.crowcoder/skills/ecc-*.json` | `/skills`, system-prompt auto-injection |
333
- | Agents | `resources/ecc/agents/*.{json,md}` | `~/.crowcoder/ecc-agents/*.md` + `~/.crowcoder/skills/ecc-agent-*.json` | `/ecc-agents`, `/skills` |
334
- | Commands | `resources/ecc/commands/*.md` + `prompts/*.md` | `~/.crowcoder/ecc-commands/*.md` | `/ecc-<command-name>` |
335
- | Rules | `resources/ecc/rules/<lang>-*.md` | `~/.crowcoder/rules/<lang>.md` | System prompt language rules |
336
- | Hooks | Native Crowcoder ports | `~/.crowcoder/hooks.json` | PreToolUse / PostToolUse pipeline |
337
-
338
- ### ECC slash commands
339
-
340
- ECC commands are auto-injected into their built-in equivalents (e.g. `/tdd`, `/review`, `/plan` automatically use ECC prompts when ECC is installed). The following ECC-only commands have no built-in equivalent:
341
-
342
- ```
343
- /ecc — show install state + counts
344
- /ecc-install — install or refresh ECC resources (idempotent)
345
- /ecc-skills — list ECC skills
346
- /ecc-agents — list ECC agents
347
- /ecc-commands — list ECC-only commands
348
- /ecc-feature-development — feature implementation workflow
349
- /ecc-add-language-rules — add language-specific rule files
350
- /ecc-database-migration — database migration workflow
351
- ```
352
-
353
- Any `/ecc-<command-name>` dynamic dispatch is also supported for commands in `~/.crowcoder/ecc-commands/`.
354
-
355
- ### Skill auto-injection
356
-
357
- When you send a prompt that matches an ECC skill's triggers
358
- (e.g. asking about *TDD*, *bun*, *e2e testing*, *MCP servers*, *frontend slides*),
359
- the highest-scoring skill's body is auto-injected into the system prompt for
360
- that turn. Skills also appear in `/skills` so you can invoke them by trigger
361
- matching from any prompt.
362
-
363
- ### ECC hooks (security)
364
-
365
- Five native hooks are installed (auto-disabled if you remove them from
366
- `~/.crowcoder/hooks.json`):
367
-
368
- | Event | Match | Behavior |
369
- |-------------|-------------|--------------------------------------------------|
370
- | PreToolUse | `bash` | Block `git ... --no-verify` and `--no-gpg-sign` |
371
- | PreToolUse | `bash` | Remind to run dev servers under tmux (non-blocking) |
372
- | PreToolUse | `read_file` | Warn when reading `.env / .key / .pem / credentials*` |
373
- | PostToolUse | `edit_file` | Warn when an edit leaves `console.*` statements |
374
- | PostToolUse | `write_file`| Same console-statement warning on new files |
375
-
376
- All hook entries are tagged `__ecc__` so `/ecc-install` can refresh them
377
- without touching hooks you've defined yourself.
378
-
379
- ### Rebuilding bundled ECC resources
380
-
381
- The bundled `resources/ecc/` is a frozen snapshot of the upstream repo. To
382
- refresh from upstream:
383
-
384
- ```bash
385
- git -C /e/ecc-mirror/everything-claude-code pull
386
- # then re-copy: skills, agents, commands, rules, prompts
387
- # (run /ecc-install afterwards to re-import)
388
- ```
389
-
390
- ---
391
-
392
- ## License
393
-
394
- MIT
1
+
2
+ # Compact Agent
3
+
4
+ **A dense, feature-rich AI coding agent for the terminal.**
5
+
6
+ [![npm](https://img.shields.io/npm/v/compact-agent?color=cyan)](https://www.npmjs.com/package/compact-agent)
7
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![Node](https://img.shields.io/badge/Node-%E2%89%A518.0-339933?logo=nodedotjs&logoColor=white)](https://nodejs.org/)
9
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.6-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
+ [![Hermes](https://img.shields.io/badge/Mode-Hermes-purple)](https://github.com/nousresearch/hermes-agent)
11
+ [![ECC](https://img.shields.io/badge/Bundled-everything--claude--code-orange)](https://github.com/Crownelius/everything-claude-code)
12
+
13
+ Compact Agent is a single-command terminal AI coding CLI. It speaks any OpenAI-compatible API (OpenRouter, OpenAI, Anthropic via compatible endpoints, Ollama, LM Studio, DeepSeek, GLM). It ships with **80+ slash commands**, **8 operation modes** including the self-improving **Hermes** mode, the bundled **everything-claude-code** skill library, multi-agent orchestration, a cross-session learning system, and zero telemetry.
14
+
15
+ [Features](#-features) • [Modes](#-operation-modes) • [Skills](#-skills-system) • [Tools](#-tool-arsenal) • [Providers](#-supported-providers) • [Installation](#-installation) • [Commands](#-slash-commands) • [Privacy](#-privacy) • [Architecture](#-architecture)
16
+
17
+ ---
18
+
19
+ ## ✨ Features
20
+
21
+ - **Single-command install** — `npm install -g compact-agent && compact-agent`. No clone, no build step, no Docker, no IDE extension.
22
+ - **Universal LLM transport** works with any OpenAI-compatible API. Switch providers and models from inside the REPL with `/model`, `/provider`, `/route`.
23
+ - **8 operation modes** `dev`, `review`, `tdd`, `research`, `plan`, `debug`, `architect`, and `hermes` (self-improving learning loop). Each rewrites the system prompt to bias the agent toward its specific workflow.
24
+ - **Hermes self-improving mode** recalls prior sessions, models the user across conversations, parallelizes independent subtasks, distills new skills from experience, and proposes what's worth banking before finishing. Inspired by [nousresearch/hermes-agent](https://github.com/nousresearch/hermes-agent).
25
+ - **Bundled everything-claude-code library** — 33 high-quality skills, 16 agents, 9 workflow commands, 7 language rule bundles, and 5 default security hooks. Auto-installed on first launch via [Crownelius/everything-claude-code](https://github.com/Crownelius/everything-claude-code).
26
+ - **Unified slash-command surface** `/tdd`, `/review`, `/security-review`, `/plan`, `/refactor`, `/build-fix` automatically use the ECC prompts when ECC is installed. **No `/ecc-tdd` vs `/tdd` duplication.**
27
+ - **Multi-agent orchestration** — `/orchestrate`, `/multi-plan`, `/multi-execute`, `/multi-backend`, `/multi-frontend`, `/pr-loop` spawn parallel sub-tasks against the same project.
28
+ - **10 language-specific reviewers** `/auto-review` (auto-detects the language) plus dedicated reviewers for TS, Python, Go, Rust, Java, C++, Kotlin, PHP, and SQL.
29
+ - **6 language-specific build fixers** — `/ts-build-fix`, `/go-build-fix`, `/rust-build-fix`, `/java-build-fix`, `/cpp-build-fix`, `/pytorch-fix`.
30
+ - **Learning system** `/learn` extracts patterns from the current session into confidence-scored instincts. `/evolve` promotes high-confidence instincts into reusable skills. Confidence decays automatically; `/prune` removes stale patterns.
31
+ - **Cross-session memory** `~/.crowcoder/memory/` retains project context across sessions. Hermes mode searches it before answering.
32
+ - **Sessions & checkpoints** `/sessions`, `/save`, `/resume`, `/delete` for full session snapshots; `/checkpoint` for git-state snapshots inside a session.
33
+ - **Agent-led walkthrough** type `/walkthrough` (or `/tour`, `/guide`) and the agent walks new users through every feature interactively.
34
+ - **Native security hooks** by default, block `git --no-verify`, warn on reading `.env`/`.key`/`.pem`, warn when an edit leaves `console.*` statements, suggest tmux for long-running dev servers. Fully configurable in `~/.crowcoder/hooks.json`.
35
+ - **Permission modes** `/perm ask` prompts before every tool use, `/perm auto` allows non-destructive ops, `/perm yolo` approves everything. Per-tool dry-run via `/dry-run`.
36
+ - **Cost & budget tracking** `/usage`, `/budget` keep token counts and cost estimates entirely local in `~/.crowcoder/usage.json`. Cost-aware routing via `/route`.
37
+ - **Real web search** — `web_search` tool backed by DuckDuckGo Lite (no API key). The LLM gets unknown-tool errors with the valid tool list so free models that hallucinate `web_search_exa` can self-correct.
38
+ - **Google Stitch integration** `/stitch <query>` interface to [Stitch](https://stitch.withgoogle.com/), Google's AI UI/UX design tool. List projects, generate UI from text, enhance design prompts. Ports the [gemini-cli-extensions/stitch](https://github.com/gemini-cli-extensions/stitch) extension; API-key auth.
39
+ - **Zero telemetry** no analytics SDKs, no phone-home, no crash reporting. The only network calls are to your chosen LLM provider when you send a message.
40
+
41
+ ---
42
+
43
+ ## 🧠 Operation Modes
44
+
45
+ Switchable any time with `/mode <name>`. Each mode injects a specialized system-prompt addition.
46
+
47
+ ### dev*default*
48
+
49
+ General coding. Write features, fix bugs, refactor. Reads files before editing, prefers minimal changes.
50
+
51
+ ### 🔍 review
52
+
53
+ Code review with severity-rated findings (CRITICAL/HIGH/MEDIUM/LOW). Confidence-filtered: only reports issues the model is >80% sure about.
54
+
55
+ ### 🧪 tdd
56
+
57
+ Strict RED GREEN → REFACTOR cycle. Will **not** write implementation before a failing test. Lower temperature for tighter cycles.
58
+
59
+ ### 🔭 research
60
+
61
+ Read-only exploration. The agent reads code, traces execution paths, maps architecture, and reports without modifying files.
62
+
63
+ ### 📋 plan
64
+
65
+ Design before building. Produces numbered step-by-step plans with file paths, trade-offs, and risk assessment. Does **not** write code in this mode.
66
+
67
+ ### 🐛 debug
68
+
69
+ Systematic root-cause hunting. Reproduce → hypothesize → narrow → fix → verify. Never guesses — always confirms with evidence.
70
+
71
+ ### 🏛 architect
72
+
73
+ System-level design. Component boundaries, data flow, technology choices, scalability, API design, database schemas, deployment.
74
+
75
+ ### 🜲 hermes
76
+
77
+ **The agent that grows with you.** Recalls prior sessions and instincts before answering, builds a model of the user across conversations, parallelizes independent subtasks, distills skills from experience, nudges to persist knowledge at end of work, and proactively suggests scheduled follow-ups.
78
+
79
+ Activate with `/hermes` or `/mode hermes`.
80
+
81
+ ---
82
+
83
+ ## 🛠 Skills System
84
+
85
+ Skills are reusable prompt templates stored in `~/.crowcoder/skills/`. Three sources:
86
+
87
+ | Source | Stored as | Origin |
88
+ | :--- | :--- | :--- |
89
+ | **ECC bundled** | `ecc-<name>.json` | The 33 skills from [everything-claude-code](https://github.com/Crownelius/everything-claude-code), auto-installed on first launch |
90
+ | **ECC agents** | `ecc-agent-<name>.json` | 16 specialized agent prompts (code-reviewer, planner, doc-updater, etc.) |
91
+ | **Your own** | `<id>.json` | Created via `/skill-create` (distilled from git patterns) or `/evolve` (promoted from high-confidence instincts) |
92
+
93
+ When you send a message, Compact Agent auto-matches the highest-scoring skill against your query and injects its body into the system prompt for that turn. Browse with `/skills`, filter to ECC with `/ecc-skills`.
94
+
95
+ ---
96
+
97
+ ## 🔧 Tool Arsenal
98
+
99
+ The LLM has access to these tools. Each call is gated by your permission mode (`ask`/`auto`/`yolo`).
100
+
101
+ | Tool | Description | R/W |
102
+ | :--- | :--- | :---: |
103
+ | `bash` | Run a shell command. Spawns via Git Bash on Windows, `/bin/bash` elsewhere. | RW |
104
+ | `read_file` | Read a file with paging + size limits. | R |
105
+ | `write_file` | Create or overwrite a file. Auto-creates parent dirs. | W |
106
+ | `edit_file` | Find-and-replace within a file with optional `replace_all`. | W |
107
+ | `grep` | Search file contents. Uses ripgrep when available, falls back to grep. | R |
108
+ | `glob` | Find files by glob pattern (e.g. `src/**/*.ts`). | R |
109
+ | `list_dir` | List directory entries (type, size, name). | R |
110
+ | `web_fetch` | Fetch a URL and convert HTML → readable text. | R |
111
+ | `web_search` | Keyword search via DuckDuckGo Lite. Returns title/URL/snippet. No API key required. | R |
112
+ | `stitch` | Google Stitch MCP server 12 tools across Project Management, Screen Management, AI Generation (gemini-3-flash / -pro, slow), and Design Systems. Auto-registered when `/stitch-config` has saved an API key. | RW |
113
+
114
+ Unknown-tool calls are intercepted: when a free model hallucinates `web_search_exa`, `TodoWrite`, or similar, the error response lists the valid tool names so the model self-corrects on the next iteration.
115
+
116
+ ---
117
+
118
+ ## 🌐 Supported Providers
119
+
120
+ | Provider | Base URL | Notes |
121
+ | :--- | :--- | :--- |
122
+ | **OpenRouter** | `https://openrouter.ai/api/v1` | One key, hundreds of models, free tier available. Recommended for new users. |
123
+ | **OpenAI** | `https://api.openai.com/v1` | GPT-4o / o-series. |
124
+ | **Anthropic** (via OpenRouter) | `https://openrouter.ai/api/v1` | Use `anthropic/claude-sonnet-4` etc. (native Anthropic API is not OpenAI-compatible). |
125
+ | **DeepSeek** | `https://api.deepseek.com/v1` | Cheap, strong on code. |
126
+ | **GLM (ZhipuAI)** | `https://open.bigmodel.cn/api/paas/v4` | GLM family. |
127
+ | **Ollama** | `http://localhost:11434/v1` | Local models — no API key needed. |
128
+ | **LM Studio** | `http://localhost:1234/v1` | Local models — no API key needed. |
129
+ | **Custom** | you provide | Anything that speaks OpenAI Chat Completions. |
130
+
131
+ ---
132
+
133
+ ## 📦 Installation
134
+
135
+ ### Prerequisites
136
+
137
+ - [Node.js](https://nodejs.org/) **18 or newer** (tested on 18, 20, 22, 24)
138
+ - An API key from any supported provider (or use a local Ollama / LM Studio)
139
+ - A POSIX-like shell. Compact Agent spawns Git Bash for shell tools on Windows.
140
+
141
+ ### Single-command install
142
+
143
+ ```bash
144
+ npm install -g compact-agent
145
+ compact-agent
146
+ ```
147
+
148
+ First run launches the setup wizard (provider, key, model, permission mode). After that, `compact-agent` from any directory drops you into the REPL.
149
+
150
+ ### From source (development)
151
+
152
+ ```bash
153
+ git clone https://github.com/Crownelius/Crowcoder.git
154
+ cd Crowcoder
155
+ npm install
156
+ npm link
157
+ ```
158
+
159
+ Rebuild after edits: `npx tsc` (or `npm run build`). The `prepare` script also runs `tsc` automatically on `npm install`, so a clean clone produces a working `dist/` without an extra step.
160
+
161
+ ### Updating
162
+
163
+ ```bash
164
+ npm install -g compact-agent@latest
165
+ ```
166
+
167
+ ### Uninstalling
168
+
169
+ ```bash
170
+ npm uninstall -g compact-agent
171
+ rm -rf ~/.crowcoder # remove all local state (config, sessions, skills, ...)
172
+ ```
173
+
174
+ See [INSTALL.md](INSTALL.md) for the full setup walkthrough including provider-specific tips and troubleshooting.
175
+
176
+ ---
177
+
178
+ ## Slash commands
179
+
180
+ The most-used commands at a glance. See **[COMMANDS.md](COMMANDS.md)** for the complete reference (~80 commands).
181
+
182
+ | Command | Description |
183
+ | :--- | :--- |
184
+ | `/walkthrough` | Agent-led tour of every feature *(aliases: `/tour`, `/guide`)* |
185
+ | `/help` | Print the full command list |
186
+ | `/mode <name>` | Switch operation mode (dev/review/tdd/research/plan/debug/architect/hermes) |
187
+ | `/model [name]` | Switch model, or show the current one |
188
+ | `/perm <mode>` | Change permission mode (ask/auto/yolo) |
189
+ | `/tdd <feature>` | Test-driven workflow — tests first, then implementation |
190
+ | `/review [target]` | AI code review with severity ratings |
191
+ | `/orchestrate <task>` | Decompose a task and run sub-agents in parallel |
192
+ | `/skills` | List all skills (built-in, ECC bundled, learned) |
193
+ | `/learn` | Extract patterns from the current session into instincts |
194
+ | `/usage` | Show token + cost summary |
195
+ | `/audit` | Local-only project health check (no data leaves your machine) |
196
+ | `/export [md\|json\|txt]` | Save the current conversation to a file |
197
+ | `!<cmd>` | Run a shell command directly without involving the AI |
198
+ | `/exit` | Quit the REPL |
199
+
200
+ ---
201
+
202
+ ## 🔒 Privacy
203
+
204
+ **Zero telemetry, zero analytics, zero phone-home.**
205
+
206
+ | Data | Where it goes |
207
+ | :--- | :--- |
208
+ | Conversation messages | Your chosen LLM provider only (required for the model to respond) |
209
+ | Token counts, costs | `~/.crowcoder/usage.json` — local file only, never transmitted |
210
+ | Sessions | `~/.crowcoder/sessions/*.json` — local files |
211
+ | Learned instincts & skills | `~/.crowcoder/instincts/`, `~/.crowcoder/skills/` — local files |
212
+ | Memory | `~/.crowcoder/memory/` — local files |
213
+ | API keys | `~/.crowcoder/config.json` — plaintext, local only. **Protect this file.** |
214
+ | Hook execution | All hooks run locally in your shell. No external calls. |
215
+
216
+ The `web_fetch` and `web_search` tools only contact URLs the agent decides to fetch in response to your request. There is no background telemetry, no crash reporting, no auto-update beacon.
217
+
218
+ **To remove everything:** `rm -rf ~/.crowcoder`.
219
+
220
+ ---
221
+
222
+ ## 🪝 Default Hooks
223
+
224
+ Five hooks ship by default via the bundled everything-claude-code library. Configured in `~/.crowcoder/hooks.json` — disable any you don't want.
225
+
226
+ | Event | Match | Behavior |
227
+ | :--- | :--- | :--- |
228
+ | `PreToolUse` | `bash` | **Block** `git ... --no-verify` and `--no-gpg-sign` — they skip pre-commit hooks |
229
+ | `PreToolUse` | `bash` | Warn (non-blocking) when running a dev server outside tmux on POSIX |
230
+ | `PreToolUse` | `read_file` | Warn when reading `.env`, `.key`, `.pem`, or paths containing `credentials`/`secrets`/`id_rsa` |
231
+ | `PostToolUse` | `edit_file` | Warn when an edit leaves `console.log`/`console.warn`/`console.error` statements in `.ts`/`.js` files |
232
+ | `PostToolUse` | `write_file` | Same console-statement warning on new files |
233
+
234
+ Set `CROWCODER_HOOK_PROFILE=minimal` to silence all but the blocking ones. Set `=strict` to enable additional reminders (tmux prompts, git-push warnings). Write your own hooks by adding entries to `hooks.json` with `event`, `match`, `command`, `blocking`, `timeout`, `enabled`.
235
+
236
+ ---
237
+
238
+ ## 🏛 Architecture
239
+
240
+ ```
241
+ src/
242
+ ├── index.ts # REPL main loop + ~80 slash-command dispatcher
243
+ ├── api.ts # OpenAI-compatible client (streaming, retries, 429-aware)
244
+ ├── query.ts # Tool-call loop: stream chat → exec tools → feed back results
245
+ ├── system-prompt.ts # System prompt assembly (env + mode + rules + ECC skill)
246
+ ├── config.ts # ~/.crowcoder/config.json (CROWCODER_HOME-aware)
247
+ ├── modes.ts # 8 operation modes — dev/review/tdd/research/plan/debug/architect/hermes
248
+ ├── walkthrough.ts # /walkthrough — agent-led tour prompt
249
+ ├── ecc.ts # everything-claude-code installer + skill/agent/command loader
250
+ ├── stitch.ts # Google Stitch integration (MCP JSON-RPC client + prompt builder)
251
+ ├── tools/ # 9 tools — each implements { name, parameters, call(input, cwd) }
252
+ │ ├── bash.ts # Shell exec with timeout, 10 MB buffer
253
+ │ ├── read.ts # Paged file read with size limit
254
+ │ ├── write.ts # File creation/overwrite, auto mkdir
255
+ │ ├── edit.ts # Find/replace with optional replace_all
256
+ │ ├── grep.ts # ripgrep with grep fallback
257
+ │ ├── glob.ts # File pattern matching
258
+ │ ├── list-dir.ts # Directory listing
259
+ │ ├── web-fetch.ts # URL fetch + HTMLtext
260
+ │ ├── web-search.ts # DuckDuckGo Lite no API key
261
+ │ ├── stitch.ts # Google Stitch MCP wrapper (opt-in via /stitch-config)
262
+ │ └── index.ts # ALL_TOOLS registry (stitch only listed when configured)
263
+ ├── hooks.ts # PreToolUse / PostToolUse / SessionStart / SessionStop dispatcher
264
+ ├── hook-controls.ts # Hook profile system (minimal/standard/strict)
265
+ ├── permissions.ts # ask/auto/yolo gating per tool
266
+ ├── security.ts # Dangerous-command + secret-write scanner
267
+ ├── sessions.ts # ~/.crowcoder/sessions/*.json — save/load/resume
268
+ ├── memory.ts # Cross-session project memory
269
+ ├── learning.ts # Instincts: pattern extraction, confidence decay, pruning
270
+ ├── skills.ts # Skill JSON store + trigger-based auto-injection
271
+ ├── skill-create.ts # Distill new skills from git history patterns
272
+ ├── orchestration.ts # /orchestrate + /multi-* parallel sub-agent prompts
273
+ ├── autonomous-loops.ts # /pr-loop + multi-plan/multi-execute prompts
274
+ ├── search-first.ts # /search-first /docs-lookup research-before-code prompts
275
+ ├── modes.ts, codemaps.ts, compaction.ts, strategic-compaction.ts
276
+ ├── verification.ts # /verify /test-coverage prompts + checkpoint helpers
277
+ ├── refactor.ts # /refactor /refactor-clean prompts
278
+ ├── evaluation.ts # /review /tdd /security-review /audit /plan prompts
279
+ ├── content-engine.ts # /article /slides /investor-deck /chief-of-staff prompts
280
+ ├── git-workflow.ts # /commit /pr /diff /log + branch helpers
281
+ ├── agents.ts # 10 language-specific review + build-fix prompt builders
282
+ ├── cost-tracker.ts # ~/.crowcoder/usage.json token counts, cost estimates
283
+ ├── model-router.ts # /route — complexity-based model switching
284
+ ├── docs-sync.ts # /update-docs + project language detection
285
+ ├── package-detect.ts # /detect — package manager / test runner / build tool
286
+ ├── rules.ts # Language-specific coding rules (loaded into system prompt)
287
+ ├── pm2-manager.ts # /pm2 wrapper
288
+ ├── theme.ts # TUI colors + splash + banner + tool-call rendering
289
+ ├── retry.ts # API call retry with backoff
290
+ ├── export.ts # /export md/json/txt
291
+ ├── html-parser.ts # HTML→text for web_fetch
292
+ └── types.ts # CrowcoderConfig, Message, Session, Mode types
293
+
294
+ bin/
295
+ └── crowcoder.js # CLI entry — DEP0040 suppress + dynamic import dist/index.js
296
+
297
+ resources/
298
+ └── ecc/ # Bundled everything-claude-code library
299
+ ├── skills/ # 33 SKILL.md files (one per skill)
300
+ ├── agents/ # 16 kiro agent JSON+MD pairs
301
+ ├── commands/ # 9 workflow command prompts
302
+ ├── rules/ # 39 language-specific rule files
303
+ └── prompts/ # 6 GitHub prompt files
304
+
305
+ tests/
306
+ ├── smoke-commands.mjs # 88-command dispatch smoke test (no LLM calls)
307
+ ├── llm-drive-all.mjs # End-to-end LLM driver against a real API
308
+ ├── users.test.ts # Vitest unit tests
309
+ └── e2e/ # Playwright E2E
310
+ ```
311
+
312
+ ---
313
+
314
+ ## 🤝 Contributing
315
+
316
+ PRs welcome. Please:
317
+
318
+ - Strict TypeScript avoid `any`
319
+ - Focused PRs one thing per PR
320
+ - Conventional Commits (`feat:`, `fix:`, `chore:`, `docs:`)
321
+ - Never commit API keys, tokens, or paths containing your username
322
+ - Run `node tests/smoke-commands.mjs` before submitting — must report `88/88 pass`
323
+
324
+ For larger features (new mode, new tool, new orchestration pattern), open an issue first to discuss the design.
325
+
326
+ ---
327
+
328
+ ## 📜 License
329
+
330
+ Distributed under the **[MIT License](LICENSE)**.
331
+
332
+ Crowcoder bundles content from these projects, each under their own license:
333
+ - [everything-claude-code](https://github.com/Crownelius/everything-claude-code) agent harness library
334
+ - [nousresearch/hermes-agent](https://github.com/nousresearch/hermes-agent) Hermes mode inspiration
335
+
336
+ ---
337
+
338
+ <div align="center">
339
+
340
+ **Compact Agent** Built to fit a lot of intelligence in a small command.
341
+
342
+ [Bug reports](https://github.com/Crownelius/Crowcoder/issues) • [Install guide](INSTALL.md) • [Command reference](COMMANDS.md) • [npm](https://www.npmjs.com/package/compact-agent)
343
+
344
+ </div>