@liriraid/agentflow-ai 1.0.14 → 1.0.16
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/bin/agentflow.mjs +3 -2
- package/orchestrator.js +590 -80
- package/package.json +1 -5
- package/src/ink/app.mjs +22 -14
- package/src/ink/index.mjs +34 -4
- package/templates/en/ORCHESTRATOR.md +44 -26
- package/templates/es/ORCHESTRATOR.md +55 -23
- package/scripts/scaffold-agent-configs.mjs +0 -100
- package/scripts/scaffold-openspec-change.mjs +0 -84
- package/scripts/update-skill-registry.mjs +0 -174
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
import path from 'path';
|
|
5
|
-
|
|
6
|
-
const ROOT = process.cwd();
|
|
7
|
-
const SKILLS_DIR = path.join(ROOT, '.claude', 'skills');
|
|
8
|
-
const OUTPUT_DIR = path.join(ROOT, '.atl');
|
|
9
|
-
const OUTPUT_FILE = path.join(OUTPUT_DIR, 'skill-registry.md');
|
|
10
|
-
const CONFIG_FILE = path.join(ROOT, 'orchestrator.config.json');
|
|
11
|
-
const CONFIG = fs.existsSync(CONFIG_FILE)
|
|
12
|
-
? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'))
|
|
13
|
-
: {};
|
|
14
|
-
const LANGUAGE = CONFIG.workspaceLanguage === 'en' ? 'en' : 'es';
|
|
15
|
-
const TEXT = {
|
|
16
|
-
es: {
|
|
17
|
-
fallbackRule: 'Usa esta skill solo para el propósito definido en su descripción.',
|
|
18
|
-
entryPoint: 'Punto de entrada de la sesión del orquestador',
|
|
19
|
-
intro:
|
|
20
|
-
'**Project-local only.** Este registry prioriza las skills dentro de `./.claude/skills/` para evitar depender de instalaciones globales como `gentle-ai`.',
|
|
21
|
-
noSkills: '| manual | none | _No hay skills locales todavía_ |',
|
|
22
|
-
noRegistered: 'No hay skills locales registradas todavía.',
|
|
23
|
-
noConventions: '| none | none | No se encontraron archivos de convención |',
|
|
24
|
-
policy: [
|
|
25
|
-
'Prioriza siempre skills locales de `./.claude/skills/`.',
|
|
26
|
-
'No dependas de `~/.claude/skills/` para el funcionamiento principal del orquestador.',
|
|
27
|
-
'Si una skill global existe con el mismo nombre, la local del proyecto gana.',
|
|
28
|
-
'Regenera este archivo después de crear, borrar o cambiar skills locales.'
|
|
29
|
-
],
|
|
30
|
-
updated: file => `Skill registry actualizado en ${file}`
|
|
31
|
-
},
|
|
32
|
-
en: {
|
|
33
|
-
fallbackRule: 'Use this skill only for the purpose defined in its description.',
|
|
34
|
-
entryPoint: 'Orchestrator session entry point',
|
|
35
|
-
intro:
|
|
36
|
-
'**Project-local only.** This registry prioritizes skills inside `./.claude/skills/` so the workflow does not depend on global installations such as `gentle-ai`.',
|
|
37
|
-
noSkills: '| manual | none | _No local skills yet_ |',
|
|
38
|
-
noRegistered: 'No local skills are registered yet.',
|
|
39
|
-
noConventions: '| none | none | No convention files found |',
|
|
40
|
-
policy: [
|
|
41
|
-
'Always prefer local skills from `./.claude/skills/`.',
|
|
42
|
-
'Do not depend on `~/.claude/skills/` for the main orchestrator workflow.',
|
|
43
|
-
'If a global skill has the same name as a project-local skill, the local skill wins.',
|
|
44
|
-
'Regenerate this file after creating, deleting, or changing local skills.'
|
|
45
|
-
],
|
|
46
|
-
updated: file => `Skill registry updated at ${file}`
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const L = TEXT[LANGUAGE];
|
|
50
|
-
|
|
51
|
-
const CONVENTION_FILES = [
|
|
52
|
-
'AGENTS.md',
|
|
53
|
-
'agents.md',
|
|
54
|
-
'CLAUDE.md',
|
|
55
|
-
'ORCHESTRATOR.md',
|
|
56
|
-
'PROJECT.md',
|
|
57
|
-
'README.md'
|
|
58
|
-
];
|
|
59
|
-
|
|
60
|
-
function ensureDir(dir) {
|
|
61
|
-
fs.mkdirSync(dir, {recursive: true});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function listSkillFiles(dir) {
|
|
65
|
-
if (!fs.existsSync(dir)) return [];
|
|
66
|
-
const entries = fs.readdirSync(dir, {withFileTypes: true});
|
|
67
|
-
const files = [];
|
|
68
|
-
for (const entry of entries) {
|
|
69
|
-
if (!entry.isDirectory()) continue;
|
|
70
|
-
const name = entry.name;
|
|
71
|
-
if (name === '_shared') continue;
|
|
72
|
-
const file = path.join(dir, name, 'SKILL.md');
|
|
73
|
-
if (fs.existsSync(file)) files.push(file);
|
|
74
|
-
}
|
|
75
|
-
return files.sort((a, b) => a.localeCompare(b));
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function extractName(content, fallback) {
|
|
79
|
-
const match = content.match(/^\s*name:\s*(.+)$/im);
|
|
80
|
-
return match ? match[1].trim().replace(/^['"]|['"]$/g, '') : fallback;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function extractTrigger(content = '') {
|
|
84
|
-
const triggerLine = content.match(/^Trigger:\s*(.+)$/im);
|
|
85
|
-
if (triggerLine) return triggerLine[1].trim();
|
|
86
|
-
const descriptionTrigger = content.match(/Trigger:\s*([^.\n]+)/im);
|
|
87
|
-
return descriptionTrigger ? descriptionTrigger[1].trim() : 'manual';
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function compactRules(content) {
|
|
91
|
-
const lines = content
|
|
92
|
-
.split('\n')
|
|
93
|
-
.map(line => line.trim())
|
|
94
|
-
.filter(Boolean);
|
|
95
|
-
|
|
96
|
-
const bullets = [];
|
|
97
|
-
for (const line of lines) {
|
|
98
|
-
if (line.startsWith('- ') || line.startsWith('* ')) {
|
|
99
|
-
bullets.push(line.replace(/^[-*]\s*/, ''));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const selected = bullets.slice(0, 8);
|
|
104
|
-
return selected.length > 0
|
|
105
|
-
? selected
|
|
106
|
-
: [L.fallbackRule];
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function toPosix(filePath) {
|
|
110
|
-
return filePath.replaceAll('\\', '/');
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function buildRegistry() {
|
|
114
|
-
const skillFiles = listSkillFiles(SKILLS_DIR);
|
|
115
|
-
const skills = skillFiles.map(file => {
|
|
116
|
-
const content = fs.readFileSync(file, 'utf8');
|
|
117
|
-
return {
|
|
118
|
-
name: extractName(content, path.basename(path.dirname(file))),
|
|
119
|
-
trigger: extractTrigger(content),
|
|
120
|
-
path: toPosix(path.relative(ROOT, file)),
|
|
121
|
-
rules: compactRules(content)
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
const conventions = CONVENTION_FILES.filter(file => fs.existsSync(path.join(ROOT, file))).map(
|
|
126
|
-
file => ({
|
|
127
|
-
file,
|
|
128
|
-
path: toPosix(file),
|
|
129
|
-
notes: file === 'ORCHESTRATOR.md' ? L.entryPoint : ''
|
|
130
|
-
})
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const registry = [
|
|
134
|
-
'# Skill Registry',
|
|
135
|
-
'',
|
|
136
|
-
L.intro,
|
|
137
|
-
'',
|
|
138
|
-
'## User Skills',
|
|
139
|
-
'',
|
|
140
|
-
'| Trigger | Skill | Path |',
|
|
141
|
-
'|---------|-------|------|',
|
|
142
|
-
...(skills.length > 0
|
|
143
|
-
? skills.map(skill => `| ${skill.trigger.replaceAll('|', '\\|')} | ${skill.name} | \`${skill.path}\` |`)
|
|
144
|
-
: [L.noSkills]),
|
|
145
|
-
'',
|
|
146
|
-
'## Compact Rules',
|
|
147
|
-
'',
|
|
148
|
-
...(skills.length > 0
|
|
149
|
-
? skills.flatMap(skill => [
|
|
150
|
-
`### ${skill.name}`,
|
|
151
|
-
...skill.rules.map(rule => `- ${rule}`),
|
|
152
|
-
''
|
|
153
|
-
])
|
|
154
|
-
: [L.noRegistered, '']),
|
|
155
|
-
'## Project Conventions',
|
|
156
|
-
'',
|
|
157
|
-
'| File | Path | Notes |',
|
|
158
|
-
'|------|------|-------|',
|
|
159
|
-
...(conventions.length > 0
|
|
160
|
-
? conventions.map(item => `| ${item.file} | \`${item.path}\` | ${item.notes || ''} |`)
|
|
161
|
-
: [L.noConventions]),
|
|
162
|
-
'',
|
|
163
|
-
'## Resolution Policy',
|
|
164
|
-
'',
|
|
165
|
-
...L.policy.map(rule => `- ${rule}`)
|
|
166
|
-
];
|
|
167
|
-
|
|
168
|
-
return registry.join('\n');
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
ensureDir(OUTPUT_DIR);
|
|
172
|
-
const registry = buildRegistry();
|
|
173
|
-
fs.writeFileSync(OUTPUT_FILE, `${registry}\n`, 'utf8');
|
|
174
|
-
console.log(L.updated(OUTPUT_FILE));
|