compact-agent 1.24.2 → 1.25.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,352 +1,194 @@
1
+ # compact-agent
1
2
 
2
- # Compact Agent
3
-
4
- **A dense, feature-rich AI coding agent for the terminal.**
3
+ A terminal AI coding CLI for any OpenAI-compatible API.
5
4
 
6
5
  [![npm](https://img.shields.io/npm/v/compact-agent?color=cyan)](https://www.npmjs.com/package/compact-agent)
7
6
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
7
  [![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
- - **9 operation modes** — `dev`, `review`, `tdd`, `research`, `plan`, `debug`, `architect`, `hermes` (self-improving learning loop), and `design` (Stitch-powered UI generation — describe what you want, the agent uses Stitch to design it and writes the result into your code). 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
8
 
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
- ### 🎨 design
82
-
83
- **UI work without thinking about UI tools.** In design mode, any visual / layout / theming request flows through Google Stitch automatically. The agent creates a Stitch project, generates the screens from a carefully composed prompt (with your aesthetic preferences translated into Stitch-style descriptors), fetches the result, writes the HTML/Tailwind into your code, and adds JS for interactivity. Iterate by just saying what to change.
84
-
85
- Example: `/design build me a stock portfolio app where I can add new stocks via a form — edgy aesthetic, lots of red, no blue or green`.
9
+ ```bash
10
+ npm install -g compact-agent
11
+ compact-agent
12
+ ```
86
13
 
87
- Activate with `/design [task]` or `/mode design`. Requires `/stitch-config` first.
14
+ First run prompts you for a provider, key, model, and permission mode. After that, `compact-agent` from any directory drops you into a REPL with a persistent bottom-anchored input box.
88
15
 
89
16
  ---
90
17
 
91
- ## 🛠 Skills System
92
-
93
- Skills are reusable prompt templates stored in `~/.crowcoder/skills/`. Three sources:
18
+ ## What it does
94
19
 
95
- | Source | Stored as | Origin |
96
- | :--- | :--- | :--- |
97
- | **ECC bundled** | `ecc-<name>.json` | The 33 skills from [everything-claude-code](https://github.com/Crownelius/everything-claude-code), auto-installed on first launch |
98
- | **ECC agents** | `ecc-agent-<name>.json` | 16 specialized agent prompts (code-reviewer, planner, doc-updater, etc.) |
99
- | **Your own** | `<id>.json` | Created via `/skill-create` (distilled from git patterns) or `/evolve` (promoted from high-confidence instincts) |
100
-
101
- 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`.
20
+ - Speaks any OpenAI-compatible Chat Completions endpoint. OpenRouter, OpenAI, NVIDIA, DeepSeek, GLM, Ollama, LM Studio, or anything custom.
21
+ - Tool-call loop with `bash`, `read_file`, `write_file`, `edit_file`, `apply_patch`, `grep`, `glob`, `list_dir`, `web_search`, `web_fetch`, plus optional `stitch` (Google's UI generator) when configured.
22
+ - Permission gating: `/perm ask` prompts every tool call, `/perm auto` lets read-only and safe writes through, `/perm yolo` runs everything.
23
+ - Optional OS sandbox: `/sandbox standard` uses `sandbox-exec` (macOS) or `bwrap` (Linux) when available. No-op on Windows.
24
+ - Multi-key rotation pool: add several provider keys via `/keys add`. The agent round-robins and cools down keys that hit 429 / quota / auth errors so the others keep working.
25
+ - Parallel agent swarm: `/swarm <agent,agent,...> <task>` fans out N specialized ECC agents against the same prompt and prints attributed results.
26
+ - Bundled [everything-claude-code](https://github.com/Crownelius/everything-claude-code): 228 skills, 60 agents, 75 workflow commands, 19 language rule bundles. Auto-installed on first launch; refresh with `/ecc-install`.
27
+ - 9 modes (`/mode <name>`): `dev`, `review`, `tdd`, `research`, `plan`, `debug`, `architect`, `hermes`, `design`. Each rewrites the system-prompt addendum.
28
+ - Optional voice: Whisper dictation (push-to-talk `F5`) and ElevenLabs TTS readout. Screen-reader mode for blind / low-vision users. All off by default — opt in with `/voice on`.
29
+ - Zero telemetry. The only outbound traffic is to your chosen LLM provider when you send a turn.
102
30
 
103
31
  ---
104
32
 
105
- ## 🔧 Tool Arsenal
106
-
107
- The LLM has access to these tools. Each call is gated by your permission mode (`ask`/`auto`/`yolo`).
33
+ ## Modes
108
34
 
109
- | Tool | Description | R/W |
110
- | :--- | :--- | :---: |
111
- | `bash` | Run a shell command. Spawns via Git Bash on Windows, `/bin/bash` elsewhere. | RW |
112
- | `read_file` | Read a file with paging + size limits. | R |
113
- | `write_file` | Create or overwrite a file. Auto-creates parent dirs. | W |
114
- | `edit_file` | Find-and-replace within a file with optional `replace_all`. | W |
115
- | `grep` | Search file contents. Uses ripgrep when available, falls back to grep. | R |
116
- | `glob` | Find files by glob pattern (e.g. `src/**/*.ts`). | R |
117
- | `list_dir` | List directory entries (type, size, name). | R |
118
- | `web_fetch` | Fetch a URL and convert HTML → readable text. | R |
119
- | `web_search` | Keyword search via DuckDuckGo Lite. Returns title/URL/snippet. No API key required. | R |
120
- | `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 |
35
+ `/mode <name>` swaps the system-prompt addendum.
121
36
 
122
- 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.
37
+ | Mode | What changes |
38
+ | :--- | :--- |
39
+ | `dev` | Default. General coding, minimal-change bias, reads before edits. |
40
+ | `review` | Severity-rated findings (CRITICAL / HIGH / MEDIUM / LOW). Confidence filter — only reports issues it's >80% sure about. |
41
+ | `tdd` | RED → GREEN → REFACTOR. Refuses to write implementation before a failing test. |
42
+ | `research` | Read-only. Maps architecture, traces paths, never modifies files. |
43
+ | `plan` | Numbered step-by-step plans with paths and trade-offs. No code. |
44
+ | `debug` | Reproduce → hypothesize → narrow → fix → verify. Refuses to guess. |
45
+ | `architect` | Component boundaries, data flow, scalability, schemas, deployment. |
46
+ | `hermes` | Recalls prior sessions, parallelizes independent subtasks, distills new skills from experience, suggests what's worth banking. |
47
+ | `design` | UI requests flow through Google Stitch automatically. Requires `/stitch-config`. |
123
48
 
124
49
  ---
125
50
 
126
- ## 🌐 Supported Providers
51
+ ## Providers
127
52
 
128
53
  | Provider | Base URL | Notes |
129
54
  | :--- | :--- | :--- |
130
- | **OpenRouter** | `https://openrouter.ai/api/v1` | One key, hundreds of models, free tier available. Recommended for new users. |
131
- | **OpenAI** | `https://api.openai.com/v1` | GPT-4o / o-series. |
132
- | **Anthropic** (via OpenRouter) | `https://openrouter.ai/api/v1` | Use `anthropic/claude-sonnet-4` etc. (native Anthropic API is not OpenAI-compatible). |
133
- | **DeepSeek** | `https://api.deepseek.com/v1` | Cheap, strong on code. |
134
- | **GLM (ZhipuAI)** | `https://open.bigmodel.cn/api/paas/v4` | GLM family. |
135
- | **Ollama** | `http://localhost:11434/v1` | Local models — no API key needed. |
136
- | **LM Studio** | `http://localhost:1234/v1` | Local models — no API key needed. |
137
- | **Custom** | you provide | Anything that speaks OpenAI Chat Completions. |
55
+ | OpenRouter | `https://openrouter.ai/api/v1` | One key, hundreds of models, free tier. Recommended default. |
56
+ | OpenAI | `https://api.openai.com/v1` | GPT-4o, o-series. |
57
+ | NVIDIA | `https://integrate.api.nvidia.com/v1` | NIM-hosted Llama, Mistral, DeepSeek, etc. Free tier with rate limits. |
58
+ | DeepSeek | `https://api.deepseek.com/v1` | Cheap, strong on code. |
59
+ | GLM (ZhipuAI) | `https://open.bigmodel.cn/api/paas/v4` | GLM family. |
60
+ | Ollama | `http://localhost:11434/v1` | Local. No key. |
61
+ | LM Studio | `http://localhost:1234/v1` | Local. No key. |
62
+ | Custom | you provide | Anything that speaks OpenAI Chat Completions. |
138
63
 
139
- ---
64
+ Anthropic models reach you via OpenRouter (`anthropic/claude-sonnet-4` etc.) — the native Anthropic API isn't OpenAI-compatible.
140
65
 
141
- ## 📦 Installation
142
-
143
- ### Prerequisites
66
+ ---
144
67
 
145
- - [Node.js](https://nodejs.org/) **18 or newer** (tested on 18, 20, 22, 24)
146
- - An API key from any supported provider (or use a local Ollama / LM Studio)
147
- - A POSIX-like shell. Compact Agent spawns Git Bash for shell tools on Windows.
68
+ ## Key rotation
148
69
 
149
- ### Single-command install
70
+ If you have multiple keys for the same provider (e.g. several free OpenRouter accounts), add them to a pool. The agent round-robins through them and cools off any key that hits 429, quota, or auth errors.
150
71
 
151
- ```bash
152
- npm install -g compact-agent
153
- compact-agent
154
72
  ```
155
-
156
- First run launches the setup wizard (provider, key, model, permission mode). After that, `compact-agent` from any directory drops you into the REPL.
157
-
158
- ### From source (development)
159
-
160
- ```bash
161
- git clone https://github.com/Crownelius/Crowcoder.git
162
- cd Crowcoder
163
- npm install
164
- npm link
73
+ /keys add sk-or-v1-…
74
+ /keys add sk-or-v1-…
75
+ /keys status
165
76
  ```
166
77
 
167
- 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.
78
+ Cool-down policy: 60s for rate-limit (`429`, `rate.?limit`), 1h for quota / auth / 403. 404 model-not-found and 5xx server errors are NOT treated as key problems — they're surfaced upward without burning a key.
168
79
 
169
- ### Updating
80
+ ---
170
81
 
171
- ```bash
172
- npm install -g compact-agent@latest
173
- ```
82
+ ## Swarming
174
83
 
175
- ### Uninstalling
84
+ Fan out the same task to N specialized agents in parallel.
176
85
 
177
- ```bash
178
- npm uninstall -g compact-agent
179
- rm -rf ~/.crowcoder # remove all local state (config, sessions, skills, ...)
86
+ ```
87
+ > /swarm code-architect,silent-failure-hunter,type-design-analyzer audit the auth flow
88
+
89
+ ══════════════════════════════════════════════
90
+ code-architect (12.4s)
91
+ ──────────────────────────────────────────────
92
+
93
+ ══════════════════════════════════════════════
94
+ silent-failure-hunter (9.1s)
95
+ ──────────────────────────────────────────────
96
+
180
97
  ```
181
98
 
182
- See [INSTALL.md](INSTALL.md) for the full setup walkthrough including provider-specific tips and troubleshooting.
99
+ Agents are pulled from the bundled ECC harness. Each runs against an empty tool list (analysis only — no edits or shell). Failures in one don't kill the others (`Promise.allSettled`). Cost = N model calls.
183
100
 
184
101
  ---
185
102
 
186
- ## Slash commands
103
+ ## Slash commands
187
104
 
188
- The most-used commands at a glance. See **[COMMANDS.md](COMMANDS.md)** for the complete reference (~80 commands).
105
+ 130+ commands. The common ones:
189
106
 
190
- | Command | Description |
107
+ | Command | What it does |
191
108
  | :--- | :--- |
192
- | `/walkthrough` | Agent-led tour of every feature *(aliases: `/tour`, `/guide`)* |
193
- | `/help` | Print the full command list |
194
- | `/mode <name>` | Switch operation mode (dev/review/tdd/research/plan/debug/architect/hermes) |
195
- | `/model [name]` | Switch model, or show the current one |
196
- | `/perm <mode>` | Change permission mode (ask/auto/yolo) |
197
- | `/tdd <feature>` | Test-driven workflow tests first, then implementation |
198
- | `/review [target]` | AI code review with severity ratings |
199
- | `/orchestrate <task>` | Decompose a task and run sub-agents in parallel |
200
- | `/skills` | List all skills (built-in, ECC bundled, learned) |
201
- | `/learn` | Extract patterns from the current session into instincts |
202
- | `/usage` | Show token + cost summary |
203
- | `/audit` | Local-only project health check (no data leaves your machine) |
204
- | `/export [md\|json\|txt]` | Save the current conversation to a file |
205
- | `!<cmd>` | Run a shell command directly without involving the AI |
206
- | `/exit` | Quit the REPL |
109
+ | `/walkthrough` | Agent-led tour. Aliases: `/tour`, `/guide`. |
110
+ | `/help` | Full command list. |
111
+ | `/mode <name>` | Switch mode. |
112
+ | `/model [name]` | Show or switch model. |
113
+ | `/perm ask\|auto\|yolo` | Change permission mode. |
114
+ | `/sandbox off\|standard\|strict` | OS sandbox level (macOS / Linux only). |
115
+ | `/keys add\|remove\|status\|clear` | Manage the key-rotation pool. |
116
+ | `/swarm <agents> <task>` | Parallel multi-agent fan-out. |
117
+ | `/tdd <feature>` | TDD workflow failing test first. |
118
+ | `/review [target]` | Severity-rated code review. |
119
+ | `/audit` | Local project health check. Nothing leaves your machine. |
120
+ | `/orchestrate <task>` | Decompose, run sub-agents in parallel. |
121
+ | `/skills`, `/ecc-guide`, `/skill-show <name>` | Browse the bundled skill library. |
122
+ | `/learn`, `/evolve`, `/prune` | Cross-session learning system. |
123
+ | `/memory` | MemPalace-backed persistent memory (rooms, drawers, KG triples). |
124
+ | `/usage`, `/budget` | Local token and cost ledger. |
125
+ | `/voice on\|off\|config` | Toggle dictation + TTS. |
126
+ | `/accessibility screenReader on` | Screen-reader-friendly output. |
127
+ | `/sessions`, `/save`, `/resume` | Full session snapshots. |
128
+ | `/checkpoint` | Git-state snapshot inside a session. |
129
+ | `/export md\|json\|txt` | Save the conversation. |
130
+ | `!<cmd>` | Run a shell command without involving the LLM. |
131
+ | `/exit` | Quit. |
132
+
133
+ See **[COMMANDS.md](COMMANDS.md)** for the full reference.
207
134
 
208
135
  ---
209
136
 
210
- ## 🔒 Privacy
211
-
212
- **Zero telemetry, zero analytics, zero phone-home.**
137
+ ## Permissions and safety
213
138
 
214
- | Data | Where it goes |
139
+ | Mode | Behavior |
215
140
  | :--- | :--- |
216
- | Conversation messages | Your chosen LLM provider only (required for the model to respond) |
217
- | Token counts, costs | `~/.crowcoder/usage.json` local file only, never transmitted |
218
- | Sessions | `~/.crowcoder/sessions/*.json` local files |
219
- | Learned instincts & skills | `~/.crowcoder/instincts/`, `~/.crowcoder/skills/` — local files |
220
- | Memory | `~/.crowcoder/memory/` — local files |
221
- | API keys | `~/.crowcoder/config.json` — plaintext, local only. **Protect this file.** |
222
- | Hook execution | All hooks run locally in your shell. No external calls. |
141
+ | `ask` | Prompts before each tool call. Default. |
142
+ | `auto` | Reads and safe writes go through. Bash + destructive ops still prompt. |
143
+ | `yolo` | Approves everything. Use with caution. |
223
144
 
224
- 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.
225
-
226
- **To remove everything:** `rm -rf ~/.crowcoder`.
145
+ A separate execpolicy gate intercepts dangerous bash patterns (`rm -rf`, `git ... --no-verify`, secret scanners) before they reach the shell independent of the permission mode. Five default hooks (configurable in `~/.compact-agent/hooks.json`) cover console-leftover warnings, `.env` reads, missing tmux for dev servers, and a hard block on `--no-verify`.
227
146
 
228
147
  ---
229
148
 
230
- ## 🪝 Default Hooks
231
-
232
- Five hooks ship by default via the bundled everything-claude-code library. Configured in `~/.crowcoder/hooks.json` — disable any you don't want.
149
+ ## Privacy
233
150
 
234
- | Event | Match | Behavior |
235
- | :--- | :--- | :--- |
236
- | `PreToolUse` | `bash` | **Block** `git ... --no-verify` and `--no-gpg-sign` they skip pre-commit hooks |
237
- | `PreToolUse` | `bash` | Warn (non-blocking) when running a dev server outside tmux on POSIX |
238
- | `PreToolUse` | `read_file` | Warn when reading `.env`, `.key`, `.pem`, or paths containing `credentials`/`secrets`/`id_rsa` |
239
- | `PostToolUse` | `edit_file` | Warn when an edit leaves `console.log`/`console.warn`/`console.error` statements in `.ts`/`.js` files |
240
- | `PostToolUse` | `write_file` | Same console-statement warning on new files |
151
+ | Data | Where it lives |
152
+ | :--- | :--- |
153
+ | Conversation messages | Your chosen provider onlyrequired for inference. |
154
+ | Token counts, costs | `~/.compact-agent/usage.json`. Local. |
155
+ | Sessions, skills, instincts, memory | `~/.compact-agent/`. Local. |
156
+ | API keys | `~/.compact-agent/config.json`. Plaintext, local. Protect this file. |
157
+ | Hooks | Run locally in your shell. No outbound calls. |
241
158
 
242
- 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`.
159
+ No analytics SDKs, no crash reporting, no auto-update beacon. `rm -rf ~/.compact-agent` removes everything.
243
160
 
244
161
  ---
245
162
 
246
- ## 🏛 Architecture
163
+ ## From source
247
164
 
165
+ ```bash
166
+ git clone https://github.com/Crownelius/compact-agent.git
167
+ cd compact-agent
168
+ npm install
169
+ npm link
248
170
  ```
249
- src/
250
- ├── index.ts # REPL main loop + ~80 slash-command dispatcher
251
- ├── api.ts # OpenAI-compatible client (streaming, retries, 429-aware)
252
- ├── query.ts # Tool-call loop: stream chat → exec tools → feed back results
253
- ├── system-prompt.ts # System prompt assembly (env + mode + rules + ECC skill)
254
- ├── config.ts # ~/.crowcoder/config.json (CROWCODER_HOME-aware)
255
- ├── modes.ts # 8 operation modes — dev/review/tdd/research/plan/debug/architect/hermes
256
- ├── walkthrough.ts # /walkthrough — agent-led tour prompt
257
- ├── ecc.ts # everything-claude-code installer + skill/agent/command loader
258
- ├── stitch.ts # Google Stitch integration (MCP JSON-RPC client + prompt builder)
259
- ├── tools/ # 9 tools — each implements { name, parameters, call(input, cwd) }
260
- │ ├── bash.ts # Shell exec with timeout, 10 MB buffer
261
- │ ├── read.ts # Paged file read with size limit
262
- │ ├── write.ts # File creation/overwrite, auto mkdir
263
- │ ├── edit.ts # Find/replace with optional replace_all
264
- │ ├── grep.ts # ripgrep with grep fallback
265
- │ ├── glob.ts # File pattern matching
266
- │ ├── list-dir.ts # Directory listing
267
- │ ├── web-fetch.ts # URL fetch + HTML→text
268
- │ ├── web-search.ts # DuckDuckGo Lite — no API key
269
- │ ├── stitch.ts # Google Stitch MCP wrapper (opt-in via /stitch-config)
270
- │ └── index.ts # ALL_TOOLS registry (stitch only listed when configured)
271
- ├── hooks.ts # PreToolUse / PostToolUse / SessionStart / SessionStop dispatcher
272
- ├── hook-controls.ts # Hook profile system (minimal/standard/strict)
273
- ├── permissions.ts # ask/auto/yolo gating per tool
274
- ├── security.ts # Dangerous-command + secret-write scanner
275
- ├── sessions.ts # ~/.crowcoder/sessions/*.json — save/load/resume
276
- ├── memory.ts # Cross-session project memory
277
- ├── learning.ts # Instincts: pattern extraction, confidence decay, pruning
278
- ├── skills.ts # Skill JSON store + trigger-based auto-injection
279
- ├── skill-create.ts # Distill new skills from git history patterns
280
- ├── orchestration.ts # /orchestrate + /multi-* parallel sub-agent prompts
281
- ├── autonomous-loops.ts # /pr-loop + multi-plan/multi-execute prompts
282
- ├── search-first.ts # /search-first /docs-lookup research-before-code prompts
283
- ├── modes.ts, codemaps.ts, compaction.ts, strategic-compaction.ts
284
- ├── verification.ts # /verify /test-coverage prompts + checkpoint helpers
285
- ├── refactor.ts # /refactor /refactor-clean prompts
286
- ├── evaluation.ts # /review /tdd /security-review /audit /plan prompts
287
- ├── content-engine.ts # /article /slides /investor-deck /chief-of-staff prompts
288
- ├── git-workflow.ts # /commit /pr /diff /log + branch helpers
289
- ├── agents.ts # 10 language-specific review + build-fix prompt builders
290
- ├── cost-tracker.ts # ~/.crowcoder/usage.json — token counts, cost estimates
291
- ├── model-router.ts # /route — complexity-based model switching
292
- ├── docs-sync.ts # /update-docs + project language detection
293
- ├── package-detect.ts # /detect — package manager / test runner / build tool
294
- ├── rules.ts # Language-specific coding rules (loaded into system prompt)
295
- ├── pm2-manager.ts # /pm2 wrapper
296
- ├── theme.ts # TUI colors + splash + banner + tool-call rendering
297
- ├── retry.ts # API call retry with backoff
298
- ├── export.ts # /export md/json/txt
299
- ├── html-parser.ts # HTML→text for web_fetch
300
- └── types.ts # CrowcoderConfig, Message, Session, Mode types
301
-
302
- bin/
303
- └── crowcoder.js # CLI entry — DEP0040 suppress + dynamic import dist/index.js
304
-
305
- resources/
306
- └── ecc/ # Bundled everything-claude-code library
307
- ├── skills/ # 33 SKILL.md files (one per skill)
308
- ├── agents/ # 16 kiro agent JSON+MD pairs
309
- ├── commands/ # 9 workflow command prompts
310
- ├── rules/ # 39 language-specific rule files
311
- └── prompts/ # 6 GitHub prompt files
312
-
313
- tests/
314
- ├── smoke-commands.mjs # 88-command dispatch smoke test (no LLM calls)
315
- ├── llm-drive-all.mjs # End-to-end LLM driver against a real API
316
- ├── users.test.ts # Vitest unit tests
317
- └── e2e/ # Playwright E2E
318
- ```
319
-
320
- ---
321
-
322
- ## 🤝 Contributing
323
-
324
- PRs welcome. Please:
325
171
 
326
- - Strict TypeScript avoid `any`
327
- - Focused PRs — one thing per PR
328
- - Conventional Commits (`feat:`, `fix:`, `chore:`, `docs:`)
329
- - Never commit API keys, tokens, or paths containing your username
330
- - Run `node tests/smoke-commands.mjs` before submitting — must report `88/88 pass`
172
+ Rebuild after edits with `npm run build` (or `npx tsc`). The `prepare` script also runs `tsc` on `npm install`, so a clean clone produces a working `dist/` without an extra step.
331
173
 
332
- For larger features (new mode, new tool, new orchestration pattern), open an issue first to discuss the design.
174
+ Update: `npm install -g compact-agent@latest`. Uninstall: `npm uninstall -g compact-agent && rm -rf ~/.compact-agent`.
333
175
 
334
176
  ---
335
177
 
336
- ## 📜 License
178
+ ## Contributing
337
179
 
338
- Distributed under the **[MIT License](LICENSE)**.
180
+ PRs welcome. Strict TypeScript (avoid `any`), one thing per PR, Conventional Commits, no API keys in diffs. Run `node tests/smoke-commands.mjs` before submitting.
339
181
 
340
- Crowcoder bundles content from these projects, each under their own license:
341
- - [everything-claude-code](https://github.com/Crownelius/everything-claude-code) — agent harness library
342
- - [nousresearch/hermes-agent](https://github.com/nousresearch/hermes-agent) — Hermes mode inspiration
182
+ For larger features (new mode, new tool, new orchestration pattern), open an issue first.
343
183
 
344
184
  ---
345
185
 
346
- <div align="center">
186
+ ## License
347
187
 
348
- **Compact Agent** — Built to fit a lot of intelligence in a small command.
188
+ [MIT](LICENSE).
349
189
 
350
- [Bug reports](https://github.com/Crownelius/Crowcoder/issues) • [Install guide](INSTALL.md) • [Command reference](COMMANDS.md) • [npm](https://www.npmjs.com/package/compact-agent)
190
+ Bundles content from:
191
+ - [everything-claude-code](https://github.com/Crownelius/everything-claude-code) — skill / agent / hook harness
192
+ - [nousresearch/hermes-agent](https://github.com/nousresearch/hermes-agent) — Hermes mode reference
351
193
 
352
- </div>
194
+ [Bug reports](https://github.com/Crownelius/compact-agent/issues) · [Install guide](INSTALL.md) · [Commands](COMMANDS.md) · [npm](https://www.npmjs.com/package/compact-agent)