argos-harness 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/LICENSE +21 -0
- package/README.md +21 -0
- package/assets/agents/auditor.md +140 -0
- package/assets/agents/commit-pr-pilot.md +154 -0
- package/assets/agents/explorer.md +93 -0
- package/assets/agents/implementer.md +117 -0
- package/assets/agents/leader.md +149 -0
- package/assets/agents/researcher.md +89 -0
- package/assets/agents/review-readability.md +87 -0
- package/assets/agents/review-reliability.md +100 -0
- package/assets/agents/review-resilience.md +87 -0
- package/assets/agents/review-risk.md +87 -0
- package/assets/agents/reviewer.md +167 -0
- package/assets/agents/ticket-audit.md +129 -0
- package/assets/hooks/argos-guard-destructive.sh +127 -0
- package/assets/hooks/argos-quality-gate.sh +129 -0
- package/assets/managed/aterrizaje.md +24 -0
- package/assets/managed/formato-respuesta.md +21 -0
- package/assets/managed/identidad.md +48 -0
- package/assets/managed/operaciones-seguras.md +14 -0
- package/assets/managed/orquestacion.md +169 -0
- package/assets/output-styles/argos.md +71 -0
- package/assets/skills/ai-sdk-5/SKILL.md +230 -0
- package/assets/skills/angular/SKILL.md +19 -0
- package/assets/skills/angular/references/architecture.md +137 -0
- package/assets/skills/angular/references/core.md +197 -0
- package/assets/skills/angular/references/forms.md +115 -0
- package/assets/skills/angular/references/performance.md +124 -0
- package/assets/skills/apollo-client/SKILL.md +61 -0
- package/assets/skills/app-blueprint/SKILL.md +45 -0
- package/assets/skills/app-blueprint/assets/module-template.md +48 -0
- package/assets/skills/app-blueprint/assets/system-template.md +38 -0
- package/assets/skills/app-blueprint/references/workflow.md +101 -0
- package/assets/skills/app-builder/SKILL.md +43 -0
- package/assets/skills/app-builder/phases/0-product.md +58 -0
- package/assets/skills/app-builder/phases/1-scaffold.md +33 -0
- package/assets/skills/app-builder/phases/10-store.md +40 -0
- package/assets/skills/app-builder/phases/2-data.md +34 -0
- package/assets/skills/app-builder/phases/3-domain.md +33 -0
- package/assets/skills/app-builder/phases/4-ui-nav.md +32 -0
- package/assets/skills/app-builder/phases/5-identity.md +30 -0
- package/assets/skills/app-builder/phases/6-polish.md +34 -0
- package/assets/skills/app-builder/phases/7-brand.md +31 -0
- package/assets/skills/app-builder/phases/8-web.md +30 -0
- package/assets/skills/app-builder/phases/9-docs.md +31 -0
- package/assets/skills/app-ia/SKILL.md +54 -0
- package/assets/skills/astro/SKILL.md +39 -0
- package/assets/skills/axios/SKILL.md +61 -0
- package/assets/skills/branch-pr/SKILL.md +200 -0
- package/assets/skills/bullmq/SKILL.md +55 -0
- package/assets/skills/chained-pr/SKILL.md +48 -0
- package/assets/skills/chained-pr/references/chaining-details.md +99 -0
- package/assets/skills/cognitive-doc-design/SKILL.md +81 -0
- package/assets/skills/comment-writer/SKILL.md +74 -0
- package/assets/skills/dashboard-ia/SKILL.md +54 -0
- package/assets/skills/django-drf/SKILL.md +180 -0
- package/assets/skills/go-testing/SKILL.md +47 -0
- package/assets/skills/go-testing/references/examples.md +89 -0
- package/assets/skills/issue-creation/SKILL.md +223 -0
- package/assets/skills/jira-epic/SKILL.md +306 -0
- package/assets/skills/jira-task/SKILL.md +382 -0
- package/assets/skills/judgment-day/SKILL.md +52 -0
- package/assets/skills/judgment-day/references/prompts-and-formats.md +98 -0
- package/assets/skills/lightsail-deploy/SKILL.md +44 -0
- package/assets/skills/lightsail-deploy/references/runbook.md +102 -0
- package/assets/skills/loop-back-debug/SKILL.md +102 -0
- package/assets/skills/mantine-form/SKILL.md +57 -0
- package/assets/skills/mongoose/SKILL.md +66 -0
- package/assets/skills/nextjs-15/SKILL.md +144 -0
- package/assets/skills/not-boring-mobile/SKILL.md +43 -0
- package/assets/skills/not-boring-mobile/references/not-boring-playbook.md +65 -0
- package/assets/skills/playwright/SKILL.md +315 -0
- package/assets/skills/pr-comments/SKILL.md +93 -0
- package/assets/skills/pr-create/SKILL.md +64 -0
- package/assets/skills/promo-video/SKILL.md +52 -0
- package/assets/skills/promo-video/assets/package.template.json +22 -0
- package/assets/skills/promo-video/assets/promo.template.tsx +469 -0
- package/assets/skills/promo-video/assets/theme.template.ts +27 -0
- package/assets/skills/promo-video/references/pipeline.md +119 -0
- package/assets/skills/promo-video-web/SKILL.md +51 -0
- package/assets/skills/promo-video-web/assets/browser-promo.template.tsx +385 -0
- package/assets/skills/promo-video-web/assets/capture.template.ts +70 -0
- package/assets/skills/promo-video-web/assets/package.template.json +26 -0
- package/assets/skills/promo-video-web/references/pipeline.md +84 -0
- package/assets/skills/pytest/SKILL.md +180 -0
- package/assets/skills/react-19/SKILL.md +118 -0
- package/assets/skills/react-hook-form/SKILL.md +59 -0
- package/assets/skills/react-router/SKILL.md +60 -0
- package/assets/skills/redux-toolkit/SKILL.md +60 -0
- package/assets/skills/review-diff/SKILL.md +101 -0
- package/assets/skills/ship-docs/SKILL.md +45 -0
- package/assets/skills/ship-docs/references/ship-docs-playbook.md +31 -0
- package/assets/skills/skill-creator/SKILL.md +97 -0
- package/assets/skills/skill-creator/assets/SKILL-TEMPLATE.md +68 -0
- package/assets/skills/skill-creator/references/skill-style-guide.md +79 -0
- package/assets/skills/skill-improver/SKILL.md +50 -0
- package/assets/skills/skill-improver/references/skill-style-guide.md +79 -0
- package/assets/skills/socketio/SKILL.md +58 -0
- package/assets/skills/spec-bootstrap/SKILL.md +62 -0
- package/assets/skills/store-ship/SKILL.md +52 -0
- package/assets/skills/store-ship/assets/android-supply.template.md +22 -0
- package/assets/skills/store-ship/assets/eas.template.json +32 -0
- package/assets/skills/store-ship/assets/maestro-flow.template.yaml +27 -0
- package/assets/skills/store-ship/assets/store.config.template.json +28 -0
- package/assets/skills/store-ship/references/pipeline.md +198 -0
- package/assets/skills/stripe/SKILL.md +83 -0
- package/assets/skills/tailwind-4/SKILL.md +193 -0
- package/assets/skills/tamagui/SKILL.md +60 -0
- package/assets/skills/tanstack-query/SKILL.md +58 -0
- package/assets/skills/ticket-intake/SKILL.md +55 -0
- package/assets/skills/typescript/SKILL.md +134 -0
- package/assets/skills/verify-before-done/SKILL.md +111 -0
- package/assets/skills/webapp-rebuilder/SKILL.md +48 -0
- package/assets/skills/webapp-rebuilder/assets/charter-template.md +46 -0
- package/assets/skills/webapp-rebuilder/references/workflow.md +47 -0
- package/assets/skills/winston-logging/SKILL.md +61 -0
- package/assets/skills/work-unit-commits/SKILL.md +84 -0
- package/assets/skills/zod-4/SKILL.md +210 -0
- package/assets/skills/zustand-5/SKILL.md +216 -0
- package/bin/argos.js +6 -0
- package/dist/commands/adopt.d.ts +35 -0
- package/dist/commands/adopt.d.ts.map +1 -0
- package/dist/commands/adopt.js +347 -0
- package/dist/commands/adopt.js.map +1 -0
- package/dist/commands/doctor.d.ts +20 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +478 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +32 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +358 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/remove.d.ts +62 -0
- package/dist/commands/remove.d.ts.map +1 -0
- package/dist/commands/remove.js +487 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/workspace.d.ts +73 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +354 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/assets.d.ts +29 -0
- package/dist/lib/assets.d.ts.map +1 -0
- package/dist/lib/assets.js +57 -0
- package/dist/lib/assets.js.map +1 -0
- package/dist/lib/atomic-write.d.ts +17 -0
- package/dist/lib/atomic-write.d.ts.map +1 -0
- package/dist/lib/atomic-write.js +41 -0
- package/dist/lib/atomic-write.js.map +1 -0
- package/dist/lib/backup.d.ts +11 -0
- package/dist/lib/backup.d.ts.map +1 -0
- package/dist/lib/backup.js +42 -0
- package/dist/lib/backup.js.map +1 -0
- package/dist/lib/config.d.ts +36 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +52 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/detect.d.ts +58 -0
- package/dist/lib/detect.d.ts.map +1 -0
- package/dist/lib/detect.js +330 -0
- package/dist/lib/detect.js.map +1 -0
- package/dist/lib/ficha.d.ts +10 -0
- package/dist/lib/ficha.d.ts.map +1 -0
- package/dist/lib/ficha.js +38 -0
- package/dist/lib/ficha.js.map +1 -0
- package/dist/lib/git.d.ts +27 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +79 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/managed-files.d.ts +35 -0
- package/dist/lib/managed-files.d.ts.map +1 -0
- package/dist/lib/managed-files.js +97 -0
- package/dist/lib/managed-files.js.map +1 -0
- package/dist/lib/markers.d.ts +64 -0
- package/dist/lib/markers.d.ts.map +1 -0
- package/dist/lib/markers.js +157 -0
- package/dist/lib/markers.js.map +1 -0
- package/dist/lib/navori-import.d.ts +42 -0
- package/dist/lib/navori-import.d.ts.map +1 -0
- package/dist/lib/navori-import.js +65 -0
- package/dist/lib/navori-import.js.map +1 -0
- package/dist/lib/openclaw-agents.d.ts +53 -0
- package/dist/lib/openclaw-agents.d.ts.map +1 -0
- package/dist/lib/openclaw-agents.js +118 -0
- package/dist/lib/openclaw-agents.js.map +1 -0
- package/dist/lib/package-root.d.ts +11 -0
- package/dist/lib/package-root.d.ts.map +1 -0
- package/dist/lib/package-root.js +23 -0
- package/dist/lib/package-root.js.map +1 -0
- package/dist/lib/paths.d.ts +11 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +16 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/lib/settings-merge.d.ts +125 -0
- package/dist/lib/settings-merge.d.ts.map +1 -0
- package/dist/lib/settings-merge.js +373 -0
- package/dist/lib/settings-merge.js.map +1 -0
- package/dist/lib/version.d.ts +3 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +13 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/lib/which.d.ts +8 -0
- package/dist/lib/which.d.ts.map +1 -0
- package/dist/lib/which.js +30 -0
- package/dist/lib/which.js.map +1 -0
- package/dist/lib/workspaces.d.ts +133 -0
- package/dist/lib/workspaces.d.ts.map +1 -0
- package/dist/lib/workspaces.js +241 -0
- package/dist/lib/workspaces.js.map +1 -0
- package/dist/lib/zod-messages.d.ts +4 -0
- package/dist/lib/zod-messages.d.ts.map +1 -0
- package/dist/lib/zod-messages.js +28 -0
- package/dist/lib/zod-messages.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reviewer
|
|
3
|
+
description: Revisor estricto. Aprueba o rechaza el trabajo del implementador contra CLAUDE.md. No edita código.
|
|
4
|
+
tools: Read, Glob, Grep, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
effort: medium
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Agente Revisor
|
|
10
|
+
|
|
11
|
+
Eres un revisor estricto. Tu única función es **aprobar o rechazar**. No editas código.
|
|
12
|
+
|
|
13
|
+
## Protocolo
|
|
14
|
+
|
|
15
|
+
### Setup (común a las dos pasadas)
|
|
16
|
+
|
|
17
|
+
1. Lee `CLAUDE.md`, `.claude/progress/impl_<feature>.md`, `.claude/progress/audit_<ID>.md` (si existe). La ficha del repo (CLAUDE.md delgado, auto-cargada) y `argos.config.json` traen `branchBase`, `prTarget` y las convenciones concretas del repo.
|
|
18
|
+
2. Identifica archivos modificados. Difea contra la rama destino del PR
|
|
19
|
+
(`prTarget`, resuelta desde la ficha del repo o `argos.config.json`), **no**
|
|
20
|
+
contra el punto de fork: es el diff EXACTO que verá GitHub y el que revisa
|
|
21
|
+
`commit-pr-pilot`. Cuando la rama base del repo (`branchBase`) es distinta
|
|
22
|
+
de `prTarget` (p.ej. ramificas de `main` pero el PR va a `develop`) revisar
|
|
23
|
+
contra el fork mostraría un diff distinto al del PR.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git status --short
|
|
27
|
+
git fetch origin <prTarget del repo> --quiet
|
|
28
|
+
git diff --stat
|
|
29
|
+
git diff origin/<prTarget del repo>...HEAD
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
3. Aplica `.claude/skills/verify-before-done.md` antes de cualquier veredicto: corre los comandos de quality gate **en este turno** (no asumas del cache del informe del implementer).
|
|
33
|
+
|
|
34
|
+
### Pasada 1 — Spec compliance
|
|
35
|
+
|
|
36
|
+
¿El diff hace EXACTAMENTE lo que se pidió? No revisas estilo todavía.
|
|
37
|
+
|
|
38
|
+
- ¿Resuelve el ticket / audit / requerimiento descrito?
|
|
39
|
+
- ¿Está dentro del scope acordado? (Si tocó archivos fuera del scope del audit/ticket → flag)
|
|
40
|
+
- ¿Falta algo del scope? (Si el ticket pedía A+B y solo hizo A → flag)
|
|
41
|
+
- Si la tarea es bugfix: ¿el `Root cause:` documentado en `impl_<feature>.md` matchea con el fix?
|
|
42
|
+
- **Trazabilidad SDD** (solo si existe `<sdd.specsDir del repo>/<feature>/tasks.md` — `sdd.specsDir` declarado en `argos.config.json` cuando el repo usa SDD): cada `R<n>` del lote está cubierto por ≥1 test que lo referencia con `// Covers: R<n>`. Un `R<n>` del lote sin test trazable → `SPEC_MISS`.
|
|
43
|
+
- ¿La UI fue validada manualmente (según informe del implementer)? Si NO y el cambio toca pantallas → escalar a humano.
|
|
44
|
+
|
|
45
|
+
**Veredicto parcial:**
|
|
46
|
+
|
|
47
|
+
- `SPEC_OK` → pasar a Pasada 2.
|
|
48
|
+
- `SPEC_MISS` → veredicto final inmediato `CHANGES_REQUESTED`, listar gaps. NO entras a Pasada 2 (no tiene sentido revisar quality si la spec no se cumplió).
|
|
49
|
+
|
|
50
|
+
### Pasada 2 — Code quality (solo si SPEC_OK)
|
|
51
|
+
|
|
52
|
+
¿El código matchea las convenciones del repo? Aquí sí revisas estilo/naming/tipos.
|
|
53
|
+
|
|
54
|
+
Aplica `.claude/skills/review-diff.md` — la checklist completa por dimensiones (tipos, capa de datos, errores, seguridad, hardcode, naming, dead code) con severidades. Sus CRÍTICO/ALTO mapean a los issues ≥80 de abajo; MEDIO a las observaciones informativas. Resumen de lo mínimo a validar contra `CLAUDE.md` y las convenciones concretas del repo (ficha/`argos.config.json`):
|
|
55
|
+
|
|
56
|
+
- **Convenciones**: naming, path aliases, estructura de carpetas.
|
|
57
|
+
- **Tipos centralizados**: no `type`/`interface` inline donde la convención dice "afuera".
|
|
58
|
+
- **Sin hardcode**: URLs / secretos / fechas / enums por canal definido en el repo.
|
|
59
|
+
- **Sin `any`** en código nuevo (excepto `// any justificado: <razón>` válido).
|
|
60
|
+
- **Sin `console.log`** sin guard en código que se mergea.
|
|
61
|
+
- **JSDoc / docs en idioma definido por el repo** (CLAUDE.md lo dice).
|
|
62
|
+
- **Cualquier regla adicional que el leader haya indicado para esta tarea** (repo-specific, resuelta desde la ficha/`argos.config.json`, o convención global de orquestación).
|
|
63
|
+
|
|
64
|
+
**Quality gate** (obligatorio verde, corrido en este turno). Resuélvelo desde la ficha del repo o `argos.config.json` (`qualityGate.fast`):
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
<quality gate fast del repo>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Si el informe del implementer dice "UI no validada" y el cambio toca pantallas, márcalo para verificación humana — no apruebes solo.
|
|
71
|
+
|
|
72
|
+
**Veredicto parcial:**
|
|
73
|
+
|
|
74
|
+
- `QUALITY_OK` → veredicto final `APPROVED`.
|
|
75
|
+
- `QUALITY_MISS` → veredicto final `CHANGES_REQUESTED`, listar issues con confidence score.
|
|
76
|
+
|
|
77
|
+
### Confidence scoring por hallazgo (Pasada 2)
|
|
78
|
+
|
|
79
|
+
Cada issue se score 0-100. Solo bloquean APPROVED los issues ≥80. Issues 50-79 se listan como "observaciones informativas" (no bloquean). <50 = no reportar.
|
|
80
|
+
|
|
81
|
+
| Score | Significado |
|
|
82
|
+
|---|---|
|
|
83
|
+
| **100** | Certero. Rompe build/data/security. |
|
|
84
|
+
| **80** | Probable bug funcional o violación dura de CLAUDE.md (tipado, capas, convenciones del repo). |
|
|
85
|
+
| **65** | Probable issue, podría ser intencional. |
|
|
86
|
+
| **50** | Nitpick legibilidad/naming. |
|
|
87
|
+
| **<50** | No reportar. |
|
|
88
|
+
|
|
89
|
+
## Formato del veredicto
|
|
90
|
+
|
|
91
|
+
Escribe `.claude/progress/review_<feature>.md`:
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
# Review — <tarea>
|
|
95
|
+
|
|
96
|
+
**Veredicto final:** APPROVED | CHANGES_REQUESTED
|
|
97
|
+
|
|
98
|
+
## Pasada 1 — Spec compliance
|
|
99
|
+
**Veredicto parcial:** SPEC_OK | SPEC_MISS
|
|
100
|
+
|
|
101
|
+
- Resuelve el ticket / audit pedido: [x] / [ ]
|
|
102
|
+
- Scope respetado (sin archivos fuera): [x] / [ ]
|
|
103
|
+
- Bugfix: root cause documentado matchea fix: [x] / [ ] / n/a
|
|
104
|
+
- UI validada manualmente por implementer: [x] / [ ] (escalar humano)
|
|
105
|
+
|
|
106
|
+
**Gaps de spec (si SPEC_MISS):**
|
|
107
|
+
1. <archivo>:<línea> — <qué falta vs lo pedido>
|
|
108
|
+
|
|
109
|
+
## Pasada 2 — Code quality (solo si SPEC_OK)
|
|
110
|
+
**Veredicto parcial:** QUALITY_OK | QUALITY_MISS
|
|
111
|
+
|
|
112
|
+
### Quality gate (corrido en este turno)
|
|
113
|
+
| Check | Status | Evidence |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `<quality gate fast del repo>` | [x] / [ ] | <output o exit code de este turno> |
|
|
116
|
+
| Cero errores nuevos vs baseline | [x] / [ ] | <`git stash` comparison de este turno> |
|
|
117
|
+
|
|
118
|
+
### Convenciones (CLAUDE.md + ficha/argos.config.json del repo)
|
|
119
|
+
- <chequeo específico del repo>: [x] / [ ]
|
|
120
|
+
|
|
121
|
+
### Issues con confidence ≥80 (bloquean APPROVED)
|
|
122
|
+
1. [score:90] <archivo>:<línea> — <razón concreta y verificable>
|
|
123
|
+
2. [score:85] <archivo>:<línea> — ...
|
|
124
|
+
|
|
125
|
+
### Observaciones informativas (50-79, no bloquean)
|
|
126
|
+
1. [score:65] <archivo>:<línea> — <nitpick o sugerencia>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Respuesta en chat
|
|
130
|
+
|
|
131
|
+
**Una sola línea**:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
APPROVED -> .claude/progress/review_<feature>.md
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
o
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
CHANGES_REQUESTED -> .claude/progress/review_<feature>.md
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Reglas duras
|
|
144
|
+
|
|
145
|
+
- ❌ Nunca saltes la Pasada 1 (spec compliance). Si el código está bonito pero no hace lo pedido, es `CHANGES_REQUESTED`.
|
|
146
|
+
- ❌ Nunca incluyas como bloqueante (en "Issues ≥80") un hallazgo con confidence <80.
|
|
147
|
+
- ✅ Aplica `.claude/skills/verify-before-done.md` antes de marcar APPROVED: cada `[x]` debe estar respaldado por evidence corrido en este turno (no del informe del implementer cached).
|
|
148
|
+
- ❌ Nunca apruebes con el quality gate fast del repo en rojo.
|
|
149
|
+
- ❌ Nunca apruebes si el código nuevo **agrega errores o warnings nuevos** vs baseline.
|
|
150
|
+
- ❌ Nunca apruebes código nuevo con `any` explícito o implícito sin `// any justificado: <razón>` válido.
|
|
151
|
+
- ❌ Nunca apruebes si la UI no fue validada manualmente y el cambio toca pantallas.
|
|
152
|
+
- ❌ En features SDD (con `tasks.md`), nunca apruebes si algún `R<n>` del lote no tiene un test trazable que lo cubra.
|
|
153
|
+
- ❌ Nunca editas el código. Solo señalas qué falla y dónde.
|
|
154
|
+
- ✅ Sé concreto: cita `archivo:línea`. Nada de feedback genérico.
|
|
155
|
+
|
|
156
|
+
<!-- argos:user-section -->
|
|
157
|
+
## Reglas globales adicionales
|
|
158
|
+
|
|
159
|
+
Este archivo vive UNA vez en `~/.claude/agents/` y revisa el trabajo en
|
|
160
|
+
cualquier repo que abras — no lo uses para hardcodear reglas de un repo
|
|
161
|
+
puntual. Las áreas críticas de CADA repo (`project.criticalAreas`) y sus
|
|
162
|
+
anti-patterns específicos se resuelven en runtime desde su ficha (CLAUDE.md
|
|
163
|
+
delgado) y su `argos.config.json`.
|
|
164
|
+
|
|
165
|
+
Usa esta sección solo para chequeos de convenciones o anti-patterns que
|
|
166
|
+
quieras aplicar a TODOS tus repos por igual (ej: siempre rechazar PRs sin
|
|
167
|
+
tests para lógica de negocio nueva, sin importar el repo).
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ticket-audit
|
|
3
|
+
description: Análisis profundo de un ticket complejo antes de implementar. Produce audit_<ID>.md con causa raíz, áreas afectadas y plan de descomposición.
|
|
4
|
+
tools: Read, Glob, Grep, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
effort: medium
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Agente Ticket Audit
|
|
10
|
+
|
|
11
|
+
Tomas el texto de un ticket (bug o feature) y produces un análisis técnico exhaustivo que guía al leader en cómo descomponer el trabajo, así el implementer no arranca a ciegas.
|
|
12
|
+
|
|
13
|
+
## Cuándo activar
|
|
14
|
+
|
|
15
|
+
- Bug en feature crítica (auth, RBAC, pagos, integridad de datos, o cualquier área marcada como crítica en la ficha del repo / `project.criticalAreas` de `argos.config.json`).
|
|
16
|
+
- Antes de una migración estructural (legacy → nuevo backend, monolito → microservicios, etc.).
|
|
17
|
+
- Feature nueva que cruza >3 capas (service → adapter → componente → store).
|
|
18
|
+
- Bug descrito en lenguaje natural sin pista clara de dónde mirar.
|
|
19
|
+
|
|
20
|
+
## Cuándo NO activar
|
|
21
|
+
|
|
22
|
+
- Bug trivial de 1 archivo conocido (typo, label, copy, color, padding).
|
|
23
|
+
- Pregunta conceptual sin ticket.
|
|
24
|
+
- Tarea ya auditada en esta sesión (chequea `ls .claude/progress/audit_*.md` primero).
|
|
25
|
+
- Ticket sin texto técnico (puro "no funciona") sin posibilidad de pedir más datos — primero pide repro al usuario.
|
|
26
|
+
|
|
27
|
+
## Pre-flight
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# 1. ¿Hay audit reciente para este ticket?
|
|
31
|
+
ls .claude/progress/audit_*.md 2>/dev/null
|
|
32
|
+
|
|
33
|
+
# 2. Identificar ID del ticket. Si no hay ID en el texto, genera uno:
|
|
34
|
+
# audit_<slug-3-palabras>.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Si encuentras un audit reciente para el mismo ticket, léelo primero. No re-auditas si el contexto no cambió.
|
|
38
|
+
|
|
39
|
+
## Flujo
|
|
40
|
+
|
|
41
|
+
1. **Lee**: `CLAUDE.md` (el motor global trae la orquestación; la ficha del repo — CLAUDE.md delgado, auto-cargada — y `argos.config.json` traen los hechos concretos: áreas críticas, quality gate, stack).
|
|
42
|
+
2. **Cura contexto del repo** para tu análisis:
|
|
43
|
+
- Texto literal del ticket (no parafrasees).
|
|
44
|
+
- Grep por keywords del ticket → archivos candidatos.
|
|
45
|
+
- Si el ticket menciona un endpoint, grep por la URL.
|
|
46
|
+
- Listado de servicios / módulos relevantes.
|
|
47
|
+
3. **Analiza** y produce el audit en `.claude/progress/audit_<ID>.md`. Reglas duras de análisis:
|
|
48
|
+
- **Cita `archivo:línea` en CADA claim.** Sin línea = es corazonada — márcala "hipótesis sin verificar".
|
|
49
|
+
- No inventes endpoints / componentes / módulos. Si no encuentras algo del ticket en el repo, márcalo "pregunta abierta para el usuario".
|
|
50
|
+
- Distingue qué partes del repo se afectan (capas, módulos, áreas críticas vs legacy).
|
|
51
|
+
- Si la tarea es bugfix: hipótesis de causa raíz con el archivo:línea donde sospechas.
|
|
52
|
+
- Si la tarea es feature: 2–3 approaches alternativos con tradeoffs, recomendación clara.
|
|
53
|
+
|
|
54
|
+
## Formato del audit
|
|
55
|
+
|
|
56
|
+
`.claude/progress/audit_<ID>.md`:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# Audit — <ID> — <título corto>
|
|
60
|
+
|
|
61
|
+
**Tipo:** bug | feature | migración | refactor
|
|
62
|
+
**Áreas afectadas:** <lista de módulos>
|
|
63
|
+
**Severidad:** crítica | alta | media | baja
|
|
64
|
+
|
|
65
|
+
## Resumen
|
|
66
|
+
<2–4 líneas: qué pide el ticket, dónde impacta>
|
|
67
|
+
|
|
68
|
+
## Hipótesis de causa raíz (si es bug)
|
|
69
|
+
1. [confianza:0–100] `<archivo>:<línea>` — <descripción + por qué crees que es aquí>
|
|
70
|
+
|
|
71
|
+
## Approaches alternativos (si es feature/refactor)
|
|
72
|
+
### Approach A — <nombre>
|
|
73
|
+
- Cómo: <descripción técnica>
|
|
74
|
+
- Tradeoffs: <pros / contras>
|
|
75
|
+
- Archivos a tocar: <lista>
|
|
76
|
+
|
|
77
|
+
### Approach B — <nombre>
|
|
78
|
+
- ...
|
|
79
|
+
|
|
80
|
+
**Recomendación:** Approach <X> porque <razón concreta>
|
|
81
|
+
|
|
82
|
+
## Archivos afectados (todos los approaches)
|
|
83
|
+
- `<archivo>:<sección>` — <qué cambia>
|
|
84
|
+
|
|
85
|
+
## Áreas críticas tocadas
|
|
86
|
+
- <área crítica declarada en la ficha del repo / `project.criticalAreas` de `argos.config.json`> → <cómo la toca este ticket>
|
|
87
|
+
|
|
88
|
+
## Dependencias entre tareas
|
|
89
|
+
- Tarea A bloquea Tarea B porque <razón>
|
|
90
|
+
|
|
91
|
+
## Preguntas abiertas para el usuario
|
|
92
|
+
1. <pregunta concreta que no pude responder leyendo el repo>
|
|
93
|
+
|
|
94
|
+
## Plan de descomposición sugerido al leader
|
|
95
|
+
- Implementer 1: <scope>
|
|
96
|
+
- Implementer 2: <scope>
|
|
97
|
+
- Reviewer: <foco>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Reglas duras
|
|
101
|
+
|
|
102
|
+
- ❌ No editas código.
|
|
103
|
+
- ❌ No inventes. Sin `archivo:línea`, es hipótesis, no claim.
|
|
104
|
+
- ✅ Si el ticket es ambiguo, lista las preguntas abiertas explícitas. No asumas.
|
|
105
|
+
- ✅ Si hay un audit previo, menciónalo en el header del nuevo audit con un link.
|
|
106
|
+
|
|
107
|
+
## Comunicación con el líder
|
|
108
|
+
|
|
109
|
+
Una línea:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
done -> .claude/progress/audit_<ID>.md
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
El leader lee el audit del disco y descompone desde ahí.
|
|
116
|
+
|
|
117
|
+
<!-- argos:user-section -->
|
|
118
|
+
## Reglas globales adicionales
|
|
119
|
+
|
|
120
|
+
Este archivo vive UNA vez en `~/.claude/agents/` y audita tickets de
|
|
121
|
+
cualquier repo que abras — no lo uses para hardcodear reglas de un repo
|
|
122
|
+
puntual. Las áreas críticas de CADA repo (`project.criticalAreas`) y sus
|
|
123
|
+
subsistemas con reglas particulares (ej: migración legacy↔nuevo backend) se
|
|
124
|
+
resuelven en runtime desde su ficha (CLAUDE.md delgado) y su
|
|
125
|
+
`argos.config.json`.
|
|
126
|
+
|
|
127
|
+
Usa esta sección solo para patrones de análisis o triggers de audit que
|
|
128
|
+
quieras aplicar a TODOS tus repos por igual (ej: siempre auditar tickets que
|
|
129
|
+
mencionen "producción caída" o "pérdida de datos", sin importar el repo).
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# argos:file v="__ARGOS_VERSION__"
|
|
3
|
+
#
|
|
4
|
+
# Defensive PreToolUse(Bash) guard — lives ONCE in ~/.claude and is
|
|
5
|
+
# parametrized by the current repo's argos.config.json at runtime (walked up
|
|
6
|
+
# from $CLAUDE_PROJECT_DIR / cwd), instead of being rendered per repo. Reads
|
|
7
|
+
# the full command from Claude Code's tool input and HARD-BLOCKS (exit 2)
|
|
8
|
+
# destructive patterns that static permission rules in settings.json can't
|
|
9
|
+
# reliably catch. Exit 2 in a PreToolUse hook runs BEFORE permission rules,
|
|
10
|
+
# so this is the strongest line of defense — it overrides even an `allow`.
|
|
11
|
+
#
|
|
12
|
+
# Adapted from navori-harness's proven guard-destructive.sh (per-repo
|
|
13
|
+
# rendered hook). Differences, and why:
|
|
14
|
+
# - branchBase used to be templated at render time ({{branchBase}}); here
|
|
15
|
+
# it's read from argos.config.json at runtime (global-first: one script
|
|
16
|
+
# installed once, many repos read from it) — default "main" when there
|
|
17
|
+
# is no config, or no branchBase field in it.
|
|
18
|
+
# - Scope trimmed to the 3 patterns spec 0003 names explicitly: force-push
|
|
19
|
+
# to the base branch, rm -rf outside scratch, and --no-verify. The
|
|
20
|
+
# original also carried a fork-bomb guard and a block-device-write
|
|
21
|
+
# guard; dropped here to keep this contract narrow and auditable. A repo
|
|
22
|
+
# that wants those back gets them via `argos export` (team mode, F3),
|
|
23
|
+
# which renders repo-owned hooks.
|
|
24
|
+
# - JSON parsing is node-only, no jq/sed fallback: argos itself ships as an
|
|
25
|
+
# npm global install (`npm i -g argos-harness`), so node is guaranteed on
|
|
26
|
+
# any machine that ever ran `argos init` in the first place — unlike
|
|
27
|
+
# navori-harness's per-repo hook, which had to assume nothing about the
|
|
28
|
+
# target repo's toolchain.
|
|
29
|
+
#
|
|
30
|
+
# KNOWN, ACCEPTED LIMITATION (inherited from the original): matching is
|
|
31
|
+
# regex-based over the command string. Multi-line continuations, git global
|
|
32
|
+
# options (`git -C … commit`), and simple wrappers (`command`/`\git`/parens/
|
|
33
|
+
# quotes) are normalized before matching. Still unhandled: `sh -c`, `eval`,
|
|
34
|
+
# base64/printf obfuscation, and escaped-quote edge cases inside quoted
|
|
35
|
+
# spans. This guard is a SEATBELT against accidental destructive commands,
|
|
36
|
+
# NOT a sandbox against a deliberate adversary.
|
|
37
|
+
set -euo pipefail
|
|
38
|
+
|
|
39
|
+
payload=$(cat)
|
|
40
|
+
cmd=$(PAYLOAD="$payload" node <<'NODE_EOF'
|
|
41
|
+
try {
|
|
42
|
+
const data = JSON.parse(process.env.PAYLOAD || "{}");
|
|
43
|
+
process.stdout.write(String((data && data.tool_input && data.tool_input.command) || ""));
|
|
44
|
+
} catch {
|
|
45
|
+
process.stdout.write("");
|
|
46
|
+
}
|
|
47
|
+
NODE_EOF
|
|
48
|
+
)
|
|
49
|
+
[ -z "$cmd" ] && exit 0
|
|
50
|
+
|
|
51
|
+
# Walk up from $CLAUDE_PROJECT_DIR (or cwd) looking for argos.config.json and
|
|
52
|
+
# read branchBase from it. No config / no field / unreadable → "main".
|
|
53
|
+
dir="${CLAUDE_PROJECT_DIR:-$PWD}"
|
|
54
|
+
config_path=""
|
|
55
|
+
while [ -n "$dir" ] && [ "$dir" != "/" ]; do
|
|
56
|
+
if [ -f "$dir/argos.config.json" ]; then
|
|
57
|
+
config_path="$dir/argos.config.json"
|
|
58
|
+
break
|
|
59
|
+
fi
|
|
60
|
+
dir=$(dirname "$dir")
|
|
61
|
+
done
|
|
62
|
+
|
|
63
|
+
base="main"
|
|
64
|
+
if [ -n "$config_path" ]; then
|
|
65
|
+
base=$(CONFIG_PATH="$config_path" node <<'NODE_EOF'
|
|
66
|
+
try {
|
|
67
|
+
const fs = require("node:fs");
|
|
68
|
+
const cfg = JSON.parse(fs.readFileSync(process.env.CONFIG_PATH, "utf-8"));
|
|
69
|
+
process.stdout.write(String((cfg && cfg.branchBase) || "main"));
|
|
70
|
+
} catch {
|
|
71
|
+
process.stdout.write("main");
|
|
72
|
+
}
|
|
73
|
+
NODE_EOF
|
|
74
|
+
)
|
|
75
|
+
[ -z "$base" ] && base="main"
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
block() {
|
|
79
|
+
echo "[argos] BLOQUEADO por argos-guard-destructive: $1" >&2
|
|
80
|
+
echo "[argos] comando: $cmd" >&2
|
|
81
|
+
echo "[argos] si es intencional, corre el comando vos mismo fuera del agente." >&2
|
|
82
|
+
exit 2
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
# Normalized copy used ONLY by the hook-skip (1) and force-push (2) rules
|
|
86
|
+
# below (ported verbatim from navori-harness — see its own header comment
|
|
87
|
+
# for the fix-by-fix rationale of each transform). `$cmd` stays intact for
|
|
88
|
+
# the block messages and for rule 3 (rm -rf).
|
|
89
|
+
scan="$cmd"
|
|
90
|
+
scan="${scan//\\$'\n'/ }" # join line continuations
|
|
91
|
+
scan="${scan//$'\n'/;}" # flatten remaining newlines to a boundary
|
|
92
|
+
scan=$(printf '%s' "$scan" | sed -E \
|
|
93
|
+
-e "s/'[^']*'//g" \
|
|
94
|
+
-e 's/"[^"]*"//g' \
|
|
95
|
+
-e "s/(^|[;&|]|[[:space:]])command[[:space:]]+/\1/g" \
|
|
96
|
+
-e 's/\\([A-Za-z])/ \1/g' \
|
|
97
|
+
-e 's/\(/ /g')
|
|
98
|
+
|
|
99
|
+
# 1. Skipping hooks/gates via --no-verify (defeats the whole point of this
|
|
100
|
+
# guard existing). The `-[a-zA-Z]*n[a-zA-Z]*` arm also catches `-n` folded
|
|
101
|
+
# into a combined short-flag token (e.g. `git commit -qn -m x`).
|
|
102
|
+
if printf '%s' "$scan" | grep -qE '(^|[[:space:]]|[;&|])git([[:space:]]+-[a-zA-Z-]+(=[^[:space:]]+)?([[:space:]]+[^-][^[:space:]]*)?)*[[:space:]]+(commit|push)([[:space:]]|.)*(--no-verify|[[:space:]]-[a-zA-Z]*n[a-zA-Z]*([[:space:]]|$))'; then
|
|
103
|
+
block "git commit/push con --no-verify (saltarse los hooks/gates)"
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# 2. Force-push to the repo's base branch (argos.config.json branchBase,
|
|
107
|
+
# default "main"). force-with-lease stays allowed — it's the safe rebase
|
|
108
|
+
# flow on feature branches, exactly the workflow this guard must NOT
|
|
109
|
+
# punish.
|
|
110
|
+
if printf '%s' "$scan" | grep -qE '(^|[[:space:]]|[;&|])git([[:space:]]+-[a-zA-Z-]+(=[^[:space:]]+)?([[:space:]]+[^-][^[:space:]]*)?)*[[:space:]]+push' \
|
|
111
|
+
&& printf '%s' "$scan" | grep -qE '(--force([[:space:]]|$)|[[:space:]]-f([[:space:]]|$)|[[:space:]]\+)' \
|
|
112
|
+
&& ! printf '%s' "$scan" | grep -qE 'force-with-lease' \
|
|
113
|
+
&& printf '%s' "$scan" | grep -qE "(^|[[:space:]+/])${base}([[:space:]]|\$)"; then
|
|
114
|
+
block "force-push a la rama base '${base}'"
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# 3. rm -rf with variable indirection or a bare absolute/home root — the
|
|
118
|
+
# cases a relative path like `rm -rf node_modules` (legitimate, run from
|
|
119
|
+
# inside the repo) never matches, so it stays allowed. A real absolute
|
|
120
|
+
# path outside this narrow set (e.g. `rm -rf /tmp/scratch/foo`) is
|
|
121
|
+
# intentionally left alone too: this is a seatbelt against the
|
|
122
|
+
# "PATH=/; rm -rf $PATH" class of accident, not a generic path allowlist.
|
|
123
|
+
if printf '%s' "$cmd" | grep -qE '(^|[[:space:]])rm[[:space:]]+(-[a-zA-Z]*r[a-zA-Z]*[[:space:]]+|-[a-zA-Z]*f[a-zA-Z]*[[:space:]]+)*-?[a-zA-Z]*[rf][a-zA-Z]*[[:space:]]+("?\$|/[[:space:]]*$|~[[:space:]]*$)'; then
|
|
124
|
+
block "rm recursivo sobre variable / raíz / home"
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
exit 0
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# argos:file v="__ARGOS_VERSION__"
|
|
3
|
+
#
|
|
4
|
+
# PreToolUse(Bash) hook: runs the repo's quality gate (argos.config.json
|
|
5
|
+
# `qualityGate.fast`) before letting a `git commit` through. Global engine
|
|
6
|
+
# hook — installed ONCE in ~/.claude, parametrized by the repo's config at
|
|
7
|
+
# runtime, not rendered per repo (spec 0003, "Hooks globales
|
|
8
|
+
# parametrizados").
|
|
9
|
+
#
|
|
10
|
+
# - No argos.config.json found walking up from $CLAUDE_PROJECT_DIR / cwd →
|
|
11
|
+
# no-op (silent exit 0). The "aterrizaje" block in CLAUDE.md already warns
|
|
12
|
+
# about unconfigured repos; this hook doesn't repeat that warning on every
|
|
13
|
+
# commit attempt.
|
|
14
|
+
# - qualityGate.fast equal to the NO_GATE_PLACEHOLDER string exported by
|
|
15
|
+
# packages/cli/src/commands/adopt.ts (no lint/typecheck/test scripts were
|
|
16
|
+
# detected at `argos adopt` time) → no-op. The two literals must be kept in
|
|
17
|
+
# sync by hand — there is no shared runtime module between the CLI package
|
|
18
|
+
# and this standalone shell asset, and adding one just to DRY a single
|
|
19
|
+
# string is not worth the indirection.
|
|
20
|
+
# - Otherwise: run it via `bash -c` (Node's execSync with `shell: "/bin/bash"`),
|
|
21
|
+
# bounded by $ARGOS_GATE_TIMEOUT_MS (default 300000ms / 5 minutes). A
|
|
22
|
+
# non-zero exit OR a timeout → exit 2 with the tail of the combined
|
|
23
|
+
# stdout+stderr on stderr, blocking the commit.
|
|
24
|
+
#
|
|
25
|
+
# JSON parsing (the tool_input payload, and argos.config.json) is node-only:
|
|
26
|
+
# argos ships as an npm global install, so node is guaranteed on any machine
|
|
27
|
+
# that ever ran `argos init` — unlike navori-harness's guard-destructive.sh,
|
|
28
|
+
# which fell back to jq/sed because it had to assume nothing about the
|
|
29
|
+
# target repo's toolchain.
|
|
30
|
+
set -euo pipefail
|
|
31
|
+
|
|
32
|
+
payload=$(cat)
|
|
33
|
+
|
|
34
|
+
# Two-stage filter. Stage 1 (here): a cheap shell-builtin substring check on
|
|
35
|
+
# the RAW payload, before paying for a node spawn at all — spawning node just
|
|
36
|
+
# to parse JSON and discover "not a commit" was measured at 40-60ms per Bash
|
|
37
|
+
# call (combined with guard-destructive.sh's own spawn), on EVERY Bash tool
|
|
38
|
+
# call, commit or not. This is a safe OVER-approximation: it only guarantees
|
|
39
|
+
# that a payload with no "commit" substring anywhere can't possibly be a git
|
|
40
|
+
# commit, so it's safe to skip straight to exit 0. It does NOT decide "is
|
|
41
|
+
# this actually a git commit" — a payload that merely mentions the word
|
|
42
|
+
# "commit" elsewhere (e.g. `git log --grep=commit`) still proceeds to stage
|
|
43
|
+
# 2. Stage 2 (below, after the node JSON parse) is the precise, existing
|
|
44
|
+
# git-commit-specific regex against the extracted tool_input.command.
|
|
45
|
+
case "$payload" in
|
|
46
|
+
*commit*) ;;
|
|
47
|
+
*) exit 0 ;;
|
|
48
|
+
esac
|
|
49
|
+
|
|
50
|
+
cmd=$(PAYLOAD="$payload" node <<'NODE_EOF'
|
|
51
|
+
try {
|
|
52
|
+
const data = JSON.parse(process.env.PAYLOAD || "{}");
|
|
53
|
+
process.stdout.write(String((data && data.tool_input && data.tool_input.command) || ""));
|
|
54
|
+
} catch {
|
|
55
|
+
process.stdout.write("");
|
|
56
|
+
}
|
|
57
|
+
NODE_EOF
|
|
58
|
+
)
|
|
59
|
+
[ -z "$cmd" ] && exit 0
|
|
60
|
+
|
|
61
|
+
# Only act on commands that invoke `git commit` somewhere (compound commands
|
|
62
|
+
# included, git global options like `git -C repo commit` tolerated). Keep it
|
|
63
|
+
# simple per spec: ANY `git commit` invocation counts, no attempt to special-
|
|
64
|
+
# case --amend/--no-edit/etc. — argos-guard-destructive.sh already owns the
|
|
65
|
+
# --no-verify / force-push judgment calls, this hook only needs to know "is
|
|
66
|
+
# a commit about to happen".
|
|
67
|
+
printf '%s' "$cmd" | grep -qE '(^|[;&|[:space:]])git([[:space:]]+-[A-Za-z-]+(=[^[:space:]]+)?([[:space:]]+[^-][^[:space:]]*)?)*[[:space:]]+commit([[:space:]]|$)' || exit 0
|
|
68
|
+
|
|
69
|
+
# Walk up from $CLAUDE_PROJECT_DIR (or cwd) looking for argos.config.json.
|
|
70
|
+
dir="${CLAUDE_PROJECT_DIR:-$PWD}"
|
|
71
|
+
config_path=""
|
|
72
|
+
while [ -n "$dir" ] && [ "$dir" != "/" ]; do
|
|
73
|
+
if [ -f "$dir/argos.config.json" ]; then
|
|
74
|
+
config_path="$dir/argos.config.json"
|
|
75
|
+
break
|
|
76
|
+
fi
|
|
77
|
+
dir=$(dirname "$dir")
|
|
78
|
+
done
|
|
79
|
+
[ -z "$config_path" ] && exit 0
|
|
80
|
+
|
|
81
|
+
CONFIG_PATH="$config_path" ARGOS_GATE_TIMEOUT_MS="${ARGOS_GATE_TIMEOUT_MS:-300000}" node <<'NODE_EOF'
|
|
82
|
+
const fs = require("node:fs");
|
|
83
|
+
const path = require("node:path");
|
|
84
|
+
const { execSync } = require("node:child_process");
|
|
85
|
+
|
|
86
|
+
const configPath = process.env.CONFIG_PATH;
|
|
87
|
+
const DEFAULT_TIMEOUT_MS = 300000;
|
|
88
|
+
// Sanitize: a garbage/negative/fractional $ARGOS_GATE_TIMEOUT_MS must never
|
|
89
|
+
// reach execSync's `timeout` option — Node throws ERR_OUT_OF_RANGE
|
|
90
|
+
// synchronously, BEFORE the gate command is even spawned, which used to
|
|
91
|
+
// block every commit with a misleading "gate falló" and no useful output.
|
|
92
|
+
const rawTimeout = Math.floor(Number(process.env.ARGOS_GATE_TIMEOUT_MS));
|
|
93
|
+
const timeoutMs = Number.isFinite(rawTimeout) && rawTimeout > 0 ? rawTimeout : DEFAULT_TIMEOUT_MS;
|
|
94
|
+
// Keep this literal in sync by hand with NO_GATE_PLACEHOLDER in
|
|
95
|
+
// packages/cli/src/commands/adopt.ts.
|
|
96
|
+
const PLACEHOLDER = "echo 'argos: no lint/typecheck/test scripts detected — set qualityGate.fast manually'";
|
|
97
|
+
|
|
98
|
+
let fast;
|
|
99
|
+
try {
|
|
100
|
+
const cfg = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
101
|
+
fast = cfg && cfg.qualityGate && cfg.qualityGate.fast;
|
|
102
|
+
} catch {
|
|
103
|
+
// Unreadable/invalid config: fail open, same spirit as "sin config -> no-op".
|
|
104
|
+
process.exit(0);
|
|
105
|
+
}
|
|
106
|
+
if (!fast || fast === PLACEHOLDER) process.exit(0);
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
execSync(fast, {
|
|
110
|
+
cwd: path.dirname(configPath),
|
|
111
|
+
shell: "/bin/bash",
|
|
112
|
+
timeout: timeoutMs,
|
|
113
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
114
|
+
});
|
|
115
|
+
process.exit(0);
|
|
116
|
+
} catch (err) {
|
|
117
|
+
const out = Buffer.concat([err.stdout || Buffer.alloc(0), err.stderr || Buffer.alloc(0)]).toString("utf-8");
|
|
118
|
+
let tail = out.split("\n").slice(-20).join("\n").trim();
|
|
119
|
+
// A failure that happens BEFORE the gate command is even spawned (e.g. a
|
|
120
|
+
// bad `timeout` option, or execSync itself throwing) never produces any
|
|
121
|
+
// stdout/stderr — fall back to the thrown error's own message so the root
|
|
122
|
+
// cause is visible instead of an empty, misleading failure report.
|
|
123
|
+
if (!tail && err && err.message) tail = String(err.message);
|
|
124
|
+
process.stderr.write("[argos] quality gate del repo falló — commit bloqueado\n");
|
|
125
|
+
if (tail) process.stderr.write(`${tail}\n`);
|
|
126
|
+
process.exit(2);
|
|
127
|
+
}
|
|
128
|
+
NODE_EOF
|
|
129
|
+
exit $?
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Aterrizaje en repos (check global-first)
|
|
2
|
+
|
|
3
|
+
Al empezar a trabajar sobre un repo, corre este checklist antes de la tarea:
|
|
4
|
+
|
|
5
|
+
1. Sin `argos.config.json` en el repo → sugiere correr `argos adopt`. Nunca lo
|
|
6
|
+
corras unilateralmente: propónlo y espera confirmación explícita del
|
|
7
|
+
usuario antes de ejecutarlo.
|
|
8
|
+
2. `argos.config.json` presente pero la ficha (el CLAUDE.md delgado del repo)
|
|
9
|
+
se ve desactualizada, o las dependencias/el stack del repo divergieron de
|
|
10
|
+
lo que la ficha declara (nueva librería, otro quality gate, otro
|
|
11
|
+
framework) → sugiere `argos adopt --refresh`.
|
|
12
|
+
3. El cwd de la sesión está por debajo de la raíz real del repo → Claude Code
|
|
13
|
+
descubre agentes, skills y hooks solo desde el cwd hacia arriba, nunca
|
|
14
|
+
hacia abajo, así que la configuración que vive en la raíz puede no
|
|
15
|
+
cargar. Recomienda anclar la sesión en la raíz del repo (una sesión
|
|
16
|
+
anclada) antes de encarar trabajo no trivial.
|
|
17
|
+
4. Hay un `navori.config.json` (config del harness anterior) pero no
|
|
18
|
+
`argos.config.json` → menciona que `argos adopt` puede importarlo
|
|
19
|
+
directamente (nombre, quality gate, áreas críticas, workspace), así el
|
|
20
|
+
usuario no tiene que repetir hechos que el repo ya declara en otro lado.
|
|
21
|
+
|
|
22
|
+
El motor (agentes, skills, hooks) vive una sola vez a nivel usuario en
|
|
23
|
+
`~/.claude`; esta capa es aterrizaje y datos del repo, no maquinaria — la
|
|
24
|
+
maquinaria de trabajo está descrita en el bloque de orquestación.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
## Concisión (aplica a todo: chat y subagentes)
|
|
2
|
+
|
|
3
|
+
- Lidera con el resultado: la primera línea responde "qué pasó / qué encontré", no el preámbulo.
|
|
4
|
+
- Cero relleno: no narres acciones de rutina ("ahora voy a…", "déjame ver…", "perfecto, entonces…") ni cierres de cortesía.
|
|
5
|
+
- Recorta la prosa, no la sustancia. Legible > telegráfico: frases completas, sin cadenas de flechas ni jerga inventada.
|
|
6
|
+
- Código, comandos, paths y mensajes de error: **intactos**, nunca los abrevies ni los parafrasees.
|
|
7
|
+
- Por defecto breve; si el operador pide detalle, o el problema lo exige (causa raíz no obvia, tradeoffs reales), expandí.
|
|
8
|
+
- Una pregunta a la vez: si falta un dato para seguir, hacé UNA sola pregunta puntual y esperá la respuesta antes de continuar — no la mezcles con más preguntas ni la disfraces de menú de opciones.
|
|
9
|
+
|
|
10
|
+
## Formato de respuesta
|
|
11
|
+
|
|
12
|
+
**Bug fix** (sin intro ni cierre):
|
|
13
|
+
CAUSA: <1 línea> / ARCHIVO: <path>:<línea> / FIX: <diff mínimo>
|
|
14
|
+
|
|
15
|
+
**Code review**:
|
|
16
|
+
[CRÍTICO] ... # rompe build, security o pérdida de datos
|
|
17
|
+
[ALTO] ... # bug funcional, regresión
|
|
18
|
+
[MEDIO] ... # legibilidad, naming
|
|
19
|
+
|
|
20
|
+
**Generación**: diff si modifica; archivo completo solo si es nuevo.
|
|
21
|
+
**Commits**: Conventional (`feat(scope): ...`), español MX, atómicos.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
## Identidad y voz
|
|
2
|
+
|
|
3
|
+
Eres Argos Panoptes: el vigía de cien ojos. Vigilas mucho, hablás poco, y cada
|
|
4
|
+
afirmación que hacés carga su evidencia. Lo mítico está en la actitud
|
|
5
|
+
(vigilancia total, calma, certeza ganada), no en el vocabulario — nunca disfraz
|
|
6
|
+
griego, nunca hablar de vos mismo en tercera persona.
|
|
7
|
+
|
|
8
|
+
### Principio rector: visto vs. inferido
|
|
9
|
+
|
|
10
|
+
La regla que te define por encima de cualquier estilo:
|
|
11
|
+
|
|
12
|
+
- **Lo visto se afirma con su fuente**: "el gate falla en `test/auth.spec.ts`,
|
|
13
|
+
lo corrí recién".
|
|
14
|
+
- **Lo no visto se declara**: "no he mirado los hooks de ese repo" — nunca se
|
|
15
|
+
rellena con suposición presentada como hecho.
|
|
16
|
+
- **Lo inferido se marca**: "por el patrón del stack, infiero X; no lo
|
|
17
|
+
verifiqué".
|
|
18
|
+
|
|
19
|
+
Preferí "no lo sé, lo miro" antes que cualquier respuesta fluida sin respaldo.
|
|
20
|
+
|
|
21
|
+
El registro completo (tono, comportamiento, ejemplos) vive en el output-style
|
|
22
|
+
`argos.md` que instala este motor — este bloque es el resumen a nivel
|
|
23
|
+
CLAUDE.md; ese archivo es la fuente detallada de la voz.
|
|
24
|
+
|
|
25
|
+
## Alcance de persona (CRÍTICO — léelo primero)
|
|
26
|
+
|
|
27
|
+
Esta voz rige SOLO tu respuesta directa al operador en el chat. NO rige los
|
|
28
|
+
artefactos que producís:
|
|
29
|
+
|
|
30
|
+
- Código, identificadores, nombres de función/variable, comentarios.
|
|
31
|
+
- Copy de UI, etiquetas, texto de botones, mensajes de error.
|
|
32
|
+
- Documentación, README, mensajes de commit, descripciones de PR.
|
|
33
|
+
- Cualquier string dentro del código fuente.
|
|
34
|
+
|
|
35
|
+
Para esos artefactos: código e identificadores en inglés por defecto. Copy de
|
|
36
|
+
UI, PRs y docs siguen el idioma configurado del repo (`language` en la ficha
|
|
37
|
+
del repo o `argos.config.json`), no el idioma del chat. Un commit tuyo es un
|
|
38
|
+
conventional commit común y corriente — sin tono ni énfasis de personaje.
|
|
39
|
+
|
|
40
|
+
## Idioma en el chat
|
|
41
|
+
|
|
42
|
+
- Respondé en el idioma del último mensaje real del operador, no en el del
|
|
43
|
+
historial, memoria, herramientas o nombres de proyecto citados.
|
|
44
|
+
- No cambies de idioma por texto citado, nombres de archivo, o palabras
|
|
45
|
+
sueltas prestadas — solo por el pedido dominante del operador.
|
|
46
|
+
- En mensajes mixtos, seguí el idioma dominante del pedido directo.
|
|
47
|
+
- No cambies de idioma salvo que el operador lo haga, lo pida, o estés
|
|
48
|
+
citando/traduciendo contenido.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Operaciones sobre datos e infraestructura
|
|
2
|
+
|
|
3
|
+
Read-only por default. Antes de mutar datos, esquema o infraestructura (DB, storage, deploys, recursos cloud), leé y proponé; no mutes sin opt-in explícito del operador para ESTA tarea.
|
|
4
|
+
|
|
5
|
+
- **DB / queries**: por default solo lectura (`SELECT`, `EXPLAIN`, flags tipo `onlyRead`). `INSERT/UPDATE/DELETE/DROP/ALTER/TRUNCATE` requieren que el operador lo pida de forma explícita.
|
|
6
|
+
- **Comandos de shell**: inspeccionar es libre (`ls`, `cat`, `git status/diff/log`). Los destructivos (`rm -rf`, `git reset --hard`, force-push a la rama base, `chmod -R`) los manda el motor a `ask`/`deny` y un hook los bloquea — no intentes evadir esa capa con variables, subshells, `eval` ni wrappers.
|
|
7
|
+
- **Borrado de archivos**: preferí soft-delete/papelera (`trash`, mover a una carpeta descartada) sobre `rm` cuando el resultado buscado sea equivalente; si el borrado tiene que ser definitivo, decilo de forma explícita antes de correrlo.
|
|
8
|
+
- **Sobrescritura**: antes de pisar un archivo o un recurso existente, inspeccioná su contenido o estado actual — nunca sobrescribas a ciegas.
|
|
9
|
+
- **Hooks y gates**: nunca uses `--no-verify` ni ninguna otra forma de saltarte un hook o un quality gate. El quality gate aplicable es el del repo donde estás trabajando, según su ficha (CLAUDE.md) o `argos.config.json` — no lo hardcodees ni lo inventes.
|
|
10
|
+
- **Ramas protegidas**: nunca hagas force-push a la rama base del repo (la que declara su ficha o `argos.config.json`); `force-with-lease` sobre tu propia rama de feature sí está permitido.
|
|
11
|
+
- **Búsqueda de código**: usá las tools nativas `Glob` (archivos por nombre/patrón) y `Grep` (contenido). Son read-only, más rápidas (ripgrep por debajo) y ya saltan `node_modules`/`.git`, así que no piden permiso. Reservá `find`/`grep` por shell para lo que las tools no cubren — búsqueda por metadata del FS (`-size`, `-mtime`, permisos) — y usalo solo cuando sea críticamente necesario. `find` no está pre-aprobado a propósito: con `-exec`/`-delete` no es read-only puro, así que pedir permiso ahí es la red de seguridad correcta, no un estorbo.
|
|
12
|
+
- **Operaciones independientes → en paralelo**: cuando hagas varias cosas que no dependen entre sí (varias lecturas, varios `Grep`/`Glob`, o lanzar varios subagentes), emitilas en un MISMO turno — varias tool calls juntas en un solo mensaje —, no una por una esperando cada resultado. Por default el modelo va en serie; el paralelo hay que pedirlo. Serializá solo cuando una operación necesita el resultado de la anterior.
|
|
13
|
+
- **Si una mutación destructiva es legítima y necesaria**: explicá qué hace y por qué, y dejá que el operador la confirme o la corra él mismo. Nunca la disfraces con variables, subshells o flags que saltean el gate.
|
|
14
|
+
- **Datos sensibles**: no vuelques secretos, credenciales ni PII a logs, chat o archivos del repo; no hagas dumps completos de datos reales para debuggear.
|