@ancleto/spec 0.9.0 → 0.10.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 Damian Argañarás, Lucas Bonch
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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Orquestador SDD (Spec-Driven Development) y toolkit personal asistido por IA**
6
6
 
7
- [![Version](https://img.shields.io/npm/v/@ancleto/spec?style=flat-square&label=version&color=4f46e5)](https://www.npmjs.com/package/@ancleto/spec)
7
+ [![Version](https://img.shields.io/npm/v/%40ancleto/spec?style=flat-square&label=version&color=4f46e5)](https://www.npmjs.com/package/@ancleto/spec)
8
8
  [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A5%2024-43853D?style=flat-square&logo=node.js&logoColor=white)](#requisitos)
9
9
  [![Dependencies](https://img.shields.io/badge/dependencies-0-0d9488?style=flat-square)](#requisitos)
10
10
  [![Agents](https://img.shields.io/badge/agents-10-334155?style=flat-square)](#caracter%C3%ADsticas-principales)
@@ -23,6 +23,7 @@
23
23
  - [Características principales](#características-principales)
24
24
  - [Requisitos](#requisitos)
25
25
  - [Instalación](#instalación)
26
+ - [Instalación manual (sin npm)](docs/instalacion-manual.md)
26
27
  - [Hosts soportados y layouts por agente](#hosts-soportados-y-layouts-por-agente)
27
28
  - [Guía de .gitignore](#guía-de-gitignore)
28
29
  - [Configuración y tiers de costo](#configuración-y-tiers-de-costo)
@@ -165,10 +166,11 @@ verificados de Antigravity (`read`→`view_file`, `edit`→`replace_file_content
165
166
  tool de opencode sin id verificado se **omite con aviso** (`skip tool '<k>': no verified Antigravity id
166
167
  for agent '<n>'`): un id inexistente cuelga el subagent. Los ids que sólo existen en el SDK
167
168
  (`find_file`, `edit_file`, `search_web`, `read_url_content`, …), los de comunidad (`write_to_file`,
168
- `call_mcp_tool`, `multi_replace_file_content`, …) y los de delegación (`invoke_subagent`,
169
- `start_subagent`, `define_subagent`) **no** se emiten; el uso de MCP se expresa por
170
- `mcpServers`/`.agents/mcp_config.json`, nunca como tool id. El campo `skill` no es una tool: se cubre
171
- con el surfaceo automático de skills de Antigravity.
169
+ `multi_replace_file_content`, …) y los de delegación (`invoke_subagent`, `start_subagent`,
170
+ `define_subagent`) **no** se emiten. Las claves de MCP declaradas dentro de `tools` (`mcpServers`,
171
+ `mcp_*`, `call_mcp_tool`) caen en **omisión con aviso** y `call_mcp_tool` queda **prohibido**; el uso
172
+ de MCP se expresa por `mcpServers`/`.agents/mcp_config.json`, nunca como tool id. El campo `skill` no
173
+ es una tool: se cubre con el surfaceo automático de skills de Antigravity.
172
174
 
173
175
  Los assets que un host no soporta (por ejemplo `agents`/`commands` de `cursor` y `roo`)
174
176
  **no se escriben** y el instalador avisa por `stderr`
@@ -308,6 +310,8 @@ ancleto init # Crea .ancletorc, aspec/, AGENTS.md y PRODUCT.md
308
310
 
309
311
  `init` **no pisa** lo que ya existe: si tu repo tiene su propio `AGENTS.md` o `PRODUCT.md`, los respeta (solo fusiona los bloques `<!-- LOCKED -->` del template). Además materializa `.ancleto/working-context.md` con tus reglas activas cuando hay memoria — es el bloque que el orquestador inyecta al arrancar.
310
312
 
313
+ Si el repo trae una carpeta legacy `openspec/`, `init`, `install --project` y `upgrade` la detectan y migran su contenido a `aspec/` **por copia**, sin prompts, cuando `aspec/` no existe o sólo tiene el scaffold: conservan `openspec/` como backup y escriben el marcador `aspec/.migrated-from-openspec`. Si `aspec/` ya tiene contenido real propio no fusionan las carpetas y avisan para revisión manual, y si el marcador ya existe la corrida es un no-op silencioso.
314
+
311
315
  > ¿Querés que el proyecto lleve **su propia** copia de agents/skills (sin depender de la instalación global)? Sumá `ancleto install --project .`.
312
316
 
313
317
  ### 2. Descubrir contexto técnico
@@ -409,7 +413,7 @@ Funciona en tres piezas que comparten el mismo archivo:
409
413
 
410
414
  Cada entrada tiene un `scope`: `project` (default), `feature` o `task`. Solo las **reglas** activas con scope `project` entran en `<ProjectMemoryRules>`; las **decisiones** con scope `project` se recuperan reactivamente con `searchMemory` y no se inyectan de forma proactiva. El orquestador inyecta los bloques `<ProjectMemoryRules>` y `<ProjectTopology>` en el system prompt de tu agente desde el día cero —incluso sin reglas previas— para que no repita errores ya resueltos.
411
415
 
412
- > El mismo motor se puede consultar a mano desde la terminal: `ancleto memory context --scope project`. El archivo `.ancleto/working-context.md` que lee el orquestador se regenera solo en `init`, `install --project` y `upgrade`.
416
+ > El mismo motor se puede consultar a mano desde la terminal: `ancleto memory context --scope project`. El archivo `.ancleto/working-context.md` que lee el orquestador se regenera en los lifecycle points (`init`, `install --project`, `upgrade` y `memory context --out`) y también **on-write**, cuando una escritura MCP lo altera: al registrar una `rule` con scope `project` o al superseder una `memory_key` existente (sin importar `type` ni `scope`).
413
417
 
414
418
  **Dos memorias, sin mezcla.** La memoria **del repositorio** (esta, `.ancleto/memory.db`) guarda reglas y decisiones del proyecto y se comparte con el equipo. Si el runtime expone además una memoria **del agente** (por ejemplo engram, habilitable con `--with-engram`), esa guarda notas de sesión, no del repo. **Una entrada vive en una sola**: si un futuro agente del equipo debería encontrarla, va al repo.
415
419
 
@@ -425,7 +429,8 @@ Una vez instalado, tu IDE expone el ciclo de vida completo como comandos barra:
425
429
  | `/cleto-propose` | Proponer el diseño técnico. |
426
430
  | `/cleto-ff` | Avanzar rápido con el contexto ya recuperado. |
427
431
  | `/cleto-apply` | Aplicar el código del change. |
428
- | `/cleto-verify` | Verificar reglas, tests y memoria antes de cerrar. |
432
+ | `/cleto-verify` | Verificar reglas, tests y memoria antes de cerrar. En modo `aspec Change`, cuando el proposal declara garantías de efecto sobre estado, verifica además que se sostengan bajo el modelo real; si no, emite `GUARANTEE NOT SUSTAINED` (`CRITICAL`) y el orquestador bloquea el archive. |
433
+ | `/cleto-review` | Revisar código del scope por duplicación, redundancia, mala ubicación y código sin uso. |
429
434
  | `/cleto-security` | Realizar una auditoría de seguridad integral en el proyecto o change. |
430
435
  | `/cleto-sync` | Sincronizar las specs con el estado del repositorio. |
431
436
  | `/cleto-archive` | Archivar el change y registrar aprendizajes. |
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Review scoped code for duplication, redundancy, misplacement and dead code
3
+ ---
4
+
5
+ Invoke the `ancleto-review` skill with the Skill tool and follow it exactly; do not improvise steps.
6
+
7
+ **Input**: The argument after `/cleto-review` is the scope to review: a ticket reference (e.g. `#123`, resolved to commits whose message contains it), a git range (e.g. `main..HEAD`), or paths/directories. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available scopes.
8
+
9
+ Work Item grounding (when the request references a Work Item) is owned by `@context-resolver`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancleto/spec",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Orquestador SDD liviano con subagentes optimizados para costo/tokens",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: ancleto-review
3
+ description: Review user-scoped code for duplication, redundancy, misplacement and dead code. Reports findings with file:line refs without modifying code. No external binaries required.
4
+ license: MIT
5
+ compatibility: No external binaries required. Works with any agent runtime.
6
+ metadata:
7
+ author: ancleto
8
+ version: '1.0'
9
+ ---
10
+
11
+ # aspec Review
12
+
13
+ Review code quality inside a user-declared scope. Read-only: never write or edit code.
14
+
15
+ **Input**: the scope to review — free text after `/cleto-review`. Forms (first match wins): `#<n>` (commits whose message contains `#<n>`), an explicit git range (`A..B`, `HEAD~n`), existing paths/directories, or empty (infer from context). If ambiguous, list candidate scopes and ask. Never guess.
16
+
17
+ **IMPORTANT**: Do NOT guess or auto-select a scope when ambiguous. Always let the user choose. Work Item grounding (when the request references a Work Item) is owned by `@context-resolver` — treat a resolved item as `#<n>`.
18
+
19
+ ## Steps
20
+
21
+ ### 1. Resolve the scope
22
+
23
+ - `#<n>` → `git log --grep="#<n>" --format=%H`, then the diff of each commit (`H^ H`). Only code introduced there is in scope.
24
+ - Range (`A..B`, `HEAD~n`) → `git diff` of that range.
25
+ - Paths → worktree diff filtered to those paths.
26
+ - Nothing usable → list `aspec/changes/` dirs with `tasks.md` and recent `git log` subjects as candidates, and ask.
27
+
28
+ The result is a concrete file:line list. Report ONLY on that list.
29
+
30
+ ### 2. Collect evidence (reading outside the scope is allowed)
31
+
32
+ Read outside the diff solely as comparison evidence: twin definitions (redundancy), call/import references (dead code), and the project map (`PRODUCT.md`, directory structure, `aspec/specs/`) for placement. Never report findings outside the scope.
33
+
34
+ ### 3. Run the four detectors
35
+
36
+ **Duplicated code:** twin blocks inside the scope doing the same logic → CRITICAL: "Duplicated block: `<file:line>` and `<file:line>`" + "Extract to a shared helper".
37
+
38
+ **Redundant method:** scope logic already implemented outside the diff → WARNING: "Redundant with `<external-file:line>`" + "Reuse `<name>` instead of duplicating". If the difference is subtle or uncertain, downgrade to SUGGESTION.
39
+
40
+ **Misplaced code:** scope code contradicting the project map (e.g. business logic in a handler, stray util in a component) → WARNING or SUGGESTION: "Misplaced code: `<file:line>` belongs in `<location>`" + reason. When the architecture is unclear, prefer SUGGESTION.
41
+
42
+ **Dead code:** scope functions/imports with no references in the repo (search calls and imports) → CRITICAL when proven (no references at all): "Unused code: `<file:line>`" + "Remove it". Otherwise SUGGESTION.
43
+
44
+ ### 4. Review Report
45
+
46
+ ```
47
+ ## Review: <scope description>
48
+
49
+ ### CRITICAL
50
+ - ...
51
+
52
+ ### WARNING
53
+ - ...
54
+
55
+ ### SUGGESTION
56
+ - ...
57
+ ```
58
+
59
+ **Issues by priority**, each with a specific recommendation:
60
+
61
+ 1. **CRITICAL** (proven duplication or proven dead code inside the scope).
62
+ 2. **WARNING** (likely redundancy or misplacement, evidence cited).
63
+ 3. **SUGGESTION** (uncertain or stylistic, needs human judgment).
64
+
65
+ **Assessment:** CRITICAL → "X critical issue(s) found. Fix before merging."; warnings only → "No critical issues. Y warning(s) to consider."; clean → "No issues found in scope: `<scope>`."
66
+
67
+ ## Heuristics
68
+
69
+ - **Scope discipline**: every finding must point at a file:line inside the scope; external files appear only as evidence.
70
+ - **False positives**: when uncertain, prefer SUGGESTION > WARNING > CRITICAL.
71
+ - **Actionability**: every issue carries a specific recommendation with file/line refs.
72
+
73
+ ## Guardrails
74
+
75
+ - Read-only: never write, edit, or refactor code — only report.
76
+ - Reference code as `file.ts:123`.
77
+ - No vague suggestions ("consider reviewing") — every issue needs a specific recommendation.
78
+ - Never paste diffs or code blocks — cite locations.
79
+ - At most 5 findings per severity; if more exist, keep the 5 highest-impact and state the count of the rest.
80
+ - This skill does not verify artifacts (that is `ancleto-verify`), conventions against an approved request (that is `reviewer`), or vulnerabilities (that is `ancleto-security`).