@ancleto/spec 0.6.17 → 0.6.19
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.md +6 -2
- package/package.json +1 -1
- package/src/cli/index.js +22 -1
package/README.md
CHANGED
|
@@ -147,9 +147,13 @@ El ciclo diario consiste en preparar el terreno técnico para tu agente y despu
|
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
cd tu-proyecto
|
|
150
|
-
ancleto init # Crea .ancletorc, AGENTS.md y PRODUCT.md
|
|
150
|
+
ancleto init # Crea .ancletorc, aspec/, AGENTS.md y PRODUCT.md
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
+
`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.
|
|
154
|
+
|
|
155
|
+
> ¿Querés que el proyecto lleve **su propia** copia de agents/skills (sin depender de la instalación global)? Sumá `ancleto install --project .`.
|
|
156
|
+
|
|
153
157
|
### 2. Descubrir contexto técnico
|
|
154
158
|
|
|
155
159
|
```bash
|
|
@@ -218,7 +222,7 @@ Funciona en tres piezas que comparten el mismo archivo:
|
|
|
218
222
|
|
|
219
223
|
Cada entrada tiene un `scope`: `project` (default, entra en `<ProjectMemoryRules>`), `feature` o `task`. 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.
|
|
220
224
|
|
|
221
|
-
> El mismo motor se puede consultar a mano desde la terminal: `ancleto memory context --scope project`.
|
|
225
|
+
> 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`.
|
|
222
226
|
|
|
223
227
|
---
|
|
224
228
|
|
package/package.json
CHANGED
package/src/cli/index.js
CHANGED
|
@@ -440,6 +440,7 @@ async function install(args) {
|
|
|
440
440
|
if (projectDir) {
|
|
441
441
|
await copyTemplates(projectDir)
|
|
442
442
|
await scaffoldAspec(projectDir)
|
|
443
|
+
await refreshWorkingContext(projectDir)
|
|
443
444
|
const agentSkillsDir = await installAgentSkills(projectDir, agent)
|
|
444
445
|
await writeManifest(projectDir, {
|
|
445
446
|
agent,
|
|
@@ -499,6 +500,7 @@ async function upgradeCmd(args) {
|
|
|
499
500
|
const agent = await resolveAgent(args, rc.agent)
|
|
500
501
|
await copyTemplates(projectDir)
|
|
501
502
|
const agentSkillsDir = await installAgentSkills(projectDir, agent)
|
|
503
|
+
const wentContext = await refreshWorkingContext(projectDir)
|
|
502
504
|
const manifest = await writeManifest(projectDir, {
|
|
503
505
|
agent,
|
|
504
506
|
installedPaths: {
|
|
@@ -511,6 +513,7 @@ async function upgradeCmd(args) {
|
|
|
511
513
|
console.log(`ancleto: upgrade completo (v${manifest.version}, agente: ${agent})`)
|
|
512
514
|
console.log(' ✔ templates re-aplicados (bloques LOCKED actualizados, EXTENSIBLE intacto)')
|
|
513
515
|
console.log(` ✔ skills actualizadas en ${agentSkillsDir} (${ANCLETO_SKILLS.length} skills)`)
|
|
516
|
+
console.log(wentContext ? ' ✔ working-context.md regenerado' : ' ✔ working-context.md sin reglas activas (vacio)')
|
|
514
517
|
console.log(' ✔ manifiesto .ancletorc actualizado')
|
|
515
518
|
}
|
|
516
519
|
|
|
@@ -551,7 +554,9 @@ async function initProject(args) {
|
|
|
551
554
|
}
|
|
552
555
|
|
|
553
556
|
const manifest = await writeManifest(projectDir, { azure, discovery, agent })
|
|
557
|
+
await copyTemplates(projectDir)
|
|
554
558
|
await scaffoldAspec(projectDir)
|
|
559
|
+
await refreshWorkingContext(projectDir)
|
|
555
560
|
if (azure.enabled) console.log(AZURE_MCP_NOTICE)
|
|
556
561
|
console.log(`ancleto: .ancletorc actualizado en ${projectDir} (v${manifest.version})${azure.enabled ? ' (Azure habilitado)' : ' (Azure desactivado)'} (Agente: ${agent})${tier ? ` (Tier: ${tier})` : ''}`)
|
|
557
562
|
}
|
|
@@ -717,6 +722,7 @@ async function runRepomix(flags, tmpFile) {
|
|
|
717
722
|
|
|
718
723
|
async function packDiscovery(flags) {
|
|
719
724
|
const { outputDir } = await loadDiscoveryConfig()
|
|
725
|
+
try { writeDiscoveryMap(process.cwd()) } catch {}
|
|
720
726
|
const tmpFile = join(tmpdir(), `ancleto-pack-${Date.now()}.txt`)
|
|
721
727
|
await runRepomix(flags, tmpFile)
|
|
722
728
|
let content = ''
|
|
@@ -744,7 +750,6 @@ async function packDiscovery(flags) {
|
|
|
744
750
|
}
|
|
745
751
|
|
|
746
752
|
async function discovery(flags) {
|
|
747
|
-
try { writeDiscoveryMap(process.cwd()) } catch {}
|
|
748
753
|
if (flags.includes('--check')) {
|
|
749
754
|
await checkDiscovery()
|
|
750
755
|
return
|
|
@@ -752,6 +757,22 @@ async function discovery(flags) {
|
|
|
752
757
|
await packDiscovery(flags)
|
|
753
758
|
}
|
|
754
759
|
|
|
760
|
+
async function refreshWorkingContext(projectDir, scope = 'project') {
|
|
761
|
+
const dbPath = defaultMemoryDbPath(projectDir)
|
|
762
|
+
if (!(await exists(dbPath))) return null
|
|
763
|
+
const engine = createMemoryEngine(dbPath)
|
|
764
|
+
let block
|
|
765
|
+
try {
|
|
766
|
+
block = engine.buildWorkingContext(scope)
|
|
767
|
+
} finally {
|
|
768
|
+
engine.close()
|
|
769
|
+
}
|
|
770
|
+
const out = join(projectDir, '.ancleto', 'working-context.md')
|
|
771
|
+
await mkdir(dirname(out), { recursive: true })
|
|
772
|
+
await writeFile(out, block === null ? '' : block + '\n')
|
|
773
|
+
return block === null ? null : out
|
|
774
|
+
}
|
|
775
|
+
|
|
755
776
|
async function memoryContext(flags) {
|
|
756
777
|
const scope = flagValue(flags, '--scope') || 'project'
|
|
757
778
|
const out = flagValue(flags, '--out')
|