@ancleto/spec 0.6.16 → 0.6.18

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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ancleto/spec",
3
- "version": "0.6.16",
3
+ "version": "0.6.18",
4
4
  "description": "Orquestador SDD liviano con subagentes optimizados para costo/tokens",
5
5
  "type": "module",
6
6
  "bin": {
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
  }
@@ -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')