Skip to content
This repository was archived by the owner on Feb 26, 2026. It is now read-only.

Commit 4877c2a

Browse files
committed
docs: align all CLAUDE.md files and README with actual codebase state
- Update README stats: 24 CLI commands, 5,460+ tests, 310+ files, 100K+ lines - Fix injection pattern count: 39 → 41 across all references - Add 6 missing CLI commands to README reference section - Update .env.example with complete 25+ API key template organized by priority - Fix 12 CLAUDE.md files with incorrect filenames and outdated component lists - Update test count references from ~3,500 to 5,460+ - Add missing directories to src/CLAUDE.md (plugins, e2e, channels) - Correct cognition/CLAUDE.md: knowledge/ and learning/ dirs are active, not removed
1 parent d8584b1 commit 4877c2a

14 files changed

Lines changed: 189 additions & 86 deletions

File tree

.env.example

Lines changed: 81 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,40 @@
22
# Copy this file to .env and fill in your values
33
# NEVER commit .env to version control
44

5-
# ─────────────────────────────────────────────────────────
6-
# LLM Providers (at least one required for AI features)
7-
# ─────────────────────────────────────────────────────────
5+
# ═══════════════════════════════════════════════════════════
6+
# CRITICAL (required for core functionality)
7+
# ═══════════════════════════════════════════════════════════
88

9-
# Anthropic (primary) — https://console.anthropic.com/settings/keys
9+
# Anthropic (primary LLM provider) — https://console.anthropic.com/settings/keys
1010
# ANTHROPIC_API_KEY=sk-ant-...
1111

12+
# Telegram Bot — https://t.me/BotFather
13+
# TELEGRAM_BOT_TOKEN=123456:ABC-...
14+
# TELEGRAM_OWNER_USER_ID=123456789
15+
# TELEGRAM_ALLOWED_USER_IDS=123456789
16+
17+
# ═══════════════════════════════════════════════════════════
18+
# HIGH PRIORITY (enables key features)
19+
# ═══════════════════════════════════════════════════════════
20+
21+
# Notion — https://www.notion.so/my-integrations
22+
# NOTION_API_KEY=ntn_...
23+
# NOTION_INBOX_DATABASE_ID=32-char-hex-id
24+
# NOTION_DAILY_LOG_PARENT_ID=32-char-hex-id
25+
# NOTION_TASKS_DATABASE_ID=32-char-hex-id
26+
27+
# X/Twitter — https://developer.x.com/en/portal/dashboard
28+
# X_BEARER_TOKEN=AAAA...
29+
# X_USER_ID=123456789
30+
31+
# Alpha Vantage (market data) — https://www.alphavantage.co/support/#api-key
32+
# ALPHA_VANTAGE_API_KEY=...
33+
34+
# ═══════════════════════════════════════════════════════════
35+
# MEDIUM PRIORITY (enhances capabilities)
36+
# ═══════════════════════════════════════════════════════════
37+
38+
# Additional LLM Providers
1239
# OpenAI — https://platform.openai.com/api-keys
1340
# OPENAI_API_KEY=sk-...
1441

@@ -18,29 +45,65 @@
1845
# xAI (Grok) — https://console.x.ai
1946
# XAI_API_KEY=xai-...
2047

21-
# ─────────────────────────────────────────────────────────
22-
# Integrations (Optional)
23-
# ─────────────────────────────────────────────────────────
48+
# GitHub — https://github.com/settings/tokens
49+
# GITHUB_TOKEN=ghp_...
2450

25-
# Telegram Bot — https://t.me/BotFather
26-
# TELEGRAM_BOT_TOKEN=123456:ABC-...
27-
# TELEGRAM_OWNER_USER_ID=123456789
28-
# TELEGRAM_ALLOWED_USER_IDS=123456789
51+
# Weather — https://openweathermap.org/api
52+
# WEATHER_API_KEY=...
2953

30-
# Notion — https://www.notion.so/my-integrations
31-
# NOTION_API_KEY=ntn_...
32-
# NOTION_INBOX_DATABASE_ID=32-char-hex-id
33-
# NOTION_DAILY_LOG_PARENT_ID=32-char-hex-id
54+
# Perplexity — https://www.perplexity.ai/settings/api
55+
# PERPLEXITY_API_KEY=pplx-...
56+
57+
# CoinGecko (crypto prices) — https://www.coingecko.com/en/api
58+
# COINGECKO_API_KEY=CG-...
3459

3560
# ElevenLabs TTS — https://elevenlabs.io
3661
# ELEVENLABS_API_KEY=sk_...
3762

38-
# ─────────────────────────────────────────────────────────
39-
# Core Settings
40-
# ─────────────────────────────────────────────────────────
63+
# ═══════════════════════════════════════════════════════════
64+
# LOW PRIORITY (optional integrations)
65+
# ═══════════════════════════════════════════════════════════
66+
67+
# Readwise — https://readwise.io/access_token
68+
# READWISE_API_KEY=...
69+
70+
# Stripe — https://dashboard.stripe.com/apikeys
71+
# STRIPE_SECRET_KEY=sk_...
72+
73+
# Toggl — https://track.toggl.com/profile (scroll to API Token)
74+
# TOGGL_API_TOKEN=...
75+
# TOGGL_WORKSPACE_ID=...
76+
77+
# Spotify — https://developer.spotify.com/dashboard
78+
# SPOTIFY_ACCESS_TOKEN=...
79+
80+
# Cal.com — https://app.cal.com/settings/developer/api-keys
81+
# CALCOM_API_KEY=cal_...
82+
83+
# Product Hunt — https://www.producthunt.com/v2/oauth/applications
84+
# PRODUCTHUNT_ACCESS_TOKEN=...
85+
86+
# ═══════════════════════════════════════════════════════════
87+
# NO API KEY NEEDED (work out of the box)
88+
# ═══════════════════════════════════════════════════════════
89+
# These integrations work without configuration:
90+
# - Hacker News (public API)
91+
# - RSS feeds (public)
92+
# - Google Trends (scraping)
93+
# - Ollama (local LLM — install from https://ollama.ai)
94+
# - Anki (local — requires AnkiConnect plugin)
95+
# - Apple Calendar/Reminders (macOS AppleScript)
96+
# - Whisper (local — requires whisper CLI)
97+
98+
# ═══════════════════════════════════════════════════════════
99+
# CORE SETTINGS
100+
# ═══════════════════════════════════════════════════════════
41101

42102
# Gateway port (default: 3141)
43103
# ARI_PORT=3141
44104

105+
# Internal API key for service-to-service auth
106+
# ARI_API_KEY=...
107+
45108
# Node environment
46109
# NODE_ENV=development

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ARI is a **multi-agent AI operating system** that runs entirely on your machine.
5353
**Core Properties:**
5454
- **Local-First** — All data stays on your machine. No cloud dependencies.
5555
- **Auditable** — Every decision is logged in a tamper-evident SHA-256 hash chain.
56-
- **Secure by Design** — Loopback-only gateway. 39-pattern injection detection. Zero trust architecture.
56+
- **Secure by Design** — Loopback-only gateway. 41-pattern injection detection. Zero trust architecture.
5757
- **Autonomous** — Morning/evening briefings, market monitoring, intelligent task management.
5858

5959
> **Note**: This is a framework. The code is open source. Your data is not.
@@ -76,7 +76,7 @@ ARI is a **multi-agent AI operating system** that runs entirely on your machine.
7676
- Intelligent task prioritization
7777

7878
**Security & Governance**
79-
- 39 injection patterns across 14 categories
79+
- 41 injection patterns across 14 categories
8080
- SHA-256 hash-chained audit trail
8181
- 15-member constitutional council
8282
- 6 trust levels with risk multipliers
@@ -93,10 +93,10 @@ ARI is a **multi-agent AI operating system** that runs entirely on your machine.
9393
- Core Agent (orchestration)
9494

9595
**Developer Experience**
96-
- 23 CLI commands
97-
- 4,885+ tests across 189 files
98-
- 200+ TypeScript files
99-
- 50,000+ lines of code
96+
- 24 CLI commands
97+
- 5,460+ tests across 218 files
98+
- 310+ TypeScript files
99+
- 100,000+ lines of code
100100
- Cognitive layer (LOGOS/ETHOS/PATHOS)
101101

102102
</td>
@@ -162,7 +162,7 @@ graph TB
162162
| **Agents** | Agent coordination and execution | Guardian (threat detection), Planner (task decomposition), Executor (tool invocation), Memory Manager (provenance tracking), Core (orchestration) |
163163
| **Strategic** | Governance and quality control | Council (15-member voting), Arbiter (6 constitutional rules), Overseer (5 quality gates) |
164164
| **Execution** | Process lifecycle | Daemon (macOS launchd integration), Health Monitor, Git Sync |
165-
| **Interfaces** | User interaction | CLI (23 commands), Dashboard (React), External Integrations |
165+
| **Interfaces** | User interaction | CLI (24 commands), Dashboard (React), External Integrations |
166166

167167
**Dependency Rule:** Lower layers CANNOT import higher layers. Cross-layer communication via EventBus only.
168168

@@ -174,7 +174,7 @@ Every message flows through a **multi-stage security pipeline** before execution
174174

175175
```mermaid
176176
flowchart TD
177-
Start([Inbound Message]) --> Sanitize[Sanitizer<br/>39 Injection Patterns]
177+
Start([Inbound Message]) --> Sanitize[Sanitizer<br/>41 Injection Patterns]
178178
Sanitize -->|Clean| TrustCheck{Trust Level<br/>Assessment}
179179
Sanitize -->|Malicious| Block1[BLOCK]
180180
@@ -245,7 +245,7 @@ sequenceDiagram
245245
246246
U->>G: POST /message
247247
G->>S: Sanitize input
248-
S->>S: Check 39 patterns
248+
S->>S: Check 41 patterns
249249
alt Malicious
250250
S-->>G: BLOCK
251251
G-->>U: 400 Bad Request
@@ -427,6 +427,12 @@ ari audit-report Generate audit reports
427427
ari autonomous [start|stop] Autonomous agent control
428428
ari cognitive [analyze] Cognitive layer tools
429429
ari budget [show|reset] Budget management
430+
ari crypto [prices|portfolio] Crypto market data
431+
ari pokemon [search|value] Pokemon TCG tools
432+
ari speak <text> Text-to-speech
433+
ari plugin [list|install] Plugin management
434+
ari provider [list|set] AI provider management
435+
ari diagram [arch|flow] Architecture diagrams
430436
```
431437

432438
---

src/CLAUDE.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@ This is the main source directory for ARI. Quick navigation:
99
| 2. System | `system/` | Routing, storage, context loading |
1010
| 3. Agents | `agents/` | Multi-agent coordination |
1111
| 4. Governance | `governance/` | Council, arbiter, overseer, policy engine |
12-
| 5. Ops | `ops/` | Daemon, infrastructure |
12+
| 5. Ops | `ops/` | Daemon, health monitor, git sync |
1313
| 6. CLI | `cli/` | User interface commands (24 commands) |
1414

1515
Additional directories:
16-
- `ai/` — AIOrchestrator, model registry, value scorer, prompt builder
17-
- `autonomous/` — Proactive agent, scheduler, briefings
18-
- `execution/` — Tool registry and executor
19-
- `integrations/` — External services (Notion, SMS, Cowork)
16+
- `ai/` — AIOrchestrator, model registry (20 models), value scorer, batch processor
17+
- `autonomous/` — Proactive agent, scheduler (35 tasks), briefings, market monitor
18+
- `execution/` — Tool registry, tool executor, model router
19+
- `integrations/` — 21 external services (Notion, Telegram, Apple, GitHub, RSS, Weather, etc.)
20+
- `plugins/` — Content engine, crypto, Pokemon TCG, Telegram bot, TTS
2021
- `mcp/` — Model Context Protocol server
2122
- `prompts/` — Prompt building utilities
22-
- `observability/` — Metrics, alerts, execution history
23-
- `api/` — REST routes (modular) and WebSocket server
24-
- `channels/` — Communication channels (Telegram, Slack, Webhook, etc.)
25-
- `skills/` — Skill definitions
23+
- `observability/` — Metrics, alerts, cost tracking, execution history
24+
- `api/` — REST routes (16 route files) and WebSocket server
25+
- `channels/` — Communication channel abstraction (registry, router, bridge)
26+
- `skills/` — Skill definitions (diagram generator)
27+
- `e2e/` — End-to-end test runner and setup
2628

2729
## Quick Rules
2830

@@ -35,7 +37,7 @@ Additional directories:
3537

3638
- `kernel/types.ts` — All Zod schemas
3739
- `kernel/event-bus.ts` — Typed pub/sub
38-
- `kernel/sanitizer.ts`Injection detection
40+
- `kernel/sanitizer.ts`41-pattern injection detection
3941
- `agents/core.ts` — Message pipeline
4042
- `ai/orchestrator.ts` — AI model routing and orchestration
4143

src/ai/CLAUDE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ AIOrchestrator.execute(request)
2424

2525
| File | Purpose |
2626
|------|---------|
27+
| orchestrator.ts | THE single entry point |
2728
| types.ts | All Zod schemas (ADR-006) |
28-
| model-registry.ts | Single source of truth for models + pricing |
29+
| model-registry.ts | Single source of truth for 20 models + pricing |
2930
| value-scorer.ts | ValueScore algorithm + task classification |
3031
| circuit-breaker.ts | Three-state failure protection |
3132
| response-evaluator.ts | Post-response quality assessment |
3233
| prompt-assembler.ts | Prompt construction with cache_control |
3334
| ai-policy-governor.ts | Council governance bridge |
34-
| orchestrator.ts | THE single entry point |
35+
| provider-registry.ts | Multi-provider management (Anthropic, OpenAI, Google, xAI) |
36+
| cascade-router.ts | Cascade model routing |
37+
| request-classifier.ts | Request classification and routing |
38+
| embedding-service.ts | Text embedding generation |
39+
| performance-tracker.ts | Model performance tracking |
40+
| batch-processor.ts | Batch API processing |
41+
| index.ts | Module exports |
3542

3643
## Layer Rules
3744

src/api/CLAUDE.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ REST API and WebSocket endpoints for ARI operations.
66

77
| Component | Purpose |
88
|-----------|---------|
9-
| routes/ | Modular Fastify route plugins |
9+
| routes/ | Modular Fastify route plugins (15 route files) |
1010
| ws.ts | WebSocket event broadcaster |
1111
| index.ts | API initialization and exports |
1212

@@ -20,6 +20,14 @@ Routes are split into modular files under `routes/`:
2020
- `audit.ts``/api/audit/*`
2121
- `budget.ts``/api/budget/*`
2222
- `autonomous.ts``/api/autonomous/*`
23+
- `alerts.ts``/api/alerts/*`
24+
- `analytics.ts``/api/analytics/*`
25+
- `approval-queue.ts``/api/approval-queue/*`
26+
- `dashboard.ts``/api/dashboard/*`
27+
- `metrics.ts``/api/metrics/*`
28+
- `scheduler.ts``/api/scheduler/*`
29+
- `subagents.ts``/api/subagents/*`
30+
- `shared.ts` — Shared `ApiDependencies` type
2331

2432
## Endpoints
2533

src/channels/CLAUDE.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Abstraction layer for multi-channel communication.
66

77
| Component | Purpose |
88
|-----------|---------|
9-
| base.ts | Base channel interface |
10-
| telegram.ts | Telegram channel adapter |
11-
| email.ts | Email communication channel |
12-
| discord.ts | Discord integration |
9+
| types.ts | Channel interface definitions |
10+
| registry.ts | Channel registry and lookup |
11+
| router.ts | Message routing across channels |
12+
| message-bridge.ts | Bridge between EventBus and channels |
13+
| index.ts | Module exports |
1314

1415
## Channel Interface
1516

src/cognition/CLAUDE.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ Layer 0: Cognitive (trimmed to essentials)
1818
└── index.ts — Barrel exports
1919
```
2020

21-
**Removed modules** (Phase 2 simplification):
22-
- `knowledge/` — 92 curated sources (not connected to core pipeline)
23-
- `learning/` — 27-file educational platform (kept only decision-journal.ts)
24-
- `ux/` — 12-file visualization system
25-
- `visualization/` — Insight formatters
21+
**Additional modules** (active):
22+
- `knowledge/` — Cognitive source management (5 files: cognitive-sources, content-validator, source-manager, specializations, index)
23+
- `learning/` — Self-improvement subsystem (7 files: decision-journal, calibration-tracker, gap-analysis, learning-loop, performance-review, self-assessment, index)
2624

2725
## Three Pillars
2826

src/execution/CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ Tool registry and executor for ARI's capability invocation.
77
| Component | Purpose |
88
|-----------|---------|
99
| tool-registry.ts | Register and manage available tools |
10-
| executor.ts | Execute tools with permission checks |
10+
| tool-executor.ts | Execute tools with permission checks |
11+
| model-router.ts | Route requests to appropriate AI models |
1112
| types.ts | Tool and execution type definitions |
13+
| index.ts | Module exports |
1214

1315
## Tool Categories
1416

src/integrations/CLAUDE.md

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
# Integrations Layer
22

3-
External service integrations for ARI.
3+
External service integrations for ARI. 21 integration directories.
44

55
## Components
66

7-
| Integration | Purpose | Files |
8-
|-------------|---------|-------|
9-
| Notion | Task and document management | notion/ |
10-
| SMS | Mobile notifications | sms/ |
11-
| Cowork | Claude Cowork plugins | cowork/ |
7+
| Integration | Purpose | API Key Required |
8+
|-------------|---------|-----------------|
9+
| anki/ | Spaced repetition flashcards | No (local) |
10+
| apple/ | Calendar, Reminders, Focus Mode | No (AppleScript) |
11+
| calcom/ | Scheduling and bookings | Yes |
12+
| cowork/ | Claude Cowork plugin generation | No |
13+
| github/ | Repository and PR monitoring | Yes |
14+
| hackernews/ | Tech news aggregation | No |
15+
| notion/ | Task and document management | Yes |
16+
| ollama/ | Local LLM inference | No (local) |
17+
| perplexity/ | AI-powered research | Yes |
18+
| producthunt/ | Product launch tracking | Yes |
19+
| readwise/ | Reading highlights sync | Yes |
20+
| rss/ | RSS feed aggregation | No |
21+
| sms/ | Mobile notifications | Yes |
22+
| spotify/ | Music and podcast tracking | Yes |
23+
| stripe/ | Payment and revenue monitoring | Yes |
24+
| telegram/ | Bot and messaging | Yes |
25+
| toggl/ | Time tracking | Yes |
26+
| trends/ | Google Trends monitoring | No |
27+
| twitter/ | Social media monitoring | Yes |
28+
| weather/ | Weather forecasts | Yes |
29+
| whisper/ | Speech-to-text transcription | No (local) |
1230

1331
## Notion Integration
1432

@@ -19,28 +37,6 @@ const notion = new NotionClient(process.env.NOTION_API_KEY);
1937
await notion.createPage({ title: 'ARI Task', content: '...' });
2038
```
2139

22-
## SMS Integration
23-
24-
```typescript
25-
import { SMSConversation } from './integrations/sms';
26-
27-
const sms = new SMSConversation(config);
28-
await sms.start();
29-
sms.on('command', (cmd) => handleCommand(cmd));
30-
```
31-
32-
## Cowork Plugin System
33-
34-
Generate Claude Cowork compatible plugins:
35-
```typescript
36-
import { generatePlugin } from './integrations/cowork';
37-
38-
await generatePlugin({
39-
name: 'ari-tasks',
40-
tools: ['create_task', 'list_tasks'],
41-
});
42-
```
43-
4440
## Security
4541

4642
- API keys stored in environment variables

0 commit comments

Comments
 (0)