#!/usr/bin/env node
import'./chunk-5TAVYPOV.js';import*as i from'fs';import*as r from'path';import o from'chalk';var m=["specs","implementation-guides","prompts","decisions"];function f(e){let s=new Date().toISOString().slice(0,10);return `# .index.yaml
# AI navigation index \u2014 read this before reading any file in this directory
version: 1.0.0
description: TODO: Describe what .paradigm/${e}/ contains
updated: ${s}

documents:
  # - id: example-doc
  #   file: example.md
  #   title: Example Document
  #   summary: One-line description for quick scanning
  #   tags: []

dependencies: []

subdirs: []
`}async function p(e={}){let s=e.rootDir||process.cwd(),c=r.join(s,".paradigm");if(!i.existsSync(c)){console.log(o.red("No .paradigm/ directory found in current directory."));return}let t=0,a=0;for(let n of m){let d=r.join(c,n);if(!i.existsSync(d)||!i.statSync(d).isDirectory())continue;let l=r.join(d,".index.yaml");if(i.existsSync(l)){e.quiet||console.log(o.dim(`  skip  .paradigm/${n}/.index.yaml \u2014 already exists`)),a++;continue}if(e.dryRun){console.log(o.cyan(`  would create  .paradigm/${n}/.index.yaml`)),t++;continue}i.writeFileSync(l,f(n),"utf8"),e.quiet||console.log(o.green(`  created  .paradigm/${n}/.index.yaml`)),t++;}if(!e.quiet){let n=e.dryRun?"Would create":"Created";console.log(""),console.log(`${n} ${o.bold(String(t))} .index.yaml stub${t===1?"":"s"}${a>0?`, skipped ${a} (already exist)`:""}.`),t>0&&!e.dryRun&&console.log(o.dim("Edit each stub to describe the directory contents."));}}export{p as docsScaffoldCommand};