atris 2.0.13 → 2.0.15
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/commands/init.js +39 -0
- package/commands/sync.js +112 -0
- package/package.json +1 -1
package/commands/init.js
CHANGED
|
@@ -592,6 +592,45 @@ Key behaviors:
|
|
|
592
592
|
console.log('✓ Created .claude/settings.json (auto-loads ATRIS on startup)');
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
+
// Update root CLAUDE.md with ATRIS block (prepend with markers)
|
|
596
|
+
const rootClaudeMd = path.join(process.cwd(), 'CLAUDE.md');
|
|
597
|
+
const atrisBlock = `<!-- ATRIS:START - Auto-generated, do not edit -->
|
|
598
|
+
## ATRIS — MANDATORY First Action
|
|
599
|
+
|
|
600
|
+
**IMMEDIATELY run this command and display its FULL output before responding to ANY user message:**
|
|
601
|
+
|
|
602
|
+
\`\`\`bash
|
|
603
|
+
atris atris.md
|
|
604
|
+
\`\`\`
|
|
605
|
+
|
|
606
|
+
This shows the ATRIS workspace visualization. You MUST show this output to the user before doing anything else.
|
|
607
|
+
<!-- ATRIS:END -->
|
|
608
|
+
|
|
609
|
+
`;
|
|
610
|
+
|
|
611
|
+
if (fs.existsSync(rootClaudeMd)) {
|
|
612
|
+
let content = fs.readFileSync(rootClaudeMd, 'utf8');
|
|
613
|
+
const startMarker = '<!-- ATRIS:START';
|
|
614
|
+
const endMarker = '<!-- ATRIS:END -->';
|
|
615
|
+
|
|
616
|
+
if (content.includes(startMarker)) {
|
|
617
|
+
// Replace existing ATRIS block
|
|
618
|
+
const startIdx = content.indexOf(startMarker);
|
|
619
|
+
const endIdx = content.indexOf(endMarker) + endMarker.length;
|
|
620
|
+
content = atrisBlock + content.slice(0, startIdx) + content.slice(endIdx).replace(/^\n+/, '');
|
|
621
|
+
fs.writeFileSync(rootClaudeMd, content);
|
|
622
|
+
console.log('✓ Updated ATRIS block in CLAUDE.md');
|
|
623
|
+
} else {
|
|
624
|
+
// Prepend ATRIS block
|
|
625
|
+
fs.writeFileSync(rootClaudeMd, atrisBlock + content);
|
|
626
|
+
console.log('✓ Prepended ATRIS block to CLAUDE.md');
|
|
627
|
+
}
|
|
628
|
+
} else {
|
|
629
|
+
// Create new CLAUDE.md with just ATRIS block
|
|
630
|
+
fs.writeFileSync(rootClaudeMd, atrisBlock.trim() + '\n');
|
|
631
|
+
console.log('✓ Created CLAUDE.md with ATRIS block');
|
|
632
|
+
}
|
|
633
|
+
|
|
595
634
|
if (fs.existsSync(sourceFile)) {
|
|
596
635
|
fs.copyFileSync(sourceFile, targetFile);
|
|
597
636
|
console.log('✓ Copied atris.md to atris/ folder');
|
package/commands/sync.js
CHANGED
|
@@ -68,6 +68,118 @@ function syncAtris() {
|
|
|
68
68
|
console.log('✓ Migrated TASK_CONTEXTS.md to TODO.md');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
// Update .claude/skills/atris/SKILL.md
|
|
72
|
+
const claudeSkillsDir = path.join(process.cwd(), '.claude', 'skills', 'atris');
|
|
73
|
+
const claudeSkillFile = path.join(claudeSkillsDir, 'SKILL.md');
|
|
74
|
+
const skillContent = `---
|
|
75
|
+
name: atris
|
|
76
|
+
description: ATRIS workspace navigation. Triggers on: atris, TODO, tasks, MAP.md, backlog, "where is X?"
|
|
77
|
+
allowed-tools: Read, Bash, Glob, Grep, Write, Edit
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
# ATRIS Skill
|
|
81
|
+
|
|
82
|
+
## IMPORTANT: First Interaction
|
|
83
|
+
|
|
84
|
+
**On your FIRST message in any ATRIS project, IMMEDIATELY run:**
|
|
85
|
+
|
|
86
|
+
\`\`\`bash
|
|
87
|
+
atris atris.md
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
Show the full ASCII output to the user. This displays the ATRIS welcome visualization with workspace stats. Do this BEFORE responding to whatever the user said.
|
|
91
|
+
|
|
92
|
+
## Workflow
|
|
93
|
+
|
|
94
|
+
Detect: Project has \`atris/\` folder with MAP.md, TODO.md, PERSONA.md
|
|
95
|
+
|
|
96
|
+
Commands: plan → do → review
|
|
97
|
+
|
|
98
|
+
Key behaviors:
|
|
99
|
+
- Read PERSONA.md (3-4 sentences, ASCII visuals)
|
|
100
|
+
- Check MAP.md for file:line refs
|
|
101
|
+
- Update TODO.md (claim tasks, delete when done)`;
|
|
102
|
+
|
|
103
|
+
if (!fs.existsSync(claudeSkillsDir)) {
|
|
104
|
+
fs.mkdirSync(claudeSkillsDir, { recursive: true });
|
|
105
|
+
}
|
|
106
|
+
const currentSkill = fs.existsSync(claudeSkillFile) ? fs.readFileSync(claudeSkillFile, 'utf8') : '';
|
|
107
|
+
if (currentSkill !== skillContent) {
|
|
108
|
+
fs.writeFileSync(claudeSkillFile, skillContent);
|
|
109
|
+
console.log('✓ Updated .claude/skills/atris/SKILL.md');
|
|
110
|
+
updated++;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Update .claude/settings.json with SessionStart hook
|
|
114
|
+
const claudeSettingsFile = path.join(process.cwd(), '.claude', 'settings.json');
|
|
115
|
+
if (!fs.existsSync(claudeSettingsFile)) {
|
|
116
|
+
const claudeSettings = {
|
|
117
|
+
hooks: {
|
|
118
|
+
SessionStart: [
|
|
119
|
+
{
|
|
120
|
+
hooks: [
|
|
121
|
+
{
|
|
122
|
+
type: "command",
|
|
123
|
+
command: "[ -d atris ] && atris atris.md || true"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
fs.writeFileSync(claudeSettingsFile, JSON.stringify(claudeSettings, null, 2));
|
|
131
|
+
console.log('✓ Created .claude/settings.json (SessionStart hook)');
|
|
132
|
+
updated++;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Update root CLAUDE.md with ATRIS block (prepend with markers)
|
|
136
|
+
const rootClaudeMd = path.join(process.cwd(), 'CLAUDE.md');
|
|
137
|
+
const atrisBlock = `<!-- ATRIS:START - Auto-generated, do not edit -->
|
|
138
|
+
## ATRIS — MANDATORY First Action
|
|
139
|
+
|
|
140
|
+
**IMMEDIATELY run this command and display its FULL output before responding to ANY user message:**
|
|
141
|
+
|
|
142
|
+
\`\`\`bash
|
|
143
|
+
atris atris.md
|
|
144
|
+
\`\`\`
|
|
145
|
+
|
|
146
|
+
This shows the ATRIS workspace visualization. You MUST show this output to the user before doing anything else.
|
|
147
|
+
<!-- ATRIS:END -->
|
|
148
|
+
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
if (fs.existsSync(rootClaudeMd)) {
|
|
152
|
+
let content = fs.readFileSync(rootClaudeMd, 'utf8');
|
|
153
|
+
const startMarker = '<!-- ATRIS:START';
|
|
154
|
+
const endMarker = '<!-- ATRIS:END -->';
|
|
155
|
+
|
|
156
|
+
if (content.includes(startMarker)) {
|
|
157
|
+
// Check if update needed
|
|
158
|
+
const startIdx = content.indexOf(startMarker);
|
|
159
|
+
const endIdx = content.indexOf(endMarker) + endMarker.length;
|
|
160
|
+
const existingBlock = content.slice(startIdx, endIdx);
|
|
161
|
+
const newBlockTrimmed = atrisBlock.trim().slice(0, -1); // Remove trailing newline for comparison
|
|
162
|
+
|
|
163
|
+
if (!existingBlock.includes('MANDATORY First Action')) {
|
|
164
|
+
// Replace existing ATRIS block with new version
|
|
165
|
+
content = atrisBlock + content.slice(0, startIdx) + content.slice(endIdx).replace(/^\n+/, '');
|
|
166
|
+
fs.writeFileSync(rootClaudeMd, content);
|
|
167
|
+
console.log('✓ Updated ATRIS block in CLAUDE.md');
|
|
168
|
+
updated++;
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
// Prepend ATRIS block
|
|
172
|
+
fs.writeFileSync(rootClaudeMd, atrisBlock + content);
|
|
173
|
+
console.log('✓ Prepended ATRIS block to CLAUDE.md');
|
|
174
|
+
updated++;
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
// Create new CLAUDE.md with just ATRIS block
|
|
178
|
+
fs.writeFileSync(rootClaudeMd, atrisBlock.trim() + '\n');
|
|
179
|
+
console.log('✓ Created CLAUDE.md with ATRIS block');
|
|
180
|
+
updated++;
|
|
181
|
+
}
|
|
182
|
+
|
|
71
183
|
if (updated === 0) {
|
|
72
184
|
console.log('✓ Already up to date');
|
|
73
185
|
} else {
|
package/package.json
CHANGED