compact-agent 1.1.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 +394 -0
- package/bin/anycode.js +2 -0
- package/bin/crowcoder.js +19 -0
- package/bin/ecc-hooks.cjs +138 -0
- package/dist/agents.d.ts +17 -0
- package/dist/agents.js +1603 -0
- package/dist/agents.js.map +1 -0
- package/dist/api.d.ts +16 -0
- package/dist/api.js +115 -0
- package/dist/api.js.map +1 -0
- package/dist/autonomous-loops.d.ts +108 -0
- package/dist/autonomous-loops.js +526 -0
- package/dist/autonomous-loops.js.map +1 -0
- package/dist/codemaps.d.ts +53 -0
- package/dist/codemaps.js +325 -0
- package/dist/codemaps.js.map +1 -0
- package/dist/compaction.d.ts +30 -0
- package/dist/compaction.js +125 -0
- package/dist/compaction.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +79 -0
- package/dist/config.js.map +1 -0
- package/dist/content-engine.d.ts +97 -0
- package/dist/content-engine.js +721 -0
- package/dist/content-engine.js.map +1 -0
- package/dist/cost-tracker.d.ts +49 -0
- package/dist/cost-tracker.js +150 -0
- package/dist/cost-tracker.js.map +1 -0
- package/dist/counter-button.d.ts +35 -0
- package/dist/counter-button.js +48 -0
- package/dist/counter-button.js.map +1 -0
- package/dist/counter.d.ts +21 -0
- package/dist/counter.js +31 -0
- package/dist/counter.js.map +1 -0
- package/dist/coverage.d.ts +23 -0
- package/dist/coverage.js +215 -0
- package/dist/coverage.js.map +1 -0
- package/dist/docs-sync.d.ts +23 -0
- package/dist/docs-sync.js +266 -0
- package/dist/docs-sync.js.map +1 -0
- package/dist/ecc.d.ts +41 -0
- package/dist/ecc.js +644 -0
- package/dist/ecc.js.map +1 -0
- package/dist/evaluation.d.ts +24 -0
- package/dist/evaluation.js +412 -0
- package/dist/evaluation.js.map +1 -0
- package/dist/export.d.ts +22 -0
- package/dist/export.js +109 -0
- package/dist/export.js.map +1 -0
- package/dist/git-workflow.d.ts +22 -0
- package/dist/git-workflow.js +197 -0
- package/dist/git-workflow.js.map +1 -0
- package/dist/hook-controls.d.ts +34 -0
- package/dist/hook-controls.js +90 -0
- package/dist/hook-controls.js.map +1 -0
- package/dist/hooks.d.ts +30 -0
- package/dist/hooks.js +130 -0
- package/dist/hooks.js.map +1 -0
- package/dist/html-parser.d.ts +18 -0
- package/dist/html-parser.js +101 -0
- package/dist/html-parser.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1230 -0
- package/dist/index.js.map +1 -0
- package/dist/learning.d.ts +35 -0
- package/dist/learning.js +238 -0
- package/dist/learning.js.map +1 -0
- package/dist/login.d.ts +37 -0
- package/dist/login.js +191 -0
- package/dist/login.js.map +1 -0
- package/dist/memory.d.ts +39 -0
- package/dist/memory.js +183 -0
- package/dist/memory.js.map +1 -0
- package/dist/model-router.d.ts +23 -0
- package/dist/model-router.js +145 -0
- package/dist/model-router.js.map +1 -0
- package/dist/modes.d.ts +17 -0
- package/dist/modes.js +217 -0
- package/dist/modes.js.map +1 -0
- package/dist/orchestration.d.ts +37 -0
- package/dist/orchestration.js +139 -0
- package/dist/orchestration.js.map +1 -0
- package/dist/package-detect.d.ts +36 -0
- package/dist/package-detect.js +529 -0
- package/dist/package-detect.js.map +1 -0
- package/dist/permissions.d.ts +25 -0
- package/dist/permissions.js +50 -0
- package/dist/permissions.js.map +1 -0
- package/dist/pm2-manager.d.ts +40 -0
- package/dist/pm2-manager.js +127 -0
- package/dist/pm2-manager.js.map +1 -0
- package/dist/query.d.ts +15 -0
- package/dist/query.js +278 -0
- package/dist/query.js.map +1 -0
- package/dist/refactor.d.ts +22 -0
- package/dist/refactor.js +226 -0
- package/dist/refactor.js.map +1 -0
- package/dist/retry.d.ts +20 -0
- package/dist/retry.js +88 -0
- package/dist/retry.js.map +1 -0
- package/dist/rules.d.ts +34 -0
- package/dist/rules.js +942 -0
- package/dist/rules.js.map +1 -0
- package/dist/schema.d.ts +23 -0
- package/dist/schema.js +12 -0
- package/dist/schema.js.map +1 -0
- package/dist/search-first.d.ts +17 -0
- package/dist/search-first.js +301 -0
- package/dist/search-first.js.map +1 -0
- package/dist/security.d.ts +10 -0
- package/dist/security.js +145 -0
- package/dist/security.js.map +1 -0
- package/dist/sessions.d.ts +21 -0
- package/dist/sessions.js +112 -0
- package/dist/sessions.js.map +1 -0
- package/dist/skill-create.d.ts +38 -0
- package/dist/skill-create.js +389 -0
- package/dist/skill-create.js.map +1 -0
- package/dist/skills.d.ts +34 -0
- package/dist/skills.js +161 -0
- package/dist/skills.js.map +1 -0
- package/dist/strategic-compaction.d.ts +24 -0
- package/dist/strategic-compaction.js +144 -0
- package/dist/strategic-compaction.js.map +1 -0
- package/dist/system-prompt.d.ts +3 -0
- package/dist/system-prompt.js +101 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/theme.d.ts +60 -0
- package/dist/theme.js +220 -0
- package/dist/theme.js.map +1 -0
- package/dist/tools/bash.d.ts +2 -0
- package/dist/tools/bash.js +49 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.js +76 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/glob.d.ts +2 -0
- package/dist/tools/glob.js +54 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/grep.d.ts +2 -0
- package/dist/tools/grep.js +64 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.js +27 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-dir.d.ts +2 -0
- package/dist/tools/list-dir.js +51 -0
- package/dist/tools/list-dir.js.map +1 -0
- package/dist/tools/read.d.ts +2 -0
- package/dist/tools/read.js +56 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/types.d.ts +45 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +2 -0
- package/dist/tools/web-fetch.js +41 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/web-search.d.ts +27 -0
- package/dist/tools/web-search.js +139 -0
- package/dist/tools/web-search.js.map +1 -0
- package/dist/tools/write.d.ts +2 -0
- package/dist/tools/write.js +36 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.js +57 -0
- package/dist/types.js.map +1 -0
- package/dist/users.d.ts +51 -0
- package/dist/users.js +193 -0
- package/dist/users.js.map +1 -0
- package/dist/verification.d.ts +73 -0
- package/dist/verification.js +269 -0
- package/dist/verification.js.map +1 -0
- package/dist/walkthrough.d.ts +10 -0
- package/dist/walkthrough.js +121 -0
- package/dist/walkthrough.js.map +1 -0
- package/package.json +58 -0
- package/resources/ecc/agents/architect.json +16 -0
- package/resources/ecc/agents/architect.md +212 -0
- package/resources/ecc/agents/build-error-resolver.json +17 -0
- package/resources/ecc/agents/build-error-resolver.md +116 -0
- package/resources/ecc/agents/chief-of-staff.json +17 -0
- package/resources/ecc/agents/chief-of-staff.md +153 -0
- package/resources/ecc/agents/code-reviewer.json +16 -0
- package/resources/ecc/agents/code-reviewer.md +238 -0
- package/resources/ecc/agents/database-reviewer.json +16 -0
- package/resources/ecc/agents/database-reviewer.md +92 -0
- package/resources/ecc/agents/doc-updater.json +16 -0
- package/resources/ecc/agents/doc-updater.md +108 -0
- package/resources/ecc/agents/e2e-runner.json +17 -0
- package/resources/ecc/agents/e2e-runner.md +109 -0
- package/resources/ecc/agents/go-build-resolver.json +17 -0
- package/resources/ecc/agents/go-build-resolver.md +96 -0
- package/resources/ecc/agents/go-reviewer.json +16 -0
- package/resources/ecc/agents/go-reviewer.md +77 -0
- package/resources/ecc/agents/harness-optimizer.json +15 -0
- package/resources/ecc/agents/harness-optimizer.md +34 -0
- package/resources/ecc/agents/loop-operator.json +16 -0
- package/resources/ecc/agents/loop-operator.md +36 -0
- package/resources/ecc/agents/planner.json +15 -0
- package/resources/ecc/agents/planner.md +212 -0
- package/resources/ecc/agents/python-reviewer.json +16 -0
- package/resources/ecc/agents/python-reviewer.md +99 -0
- package/resources/ecc/agents/refactor-cleaner.json +17 -0
- package/resources/ecc/agents/refactor-cleaner.md +87 -0
- package/resources/ecc/agents/security-reviewer.json +16 -0
- package/resources/ecc/agents/security-reviewer.md +109 -0
- package/resources/ecc/agents/tdd-guide.json +17 -0
- package/resources/ecc/agents/tdd-guide.md +93 -0
- package/resources/ecc/commands/add-language-rules.md +39 -0
- package/resources/ecc/commands/database-migration.md +36 -0
- package/resources/ecc/commands/feature-development.md +38 -0
- package/resources/ecc/prompts/build-fix.prompt.md +47 -0
- package/resources/ecc/prompts/code-review.prompt.md +56 -0
- package/resources/ecc/prompts/plan.prompt.md +52 -0
- package/resources/ecc/prompts/refactor.prompt.md +50 -0
- package/resources/ecc/prompts/security-review.prompt.md +70 -0
- package/resources/ecc/prompts/tdd.prompt.md +47 -0
- package/resources/ecc/rules/common-agents.md +53 -0
- package/resources/ecc/rules/common-coding-style.md +52 -0
- package/resources/ecc/rules/common-development-workflow.md +33 -0
- package/resources/ecc/rules/common-git-workflow.md +28 -0
- package/resources/ecc/rules/common-hooks.md +34 -0
- package/resources/ecc/rules/common-patterns.md +35 -0
- package/resources/ecc/rules/common-performance.md +59 -0
- package/resources/ecc/rules/common-security.md +33 -0
- package/resources/ecc/rules/common-testing.md +33 -0
- package/resources/ecc/rules/golang-coding-style.md +31 -0
- package/resources/ecc/rules/golang-hooks.md +16 -0
- package/resources/ecc/rules/golang-patterns.md +44 -0
- package/resources/ecc/rules/golang-security.md +33 -0
- package/resources/ecc/rules/golang-testing.md +30 -0
- package/resources/ecc/rules/kotlin-coding-style.md +39 -0
- package/resources/ecc/rules/kotlin-hooks.md +16 -0
- package/resources/ecc/rules/kotlin-patterns.md +50 -0
- package/resources/ecc/rules/kotlin-security.md +58 -0
- package/resources/ecc/rules/kotlin-testing.md +38 -0
- package/resources/ecc/rules/php-coding-style.md +25 -0
- package/resources/ecc/rules/php-hooks.md +21 -0
- package/resources/ecc/rules/php-patterns.md +23 -0
- package/resources/ecc/rules/php-security.md +24 -0
- package/resources/ecc/rules/php-testing.md +26 -0
- package/resources/ecc/rules/python-coding-style.md +42 -0
- package/resources/ecc/rules/python-hooks.md +19 -0
- package/resources/ecc/rules/python-patterns.md +39 -0
- package/resources/ecc/rules/python-security.md +30 -0
- package/resources/ecc/rules/python-testing.md +38 -0
- package/resources/ecc/rules/swift-coding-style.md +47 -0
- package/resources/ecc/rules/swift-hooks.md +20 -0
- package/resources/ecc/rules/swift-patterns.md +66 -0
- package/resources/ecc/rules/swift-security.md +33 -0
- package/resources/ecc/rules/swift-testing.md +45 -0
- package/resources/ecc/rules/typescript-coding-style.md +63 -0
- package/resources/ecc/rules/typescript-hooks.md +20 -0
- package/resources/ecc/rules/typescript-patterns.md +50 -0
- package/resources/ecc/rules/typescript-security.md +26 -0
- package/resources/ecc/rules/typescript-testing.md +16 -0
- package/resources/ecc/skills/agent-introspection-debugging/SKILL.md +152 -0
- package/resources/ecc/skills/agent-introspection-debugging/agents/openai.yaml +7 -0
- package/resources/ecc/skills/agent-sort/SKILL.md +214 -0
- package/resources/ecc/skills/agent-sort/agents/openai.yaml +7 -0
- package/resources/ecc/skills/api-design/SKILL.md +522 -0
- package/resources/ecc/skills/api-design/agents/openai.yaml +7 -0
- package/resources/ecc/skills/article-writing/SKILL.md +78 -0
- package/resources/ecc/skills/article-writing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/backend-patterns/SKILL.md +597 -0
- package/resources/ecc/skills/backend-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/brand-voice/SKILL.md +96 -0
- package/resources/ecc/skills/brand-voice/agents/openai.yaml +7 -0
- package/resources/ecc/skills/brand-voice/references/voice-profile-schema.md +55 -0
- package/resources/ecc/skills/bun-runtime/SKILL.md +83 -0
- package/resources/ecc/skills/bun-runtime/agents/openai.yaml +7 -0
- package/resources/ecc/skills/coding-standards/SKILL.md +548 -0
- package/resources/ecc/skills/coding-standards/agents/openai.yaml +7 -0
- package/resources/ecc/skills/content-engine/SKILL.md +130 -0
- package/resources/ecc/skills/content-engine/agents/openai.yaml +7 -0
- package/resources/ecc/skills/crosspost/SKILL.md +110 -0
- package/resources/ecc/skills/crosspost/agents/openai.yaml +7 -0
- package/resources/ecc/skills/deep-research/SKILL.md +154 -0
- package/resources/ecc/skills/deep-research/agents/openai.yaml +7 -0
- package/resources/ecc/skills/dmux-workflows/SKILL.md +143 -0
- package/resources/ecc/skills/dmux-workflows/agents/openai.yaml +7 -0
- package/resources/ecc/skills/documentation-lookup/SKILL.md +89 -0
- package/resources/ecc/skills/documentation-lookup/agents/openai.yaml +7 -0
- package/resources/ecc/skills/e2e-testing/SKILL.md +325 -0
- package/resources/ecc/skills/e2e-testing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/eval-harness/SKILL.md +235 -0
- package/resources/ecc/skills/eval-harness/agents/openai.yaml +7 -0
- package/resources/ecc/skills/everything-claude-code/SKILL.md +442 -0
- package/resources/ecc/skills/everything-claude-code/agents/openai.yaml +7 -0
- package/resources/ecc/skills/exa-search/SKILL.md +169 -0
- package/resources/ecc/skills/exa-search/agents/openai.yaml +7 -0
- package/resources/ecc/skills/fal-ai-media/SKILL.md +276 -0
- package/resources/ecc/skills/fal-ai-media/agents/openai.yaml +7 -0
- package/resources/ecc/skills/frontend-patterns/SKILL.md +647 -0
- package/resources/ecc/skills/frontend-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/frontend-slides/SKILL.md +183 -0
- package/resources/ecc/skills/frontend-slides/STYLE_PRESETS.md +330 -0
- package/resources/ecc/skills/frontend-slides/agents/openai.yaml +7 -0
- package/resources/ecc/skills/investor-materials/SKILL.md +95 -0
- package/resources/ecc/skills/investor-materials/agents/openai.yaml +7 -0
- package/resources/ecc/skills/investor-outreach/SKILL.md +90 -0
- package/resources/ecc/skills/investor-outreach/agents/openai.yaml +7 -0
- package/resources/ecc/skills/market-research/SKILL.md +74 -0
- package/resources/ecc/skills/market-research/agents/openai.yaml +7 -0
- package/resources/ecc/skills/mcp-server-patterns/SKILL.md +66 -0
- package/resources/ecc/skills/mcp-server-patterns/agents/openai.yaml +7 -0
- package/resources/ecc/skills/mle-workflow/SKILL.md +346 -0
- package/resources/ecc/skills/mle-workflow/agents/openai.yaml +7 -0
- package/resources/ecc/skills/nextjs-turbopack/SKILL.md +43 -0
- package/resources/ecc/skills/nextjs-turbopack/agents/openai.yaml +7 -0
- package/resources/ecc/skills/product-capability/SKILL.md +140 -0
- package/resources/ecc/skills/product-capability/agents/openai.yaml +7 -0
- package/resources/ecc/skills/security-review/SKILL.md +494 -0
- package/resources/ecc/skills/security-review/agents/openai.yaml +7 -0
- package/resources/ecc/skills/strategic-compact/SKILL.md +102 -0
- package/resources/ecc/skills/strategic-compact/agents/openai.yaml +7 -0
- package/resources/ecc/skills/tdd-workflow/SKILL.md +409 -0
- package/resources/ecc/skills/tdd-workflow/agents/openai.yaml +7 -0
- package/resources/ecc/skills/verification-loop/SKILL.md +125 -0
- package/resources/ecc/skills/verification-loop/agents/openai.yaml +7 -0
- package/resources/ecc/skills/video-editing/SKILL.md +307 -0
- package/resources/ecc/skills/video-editing/agents/openai.yaml +7 -0
- package/resources/ecc/skills/x-api/SKILL.md +229 -0
- package/resources/ecc/skills/x-api/agents/openai.yaml +7 -0
package/README.md
ADDED
|
@@ -0,0 +1,394 @@
|
|
|
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
|
+
### Core — API
|
|
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 Tracking — LOCAL
|
|
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
|
package/bin/anycode.js
ADDED
package/bin/crowcoder.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// In-process best-effort: override process.emitWarning to drop DEP0040.
|
|
3
|
+
// Catches the warning when it's emitted late (after this runs), but does NOT
|
|
4
|
+
// catch warnings fired during Node's ESM bootstrap (before any user code).
|
|
5
|
+
// For a fully clean stderr, invoke Crowcoder via:
|
|
6
|
+
// node --no-deprecation bin/crowcoder.js
|
|
7
|
+
// NODE_OPTIONS=--no-deprecation crowcoder
|
|
8
|
+
// oag chat # already passes --no-deprecation
|
|
9
|
+
(() => {
|
|
10
|
+
const orig = process.emitWarning;
|
|
11
|
+
process.emitWarning = function patched(warning, ...rest) {
|
|
12
|
+
let code;
|
|
13
|
+
if (rest[0] && typeof rest[0] === 'object') code = rest[0].code;
|
|
14
|
+
else code = rest[1];
|
|
15
|
+
if (code === 'DEP0040') return;
|
|
16
|
+
return orig.call(this, warning, ...rest);
|
|
17
|
+
};
|
|
18
|
+
})();
|
|
19
|
+
import('../dist/index.js');
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* ECC-native hook dispatcher for Crowcoder.
|
|
4
|
+
*
|
|
5
|
+
* Reads Crowcoder's hook env vars (CROWCODER_EVENT, CROWCODER_TOOL,
|
|
6
|
+
* CROWCODER_TOOL_INPUT, CROWCODER_TOOL_OUTPUT) and runs a single named check.
|
|
7
|
+
*
|
|
8
|
+
* Exit codes:
|
|
9
|
+
* 0 — allow (PreToolUse) or success (PostToolUse)
|
|
10
|
+
* 2 — block (PreToolUse only; non-zero on a non-blocking hook is just logged)
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node ecc-hooks.cjs <check-name> [__ecc__]
|
|
14
|
+
*
|
|
15
|
+
* The trailing __ecc__ tag is used by the installer to identify ECC-managed
|
|
16
|
+
* hook entries so /ecc-install can refresh them without touching user hooks.
|
|
17
|
+
*/
|
|
18
|
+
'use strict';
|
|
19
|
+
|
|
20
|
+
const checkName = process.argv[2] || '';
|
|
21
|
+
|
|
22
|
+
let toolInput = {};
|
|
23
|
+
try {
|
|
24
|
+
toolInput = JSON.parse(process.env.CROWCODER_TOOL_INPUT || '{}');
|
|
25
|
+
} catch { /* ignore — leave as {} */ }
|
|
26
|
+
|
|
27
|
+
const tool = process.env.CROWCODER_TOOL || '';
|
|
28
|
+
const cwd = process.env.CROWCODER_CWD || process.cwd();
|
|
29
|
+
|
|
30
|
+
// ── Helpers ─────────────────────────────────────────────
|
|
31
|
+
function bashCommand() {
|
|
32
|
+
return String(toolInput.command || toolInput.cmd || '');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function filePath() {
|
|
36
|
+
return String(toolInput.path || toolInput.file_path || toolInput.file || '');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function fileContent() {
|
|
40
|
+
return String(
|
|
41
|
+
toolInput.content ||
|
|
42
|
+
toolInput.new_string ||
|
|
43
|
+
toolInput.text ||
|
|
44
|
+
'',
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function block(message) {
|
|
49
|
+
process.stderr.write(`[ECC] BLOCKED: ${message}\n`);
|
|
50
|
+
process.exit(2);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function warn(message) {
|
|
54
|
+
process.stderr.write(`[ECC] ${message}\n`);
|
|
55
|
+
process.exit(0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function ok() {
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ── Checks ──────────────────────────────────────────────
|
|
63
|
+
const checks = {
|
|
64
|
+
/**
|
|
65
|
+
* Block `git commit --no-verify` and friends — these skip pre-commit hooks.
|
|
66
|
+
*/
|
|
67
|
+
'block-no-verify': () => {
|
|
68
|
+
const cmd = bashCommand();
|
|
69
|
+
if (!/\bgit\s+/.test(cmd)) return ok();
|
|
70
|
+
if (/(^|\s)--no-verify(\s|$)/.test(cmd)) {
|
|
71
|
+
return block('`--no-verify` skips git hooks — fix the failure instead.');
|
|
72
|
+
}
|
|
73
|
+
if (/(^|\s)--no-gpg-sign(\s|$)/.test(cmd)) {
|
|
74
|
+
return block('`--no-gpg-sign` bypasses signing — ask the user first.');
|
|
75
|
+
}
|
|
76
|
+
return ok();
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Remind the user to run dev servers under tmux (non-blocking, POSIX only).
|
|
81
|
+
*/
|
|
82
|
+
'dev-server-tmux': () => {
|
|
83
|
+
if (process.platform === 'win32') return ok();
|
|
84
|
+
if (process.env.TMUX) return ok();
|
|
85
|
+
const cmd = bashCommand();
|
|
86
|
+
const devPattern = /\b(npm\s+run\s+dev|pnpm(?:\s+run)?\s+dev|yarn\s+dev|bun\s+run\s+dev|next\s+dev|vite(?:\s+dev)?)\b/;
|
|
87
|
+
const tmuxLauncher = /^\s*tmux\s+(new|new-session|new-window|split-window)\b/;
|
|
88
|
+
if (devPattern.test(cmd) && !tmuxLauncher.test(cmd)) {
|
|
89
|
+
return warn('Consider running dev servers in tmux for log access: `tmux new-session -d -s dev "<cmd>"`');
|
|
90
|
+
}
|
|
91
|
+
return ok();
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Warn (don't block) when reading typically-sensitive files.
|
|
96
|
+
*/
|
|
97
|
+
'sensitive-file': () => {
|
|
98
|
+
const path = filePath();
|
|
99
|
+
if (!path) return ok();
|
|
100
|
+
if (/\.(env|key|pem|p12|pfx)$/i.test(path) || /\b(credentials|secrets|id_rsa)\b/i.test(path)) {
|
|
101
|
+
return warn(`Reading sensitive file: ${path}`);
|
|
102
|
+
}
|
|
103
|
+
return ok();
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Warn when a file edit/write leaves console.log() / print() statements.
|
|
108
|
+
* Looks at the new_string / content payload only — doesn't read disk.
|
|
109
|
+
*/
|
|
110
|
+
'console-log-warn': () => {
|
|
111
|
+
const path = filePath();
|
|
112
|
+
const content = fileContent();
|
|
113
|
+
if (!content) return ok();
|
|
114
|
+
if (!/\.(ts|tsx|js|jsx|mjs|cjs)$/i.test(path)) return ok();
|
|
115
|
+
const noisy = /\bconsole\.(log|debug|info|warn|error)\s*\(/g;
|
|
116
|
+
const matches = content.match(noisy);
|
|
117
|
+
if (matches && matches.length > 0) {
|
|
118
|
+
return warn(`${matches.length} console statement(s) in ${path}`);
|
|
119
|
+
}
|
|
120
|
+
return ok();
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// ── Dispatch ────────────────────────────────────────────
|
|
125
|
+
const fn = checks[checkName];
|
|
126
|
+
if (!fn) {
|
|
127
|
+
// Unknown check — silently pass so an upgrade that removes a check doesn't
|
|
128
|
+
// break old hooks.json entries.
|
|
129
|
+
process.exit(0);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
try {
|
|
133
|
+
fn();
|
|
134
|
+
} catch (err) {
|
|
135
|
+
// Hook bugs must not break the user's flow.
|
|
136
|
+
process.stderr.write(`[ECC] hook ${checkName} error: ${err && err.message}\n`);
|
|
137
|
+
process.exit(0);
|
|
138
|
+
}
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare function detectProjectLanguage(cwd: string): string;
|
|
2
|
+
export declare function buildTSReviewPrompt(cwd: string, target?: string): string;
|
|
3
|
+
export declare function buildPyReviewPrompt(cwd: string, target?: string): string;
|
|
4
|
+
export declare function buildGoReviewPrompt(cwd: string, target?: string): string;
|
|
5
|
+
export declare function buildRustReviewPrompt(cwd: string, target?: string): string;
|
|
6
|
+
export declare function buildJavaReviewPrompt(cwd: string, target?: string): string;
|
|
7
|
+
export declare function buildCppReviewPrompt(cwd: string, target?: string): string;
|
|
8
|
+
export declare function buildKotlinReviewPrompt(cwd: string, target?: string): string;
|
|
9
|
+
export declare function buildPhpReviewPrompt(cwd: string, target?: string): string;
|
|
10
|
+
export declare function buildDbReviewPrompt(cwd: string, target?: string): string;
|
|
11
|
+
export declare function buildTSBuildFixPrompt(cwd: string, errors?: string): string;
|
|
12
|
+
export declare function buildGoBuildFixPrompt(cwd: string, errors?: string): string;
|
|
13
|
+
export declare function buildRustBuildFixPrompt(cwd: string, errors?: string): string;
|
|
14
|
+
export declare function buildJavaBuildFixPrompt(cwd: string, errors?: string): string;
|
|
15
|
+
export declare function buildCppBuildFixPrompt(cwd: string, errors?: string): string;
|
|
16
|
+
export declare function buildPyTorchBuildFixPrompt(cwd: string, errors?: string): string;
|
|
17
|
+
export declare function buildAutoReviewPrompt(cwd: string, target?: string): string;
|