@leanspec/ui 0.2.6-dev.20251125010539 → 0.2.6

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.
Files changed (278) hide show
  1. package/.next/standalone/node_modules/.pnpm/better-sqlite3@11.10.0/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  2. package/.next/standalone/packages/ui/.next/BUILD_ID +1 -1
  3. package/.next/standalone/packages/ui/.next/build-manifest.json +2 -2
  4. package/.next/standalone/packages/ui/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/packages/ui/.next/required-server-files.json +4 -4
  6. package/.next/standalone/packages/ui/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/standalone/packages/ui/.next/server/app/_global-error.html +2 -2
  8. package/.next/standalone/packages/ui/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/standalone/packages/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/packages/ui/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/packages/ui/.next/server/app/_not-found.html +2 -2
  15. package/.next/standalone/packages/ui/.next/server/app/_not-found.rsc +1 -1
  16. package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/standalone/packages/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/standalone/packages/ui/.next/server/app/api/local-projects/[id]/route.js.nft.json +1 -1
  22. package/.next/standalone/packages/ui/.next/server/app/api/local-projects/discover/route.js.nft.json +1 -1
  23. package/.next/standalone/packages/ui/.next/server/app/api/local-projects/list-directory/route.js.nft.json +1 -1
  24. package/.next/standalone/packages/ui/.next/server/app/api/local-projects/route.js.nft.json +1 -1
  25. package/.next/standalone/packages/ui/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  26. package/.next/standalone/packages/ui/.next/server/app/api/projects/[id]/specs/[spec]/route.js.nft.json +1 -1
  27. package/.next/standalone/packages/ui/.next/server/app/api/projects/[id]/specs/[spec]/status/route.js.nft.json +1 -1
  28. package/.next/standalone/packages/ui/.next/server/app/api/projects/[id]/specs/route.js.nft.json +1 -1
  29. package/.next/standalone/packages/ui/.next/server/app/api/projects/[id]/stats/route.js.nft.json +1 -1
  30. package/.next/standalone/packages/ui/.next/server/app/api/projects/route.js.nft.json +1 -1
  31. package/.next/standalone/packages/ui/.next/server/app/api/revalidate/route.js.nft.json +1 -1
  32. package/.next/standalone/packages/ui/.next/server/app/api/specs/[id]/dependency-graph/route.js.nft.json +1 -1
  33. package/.next/standalone/packages/ui/.next/server/app/api/specs/[id]/route.js.nft.json +1 -1
  34. package/.next/standalone/packages/ui/.next/server/app/api/specs/[id]/status/route.js.nft.json +1 -1
  35. package/.next/standalone/packages/ui/.next/server/app/api/specs/[id]/subspecs/[file]/route.js.nft.json +1 -1
  36. package/.next/standalone/packages/ui/.next/server/app/api/stats/route.js.nft.json +1 -1
  37. package/.next/standalone/packages/ui/.next/server/app/page.js.nft.json +1 -1
  38. package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/page.js.nft.json +1 -1
  39. package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/specs/[specId]/page.js.nft.json +1 -1
  40. package/.next/standalone/packages/ui/.next/server/app/projects/[projectId]/specs/page.js.nft.json +1 -1
  41. package/.next/standalone/packages/ui/.next/server/app/projects/page.js.nft.json +1 -1
  42. package/.next/standalone/packages/ui/.next/server/app/projects.html +2 -2
  43. package/.next/standalone/packages/ui/.next/server/app/projects.rsc +1 -1
  44. package/.next/standalone/packages/ui/.next/server/app/projects.segments/_full.segment.rsc +1 -1
  45. package/.next/standalone/packages/ui/.next/server/app/projects.segments/_index.segment.rsc +1 -1
  46. package/.next/standalone/packages/ui/.next/server/app/projects.segments/_tree.segment.rsc +1 -1
  47. package/.next/standalone/packages/ui/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +1 -1
  48. package/.next/standalone/packages/ui/.next/server/app/projects.segments/projects.segment.rsc +1 -1
  49. package/.next/standalone/packages/ui/.next/server/app/specs/[id]/page.js.nft.json +1 -1
  50. package/.next/standalone/packages/ui/.next/server/app/specs/page.js.nft.json +1 -1
  51. package/.next/standalone/packages/ui/.next/server/app/stats/page.js.nft.json +1 -1
  52. package/.next/standalone/packages/ui/.next/server/pages/404.html +2 -2
  53. package/.next/standalone/packages/ui/.next/server/pages/500.html +2 -2
  54. package/.next/standalone/packages/ui/.next/server/server-reference-manifest.js +1 -1
  55. package/.next/standalone/packages/ui/.next/server/server-reference-manifest.json +1 -1
  56. package/.next/standalone/packages/ui/dist/BUILD_ID +1 -0
  57. package/.next/standalone/packages/ui/dist/public/f864aa7e7061c0600e35cf3d879b27cf.txt +1 -0
  58. package/.next/standalone/packages/ui/dist/public/favicon.ico +0 -0
  59. package/.next/standalone/packages/ui/dist/public/file.svg +1 -0
  60. package/.next/standalone/packages/ui/dist/public/github-mark-white.svg +1 -0
  61. package/.next/standalone/packages/ui/dist/public/github-mark.svg +1 -0
  62. package/.next/standalone/packages/ui/dist/public/globe.svg +1 -0
  63. package/.next/standalone/packages/ui/dist/public/icon.svg +7 -0
  64. package/.next/standalone/packages/ui/dist/public/logo-dark-bg.svg +17 -0
  65. package/.next/standalone/packages/ui/dist/public/logo-with-bg.svg +17 -0
  66. package/.next/standalone/packages/ui/dist/public/logo.svg +17 -0
  67. package/.next/standalone/packages/ui/dist/public/next.svg +1 -0
  68. package/.next/standalone/packages/ui/dist/public/vercel.svg +1 -0
  69. package/.next/standalone/packages/ui/dist/public/window.svg +1 -0
  70. package/.next/standalone/packages/ui/dist/standalone/packages/web/README.md +196 -0
  71. package/.next/standalone/packages/ui/dist/standalone/packages/web/leanspec.db +0 -0
  72. package/.next/standalone/packages/ui/dist/standalone/packages/web/package.json +75 -0
  73. package/.next/standalone/packages/ui/dist/standalone/packages/web/server.js +44 -0
  74. package/.next/standalone/packages/ui/dist/standalone/specs/014-complete-custom-frontmatter/README.md +175 -0
  75. package/.next/standalone/packages/ui/dist/standalone/specs/016-github-action/README.md +317 -0
  76. package/.next/standalone/packages/ui/dist/standalone/specs/017-vscode-extension/README.md +261 -0
  77. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/CLI-DESIGN.md +380 -0
  78. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/CONFIGURATION-EXAMPLES.md +230 -0
  79. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/CONFIGURATION.md +285 -0
  80. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/IMPLEMENTATION.md +358 -0
  81. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/README.md +303 -0
  82. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/TESTING.md +368 -0
  83. package/.next/standalone/packages/ui/dist/standalone/specs/018-spec-validation/VALIDATION-RULES.md +327 -0
  84. package/.next/standalone/packages/ui/dist/standalone/specs/024-pattern-aware-list-grouping/README.md +117 -0
  85. package/.next/standalone/packages/ui/dist/standalone/specs/025-template-config-updates/README.md +73 -0
  86. package/.next/standalone/packages/ui/dist/standalone/specs/026-init-pattern-selection/README.md +109 -0
  87. package/.next/standalone/packages/ui/dist/standalone/specs/034-copilot-slash-commands/README.md +107 -0
  88. package/.next/standalone/packages/ui/dist/standalone/specs/035-live-specs-showcase/ARCHITECTURE.md +244 -0
  89. package/.next/standalone/packages/ui/dist/standalone/specs/035-live-specs-showcase/IMPLEMENTATION.md +429 -0
  90. package/.next/standalone/packages/ui/dist/standalone/specs/035-live-specs-showcase/README.md +302 -0
  91. package/.next/standalone/packages/ui/dist/standalone/specs/036-pm-integrations/README.md +158 -0
  92. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DEMO-AI-ASSISTED.md +359 -0
  93. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DEMO-FULL-LIFECYCLE.md +86 -0
  94. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DEMO-REAL-FEATURE.md +437 -0
  95. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DEMO-SCRIPT.md +365 -0
  96. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DOGFOODING-FINAL.md +203 -0
  97. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DOGFOODING-SESSION-2025-11-06.md +174 -0
  98. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/DOGFOODING-SUMMARY.md +156 -0
  99. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/IMPLEMENTATION.md +183 -0
  100. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/MARKETING.md +229 -0
  101. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/NEXT-STEPS-DEMO.md +243 -0
  102. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/README.md +217 -0
  103. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/SESSION-2025-11-06.md +166 -0
  104. package/.next/standalone/packages/ui/dist/standalone/specs/043-official-launch-02/TESTING.md +126 -0
  105. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/ACTUAL-IMPLEMENTATION.md +108 -0
  106. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/DESIGN.md +382 -0
  107. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/IMPLEMENTATION.md +144 -0
  108. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/RATIONALE.md +146 -0
  109. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/README.md +208 -0
  110. package/.next/standalone/packages/ui/dist/standalone/specs/045-unified-dashboard/TESTING.md +182 -0
  111. package/.next/standalone/packages/ui/dist/standalone/specs/047-git-backfill-timestamps/README.md +314 -0
  112. package/.next/standalone/packages/ui/dist/standalone/specs/048-spec-complexity-analysis/FINDINGS.md +113 -0
  113. package/.next/standalone/packages/ui/dist/standalone/specs/048-spec-complexity-analysis/GUIDELINES.md +237 -0
  114. package/.next/standalone/packages/ui/dist/standalone/specs/048-spec-complexity-analysis/README.md +149 -0
  115. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/ANALYSIS-COMPARISONS.md +175 -0
  116. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/ANALYSIS-CONSTRAINTS.md +254 -0
  117. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/FIRST-PRINCIPLES.md +376 -0
  118. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/OPERATIONALIZATION-ROADMAP.md +240 -0
  119. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/OPERATIONALIZATION-TOOLS.md +175 -0
  120. package/.next/standalone/packages/ui/dist/standalone/specs/049-leanspec-first-principles/README.md +374 -0
  121. package/.next/standalone/packages/ui/dist/standalone/specs/051-docs-system-prompt-principles/README.md +339 -0
  122. package/.next/standalone/packages/ui/dist/standalone/specs/052-branding-assets/README.md +128 -0
  123. package/.next/standalone/packages/ui/dist/standalone/specs/053-spec-assets-philosophy/README.md +97 -0
  124. package/.next/standalone/packages/ui/dist/standalone/specs/054-validate-output-lint-style/DESIGN-DECISIONS.md +93 -0
  125. package/.next/standalone/packages/ui/dist/standalone/specs/054-validate-output-lint-style/OUTPUT-FORMAT-SPEC.md +146 -0
  126. package/.next/standalone/packages/ui/dist/standalone/specs/054-validate-output-lint-style/README.md +175 -0
  127. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/ANALYSIS-PART1.md +397 -0
  128. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/ANALYSIS-PART2.md +342 -0
  129. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/ANALYSIS.md +44 -0
  130. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/CHANGES.md +150 -0
  131. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/CONCERNS-ANALYSIS.md +351 -0
  132. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/DOCS-ALIGNMENT-ANALYSIS.md +238 -0
  133. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/README.md +280 -0
  134. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/REDESIGN-DRAFT.md +372 -0
  135. package/.next/standalone/packages/ui/dist/standalone/specs/055-readme-redesign-ai-first/REDESIGN-REFINED.md +466 -0
  136. package/.next/standalone/packages/ui/dist/standalone/specs/056-docs-site-accuracy-audit/AUDIT-RESULTS.md +178 -0
  137. package/.next/standalone/packages/ui/dist/standalone/specs/056-docs-site-accuracy-audit/README.md +174 -0
  138. package/.next/standalone/packages/ui/dist/standalone/specs/057-docs-validation-comprehensive/README.md +295 -0
  139. package/.next/standalone/packages/ui/dist/standalone/specs/057-docs-validation-comprehensive/VALIDATION-RESULTS.md +487 -0
  140. package/.next/standalone/packages/ui/dist/standalone/specs/058-docs-overview-polish/ANALYSIS.md +241 -0
  141. package/.next/standalone/packages/ui/dist/standalone/specs/058-docs-overview-polish/DESIGN.md +279 -0
  142. package/.next/standalone/packages/ui/dist/standalone/specs/058-docs-overview-polish/IMPLEMENTATION.md +642 -0
  143. package/.next/standalone/packages/ui/dist/standalone/specs/058-docs-overview-polish/NOTES.md +125 -0
  144. package/.next/standalone/packages/ui/dist/standalone/specs/058-docs-overview-polish/README.md +286 -0
  145. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/ARCHITECTURE.md +392 -0
  146. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/COMMANDS.md +1002 -0
  147. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/CONTEXT-ENGINEERING.md +411 -0
  148. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/IMPLEMENTATION.md +812 -0
  149. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/README.md +504 -0
  150. package/.next/standalone/packages/ui/dist/standalone/specs/059-programmatic-spec-management/TESTING.md +724 -0
  151. package/.next/standalone/packages/ui/dist/standalone/specs/060-core-concepts-coherence/README.md +125 -0
  152. package/.next/standalone/packages/ui/dist/standalone/specs/061-ai-assisted-spec-writing/README.md +299 -0
  153. package/.next/standalone/packages/ui/dist/standalone/specs/062-docs-info-architecture-v2/IMPLEMENTATION-PLAN.md +174 -0
  154. package/.next/standalone/packages/ui/dist/standalone/specs/062-docs-info-architecture-v2/PAGE-SPECIFICATIONS.md +265 -0
  155. package/.next/standalone/packages/ui/dist/standalone/specs/062-docs-info-architecture-v2/PROBLEM-ANALYSIS.md +36 -0
  156. package/.next/standalone/packages/ui/dist/standalone/specs/062-docs-info-architecture-v2/README.md +243 -0
  157. package/.next/standalone/packages/ui/dist/standalone/specs/062-docs-info-architecture-v2/SOLUTION-DESIGN.md +82 -0
  158. package/.next/standalone/packages/ui/dist/standalone/specs/063-migration-from-existing-tools/DESIGN.md +338 -0
  159. package/.next/standalone/packages/ui/dist/standalone/specs/063-migration-from-existing-tools/EXAMPLES.md +354 -0
  160. package/.next/standalone/packages/ui/dist/standalone/specs/063-migration-from-existing-tools/IMPLEMENTATION.md +189 -0
  161. package/.next/standalone/packages/ui/dist/standalone/specs/063-migration-from-existing-tools/README.md +119 -0
  162. package/.next/standalone/packages/ui/dist/standalone/specs/064-docs-site-zh-translation/README.md +170 -0
  163. package/.next/standalone/packages/ui/dist/standalone/specs/065-v03-planning/README.md +158 -0
  164. package/.next/standalone/packages/ui/dist/standalone/specs/066-context-economy-thresholds-refinement/README.md +842 -0
  165. package/.next/standalone/packages/ui/dist/standalone/specs/067-monorepo-core-extraction/README.md +358 -0
  166. package/.next/standalone/packages/ui/dist/standalone/specs/068-live-specs-ux-enhancements/DESIGN.md +444 -0
  167. package/.next/standalone/packages/ui/dist/standalone/specs/068-live-specs-ux-enhancements/README.md +357 -0
  168. package/.next/standalone/packages/ui/dist/standalone/specs/069-token-counting-utils/README.md +551 -0
  169. package/.next/standalone/packages/ui/dist/standalone/specs/070-mcp-token-counting-tool/README.md +372 -0
  170. package/.next/standalone/packages/ui/dist/standalone/specs/071-simplified-token-validation/README.md +489 -0
  171. package/.next/standalone/packages/ui/dist/standalone/specs/072-ai-agent-first-use-workflow/README.md +285 -0
  172. package/.next/standalone/packages/ui/dist/standalone/specs/073-template-engine-agents-md/README.md +323 -0
  173. package/.next/standalone/packages/ui/dist/standalone/specs/074-content-at-creation/README.md +136 -0
  174. package/.next/standalone/packages/ui/dist/standalone/specs/075-intelligent-search-engine/README.md +399 -0
  175. package/.next/standalone/packages/ui/dist/standalone/specs/076-programmatic-spec-relationships/README.md +301 -0
  176. package/.next/standalone/packages/ui/dist/standalone/specs/077-archiving-strategy/README.md +235 -0
  177. package/.next/standalone/packages/ui/dist/standalone/specs/078-sub-spec-template-system/README.md +303 -0
  178. package/.next/standalone/packages/ui/dist/standalone/specs/079-cli-alphabetical-organization/README.md +196 -0
  179. package/.next/standalone/packages/ui/dist/standalone/specs/080-mcp-server-modular-architecture/README.md +388 -0
  180. package/.next/standalone/packages/ui/dist/standalone/specs/081-web-app-ux-redesign/README.md +824 -0
  181. package/.next/standalone/packages/ui/dist/standalone/specs/082-web-realtime-sync-architecture/DATABASE.md +111 -0
  182. package/.next/standalone/packages/ui/dist/standalone/specs/082-web-realtime-sync-architecture/DEPLOYMENT.md +69 -0
  183. package/.next/standalone/packages/ui/dist/standalone/specs/082-web-realtime-sync-architecture/FILESYSTEM.md +77 -0
  184. package/.next/standalone/packages/ui/dist/standalone/specs/082-web-realtime-sync-architecture/IMPLEMENTATION.md +184 -0
  185. package/.next/standalone/packages/ui/dist/standalone/specs/082-web-realtime-sync-architecture/README.md +496 -0
  186. package/.next/standalone/packages/ui/dist/standalone/specs/083-web-navigation-performance/README.md +490 -0
  187. package/.next/standalone/packages/ui/dist/standalone/specs/084-sub-spec-visibility-in-tools/README.md +389 -0
  188. package/.next/standalone/packages/ui/dist/standalone/specs/085-cli-relationship-commands/README.md +920 -0
  189. package/.next/standalone/packages/ui/dist/standalone/specs/086-template-component-deduplication/README.md +146 -0
  190. package/.next/standalone/packages/ui/dist/standalone/specs/087-cli-ui-command/README.md +607 -0
  191. package/.next/standalone/packages/ui/dist/standalone/specs/088-core-concepts-terminology-only/README.md +104 -0
  192. package/.next/standalone/packages/ui/dist/standalone/specs/089-sdd-practical-tutorials/README.md +124 -0
  193. package/.next/standalone/packages/ui/dist/standalone/specs/090-leanspec-sdd-case-studies/README.md +129 -0
  194. package/.next/standalone/packages/ui/dist/standalone/specs/091-chinese-localization-strategy/README.md +244 -0
  195. package/.next/standalone/packages/ui/dist/standalone/specs/092-docs-site-submodule-migration/README.md +148 -0
  196. package/.next/standalone/packages/ui/dist/standalone/specs/093-spec-detail-ui-improvements/README.md +54 -0
  197. package/.next/standalone/packages/ui/dist/standalone/specs/archived/001-typescript-cli-migration/README.md +37 -0
  198. package/.next/standalone/packages/ui/dist/standalone/specs/archived/002-template-system-redesign/README.md +60 -0
  199. package/.next/standalone/packages/ui/dist/standalone/specs/archived/003-init-system-redesign/README.md +113 -0
  200. package/.next/standalone/packages/ui/dist/standalone/specs/archived/004-existing-project-integration/README.md +69 -0
  201. package/.next/standalone/packages/ui/dist/standalone/specs/archived/004-existing-project-integration/SUMMARY.md +112 -0
  202. package/.next/standalone/packages/ui/dist/standalone/specs/archived/005-structured-frontmatter/README.md +229 -0
  203. package/.next/standalone/packages/ui/dist/standalone/specs/archived/006-pm-visualization-tools/README.md +406 -0
  204. package/.next/standalone/packages/ui/dist/standalone/specs/archived/007-system-prompt-updates/README.md +168 -0
  205. package/.next/standalone/packages/ui/dist/standalone/specs/archived/008-commander-migration/README.md +174 -0
  206. package/.next/standalone/packages/ui/dist/standalone/specs/archived/009-cli-ux-enhancement/README.md +212 -0
  207. package/.next/standalone/packages/ui/dist/standalone/specs/archived/010-commands-refactor/README.md +249 -0
  208. package/.next/standalone/packages/ui/dist/standalone/specs/archived/011-test-results/README.md +60 -0
  209. package/.next/standalone/packages/ui/dist/standalone/specs/archived/011-test-results/TEST_SUMMARY.md +139 -0
  210. package/.next/standalone/packages/ui/dist/standalone/specs/archived/012-sub-spec-files/README.md +722 -0
  211. package/.next/standalone/packages/ui/dist/standalone/specs/archived/013-custom-spec-templates/README.md +413 -0
  212. package/.next/standalone/packages/ui/dist/standalone/specs/archived/015-npm-publishing/README.md +255 -0
  213. package/.next/standalone/packages/ui/dist/standalone/specs/archived/019-readme-improvement/README.md +252 -0
  214. package/.next/standalone/packages/ui/dist/standalone/specs/archived/020-documentation-website/README.md +253 -0
  215. package/.next/standalone/packages/ui/dist/standalone/specs/archived/021-docusaurus-vercel-migration/README.md +612 -0
  216. package/.next/standalone/packages/ui/dist/standalone/specs/archived/022-flexible-folder-structure/README.md +794 -0
  217. package/.next/standalone/packages/ui/dist/standalone/specs/archived/023-folder-structure-improvements/DESIGN.md +834 -0
  218. package/.next/standalone/packages/ui/dist/standalone/specs/archived/023-folder-structure-improvements/README.md +255 -0
  219. package/.next/standalone/packages/ui/dist/standalone/specs/archived/027-cli-ui-ux-optimization/README.md +454 -0
  220. package/.next/standalone/packages/ui/dist/standalone/specs/archived/028-cli-ui-modernization/README.md +172 -0
  221. package/.next/standalone/packages/ui/dist/standalone/specs/archived/029-visualization-improvements/IMPLEMENTATION.md +152 -0
  222. package/.next/standalone/packages/ui/dist/standalone/specs/archived/029-visualization-improvements/README.md +95 -0
  223. package/.next/standalone/packages/ui/dist/standalone/specs/archived/030-created-date-format-bug/README.md +87 -0
  224. package/.next/standalone/packages/ui/dist/standalone/specs/archived/031-gantt-ux-improvements/README.md +230 -0
  225. package/.next/standalone/packages/ui/dist/standalone/specs/archived/032-console-log-chalk-security/README.md +89 -0
  226. package/.next/standalone/packages/ui/dist/standalone/specs/archived/033-mcp-server/README.md +89 -0
  227. package/.next/standalone/packages/ui/dist/standalone/specs/archived/037-docs-overhaul/README.md +166 -0
  228. package/.next/standalone/packages/ui/dist/standalone/specs/archived/038-flat-structure-migration/README.md +276 -0
  229. package/.next/standalone/packages/ui/dist/standalone/specs/archived/038-mcp-frontmatter-bug-fix/README.md +122 -0
  230. package/.next/standalone/packages/ui/dist/standalone/specs/archived/039-simplify-viewer-commands/README.md +198 -0
  231. package/.next/standalone/packages/ui/dist/standalone/specs/archived/039-template-variable-sync/README.md +192 -0
  232. package/.next/standalone/packages/ui/dist/standalone/specs/archived/040-spec-viewer-commands/README.md +171 -0
  233. package/.next/standalone/packages/ui/dist/standalone/specs/archived/042-mcp-error-handling/README.md +200 -0
  234. package/.next/standalone/packages/ui/dist/standalone/specs/archived/044-spec-relationships-clarity/README.md +317 -0
  235. package/.next/standalone/packages/ui/dist/standalone/specs/archived/046-stats-dashboard-refactor/DESIGN.md +276 -0
  236. package/.next/standalone/packages/ui/dist/standalone/specs/archived/046-stats-dashboard-refactor/IMPLEMENTATION.md +241 -0
  237. package/.next/standalone/packages/ui/dist/standalone/specs/archived/046-stats-dashboard-refactor/README.md +139 -0
  238. package/.next/standalone/packages/ui/dist/standalone/specs/archived/046-stats-dashboard-refactor/TESTING.md +328 -0
  239. package/.next/standalone/packages/ui/dist/standalone/specs/archived/050-tool-redesign-first-principles/README.md +400 -0
  240. package/.next/standalone/packages/ui/dist/static/chunks/0c19c69aa7625475.js +1 -0
  241. package/.next/standalone/packages/ui/dist/static/chunks/116800b03245a1e5.js +1 -0
  242. package/.next/standalone/packages/ui/dist/static/chunks/15843a3d7584e314.js +1 -0
  243. package/.next/standalone/packages/ui/dist/static/chunks/19e80edf527aef5c.js +1 -0
  244. package/.next/standalone/packages/ui/dist/static/chunks/465954d5af3284a9.js +1 -0
  245. package/.next/standalone/packages/ui/dist/static/chunks/5abeeb89f1412a80.js +3 -0
  246. package/.next/standalone/packages/ui/dist/static/chunks/5c2072ad938de8ed.js +1 -0
  247. package/.next/standalone/packages/ui/dist/static/chunks/6a05a93ec8fa7b83.js +1 -0
  248. package/.next/standalone/packages/ui/dist/static/chunks/778e42188e450b39.css +1 -0
  249. package/.next/standalone/packages/ui/dist/static/chunks/a02c1f50ff00204f.js +1 -0
  250. package/.next/standalone/packages/ui/dist/static/chunks/a45464b9776dd88e.js +1 -0
  251. package/.next/standalone/packages/ui/dist/static/chunks/a6dad97d9634a72d.js +1 -0
  252. package/.next/standalone/packages/ui/dist/static/chunks/b0ea0ac61604f843.js +1 -0
  253. package/.next/standalone/packages/ui/dist/static/chunks/c06e85b449720194.js +1 -0
  254. package/.next/standalone/packages/ui/dist/static/chunks/c557ac675be79771.js +1 -0
  255. package/.next/standalone/packages/ui/dist/static/chunks/cad005a57ffbb2d3.js +1 -0
  256. package/.next/standalone/packages/ui/dist/static/chunks/cdf6fe33bc65efbc.js +1 -0
  257. package/.next/standalone/packages/ui/dist/static/chunks/d12ed5dbe44caed7.js +1 -0
  258. package/.next/standalone/packages/ui/dist/static/chunks/d1ebe5c1a344f4ca.js +5 -0
  259. package/.next/standalone/packages/ui/dist/static/chunks/d42cf1682bc46652.js +1 -0
  260. package/.next/standalone/packages/ui/dist/static/chunks/dde5d8bddd7fbfcf.js +1 -0
  261. package/.next/standalone/packages/ui/dist/static/chunks/ebd89051637b9a47.js +4 -0
  262. package/.next/standalone/packages/ui/dist/static/chunks/ec82875d18b29f47.js +2 -0
  263. package/.next/standalone/packages/ui/dist/static/chunks/f0b701df9769bcc5.js +19 -0
  264. package/.next/standalone/packages/ui/dist/static/chunks/turbopack-1c09a99f4c9e28d3.js +3 -0
  265. package/.next/standalone/packages/ui/leanspec.db +0 -0
  266. package/.next/standalone/packages/ui/package.json +1 -1
  267. package/.next/standalone/packages/ui/server.js +1 -1
  268. package/.next/standalone/packages/ui/tsconfig.tsbuildinfo +1 -1
  269. package/.next/static/T_KGFP0pHt_xSaaYUJa3L/_buildManifest.js +11 -0
  270. package/.next/static/T_KGFP0pHt_xSaaYUJa3L/_clientMiddlewareManifest.json +1 -0
  271. package/.next/static/T_KGFP0pHt_xSaaYUJa3L/_ssgManifest.js +1 -0
  272. package/package.json +2 -2
  273. /package/.next/standalone/packages/ui/.next/static/{WJi9opx4ShY8zt8yBFo4r → T_KGFP0pHt_xSaaYUJa3L}/_buildManifest.js +0 -0
  274. /package/.next/standalone/packages/ui/.next/static/{WJi9opx4ShY8zt8yBFo4r → T_KGFP0pHt_xSaaYUJa3L}/_clientMiddlewareManifest.json +0 -0
  275. /package/.next/standalone/packages/ui/.next/static/{WJi9opx4ShY8zt8yBFo4r → T_KGFP0pHt_xSaaYUJa3L}/_ssgManifest.js +0 -0
  276. /package/.next/{static/WJi9opx4ShY8zt8yBFo4r → standalone/packages/ui/dist/static/4ZnYN1WbN4LGJQOwP6FkT}/_buildManifest.js +0 -0
  277. /package/.next/{static/WJi9opx4ShY8zt8yBFo4r → standalone/packages/ui/dist/static/4ZnYN1WbN4LGJQOwP6FkT}/_clientMiddlewareManifest.json +0 -0
  278. /package/.next/{static/WJi9opx4ShY8zt8yBFo4r → standalone/packages/ui/dist/static/4ZnYN1WbN4LGJQOwP6FkT}/_ssgManifest.js +0 -0
@@ -0,0 +1,1002 @@
1
+ # CLI Commands
2
+
3
+ **Mechanical transformation tools for AI agent orchestration**
4
+
5
+ ## Design Philosophy
6
+
7
+ These commands are designed for **AI agent orchestration**:
8
+ - AI agents read specs and detect issues
9
+ - AI agents decide transformation strategies
10
+ - AI agents call tools with explicit parameters
11
+ - Tools execute transformations mechanically (no LLM calls)
12
+
13
+ **Key Principles**:
14
+ 1. **Tools are executors, not deciders** - AI agents provide intelligence
15
+ 2. **Deterministic operations** - Same input = same output, always
16
+ 3. **Structured I/O** - JSON output for AI agent consumption
17
+ 4. **No semantic analysis** - Just parse, transform, validate
18
+ 5. **Fast and reliable** - Milliseconds, not minutes
19
+
20
+ ## Command Overview
21
+
22
+ ```bash
23
+ # Analysis (returns structured data)
24
+ lean-spec analyze <spec> [options]
25
+
26
+ # Transformations (execute AI agent decisions)
27
+ lean-spec split <spec> [options]
28
+ lean-spec compact <spec> [options]
29
+ lean-spec compress <spec> [options]
30
+ lean-spec isolate <spec> [options]
31
+
32
+ # Utilities
33
+ lean-spec diff <spec> --before-after
34
+ lean-spec preview <spec> --transformation=<type>
35
+ lean-spec rollback <spec>
36
+ ```
37
+
38
+ ## `lean-spec analyze` - Analyze Spec Complexity
39
+
40
+ ### Purpose
41
+ Parse spec structure and return metrics for AI agent decision-making. No semantic analysis, just structural facts.
42
+
43
+ ### Usage
44
+ ```bash
45
+ lean-spec analyze <spec> [options]
46
+
47
+ Options:
48
+ --json Output as JSON (default for AI agents)
49
+ --concerns Detect logical groupings by section structure
50
+ --verbose Include detailed breakdown
51
+ ```
52
+
53
+ ### Output Format
54
+
55
+ **JSON (primary format for AI agents)**:
56
+ ```json
57
+ {
58
+ "spec": "045-unified-dashboard",
59
+ "path": "specs/045-unified-dashboard/README.md",
60
+ "metrics": {
61
+ "tokens": 4800,
62
+ "lines": 1166,
63
+ "characters": 19200,
64
+ "sections": {
65
+ "h1": 1,
66
+ "h2": 8,
67
+ "h3": 23,
68
+ "h4": 12,
69
+ "total": 44
70
+ },
71
+ "codeBlocks": 23,
72
+ "maxNesting": 4
73
+ },
74
+ "threshold": {
75
+ "status": "warning",
76
+ "limit": 3500,
77
+ "message": "Exceeds 3,500 token warning threshold"
78
+ },
79
+ "structure": [
80
+ {
81
+ "section": "Overview",
82
+ "level": 2,
83
+ "lineRange": [1, 150],
84
+ "tokens": 600,
85
+ "subsections": ["Background", "Decision"]
86
+ },
87
+ {
88
+ "section": "Design",
89
+ "level": 2,
90
+ "lineRange": [151, 528],
91
+ "tokens": 1512,
92
+ "subsections": ["Architecture", "Components", "Data Flow"]
93
+ }
94
+ ],
95
+ "recommendation": {
96
+ "action": "split",
97
+ "reason": "Exceeds 3,500 token threshold with multiple distinct concerns",
98
+ "confidence": "high"
99
+ }
100
+ }
101
+ ```
102
+
103
+ ### Human-Readable Format
104
+
105
+ **For human review** (optional `--verbose` flag):
106
+ ```bash
107
+ $ lean-spec analyze 045 --verbose
108
+
109
+ 📊 Spec Analysis: 045-unified-dashboard
110
+
111
+ Token Count: 4,800 tokens (⚠️ WARNING)
112
+ • Threshold: 3,500 tokens
113
+ • Status: Exceeds warning, approaching 5,000 error threshold
114
+
115
+ Structure:
116
+ Lines: 1,166
117
+ Sections: 44 (H1:1, H2:8, H3:23, H4:12)
118
+ Code blocks: 23
119
+ Max nesting: 4 levels
120
+
121
+ Top Sections by Size:
122
+ 1. Design (1,512 tokens / 378 lines, 32%)
123
+ 2. Testing (728 tokens / 182 lines, 15%)
124
+ 3. Overview (600 tokens / 150 lines, 13%)
125
+
126
+ Recommendation: Split into sub-specs
127
+ → Multiple distinct concerns detected
128
+ → Would reduce to 5 files under 2,000 tokens each
129
+ ```
130
+
131
+ ### AI Agent Usage Pattern
132
+
133
+ ```typescript
134
+ // AI agent workflow
135
+ const analysis = await exec('lean-spec analyze 045 --json');
136
+ const data = JSON.parse(analysis);
137
+
138
+ if (data.threshold.status === 'warning' && data.recommendation.action === 'split') {
139
+ // AI decides split strategy based on structure
140
+ const outputs = data.structure
141
+ .filter(s => s.level === 2)
142
+ .map(s => `${s.section}.md:${s.lineRange[0]}-${s.lineRange[1]}`);
143
+
144
+ // AI calls tool with explicit parameters
145
+ await exec(`lean-spec split 045 ${outputs.map(o => `--output=${o}`).join(' ')}`);
146
+ }
147
+ ```
148
+
149
+ ## `lean-spec split` - Partition Spec into Files
150
+
151
+ ### Purpose
152
+ Mechanically split spec into multiple files based on explicit line ranges. AI agent decides what goes where.
153
+
154
+ ### Usage
155
+ ```bash
156
+ lean-spec split <spec> [options]
157
+
158
+ Options:
159
+ --output=<file>:<lines> Output file with line range (required, repeatable)
160
+ --update-refs Update cross-references automatically
161
+ --dry-run Show what would be created
162
+ --force Overwrite existing files
163
+ ```
164
+
165
+ ### Examples
166
+
167
+ **AI agent orchestrated split**:
168
+ ```bash
169
+ # AI agent analyzed spec and decided on split points
170
+ $ lean-spec split 045 \
171
+ --output=README.md:1-150 \
172
+ --output=DESIGN.md:151-528 \
173
+ --output=TESTING.md:529-710 \
174
+ --update-refs
175
+
176
+ ✓ Created specs/045-unified-dashboard/README.md (812 tokens / 150 lines)
177
+ ✓ Created specs/045-unified-dashboard/DESIGN.md (1,512 tokens / 378 lines)
178
+ ✓ Created specs/045-unified-dashboard/TESTING.md (728 tokens / 182 lines)
179
+ ✓ Updated 47 cross-references
180
+ ✓ Validated all files
181
+
182
+ Split complete: 3 files, 3,052 tokens total
183
+ ```
184
+
185
+ **Dry run preview**:
186
+ ```bash
187
+ $ lean-spec split 045 --output=README.md:1-150 --dry-run
188
+
189
+ Would create:
190
+ specs/045-unified-dashboard/README.md
191
+ Lines: 1-150 (150 lines)
192
+ Estimated tokens: 812
193
+ Sections: Overview, Background, Decision
194
+
195
+ No files modified (dry run)
196
+ ```
197
+
198
+ **Conflict detection**:
199
+ ```bash
200
+ **AI agent orchestrated split**:
201
+ ```bash
202
+ # AI agent analyzed spec and decided on split points
203
+ $ lean-spec split 045 \
204
+ --output=README.md:1-150 \
205
+ --output=DESIGN.md:151-528 \
206
+ --output=TESTING.md:529-710 \
207
+ --update-refs
208
+
209
+ ✓ Created specs/045-unified-dashboard/README.md (812 tokens / 150 lines)
210
+ ✓ Created specs/045-unified-dashboard/DESIGN.md (1,512 tokens / 378 lines)
211
+ ✓ Created specs/045-unified-dashboard/TESTING.md (728 tokens / 182 lines)
212
+ ✓ Updated 47 cross-references
213
+ ✓ Validated all files
214
+
215
+ Split complete: 3 files, 3,052 tokens total
216
+ ```
217
+
218
+ **Dry run preview**:
219
+ ```bash
220
+ $ lean-spec split 045 --output=README.md:1-150 --dry-run
221
+
222
+ Would create:
223
+ specs/045-unified-dashboard/README.md
224
+ Lines: 1-150 (150 lines)
225
+ Estimated tokens: 812
226
+ Sections: Overview, Background, Decision
227
+
228
+ No files modified (dry run)
229
+ ```
230
+
231
+ ### Tool Behavior
232
+
233
+ **What it does**:
234
+ 1. Parses spec structure (frontmatter, sections, line ranges)
235
+ 2. Extracts specified line ranges to new files
236
+ 3. Copies frontmatter to README.md only
237
+ 4. Updates internal cross-references if `--update-refs`
238
+ 5. Validates all created files
239
+
240
+ **What it doesn't do**:
241
+ - ❌ No semantic analysis of content
242
+ - ❌ No decisions about what should go where
243
+ - ❌ No content rewriting or summarization
244
+ - ✅ Just mechanical extraction and file creation
245
+
246
+ ## `lean-spec compact` - Remove Specified Content
247
+
248
+ ### Purpose
249
+ Mechanically remove specified line ranges. AI agent identifies redundancy, tool executes removal.
250
+
251
+ ### Usage
252
+ ```bash
253
+ lean-spec compact <spec> [options]
254
+
255
+ Options:
256
+ --remove=<lines> Line range to remove (required, repeatable)
257
+ --dry-run Show what would be removed
258
+ --force Skip confirmation
259
+ ```
260
+
261
+ ### Examples
262
+
263
+ **AI agent orchestrated compaction**:
264
+ ```bash
265
+ # AI agent detected redundancy at specific lines
266
+ $ lean-spec compact 045 \
267
+ --remove=145-153 \
268
+ --remove=234-256 \
269
+ --remove=401-415
270
+
271
+ ✓ Removed lines 145-153 (9 lines, ~36 tokens)
272
+ ✓ Removed lines 234-256 (23 lines, ~92 tokens)
273
+ ✓ Removed lines 401-415 (15 lines, ~60 tokens)
274
+ ✓ Updated line references
275
+
276
+ Compaction complete: Removed 47 lines, saved ~188 tokens
277
+ ```
278
+
279
+ **Dry run**:
280
+ ```bash
281
+ $ lean-spec compact 045 --remove=145-153 --dry-run
282
+
283
+ Would remove:
284
+ Lines 145-153 (9 lines):
285
+ "Dashboard layout using CSS Grid..."
286
+ [duplicate of content at lines 289-297]
287
+
288
+ Estimated savings: ~36 tokens
289
+
290
+ No files modified (dry run)
291
+ ```
292
+
293
+ ### Tool Behavior
294
+
295
+ **What it does**:
296
+ 1. Removes specified line ranges
297
+ 2. Updates internal line number references
298
+ 3. Validates markdown structure after removal
299
+ 4. Reports token/line savings
300
+
301
+ **What it doesn't do**:
302
+ - ❌ No detection of redundancy
303
+ - ❌ No semantic understanding of what's safe to remove
304
+ - ✅ Just mechanical deletion of specified lines
305
+
306
+ ## `lean-spec compress` - Replace Content with Summary
307
+
308
+ ### Purpose
309
+ Replace specified content with AI-provided summary. AI agent generates summary, tool executes replacement.
310
+
311
+ ### Usage
312
+ ```bash
313
+ lean-spec compress <spec> [options]
314
+
315
+ Options:
316
+ --replace=<lines>:<text> Replace line range with text (required)
317
+ --dry-run Show preview
318
+ ```
319
+
320
+ ### Examples
321
+
322
+ **AI agent orchestrated compression**:
323
+ ```bash
324
+ # AI agent read completed phase, generated summary
325
+ $ lean-spec compress 043 \
326
+ --replace='142-284:## ✅ Phase 1: Foundation (Completed 2025-11-05)
327
+
328
+ Established first principles through comprehensive analysis.
329
+ See: specs/049-leanspec-first-principles/'
330
+
331
+ ✓ Replaced lines 142-284 (143 lines) with 4 lines
332
+ ✓ Saved ~572 tokens
333
+
334
+ Compression complete: 143 → 4 lines
335
+ ```
336
+
337
+ ### Tool Behavior
338
+
339
+ **What it does**:
340
+ 1. Replaces specified line range with provided text
341
+ 2. Validates markdown structure
342
+ 3. Reports compression ratio
343
+
344
+ **What it doesn't do**:
345
+ - ❌ No summarization of content
346
+ - ❌ No decision about what to keep/remove
347
+ - ✅ Just mechanical text replacement
348
+
349
+ ## `lean-spec isolate` - Move Content to New Spec
350
+
351
+ ### Purpose
352
+ Move specified content to a new spec file. AI agent decides what to isolate, tool executes move.
353
+
354
+ ### Usage
355
+ ```bash
356
+ lean-spec isolate <source-spec> [options]
357
+
358
+ Options:
359
+ --lines=<range> Lines to move (required)
360
+ --to=<new-spec> New spec name (required)
361
+ --add-reference Add cross-reference in source
362
+ ```
363
+
364
+ ### Examples
365
+
366
+ **AI agent orchestrated isolation**:
367
+ ```bash
368
+ # AI agent determined section is independent concern
369
+ $ lean-spec isolate 045 \
370
+ --lines=401-542 \
371
+ --to=060-velocity-algorithm \
372
+ --add-reference
373
+
374
+ ✓ Created specs/060-velocity-algorithm/README.md (142 lines, ~568 tokens)
375
+ ✓ Removed lines 401-542 from spec 045
376
+ ✓ Added reference: "See [spec 060](../060-velocity-algorithm/)"
377
+ ✓ Updated frontmatter (related fields)
378
+
379
+ Isolation complete: New spec 060 created
380
+ ```
381
+
382
+ ### Tool Behavior
383
+
384
+ **What it does**:
385
+ 1. Creates new spec directory and README.md
386
+ 2. Moves specified lines to new spec
387
+ 3. Removes lines from source spec
388
+ 4. Updates cross-references if requested
389
+ 5. Initializes frontmatter for new spec
390
+
391
+ **What it doesn't do**:
392
+ - ❌ No decision about what constitutes a separate concern
393
+ - ❌ No analysis of dependencies
394
+ - ✅ Just mechanical file operations
395
+
396
+ **auto (default)**: AI-suggested strategy based on analysis
397
+ **concerns**: Split by logical concerns (design, testing, etc.)
398
+ **phases**: Split by implementation phases
399
+ **custom**: Interactive selection of sections
400
+
401
+ ### Examples
402
+
403
+ **Auto split** (recommended):
404
+ ```bash
405
+ $ lean-spec split 045
406
+
407
+ 🔍 Analyzing spec structure...
408
+ ✓ Detected 5 concerns
409
+ ✓ Generated split plan
410
+
411
+ Split Preview:
412
+ 045-unified-dashboard/
413
+ ├── README.md (812 tokens / 203 lines)
414
+ │ └── Overview, decision, quick reference
415
+ ├── DESIGN.md (1,512 tokens / 378 lines)
416
+ │ └── Architecture, components, data flow
417
+ ├── RATIONALE.md (584 tokens / 146 lines)
418
+ │ └── Trade-offs, alternatives, decisions
419
+ ├── IMPLEMENTATION.md (576 tokens / 144 lines)
420
+ │ └── Phased plan with milestones
421
+ └── TESTING.md (728 tokens / 182 lines)
422
+ └── Test strategy, cases, criteria
423
+
424
+ Changes:
425
+ ✓ 5 files created (4,212 tokens total, ~588 tokens saved via compaction)
426
+ ✓ 47 cross-references updated
427
+ ✓ All files under 2,000 token optimal threshold
428
+ ✓ No content lost
429
+
430
+ Apply this split? (Y/n) █
431
+ ```
432
+
433
+ **Preview mode**:
434
+ ```bash
435
+ $ lean-spec split 045 --preview
436
+
437
+ Split Plan:
438
+
439
+ README.md (812 tokens / 203 lines):
440
+ # Unified Dashboard
441
+
442
+ > **Status**: 📅 Planned · **Priority**: Critical
443
+
444
+ ## Overview
445
+ [600 tokens / 150 lines of overview content...]
446
+
447
+ ## Sub-Specs
448
+ - [DESIGN.md](./DESIGN.md) - Architecture details
449
+ - [RATIONALE.md](./RATIONALE.md) - Design decisions
450
+ - [IMPLEMENTATION.md](./IMPLEMENTATION.md) - Phased plan
451
+ - [TESTING.md](./TESTING.md) - Test strategy
452
+
453
+ DESIGN.md (1,512 tokens / 378 lines):
454
+ # Design & Architecture
455
+
456
+ Detailed design for unified dashboard...
457
+
458
+ ## Component Structure
459
+ [architecture content...]
460
+
461
+ [continue for other files...]
462
+
463
+ Preview only - no files created.
464
+ Run without --preview to apply.
465
+ ```
466
+
467
+ **Split by phases**:
468
+ ```bash
469
+ $ lean-spec split 043 --strategy=phases
470
+
471
+ Phase-based split for multi-phase spec:
472
+
473
+ 043-official-launch-02/
474
+ ├── README.md (720 tokens / 180 lines)
475
+ │ └── Overview, vision, success criteria
476
+ ├── PHASE-1-FOUNDATION.md (568 tokens / 142 lines)
477
+ │ └── First principles, guidelines
478
+ ├── PHASE-2-OPERATIONALIZATION.md (632 tokens / 158 lines)
479
+ │ └── Validation, tooling, dogfooding
480
+ └── PHASE-3-LAUNCH.md (500 tokens / 125 lines)
481
+ └── Marketing, docs, announcement
482
+
483
+ Apply? (Y/n)
484
+ ```
485
+
486
+ **Custom/interactive split**:
487
+ ```bash
488
+ $ lean-spec split 045 --strategy=custom
489
+
490
+ Interactive Split Wizard:
491
+
492
+ Current sections (select to group):
493
+ [x] 1. Overview
494
+ [x] 2. Background
495
+ [x] 3. Decision
496
+ [ ] 4. Design
497
+ [ ] 5. Architecture
498
+ [ ] 6. Components
499
+ ...
500
+
501
+ Create file: README.md ✓
502
+ Selected sections: 1, 2, 3
503
+
504
+ Continue with next file? (Y/n) y
505
+
506
+ Select sections for next file:
507
+ [ ] 4. Design
508
+ [ ] 5. Architecture
509
+ [ ] 6. Components
510
+ ...
511
+ ```
512
+
513
+ ### Post-Split Validation
514
+
515
+ After splitting, automatically validates:
516
+ - ✓ All files under 3,500 tokens
517
+ - ✓ No broken cross-references
518
+ - ✓ Valid markdown syntax
519
+ - ✓ Valid frontmatter in README.md
520
+ - ✓ Sub-spec links in README.md
521
+ - ✓ Git-trackable (files committed together)
522
+
523
+ ## `lean-spec compact` - Remove Redundancy
524
+
525
+ ### Purpose
526
+ Remove duplicate and redundant content while preserving decisions.
527
+
528
+ ### Usage
529
+ ```bash
530
+ lean-spec compact <spec> [options]
531
+
532
+ Options:
533
+ --preview Show changes before applying
534
+ --aggressive More aggressive compaction
535
+ --preserve=<sections> Don't compact these sections
536
+ --threshold=<percent> Similarity threshold (0-100, default: 85)
537
+ ```
538
+
539
+ ### Examples
540
+
541
+ **Basic compaction**:
542
+ ```bash
543
+ $ lean-spec compact 018
544
+
545
+ 🔍 Analyzing redundancy...
546
+ ✓ Found 3 duplicate sections
547
+ ✓ Found 5 consolidation opportunities
548
+
549
+ Compaction Preview:
550
+
551
+ Duplicates to remove:
552
+ 1. "Validation rules" (lines 145-158)
553
+ → Consolidate with lines 278-291
554
+ Savings: 13 lines
555
+
556
+ 2. "Config schema example" (lines 234-256)
557
+ → Already shown in lines 89-111
558
+ Savings: 22 lines
559
+
560
+ Consolidations:
561
+ 3. Repeated prop descriptions (4 instances)
562
+ → Convert to reference table
563
+ Savings: 38 lines
564
+
565
+ Before: 591 lines
566
+ After: 518 lines
567
+ Savings: 73 lines (12%)
568
+
569
+ Apply compaction? (Y/n)
570
+ ```
571
+
572
+ **Aggressive mode**:
573
+ ```bash
574
+ $ lean-spec compact 018 --aggressive
575
+
576
+ 🔍 Aggressive compaction analysis...
577
+
578
+ Additional opportunities:
579
+ - Remove obvious inferences (e.g., "ESLint lints code")
580
+ - Shorten verbose explanations
581
+ - Convert examples to references
582
+ - Merge similar subsections
583
+
584
+ Before: 591 lines
585
+ After: 445 lines (conservative) or 389 lines (aggressive)
586
+
587
+ Choose mode:
588
+ 1. Conservative (keep more context)
589
+ 2. Aggressive (maximum reduction)
590
+ 3. Custom (you choose each)
591
+
592
+ Selection: █
593
+ ```
594
+
595
+ ## `lean-spec compress` - Summarize Sections
596
+
597
+ ### Purpose
598
+ Compress completed phases or verbose sections into summaries.
599
+
600
+ ### Usage
601
+ ```bash
602
+ lean-spec compress <spec> [options]
603
+
604
+ Options:
605
+ --section=<name> Section to compress
606
+ --phases Compress completed phases
607
+ --history Compress historical sections
608
+ --ai Use AI for summarization
609
+ --preserve-decisions Keep decision rationale (default: true)
610
+ ```
611
+
612
+ ### Examples
613
+
614
+ **Compress completed phases**:
615
+ ```bash
616
+ $ lean-spec compress 043 --phases
617
+
618
+ 🔍 Identifying completed phases...
619
+ ✓ Found 2 completed phases
620
+
621
+ Compression Preview:
622
+
623
+ Phase 1: Foundation (COMPLETE - 2025-11-05)
624
+ Before (142 lines):
625
+ ## Phase 1: Foundation
626
+
627
+ Establish first principles...
628
+
629
+ ### Task 1.1: Conduct Analysis
630
+ - Research context engineering
631
+ - Identify constraints
632
+ - [138 lines of detailed steps...]
633
+
634
+ After (8 lines):
635
+ ## ✅ Phase 1: Foundation (Completed 2025-11-05)
636
+
637
+ Established first principles through comprehensive analysis
638
+ of constraints, comparisons, and thought experiments.
639
+
640
+ Deliverables: specs/049-leanspec-first-principles/
641
+ Key decisions: [link to FIRST-PRINCIPLES.md]
642
+
643
+ Phase 2: Operationalization (COMPLETE - 2025-11-06)
644
+ Before (158 lines):
645
+ ## Phase 2: Operationalization
646
+ [detailed implementation steps...]
647
+
648
+ After (10 lines):
649
+ ## ✅ Phase 2: Operationalization (Completed 2025-11-06)
650
+
651
+ Implemented validation tools and dogfooded on our own specs.
652
+ Split specs 018, 045, 048 using sub-spec pattern.
653
+
654
+ Result: All specs now under 400 lines or properly split.
655
+
656
+ Total savings: 282 lines (69% reduction for completed phases)
657
+
658
+ Apply compression? (Y/n)
659
+ ```
660
+
661
+ **Compress specific section**:
662
+ ```bash
663
+ $ lean-spec compress 045 --section="Research Notes"
664
+
665
+ Section: Research Notes (85 lines)
666
+ Status: Supporting information, not critical to decisions
667
+
668
+ Compression options:
669
+ 1. Summarize to 10-15 lines
670
+ 2. Move to separate file (RESEARCH.md)
671
+ 3. Link to external doc and remove
672
+ 4. Keep as-is
673
+
674
+ Selection: 1
675
+
676
+ Preview:
677
+ Before (85 lines): [full research notes]
678
+ After (12 lines): Key findings and links to sources
679
+
680
+ Apply? (Y/n)
681
+ ```
682
+
683
+ **AI-powered compression**:
684
+ ```bash
685
+ $ lean-spec compress 018 --history --ai
686
+
687
+ 🤖 Using AI to summarize historical sections...
688
+
689
+ Found 3 historical sections:
690
+ 1. "Initial Implementation Notes" (45 lines)
691
+ 2. "Migration Path" (38 lines)
692
+ 3. "Archived Approaches" (52 lines)
693
+
694
+ AI Summary Preview:
695
+
696
+ ## Implementation History
697
+
698
+ Initial implementation focused on...
699
+ [AI-generated summary preserving key decisions]
700
+
701
+ Total: 15 lines (from 135 lines, 89% reduction)
702
+
703
+ Preserved:
704
+ ✓ Key decisions and rationale
705
+ ✓ Links to commits/PRs
706
+ ✓ Lessons learned
707
+
708
+ Lost:
709
+ ✗ Step-by-step details (available in git history)
710
+ ✗ Intermediate explorations
711
+ ✗ Debugging notes
712
+
713
+ Apply? (Y/n)
714
+ ```
715
+
716
+ ## `lean-spec isolate` - Extract to New Spec
717
+
718
+ ### Purpose
719
+ Move unrelated concern to separate spec.
720
+
721
+ ### Usage
722
+ ```bash
723
+ lean-spec isolate <spec> [options]
724
+
725
+ Options:
726
+ --section=<name> Section to isolate
727
+ --new-spec=<name> Name for new spec
728
+ --interactive Interactive section selection
729
+ --keep-reference Add cross-reference in original
730
+ ```
731
+
732
+ ### Examples
733
+
734
+ **Isolate section**:
735
+ ```bash
736
+ $ lean-spec isolate 045 --section="Velocity Algorithm" --new-spec=velocity-algorithm
737
+
738
+ 🔍 Analyzing section "Velocity Algorithm"...
739
+ ✓ Can be isolated (minimal dependencies)
740
+
741
+ Isolation Plan:
742
+
743
+ Create new spec:
744
+ 060-velocity-algorithm/README.md (142 lines)
745
+ - Extract "Velocity Algorithm" section
746
+ - Add context from parent spec
747
+ - Update frontmatter (tags, related)
748
+
749
+ Update original spec:
750
+ 045-unified-dashboard/README.md
751
+ - Remove "Velocity Algorithm" section (-142 lines)
752
+ - Add reference: "See [spec 060](../060-velocity-algorithm/)"
753
+ - Update line count: 1,166 → 1,024 lines
754
+
755
+ Cross-references:
756
+ ✓ Update 3 internal links
757
+ ✓ Add bidirectional relationship (related field)
758
+
759
+ Apply isolation? (Y/n)
760
+ ```
761
+
762
+ **Interactive mode**:
763
+ ```bash
764
+ $ lean-spec isolate 045 --interactive
765
+
766
+ Select sections to isolate:
767
+ [ ] 1. Overview
768
+ [ ] 2. Background
769
+ [ ] 3. Design
770
+ [x] 4. Velocity Algorithm
771
+ [ ] 5. Health Scoring
772
+ [x] 6. Chart Library Evaluation
773
+ [ ] 7. Implementation
774
+ [ ] 8. Testing
775
+
776
+ Selected: Velocity Algorithm, Chart Library Evaluation
777
+
778
+ These sections can be isolated together (related concerns).
779
+
780
+ Create new spec:
781
+ 1. Single spec for both sections
782
+ 2. Two separate specs
783
+
784
+ Selection: 2 █
785
+
786
+ New spec names:
787
+ 1. 060-velocity-algorithm
788
+ 2. 061-chart-library-eval
789
+
790
+ Proceed? (Y/n)
791
+ ```
792
+
793
+ ## Utility Commands
794
+
795
+ ### `lean-spec diff` - Show Transformation Diff
796
+
797
+ ```bash
798
+ $ lean-spec diff 045 --before-after
799
+
800
+ Comparing before/after split:
801
+
802
+ Before:
803
+ 045-unified-dashboard/README.md (4,800 tokens / 1,166 lines)
804
+
805
+ After:
806
+ 045-unified-dashboard/
807
+ ├── README.md (812 tokens / 203 lines)
808
+ ├── DESIGN.md (1,512 tokens / 378 lines)
809
+ └── TESTING.md (728 tokens / 182 lines)
810
+
811
+ Total: 3,052 tokens / 763 lines
812
+ Savings: 1,748 tokens / 403 lines (via compaction)
813
+ ```
814
+
815
+ ### `lean-spec preview` - Preview Transformation
816
+
817
+ ```bash
818
+ $ lean-spec preview 045 \
819
+ --split=README.md:1-150,DESIGN.md:151-528
820
+
821
+ Preview:
822
+ Would create 2 files from spec 045
823
+ README.md: 812 tokens / 150 lines
824
+ DESIGN.md: 1,512 tokens / 378 lines
825
+
826
+ Use --apply to execute transformation
827
+ ```
828
+
829
+ ### `lean-spec rollback` - Undo Transformation
830
+
831
+ ```bash
832
+ $ lean-spec rollback 045
833
+
834
+ Found git history:
835
+ 1. Split into sub-specs (2 hours ago) - commit abc123
836
+ 2. Compact README.md (5 hours ago) - commit def456
837
+
838
+ Select rollback point: 1
839
+
840
+ ✓ Git reset to commit xyz789
841
+ ✓ Spec 045 restored to pre-split state
842
+ ```
843
+
844
+ ## AI Agent Usage Patterns
845
+
846
+ ### Pattern 1: Detect and Split Oversized Spec
847
+
848
+ ```typescript
849
+ // AI agent detects large spec during review
850
+ const analysis = await exec('lean-spec analyze 045 --json');
851
+ const data = JSON.parse(analysis);
852
+
853
+ if (data.metrics.tokens > 3500) {
854
+ // AI analyzes structure and decides split points
855
+ const h2Sections = data.structure.filter(s => s.level === 2);
856
+
857
+ // Group related sections
858
+ const groups = [
859
+ { file: 'README.md', sections: h2Sections.slice(0, 2) },
860
+ { file: 'DESIGN.md', sections: h2Sections.slice(2, 5) },
861
+ { file: 'TESTING.md', sections: h2Sections.slice(5) }
862
+ ];
863
+
864
+ // Build command
865
+ const outputs = groups.map(g => {
866
+ const start = g.sections[0].lineRange[0];
867
+ const end = g.sections[g.sections.length - 1].lineRange[1];
868
+ return `--output=${g.file}:${start}-${end}`;
869
+ });
870
+
871
+ // Execute split
872
+ await exec(`lean-spec split 045 ${outputs.join(' ')} --update-refs`);
873
+
874
+ // Verify
875
+ const newTokens = await exec('lean-spec tokens 045/*');
876
+ // Confirm all files under 2,000 tokens
877
+ }
878
+ ```
879
+
880
+ ### Pattern 2: Detect and Remove Redundancy
881
+
882
+ ```typescript
883
+ // AI agent reads spec and detects duplicate content
884
+ const content = await readFile('specs/045-unified-dashboard/README.md');
885
+ const lines = content.split('\n');
886
+
887
+ // AI identifies duplicate sections by semantic similarity
888
+ const duplicates = [
889
+ { original: [145, 153], duplicate: [289, 297] },
890
+ { original: [201, 215], duplicate: [423, 437] }
891
+ ];
892
+
893
+ // Remove duplicates (keep original, remove duplicate)
894
+ const removes = duplicates
895
+ .map(d => `--remove=${d.duplicate[0]}-${d.duplicate[1]}`)
896
+ .join(' ');
897
+
898
+ await exec(`lean-spec compact 045 ${removes}`);
899
+ ```
900
+
901
+ ### Pattern 3: Compress Completed Phases
902
+
903
+ ```typescript
904
+ // AI agent detects completed phase in implementation spec
905
+ const content = await readFile('specs/043-official-launch-02/README.md');
906
+ const analysis = await exec('lean-spec analyze 043 --json');
907
+
908
+ // AI reads phase 1 section (lines 142-284)
909
+ const phase1Content = lines.slice(141, 284).join('\n');
910
+
911
+ // AI generates summary
912
+ const summary = `## ✅ Phase 1: Foundation (Completed 2025-11-05)
913
+
914
+ Established first principles through comprehensive analysis.
915
+ Key deliverable: specs/049-leanspec-first-principles/`;
916
+
917
+ // Execute compression
918
+ await exec(`lean-spec compress 043 --replace='142-284:${summary}'`);
919
+ ```
920
+
921
+ ### Pattern 4: Isolate Independent Concern
922
+
923
+ ```typescript
924
+ // AI agent identifies section that should be separate spec
925
+ const analysis = await exec('lean-spec analyze 045 --json');
926
+
927
+ // AI finds "Velocity Algorithm" section is self-contained
928
+ const velocitySection = analysis.structure.find(
929
+ s => s.section === 'Velocity Algorithm'
930
+ );
931
+
932
+ // Check dependencies (AI reads content and determines it's independent)
933
+ const hasExternalDeps = false; // AI determined this
934
+
935
+ if (!hasExternalDeps) {
936
+ // Execute isolation
937
+ await exec(`lean-spec isolate 045 \
938
+ --lines=${velocitySection.lineRange.join('-')} \
939
+ --to=060-velocity-algorithm \
940
+ --add-reference`);
941
+ }
942
+ ```
943
+
944
+ ### Pattern 5: Full Transformation Pipeline
945
+
946
+ ```typescript
947
+ // AI agent performs complete spec optimization
948
+ async function optimizeSpec(specId: string) {
949
+ // 1. Analyze
950
+ const analysis = JSON.parse(
951
+ await exec(`lean-spec analyze ${specId} --json`)
952
+ );
953
+
954
+ // 2. Decide strategy based on metrics
955
+ if (analysis.metrics.tokens > 5000) {
956
+ // Critical: Must split immediately
957
+ await splitSpec(specId, analysis);
958
+ } else if (analysis.metrics.tokens > 3500) {
959
+ // Try compaction first, then split if still too large
960
+ await compactSpec(specId, analysis);
961
+
962
+ const recheck = JSON.parse(
963
+ await exec(`lean-spec analyze ${specId} --json`)
964
+ );
965
+
966
+ if (recheck.metrics.tokens > 3500) {
967
+ await splitSpec(specId, recheck);
968
+ }
969
+ }
970
+
971
+ // 3. Verify all files are healthy
972
+ const finalCheck = await exec(`lean-spec validate ${specId}`);
973
+ return finalCheck;
974
+ }
975
+ ```
976
+
977
+ ## Global Options
978
+
979
+ Available for all commands:
980
+
981
+ ```bash
982
+ --json JSON output (default for AI agents)
983
+ --dry-run Simulate without making changes
984
+ --force Skip confirmations (use with caution)
985
+ --verbose, -v Show detailed output (for human review)
986
+ --quiet, -q Minimal output
987
+ --help, -h Show command help
988
+ ```
989
+
990
+ ## Exit Codes
991
+
992
+ ```
993
+ 0 Success
994
+ 1 General error
995
+ 2 Invalid arguments
996
+ 3 Validation failed
997
+ 4 File operation failed
998
+ ```
999
+
1000
+ ---
1001
+
1002
+ **Key Takeaway**: These tools are building blocks for AI agents. The agent provides the intelligence (what to split, where to split, what to remove), tools provide reliable execution.