el-primor 3.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fxMT-nx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,148 @@
1
+ # πŸ₯‡ El Primor v3.0.0
2
+
3
+ [![Version](https://img.shields.io/badge/version-3.0.0-blue.svg)](https://github.com/fxMT-nx/el-primor)
4
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
+ [![OpenCode](https://img.shields.io/badge/OpenCode-compatible-ff6b6b.svg)](https://github.com/anomalyco/opencode)
6
+
7
+ > **El asistente de IA que investiga, aprende, ejecuta y persiste.**
8
+ >
9
+ > *The AI assistant that researches, learns, executes, and persists.*
10
+
11
+ ---
12
+
13
+ **El Primor** es un sistema de agentes para [OpenCode](https://github.com/anomalyco/opencode) que combina 7 skills especializadas con memoria semΓ‘ntica persistente (TurboVec + SQLite). DiseΓ±ado para funcionar con **DeepSeek V4 Pro**, ofrece capacidades de investigaciΓ³n, razonamiento y ejecuciΓ³n que van mΓ‘s allΓ‘ del conocimiento nativo del LLM.
14
+
15
+ ---
16
+
17
+ ## πŸš€ Install
18
+
19
+ **For humans:**
20
+ ```bash
21
+ npx el-primor init
22
+ ```
23
+
24
+ **For AI agents:** just tell your OpenCode agent:
25
+
26
+ > *"instala El Primor"*
27
+
28
+ The agent will run `npx el-primor init` and configure everything automatically.
29
+
30
+ ---
31
+
32
+ ## 🧠 Capacidades
33
+
34
+ | Capacidad | DescripciΓ³n |
35
+ |-----------|-------------|
36
+ | πŸ” **Investiga** | BΓΊsqueda semΓ‘ntica multicapa con verificaciΓ³n cruzada |
37
+ | πŸ“š **Aprende** | Memoria persistente que sobrevive a sesiones individuales |
38
+ | ⚑ **Ejecuta** | 7 skills con conocimiento experto único que el LLM no posee |
39
+ | πŸ’Ύ **Persiste** | TurboVec (SQLite + embeddings multilingual-e5-small) |
40
+
41
+ ---
42
+
43
+ ## πŸ“‹ MetodologΓ­a β€” 9 Fases
44
+
45
+ Cada tarea sigue un pipeline riguroso de 9 fases que garantiza calidad:
46
+
47
+ | Fase | Nombre | DescripciΓ³n |
48
+ |------|--------|-------------|
49
+ | 0 | πŸ”Ž Consulta de Memoria | Buscar conocimiento previo en TurboVec |
50
+ | 1 | 🧭 Comprensión | Analizar y descomponer la tarea |
51
+ | 2 | πŸ“– InvestigaciΓ³n | Recopilar informaciΓ³n relevante |
52
+ | 3 | πŸ—οΈ PlanificaciΓ³n | DiseΓ±ar la soluciΓ³n paso a paso |
53
+ | 4 | πŸ› οΈ EjecuciΓ³n | Implementar siguiendo el plan |
54
+ | 5 | βœ… VerificaciΓ³n | Validar resultados contra criterios |
55
+ | 6 | πŸ“ DocumentaciΓ³n | Registrar decisiones y aprendizajes |
56
+ | 7 | πŸ’Ύ Persistencia | Guardar en memoria semΓ‘ntica |
57
+ | 8 | 🎯 Entrega | Reportar resultados al usuario |
58
+
59
+ ---
60
+
61
+ ## πŸ› οΈ Skills
62
+
63
+ Cada skill contiene conocimiento experto que el LLM **no tiene** por defecto:
64
+
65
+ | Skill | Dominio |
66
+ |-------|---------|
67
+ | 🧬 **razonamiento-multicapa** | AnÑlisis multi-perspectiva, Ñrbol de decisión, verificación cruzada |
68
+ | πŸ”¬ **investigacion-profunda** | BΓΊsqueda con fuentes, validaciΓ³n de hechos, sΓ­ntesis de informaciΓ³n |
69
+ | πŸ’» **maestria-tecnica** | Arquitectura de software, patrones de diseΓ±o, optimizaciΓ³n |
70
+ | πŸ—οΈ **ejecucion-estructurada** | PlanificaciΓ³n granular, gestiΓ³n de dependencias, puntos de control |
71
+ | πŸ§ͺ **verificacion-calidad** | Testing sistemΓ‘tico, validaciΓ³n de edge cases, mΓ©tricas de calidad |
72
+ | πŸ“– **documentacion-clara** | DocumentaciΓ³n tΓ©cnica, diagramas, explicaciones accesibles |
73
+ | 🌐 **contexto-global** | Conocimiento multilingüe, matices culturales, adaptación regional |
74
+
75
+ ---
76
+
77
+ ## πŸ“¦ Requisitos
78
+
79
+ - **[OpenCode](https://github.com/anthropics/opencode)** β€” Plataforma de agentes
80
+ - **[DeepSeek V4 Pro](https://deepseek.com)** β€” Modelo de lenguaje (recomendado)
81
+ - Python 3.10+ (para el MCP server de TurboVec)
82
+ - SQLite 3 (incluido en la mayorΓ­a de sistemas)
83
+
84
+ ---
85
+
86
+ ## πŸ“Š Benchmarks
87
+
88
+ *PrΓ³ximamente β€” en desarrollo*
89
+
90
+ ---
91
+
92
+ ## πŸ“ Estructura del Repositorio
93
+
94
+ ```
95
+ el-primor-v3/
96
+ β”œβ”€β”€ AGENTS.md # DefiniciΓ³n del agente principal
97
+ β”œβ”€β”€ install.sh # Instalador one-liner
98
+ β”œβ”€β”€ setup.sh # ConfiguraciΓ³n de entorno
99
+ β”œβ”€β”€ turbo-vec-mcp.py # MCP server (memoria semΓ‘ntica)
100
+ β”œβ”€β”€ skills/ # 7 skills especializadas
101
+ β”‚ β”œβ”€β”€ razonamiento-multicapa/
102
+ β”‚ β”œβ”€β”€ investigacion-profunda/
103
+ β”‚ β”œβ”€β”€ maestria-tecnica/
104
+ β”‚ β”œβ”€β”€ ejecucion-estructurada/
105
+ β”‚ β”œβ”€β”€ verificacion-calidad/
106
+ β”‚ β”œβ”€β”€ documentacion-clara/
107
+ β”‚ └── contexto-global/
108
+ β”œβ”€β”€ .opencode/ # ConfiguraciΓ³n de OpenCode
109
+ β”œβ”€β”€ .github/workflows/ # CI/CD
110
+ β”œβ”€β”€ CHANGELOG.md
111
+ β”œβ”€β”€ CONTRIBUTING.md
112
+ └── LICENSE
113
+ ```
114
+
115
+ ---
116
+
117
+ ## πŸ“„ Licencia
118
+
119
+ MIT Β© 2026 [fxMT-nx](https://github.com/fxMT-nx)
120
+
121
+ ---
122
+
123
+ ## πŸ‡¬πŸ‡§ English
124
+
125
+ **El Primor** is an agent system for [OpenCode](https://github.com/anthropics/opencode) combining 7 specialized skills with persistent semantic memory (TurboVec + SQLite). Built for **DeepSeek V4 Pro**, it provides research, reasoning, and execution capabilities beyond the LLM's native knowledge.
126
+
127
+ ### Quickstart
128
+
129
+ ```bash
130
+ curl -fsSL https://raw.githubusercontent.com/fxMT-nx/el-primor/main/install.sh | bash
131
+ ```
132
+
133
+ ### Key Features
134
+
135
+ - **Semantic Memory**: TurboVec with multilingual-e5-small embeddings across sessions
136
+ - **7 Expert Skills**: Knowledge the LLM doesn't natively have
137
+ - **9-Phase Pipeline**: From memory recall to final delivery
138
+ - **MCP Server**: Native OpenCode integration via Model Context Protocol
139
+ - **One-liner Install**: Single command to get everything running
140
+
141
+ ### Requirements
142
+
143
+ - OpenCode + DeepSeek V4 Pro
144
+ - Python 3.10+ and SQLite 3
145
+
146
+ ### License
147
+
148
+ MIT Β© 2026 fxMT-nx
package/bin/cli.js ADDED
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/env node
2
+ // el-primor CLI v3.0.0 β€” Zero-friction installer for OpenCode
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { execSync } = require('child_process');
7
+
8
+ const command = process.argv[2] || 'init';
9
+ const projectRoot = process.cwd();
10
+ const globalDir = path.join(process.env.HOME, '.config', 'opencode');
11
+ const repoUrl = 'https://github.com/fxMT-nx/el-primor.git';
12
+
13
+ function log(msg) { console.log(` ${msg}`); }
14
+ function ok(msg) { console.log(`βœ… ${msg}`); }
15
+ function err(msg) { console.error(`❌ ${msg}`); process.exit(1); }
16
+
17
+ function mergeJson(filePath, newConfig) {
18
+ let existing = {};
19
+ if (fs.existsSync(filePath)) {
20
+ try { existing = JSON.parse(fs.readFileSync(filePath, 'utf8')); } catch(e) {}
21
+ }
22
+ const merged = { ...existing, ...newConfig };
23
+ // Deep merge permissions
24
+ if (existing.permission && newConfig.permission) {
25
+ merged.permission = { ...existing.permission, ...newConfig.permission };
26
+ }
27
+ fs.writeFileSync(filePath, JSON.stringify(merged, null, 2) + '\n');
28
+ }
29
+
30
+ function init() {
31
+ console.log('πŸ† El Primor v3.0.0 β€” Installing...\n');
32
+
33
+ // 1. Copy AGENTS.md
34
+ const agentsSrc = path.join(__dirname, '..', 'AGENTS.md');
35
+ const agentsDst = path.join(projectRoot, 'AGENTS.md');
36
+ fs.copyFileSync(agentsSrc, agentsDst);
37
+ ok('AGENTS.md copied');
38
+
39
+ // 2. Copy skills
40
+ const skillsSrc = path.join(__dirname, '..', '.opencode', 'skills');
41
+ const skillsDst = path.join(projectRoot, '.opencode', 'skills');
42
+ fs.cpSync(skillsSrc, skillsDst, { recursive: true });
43
+ const count = fs.readdirSync(skillsDst).filter(d => !d.startsWith('.')).length;
44
+ ok(`${count} skills installed`);
45
+
46
+ // 3. Update opencode.json
47
+ const configPath = path.join(projectRoot, 'opencode.json');
48
+ const primorConfig = {
49
+ "instructions": ["AGENTS.md"],
50
+ "permission": {
51
+ "external_directory": { "~/.primor/**": "allow" },
52
+ "skill": { "*": "allow" },
53
+ "websearch": "allow",
54
+ "webfetch": "allow"
55
+ },
56
+ "mcp": {
57
+ "turbovec": {
58
+ "type": "local",
59
+ "command": ["python3", "~/.primor/turbo-vec-mcp.py"],
60
+ "enabled": true,
61
+ "timeout": 10000
62
+ }
63
+ }
64
+ };
65
+ mergeJson(configPath, primorConfig);
66
+ ok('opencode.json configured');
67
+
68
+ // 4. Setup TurboVec (non-fatal if python/turbo-vec absent)
69
+ try {
70
+ execSync(`bash "${path.join(__dirname, '..', 'setup.sh')}"`, { stdio: 'inherit' });
71
+ ok('TurboVec ready');
72
+ } catch {
73
+ log('TurboVec skipped (python/turbo-vec not available β€” memory system inactive)');
74
+ }
75
+
76
+ // 5. Cleanup
77
+ console.log(`\nπŸ† El Primor v3.0.0 installed!\n`);
78
+ console.log(` AGENTS.md β†’ ${agentsDst}`);
79
+ console.log(` Skills (${count}) β†’ ${skillsDst}`);
80
+ console.log(` Memory β†’ ~/.primor/`);
81
+ console.log(`\n Run 'npx el-primor doctor' to verify.`);
82
+ }
83
+
84
+ function globalInstall() {
85
+ console.log('πŸ† El Primor v3.0.0 β€” Global install...\n');
86
+ fs.mkdirSync(globalDir, { recursive: true });
87
+ // Copy skills to global
88
+ const skillsSrc = path.join(__dirname, '..', '.opencode', 'skills');
89
+ const skillsDst = path.join(globalDir, 'skills');
90
+ fs.cpSync(skillsSrc, skillsDst, { recursive: true });
91
+ ok(`Skills β†’ ${skillsDst}`);
92
+ // Setup TurboVec (non-fatal if python/turbo-vec absent)
93
+ try {
94
+ execSync(`bash "${path.join(__dirname, '..', 'setup.sh')}"`, { stdio: 'inherit' });
95
+ ok('TurboVec ready');
96
+ } catch {
97
+ log('TurboVec skipped (python/turbo-vec not available β€” memory system inactive)');
98
+ }
99
+ console.log(`\nπŸ† El Primor installed globally. Works in any project.`);
100
+ }
101
+
102
+ function update() {
103
+ console.log('πŸ”„ Updating El Primor...\n');
104
+ const tmp = fs.mkdtempSync('/tmp/el-primor-');
105
+ execSync(`git clone --depth 1 ${repoUrl} ${tmp}`, { stdio: 'pipe' });
106
+ // Copy latest AGENTS.md and skills
107
+ fs.copyFileSync(path.join(tmp, 'AGENTS.md'), path.join(projectRoot, 'AGENTS.md'));
108
+ fs.cpSync(path.join(tmp, '.opencode', 'skills'), path.join(projectRoot, '.opencode', 'skills'), { recursive: true });
109
+ fs.rmSync(tmp, { recursive: true, force: true });
110
+ ok('Updated to latest version');
111
+ }
112
+
113
+ function uninstall() {
114
+ console.log('🧹 Uninstalling El Primor...\n');
115
+ const agents = path.join(projectRoot, 'AGENTS.md');
116
+ const skills = path.join(projectRoot, '.opencode', 'skills');
117
+ if (fs.existsSync(agents)) { fs.unlinkSync(agents); ok('AGENTS.md removed'); }
118
+ // Only remove subdirs that are El Primor skills
119
+ if (fs.existsSync(skills)) {
120
+ const primorSkills = ['comprension-y-plan','investigacion-actualizada','verificacion-rigurosa','seguridad-primor','debug-forense','diseno-excelente','reporting-profesional'];
121
+ for (const s of primorSkills) {
122
+ const sp = path.join(skills, s);
123
+ if (fs.existsSync(sp)) fs.rmSync(sp, { recursive: true, force: true });
124
+ }
125
+ ok('Skills removed');
126
+ }
127
+ console.log(' TurboVec (~/.primor/) preserved. Delete manually if needed.');
128
+ console.log(`\nβœ… El Primor uninstalled.`);
129
+ }
130
+
131
+ function doctor() {
132
+ console.log('πŸ” El Primor v3.0.0 β€” Health check...\n');
133
+ const checks = [
134
+ ['AGENTS.md', fs.existsSync(path.join(projectRoot, 'AGENTS.md'))],
135
+ ['Skills (7 dirs)', (() => {
136
+ const sp = path.join(projectRoot, '.opencode', 'skills');
137
+ if (!fs.existsSync(sp)) return false;
138
+ return fs.readdirSync(sp).filter(d => !d.startsWith('.')).length >= 7;
139
+ })()],
140
+ ['~/.primor/', fs.existsSync(path.join(process.env.HOME, '.primor'))],
141
+ ['TurboVec MCP', (() => {
142
+ const cp = path.join(projectRoot, 'opencode.json');
143
+ if (!fs.existsSync(cp)) return false;
144
+ try { const c = JSON.parse(fs.readFileSync(cp, 'utf8')); return c.mcp?.turbovec != null; } catch { return false; }
145
+ })()]
146
+ ];
147
+ let allOk = true;
148
+ for (const [name, ok_] of checks) {
149
+ console.log(` ${ok_ ? 'βœ…' : '❌'} ${name}`);
150
+ if (!ok_) allOk = false;
151
+ }
152
+ console.log(`\n${allOk ? 'πŸ† All checks passed!' : '⚠️ Some checks failed. Run npx el-primor init to repair.'}`);
153
+ }
154
+
155
+ switch(command) {
156
+ case 'init': init(); break;
157
+ case 'global': globalInstall(); break;
158
+ case 'update': update(); break;
159
+ case 'uninstall': uninstall(); break;
160
+ case 'doctor': doctor(); break;
161
+ case 'version':
162
+ case '--version':
163
+ case '-v':
164
+ console.log('v3.0.0'); break;
165
+ default:
166
+ console.log('πŸ† El Primor v3.0.0 β€” AI coding agent for OpenCode\n');
167
+ console.log('Usage: npx el-primor <command>\n');
168
+ console.log('Commands:');
169
+ console.log(' init Install in current project');
170
+ console.log(' global Install globally (~/.config/opencode/)');
171
+ console.log(' update Update to latest version');
172
+ console.log(' uninstall Remove from current project');
173
+ console.log(' doctor Verify installation');
174
+ console.log(' version Show version');
175
+ console.log('\nZero-friction: just tell your OpenCode agent "instala El Primor"');
176
+ }
package/install.sh ADDED
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # ─── El Primor v3.0.0 β€” Instalador One-Liner ─────────────────────────────────
5
+ # Uso: curl -fsSL https://raw.githubusercontent.com/fxMT-nx/el-primor/main/install.sh | bash
6
+ #
7
+ # Este script:
8
+ # 1. Clona el repositorio
9
+ # 2. Copia .opencode/ a ~/.config/opencode/
10
+ # 3. Copia AGENTS.md a la raΓ­z del proyecto
11
+ # 4. Ejecuta setup.sh desde ~/.primor/
12
+
13
+ REPO_URL="${REPO_URL:-https://github.com/fxMT-nx/el-primor.git}"
14
+ INSTALL_DIR="${INSTALL_DIR:-$HOME/el-primor-v3}"
15
+ PRIMOR_DIR="$HOME/.primor"
16
+ OPENCODE_CONFIG_DIR="$HOME/.config/opencode"
17
+
18
+ echo "╔══════════════════════════════════════════════╗"
19
+ echo "β•‘ El Primor v3.0.0 β€” Instalador β•‘"
20
+ echo "β•‘ Sistema de agentes para OpenCode β•‘"
21
+ echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"
22
+ echo ""
23
+
24
+ # ── Paso 1: Clonar repositorio ──────────────────────────────────────────────
25
+ if [ -d "$INSTALL_DIR" ]; then
26
+ echo "[1/4] Repositorio ya existe en $INSTALL_DIR β€” actualizando..."
27
+ git -C "$INSTALL_DIR" pull --ff-only
28
+ else
29
+ echo "[1/4] Clonando repositorio en $INSTALL_DIR..."
30
+ git clone "$REPO_URL" "$INSTALL_DIR"
31
+ fi
32
+
33
+ # ── Paso 2: Copiar configuraciΓ³n de OpenCode ────────────────────────────────
34
+ echo "[2/4] Instalando configuraciΓ³n de OpenCode..."
35
+ mkdir -p "$OPENCODE_CONFIG_DIR"
36
+ if [ -d "$INSTALL_DIR/.opencode" ]; then
37
+ cp -r "$INSTALL_DIR/.opencode/"* "$OPENCODE_CONFIG_DIR/"
38
+ echo " βœ“ .opencode/ β†’ $OPENCODE_CONFIG_DIR"
39
+ else
40
+ echo " ⚠ No se encontró .opencode/ en el repositorio"
41
+ fi
42
+
43
+ # ── Paso 3: Copiar AGENTS.md a raΓ­z ─────────────────────────────────────────
44
+ echo "[3/4] Copiando AGENTS.md a la raΓ­z..."
45
+ if [ -f "$INSTALL_DIR/AGENTS.md" ]; then
46
+ cp "$INSTALL_DIR/AGENTS.md" "$HOME/AGENTS.md"
47
+ echo " βœ“ AGENTS.md β†’ $HOME/AGENTS.md"
48
+ else
49
+ echo " ⚠ No se encontró AGENTS.md en el repositorio"
50
+ fi
51
+
52
+ # ── Paso 4: Ejecutar setup.sh ───────────────────────────────────────────────
53
+ echo "[4/4] Ejecutando setup.sh..."
54
+ mkdir -p "$PRIMOR_DIR"
55
+ if [ -f "$INSTALL_DIR/setup.sh" ]; then
56
+ cp "$INSTALL_DIR/setup.sh" "$PRIMOR_DIR/setup.sh"
57
+ bash "$PRIMOR_DIR/setup.sh"
58
+ else
59
+ echo " ⚠ No se encontró setup.sh en el repositorio"
60
+ fi
61
+
62
+ echo ""
63
+ echo "╔══════════════════════════════════════════════╗"
64
+ echo "β•‘ βœ… InstalaciΓ³n completada β•‘"
65
+ echo "β•‘ β•‘"
66
+ echo "β•‘ ConfiguraciΓ³n: ~/.config/opencode/ β•‘"
67
+ echo "β•‘ Memoria: ~/.primor/ β•‘"
68
+ echo "β•‘ Agente: ~/AGENTS.md β•‘"
69
+ echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"
package/opencode.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "default_agent": "build",
4
+ "model": "deepseek/deepseek-v4-pro",
5
+ "small_model": "deepseek/deepseek-v4-pro",
6
+ "agent": {
7
+ "plan": {
8
+ "model": "deepseek/deepseek-v4-pro",
9
+ "steps": 60
10
+ },
11
+ "build": {
12
+ "model": "deepseek/deepseek-v4-pro",
13
+ "steps": 100
14
+ }
15
+ },
16
+ "permission": {
17
+ "*": "ask",
18
+ "read": "allow",
19
+ "glob": "allow",
20
+ "grep": "allow",
21
+ "list": "allow",
22
+ "edit": "allow",
23
+ "bash": "allow",
24
+ "webfetch": "allow",
25
+ "websearch": "allow",
26
+ "todowrite": "allow",
27
+ "question": "allow",
28
+ "external_directory": { "~/.primor/**": "allow" },
29
+ "skill": { "*": "allow" }
30
+ },
31
+ "mcp": {
32
+ "turbovec": {
33
+ "type": "local",
34
+ "command": ["python3", "/home/nx/.primor/turbo-vec-mcp.py"],
35
+ "enabled": true,
36
+ "timeout": 10000
37
+ }
38
+ },
39
+ "instructions": [],
40
+ "skills": {
41
+ "paths": [".opencode/skills"]
42
+ }
43
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "el-primor",
3
+ "version": "3.0.0",
4
+ "description": "El Primor β€” AI coding agent for OpenCode. 9-phase methodology, 7 expert skills, persistent memory (TurboVec). Zero-friction install.",
5
+ "license": "MIT",
6
+ "author": "fxMT-nx",
7
+ "repository": "github:fxMT-nx/el-primor",
8
+ "homepage": "https://github.com/fxMT-nx/el-primor#readme",
9
+ "bugs": "https://github.com/fxMT-nx/el-primor/issues",
10
+ "keywords": [
11
+ "opencode",
12
+ "ai-agent",
13
+ "llm",
14
+ "coding-agent",
15
+ "agent-framework",
16
+ "deepseek",
17
+ "code-quality",
18
+ "skills",
19
+ "tdd",
20
+ "primor"
21
+ ],
22
+ "bin": {
23
+ "el-primor": "./bin/cli.js"
24
+ },
25
+ "files": [
26
+ "bin/",
27
+ "AGENTS.md",
28
+ "INSTALL.md",
29
+ "install.sh",
30
+ "setup.sh",
31
+ "turbo-vec-mcp.py",
32
+ ".opencode/skills/",
33
+ "opencode.json"
34
+ ]
35
+ }
package/setup.sh ADDED
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # ─── El Primor v3.0.0 β€” Setup ───────────────────────────────────────────────
5
+ # Este script configura el entorno de memoria TurboVec para El Primor.
6
+ # Se copia a ~/.primor/setup.sh y se ejecuta desde allΓ­.
7
+
8
+ PRIMOR_DIR="$HOME/.primor"
9
+ VENV_DIR="$PRIMOR_DIR/venv"
10
+ MODEL_NAME="sentence-transformers/multilingual-e5-small"
11
+ MODEL_DIR="$PRIMOR_DIR/models/multilingual-e5-small"
12
+ DB_PATH="$PRIMOR_DIR/primor.db"
13
+
14
+ echo "βš™ Configurando El Primor v3.0.0..."
15
+ echo ""
16
+
17
+ # ── 1. Crear directorio ~/.primor/ ──────────────────────────────────────────
18
+ echo "[1/5] Creando ~/.primor/"
19
+ mkdir -p "$PRIMOR_DIR"
20
+ mkdir -p "$PRIMOR_DIR/models"
21
+
22
+ # ── 2. Crear venv Python con TurboVec ───────────────────────────────────────
23
+ echo "[2/5] Creando entorno virtual Python..."
24
+ if [ ! -d "$VENV_DIR" ]; then
25
+ python3 -m venv "$VENV_DIR"
26
+ fi
27
+ source "$VENV_DIR/bin/activate"
28
+ pip install --quiet --upgrade pip
29
+ pip install --quiet sentence-transformers turbo-vec
30
+ echo " βœ“ TurboVec instalado"
31
+
32
+ # ── 3. Inicializar SQLite ───────────────────────────────────────────────────
33
+ echo "[3/5] Inicializando base de datos SQLite..."
34
+ sqlite3 "$DB_PATH" "CREATE TABLE IF NOT EXISTS docs (
35
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
36
+ title TEXT NOT NULL,
37
+ content TEXT NOT NULL,
38
+ collection TEXT DEFAULT 'default',
39
+ metadata TEXT DEFAULT '{}',
40
+ vec_id INTEGER,
41
+ created_at TEXT DEFAULT (datetime('now')),
42
+ updated_at TEXT DEFAULT (datetime('now'))
43
+ );"
44
+ echo " βœ“ Base de datos lista en $DB_PATH"
45
+
46
+ # ── 4. Descargar modelo multilingual-e5-small ───────────────────────────────
47
+ echo "[4/5] Verificando modelo multilingual-e5-small..."
48
+ if [ ! -f "$MODEL_DIR/config.json" ]; then
49
+ echo " Descargando modelo (esto puede tardar unos minutos)..."
50
+ python3 -c "
51
+ from sentence_transformers import SentenceTransformer
52
+ model = SentenceTransformer('$MODEL_NAME', cache_folder='$PRIMOR_DIR/models')
53
+ print(' βœ“ Modelo descargado')
54
+ "
55
+ else
56
+ echo " βœ“ Modelo ya existe en $MODEL_DIR"
57
+ fi
58
+
59
+ # ── 5. Copiar MCP server ───────────────────────────────────────────────────
60
+ echo "[5/5] Copiando MCP server..."
61
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
62
+ if [ -f "$SCRIPT_DIR/turbo-vec-mcp.py" ]; then
63
+ cp "$SCRIPT_DIR/turbo-vec-mcp.py" "$PRIMOR_DIR/turbo-vec-mcp.py"
64
+ echo " βœ“ turbo-vec-mcp.py β†’ $PRIMOR_DIR/"
65
+ elif [ -f "$HOME/el-primor-v3/turbo-vec-mcp.py" ]; then
66
+ cp "$HOME/el-primor-v3/turbo-vec-mcp.py" "$PRIMOR_DIR/turbo-vec-mcp.py"
67
+ echo " βœ“ turbo-vec-mcp.py β†’ $PRIMOR_DIR/"
68
+ else
69
+ echo " ⚠ No se encontrΓ³ turbo-vec-mcp.py β€” busca el script en el repo"
70
+ fi
71
+
72
+ deactivate 2>/dev/null || true
73
+
74
+ echo ""
75
+ echo "╔══════════════════════════════════════════════════════╗"
76
+ echo "β•‘ βœ… Setup completado β•‘"
77
+ echo "β•‘ β•‘"
78
+ echo "β•‘ Para activar el MCP server en OpenCode, aΓ±ade β•‘"
79
+ echo "β•‘ esto a tu ~/.config/opencode/opencode.json: β•‘"
80
+ echo "β•‘ β•‘"
81
+ echo "β•‘ { β•‘"
82
+ echo "β•‘ \"mcpServers\": { β•‘"
83
+ echo "β•‘ \"turbo-vec\": { β•‘"
84
+ echo "β•‘ \"command\": \"$VENV_DIR/bin/python3\", β•‘"
85
+ echo "β•‘ \"args\": [\"$PRIMOR_DIR/turbo-vec-mcp.py\"] β•‘"
86
+ echo "β•‘ } β•‘"
87
+ echo "β•‘ } β•‘"
88
+ echo "β•‘ } β•‘"
89
+ echo "β•‘ β•‘"
90
+ echo "β•‘ DocumentaciΓ³n: https://github.com/fxMT-nx/el-primorβ•‘"
91
+ echo "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•"