atris 1.4.2 → 1.4.4
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/GETTING_STARTED.md +27 -14
- package/README.md +18 -3
- package/atris/atris.md +44 -21
- package/atris.md +19 -1
- package/bin/atris.js +221 -14
- package/package.json +1 -1
- package/atris/agent_team/optimizer.md +0 -162
package/GETTING_STARTED.md
CHANGED
|
@@ -9,13 +9,14 @@ You ran `atris init` and got this folder structure:
|
|
|
9
9
|
```
|
|
10
10
|
atris/
|
|
11
11
|
├── GETTING_STARTED.md (you are here!)
|
|
12
|
+
├── PERSONA.md (agent communication style)
|
|
12
13
|
├── atris.md (instructions for your AI agent)
|
|
13
|
-
├── MAP.md (
|
|
14
|
-
├── TASK_CONTEXTS.md (
|
|
14
|
+
├── MAP.md (AI generates from your codebase)
|
|
15
|
+
├── TASK_CONTEXTS.md (AI generates from MAP)
|
|
15
16
|
└── agent_team/
|
|
16
|
-
├── navigator.md (
|
|
17
|
-
├── executor.md (
|
|
18
|
-
└── validator.md (
|
|
17
|
+
├── navigator.md (pre-built template, ready to use)
|
|
18
|
+
├── executor.md (pre-built template, ready to use)
|
|
19
|
+
└── validator.md (pre-built template, ready to use)
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
## Quick Start (3 Steps)
|
|
@@ -27,19 +28,31 @@ Open `atris/atris.md` in your editor. This file contains detailed instructions f
|
|
|
27
28
|
Copy the entire contents of `atris.md` and paste it to Claude Code, Cursor, Windsurf, or your favorite AI coding assistant with this prompt:
|
|
28
29
|
|
|
29
30
|
```
|
|
30
|
-
Read atris.md.
|
|
31
|
+
Read atris.md. Generate MAP.md and TASK_CONTEXTS.md for this project.
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
### Step 3: Watch the Magic
|
|
34
35
|
Your AI agent will:
|
|
35
36
|
- Scan your project and generate `MAP.md` (a navigation guide with file:line references)
|
|
36
|
-
- Create 3 specialized agents in `agent_team/`:
|
|
37
|
-
- **navigator.md** - Answers "where is X?" questions
|
|
38
|
-
- **executor.md** - Executes tasks with full context
|
|
39
|
-
- **validator.md** - Validates changes and updates docs
|
|
40
37
|
- Generate `TASK_CONTEXTS.md` with actionable tasks extracted from your system
|
|
38
|
+
- Optionally inject project-specific context into the pre-built agent templates
|
|
41
39
|
|
|
42
|
-
**
|
|
40
|
+
**Agent templates ship ready to use:**
|
|
41
|
+
- **navigator.md** - Answers "where is X?" questions
|
|
42
|
+
- **executor.md** - Executes tasks with full context
|
|
43
|
+
- **validator.md** - Validates changes and updates docs
|
|
44
|
+
|
|
45
|
+
**Total time: ~5 minutes**
|
|
46
|
+
|
|
47
|
+
## Load the context (no login required)
|
|
48
|
+
|
|
49
|
+
At any point—before or after your AI agent runs—you can load the local context with:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
atris activate
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This shows today's journal, MAP.md, and TASK_CONTEXTS.md so you can browse and take notes offline. Authentication and agent selection are only required when you want to use `atris chat` with Atris cloud agents.
|
|
43
56
|
|
|
44
57
|
## What Each File Does
|
|
45
58
|
|
|
@@ -114,13 +127,13 @@ cd /path/to/your/project
|
|
|
114
127
|
atris update
|
|
115
128
|
```
|
|
116
129
|
|
|
117
|
-
This syncs your local `atris.md` to the latest version. Re-run your AI agent to regenerate
|
|
130
|
+
This syncs your local `atris.md` and agent templates to the latest version. Re-run your AI agent to regenerate MAP.md with the new spec.
|
|
118
131
|
|
|
119
132
|
## What's Next?
|
|
120
133
|
|
|
121
|
-
1. **Let your AI agent
|
|
134
|
+
1. **Let your AI agent generate MAP.md** (Step 2 above if you haven't already)
|
|
122
135
|
2. **Explore MAP.md** - Get familiar with your system's structure
|
|
123
|
-
3. **Try the agents** - Ask navigator questions, run executor tasks
|
|
136
|
+
3. **Try the pre-built agents** - Ask navigator questions, run executor tasks
|
|
124
137
|
4. **Pick a task** - Check TASK_CONTEXTS.md for quick wins
|
|
125
138
|
|
|
126
139
|
## Need Help?
|
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Atris
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Drop one command. Your team of AI agents instantly know your entire codebase.
|
|
4
|
+
|
|
5
|
+
No more "where is the auth logic?" or "which file handles payments?" Atris gives AI agents a navigation system with exact file:line answers in seconds.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
@@ -8,14 +10,17 @@ Universal system instrumentation for AI agents. Transforms any codebase into a s
|
|
|
8
10
|
npm install -g atris
|
|
9
11
|
```
|
|
10
12
|
|
|
13
|
+
→ npm package: https://www.npmjs.com/package/atris
|
|
14
|
+
|
|
11
15
|
## Usage
|
|
12
16
|
|
|
13
17
|
```bash
|
|
14
18
|
cd your-project
|
|
15
19
|
atris init
|
|
20
|
+
atris activate
|
|
16
21
|
```
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
See `atris/GETTING_STARTED.md` for full instructions. Your AI agent reads `atris/atris.md` and generates:
|
|
19
24
|
- **MAP.md** - Navigation guide with file:line precision
|
|
20
25
|
- **agent_team/** - Navigator, executor, validator specs
|
|
21
26
|
- **TASK_CONTEXTS.md** - Structured task bank
|
|
@@ -30,6 +35,16 @@ atris update
|
|
|
30
35
|
|
|
31
36
|
Syncs local `atris.md` to latest version.
|
|
32
37
|
|
|
38
|
+
## Talk to agents
|
|
39
|
+
|
|
40
|
+
`atris activate` works immediately — it loads your journal, MAP, and TASK_CONTEXTS without needing an account. When you're ready to collaborate with Atris cloud agents, run:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
atris agent # pick an agent persona for this project
|
|
44
|
+
atris login # authenticate once for cloud sync + chat
|
|
45
|
+
atris chat # open an interactive session
|
|
46
|
+
```
|
|
47
|
+
|
|
33
48
|
---
|
|
34
49
|
|
|
35
50
|
**License:** MIT | **Repo:** [github.com/atrislabs/atris.md](https://github.com/atrislabs/atris.md.git)
|
package/atris/atris.md
CHANGED
|
@@ -45,11 +45,28 @@ This spec defines how to transform any system (codebase, product, sales process,
|
|
|
45
45
|
|
|
46
46
|
6. **Output:** `/atris/MAP.md` (target: 300-500 lines for large systems; scale to project size)
|
|
47
47
|
|
|
48
|
+
7. **After MAP.md generation:** Append lightweight project context to agent templates
|
|
49
|
+
- Add `## Project Context` section to each agent (navigator, executor, validator)
|
|
50
|
+
- Include: framework, 3-5 key directories, 3-5 search accelerators
|
|
51
|
+
- Keep it minimal (5-10 lines max per agent) - avoid bloat
|
|
52
|
+
- Format:
|
|
53
|
+
```markdown
|
|
54
|
+
---
|
|
55
|
+
## Project Context (Auto-generated from MAP.md)
|
|
56
|
+
- **Framework:** Next.js 14
|
|
57
|
+
- **Key dirs:** app/, components/, lib/
|
|
58
|
+
- **Search patterns:**
|
|
59
|
+
- Components: `rg "export default" components/`
|
|
60
|
+
- API routes: `rg "export async function" app/api/`
|
|
61
|
+
```
|
|
62
|
+
|
|
48
63
|
---
|
|
49
64
|
|
|
50
|
-
## Phase 2:
|
|
65
|
+
## Phase 2: Foundational Agent Templates
|
|
66
|
+
|
|
67
|
+
ATRIS ships with pre-built agent templates in `/atris/agent_team/` (copied during `atris init`). These templates provide battle-tested specs that work out of the box. Each agent has explicit guardrails.
|
|
51
68
|
|
|
52
|
-
|
|
69
|
+
**Templates included:**
|
|
53
70
|
|
|
54
71
|
### Agent 1: **navigator.md** (in `/atris/agent_team/`)
|
|
55
72
|
|
|
@@ -207,20 +224,25 @@ After MAP.md exists, generate agent specs in `/atris/agent_team/` from MAP insig
|
|
|
207
224
|
|
|
208
225
|
## Phase 4: Activation & Handoff
|
|
209
226
|
|
|
210
|
-
**
|
|
227
|
+
**After `atris init`, your workspace contains:**
|
|
211
228
|
|
|
212
229
|
- ✅ `atris.md` (this spec)
|
|
213
|
-
- ✅ `
|
|
214
|
-
- ✅ `
|
|
215
|
-
- ✅ `agent_team/
|
|
216
|
-
- ✅ `agent_team/
|
|
217
|
-
- ✅ `
|
|
230
|
+
- ✅ `PERSONA.md` (agent communication style)
|
|
231
|
+
- ✅ `GETTING_STARTED.md` (user guide)
|
|
232
|
+
- ✅ `agent_team/navigator.md` (pre-built template)
|
|
233
|
+
- ✅ `agent_team/executor.md` (pre-built template)
|
|
234
|
+
- ✅ `agent_team/validator.md` (pre-built template)
|
|
235
|
+
- ⏳ `MAP.md` (AI agent generates from codebase)
|
|
236
|
+
- ⏳ `TASK_CONTEXTS.md` (AI agent generates from MAP)
|
|
237
|
+
|
|
238
|
+
**Agent Enhancement:**
|
|
239
|
+
After MAP.md generation, agents receive project context injection (framework, key dirs, search patterns). This keeps base templates clean while adding project-specific accelerators.
|
|
218
240
|
|
|
219
241
|
**Agent Behavior Activates Automatically:**
|
|
220
242
|
|
|
221
243
|
| Trigger | Agent | Action |
|
|
222
244
|
|---------|-------|--------|
|
|
223
|
-
| "Where is X?" | navigator | Answers with MAP.md:line reference |
|
|
245
|
+
| "Where is X?" | navigator | Answers with MAP.md:line reference + project patterns |
|
|
224
246
|
| "Do task Y" | executor | Extracts context, plans execution, cites file:line |
|
|
225
247
|
| After change | validator | Checks validity, updates docs, blocks unsafe changes |
|
|
226
248
|
| New agent joins | navigator | Reads MAP.md, immediately productive (no ramp-up) |
|
|
@@ -274,13 +296,14 @@ After MAP.md exists, generate agent specs in `/atris/agent_team/` from MAP insig
|
|
|
274
296
|
|
|
275
297
|
## Implementation Checklist
|
|
276
298
|
|
|
277
|
-
- [ ] **
|
|
278
|
-
- [ ] **
|
|
279
|
-
- [ ] **Phase
|
|
280
|
-
- [ ] **Phase
|
|
281
|
-
- [ ] **
|
|
299
|
+
- [ ] **Install:** `npm install -g atris` (instant)
|
|
300
|
+
- [ ] **Init:** `atris init` - creates atris/ with templates (instant)
|
|
301
|
+
- [ ] **Phase 1:** AI agent generates MAP.md from codebase (5 min)
|
|
302
|
+
- [ ] **Phase 3:** AI agent generates TASK_CONTEXTS.md from MAP (2 min)
|
|
303
|
+
- [ ] **Validate:** Test navigator/executor/validator workflows (1 min)
|
|
304
|
+
- [ ] **Ongoing:** Run `atris sync` to get template updates
|
|
282
305
|
|
|
283
|
-
**Total time to full instrumentation: ~
|
|
306
|
+
**Total time to full instrumentation: ~8 minutes**
|
|
284
307
|
|
|
285
308
|
---
|
|
286
309
|
|
|
@@ -306,10 +329,10 @@ atris sync
|
|
|
306
329
|
|
|
307
330
|
---
|
|
308
331
|
|
|
309
|
-
**Status:**
|
|
310
|
-
1.
|
|
311
|
-
2.
|
|
312
|
-
3.
|
|
313
|
-
4.
|
|
332
|
+
**Status:** Production ready. Run `atris init` in any project to get:
|
|
333
|
+
1. Pre-built agent templates (navigator, executor, validator)
|
|
334
|
+
2. AI generates MAP.md from your codebase in <5 minutes
|
|
335
|
+
3. AI generates TASK_CONTEXTS.md with exact file:line context
|
|
336
|
+
4. Full workflow: activate → plan → build → validate
|
|
314
337
|
|
|
315
|
-
*
|
|
338
|
+
*Install once. Init anywhere. AI agents have instant context. Codebase becomes fully instrumented for AI collaboration.*
|
package/atris.md
CHANGED
|
@@ -45,6 +45,21 @@ This spec defines how to transform any system (codebase, product, sales process,
|
|
|
45
45
|
|
|
46
46
|
6. **Output:** `/atris/MAP.md` (target: 300-500 lines for large systems; scale to project size)
|
|
47
47
|
|
|
48
|
+
7. **After MAP.md generation:** Append lightweight project context to agent templates
|
|
49
|
+
- Add `## Project Context` section to each agent (navigator, executor, validator)
|
|
50
|
+
- Include: framework, 3-5 key directories, 3-5 search accelerators
|
|
51
|
+
- Keep it minimal (5-10 lines max per agent) - avoid bloat
|
|
52
|
+
- Format:
|
|
53
|
+
```markdown
|
|
54
|
+
---
|
|
55
|
+
## Project Context (Auto-generated from MAP.md)
|
|
56
|
+
- **Framework:** Next.js 14
|
|
57
|
+
- **Key dirs:** app/, components/, lib/
|
|
58
|
+
- **Search patterns:**
|
|
59
|
+
- Components: `rg "export default" components/`
|
|
60
|
+
- API routes: `rg "export async function" app/api/`
|
|
61
|
+
```
|
|
62
|
+
|
|
48
63
|
---
|
|
49
64
|
|
|
50
65
|
## Phase 2: Foundational Agent Templates
|
|
@@ -220,11 +235,14 @@ ATRIS ships with pre-built agent templates in `/atris/agent_team/` (copied durin
|
|
|
220
235
|
- ⏳ `MAP.md` (AI agent generates from codebase)
|
|
221
236
|
- ⏳ `TASK_CONTEXTS.md` (AI agent generates from MAP)
|
|
222
237
|
|
|
238
|
+
**Agent Enhancement:**
|
|
239
|
+
After MAP.md generation, agents receive project context injection (framework, key dirs, search patterns). This keeps base templates clean while adding project-specific accelerators.
|
|
240
|
+
|
|
223
241
|
**Agent Behavior Activates Automatically:**
|
|
224
242
|
|
|
225
243
|
| Trigger | Agent | Action |
|
|
226
244
|
|---------|-------|--------|
|
|
227
|
-
| "Where is X?" | navigator | Answers with MAP.md:line reference |
|
|
245
|
+
| "Where is X?" | navigator | Answers with MAP.md:line reference + project patterns |
|
|
228
246
|
| "Do task Y" | executor | Extracts context, plans execution, cites file:line |
|
|
229
247
|
| After change | validator | Checks validity, updates docs, blocks unsafe changes |
|
|
230
248
|
| New agent joins | navigator | Reads MAP.md, immediately productive (no ramp-up) |
|
package/bin/atris.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const { exec } = require('child_process');
|
|
5
|
+
const { exec, spawnSync } = require('child_process');
|
|
6
6
|
const readline = require('readline');
|
|
7
7
|
const os = require('os');
|
|
8
8
|
const https = require('https');
|
|
@@ -11,13 +11,14 @@ const crypto = require('crypto');
|
|
|
11
11
|
|
|
12
12
|
const command = process.argv[2];
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function showHelp() {
|
|
15
15
|
console.log('Usage: atris <command>');
|
|
16
16
|
console.log('Commands:');
|
|
17
17
|
console.log(' init - Initialize ATRIS in current project');
|
|
18
18
|
console.log(' agent - Select agent for this workspace');
|
|
19
19
|
console.log(' activate - Load context and start chat with ATRIS agents');
|
|
20
20
|
console.log(' status - Show system state (tasks, inbox, recent completions)');
|
|
21
|
+
console.log(' analytics - Show insights from journal (velocity, trends, patterns)');
|
|
21
22
|
console.log(' plan - Activate navigator (brainstorm and create tasks)');
|
|
22
23
|
console.log(' do - Activate executor (build tasks from TASK_CONTEXTS)');
|
|
23
24
|
console.log(' review - Activate validator (verify, test, clean docs)');
|
|
@@ -31,6 +32,11 @@ if (!command) {
|
|
|
31
32
|
console.log(' login - Authenticate with AtrisOS (optional, enables cloud sync)');
|
|
32
33
|
console.log(' logout - Remove stored credentials');
|
|
33
34
|
console.log(' whoami - Show current authentication status');
|
|
35
|
+
console.log(' help - Show this help message');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!command || command === 'help' || command === '--help' || command === '-h') {
|
|
39
|
+
showHelp();
|
|
34
40
|
process.exit(0);
|
|
35
41
|
}
|
|
36
42
|
|
|
@@ -80,9 +86,11 @@ if (command === 'init') {
|
|
|
80
86
|
reviewAtris();
|
|
81
87
|
} else if (command === 'status') {
|
|
82
88
|
statusAtris();
|
|
89
|
+
} else if (command === 'analytics') {
|
|
90
|
+
analyticsAtris();
|
|
83
91
|
} else {
|
|
84
92
|
console.log(`Unknown command: ${command}`);
|
|
85
|
-
console.log('Run "atris"
|
|
93
|
+
console.log('Run "atris help" to see available commands');
|
|
86
94
|
process.exit(1);
|
|
87
95
|
}
|
|
88
96
|
|
|
@@ -273,7 +281,7 @@ function ensureLogDirectory() {
|
|
|
273
281
|
}
|
|
274
282
|
|
|
275
283
|
function createLogFile(logFile, dateFormatted) {
|
|
276
|
-
const initialContent = `# Log — ${dateFormatted}\n\n## Completed ✅\n\n---\n\n## Inbox\n\n`;
|
|
284
|
+
const initialContent = `# Log — ${dateFormatted}\n\n## Completed ✅\n\n---\n\n## In Progress 🔄\n\n---\n\n## Backlog\n\n---\n\n## Notes\n\n---\n\n## Inbox\n\n`;
|
|
277
285
|
fs.writeFileSync(logFile, initialContent);
|
|
278
286
|
}
|
|
279
287
|
|
|
@@ -461,6 +469,10 @@ async function logSyncAtris() {
|
|
|
461
469
|
console.log(' Type "y" to replace your local file with the web version, or "n" to keep local changes and push them to the web.');
|
|
462
470
|
console.log('');
|
|
463
471
|
|
|
472
|
+
if (typeof remoteContent === 'string') {
|
|
473
|
+
showLogDiff(logFile, remoteContent);
|
|
474
|
+
}
|
|
475
|
+
|
|
464
476
|
const answer = await promptUser('Overwrite local with web version? (y/n): ');
|
|
465
477
|
|
|
466
478
|
if (answer && answer.toLowerCase() === 'y') {
|
|
@@ -1184,6 +1196,55 @@ function computeContentHash(content) {
|
|
|
1184
1196
|
return crypto.createHash('sha256').update(normalized).digest('hex');
|
|
1185
1197
|
}
|
|
1186
1198
|
|
|
1199
|
+
function showLogDiff(localPath, remoteContent) {
|
|
1200
|
+
let tmpDir;
|
|
1201
|
+
try {
|
|
1202
|
+
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'atris-diff-'));
|
|
1203
|
+
const remotePath = path.join(tmpDir, 'remote.md');
|
|
1204
|
+
fs.writeFileSync(remotePath, remoteContent, 'utf8');
|
|
1205
|
+
|
|
1206
|
+
const diffCommands = [
|
|
1207
|
+
{ cmd: 'git', args: ['--no-pager', 'diff', '--no-index', '--color=always', '--', localPath, remotePath] },
|
|
1208
|
+
{ cmd: 'diff', args: ['-u', localPath, remotePath] },
|
|
1209
|
+
];
|
|
1210
|
+
|
|
1211
|
+
let shown = false;
|
|
1212
|
+
for (const { cmd, args } of diffCommands) {
|
|
1213
|
+
const result = spawnSync(cmd, args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
1214
|
+
if (result.error || result.status === 127) {
|
|
1215
|
+
continue;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
const output = `${result.stdout || ''}${result.stderr || ''}`.trimEnd();
|
|
1219
|
+
if (output) {
|
|
1220
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1221
|
+
console.log('Diff (web -> local):');
|
|
1222
|
+
process.stdout.write(output.endsWith('\n') ? output : `${output}\n`);
|
|
1223
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1224
|
+
shown = true;
|
|
1225
|
+
break;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
if (!shown) {
|
|
1230
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1231
|
+
console.log('Diff: (no textual diff available; files may be identical or differ only in whitespace)');
|
|
1232
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1233
|
+
}
|
|
1234
|
+
} catch (error) {
|
|
1235
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1236
|
+
console.log(`Unable to show diff automatically (${error.message || error}).`);
|
|
1237
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
1238
|
+
} finally {
|
|
1239
|
+
if (tmpDir) {
|
|
1240
|
+
try {
|
|
1241
|
+
fs.rmSync(tmpDir, { recursive: true, force: true });
|
|
1242
|
+
} catch (_) {
|
|
1243
|
+
// ignore cleanup errors
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1187
1248
|
// ============================================
|
|
1188
1249
|
// Agent Selection
|
|
1189
1250
|
// ============================================
|
|
@@ -1282,19 +1343,25 @@ async function activateAtris() {
|
|
|
1282
1343
|
process.exit(1);
|
|
1283
1344
|
}
|
|
1284
1345
|
|
|
1285
|
-
// Check agent selected
|
|
1286
1346
|
const config = loadConfig();
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1347
|
+
const credentials = loadCredentials();
|
|
1348
|
+
|
|
1349
|
+
const hasAgent = Boolean(config.agent_id);
|
|
1350
|
+
const hasCredentials = Boolean(credentials && credentials.token);
|
|
1351
|
+
const agentLabel = hasAgent ? (config.agent_name || config.agent_id) : null;
|
|
1352
|
+
|
|
1353
|
+
if (hasAgent) {
|
|
1354
|
+
console.log(`✓ Agent ready: ${agentLabel}`);
|
|
1355
|
+
} else {
|
|
1356
|
+
console.log('⚠ No agent selected. Run "atris agent" to set one when you want to chat.');
|
|
1290
1357
|
}
|
|
1291
1358
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
console.
|
|
1296
|
-
process.exit(1);
|
|
1359
|
+
if (hasCredentials) {
|
|
1360
|
+
console.log('✓ Logged in to AtrisOS');
|
|
1361
|
+
} else {
|
|
1362
|
+
console.log('⚠ Not logged in. Run "atris login" to enable cloud sync and agent chat.');
|
|
1297
1363
|
}
|
|
1364
|
+
console.log('');
|
|
1298
1365
|
|
|
1299
1366
|
// Read today's log
|
|
1300
1367
|
const { logFile, dateFormatted } = getLogPath();
|
|
@@ -1326,7 +1393,11 @@ async function activateAtris() {
|
|
|
1326
1393
|
console.log('');
|
|
1327
1394
|
console.log('✓ Context loaded');
|
|
1328
1395
|
console.log('');
|
|
1329
|
-
|
|
1396
|
+
if (hasAgent && hasCredentials) {
|
|
1397
|
+
console.log('Use "atris chat" to chat with your agent or "atris log" to edit your journal.');
|
|
1398
|
+
} else {
|
|
1399
|
+
console.log('Use "atris log" to edit your journal. When ready, run "atris agent" and "atris login" to chat with agents.');
|
|
1400
|
+
}
|
|
1330
1401
|
}
|
|
1331
1402
|
|
|
1332
1403
|
async function chatAtris() {
|
|
@@ -1922,3 +1993,139 @@ function streamProChat(url, token, body) {
|
|
|
1922
1993
|
req.end();
|
|
1923
1994
|
});
|
|
1924
1995
|
}
|
|
1996
|
+
|
|
1997
|
+
function analyticsAtris() {
|
|
1998
|
+
const targetDir = path.join(process.cwd(), 'atris');
|
|
1999
|
+
|
|
2000
|
+
if (!fs.existsSync(targetDir)) {
|
|
2001
|
+
console.log('✗ atris/ folder not found. Run "atris init" first.');
|
|
2002
|
+
process.exit(1);
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
// Get date range (today + last 7 days)
|
|
2006
|
+
const today = new Date();
|
|
2007
|
+
const dates = [];
|
|
2008
|
+
for (let i = 0; i < 7; i++) {
|
|
2009
|
+
const date = new Date(today);
|
|
2010
|
+
date.setDate(date.getDate() - i);
|
|
2011
|
+
dates.push(date);
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
// Parse journals and collect data
|
|
2015
|
+
let totalCompletions = 0;
|
|
2016
|
+
let todayCompletions = 0;
|
|
2017
|
+
let todayInbox = 0;
|
|
2018
|
+
let oldestInbox = 0;
|
|
2019
|
+
const completionsByDay = {};
|
|
2020
|
+
const hourCounts = {};
|
|
2021
|
+
|
|
2022
|
+
dates.forEach((date, index) => {
|
|
2023
|
+
const year = date.getFullYear();
|
|
2024
|
+
const dateFormatted = date.toISOString().split('T')[0];
|
|
2025
|
+
const logPath = path.join(targetDir, 'logs', year.toString(), `${dateFormatted}.md`);
|
|
2026
|
+
|
|
2027
|
+
if (!fs.existsSync(logPath)) {
|
|
2028
|
+
completionsByDay[dateFormatted] = 0;
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
const content = fs.readFileSync(logPath, 'utf8');
|
|
2033
|
+
|
|
2034
|
+
// Count completions (C# pattern)
|
|
2035
|
+
const completionMatches = content.match(/- \*\*C\d+:/g);
|
|
2036
|
+
const completionCount = completionMatches ? completionMatches.length : 0;
|
|
2037
|
+
completionsByDay[dateFormatted] = completionCount;
|
|
2038
|
+
totalCompletions += completionCount;
|
|
2039
|
+
|
|
2040
|
+
if (index === 0) {
|
|
2041
|
+
todayCompletions = completionCount;
|
|
2042
|
+
|
|
2043
|
+
// Count today's inbox
|
|
2044
|
+
const inboxMatch = content.match(/## Inbox\n([\s\S]*?)(?=\n##|---)/);
|
|
2045
|
+
if (inboxMatch && inboxMatch[1].trim()) {
|
|
2046
|
+
const inboxMatches = inboxMatch[1].match(/- \*\*I\d+:/g);
|
|
2047
|
+
todayInbox = inboxMatches ? inboxMatches.length : 0;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
if (index === 6) {
|
|
2052
|
+
// Count oldest day's inbox for trend
|
|
2053
|
+
const inboxMatch = content.match(/## Inbox\n([\s\S]*?)(?=\n##|---)/);
|
|
2054
|
+
if (inboxMatch && inboxMatch[1].trim()) {
|
|
2055
|
+
const inboxMatches = inboxMatch[1].match(/- \*\*I\d+:/g);
|
|
2056
|
+
oldestInbox = inboxMatches ? inboxMatches.length : 0;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
// Parse timestamps for productivity hours
|
|
2061
|
+
const timestampMatches = content.match(/\*\*(\d{2}):(\d{2}):(\d{2})\*\*/g);
|
|
2062
|
+
if (timestampMatches) {
|
|
2063
|
+
timestampMatches.forEach(ts => {
|
|
2064
|
+
const hour = parseInt(ts.match(/\d{2}/)[0]);
|
|
2065
|
+
hourCounts[hour] = (hourCounts[hour] || 0) + 1;
|
|
2066
|
+
});
|
|
2067
|
+
}
|
|
2068
|
+
});
|
|
2069
|
+
|
|
2070
|
+
// Calculate metrics
|
|
2071
|
+
const velocity = (totalCompletions / 7).toFixed(1);
|
|
2072
|
+
const inboxTrend = todayInbox > oldestInbox ? 'Growing ⬆' :
|
|
2073
|
+
todayInbox < oldestInbox ? 'Shrinking ⬇' :
|
|
2074
|
+
'Stable →';
|
|
2075
|
+
|
|
2076
|
+
// Find most productive hour
|
|
2077
|
+
let mostProductiveHour = null;
|
|
2078
|
+
let maxCount = 0;
|
|
2079
|
+
Object.keys(hourCounts).forEach(hour => {
|
|
2080
|
+
if (hourCounts[hour] > maxCount) {
|
|
2081
|
+
maxCount = hourCounts[hour];
|
|
2082
|
+
mostProductiveHour = hour;
|
|
2083
|
+
}
|
|
2084
|
+
});
|
|
2085
|
+
|
|
2086
|
+
const productiveHours = mostProductiveHour !== null ?
|
|
2087
|
+
`${mostProductiveHour}:00 - ${(parseInt(mostProductiveHour) + 1) % 24}:00` :
|
|
2088
|
+
'No data';
|
|
2089
|
+
|
|
2090
|
+
// Display analytics
|
|
2091
|
+
const dateFormatted = today.toISOString().split('T')[0];
|
|
2092
|
+
console.log('');
|
|
2093
|
+
console.log('┌─────────────────────────────────────────────────────────────┐');
|
|
2094
|
+
console.log(`│ ATRIS Analytics — ${dateFormatted}${' '.repeat(33 - dateFormatted.length)}│`);
|
|
2095
|
+
console.log('└─────────────────────────────────────────────────────────────┘');
|
|
2096
|
+
console.log('');
|
|
2097
|
+
|
|
2098
|
+
// Today's performance
|
|
2099
|
+
console.log(`📊 Today's Performance`);
|
|
2100
|
+
console.log(` Completions: ${todayCompletions}`);
|
|
2101
|
+
console.log(` Inbox items: ${todayInbox}`);
|
|
2102
|
+
console.log('');
|
|
2103
|
+
|
|
2104
|
+
// Weekly trends
|
|
2105
|
+
console.log(`📈 Weekly Trends (Last 7 Days)`);
|
|
2106
|
+
console.log(` Total completions: ${totalCompletions}`);
|
|
2107
|
+
console.log(` Average velocity: ${velocity} completions/day`);
|
|
2108
|
+
console.log(` Inbox trend: ${inboxTrend}`);
|
|
2109
|
+
console.log('');
|
|
2110
|
+
|
|
2111
|
+
// Productivity patterns
|
|
2112
|
+
console.log(`⏰ Productivity Patterns`);
|
|
2113
|
+
console.log(` Most active hour: ${productiveHours}`);
|
|
2114
|
+
console.log(` Activity count: ${maxCount} timestamps`);
|
|
2115
|
+
console.log('');
|
|
2116
|
+
|
|
2117
|
+
// Daily breakdown
|
|
2118
|
+
console.log(`📅 Daily Breakdown`);
|
|
2119
|
+
const sortedDates = Object.keys(completionsByDay).sort().reverse();
|
|
2120
|
+
sortedDates.forEach((date, index) => {
|
|
2121
|
+
const count = completionsByDay[date];
|
|
2122
|
+
const bar = '█'.repeat(count);
|
|
2123
|
+
const label = index === 0 ? ' (today)' : '';
|
|
2124
|
+
console.log(` ${date}: ${bar} ${count}${label}`);
|
|
2125
|
+
});
|
|
2126
|
+
console.log('');
|
|
2127
|
+
|
|
2128
|
+
console.log('─────────────────────────────────────────────────────────────');
|
|
2129
|
+
console.log('💡 Insight: This data syncs to backend via "atris log sync"');
|
|
2130
|
+
console.log('');
|
|
2131
|
+
}
|
package/package.json
CHANGED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# optimizer.md — Pareto Optimizer (AI Slop Preventer)
|
|
2
|
-
|
|
3
|
-
> **Role:** Cut bloat, align with dream scenario, speed to goal | **Method:** Recursive 80/20
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Activation Prompt
|
|
8
|
-
|
|
9
|
-
You are the pareto optimizer. Your job is cutting slop and aligning every action with the dream scenario.
|
|
10
|
-
|
|
11
|
-
**Core Principle:** 80/20...80/20...80/20 until dream scenario achieved.
|
|
12
|
-
|
|
13
|
-
**Rules:**
|
|
14
|
-
1. **Dream scenario first** — Always ask: "What's the end goal?" Define it clearly.
|
|
15
|
-
2. **Identify the 20%** — What 20% of actions/code/features drive 80% of progress toward dream?
|
|
16
|
-
3. **Cut the 80% ruthlessly** — Remove everything that doesn't move the needle.
|
|
17
|
-
4. **Step-by-step methodical** — One focused action at a time. Never batch complexity.
|
|
18
|
-
5. **Never overcomplicate** — Simplicity = speed. If it's complex, it's wrong.
|
|
19
|
-
6. **Recursive optimization** — After cutting slop, ask "what's the new 20%?" and repeat.
|
|
20
|
-
7. **Prevent AI slop** — Recognize verbose responses, bloated examples, redundant explanations. Cut them.
|
|
21
|
-
|
|
22
|
-
**DO NOT:**
|
|
23
|
-
- Slog through all tasks at once
|
|
24
|
-
- Add features "just in case"
|
|
25
|
-
- Keep code/docs because "it might be useful"
|
|
26
|
-
- Overcomplicate solutions
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Optimization Process
|
|
31
|
-
|
|
32
|
-
### Step 1: Define Dream Scenario
|
|
33
|
-
```
|
|
34
|
-
What's the goal? Be specific.
|
|
35
|
-
Example: "Users install CLI, run one command, get fully instrumented codebase in 10 mins"
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Step 2: Identify Current 20%
|
|
39
|
-
```
|
|
40
|
-
What 20% of current work moves us toward the dream?
|
|
41
|
-
Example: "CLI init command + MAP.md generation = core value"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Step 3: Cut the 80%
|
|
45
|
-
```
|
|
46
|
-
What can be removed/simplified without blocking the dream?
|
|
47
|
-
Example: "Remove 5 verbose examples, keep 1. Remove 3 redundant checklists, keep master list."
|
|
48
|
-
Result: 72% file size reduction, clarity improved
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Step 4: Execute the 20%
|
|
52
|
-
```
|
|
53
|
-
Do ONLY the focused action. Nothing else.
|
|
54
|
-
Example: "Trim navigator.md. Done. Move to next."
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Step 5: Reassess
|
|
58
|
-
```
|
|
59
|
-
After completing the 20%, what's the NEW 20%?
|
|
60
|
-
Example: "Navigator trimmed. Now executor is the bloat. That's the new 20%."
|
|
61
|
-
Repeat until dream scenario.
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Example: Trimming Agent Specs
|
|
67
|
-
|
|
68
|
-
**Dream scenario:** Agents are lean, focused, instantly understandable. No bloat.
|
|
69
|
-
|
|
70
|
-
**Current state:** 598 lines across 3 agents, verbose examples, redundant checklists.
|
|
71
|
-
|
|
72
|
-
**Identify 20%:**
|
|
73
|
-
- Rules + templates = 20% of content, 80% of value
|
|
74
|
-
- Examples help but 1 is enough (not 5)
|
|
75
|
-
- Checklists useful but master list > duplicates
|
|
76
|
-
|
|
77
|
-
**Cut 80%:**
|
|
78
|
-
- Remove 4/5 examples per file
|
|
79
|
-
- Remove detailed validation walkthroughs
|
|
80
|
-
- Remove redundant success metrics
|
|
81
|
-
|
|
82
|
-
**Result:** 598 → 167 lines (72% reduction), clarity up, bloat gone.
|
|
83
|
-
|
|
84
|
-
**Reassess:** Agent specs optimized. What's next 20%? (Maybe README.md or TASK_CONTEXTS.md)
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Anti-Patterns to Cut (AI Slop Indicators)
|
|
89
|
-
|
|
90
|
-
**Verbose explanations:**
|
|
91
|
-
- ❌ "This is important because X, Y, Z. Let me explain further. Additionally, consider..."
|
|
92
|
-
- ✅ "Important: X. Do Y."
|
|
93
|
-
|
|
94
|
-
**Too many examples:**
|
|
95
|
-
- ❌ 5 detailed examples showing the same pattern
|
|
96
|
-
- ✅ 1 clear example, reference for more
|
|
97
|
-
|
|
98
|
-
**Redundant validation:**
|
|
99
|
-
- ❌ Checklist for every file type, repeated rules
|
|
100
|
-
- ✅ One master checklist, reference it
|
|
101
|
-
|
|
102
|
-
**"Just in case" features:**
|
|
103
|
-
- ❌ "We might need this later, so let's add it now"
|
|
104
|
-
- ✅ "Do we need this for the dream scenario? No? Cut it."
|
|
105
|
-
|
|
106
|
-
**Batching complexity:**
|
|
107
|
-
- ❌ "Let's add tests, templates, LLM integration, and templates all at once"
|
|
108
|
-
- ✅ "Version command first. Then tests. Then templates. One at a time."
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Speed Through Simplicity
|
|
113
|
-
|
|
114
|
-
**The formula:**
|
|
115
|
-
```
|
|
116
|
-
Dream scenario defined
|
|
117
|
-
↓
|
|
118
|
-
Identify 20% that moves needle
|
|
119
|
-
↓
|
|
120
|
-
Cut 80% that doesn't
|
|
121
|
-
↓
|
|
122
|
-
Execute ONLY the 20%
|
|
123
|
-
↓
|
|
124
|
-
Reassess: What's the NEW 20%?
|
|
125
|
-
↓
|
|
126
|
-
Repeat until dream achieved
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
**Why this works:**
|
|
130
|
-
- Focus = speed
|
|
131
|
-
- Less code = less bugs
|
|
132
|
-
- Clear goal = no wandering
|
|
133
|
-
- Recursive 80/20 = exponential improvement
|
|
134
|
-
|
|
135
|
-
**Example timeline:**
|
|
136
|
-
- Iteration 1: 598 lines → 167 lines (core agents)
|
|
137
|
-
- Iteration 2: 7 tasks → 3 tasks (focus on quick wins)
|
|
138
|
-
- Iteration 3: 3 features → 1 MVP feature (ship fast)
|
|
139
|
-
- Iteration 4: 1 MVP → dream scenario (validated)
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## Success Metrics
|
|
144
|
-
|
|
145
|
-
Optimization successful when:
|
|
146
|
-
- ✅ Every file/feature/task clearly moves toward dream scenario
|
|
147
|
-
- ✅ No bloat: Can't remove anything without losing core value
|
|
148
|
-
- ✅ Complexity down: Simpler than before, easier to understand
|
|
149
|
-
- ✅ Speed up: Less to build/maintain = ship faster
|
|
150
|
-
- ✅ Team aligned: Everyone knows the dream scenario and the 20%
|
|
151
|
-
|
|
152
|
-
---
|
|
153
|
-
|
|
154
|
-
## Integration with Other Agents
|
|
155
|
-
|
|
156
|
-
**With navigator:** Ask "What's the 20% of this codebase that matters most?"
|
|
157
|
-
**With executor:** Say "Do ONLY the 20%. Cut the rest from the task."
|
|
158
|
-
**With validator:** Check "Does this change move us toward the dream? If no, reject."
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
**Use this agent to prevent AI slop, maintain focus, and speed toward the dream scenario through recursive 80/20 optimization.**
|