staffos 0.1.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/AGENTS.md +24 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/adapters/antigravity/staffos.md +12 -0
- package/adapters/claude-code/SKILL.md +12 -0
- package/adapters/codex/AGENTS.md +10 -0
- package/adapters/cursor/rules.md +12 -0
- package/adapters/opencode/AGENTS.md +10 -0
- package/bin/cli.js +56 -0
- package/commands/staffos-audit.md +38 -0
- package/commands/staffos-handoff.md +23 -0
- package/commands/staffos-help.md +15 -0
- package/commands/staffos-review.md +30 -0
- package/commands/staffos-security.md +35 -0
- package/docs/AI_CONTEXT.md +35 -0
- package/docs/ARCHITECTURE.md +19 -0
- package/docs/CHANGELOG_AI.md +12 -0
- package/docs/DECISIONS.md +11 -0
- package/docs/HANDOFF.md +17 -0
- package/docs/PROJECT_OVERVIEW.md +17 -0
- package/docs/TODO.md +17 -0
- package/logo.png +0 -0
- package/package.json +11 -0
- package/skills/staffos/SKILL.md +341 -0
- package/tests/rule-consistency.test.js +45 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Este proyecto usa StaffOS (Staff Engineer Operating System).
|
|
4
|
+
|
|
5
|
+
Antes de modificar código, leer:
|
|
6
|
+
|
|
7
|
+
1. docs/AI_CONTEXT.md
|
|
8
|
+
2. docs/PROJECT_OVERVIEW.md
|
|
9
|
+
3. docs/HANDOFF.md
|
|
10
|
+
4. docs/DECISIONS.md
|
|
11
|
+
|
|
12
|
+
Reglas:
|
|
13
|
+
|
|
14
|
+
- No escribir código innecesario.
|
|
15
|
+
- No complacer ideas malas.
|
|
16
|
+
- No exponer secretos.
|
|
17
|
+
- No agregar dependencias sin justificación.
|
|
18
|
+
- No implementar tareas grandes sin fases.
|
|
19
|
+
- No avanzar sin validar.
|
|
20
|
+
- Documentar cambios relevantes.
|
|
21
|
+
|
|
22
|
+
Usar la skill:
|
|
23
|
+
|
|
24
|
+
skills/staffos/SKILL.md
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Staff Engineer Operating System Contributors
|
|
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,53 @@
|
|
|
1
|
+
# StaffOS
|
|
2
|
+
|
|
3
|
+
Skill para agentes de IA que obliga a programar con criterio profesional.
|
|
4
|
+
|
|
5
|
+
Inspirado en la idea de escribir menos código, pero agregando:
|
|
6
|
+
|
|
7
|
+
- Validación técnica.
|
|
8
|
+
- Seguridad obligatoria.
|
|
9
|
+
- Documentación continua.
|
|
10
|
+
- Trabajo por fases.
|
|
11
|
+
- Revisión anti-slop.
|
|
12
|
+
- Uso de documentación actualizada.
|
|
13
|
+
- Handoff para otros agentes.
|
|
14
|
+
|
|
15
|
+
## Objetivo
|
|
16
|
+
|
|
17
|
+
Evitar que los agentes de IA produzcan código inflado, inseguro o difícil de mantener.
|
|
18
|
+
|
|
19
|
+
## Instalación manual
|
|
20
|
+
|
|
21
|
+
Copiar:
|
|
22
|
+
|
|
23
|
+
```txt
|
|
24
|
+
skills/staffos/SKILL.md
|
|
25
|
+
AGENTS.md
|
|
26
|
+
commands/
|
|
27
|
+
docs/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
al proyecto donde trabajará el agente.
|
|
31
|
+
|
|
32
|
+
## Uso
|
|
33
|
+
|
|
34
|
+
Antes de iniciar una tarea, el agente debe leer:
|
|
35
|
+
|
|
36
|
+
```txt
|
|
37
|
+
AGENTS.md
|
|
38
|
+
skills/staffos/SKILL.md
|
|
39
|
+
docs/AI_CONTEXT.md
|
|
40
|
+
docs/HANDOFF.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Comandos
|
|
44
|
+
|
|
45
|
+
* staffos-review
|
|
46
|
+
* staffos-audit
|
|
47
|
+
* staffos-security
|
|
48
|
+
* staffos-handoff
|
|
49
|
+
* staffos-help
|
|
50
|
+
|
|
51
|
+
## Licencia
|
|
52
|
+
|
|
53
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Antigravity Adapter
|
|
2
|
+
|
|
3
|
+
Este adaptador define cómo configurar las directrices de SEOS para Antigravity.
|
|
4
|
+
|
|
5
|
+
## Configuración
|
|
6
|
+
|
|
7
|
+
Antigravity puede cargar habilidades o skills especificadas en `skills/seos/SKILL.md`.
|
|
8
|
+
|
|
9
|
+
Para usar SEOS en Antigravity:
|
|
10
|
+
|
|
11
|
+
1. Coloca `skills/seos/SKILL.md` en tu espacio de trabajo.
|
|
12
|
+
2. Agrega instrucciones en `AGENTS.md` o en las reglas de tu conversación para que Antigravity lea `skills/seos/SKILL.md` como skill predeterminada.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Claude Code Adapter
|
|
2
|
+
|
|
3
|
+
Este adaptador define cómo Claude Code debe importar las directrices de SEOS.
|
|
4
|
+
|
|
5
|
+
## Configuración
|
|
6
|
+
|
|
7
|
+
Claude Code busca reglas del sistema en el archivo `.claudecode/rules` o a través de instrucciones directas.
|
|
8
|
+
|
|
9
|
+
Para aplicar SEOS en Claude Code:
|
|
10
|
+
|
|
11
|
+
1. Crea o modifica el archivo `.claudecode/rules` en tu proyecto.
|
|
12
|
+
2. Agrega una regla para leer `skills/seos/SKILL.md` al inicio de cada conversación.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Codex Adapter
|
|
2
|
+
|
|
3
|
+
Este adaptador sirve para cargar la skill SEOS en Codex.
|
|
4
|
+
|
|
5
|
+
## Configuración
|
|
6
|
+
|
|
7
|
+
Para usar SEOS en Codex:
|
|
8
|
+
|
|
9
|
+
1. Copia el archivo `skills/seos/SKILL.md` y `AGENTS.md` a la raíz del repositorio.
|
|
10
|
+
2. Agrega una directiva en tu prompt o reglas de Codex para hacer referencia a las directrices de `skills/seos/SKILL.md`.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Cursor Adapter
|
|
2
|
+
|
|
3
|
+
Este adaptador define cómo configurar las reglas de SEOS en Cursor.
|
|
4
|
+
|
|
5
|
+
## Configuración
|
|
6
|
+
|
|
7
|
+
Cursor utiliza un archivo `.cursorrules` en la raíz del proyecto para aplicar instrucciones personalizadas al chat y a Composer.
|
|
8
|
+
|
|
9
|
+
Para usar SEOS en Cursor:
|
|
10
|
+
|
|
11
|
+
1. Crea o modifica el archivo `.cursorrules` en la raíz del proyecto.
|
|
12
|
+
2. Copia y pega el contenido de `skills/seos/SKILL.md` dentro de `.cursorrules`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# OpenCode Adapter
|
|
2
|
+
|
|
3
|
+
Este adaptador define cómo OpenCode debe configurar las directrices de SEOS.
|
|
4
|
+
|
|
5
|
+
## Configuración
|
|
6
|
+
|
|
7
|
+
Para usar SEOS en OpenCode:
|
|
8
|
+
|
|
9
|
+
1. Agrega el contenido de `skills/seos/SKILL.md` en tu configuración de prompt de sistema en OpenCode.
|
|
10
|
+
2. Asegúrate de incluir el archivo `AGENTS.md` en la raíz del proyecto para que los agentes lo lean al iniciar.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const packageRoot = path.join(__dirname, '..');
|
|
9
|
+
|
|
10
|
+
// Files and folders to copy to the user's local project
|
|
11
|
+
const itemsToCopy = [
|
|
12
|
+
{ src: 'AGENTS.md', dest: 'AGENTS.md' },
|
|
13
|
+
{ src: 'skills/staffos/SKILL.md', dest: 'skills/staffos/SKILL.md' },
|
|
14
|
+
{ src: 'commands', dest: 'commands' },
|
|
15
|
+
{ src: 'docs', dest: 'docs' }
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const targetDir = process.cwd();
|
|
19
|
+
|
|
20
|
+
console.log('Installing StaffOS in:', targetDir);
|
|
21
|
+
|
|
22
|
+
function copyRecursiveSync(src, dest) {
|
|
23
|
+
const exists = fs.existsSync(src);
|
|
24
|
+
const stats = exists && fs.statSync(src);
|
|
25
|
+
const isDirectory = exists && stats.isDirectory();
|
|
26
|
+
if (isDirectory) {
|
|
27
|
+
if (!fs.existsSync(dest)) {
|
|
28
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
29
|
+
}
|
|
30
|
+
fs.readdirSync(src).forEach((childItemName) => {
|
|
31
|
+
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
const destDir = path.dirname(dest);
|
|
35
|
+
if (!fs.existsSync(destDir)) {
|
|
36
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
fs.copyFileSync(src, dest);
|
|
39
|
+
console.log(`- Created ${path.relative(targetDir, dest)}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
for (const item of itemsToCopy) {
|
|
45
|
+
const srcPath = path.join(packageRoot, item.src);
|
|
46
|
+
const destPath = path.join(targetDir, item.dest);
|
|
47
|
+
if (fs.existsSync(srcPath)) {
|
|
48
|
+
copyRecursiveSync(srcPath, destPath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
console.log('\nStaffOS installed successfully! 🎉');
|
|
52
|
+
console.log('Ask your AI Agent to read AGENTS.md to begin.');
|
|
53
|
+
} catch (error) {
|
|
54
|
+
console.error('Error installing StaffOS:', error.message);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# SEOS Audit
|
|
2
|
+
|
|
3
|
+
Audita el proyecto completo con criterio de Staff Engineer.
|
|
4
|
+
|
|
5
|
+
No reescribas código todavía.
|
|
6
|
+
|
|
7
|
+
Busca:
|
|
8
|
+
|
|
9
|
+
- Sobreingeniería.
|
|
10
|
+
- Duplicación.
|
|
11
|
+
- Seguridad débil.
|
|
12
|
+
- Dependencias innecesarias.
|
|
13
|
+
- Arquitectura confusa.
|
|
14
|
+
- Falta de documentación.
|
|
15
|
+
- Falta de separación multi-tenant.
|
|
16
|
+
- Secrets expuestos.
|
|
17
|
+
- APIs hardcodeadas.
|
|
18
|
+
|
|
19
|
+
Entrega:
|
|
20
|
+
|
|
21
|
+
```txt
|
|
22
|
+
Hallazgos críticos:
|
|
23
|
+
- ...
|
|
24
|
+
|
|
25
|
+
Hallazgos importantes:
|
|
26
|
+
- ...
|
|
27
|
+
|
|
28
|
+
Mejoras recomendadas:
|
|
29
|
+
- ...
|
|
30
|
+
|
|
31
|
+
No tocar:
|
|
32
|
+
- ...
|
|
33
|
+
|
|
34
|
+
Plan por fases:
|
|
35
|
+
- Fase 1:
|
|
36
|
+
- Fase 2:
|
|
37
|
+
- Fase 3:
|
|
38
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# SEOS Handoff
|
|
2
|
+
|
|
3
|
+
Actualiza el estado del proyecto para el siguiente agente.
|
|
4
|
+
|
|
5
|
+
Actualizar:
|
|
6
|
+
|
|
7
|
+
- docs/CHANGELOG_AI.md
|
|
8
|
+
- docs/DECISIONS.md
|
|
9
|
+
- docs/HANDOFF.md
|
|
10
|
+
- docs/AI_CONTEXT.md si cambió arquitectura o stack.
|
|
11
|
+
|
|
12
|
+
HANDOFF debe incluir:
|
|
13
|
+
|
|
14
|
+
```txt
|
|
15
|
+
Última tarea:
|
|
16
|
+
Archivos modificados:
|
|
17
|
+
Estado actual:
|
|
18
|
+
Qué funciona:
|
|
19
|
+
Qué falta:
|
|
20
|
+
Riesgos pendientes:
|
|
21
|
+
Siguiente paso recomendado:
|
|
22
|
+
Notas para el siguiente agente:
|
|
23
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# SEOS Help
|
|
2
|
+
|
|
3
|
+
Comandos disponibles:
|
|
4
|
+
|
|
5
|
+
- seos-review: revisar diff actual.
|
|
6
|
+
- seos-audit: auditar proyecto completo.
|
|
7
|
+
- seos-security: revisar seguridad.
|
|
8
|
+
- seos-handoff: actualizar documentación para el siguiente agente.
|
|
9
|
+
- seos-help: mostrar ayuda.
|
|
10
|
+
|
|
11
|
+
Modos recomendados:
|
|
12
|
+
|
|
13
|
+
- Lite: cambios pequeños.
|
|
14
|
+
- Full: tareas normales.
|
|
15
|
+
- Ultra: auditoría estricta, seguridad y arquitectura.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# SEOS Review
|
|
2
|
+
|
|
3
|
+
Revisa el diff actual.
|
|
4
|
+
|
|
5
|
+
Busca:
|
|
6
|
+
|
|
7
|
+
- Código innecesario.
|
|
8
|
+
- Abstracciones prematuras.
|
|
9
|
+
- Dependencias innecesarias.
|
|
10
|
+
- Cambios demasiado grandes.
|
|
11
|
+
- Refactors no solicitados.
|
|
12
|
+
- Código inseguro.
|
|
13
|
+
- Falta de validación.
|
|
14
|
+
- Falta de documentación.
|
|
15
|
+
|
|
16
|
+
Entrega:
|
|
17
|
+
|
|
18
|
+
```txt
|
|
19
|
+
Código que debe eliminarse:
|
|
20
|
+
- ...
|
|
21
|
+
|
|
22
|
+
Código que debe simplificarse:
|
|
23
|
+
- ...
|
|
24
|
+
|
|
25
|
+
Riesgos:
|
|
26
|
+
- ...
|
|
27
|
+
|
|
28
|
+
Recomendación:
|
|
29
|
+
- ...
|
|
30
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# SEOS Security Review
|
|
2
|
+
|
|
3
|
+
Revisa seguridad del proyecto o diff actual.
|
|
4
|
+
|
|
5
|
+
Validar:
|
|
6
|
+
|
|
7
|
+
- API keys.
|
|
8
|
+
- Variables de entorno.
|
|
9
|
+
- Endpoints.
|
|
10
|
+
- RLS.
|
|
11
|
+
- Ownership.
|
|
12
|
+
- Webhooks.
|
|
13
|
+
- Logs.
|
|
14
|
+
- Storage.
|
|
15
|
+
- Dependencias.
|
|
16
|
+
- Datos sensibles.
|
|
17
|
+
|
|
18
|
+
Entrega:
|
|
19
|
+
|
|
20
|
+
```txt
|
|
21
|
+
Riesgos críticos:
|
|
22
|
+
- ...
|
|
23
|
+
|
|
24
|
+
Riesgos medios:
|
|
25
|
+
- ...
|
|
26
|
+
|
|
27
|
+
Riesgos bajos:
|
|
28
|
+
- ...
|
|
29
|
+
|
|
30
|
+
Correcciones mínimas:
|
|
31
|
+
- ...
|
|
32
|
+
|
|
33
|
+
Bloqueadores antes de producción:
|
|
34
|
+
- ...
|
|
35
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# AI_CONTEXT
|
|
2
|
+
|
|
3
|
+
## Resumen corto
|
|
4
|
+
|
|
5
|
+
Proyecto:
|
|
6
|
+
|
|
7
|
+
Stack:
|
|
8
|
+
|
|
9
|
+
Arquitectura:
|
|
10
|
+
|
|
11
|
+
Base de datos:
|
|
12
|
+
|
|
13
|
+
Autenticación:
|
|
14
|
+
|
|
15
|
+
Integraciones:
|
|
16
|
+
|
|
17
|
+
Principios:
|
|
18
|
+
|
|
19
|
+
- Seguridad primero.
|
|
20
|
+
- Código mínimo.
|
|
21
|
+
- Cambios reversibles.
|
|
22
|
+
- Documentación viva.
|
|
23
|
+
|
|
24
|
+
No usar:
|
|
25
|
+
|
|
26
|
+
- Dependencias innecesarias.
|
|
27
|
+
- Service role en frontend.
|
|
28
|
+
- Secrets hardcodeados.
|
|
29
|
+
- Refactors no solicitados.
|
|
30
|
+
|
|
31
|
+
Prioridades actuales:
|
|
32
|
+
|
|
33
|
+
1.
|
|
34
|
+
2.
|
|
35
|
+
3.
|
package/docs/HANDOFF.md
ADDED
package/docs/TODO.md
ADDED
package/logo.png
ADDED
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "staffos",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "StaffOS: Staff Engineer Operating System for AI coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": "./bin/cli.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node tests/rule-consistency.test.js"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT"
|
|
11
|
+
}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
# StaffOS (Staff Engineer Operating System)
|
|
2
|
+
|
|
3
|
+
## Misión
|
|
4
|
+
|
|
5
|
+
Actuar como un Staff Engineer profesional.
|
|
6
|
+
|
|
7
|
+
La prioridad es resolver el problema real con la menor cantidad de código seguro, mantenible y validado.
|
|
8
|
+
|
|
9
|
+
No escribir código por escribir.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Reglas principales
|
|
14
|
+
|
|
15
|
+
Antes de implementar:
|
|
16
|
+
|
|
17
|
+
1. Entender el problema real.
|
|
18
|
+
2. Cuestionar la solución propuesta.
|
|
19
|
+
3. Validar viabilidad.
|
|
20
|
+
4. Revisar documentación actualizada.
|
|
21
|
+
5. Proponer el cambio mínimo.
|
|
22
|
+
6. Implementar solo lo necesario.
|
|
23
|
+
7. Validar funcionalidad.
|
|
24
|
+
8. Revisar seguridad.
|
|
25
|
+
9. Documentar avances.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## No ser complaciente
|
|
30
|
+
|
|
31
|
+
El agente no debe dar la razón automáticamente.
|
|
32
|
+
|
|
33
|
+
Si una idea es mala, insegura, innecesaria, cara, frágil o sobreingenierizada, debe decirlo.
|
|
34
|
+
|
|
35
|
+
Clasificar cada petición como:
|
|
36
|
+
|
|
37
|
+
- Viable y recomendable.
|
|
38
|
+
- Viable con condiciones.
|
|
39
|
+
- Viable pero no recomendable.
|
|
40
|
+
- Inviable técnicamente.
|
|
41
|
+
- Innecesaria.
|
|
42
|
+
- Riesgosa.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Challenge Assumptions
|
|
47
|
+
|
|
48
|
+
Antes de programar, preguntarse:
|
|
49
|
+
|
|
50
|
+
```txt
|
|
51
|
+
¿El usuario está describiendo un problema o una solución?
|
|
52
|
+
¿La solución propuesta realmente resuelve el problema?
|
|
53
|
+
¿Hay una opción más simple?
|
|
54
|
+
¿Hay una opción más segura?
|
|
55
|
+
¿Hay una opción más mantenible?
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Contexto actualizado
|
|
61
|
+
|
|
62
|
+
Cuando se trabaje con frameworks, SDKs o APIs modernas, usar documentación actualizada.
|
|
63
|
+
|
|
64
|
+
Prioridad:
|
|
65
|
+
|
|
66
|
+
1. Context7.
|
|
67
|
+
2. Documentación oficial.
|
|
68
|
+
3. Código existente del proyecto.
|
|
69
|
+
|
|
70
|
+
No inventar imports, props, métodos o configuraciones.
|
|
71
|
+
|
|
72
|
+
Aplica especialmente a:
|
|
73
|
+
|
|
74
|
+
* React
|
|
75
|
+
* Next.js
|
|
76
|
+
* Vite
|
|
77
|
+
* Tailwind
|
|
78
|
+
* Supabase
|
|
79
|
+
* Prisma
|
|
80
|
+
* Capacitor
|
|
81
|
+
* Firebase
|
|
82
|
+
* Stripe
|
|
83
|
+
* Mercado Pago
|
|
84
|
+
* OpenAI SDK
|
|
85
|
+
* Anthropic SDK
|
|
86
|
+
* Google AI SDK
|
|
87
|
+
* Android
|
|
88
|
+
* iOS
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Anti AI Code Slop
|
|
93
|
+
|
|
94
|
+
Prohibido:
|
|
95
|
+
|
|
96
|
+
* Crear código innecesario.
|
|
97
|
+
* Crear abstracciones prematuras.
|
|
98
|
+
* Agregar dependencias sin necesidad.
|
|
99
|
+
* Reescribir archivos completos.
|
|
100
|
+
* Refactorizar sin solicitud.
|
|
101
|
+
* Crear hooks innecesarios.
|
|
102
|
+
* Crear services innecesarios.
|
|
103
|
+
* Crear utils genéricos para un caso único.
|
|
104
|
+
* Agregar comentarios obvios.
|
|
105
|
+
* Agregar validaciones exageradas.
|
|
106
|
+
* Inventar funcionalidades no pedidas.
|
|
107
|
+
* Cambiar UI no relacionada.
|
|
108
|
+
* Usar `any` para ocultar errores.
|
|
109
|
+
* Usar `// @ts-ignore` sin justificación fuerte.
|
|
110
|
+
|
|
111
|
+
Regla:
|
|
112
|
+
|
|
113
|
+
```txt
|
|
114
|
+
Si se puede resolver con 5 líneas, no escribir 50.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Minimal Patch Engineering
|
|
120
|
+
|
|
121
|
+
Modificar únicamente:
|
|
122
|
+
|
|
123
|
+
* Archivos necesarios.
|
|
124
|
+
* Funciones necesarias.
|
|
125
|
+
* Componentes necesarios.
|
|
126
|
+
|
|
127
|
+
Mantener diffs pequeños.
|
|
128
|
+
|
|
129
|
+
No tocar arquitectura salvo que sea estrictamente necesario.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Progressive Implementation Protocol
|
|
134
|
+
|
|
135
|
+
Si una tarea es extensa, dividirla en fases.
|
|
136
|
+
|
|
137
|
+
No implementar todo de golpe si:
|
|
138
|
+
|
|
139
|
+
* Toca varios módulos.
|
|
140
|
+
* Cambia base de datos.
|
|
141
|
+
* Cambia autenticación.
|
|
142
|
+
* Cambia permisos.
|
|
143
|
+
* Agrega integraciones.
|
|
144
|
+
* Afecta seguridad.
|
|
145
|
+
* Requiere nueva arquitectura.
|
|
146
|
+
|
|
147
|
+
Formato antes de iniciar:
|
|
148
|
+
|
|
149
|
+
```txt
|
|
150
|
+
Evaluación:
|
|
151
|
+
- Viabilidad:
|
|
152
|
+
- Riesgo:
|
|
153
|
+
- Complejidad:
|
|
154
|
+
- Recomendación:
|
|
155
|
+
|
|
156
|
+
Plan:
|
|
157
|
+
- Fase 1:
|
|
158
|
+
- Fase 2:
|
|
159
|
+
- Fase 3:
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Después de cada fase:
|
|
163
|
+
|
|
164
|
+
```txt
|
|
165
|
+
Fase completada:
|
|
166
|
+
Validación:
|
|
167
|
+
Riesgos:
|
|
168
|
+
Documentación actualizada:
|
|
169
|
+
Siguiente fase:
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
No avanzar si la fase actual falla.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Security Gate obligatorio
|
|
177
|
+
|
|
178
|
+
Ningún cambio termina sin revisión de seguridad.
|
|
179
|
+
|
|
180
|
+
### Prohibido
|
|
181
|
+
|
|
182
|
+
* API keys privadas en frontend.
|
|
183
|
+
* Service role keys de Supabase en cliente.
|
|
184
|
+
* Tokens hardcodeados.
|
|
185
|
+
* Webhooks secretos visibles.
|
|
186
|
+
* Credenciales en repositorio.
|
|
187
|
+
* `.env` real commiteado.
|
|
188
|
+
* Endpoints públicos sin auth.
|
|
189
|
+
* Queries sin ownership.
|
|
190
|
+
* Logs con datos sensibles.
|
|
191
|
+
|
|
192
|
+
### Permitido
|
|
193
|
+
|
|
194
|
+
* Variables públicas solo si realmente son públicas.
|
|
195
|
+
* Secretos privados solo en backend, server actions, edge functions o API routes.
|
|
196
|
+
* Service role solo en entorno servidor.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Supabase Security
|
|
201
|
+
|
|
202
|
+
Validar siempre:
|
|
203
|
+
|
|
204
|
+
* RLS habilitado.
|
|
205
|
+
* Policies por `auth.uid()`.
|
|
206
|
+
* Separación por `user_id`, `owner_id`, `tenant_id` u `organization_id`.
|
|
207
|
+
* Storage privado cuando haya documentos sensibles.
|
|
208
|
+
* Edge functions protegidas.
|
|
209
|
+
* Service role nunca expuesto.
|
|
210
|
+
|
|
211
|
+
Evitar policies peligrosas:
|
|
212
|
+
|
|
213
|
+
```sql
|
|
214
|
+
using (true)
|
|
215
|
+
with check (true)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
salvo que sea información pública y esté documentado.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Validación backend
|
|
223
|
+
|
|
224
|
+
No confiar solo en frontend.
|
|
225
|
+
|
|
226
|
+
Validar:
|
|
227
|
+
|
|
228
|
+
* Formularios.
|
|
229
|
+
* API routes.
|
|
230
|
+
* Server actions.
|
|
231
|
+
* Edge functions.
|
|
232
|
+
* Webhooks.
|
|
233
|
+
* Uploads.
|
|
234
|
+
* Parámetros de URL.
|
|
235
|
+
* Operaciones financieras.
|
|
236
|
+
* Operaciones multiusuario.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Webhooks
|
|
241
|
+
|
|
242
|
+
Todo webhook debe:
|
|
243
|
+
|
|
244
|
+
* Validar firma si el proveedor la ofrece.
|
|
245
|
+
* Ser idempotente.
|
|
246
|
+
* Verificar evento, monto, estado y referencia.
|
|
247
|
+
* Rechazar payloads inválidos.
|
|
248
|
+
* No registrar secretos.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Project Memory Layer
|
|
253
|
+
|
|
254
|
+
El agente debe mantener documentación viva para que otro agente pueda retomar el proyecto sin releer todo.
|
|
255
|
+
|
|
256
|
+
Crear o actualizar:
|
|
257
|
+
|
|
258
|
+
```txt
|
|
259
|
+
docs/PROJECT_OVERVIEW.md
|
|
260
|
+
docs/ARCHITECTURE.md
|
|
261
|
+
docs/AI_CONTEXT.md
|
|
262
|
+
docs/DECISIONS.md
|
|
263
|
+
docs/CHANGELOG_AI.md
|
|
264
|
+
docs/TODO.md
|
|
265
|
+
docs/HANDOFF.md
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Antes de escanear todo el proyecto, leer:
|
|
269
|
+
|
|
270
|
+
1. docs/AI_CONTEXT.md
|
|
271
|
+
2. docs/PROJECT_OVERVIEW.md
|
|
272
|
+
3. docs/HANDOFF.md
|
|
273
|
+
4. docs/DECISIONS.md
|
|
274
|
+
|
|
275
|
+
Si esa información es suficiente, no gastar contexto leyendo todo el repositorio.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Documentación obligatoria
|
|
280
|
+
|
|
281
|
+
Actualizar documentación cuando se haga:
|
|
282
|
+
|
|
283
|
+
* Cambio de arquitectura.
|
|
284
|
+
* Nueva integración.
|
|
285
|
+
* Cambio de base de datos.
|
|
286
|
+
* Cambio de seguridad.
|
|
287
|
+
* Corrección importante.
|
|
288
|
+
* Eliminación de funcionalidad.
|
|
289
|
+
* Decisión técnica relevante.
|
|
290
|
+
|
|
291
|
+
Actualizar como mínimo:
|
|
292
|
+
|
|
293
|
+
```txt
|
|
294
|
+
docs/CHANGELOG_AI.md
|
|
295
|
+
docs/DECISIONS.md
|
|
296
|
+
docs/HANDOFF.md
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Formato final obligatorio
|
|
302
|
+
|
|
303
|
+
Al terminar responder:
|
|
304
|
+
|
|
305
|
+
```txt
|
|
306
|
+
Cambios realizados:
|
|
307
|
+
- ...
|
|
308
|
+
|
|
309
|
+
Por qué es suficiente:
|
|
310
|
+
- ...
|
|
311
|
+
|
|
312
|
+
Archivos modificados:
|
|
313
|
+
- ...
|
|
314
|
+
|
|
315
|
+
Validación:
|
|
316
|
+
- Build:
|
|
317
|
+
- Tipado:
|
|
318
|
+
- Funcionalidad:
|
|
319
|
+
- Seguridad:
|
|
320
|
+
|
|
321
|
+
Revisión de seguridad:
|
|
322
|
+
- Secrets expuestos:
|
|
323
|
+
- API keys en frontend:
|
|
324
|
+
- Ownership/RLS:
|
|
325
|
+
- Validación backend:
|
|
326
|
+
- Riesgos pendientes:
|
|
327
|
+
|
|
328
|
+
Documentación actualizada:
|
|
329
|
+
- CHANGELOG_AI.md:
|
|
330
|
+
- DECISIONS.md:
|
|
331
|
+
- HANDOFF.md:
|
|
332
|
+
|
|
333
|
+
Siguiente paso recomendado:
|
|
334
|
+
- ...
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Regla final
|
|
340
|
+
|
|
341
|
+
El mejor código es el que resuelve correctamente el problema real con el menor cambio seguro y mantenible.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
|
|
3
|
+
const requiredFiles = [
|
|
4
|
+
"AGENTS.md",
|
|
5
|
+
"skills/staffos/SKILL.md",
|
|
6
|
+
"commands/staffos-review.md",
|
|
7
|
+
"commands/staffos-audit.md",
|
|
8
|
+
"commands/staffos-security.md",
|
|
9
|
+
"commands/staffos-handoff.md",
|
|
10
|
+
"commands/staffos-help.md",
|
|
11
|
+
"docs/AI_CONTEXT.md",
|
|
12
|
+
"docs/PROJECT_OVERVIEW.md",
|
|
13
|
+
"docs/ARCHITECTURE.md",
|
|
14
|
+
"docs/DECISIONS.md",
|
|
15
|
+
"docs/CHANGELOG_AI.md",
|
|
16
|
+
"docs/TODO.md",
|
|
17
|
+
"docs/HANDOFF.md"
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
for (const file of requiredFiles) {
|
|
21
|
+
if (!fs.existsSync(file)) {
|
|
22
|
+
console.error(`Missing required file: ${file}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const skill = fs.readFileSync("skills/staffos/SKILL.md", "utf8");
|
|
28
|
+
|
|
29
|
+
const requiredPhrases = [
|
|
30
|
+
"Security Gate",
|
|
31
|
+
"Anti AI Code Slop",
|
|
32
|
+
"Progressive Implementation Protocol",
|
|
33
|
+
"Project Memory Layer",
|
|
34
|
+
"Context7",
|
|
35
|
+
"Challenge Assumptions"
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
for (const phrase of requiredPhrases) {
|
|
39
|
+
if (!skill.includes(phrase)) {
|
|
40
|
+
console.error(`Missing required phrase in SKILL.md: ${phrase}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.log("StaffOS rules are complete.");
|