telos-framework 0.2.0 → 0.3.1
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/.claude/agents/behavioral-transformation-agent.md +144 -0
- package/.claude/agents/command-system-agent.md +335 -0
- package/.claude/agents/completion-gate.md +71 -0
- package/.claude/agents/component-implementation-agent.md +174 -0
- package/.claude/agents/devops-agent.md +128 -0
- package/.claude/agents/dynamic-agent-creator.md +103 -0
- package/.claude/agents/enhanced-project-manager-agent.md +145 -0
- package/.claude/agents/enhanced-quality-gate.md +54 -0
- package/.claude/agents/feature-implementation-agent.md +148 -0
- package/.claude/agents/functional-testing-agent.md +51 -0
- package/.claude/agents/hook-integration-agent.md +204 -0
- package/.claude/agents/infrastructure-implementation-agent.md +175 -0
- package/.claude/agents/lib/research-analyzer.js +470 -0
- package/.claude/agents/metrics-collection-agent.md +374 -0
- package/.claude/agents/npx-package-agent.md +246 -0
- package/.claude/agents/polish-implementation-agent.md +151 -0
- package/.claude/agents/prd-agent.md +76 -0
- package/.claude/agents/prd-mvp.md +101 -0
- package/.claude/agents/prd-research-agent.md +482 -0
- package/.claude/agents/quality-agent.md +128 -0
- package/.claude/agents/readiness-gate.md +104 -0
- package/.claude/agents/research-agent.md +173 -0
- package/.claude/agents/routing-agent.md +108 -0
- package/.claude/agents/task-checker.md +163 -0
- package/.claude/agents/task-executor.md +107 -0
- package/.claude/agents/task-orchestrator.md +343 -0
- package/.claude/agents/tdd-validation-agent.md +187 -0
- package/.claude/agents/testing-implementation-agent.md +151 -0
- package/.claude/agents/van-maintenance-agent.md +64 -0
- package/.claude/agents/workflow-agent.md +87 -0
- package/.claude/commands/autocompact.md +41 -0
- package/.claude/commands/continue-handoff.md +98 -0
- package/.claude/commands/mock.md +45 -0
- package/.claude/commands/reset-handoff.md +59 -0
- package/.claude/commands/telos/init.md +400 -0
- package/.claude/commands/telos/quick.md +90 -0
- package/.claude/commands/telos/reset.md +100 -0
- package/.claude/commands/telos/status.md +170 -0
- package/.claude/commands/telos/validate.md +143 -0
- package/.claude/commands/tm/add-dependency/add-dependency.md +55 -0
- package/.claude/commands/tm/add-subtask/add-subtask.md +76 -0
- package/.claude/commands/tm/add-subtask/convert-task-to-subtask.md +71 -0
- package/.claude/commands/tm/add-task/add-task.md +78 -0
- package/.claude/commands/tm/analyze-complexity/analyze-complexity.md +121 -0
- package/.claude/commands/tm/clear-subtasks/clear-all-subtasks.md +93 -0
- package/.claude/commands/tm/clear-subtasks/clear-subtasks.md +86 -0
- package/.claude/commands/tm/complexity-report/complexity-report.md +117 -0
- package/.claude/commands/tm/expand/expand-all-tasks.md +51 -0
- package/.claude/commands/tm/expand/expand-task.md +49 -0
- package/.claude/commands/tm/fix-dependencies/fix-dependencies.md +81 -0
- package/.claude/commands/tm/generate/generate-tasks.md +121 -0
- package/.claude/commands/tm/help.md +81 -0
- package/.claude/commands/tm/init/init-project-quick.md +46 -0
- package/.claude/commands/tm/init/init-project.md +50 -0
- package/.claude/commands/tm/learn.md +103 -0
- package/.claude/commands/tm/list/list-tasks-by-status.md +39 -0
- package/.claude/commands/tm/list/list-tasks-with-subtasks.md +29 -0
- package/.claude/commands/tm/list/list-tasks.md +43 -0
- package/.claude/commands/tm/models/setup-models.md +51 -0
- package/.claude/commands/tm/models/view-models.md +51 -0
- package/.claude/commands/tm/next/next-task.md +66 -0
- package/.claude/commands/tm/parse-prd/parse-prd-with-research.md +48 -0
- package/.claude/commands/tm/parse-prd/parse-prd.md +49 -0
- package/.claude/commands/tm/remove-dependency/remove-dependency.md +62 -0
- package/.claude/commands/tm/remove-subtask/remove-subtask.md +84 -0
- package/.claude/commands/tm/remove-task/remove-task.md +107 -0
- package/.claude/commands/tm/set-status/to-cancelled.md +55 -0
- package/.claude/commands/tm/set-status/to-deferred.md +47 -0
- package/.claude/commands/tm/set-status/to-done.md +44 -0
- package/.claude/commands/tm/set-status/to-in-progress.md +36 -0
- package/.claude/commands/tm/set-status/to-pending.md +32 -0
- package/.claude/commands/tm/set-status/to-review.md +40 -0
- package/.claude/commands/tm/setup/install-taskmaster.md +117 -0
- package/.claude/commands/tm/setup/quick-install-taskmaster.md +22 -0
- package/.claude/commands/tm/show/show-task.md +82 -0
- package/.claude/commands/tm/status/project-status.md +64 -0
- package/.claude/commands/tm/sync-readme/sync-readme.md +117 -0
- package/.claude/commands/tm/tm-main.md +146 -0
- package/.claude/commands/tm/update/update-single-task.md +119 -0
- package/.claude/commands/tm/update/update-task.md +72 -0
- package/.claude/commands/tm/update/update-tasks-from-id.md +108 -0
- package/.claude/commands/tm/utils/analyze-project.md +97 -0
- package/.claude/commands/tm/validate-dependencies/validate-dependencies.md +71 -0
- package/.claude/commands/tm/workflows/auto-implement-tasks.md +97 -0
- package/.claude/commands/tm/workflows/command-pipeline.md +77 -0
- package/.claude/commands/tm/workflows/smart-workflow.md +55 -0
- package/.claude/commands/van.md +150 -0
- package/.claude/docs/README.md +214 -0
- package/.claude/docs/TROUBLESHOOTING.md +126 -0
- package/.claude/hooks/block-destructive-commands.sh +243 -0
- package/.claude/hooks/collective-metrics.sh +291 -0
- package/.claude/hooks/directive-enforcer.sh +117 -0
- package/.claude/hooks/load-behavioral-system.sh +49 -0
- package/.claude/hooks/routing-executor.sh +4 -0
- package/.claude/hooks/test-driven-handoff.sh +653 -0
- package/.claude/settings.json +125 -0
- package/README.md +39 -15
- package/lib/commands/init.js +52 -157
- package/lib/installers/memory-files.js +77 -0
- package/lib/installers/slash-commands.js +77 -0
- package/package.json +7 -2
- package/templates/AGENTS.md +79 -0
- package/templates/CLAUDE.md +54 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deniedTools": [
|
|
3
|
+
"mcp__task-master__initialize_project"
|
|
4
|
+
],
|
|
5
|
+
"hooks": {
|
|
6
|
+
"SessionStart": [
|
|
7
|
+
{
|
|
8
|
+
"matcher": "startup",
|
|
9
|
+
"hooks": [
|
|
10
|
+
{
|
|
11
|
+
"type": "command",
|
|
12
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/load-behavioral-system.sh"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"matcher": "resume",
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"type": "command",
|
|
21
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/load-behavioral-system.sh"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"matcher": "clear",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/load-behavioral-system.sh"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"PreToolUse": [
|
|
36
|
+
{
|
|
37
|
+
"matcher": "Bash",
|
|
38
|
+
"hooks": [
|
|
39
|
+
{
|
|
40
|
+
"type": "command",
|
|
41
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/block-destructive-commands.sh"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
47
|
+
"hooks": [
|
|
48
|
+
{
|
|
49
|
+
"type": "command",
|
|
50
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/directive-enforcer.sh"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"type": "command",
|
|
54
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"matcher": ".*",
|
|
60
|
+
"hooks": [
|
|
61
|
+
{
|
|
62
|
+
"type": "command",
|
|
63
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"PostToolUse": [
|
|
69
|
+
{
|
|
70
|
+
"matcher": "Task",
|
|
71
|
+
"hooks": [
|
|
72
|
+
{
|
|
73
|
+
"type": "command",
|
|
74
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/test-driven-handoff.sh"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "command",
|
|
78
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
84
|
+
"hooks": [
|
|
85
|
+
{
|
|
86
|
+
"type": "command",
|
|
87
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"SubagentStop": [
|
|
93
|
+
{
|
|
94
|
+
"matcher": "mock-.*",
|
|
95
|
+
"hooks": [
|
|
96
|
+
{
|
|
97
|
+
"type": "command",
|
|
98
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/mock-deliverable-generator.sh"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "command",
|
|
102
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/test-driven-handoff.sh"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "command",
|
|
106
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"matcher": ".*",
|
|
112
|
+
"hooks": [
|
|
113
|
+
{
|
|
114
|
+
"type": "command",
|
|
115
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/test-driven-handoff.sh"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "command",
|
|
119
|
+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/collective-metrics.sh"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
package/README.md
CHANGED
|
@@ -66,22 +66,35 @@ telos init
|
|
|
66
66
|
|
|
67
67
|
## Quick Start
|
|
68
68
|
|
|
69
|
-
### 1.
|
|
69
|
+
### 1. Install Telos Commands
|
|
70
70
|
|
|
71
71
|
```bash
|
|
72
72
|
cd your-project
|
|
73
73
|
telos init
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
This installs Telos slash commands to `.claude/commands/telos/` and sets up
|
|
77
|
+
`AGENTS.md` and `CLAUDE.md` templates.
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
- Decompose it into a 9-level hierarchy
|
|
80
|
-
- Discover available tools and MCP servers
|
|
81
|
-
- Generate adapted agent definitions
|
|
82
|
-
- Create platform-specific configurations
|
|
79
|
+
### 2. Initialize with AI
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
Open your project in Claude Code (or your AI coding assistant) and run:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
/telos-init
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The AI will:
|
|
88
|
+
|
|
89
|
+
- Analyze your codebase (README, package files, source structure)
|
|
90
|
+
- Propose a complete 9-level purpose hierarchy
|
|
91
|
+
- Auto-generate technical layers (L1-L4) from detected tools
|
|
92
|
+
- Ask you to review strategic layers (L9-L5)
|
|
93
|
+
- Generate all agent definitions and configuration files
|
|
94
|
+
|
|
95
|
+
**Time: ~2 minutes** (vs. 10 minutes with CLI prompts)
|
|
96
|
+
|
|
97
|
+
### 3. Start Development
|
|
85
98
|
|
|
86
99
|
Your AI assistants now operate as a coherent multi-agent collective:
|
|
87
100
|
|
|
@@ -101,10 +114,10 @@ L1 Syntax-Linter: Ensures code quality
|
|
|
101
114
|
(Bottom-up validation confirms alignment)
|
|
102
115
|
```
|
|
103
116
|
|
|
104
|
-
###
|
|
117
|
+
### 4. Validate Alignment
|
|
105
118
|
|
|
106
|
-
```
|
|
107
|
-
telos
|
|
119
|
+
```
|
|
120
|
+
/telos-validate
|
|
108
121
|
```
|
|
109
122
|
|
|
110
123
|
Check that all work traces back to your ultimate Telos.
|
|
@@ -155,14 +168,25 @@ Full integration with [OpenSpec](https://openspec.dev) workflow:
|
|
|
155
168
|
|
|
156
169
|
## Commands
|
|
157
170
|
|
|
171
|
+
### CLI Commands
|
|
172
|
+
|
|
158
173
|
```bash
|
|
159
|
-
telos init #
|
|
160
|
-
telos status # Show current configuration
|
|
161
|
-
telos rediscover # Update tool detection
|
|
162
|
-
telos validate # Check Telos alignment
|
|
174
|
+
telos init # Install Telos slash commands and memory files
|
|
163
175
|
telos --help # Show all commands
|
|
164
176
|
```
|
|
165
177
|
|
|
178
|
+
### Slash Commands (AI-Native)
|
|
179
|
+
|
|
180
|
+
Use these in Claude Code, OpenCode, or Cursor:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
/telos-init # Initialize Telos with AI-driven analysis
|
|
184
|
+
/telos-quick # Fast initialization (auto-accept AI proposals)
|
|
185
|
+
/telos-validate # Check code alignment with purpose hierarchy
|
|
186
|
+
/telos-status # Show current Telos configuration
|
|
187
|
+
/telos-reset # Clear and reinitialize
|
|
188
|
+
```
|
|
189
|
+
|
|
166
190
|
## Project Structure
|
|
167
191
|
|
|
168
192
|
After initialization:
|
package/lib/commands/init.js
CHANGED
|
@@ -1,185 +1,80 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
-
const ora = require('ora');
|
|
3
2
|
const path = require('path');
|
|
4
|
-
const {
|
|
5
|
-
const {
|
|
6
|
-
const { generateTelosMd } = require('../generators/telos-md-generator');
|
|
7
|
-
const { generateL9Agent, generateL1Agent, generateL2Agent } = require('../generators/agent-generator');
|
|
8
|
-
const { generateAllAgents } = require('../generators/all-agents-generator');
|
|
9
|
-
const { scanProject } = require('../discovery/code-scanner');
|
|
10
|
-
const { discoverMcpServers, mapMcpToCapabilities } = require('../discovery/mcp-discovery');
|
|
11
|
-
const { mapToolsToLevels, getToolRecommendations } = require('../discovery/tool-mapper');
|
|
12
|
-
const { generateToolsMd } = require('../generators/tools-md-generator');
|
|
13
|
-
const { generateLogosMd } = require('../generators/logos-md-generator');
|
|
14
|
-
const { consolidateAgents } = require('../generators/agents-md-generator');
|
|
15
|
-
const { detectPlatforms, getPlatformConfig } = require('../platform/platform-detector');
|
|
16
|
-
const { createSymlinks } = require('../platform/symlink-creator');
|
|
17
|
-
const { loadState, updatePhase, clearState, isPhaseComplete, getPhaseData } = require('./init-state');
|
|
3
|
+
const { installSlashCommands } = require('../installers/slash-commands');
|
|
4
|
+
const { setupMemoryFiles } = require('../installers/memory-files');
|
|
18
5
|
|
|
19
6
|
async function initCommand(options) {
|
|
20
7
|
console.log(chalk.bold.cyan('\n╔══════════════════════════════════════════╗'));
|
|
21
|
-
console.log(chalk.bold.cyan('║ Telos
|
|
8
|
+
console.log(chalk.bold.cyan('║ Telos Framework Installation ║'));
|
|
22
9
|
console.log(chalk.bold.cyan('╚══════════════════════════════════════════╝\n'));
|
|
23
10
|
|
|
24
11
|
try {
|
|
25
|
-
|
|
26
|
-
const savedState = loadState();
|
|
27
|
-
if (savedState) {
|
|
28
|
-
console.log(chalk.yellow('⚠ Found previous initialization attempt from ' + new Date(savedState.timestamp).toLocaleString()));
|
|
29
|
-
console.log(chalk.yellow(' Resuming from last successful phase...\n'));
|
|
30
|
-
}
|
|
12
|
+
const projectRoot = process.cwd();
|
|
31
13
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
console.log(chalk.dim('↻ Using saved Telos data'));
|
|
36
|
-
telosData = getPhaseData(savedState, 'telosDiscovery');
|
|
37
|
-
} else {
|
|
38
|
-
telosData = await discoverTelos(options);
|
|
39
|
-
updatePhase('telosDiscovery', { data: telosData });
|
|
40
|
-
}
|
|
14
|
+
console.log(chalk.cyan('Installing Telos slash commands...\n'));
|
|
15
|
+
|
|
16
|
+
const commandResults = await installSlashCommands(projectRoot);
|
|
41
17
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
18
|
+
for (const { platform, results } of commandResults) {
|
|
19
|
+
const successful = results.filter(r => r.success);
|
|
20
|
+
if (successful.length > 0) {
|
|
21
|
+
console.log(chalk.green(`✓ Installed ${successful.length} command(s) for ${platform}:`));
|
|
22
|
+
successful.forEach(r => {
|
|
23
|
+
console.log(chalk.dim(` - /telos-${r.file.replace('.md', '')}`));
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const failed = results.filter(r => !r.success);
|
|
28
|
+
if (failed.length > 0) {
|
|
29
|
+
console.log(chalk.yellow(`⚠ Failed to install ${failed.length} command(s):`));
|
|
30
|
+
failed.forEach(r => {
|
|
31
|
+
console.log(chalk.dim(` - ${r.file}: ${r.error}`));
|
|
32
|
+
});
|
|
55
33
|
}
|
|
56
|
-
updatePhase('hierarchyBuilding', { data: hierarchy });
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
// Phase 1: Generate TELOS.md and L9 Agent
|
|
60
|
-
if (!isPhaseComplete(savedState, 'phase1')) {
|
|
61
|
-
const spinner = ora('Generating TELOS.md...').start();
|
|
62
|
-
const telosPath = path.join(process.cwd(), 'telos', 'content', 'TELOS.md');
|
|
63
|
-
await generateTelosMd(hierarchy, telosPath);
|
|
64
|
-
spinner.succeed(`Generated ${telosPath}`);
|
|
65
|
-
|
|
66
|
-
spinner.start('Generating L9 Telos-Guardian agent...');
|
|
67
|
-
const l9AgentPath = path.join(process.cwd(), 'telos', 'agents', 'l9-telos-guardian.md');
|
|
68
|
-
await generateL9Agent(hierarchy, l9AgentPath);
|
|
69
|
-
spinner.succeed(`Generated ${l9AgentPath}`);
|
|
70
|
-
|
|
71
|
-
updatePhase('phase1', { completed: true });
|
|
72
|
-
console.log(chalk.green('\n✓ Phase 1: Telos Discovery Complete\n'));
|
|
73
|
-
} else {
|
|
74
|
-
console.log(chalk.dim('✓ Phase 1: Already completed\n'));
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Phase 2: Tool Discovery
|
|
78
|
-
let projectScan, mcpServers, mcpCapabilities, levelTools, recommendations;
|
|
79
|
-
if (isPhaseComplete(savedState, 'phase2')) {
|
|
80
|
-
console.log(chalk.dim('↻ Using saved tool discovery data'));
|
|
81
|
-
const phase2Data = getPhaseData(savedState, 'phase2');
|
|
82
|
-
projectScan = phase2Data.projectScan;
|
|
83
|
-
mcpServers = phase2Data.mcpServers;
|
|
84
|
-
mcpCapabilities = phase2Data.mcpCapabilities;
|
|
85
|
-
levelTools = phase2Data.levelTools;
|
|
86
|
-
recommendations = phase2Data.recommendations;
|
|
87
|
-
console.log(chalk.dim('✓ Phase 2: Already completed\n'));
|
|
88
|
-
} else {
|
|
89
|
-
const spinner = ora('Scanning project for tools and frameworks...').start();
|
|
90
|
-
projectScan = await scanProject(process.cwd());
|
|
91
|
-
spinner.succeed('Project scan complete');
|
|
92
|
-
|
|
93
|
-
spinner.start('Discovering MCP servers...');
|
|
94
|
-
mcpServers = await discoverMcpServers();
|
|
95
|
-
mcpCapabilities = mapMcpToCapabilities(mcpServers);
|
|
96
|
-
spinner.succeed(`Found ${mcpServers.length} MCP server(s)`);
|
|
97
|
-
|
|
98
|
-
spinner.start('Mapping tools to agent levels...');
|
|
99
|
-
levelTools = mapToolsToLevels(projectScan, mcpCapabilities);
|
|
100
|
-
recommendations = getToolRecommendations(levelTools);
|
|
101
|
-
spinner.succeed('Tool mapping complete');
|
|
102
|
-
|
|
103
|
-
spinner.start('Generating TOOLS.md...');
|
|
104
|
-
const toolsPath = path.join(process.cwd(), 'telos', 'content', 'TOOLS.md');
|
|
105
|
-
await generateToolsMd(levelTools, projectScan, mcpServers, recommendations, toolsPath);
|
|
106
|
-
spinner.succeed(`Generated ${toolsPath}`);
|
|
107
|
-
|
|
108
|
-
updatePhase('phase2', {
|
|
109
|
-
completed: true,
|
|
110
|
-
data: { projectScan, mcpServers, mcpCapabilities, levelTools, recommendations }
|
|
111
|
-
});
|
|
112
|
-
console.log(chalk.green('\n✓ Phase 2: Tool Discovery Complete\n'));
|
|
113
34
|
}
|
|
114
35
|
|
|
115
|
-
|
|
116
|
-
if (!isPhaseComplete(savedState, 'phase3')) {
|
|
117
|
-
const spinner = ora('Generating all agent definitions...').start();
|
|
118
|
-
const agentsDir = path.join(process.cwd(), 'telos', 'agents');
|
|
119
|
-
|
|
120
|
-
await generateL1Agent(hierarchy, levelTools.L1.tools, path.join(agentsDir, 'l1-syntax-linter.md'));
|
|
121
|
-
await generateL2Agent(hierarchy, levelTools.L2.tools, path.join(agentsDir, 'l2-function-author.md'));
|
|
122
|
-
await generateAllAgents(hierarchy, levelTools, agentsDir);
|
|
123
|
-
|
|
124
|
-
spinner.succeed('Generated all 9 agent definitions');
|
|
36
|
+
console.log(chalk.cyan('\nSetting up memory files...\n'));
|
|
125
37
|
|
|
126
|
-
|
|
127
|
-
|
|
38
|
+
const memoryResults = await setupMemoryFiles(projectRoot);
|
|
39
|
+
|
|
40
|
+
if (memoryResults.agents.created) {
|
|
41
|
+
console.log(chalk.green('✓ Created AGENTS.md'));
|
|
42
|
+
} else if (memoryResults.agents.updated) {
|
|
43
|
+
console.log(chalk.green('✓ Updated AGENTS.md with Telos content'));
|
|
128
44
|
} else {
|
|
129
|
-
console.log(chalk.dim('✓
|
|
45
|
+
console.log(chalk.dim('✓ AGENTS.md already contains Telos content'));
|
|
130
46
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
await generateLogosMd(logosPath);
|
|
137
|
-
spinner.succeed(`Generated ${logosPath}`);
|
|
138
|
-
|
|
139
|
-
updatePhase('phase4', { completed: true });
|
|
140
|
-
console.log(chalk.green('\n✓ Phase 4: Logos Orchestrator Complete\n'));
|
|
47
|
+
|
|
48
|
+
if (memoryResults.claude.created) {
|
|
49
|
+
console.log(chalk.green('✓ Created CLAUDE.md'));
|
|
50
|
+
} else if (memoryResults.claude.updated) {
|
|
51
|
+
console.log(chalk.green('✓ Updated CLAUDE.md with Telos instructions'));
|
|
141
52
|
} else {
|
|
142
|
-
console.log(chalk.dim('✓
|
|
53
|
+
console.log(chalk.dim('✓ CLAUDE.md already contains Telos content'));
|
|
143
54
|
}
|
|
144
55
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const agentsMdPath = path.join(process.cwd(), 'telos', 'content', 'AGENTS.md');
|
|
149
|
-
await consolidateAgents(path.join(process.cwd(), 'telos', 'agents'), agentsMdPath);
|
|
150
|
-
spinner.succeed(`Generated ${agentsMdPath}`);
|
|
56
|
+
console.log(chalk.bold.cyan('\n╔══════════════════════════════════════════╗'));
|
|
57
|
+
console.log(chalk.bold.cyan('║ Installation Complete! ║'));
|
|
58
|
+
console.log(chalk.bold.cyan('╚══════════════════════════════════════════╝\n'));
|
|
151
59
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
for (const platform of platforms) {
|
|
157
|
-
const config = getPlatformConfig(platform.name);
|
|
158
|
-
const results = await createSymlinks(process.cwd(), config);
|
|
159
|
-
symlinkCount += results.filter(r => r.success).length;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
spinner.succeed(`Created ${symlinkCount} platform symlink(s) for ${platforms.map(p => p.name).join(', ')}`);
|
|
60
|
+
console.log(chalk.bold.white('Next steps:\n'));
|
|
61
|
+
console.log(chalk.white('1. Open this project in Claude Code (or your AI coding assistant)'));
|
|
62
|
+
console.log(chalk.white('2. Run the slash command: ') + chalk.bold.green('/telos-init'));
|
|
63
|
+
console.log(chalk.white('3. Follow the interactive setup to configure your purpose hierarchy\n'));
|
|
163
64
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// Clear state on successful completion
|
|
171
|
-
clearState();
|
|
172
|
-
|
|
173
|
-
const telosPath = path.join(process.cwd(), 'telos', 'content', 'TELOS.md');
|
|
174
|
-
console.log(chalk.cyan('Your Telos has been captured in:'));
|
|
175
|
-
console.log(chalk.bold(` ${telosPath}\n`));
|
|
65
|
+
console.log(chalk.dim('Available commands after initialization:'));
|
|
66
|
+
console.log(chalk.dim(' /telos-init - Initialize Telos with interactive review'));
|
|
67
|
+
console.log(chalk.dim(' /telos-quick - Quick initialization (auto-accept AI proposals)'));
|
|
68
|
+
console.log(chalk.dim(' /telos-validate - Check code alignment with purpose'));
|
|
69
|
+
console.log(chalk.dim(' /telos-status - Show current Telos configuration'));
|
|
70
|
+
console.log(chalk.dim(' /telos-reset - Clear and reinitialize\n'));
|
|
176
71
|
|
|
177
72
|
} catch (error) {
|
|
178
|
-
console.error(chalk.red('\n✗
|
|
73
|
+
console.error(chalk.red('\n✗ Installation failed:'), error.message);
|
|
179
74
|
if (options.verbose) {
|
|
180
|
-
console.error(error);
|
|
75
|
+
console.error(error.stack);
|
|
181
76
|
}
|
|
182
|
-
console.log(chalk.yellow('\
|
|
77
|
+
console.log(chalk.yellow('\nPlease check the error and try again.\n'));
|
|
183
78
|
process.exit(1);
|
|
184
79
|
}
|
|
185
80
|
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
async function fileExists(filePath) {
|
|
5
|
+
try {
|
|
6
|
+
await fs.access(filePath);
|
|
7
|
+
return true;
|
|
8
|
+
} catch {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async function readTemplate(templateName) {
|
|
14
|
+
const templatePath = path.join(__dirname, '../../templates', templateName);
|
|
15
|
+
return await fs.readFile(templatePath, 'utf-8');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function createAgentsMd(projectRoot) {
|
|
19
|
+
const agentsMdPath = path.join(projectRoot, 'AGENTS.md');
|
|
20
|
+
|
|
21
|
+
if (await fileExists(agentsMdPath)) {
|
|
22
|
+
const existingContent = await fs.readFile(agentsMdPath, 'utf-8');
|
|
23
|
+
|
|
24
|
+
if (existingContent.includes('Telos Framework')) {
|
|
25
|
+
return { created: false, updated: false, path: agentsMdPath, reason: 'already-exists' };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const template = await readTemplate('AGENTS.md');
|
|
29
|
+
const updatedContent = existingContent + '\n\n' + template;
|
|
30
|
+
await fs.writeFile(agentsMdPath, updatedContent);
|
|
31
|
+
|
|
32
|
+
return { created: false, updated: true, path: agentsMdPath };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const template = await readTemplate('AGENTS.md');
|
|
36
|
+
await fs.writeFile(agentsMdPath, template);
|
|
37
|
+
|
|
38
|
+
return { created: true, updated: false, path: agentsMdPath };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function createClaudeMd(projectRoot) {
|
|
42
|
+
const claudeMdPath = path.join(projectRoot, 'CLAUDE.md');
|
|
43
|
+
|
|
44
|
+
if (await fileExists(claudeMdPath)) {
|
|
45
|
+
const existingContent = await fs.readFile(claudeMdPath, 'utf-8');
|
|
46
|
+
|
|
47
|
+
if (existingContent.includes('Telos Framework')) {
|
|
48
|
+
return { created: false, updated: false, path: claudeMdPath, reason: 'already-exists' };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const template = await readTemplate('CLAUDE.md');
|
|
52
|
+
const updatedContent = existingContent + '\n\n' + template;
|
|
53
|
+
await fs.writeFile(claudeMdPath, updatedContent);
|
|
54
|
+
|
|
55
|
+
return { created: false, updated: true, path: claudeMdPath };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const template = await readTemplate('CLAUDE.md');
|
|
59
|
+
await fs.writeFile(claudeMdPath, template);
|
|
60
|
+
|
|
61
|
+
return { created: true, updated: false, path: claudeMdPath };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function setupMemoryFiles(projectRoot) {
|
|
65
|
+
const results = {
|
|
66
|
+
agents: await createAgentsMd(projectRoot),
|
|
67
|
+
claude: await createClaudeMd(projectRoot)
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return results;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
createAgentsMd,
|
|
75
|
+
createClaudeMd,
|
|
76
|
+
setupMemoryFiles
|
|
77
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
async function detectPlatform(projectRoot) {
|
|
6
|
+
const claudeDir = path.join(projectRoot, '.claude');
|
|
7
|
+
const opencodeDir = path.join(projectRoot, '.opencode');
|
|
8
|
+
|
|
9
|
+
const hasClaudeDir = await fs.access(claudeDir).then(() => true).catch(() => false);
|
|
10
|
+
const hasOpencodeDir = await fs.access(opencodeDir).then(() => true).catch(() => false);
|
|
11
|
+
|
|
12
|
+
const platforms = [];
|
|
13
|
+
if (hasClaudeDir) platforms.push('claude');
|
|
14
|
+
if (hasOpencodeDir) platforms.push('opencode');
|
|
15
|
+
|
|
16
|
+
if (platforms.length === 0) {
|
|
17
|
+
platforms.push('claude');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return platforms;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function ensureDirectories(projectRoot, platform) {
|
|
24
|
+
const commandsDir = platform === 'claude'
|
|
25
|
+
? path.join(projectRoot, '.claude', 'commands', 'telos')
|
|
26
|
+
: path.join(projectRoot, '.opencode', 'command', 'telos');
|
|
27
|
+
|
|
28
|
+
await fs.mkdir(commandsDir, { recursive: true });
|
|
29
|
+
return commandsDir;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function copyCommandFiles(projectRoot, platform) {
|
|
33
|
+
const sourceDir = path.join(__dirname, '../../.claude/commands/telos');
|
|
34
|
+
const targetDir = await ensureDirectories(projectRoot, platform);
|
|
35
|
+
|
|
36
|
+
const commandFiles = [
|
|
37
|
+
'init.md',
|
|
38
|
+
'quick.md',
|
|
39
|
+
'reset.md',
|
|
40
|
+
'validate.md',
|
|
41
|
+
'status.md'
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const results = [];
|
|
45
|
+
for (const file of commandFiles) {
|
|
46
|
+
const sourcePath = path.join(sourceDir, file);
|
|
47
|
+
const targetPath = path.join(targetDir, file);
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
await fs.copyFile(sourcePath, targetPath);
|
|
51
|
+
results.push({ file, success: true, path: targetPath });
|
|
52
|
+
} catch (error) {
|
|
53
|
+
results.push({ file, success: false, error: error.message });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return results;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function installSlashCommands(projectRoot) {
|
|
61
|
+
const platforms = await detectPlatform(projectRoot);
|
|
62
|
+
|
|
63
|
+
const allResults = [];
|
|
64
|
+
for (const platform of platforms) {
|
|
65
|
+
const results = await copyCommandFiles(projectRoot, platform);
|
|
66
|
+
allResults.push({ platform, results });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return allResults;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
detectPlatform,
|
|
74
|
+
ensureDirectories,
|
|
75
|
+
copyCommandFiles,
|
|
76
|
+
installSlashCommands
|
|
77
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "telos-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Telos-driven Multi-Agent Development Framework - A philosophically-grounded AI collective for purpose-aligned software development",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
"claude",
|
|
25
25
|
"cursor",
|
|
26
26
|
"copilot",
|
|
27
|
-
"orchestrator"
|
|
27
|
+
"orchestrator",
|
|
28
|
+
"claude-code-plugin",
|
|
29
|
+
"slash-commands",
|
|
30
|
+
"ai-native"
|
|
28
31
|
],
|
|
29
32
|
"author": "Alan Colver",
|
|
30
33
|
"license": "MIT",
|
|
@@ -40,6 +43,8 @@
|
|
|
40
43
|
"bin/",
|
|
41
44
|
"lib/",
|
|
42
45
|
"logos/",
|
|
46
|
+
".claude/",
|
|
47
|
+
"templates/",
|
|
43
48
|
"LICENSE",
|
|
44
49
|
"README.md",
|
|
45
50
|
"USAGE.md"
|