@fprad0/skill-master-mcp 0.0.8 → 0.0.9

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +47 -8
  3. package/VERSION.md +3 -3
  4. package/bin/lib/menu-core.mjs +157 -1
  5. package/bin/skill-master-bootstrap-global.mjs +35 -0
  6. package/bin/skill-master-install-global-skills.mjs +77 -0
  7. package/bin/skill-master-register-clients.mjs +154 -0
  8. package/dist/domain-router.d.ts +11 -0
  9. package/dist/domain-router.d.ts.map +1 -0
  10. package/dist/domain-router.js +79 -0
  11. package/dist/domain-router.js.map +1 -0
  12. package/dist/index.js +134 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/moral-governance.d.ts +24 -0
  15. package/dist/moral-governance.d.ts.map +1 -0
  16. package/dist/moral-governance.js +143 -0
  17. package/dist/moral-governance.js.map +1 -0
  18. package/dist/prompt-router.d.ts +4 -0
  19. package/dist/prompt-router.d.ts.map +1 -1
  20. package/dist/prompt-router.js +18 -2
  21. package/dist/prompt-router.js.map +1 -1
  22. package/docs/planning/V0_0_9_APROVACAO_CRITICA_MENSAGENS_DE_VENDA.md +85 -0
  23. package/docs/planning/V0_0_9_FONTES_E_CRITERIOS_DE_AUTORIDADE.md +139 -0
  24. package/docs/planning/V0_0_9_MATRIZ_SKILLS_MULTIDISCIPLINARES.md +105 -0
  25. package/docs/planning/V0_0_9_POLITICA_MORAL_CATOLICA_PARA_IA.md +181 -0
  26. package/docs/planning/V0_0_9_PROMPTS_EXECUCAO.md +59 -0
  27. package/docs/planning/V0_0_9_ROADMAP_DISCERNIMENTO_E_CONHECIMENTO_AMPLO.md +181 -0
  28. package/docs/skill-candidates/v0.0.9/ai-ethics-human-dignity/SKILL.md +32 -0
  29. package/docs/skill-candidates/v0.0.9/broad-domain-router/SKILL.md +41 -0
  30. package/docs/skill-candidates/v0.0.9/catholic-moral-discernment/SKILL.md +31 -0
  31. package/docs/skill-candidates/v0.0.9/engineering-systems-master/SKILL.md +31 -0
  32. package/docs/skill-candidates/v0.0.9/language-quality-pt-en-fr/SKILL.md +28 -0
  33. package/docs/skill-candidates/v0.0.9/math-science-reasoning/SKILL.md +29 -0
  34. package/docs/skill-candidates/v0.0.9/philosophy-sociology-discernment/SKILL.md +28 -0
  35. package/docs/skill-candidates/v0.0.9/professional-boundary-triage/SKILL.md +40 -0
  36. package/docs/skill-candidates/v0.0.9/release-ethics-gate/SKILL.md +32 -0
  37. package/docs/skill-candidates/v0.0.9/source-authority-reviewer/SKILL.md +31 -0
  38. package/manifests/channels/beta.json +7 -7
  39. package/manifests/channels/stable.json +8 -8
  40. package/package.json +6 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to `skill_master` will be tracked here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.0.9] - 2026-06-28
8
+
9
+ - Add Catholic-inspired moral governance with `skill_master_moral_discernment`, moral gates, and prompt-router integration.
10
+ - Add broad domain routing with `skill_master_domain_router` and global multidisciplinary skill recommendations.
11
+ - Add bundled global Skill Master skills for moral discernment, AI ethics, professional boundaries, languages, science, philosophy, sociology, engineering, source review, and release ethics.
12
+ - Add `skill-master-install-global-skills` to install bundled skills into `CODEX_HOME/skills` or `~/.codex/skills`.
13
+ - Add `skill-master-register-clients` to generate/apply MCP registration for Codex, Claude Desktop, and Gemini.
7
14
  - Prepare a public npm publication path with dedicated workflow and operator guide.
8
15
  - Upgrade release automation from Node `20` to Node `22`.
9
16
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Skill Master MCP
2
2
 
3
- Versao planejada: `00.02`
3
+ Versao planejada: `00.03`
4
4
 
5
5
  Este repositorio e a base independente do MCP `skill_master`. Ele nao pertence ao LinkBiz e deve evoluir como um projeto pessoal, preferencialmente publicado em um GitHub particular.
6
6
 
@@ -8,9 +8,9 @@ Este repositorio e a base independente do MCP `skill_master`. Ele nao pertence a
8
8
 
9
9
  Criar um MCP capaz de catalogar skills locais e remotas, recomendar as melhores skills para um prompt e manter atualizacoes automaticas para varios computadores e usuarios.
10
10
 
11
- ## Decisao da versao 00.02
11
+ ## Decisao da versao 00.03
12
12
 
13
- A versao `00.02` consolida:
13
+ A versao `00.03` consolida:
14
14
 
15
15
  - distribuicao publica por `npmjs.org`
16
16
  - distribuicao privada por GitHub Packages
@@ -108,20 +108,22 @@ npm install -g @fprad0/skill-master-mcp
108
108
  npx -y @fprad0/skill-master-mcp@latest
109
109
  ```
110
110
 
111
- Estado atual preparado em `2026-06-27`:
111
+ Estado atual preparado em `2026-06-28`:
112
112
 
113
- - release local preparada: `@fprad0/skill-master-mcp@0.0.8`
113
+ - release publica: `@fprad0/skill-master-mcp@0.0.9`
114
+ - `latest` no npmjs aponta para `0.0.9`
114
115
  - validacao de pacote por tarball local confirmada
115
- - publicacao no npmjs aguardando autenticacao npmjs nesta maquina
116
- - apos publicar, validar `npm install`, `npx` e dist-tag `latest`
116
+ - validacao de instalacao publica via `npm install @fprad0/skill-master-mcp@0.0.9` confirmada
117
117
 
118
118
  Comandos globais principais:
119
119
 
120
120
  ```bash
121
121
  skill-master-activation
122
122
  skill-master-eval-activation
123
+ skill-master-install-global-skills
123
124
  skill-master-mcp
124
125
  skill-master-menu
126
+ skill-master-register-clients
125
127
  skill-master-success-skills
126
128
  skill-master-update
127
129
  skill-master-configure-private-registry
@@ -139,6 +141,9 @@ O menu agora possui modo visual interativo para terminal com TTY e tambem aceita
139
141
  skill-master-menu --run status
140
142
  skill-master-menu --run check
141
143
  skill-master-menu --run update --yes
144
+ skill-master-menu --run install-global-skills
145
+ skill-master-menu --run bootstrap-global
146
+ skill-master-menu --run register-clients
142
147
  skill-master-menu --run notifications
143
148
  skill-master-menu --run study-skills
144
149
  skill-master-menu --run approval-package
@@ -149,6 +154,36 @@ skill-master-menu --run notion-summary
149
154
 
150
155
  O menu visual usa `prompts` para ficar mais legivel no terminal e manter compatibilidade com `Node 18+`.
151
156
 
157
+ Quando o menu detectar que o MCP ainda nao esta globalmente pronto neste computador, ele mostra um alerta forte e um aviso sutil explicando que a instalacao global e o registro dos clientes sao necessarios para o `skill_master` parecer parte do sistema em Codex, Claude e Gemini.
158
+
159
+ Para instalar as skills globais embutidas de discernimento, conhecimento amplo, engenharia e governanca moral:
160
+
161
+ ```bash
162
+ skill-master-install-global-skills
163
+ ```
164
+
165
+ Para fazer o bootstrap global completo em um passo:
166
+
167
+ ```bash
168
+ skill-master-bootstrap-global
169
+ ```
170
+
171
+ Para registrar o MCP nos clientes principais usando o binario global `skill-master-mcp`:
172
+
173
+ ```bash
174
+ skill-master-register-clients --apply-codex
175
+ skill-master-register-clients --apply-claude
176
+ skill-master-register-clients --apply-gemini
177
+ ```
178
+
179
+ Atalho para gerar snippets e aplicar nos tres:
180
+
181
+ ```bash
182
+ skill-master-register-clients --apply-all
183
+ ```
184
+
185
+ Isso configura o servidor MCP `skill_master` em Codex, Claude Desktop e Gemini quando os arquivos de configuracao locais estiverem disponiveis. Reinicie o cliente depois do registro.
186
+
152
187
  O menu tambem mostra notificacoes de skills aprendidas pendentes e links externos para estudo. As acoes de ativacao sao:
153
188
 
154
189
  - `skill-master-menu --run activate-learned-local`: instala uma skill aprovada em `.codex/skills` do workspace atual.
@@ -204,7 +239,7 @@ Os dois caminhos configuram:
204
239
 
205
240
  ## Compatibilidade com Claude e Gemini
206
241
 
207
- A versao `00.02` documenta compatibilidade operacional ja preparada para:
242
+ A versao `00.03` documenta compatibilidade operacional ja preparada para:
208
243
 
209
244
  - Claude Desktop
210
245
  - Claude Code
@@ -234,6 +269,10 @@ Ferramentas MCP principais:
234
269
  - `skill_master_prompt_router`
235
270
  - `skill_master_activation_check`
236
271
  - `skill_master_recommend`
272
+ - `skill_master_moral_discernment`
273
+ - `skill_master_domain_router`
274
+ - `skill_master_bootstrap_global`
275
+ - `skill_master_install_global_skills`
237
276
  - `skill_master_prepare_skill_contribution`
238
277
  - `skill_master_review_skill_contribution`
239
278
  - `skill_master_prepare_success_skill`
package/VERSION.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Versão
2
2
 
3
- Versão funcional planejada: `00.02`
3
+ Versão funcional planejada: `00.03`
4
4
 
5
- Versão técnica para empacotamento semântico: `0.0.8`
5
+ Versão técnica para empacotamento semântico: `0.0.9`
6
6
 
7
7
  ## Observação
8
8
 
9
- O nome `00.02` será usado na comunicação e nos documentos. Para ferramentas que exigem SemVer, como npm e alguns fluxos de release, usar `0.0.8`.
9
+ O nome `00.03` será usado na comunicação e nos documentos. Para ferramentas que exigem SemVer, como npm e alguns fluxos de release, usar `0.0.9`.
@@ -1,5 +1,6 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { existsSync, readFileSync, readdirSync } from 'node:fs';
3
+ import os from 'node:os';
3
4
  import { join } from 'node:path';
4
5
  import process from 'node:process';
5
6
 
@@ -13,10 +14,91 @@ const ANSI = {
13
14
  red: '\x1b[31m',
14
15
  };
15
16
 
17
+ const REQUIRED_GLOBAL_SKILLS = [
18
+ 'catholic-moral-discernment',
19
+ 'ai-ethics-human-dignity',
20
+ 'professional-boundary-triage',
21
+ 'broad-domain-router',
22
+ 'language-quality-pt-en-fr',
23
+ 'math-science-reasoning',
24
+ 'philosophy-sociology-discernment',
25
+ 'engineering-systems-master',
26
+ 'source-authority-reviewer',
27
+ 'release-ethics-gate',
28
+ ];
29
+
16
30
  function colorize(text, color, enabled) {
17
31
  return enabled ? `${color}${text}${ANSI.reset}` : text;
18
32
  }
19
33
 
34
+ function globalSkillsRoot() {
35
+ return join(process.env.CODEX_HOME ?? join(os.homedir(), '.codex'), 'skills');
36
+ }
37
+
38
+ function readClientConfigState(filePath) {
39
+ if (!existsSync(filePath)) {
40
+ return { present: false, kind: 'missing', globalCommand: false };
41
+ }
42
+
43
+ const content = readFileSync(filePath, 'utf8');
44
+ const hasSkillMaster = content.includes('skill_master');
45
+ const hasGlobalCommand = content.includes('command = "skill-master-mcp"') || content.includes("command = 'skill-master-mcp'");
46
+ const hasLauncher = content.includes('skill-master-launcher');
47
+
48
+ return {
49
+ present: true,
50
+ kind: hasGlobalCommand ? 'global' : hasLauncher ? 'launcher' : hasSkillMaster ? 'custom' : 'unknown',
51
+ globalCommand: hasGlobalCommand,
52
+ };
53
+ }
54
+
55
+ function readJsonState(filePath) {
56
+ if (!existsSync(filePath)) {
57
+ return { present: false, globalCommand: false };
58
+ }
59
+
60
+ try {
61
+ const parsed = JSON.parse(readFileSync(filePath, 'utf8'));
62
+ const server = parsed?.mcpServers?.skill_master;
63
+ return {
64
+ present: true,
65
+ globalCommand: server?.command === 'skill-master-mcp',
66
+ };
67
+ } catch {
68
+ return { present: true, globalCommand: false };
69
+ }
70
+ }
71
+
72
+ function inspectGlobalReadiness() {
73
+ const root = globalSkillsRoot();
74
+ const installed = REQUIRED_GLOBAL_SKILLS.filter((name) => existsSync(join(root, name, 'SKILL.md')));
75
+ const missing = REQUIRED_GLOBAL_SKILLS.filter((name) => !installed.includes(name));
76
+ const codexConfigPath = join(process.env.CODEX_HOME ?? join(os.homedir(), '.codex'), 'config.toml');
77
+ const claudeConfigPath = join(os.homedir(), '.config', 'Claude', 'claude_desktop_config.json');
78
+ const geminiConfigPath = join(os.homedir(), '.gemini', 'settings.json');
79
+ const codex = readClientConfigState(codexConfigPath);
80
+ const claude = readJsonState(claudeConfigPath);
81
+ const gemini = readJsonState(geminiConfigPath);
82
+ const ready = missing.length === 0 && codex.globalCommand && claude.globalCommand && gemini.globalCommand;
83
+ const mode = ready
84
+ ? 'ready'
85
+ : codex.kind === 'launcher' || claude.present || gemini.present
86
+ ? 'partial'
87
+ : 'missing';
88
+
89
+ return {
90
+ root,
91
+ required: REQUIRED_GLOBAL_SKILLS.length,
92
+ installed,
93
+ missing,
94
+ ready,
95
+ mode,
96
+ codex,
97
+ claude,
98
+ gemini,
99
+ };
100
+ }
101
+
20
102
  export function readJson(rootDir, relativePath) {
21
103
  const target = join(rootDir, relativePath);
22
104
  if (!existsSync(target)) {
@@ -42,6 +124,7 @@ export function getMenuStatus(rootDir) {
42
124
  const successLearningDir = process.env.SKILL_MASTER_SUCCESS_LEARNING_DIR
43
125
  ?? join(process.env.SKILL_MASTER_HOME ?? join(process.env.HOME ?? process.env.USERPROFILE ?? '', '.skill-master'), 'data', 'success-learning');
44
126
  const studyCandidates = readJson(rootDir, 'network/unapproved-skill-candidates.json');
127
+ const globalReadiness = inspectGlobalReadiness();
45
128
 
46
129
  return {
47
130
  packageName: packageJson?.name ?? 'nao encontrado',
@@ -52,6 +135,7 @@ export function getMenuStatus(rootDir) {
52
135
  rootDir,
53
136
  pendingSuccessDrafts: countManifestFiles(successLearningDir),
54
137
  studyCandidates: Array.isArray(studyCandidates?.candidates) ? studyCandidates.candidates.length : 0,
138
+ globalReadiness,
55
139
  };
56
140
  }
57
141
 
@@ -155,6 +239,33 @@ export function buildMenuCommands({ rootDir, currentFile, nodeExecPath = process
155
239
  args: [join(rootDir, 'bin', 'skill-master-activation.mjs'), '--set-mode', 'always-on-assisted'],
156
240
  confirmMessage: 'Alterar o modo local para always-on-assisted?',
157
241
  },
242
+ {
243
+ key: 'installGlobalSkills',
244
+ aliases: ['install-global-skills', 'skills-globais', 'global-skills'],
245
+ label: 'Instalar skills globais do Skill Master',
246
+ description: 'Copia as skills amplas e morais embutidas para CODEX_HOME/skills ou ~/.codex/skills.',
247
+ command: nodeExecPath,
248
+ args: [join(rootDir, 'bin', 'skill-master-install-global-skills.mjs')],
249
+ confirmMessage: 'Instalar as skills globais embutidas neste usuario?',
250
+ },
251
+ {
252
+ key: 'bootstrapGlobal',
253
+ aliases: ['bootstrap-global', 'global-bootstrap', 'ativar-global-completo'],
254
+ label: 'Ativar MCP global neste computador',
255
+ description: 'Instala as skills globais e registra Codex, Claude e Gemini no mesmo passo.',
256
+ command: nodeExecPath,
257
+ args: [join(rootDir, 'bin', 'skill-master-bootstrap-global.mjs')],
258
+ confirmMessage: 'Executar o bootstrap global do Skill Master neste computador?',
259
+ },
260
+ {
261
+ key: 'registerClients',
262
+ aliases: ['register-clients', 'registrar-clientes', 'codex-claude-gemini'],
263
+ label: 'Registrar Codex, Claude e Gemini',
264
+ description: 'Gera/aplica configuracoes MCP para reconhecer skill_master nos clientes principais.',
265
+ command: nodeExecPath,
266
+ args: [join(rootDir, 'bin', 'skill-master-register-clients.mjs'), '--apply-all'],
267
+ confirmMessage: 'Aplicar registro do skill_master em Codex, Claude e Gemini?',
268
+ },
158
269
  {
159
270
  key: 'promptRecommendation',
160
271
  aliases: ['recommend-prompt', 'recomendar-prompt', 'prompt-router'],
@@ -261,6 +372,7 @@ export function isInteractiveTerminal() {
261
372
  }
262
373
 
263
374
  export function formatStatusReport(status) {
375
+ const readiness = status.globalReadiness;
264
376
  const lines = [
265
377
  'Skill Master MCP - status local',
266
378
  `Diretorio: ${status.rootDir}`,
@@ -270,6 +382,11 @@ export function formatStatusReport(status) {
270
382
  `Manifesto semver: ${status.manifestSemver}`,
271
383
  `Drafts de skills aprendidas: ${status.pendingSuccessDrafts}`,
272
384
  `Skills externas para estudar: ${status.studyCandidates}`,
385
+ `Global readiness: ${readiness.ready ? 'pronto' : readiness.mode}`,
386
+ `Global skills instaladas: ${readiness.installed.length}/${readiness.required}`,
387
+ `Codex global: ${readiness.codex.globalCommand ? 'sim' : readiness.codex.kind}`,
388
+ `Claude global: ${readiness.claude.globalCommand ? 'sim' : readiness.claude.present ? 'nao-global' : 'ausente'}`,
389
+ `Gemini global: ${readiness.gemini.globalCommand ? 'sim' : readiness.gemini.present ? 'nao-global' : 'ausente'}`,
273
390
  ];
274
391
 
275
392
  if (status.versionText) {
@@ -280,6 +397,41 @@ export function formatStatusReport(status) {
280
397
  return lines.join('\n');
281
398
  }
282
399
 
400
+ function formatGlobalAlert(status, { useColor = false } = {}) {
401
+ const readiness = status.globalReadiness;
402
+ if (readiness.ready) {
403
+ return renderPanelLines(
404
+ [
405
+ colorize('GLOBAL READY', ANSI.bold, useColor),
406
+ 'O MCP esta reconhecido como comando global neste computador.',
407
+ 'Codex, Claude e Gemini podem ser apontados para skill-master-mcp.',
408
+ 'A instalacao global e as skills embutidas ja estao prontas para uso.',
409
+ ],
410
+ { color: ANSI.green, useColor },
411
+ );
412
+ }
413
+
414
+ return [
415
+ renderPanelLines(
416
+ [
417
+ colorize('ALERTA GLOBAL', ANSI.bold, useColor),
418
+ 'Este computador ainda nao esta pronto para uso global do Skill Master.',
419
+ 'Execute agora: skill-master-menu --run bootstrap-global --yes',
420
+ 'Isso instala as skills globais e registra Codex, Claude e Gemini.',
421
+ ],
422
+ { color: ANSI.red, useColor },
423
+ ),
424
+ renderPanelLines(
425
+ [
426
+ colorize('AVISO SUTIL', ANSI.dim, useColor),
427
+ 'Sem instalacao global, o MCP continua util localmente, mas nao fica integrado como parte do sistema em todos os clientes.',
428
+ `Skills globais detectadas: ${readiness.installed.length}/${readiness.required}`,
429
+ ],
430
+ { color: ANSI.yellow, useColor },
431
+ ),
432
+ ].join('\n\n');
433
+ }
434
+
283
435
  function renderPanelLines(lines, { color = ANSI.cyan, useColor = false } = {}) {
284
436
  const width = Math.max(...lines.map((line) => line.length), 24);
285
437
  const border = `+${'-'.repeat(width + 2)}+`;
@@ -294,9 +446,13 @@ export function formatMenuBanner(status, { useColor = false } = {}) {
294
446
  'Menu operacional para manutencao local',
295
447
  `Versao local ${status.semver} | canal ${status.manifestVersion}`,
296
448
  `Pendencias: ${status.pendingSuccessDrafts} drafts | estudo: ${status.studyCandidates} links`,
449
+ `Global: ${status.globalReadiness.ready ? 'pronto' : 'requer instalacao global'}`,
297
450
  colorize('Setas + Enter para navegar', ANSI.dim, useColor),
298
451
  ];
299
- return renderPanelLines(lines, { color: ANSI.cyan, useColor });
452
+ return [
453
+ renderPanelLines(lines, { color: ANSI.cyan, useColor }),
454
+ formatGlobalAlert(status, { useColor }),
455
+ ].join('\n\n');
300
456
  }
301
457
 
302
458
  export function formatActionHeader(action, { useColor = false } = {}) {
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from 'node:child_process';
4
+ import { dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const here = dirname(fileURLToPath(import.meta.url));
8
+ const rootDir = dirname(here);
9
+
10
+ const steps = [
11
+ {
12
+ label: 'install-global-skills',
13
+ command: process.execPath,
14
+ args: [join(rootDir, 'bin', 'skill-master-install-global-skills.mjs'), '--overwrite'],
15
+ },
16
+ {
17
+ label: 'register-clients',
18
+ command: process.execPath,
19
+ args: [join(rootDir, 'bin', 'skill-master-register-clients.mjs'), '--apply-all', '--force'],
20
+ },
21
+ ];
22
+
23
+ for (const step of steps) {
24
+ console.log(`[skill_master] Running ${step.label}...`);
25
+ const result = spawnSync(step.command, step.args, { stdio: 'inherit' });
26
+ if (result.status !== 0) {
27
+ process.exitCode = result.status ?? 1;
28
+ break;
29
+ }
30
+ }
31
+
32
+ if ((process.exitCode ?? 0) === 0) {
33
+ console.log('[skill_master] Global bootstrap complete.');
34
+ }
35
+
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, readdirSync, cpSync, mkdirSync } from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+
7
+ const here = path.dirname(fileURLToPath(import.meta.url));
8
+ const rootDir = path.resolve(here, '..');
9
+ const defaultSource = path.join(rootDir, 'docs', 'skill-candidates', 'v0.0.9');
10
+ const defaultTarget = path.join(process.env.CODEX_HOME ?? path.join(os.homedir(), '.codex'), 'skills');
11
+
12
+ const args = process.argv.slice(2);
13
+ const has = (flag) => args.includes(flag);
14
+ const readValue = (flag, fallback) => {
15
+ const index = args.indexOf(flag);
16
+ return index >= 0 ? args[index + 1] : fallback;
17
+ };
18
+
19
+ if (has('--help')) {
20
+ console.log(`Skill Master global skills installer
21
+
22
+ Uso:
23
+ skill-master-install-global-skills
24
+ skill-master-install-global-skills --overwrite
25
+ skill-master-install-global-skills --dry-run
26
+ skill-master-install-global-skills --target ~/.codex/skills
27
+
28
+ Instala as skills globais embutidas em CODEX_HOME/skills ou ~/.codex/skills.
29
+ `);
30
+ process.exit(0);
31
+ }
32
+
33
+ const source = readValue('--source', defaultSource);
34
+ const target = readValue('--target', defaultTarget);
35
+ const overwrite = has('--overwrite');
36
+ const dryRun = has('--dry-run');
37
+
38
+ if (!existsSync(source)) {
39
+ console.error(`[skill_master] Source not found: ${source}`);
40
+ process.exit(1);
41
+ }
42
+
43
+ const skills = readdirSync(source, { withFileTypes: true })
44
+ .filter((entry) => entry.isDirectory())
45
+ .map((entry) => entry.name)
46
+ .sort();
47
+
48
+ if (!dryRun) {
49
+ mkdirSync(target, { recursive: true });
50
+ }
51
+
52
+ const installed = [];
53
+ const skipped = [];
54
+
55
+ for (const skill of skills) {
56
+ const from = path.join(source, skill);
57
+ const to = path.join(target, skill);
58
+ if (existsSync(to) && !overwrite) {
59
+ skipped.push(skill);
60
+ continue;
61
+ }
62
+ if (!dryRun) {
63
+ cpSync(from, to, { recursive: true, force: overwrite });
64
+ }
65
+ installed.push(skill);
66
+ }
67
+
68
+ console.log('[skill_master] Global skills installer');
69
+ console.log(`- Source: ${source}`);
70
+ console.log(`- Target: ${target}`);
71
+ console.log(`- Installed: ${installed.length}`);
72
+ console.log(`- Skipped: ${skipped.length}`);
73
+ if (dryRun) console.log('- Dry run: no files were written.');
74
+ if (installed.length) console.log(`- Installed skills: ${installed.join(', ')}`);
75
+ if (skipped.length) console.log(`- Skipped skills: ${skipped.join(', ')}`);
76
+ console.log('[skill_master] Restart or rescan Codex to load new global skills.');
77
+
@@ -0,0 +1,154 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
3
+ import os from 'node:os';
4
+ import path from 'node:path';
5
+
6
+ const args = process.argv.slice(2);
7
+ const has = (flag) => args.includes(flag);
8
+ const readValue = (flag, fallback) => {
9
+ const index = args.indexOf(flag);
10
+ return index >= 0 ? args[index + 1] : fallback;
11
+ };
12
+
13
+ if (has('--help')) {
14
+ console.log(`Skill Master client registration
15
+
16
+ Uso:
17
+ skill-master-register-clients --write-snippets
18
+ skill-master-register-clients --apply-codex
19
+ skill-master-register-clients --apply-claude
20
+ skill-master-register-clients --apply-gemini
21
+ skill-master-register-clients --apply-all
22
+ skill-master-register-clients --apply-codex --force
23
+
24
+ Registra o servidor MCP skill_master como stdio usando o binario global:
25
+ skill-master-mcp
26
+ `);
27
+ process.exit(0);
28
+ }
29
+
30
+ const home = os.homedir();
31
+ const snippetsDir = readValue('--snippets-dir', path.join(home, '.skill-master', 'client-configs'));
32
+ const codexConfig = readValue('--codex-config', path.join(process.env.CODEX_HOME ?? path.join(home, '.codex'), 'config.toml'));
33
+ const claudeConfig = readValue('--claude-config', path.join(home, '.config', 'Claude', 'claude_desktop_config.json'));
34
+ const geminiConfig = readValue('--gemini-config', path.join(home, '.gemini', 'settings.json'));
35
+
36
+ const applyAll = has('--apply-all');
37
+ const applyCodex = applyAll || has('--apply-codex');
38
+ const applyClaude = applyAll || has('--apply-claude');
39
+ const applyGemini = applyAll || has('--apply-gemini');
40
+ const writeSnippets = applyAll || has('--write-snippets') || !(applyCodex || applyClaude || applyGemini);
41
+ const force = has('--force');
42
+
43
+ const mcpServer = {
44
+ command: 'skill-master-mcp',
45
+ args: [],
46
+ env: {
47
+ SKILL_MASTER_UPDATE_CHANNEL: 'stable',
48
+ },
49
+ };
50
+
51
+ const codexBlock = `
52
+ [mcp_servers.skill_master]
53
+ command = "skill-master-mcp"
54
+ startup_timeout_sec = 120
55
+
56
+ [mcp_servers.skill_master.env]
57
+ SKILL_MASTER_UPDATE_CHANNEL = "stable"
58
+ `;
59
+
60
+ const claudeSnippet = {
61
+ mcpServers: {
62
+ skill_master: mcpServer,
63
+ },
64
+ };
65
+
66
+ const geminiSnippet = {
67
+ mcpServers: {
68
+ skill_master: mcpServer,
69
+ },
70
+ };
71
+
72
+ const ensureParent = (filePath) => mkdirSync(path.dirname(filePath), { recursive: true });
73
+
74
+ const readJsonOrEmpty = (filePath) => {
75
+ if (!existsSync(filePath)) return {};
76
+ const raw = readFileSync(filePath, 'utf8').trim();
77
+ return raw ? JSON.parse(raw) : {};
78
+ };
79
+
80
+ const writeJson = (filePath, value) => {
81
+ ensureParent(filePath);
82
+ writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`, 'utf8');
83
+ };
84
+
85
+ const mergeMcpServer = (filePath) => {
86
+ const current = readJsonOrEmpty(filePath);
87
+ const next = {
88
+ ...current,
89
+ mcpServers: {
90
+ ...(current.mcpServers ?? {}),
91
+ skill_master: mcpServer,
92
+ },
93
+ };
94
+ writeJson(filePath, next);
95
+ };
96
+
97
+ const writeSnippetsFiles = () => {
98
+ mkdirSync(snippetsDir, { recursive: true });
99
+ writeFileSync(path.join(snippetsDir, 'codex.config.toml'), codexBlock.trimStart(), 'utf8');
100
+ writeJson(path.join(snippetsDir, 'claude_desktop_config.skill_master.json'), claudeSnippet);
101
+ writeJson(path.join(snippetsDir, 'gemini.settings.skill_master.json'), geminiSnippet);
102
+ };
103
+
104
+ const removeCodexBlock = (content) => {
105
+ const lines = content.split('\n');
106
+ const kept = [];
107
+ let skipping = false;
108
+ for (const line of lines) {
109
+ const trimmed = line.trim();
110
+ if (trimmed === '[mcp_servers.skill_master]') {
111
+ skipping = true;
112
+ continue;
113
+ }
114
+ if (skipping && trimmed.startsWith('[') && !trimmed.startsWith('[mcp_servers.skill_master')) {
115
+ skipping = false;
116
+ }
117
+ if (!skipping) kept.push(line);
118
+ }
119
+ return kept.join('\n').trimEnd();
120
+ };
121
+
122
+ const appendCodex = () => {
123
+ ensureParent(codexConfig);
124
+ const current = existsSync(codexConfig) ? readFileSync(codexConfig, 'utf8') : '';
125
+ if (current.includes('[mcp_servers.skill_master]') && !force) {
126
+ return false;
127
+ }
128
+ const base = force ? removeCodexBlock(current) : current.trimEnd();
129
+ writeFileSync(codexConfig, `${base}\n${codexBlock}`, 'utf8');
130
+ return true;
131
+ };
132
+
133
+ const actions = [];
134
+ if (writeSnippets) {
135
+ writeSnippetsFiles();
136
+ actions.push(`snippets written to ${snippetsDir}`);
137
+ }
138
+ if (applyCodex) {
139
+ actions.push(appendCodex() ? `Codex registered at ${codexConfig}` : `Codex already had skill_master at ${codexConfig}`);
140
+ }
141
+ if (applyClaude) {
142
+ mergeMcpServer(claudeConfig);
143
+ actions.push(`Claude config merged at ${claudeConfig}`);
144
+ }
145
+ if (applyGemini) {
146
+ mergeMcpServer(geminiConfig);
147
+ actions.push(`Gemini config merged at ${geminiConfig}`);
148
+ }
149
+
150
+ console.log('[skill_master] Client registration');
151
+ for (const action of actions) {
152
+ console.log(`- ${action}`);
153
+ }
154
+ console.log('- Restart Codex, Claude or Gemini after registration.');
@@ -0,0 +1,11 @@
1
+ export type KnowledgeDomain = 'catholic_moral_theology' | 'science' | 'philosophy' | 'sociology' | 'law' | 'mathematics' | 'portuguese' | 'english' | 'french' | 'computer_engineering' | 'software_engineering' | 'network_engineering' | 'ai_engineering' | 'security' | 'product' | 'documentation';
2
+ export type DomainRoute = {
3
+ primaryDomain: KnowledgeDomain | 'general';
4
+ secondaryDomains: KnowledgeDomain[];
5
+ recommendedSkillNames: string[];
6
+ approvedSourceHints: string[];
7
+ professionalBoundary: 'none' | 'use-general-information-only' | 'qualified-professional-required';
8
+ needsCurrentResearch: boolean;
9
+ };
10
+ export declare const routeKnowledgeDomain: (prompt: string) => DomainRoute;
11
+ //# sourceMappingURL=domain-router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain-router.d.ts","sourceRoot":"","sources":["../src/domain-router.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,yBAAyB,GACzB,SAAS,GACT,YAAY,GACZ,WAAW,GACX,KAAK,GACL,aAAa,GACb,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,GACrB,gBAAgB,GAChB,UAAU,GACV,SAAS,GACT,eAAe,CAAC;AAEpB,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,eAAe,GAAG,SAAS,CAAC;IAC3C,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,EAAE,MAAM,GAAG,8BAA8B,GAAG,iCAAiC,CAAC;IAClG,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC;AAsDF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,KAAG,WAgCrD,CAAC"}