clckernel 1.2.6 → 1.2.8
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/README.es.md +51 -118
- package/README.md +48 -116
- package/package.json +14 -2
- package/src/adapters/agent-os.js +183 -0
- package/src/catalog.js +16 -0
- package/src/detector.js +2 -0
- package/src/index.js +11 -0
- package/src/ui.js +79 -35
- package/tools/audit.js +0 -0
- package/tools/audit.py +0 -0
- package/tools/check_custom.js +0 -0
- package/tools/check_custom.py +0 -0
- package/tools/check_db_efficiency.py +0 -0
- package/tools/check_domain_data.js +100 -0
- package/tools/check_hitl.js +93 -0
- package/tools/check_responsive.js +0 -0
- package/tools/check_seo.js +1 -1
- package/tools/check_symlinks.js +76 -0
- package/tools/scan_secrets.js +12 -1
- package/tools/scan_secrets.py +0 -0
- package/AGENTS.md +0 -124
- package/docs/Journal/001-adr-clckernel-governance.md +0 -18
- package/test/adapters/astro.test.js +0 -102
- package/test/adapters/base.test.js +0 -86
- package/test/adapters/django.test.js +0 -95
- package/test/adapters/fastapi.test.js +0 -88
- package/test/adapters/go.test.js +0 -81
- package/test/adapters/laravel.test.js +0 -106
- package/test/adapters/nextjs.test.js +0 -113
- package/test/adapters/rails.test.js +0 -108
- package/test/adapters/rust.test.js +0 -83
- package/test/catalog.test.js +0 -170
- package/test/config.test.js +0 -512
- package/test/detector.test.js +0 -345
- package/test/doctor.test.js +0 -302
- package/test/generator.test.js +0 -419
- package/test/guards_new.test.js +0 -95
- package/test/helpers.js +0 -36
- package/test/integration/cli-flow.test.js +0 -270
- package/test/technologies/celery_guard.test.js +0 -185
- package/test/technologies/detector.test.js +0 -342
- package/test/technologies/docker_guard.test.js +0 -187
- package/test/technologies/integration.test.js +0 -123
- package/test/technologies/postgres_guard.test.js +0 -87
- package/test/technologies/redis_guard.test.js +0 -128
package/README.es.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img width="
|
|
3
|
-
</div>
|
|
2
|
+
<img width="280" height="280" alt="clckernel_logo" src="https://github.com/user-attachments/assets/2898e9c1-ec7a-4c60-a6dd-e62c05a0d446" />
|
|
4
3
|
|
|
5
4
|
# 🤖 CLC Kernel (`clckernel`)
|
|
6
5
|
|
|
@@ -8,30 +7,28 @@
|
|
|
8
7
|
[](https://opensource.org/licenses/MIT)
|
|
9
8
|
[](./README.md)
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
**El Motor Universal de Gobernanza Determinista para Agentes de IA & Orquestador AIUP.**
|
|
11
|
+
*Creado por [CarlosLeonCode](https://github.com/carlosleoncode).*
|
|
12
|
+
</div>
|
|
13
13
|
|
|
14
|
-
Los agentes de IA (
|
|
14
|
+
Los agentes de programación con IA (Cursor, Claude Code, Windsurf, Copilot) codifican a gran velocidad, pero sin límites introducen degradación arquitectónica, tests falsos positivos y fuga de credenciales.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
**CLC Kernel** es un arnés de desarrollo políglota que gobierna físicamente a los agentes mediante **linters AST deterministas (< 5ms)**, **especificaciones SDD locales** y el cumplimiento del **Proceso Unificado de IA (AIUP)**.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
## 🎯
|
|
21
|
-
|
|
22
|
-
CLC Kernel **no** es "otro framework de IA" ni una colección de prompts. Define una categoría de ingeniería propia: **Gobernanza Determinística de Agentes de IA (AI Agent Governance)**.
|
|
20
|
+
## 🎯 Casos de Uso
|
|
23
21
|
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
| **
|
|
27
|
-
| **
|
|
28
|
-
| **
|
|
22
|
+
| Caso de Uso | Problema que Resuelve | Cómo lo Resuelve CLC Kernel |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| **1. Gobernanza de Coding Agents**<br>*(Cursor, Claude Code, Copilot)* | Los agentes programan por intuición ("vibe coding"), se saltan pruebas y rompen capas de arquitectura en backend y frontend. | Impone la **Regla #0** (Investigación -> SDD -> TDD Rojo a Verde -> Auditoría AST) y bloquea commits no conformes mediante linters AST. |
|
|
25
|
+
| **2. Arquetipos Agent-OS y Flujos de Dominio**<br>*(Bots autónomos, OS de marketing/ventas)* | Runtimes de agentes ejecutan acciones sin supervisión, alucinan métricas o desincronizan reglas en diferentes IDEs. | Provee **Gobernanza Dual-Layer**, valida symlinks de reglas para IDEs, exige compuertas Human-in-the-Loop (`check_hitl`) y valida esquemas con null seguro (`check_domain_data`). |
|
|
26
|
+
| **3. Refactorizaciones y Migraciones Críticas** | Los agentes modifican archivos fuera del alcance acordado, introduciendo regresiones silenciosas. | Delimita el trabajo en una especificación local `sdds/{cambio}/spec.md` y bloquea commits que toquen archivos no autorizados (`check_scope`). |
|
|
27
|
+
| **4. Blindaje Pre-Commit y Shift-Left en CI/CD** | Fuga de credenciales, consultas N+1 en bucles y migraciones destructivas llegan a ramas remotas. | Ejecuta validaciones AST sin dependencias foráneas en el lenguaje nativo del stack en **< 5ms** antes de cada commit. |
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
|
-
## 🏛️
|
|
33
|
-
|
|
34
|
-
CLC Kernel se apoya en cinco fundamentos de ingeniería diseñados para erradicar los vicios del "Vibe Coding":
|
|
31
|
+
## 🏛️ El Proceso Unificado de IA (AIUP)
|
|
35
32
|
|
|
36
33
|
```
|
|
37
34
|
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -43,124 +40,60 @@ CLC Kernel se apoya en cinco fundamentos de ingeniería diseñados para erradica
|
|
|
43
40
|
└─────────────┴─────────────┴─────────────┴──────────────────┴────────────────┘
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### 🧪 C. Test-Driven Development (TDD Rojo-a-Verde)
|
|
53
|
-
Los agentes suelen generar "tests tautológicos" que nunca fallan ante bugs reales. CLC Kernel impone TDD genuino: el agente debe escribir un test de regresión que falle primero (Fase Roja) y demostrar el fallo antes de escribir la implementación (Fase Verde).
|
|
54
|
-
|
|
55
|
-
### 🛡️ D. Salvaguardas AST Determinísticas (Linters Nativos)
|
|
56
|
-
Las instrucciones en markdown se olvidan con facilidad. CLC Kernel provisiona linters basados en el Árbol de Sintaxis Abstracta (AST) en el lenguaje nativo del stack (Python `ast`, Go `ast`, RuboCop, PHPStan, TypeScript AST). Estos guardias validan físicamente los cambios y bloquean commits inválidos:
|
|
57
|
-
- **📱 Frontend & UX:** Breakpoints mobile-first y touch targets de 44px (`check_responsive`), metadata SEO/tags GEO/prioridad LCP (`check_seo`), accesibilidad ARIA (`check_a11y`), reutilización de primitivas UI (`check_ui_reuse`), optimización de imágenes y tree-shaking (`check_performance`), y contratos Zod (`check_api_contracts`).
|
|
58
|
-
- **🏛️ Backend & Arquitectura:** Aislamiento de capas Clean Architecture (`check_architecture`), prevención de queries N+1 en loops (`check_db_efficiency`), idempotencia de migraciones (`check_migrations`), y escaneo de secretos (`scan_secrets`).
|
|
59
|
-
- **🎯 Proceso & Infraestructura:** Validación de alcance git diff vs SDD (`check_scope`), prueba de transición TDD Rojo-a-Verde (`verify_tdd`), y guardias de tecnologías (`docker_guard`, `celery_guard`, `redis_guard`, `postgres_guard`).
|
|
60
|
-
|
|
61
|
-
### 🔗 E. Single Source of Truth (SSOT) & Espejado Dinámico (Mirroring)
|
|
62
|
-
Mantener archivos de reglas separados para Cursor, Claude, Windsurf, Copilot y Gemini produce desincronización y deriva de contexto. CLC Kernel lo resuelve mediante **Espejado Dinámico**:
|
|
63
|
-
- `AGENTS.md` se forja como el **Single Source of Truth** (Única Fuente de Verdad).
|
|
64
|
-
- Symlinks multiplataforma proyectan automáticamente `AGENTS.md` hacia:
|
|
65
|
-
- 🧠 `CLAUDE.md` (Claude Desktop / Windsurf)
|
|
66
|
-
- 🌌 `GEMINI.md` (Gemini CLI / Project IDX)
|
|
67
|
-
- 💠 `.cursorrules` & `.cursor/rules/clckernel_context.mdc` (Cursor)
|
|
68
|
-
- ✈️ `.github/copilot-instructions.md` (GitHub Copilot)
|
|
69
|
-
- 🛸 `.antigravity/rules.md` (Antigravity)
|
|
70
|
-
- *Editás una sola vez en `AGENTS.md` y todos los IDEs absorben el contexto de forma instantánea y con cero duplicación.*
|
|
43
|
+
1. **SDD (Spec-Driven Development):** El agente debe redactar una especificación técnica local gitignorada (`sdds/{feature}/spec.md`) antes de tocar código de producción.
|
|
44
|
+
2. **HIT (Human-in-the-Loop):** El ingeniero revisa y aprueba los contratos y escenarios de prueba antes del inicio de la implementación.
|
|
45
|
+
3. **TDD (Rojo a Verde):** El agente debe demostrar un test de regresión fallido (Fase Roja) antes de escribir la solución en producción (Fase Verde).
|
|
46
|
+
4. **AST (Salvaguardas Deterministas):** Parsers nativos del stack (Python `ast`, Go `ast`, RuboCop, TypeScript AST) inspeccionan el diff y bloquean físicamente commits no conformes.
|
|
47
|
+
5. **SSOT (Única Fuente de Verdad):** `AGENTS.md` se define una sola vez y se proyecta mediante symlinks hacia `CLAUDE.md`, `GEMINI.md`, `.cursorrules` y Copilot.
|
|
71
48
|
|
|
72
49
|
---
|
|
73
50
|
|
|
74
|
-
##
|
|
51
|
+
## 🌐 Ecosistemas Soportados y Arquetipos
|
|
75
52
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<div align="center">
|
|
79
|
-
<img width="900" alt="clckernel_comparison_es" src="https://github.com/user-attachments/assets/4d2e6651-15be-46f6-ae12-c8274b6492ca" />
|
|
80
|
-
<p><em>Izquierda: Agente de IA sin gobernanza — código caótico y alucinado. Derecha: Agente con CLC Kernel AIUP — estructurado, seguro y arquitectónicamente correcto.</em></p>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
- ❌ **Decaimiento Arquitectónico:** Mezclar lógica de rutas con llamadas a la base de datos en lugar de respetar el aislamiento de capas.
|
|
84
|
-
- ❌ **Duplicación de UI:** Inventar colores hexadecimales arbitrarios y HTML crudo en lugar de reutilizar los tokens del sistema de diseño.
|
|
85
|
-
- ❌ **Tests de Falso Positivo:** Declarar que una feature funciona sin jamás demostrar la transición Rojo-a-Verde.
|
|
86
|
-
- ❌ **Fugas de Seguridad:** Commitear accidentalmente API Keys o exponer DTOs privados del backend al cliente.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## 🧩 4. Dependencias Deseadas del Ecosistema (Opcionales y Modulares)
|
|
91
|
-
|
|
92
|
-
CLC Kernel se enfoca estrictamente en **Gobernanza, Proceso y Salvaguardas de Calidad**. Intencionalmente **no** empaqueta un motor de grafos propietario ni una base de datos de persistencia monolítica. En su lugar, delega esas capacidades en herramientas complementarias especializadas (con degradación elegante si no se encuentran instaladas en el entorno):
|
|
93
|
-
|
|
94
|
-
| Herramienta Complementaria | Rol | Por Qué es Deseada | Comportamiento si no está |
|
|
53
|
+
| Ecosistema | Firma de Detección | Test Runner | Salvaguardas Nativas |
|
|
95
54
|
|---|---|---|---|
|
|
96
|
-
|
|
|
97
|
-
|
|
|
98
|
-
| 🛡️ **[Gentle AI (RDD)](https://github.com/Gentleman-Programming/gentle-ai)** | Gate de Revisión Adversaria | Aplica Review-Driven Development (RDD) con inspección multi-lente antes de commitear cambios. | Salteo elegante (`verify_rdd_review_gate` pasa como advisory). |
|
|
99
|
-
| ⚡ **Linters Nativos por Stack** | AST & Seguridad de Tipos | `ruff` (Python), `golangci-lint` (Go), `cargo clippy` (Rust), `phpstan` (PHP), `tsc` (TypeScript). | Utiliza las herramientas CLI instaladas en el entorno local del proyecto. |
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 🧠 5. El Paradigma de la CLI Conversacional
|
|
104
|
-
|
|
105
|
-
CLC Kernel opera tanto en tu terminal como dentro del chat de tu IDE con IA. Al inicializarse, inyecta un **Agentic Playbook (`SKILL.md`)** en tu repositorio, convirtiendo cualquier LLM en un asistente interactivo de gobernanza:
|
|
106
|
-
|
|
107
|
-
- 🚀 **`clckernel start`**: Detecta tu stack automáticamente, propone un ciclo de gobernanza, y materializa `.clckernel.yaml`.
|
|
108
|
-
- 🛠️ **`clckernel create_guard`**: Escribe un linter AST personalizado en el lenguaje nativo de tu stack (`tools/guards/`).
|
|
109
|
-
- 🔄 **`clckernel add_phase` / `remove_guard`**: Modifica el ciclo de vida AIUP interactivamente sin editar YAML manualmente.
|
|
110
|
-
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
## 🌐 6. Adaptadores Polyglot por Stack
|
|
114
|
-
|
|
115
|
-
CLC Kernel cuenta con adaptadores dedicados para los principales ecosistemas:
|
|
116
|
-
|
|
117
|
-
| Ecosistema | Firma de Detección | Test Runner | Salvaguardas Aplicadas |
|
|
118
|
-
|---|---|---|---|
|
|
119
|
-
| ⚛️ **Next.js** | `next` | Vitest / Jest | Reutilización de UI, Tokens Semánticos, Reglas RSC, Zod, A11y, Responsive, SEO, Performance |
|
|
120
|
-
| ⚡ **FastAPI** | `fastapi` | Pytest | Pydantic V2, Idempotencia Alembic, AST Arquitectura Limpia, Eficiencia DB (N+1) |
|
|
55
|
+
| ⚛️ **Next.js** | `next` | Vitest / Jest | Clean Architecture, Reutilización de UI, Tokens Semánticos, RSC, A11y, Responsive, SEO |
|
|
56
|
+
| ⚡ **FastAPI** | `fastapi` | Pytest | Pydantic V2, Idempotencia Alembic, AST Clean Architecture, Eficiencia DB (N+1) |
|
|
121
57
|
| 💎 **Rails** | `Gemfile` | RSpec | AST RuboCop, Seguridad Brakeman, Idempotencia de Migraciones |
|
|
122
|
-
| 🐹 **Golang** | `go.mod` | `go test` | AST `golangci-lint`,
|
|
123
|
-
| 🦀 **Rust** | `Cargo.toml` | `cargo test` | AST `cargo clippy`, `cargo audit`, Seguridad de Memoria
|
|
124
|
-
| 🐘 **Laravel** | `artisan` | Pest / PHPUnit | AST PHPStan, Detección de N+1 Eloquent, Migraciones |
|
|
58
|
+
| 🐹 **Golang** | `go.mod` | `go test` | AST `golangci-lint`, Aislamiento de Capas Dominio/Casos de Uso |
|
|
59
|
+
| 🦀 **Rust** | `Cargo.toml` | `cargo test` | AST `cargo clippy`, `cargo audit`, Seguridad Estricta de Memoria |
|
|
60
|
+
| 🐘 **Laravel** | `artisan` | Pest / PHPUnit | AST PHPStan, Detección de Consultas N+1 en Eloquent, Migraciones |
|
|
125
61
|
| 🎸 **Django** | `manage.py` | `pytest-django` | Idempotencia ORM Django, AST Ruff, Scope Guard, Eficiencia DB (N+1) |
|
|
126
|
-
| 🚀 **Astro** | `astro.config` | Playwright | Tokens Tailwind v4,
|
|
62
|
+
| 🚀 **Astro** | `astro.config` | Playwright | Tokens Tailwind v4, Esquemas de Colección, A11y, Responsive, SEO |
|
|
63
|
+
| 🤖 **Agent-OS** | `skills/`, `brand/`, `templates/` | Tests de Contrato | AGENTS.md Dual-Layer, Compuertas HITL (`check_hitl`), Symlinks (`check_symlinks`), Integridad de Datos (`check_domain_data`) |
|
|
127
64
|
|
|
128
65
|
---
|
|
129
66
|
|
|
130
|
-
##
|
|
67
|
+
## 🚀 Inicio Rápido
|
|
131
68
|
|
|
69
|
+
### 1. Inicializar en Terminal
|
|
70
|
+
```bash
|
|
71
|
+
npx clckernel start
|
|
132
72
|
```
|
|
133
|
-
|
|
134
|
-
npx clckernel ───► clckernel start ───► "Feature X con harness" ───► Hooks Pre-commit
|
|
135
|
-
(Bootstrap) (Setup Interactivo) (SDD -> HIT -> Tests) (Guardián AST & Secretos)
|
|
136
|
-
```
|
|
73
|
+
Detecta el framework, genera `AGENTS.md`, crea symlinks para todos los IDEs, provisiona hooks pre-commit e instala verificadores AST en `tools/`.
|
|
137
74
|
|
|
138
|
-
###
|
|
75
|
+
### 2. Verificar Estado de Salud
|
|
139
76
|
```bash
|
|
140
|
-
npx clckernel
|
|
77
|
+
npx clckernel doctor
|
|
141
78
|
```
|
|
142
|
-
|
|
79
|
+
Audita hooks de Git, test runners activos y la integridad del motor AST.
|
|
143
80
|
|
|
144
|
-
###
|
|
145
|
-
|
|
146
|
-
>
|
|
147
|
-
El agente escanea tu código en silencio, propone un plan de gobernanza AIUP adaptado a tu stack y genera `.clckernel.yaml`.
|
|
81
|
+
### 3. Desarrollar con Gobernanza
|
|
82
|
+
En el chat del IDE (Cursor, Claude Code, Gemini CLI, Windsurf):
|
|
83
|
+
> *"Implementa el endpoint de autenticación. **Usa el harness de CLC Kernel**."*
|
|
148
84
|
|
|
149
|
-
|
|
150
|
-
Al pedir una funcionalidad o corrección, activá el workflow:
|
|
151
|
-
> *"Agregá el endpoint de autenticación. **Usá el workflow / harness**."*
|
|
152
|
-
El agente ejecuta de forma autónoma el ciclo de 10 pasos: **SDD Spec -> Gate HIT -> TDD Rojo-a-Verde -> Implementación Limpia -> Auditoría AST**.
|
|
85
|
+
El agente ejecutará el ciclo AIUP completo: **Especificación SDD -> Aprobación HIT -> Test Rojo -> Implementación Verde -> Auditoría AST**.
|
|
153
86
|
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
git add .
|
|
157
|
-
git commit -m "feat(auth): add user authentication endpoint"
|
|
158
|
-
```
|
|
159
|
-
Los hooks pre-commit ejecutan escáneres AST automáticos (Clean Architecture, Fuga de Secretos, Scope Guard, Idempotencia de Migraciones). Cualquier violación bloquea el commit de inmediato.
|
|
87
|
+
---
|
|
160
88
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
89
|
+
## 🧩 Herramientas Complementarias (Opcionales)
|
|
90
|
+
|
|
91
|
+
CLC Kernel se enfoca estrictamente en gobernanza y opera con **cero dependencias foráneas**. Se integra de forma modular con:
|
|
92
|
+
- 🧠 **[Engram (MCP)](https://github.com/Gentleman-Programming/gentle-ai):** Memoria arquitectónica persistente y registro de ADRs entre sesiones.
|
|
93
|
+
- 🕸️ **[Graphify](https://github.com/carlosleoncode/graphify):** Generación de grafos visuales de dependencias y topología del código.
|
|
94
|
+
- 🛡️ **[Gentle AI (RDD)](https://github.com/Gentleman-Programming/gentle-ai):** Compuerta de revisión multi-lente adversaria antes de commitear.
|
|
95
|
+
|
|
96
|
+
---
|
|
166
97
|
|
|
98
|
+
## 📄 Licencia
|
|
99
|
+
MIT © [CarlosLeonCode](https://github.com/carlosleoncode)
|
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img width="
|
|
3
|
-
</div>
|
|
2
|
+
<img width="280" height="280" alt="clckernel_logo" src="https://github.com/user-attachments/assets/ed631ce1-c996-4347-b818-97b8ab25e0ec" />
|
|
4
3
|
|
|
5
4
|
# 🤖 CLC Kernel (`clckernel`)
|
|
6
5
|
|
|
@@ -8,30 +7,28 @@
|
|
|
8
7
|
[](https://opensource.org/licenses/MIT)
|
|
9
8
|
[](./README.es.md)
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
**Deterministic AI Agent Governance Engine & AIUP Orchestrator.**
|
|
11
|
+
*Forged by [CarlosLeonCode](https://github.com/carlosleoncode).*
|
|
12
|
+
</div>
|
|
13
13
|
|
|
14
|
-
AI coding agents (
|
|
14
|
+
AI coding agents (Cursor, Claude Code, Windsurf, Copilot) code fast, but without guardrails they create architectural decay, tautological tests, and secret leaks.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
**CLC Kernel** is a polyglot developer harness that physically governs AI agents using **deterministic AST linters (< 5ms)**, **local SDD specs**, and an enforced **AI Unified Process (AIUP)**.
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
-
## 🎯
|
|
20
|
+
## 🎯 Use Cases
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
| **
|
|
27
|
-
| **
|
|
28
|
-
| **Agent Runtimes** (LangGraph, CrewAI) | Builds multi-agent production backend apps. | **Different problem:** Doesn't govern human-in-the-loop repo development. | **Developer Tooling Harness:** Injected directly into your daily IDE workflow. |
|
|
22
|
+
| Use Case | Problem It Solves | How CLC Kernel Solves It |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| **1. Coding Agent Governance**<br>*(Cursor, Claude Code, Copilot)* | Agents "vibe code", bypass tests, and violate layer boundaries in backend/frontend apps. | Enforces **Rule #0** (Research -> SDD -> TDD Red-to-Green -> AST Audit) and blocks commits via native AST guards. |
|
|
25
|
+
| **2. Agent-OS & Domain Workflows**<br>*(Autonomous bots, marketing/sales OS)* | Agent runtimes execute actions without review, hallucinate metrics, or drift across IDE configs. | Provides **Dual-Layer Governance**, validates IDE mirror symlinks, checks Human-in-the-Loop (`check_hitl`), and enforces null-safe schemas (`check_domain_data`). |
|
|
26
|
+
| **3. Complex Refactors & Migrations** | Agents modify files outside the agreed feature scope, causing silent regressions. | Locks work to a local `sdds/{change}/spec.md` and fails commits modifying untouched layers (`check_scope`). |
|
|
27
|
+
| **4. Shift-Left CI/CD & Pre-commit** | Secret leaks, N+1 query loops, and broken database migrations reach remote branches. | Runs zero-dependency AST checks in your stack's native language in **< 5ms** before Git commit. |
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
|
-
## 🏛️
|
|
33
|
-
|
|
34
|
-
CLC Kernel is built upon five foundational engineering principles designed to eliminate "vibe coding" hazards:
|
|
31
|
+
## 🏛️ The AI Unified Process (AIUP)
|
|
35
32
|
|
|
36
33
|
```
|
|
37
34
|
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
@@ -43,125 +40,60 @@ CLC Kernel is built upon five foundational engineering principles designed to el
|
|
|
43
40
|
└─────────────┴─────────────┴─────────────┴──────────────────┴────────────────┘
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### 🧪 C. Test-Driven Development (TDD Red-to-Green)
|
|
53
|
-
AI agents frequently generate "tautological tests" that never fail against bugs. CLC Kernel enforces real TDD: the agent must produce a failing regression test (Red Phase) and prove failure before writing implementation code (Green Phase).
|
|
54
|
-
|
|
55
|
-
### 🛡️ D. Deterministic AST Safeguards (Native Code Linters)
|
|
56
|
-
Markdown instructions can be forgotten by LLMs. CLC Kernel provisions deterministic Abstract Syntax Tree (AST) linters in the stack's native language (Python `ast`, Go `ast`, RuboCop, PHPStan, TypeScript AST). These guards physically validate code changes and block non-compliant commits:
|
|
57
|
-
- **📱 Frontend & UX:** Mobile-first responsive breakpoints & 44px touch targets (`check_responsive`), SEO metadata/GEO tags/LCP priority (`check_seo`), ARIA accessibility (`check_a11y`), UI primitive reuse (`check_ui_reuse`), image optimization & tree-shaking (`check_performance`), and Zod API contracts (`check_api_contracts`).
|
|
58
|
-
- **🏛️ Backend & Architecture:** Clean Architecture layer boundaries (`check_architecture`), N+1 query loop prevention (`check_db_efficiency`), migration idempotency (`check_migrations`), and secret leak scanning (`scan_secrets`).
|
|
59
|
-
- **🎯 Process & Infrastructure:** Git diff vs SDD scope validation (`check_scope`), TDD Red-to-Green transition proof (`verify_tdd`), and tech guards (`docker_guard`, `celery_guard`, `redis_guard`, `postgres_guard`).
|
|
60
|
-
|
|
61
|
-
### 🔗 E. Single Source of Truth (SSOT) & Dynamic Mirroring
|
|
62
|
-
Managing separate instructions for Cursor, Claude, Windsurf, Copilot, and Gemini causes documentation drift. CLC Kernel solves this via **Dynamic Mirroring**:
|
|
63
|
-
- `AGENTS.md` is forged as the **Single Source of Truth**.
|
|
64
|
-
- Cross-platform filesystem symlinks automatically project `AGENTS.md` to:
|
|
65
|
-
- 🧠 `CLAUDE.md` (Claude Desktop / Windsurf)
|
|
66
|
-
- 🌌 `GEMINI.md` (Gemini CLI / Project IDX)
|
|
67
|
-
- 💠 `.cursorrules` & `.cursor/rules/clckernel_context.mdc` (Cursor)
|
|
68
|
-
- ✈️ `.github/copilot-instructions.md` (GitHub Copilot)
|
|
69
|
-
- 🛸 `.antigravity/rules.md` (Antigravity)
|
|
70
|
-
- *Edit once in `AGENTS.md`, and all AI IDEs synchronize instantly with zero redundancy.*
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 💡 3. Why CLC Kernel Exists
|
|
75
|
-
|
|
76
|
-
Left unguided, AI agents create compounding **Comprehension Debt**—a codebase that grows faster than the team's ability to maintain its architecture:
|
|
77
|
-
|
|
78
|
-
<div align="center">
|
|
79
|
-
<img width="900" alt="clckernel_comparison" src="https://github.com/user-attachments/assets/cb62753a-3e88-432d-9196-94eaa817864d" />
|
|
80
|
-
<p><em>Left: AI agent without governance — chaotic, hallucinated code. Right: AI agent with CLC Kernel AIUP — structured, safe, architectural.</em></p>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
- ❌ **Architectural Decay:** Mixing routing logic with database queries instead of respecting layer isolation.
|
|
84
|
-
- ❌ **UI Duplication:** Inventing raw HTML and arbitrary hex colors instead of reusing design tokens.
|
|
85
|
-
- ❌ **False-Positive Tests:** Writing mocks that pass trivially without testing domain invariants.
|
|
86
|
-
- ❌ **Secret Leaks:** Accidental commits of API credentials or private backend DTOs.
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## 🧩 4. Recommended Ecosystem Dependencies (Modular & Optional)
|
|
91
|
-
|
|
92
|
-
CLC Kernel focuses strictly on **Governance, Process & Quality Guardrails**. It intentionally does not bundle monolithic databases or runtime graphs. Instead, it integrates modularly with companion tools (with graceful skip if absent):
|
|
93
|
-
|
|
94
|
-
| Companion Tool | Role | Why It's Recommended | Fallback Behavior |
|
|
95
|
-
|---|---|---|---|
|
|
96
|
-
| 🧠 **[Engram (MCP)](https://github.com/Gentleman-Programming/gentle-ai)** | Long-Term Memory & ADRs | Preserves architectural context, design rationales, and cross-session knowledge for agents. | Graceful skip (audits proceed without persistent memory). |
|
|
97
|
-
| 🕸️ **[Graphify](https://github.com/carlosleoncode/graphify)** | Code Knowledge Graph | Generates dependency graphs and visual codebase topology for architecture-aware agents. | Graceful skip (`verify_memory_graph` advisory check passes). |
|
|
98
|
-
| 🛡️ **[Gentle AI (RDD)](https://github.com/Gentleman-Programming/gentle-ai)** | Adversarial Review Gate | Enforces Review-Driven Development (RDD) with multi-lens inspection before commits. | Graceful skip (`verify_rdd_review_gate` advisory check passes). |
|
|
99
|
-
| ⚡ **Native Stack Linters** | AST & Type Safety | `ruff` (Python), `golangci-lint` (Go), `cargo clippy` (Rust), `phpstan` (PHP), `tsc` (TypeScript). | Uses whatever CLI is available in the local repository environment. |
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## 🧠 5. The Conversational CLI Paradigm
|
|
104
|
-
|
|
105
|
-
CLC Kernel operates both in your terminal and inside your AI chat. It injects an **Agentic Playbook (`SKILL.md`)**, turning your LLM into an interactive governance orchestrator:
|
|
106
|
-
|
|
107
|
-
- 🚀 **`clckernel start`**: Auto-detects your stack, proposes an AIUP lifecycle, and generates `.clckernel.yaml`.
|
|
108
|
-
- 🛠️ **`clckernel create_guard`**: Generates a custom AST linter in your stack's native language (`tools/guards/`).
|
|
109
|
-
- 🔄 **`clckernel add_phase` / `remove_guard`**: Interactively mutates the AIUP workflow without manual YAML editing.
|
|
43
|
+
1. **SDD (Spec-Driven Development):** Agent must write a local, gitignored specification (`sdds/{feature}/spec.md`) before editing production files.
|
|
44
|
+
2. **HIT (Human-in-the-Loop):** The engineer reviews and approves test scenarios and contracts before execution begins.
|
|
45
|
+
3. **TDD (Red-to-Green):** Agent must prove failure with a failing regression test (Red Phase) before writing implementation code (Green Phase).
|
|
46
|
+
4. **AST (Deterministic Safeguards):** Native stack parsers (Python `ast`, Go `ast`, RuboCop, TypeScript AST) inspect diffs and physically block invalid commits.
|
|
47
|
+
5. **SSOT (Single Source of Truth):** `AGENTS.md` is forged once and mirrored via filesystem symlinks to `CLAUDE.md`, `GEMINI.md`, `.cursorrules`, and Copilot.
|
|
110
48
|
|
|
111
49
|
---
|
|
112
50
|
|
|
113
|
-
## 🌐
|
|
51
|
+
## 🌐 Supported Stacks & Archetypes
|
|
114
52
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
| Ecosystem | Detection Signature | Test Runner | Enforced Safeguards |
|
|
53
|
+
| Ecosystem | Detection Signature | Test Runner | Native Safeguards |
|
|
118
54
|
|---|---|---|---|
|
|
119
|
-
| ⚛️ **Next.js** | `next` | Vitest / Jest | UI Reuse, Semantic Tokens, RSC
|
|
55
|
+
| ⚛️ **Next.js** | `next` | Vitest / Jest | Clean Arch, UI Reuse, Semantic Tokens, RSC, A11y, Responsive, SEO |
|
|
120
56
|
| ⚡ **FastAPI** | `fastapi` | Pytest | Pydantic V2, Alembic Idempotency, Clean Arch AST, DB Efficiency (N+1) |
|
|
121
57
|
| 💎 **Rails** | `Gemfile` | RSpec | RuboCop AST, Brakeman Security, Migration Idempotency |
|
|
122
|
-
| 🐹 **Golang** | `go.mod` | `go test` | `golangci-lint` AST, Domain/UseCase
|
|
58
|
+
| 🐹 **Golang** | `go.mod` | `go test` | `golangci-lint` AST, Domain/UseCase Layer Isolation |
|
|
123
59
|
| 🦀 **Rust** | `Cargo.toml` | `cargo test` | `cargo clippy` AST, `cargo audit`, Strict Memory Safety |
|
|
124
|
-
| 🐘 **Laravel** | `artisan` | Pest / PHPUnit | PHPStan AST, Eloquent N+1 Detection, Migrations |
|
|
60
|
+
| 🐘 **Laravel** | `artisan` | Pest / PHPUnit | PHPStan AST, Eloquent N+1 Loop Detection, Migrations |
|
|
125
61
|
| 🎸 **Django** | `manage.py` | `pytest-django` | Django ORM Idempotency, Ruff AST, Scope Guard, DB Efficiency (N+1) |
|
|
126
|
-
| 🚀 **Astro** | `astro.config` | Playwright | Tailwind v4 Tokens, Content
|
|
62
|
+
| 🚀 **Astro** | `astro.config` | Playwright | Tailwind v4 Tokens, Content Schema, A11y, Responsive, SEO |
|
|
63
|
+
| 🤖 **Agent-OS** | `skills/`, `brand/`, `templates/` | Contract Tests | Dual-Layer AGENTS.md, HITL Gates (`check_hitl`), Symlinks (`check_symlinks`), Domain Data (`check_domain_data`) |
|
|
127
64
|
|
|
128
65
|
---
|
|
129
66
|
|
|
130
|
-
##
|
|
67
|
+
## 🚀 Quickstart
|
|
131
68
|
|
|
69
|
+
### 1. Initialize in Terminal
|
|
70
|
+
```bash
|
|
71
|
+
npx clckernel start
|
|
132
72
|
```
|
|
133
|
-
|
|
134
|
-
npx clckernel ───► clckernel start ───► "Feature X with harness" ───► Pre-commit Hooks
|
|
135
|
-
(Bootstrap) (Interactive Setup) (SDD -> HIT -> Tests) (AST & Secret Guard)
|
|
136
|
-
```
|
|
73
|
+
Auto-detects your framework, generates `AGENTS.md`, creates IDE rule symlinks, provisions pre-commit hooks, and creates native AST checks in `tools/`.
|
|
137
74
|
|
|
138
|
-
###
|
|
75
|
+
### 2. Verify Health
|
|
139
76
|
```bash
|
|
140
|
-
npx clckernel
|
|
77
|
+
npx clckernel doctor
|
|
141
78
|
```
|
|
142
|
-
|
|
79
|
+
Audits Git hooks, active test runners, and AST engine integrity.
|
|
143
80
|
|
|
144
|
-
###
|
|
145
|
-
|
|
146
|
-
>
|
|
147
|
-
The agent scans your codebase silently, proposes an AIUP governance plan tailored to your framework, and generates `.clckernel.yaml`.
|
|
81
|
+
### 3. Develop with Agentic Governance
|
|
82
|
+
In your IDE chat (Cursor, Claude Code, Gemini CLI, Windsurf):
|
|
83
|
+
> *"Implement authentication endpoint. **Follow the CLC Kernel harness**."*
|
|
148
84
|
|
|
149
|
-
|
|
150
|
-
When requesting features or fixes, trigger the workflow:
|
|
151
|
-
> *"Add user authentication endpoint. **Use the workflow / harness**."*
|
|
152
|
-
The agent executes the full AIUP cycle: **SDD Spec -> HIT Approval -> TDD Red Phase -> Clean Implementation -> AST Audit**.
|
|
85
|
+
The agent executes the full AIUP loop: **SDD Spec -> HIT Review -> Failing Test (Red) -> Implementation (Green) -> AST Audit**.
|
|
153
86
|
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
git add .
|
|
157
|
-
git commit -m "feat(auth): add user authentication endpoint"
|
|
158
|
-
```
|
|
159
|
-
Pre-commit hooks execute AST scanners (Clean Architecture, Secret Leaks, Scope Guard, Migration Idempotency). Non-compliant commits are blocked deterministically.
|
|
87
|
+
---
|
|
160
88
|
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
npx clckernel doctor
|
|
164
|
-
```
|
|
165
|
-
Runs the **CLC Kernel Doctor** to verify 100% compliance across `AGENTS.md`, `sdds/`, `tools/`, and Git hooks.
|
|
89
|
+
## 🧩 Optional Ecosystem Companions
|
|
166
90
|
|
|
91
|
+
CLC Kernel focuses strictly on governance and runs with **zero foreign dependencies**. It seamlessly integrates with companion tools:
|
|
92
|
+
- 🧠 **[Engram (MCP)](https://github.com/Gentleman-Programming/gentle-ai):** Persistent architectural memory and ADR tracking across agent sessions.
|
|
93
|
+
- 🕸️ **[Graphify](https://github.com/carlosleoncode/graphify):** Visual dependency graphs and codebase topology mapping.
|
|
94
|
+
- 🛡️ **[Gentle AI (RDD)](https://github.com/Gentleman-Programming/gentle-ai):** Multi-lens adversarial code review gate.
|
|
95
|
+
|
|
96
|
+
---
|
|
167
97
|
|
|
98
|
+
## 📄 License
|
|
99
|
+
MIT © [CarlosLeonCode](https://github.com/carlosleoncode)
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clckernel",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "CLC Kernel — The Universal Polyglot AI Agent Governance Engine (Next.js, FastAPI, Django, Astro, Rails, Go, Rust, Laravel).",
|
|
5
5
|
"main": "./bin/cli.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"bin",
|
|
8
|
+
"src",
|
|
9
|
+
"tools",
|
|
10
|
+
"README.md",
|
|
11
|
+
"README.es.md"
|
|
12
|
+
],
|
|
6
13
|
"bin": {
|
|
7
14
|
"clckernel": "bin/cli.js",
|
|
8
15
|
"create-clckernel": "bin/cli.js",
|
|
@@ -39,6 +46,11 @@
|
|
|
39
46
|
"scripts": {
|
|
40
47
|
"test": "node --test test/*.test.js test/**/*.test.js",
|
|
41
48
|
"test:unit": "node --test test/adapters/*.test.js",
|
|
42
|
-
"test:coverage": "NODE_V8_COVERAGE=coverage node --test test/*.test.js test/**/*.test.js"
|
|
49
|
+
"test:coverage": "NODE_V8_COVERAGE=coverage node --test test/*.test.js test/**/*.test.js",
|
|
50
|
+
"website:dev": "npm --prefix website run dev",
|
|
51
|
+
"website:build": "npm --prefix website run build"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@clack/prompts": "^1.8.1"
|
|
43
55
|
}
|
|
44
56
|
}
|