@ginkoai/cli 1.0.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 +230 -0
- package/dist/adapters/ai-adapter.d.ts +25 -0
- package/dist/adapters/ai-adapter.d.ts.map +1 -0
- package/dist/adapters/ai-adapter.js +21 -0
- package/dist/adapters/ai-adapter.js.map +1 -0
- package/dist/adapters/ai-completion.d.ts +35 -0
- package/dist/adapters/ai-completion.d.ts.map +1 -0
- package/dist/adapters/ai-completion.js +118 -0
- package/dist/adapters/ai-completion.js.map +1 -0
- package/dist/adapters/base.d.ts +64 -0
- package/dist/adapters/base.d.ts.map +1 -0
- package/dist/adapters/base.js +48 -0
- package/dist/adapters/base.js.map +1 -0
- package/dist/adapters/claude-adapter.d.ts +18 -0
- package/dist/adapters/claude-adapter.d.ts.map +1 -0
- package/dist/adapters/claude-adapter.js +73 -0
- package/dist/adapters/claude-adapter.js.map +1 -0
- package/dist/adapters/claude.d.ts +20 -0
- package/dist/adapters/claude.d.ts.map +1 -0
- package/dist/adapters/claude.js +91 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/copilot-adapter.d.ts +16 -0
- package/dist/adapters/copilot-adapter.d.ts.map +1 -0
- package/dist/adapters/copilot-adapter.js +288 -0
- package/dist/adapters/copilot-adapter.js.map +1 -0
- package/dist/adapters/cursor-adapter.d.ts +22 -0
- package/dist/adapters/cursor-adapter.d.ts.map +1 -0
- package/dist/adapters/cursor-adapter.js +108 -0
- package/dist/adapters/cursor-adapter.js.map +1 -0
- package/dist/adapters/detector.d.ts +29 -0
- package/dist/adapters/detector.d.ts.map +1 -0
- package/dist/adapters/detector.js +132 -0
- package/dist/adapters/detector.js.map +1 -0
- package/dist/adapters/generic-adapter.d.ts +18 -0
- package/dist/adapters/generic-adapter.d.ts.map +1 -0
- package/dist/adapters/generic-adapter.js +37 -0
- package/dist/adapters/generic-adapter.js.map +1 -0
- package/dist/adapters/gpt4.d.ts +20 -0
- package/dist/adapters/gpt4.d.ts.map +1 -0
- package/dist/adapters/gpt4.js +114 -0
- package/dist/adapters/gpt4.js.map +1 -0
- package/dist/adapters/grok-adapter.d.ts +18 -0
- package/dist/adapters/grok-adapter.d.ts.map +1 -0
- package/dist/adapters/grok-adapter.js +94 -0
- package/dist/adapters/grok-adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +18 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +71 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/openai-adapter.d.ts +18 -0
- package/dist/adapters/openai-adapter.d.ts.map +1 -0
- package/dist/adapters/openai-adapter.js +97 -0
- package/dist/adapters/openai-adapter.js.map +1 -0
- package/dist/adapters/universal.d.ts +20 -0
- package/dist/adapters/universal.d.ts.map +1 -0
- package/dist/adapters/universal.js +80 -0
- package/dist/adapters/universal.js.map +1 -0
- package/dist/analysis/deep-analyzer.d.ts +61 -0
- package/dist/analysis/deep-analyzer.d.ts.map +1 -0
- package/dist/analysis/deep-analyzer.js +349 -0
- package/dist/analysis/deep-analyzer.js.map +1 -0
- package/dist/analysis/project-analyzer.d.ts +25 -0
- package/dist/analysis/project-analyzer.d.ts.map +1 -0
- package/dist/analysis/project-analyzer.js +244 -0
- package/dist/analysis/project-analyzer.js.map +1 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.d.ts +82 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.js +649 -0
- package/dist/commands/architecture/architecture-pipeline-enhanced.js.map +1 -0
- package/dist/commands/architecture/architecture-pipeline.d.ts +105 -0
- package/dist/commands/architecture/architecture-pipeline.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-pipeline.js +510 -0
- package/dist/commands/architecture/architecture-pipeline.js.map +1 -0
- package/dist/commands/architecture/architecture-reflection.d.ts +67 -0
- package/dist/commands/architecture/architecture-reflection.d.ts.map +1 -0
- package/dist/commands/architecture/architecture-reflection.js +508 -0
- package/dist/commands/architecture/architecture-reflection.js.map +1 -0
- package/dist/commands/architecture/index.d.ts +21 -0
- package/dist/commands/architecture/index.d.ts.map +1 -0
- package/dist/commands/architecture/index.js +41 -0
- package/dist/commands/architecture/index.js.map +1 -0
- package/dist/commands/architecture.d.ts +20 -0
- package/dist/commands/architecture.d.ts.map +1 -0
- package/dist/commands/architecture.js +223 -0
- package/dist/commands/architecture.js.map +1 -0
- package/dist/commands/backlog/ai-enhanced.d.ts +83 -0
- package/dist/commands/backlog/ai-enhanced.d.ts.map +1 -0
- package/dist/commands/backlog/ai-enhanced.js +462 -0
- package/dist/commands/backlog/ai-enhanced.js.map +1 -0
- package/dist/commands/backlog/ai-prompt.d.ts +21 -0
- package/dist/commands/backlog/ai-prompt.d.ts.map +1 -0
- package/dist/commands/backlog/ai-prompt.js +373 -0
- package/dist/commands/backlog/ai-prompt.js.map +1 -0
- package/dist/commands/backlog/ai-template.d.ts +21 -0
- package/dist/commands/backlog/ai-template.d.ts.map +1 -0
- package/dist/commands/backlog/ai-template.js +374 -0
- package/dist/commands/backlog/ai-template.js.map +1 -0
- package/dist/commands/backlog/ai.d.ts +21 -0
- package/dist/commands/backlog/ai.d.ts.map +1 -0
- package/dist/commands/backlog/ai.js +76 -0
- package/dist/commands/backlog/ai.js.map +1 -0
- package/dist/commands/backlog/backlog-pipeline.d.ts +103 -0
- package/dist/commands/backlog/backlog-pipeline.d.ts.map +1 -0
- package/dist/commands/backlog/backlog-pipeline.js +538 -0
- package/dist/commands/backlog/backlog-pipeline.js.map +1 -0
- package/dist/commands/backlog/backlog-reflection.d.ts +48 -0
- package/dist/commands/backlog/backlog-reflection.d.ts.map +1 -0
- package/dist/commands/backlog/backlog-reflection.js +231 -0
- package/dist/commands/backlog/backlog-reflection.js.map +1 -0
- package/dist/commands/backlog/base.d.ts +95 -0
- package/dist/commands/backlog/base.d.ts.map +1 -0
- package/dist/commands/backlog/base.js +291 -0
- package/dist/commands/backlog/base.js.map +1 -0
- package/dist/commands/backlog/complete.d.ts +20 -0
- package/dist/commands/backlog/complete.d.ts.map +1 -0
- package/dist/commands/backlog/complete.js +83 -0
- package/dist/commands/backlog/complete.js.map +1 -0
- package/dist/commands/backlog/context-gatherer.d.ts +76 -0
- package/dist/commands/backlog/context-gatherer.d.ts.map +1 -0
- package/dist/commands/backlog/context-gatherer.js +216 -0
- package/dist/commands/backlog/context-gatherer.js.map +1 -0
- package/dist/commands/backlog/create.d.ts +25 -0
- package/dist/commands/backlog/create.d.ts.map +1 -0
- package/dist/commands/backlog/create.js +131 -0
- package/dist/commands/backlog/create.js.map +1 -0
- package/dist/commands/backlog/index.d.ts +17 -0
- package/dist/commands/backlog/index.d.ts.map +1 -0
- package/dist/commands/backlog/index.js +177 -0
- package/dist/commands/backlog/index.js.map +1 -0
- package/dist/commands/backlog/list.d.ts +25 -0
- package/dist/commands/backlog/list.d.ts.map +1 -0
- package/dist/commands/backlog/list.js +136 -0
- package/dist/commands/backlog/list.js.map +1 -0
- package/dist/commands/backlog/quick-query.d.ts +16 -0
- package/dist/commands/backlog/quick-query.d.ts.map +1 -0
- package/dist/commands/backlog/quick-query.js +126 -0
- package/dist/commands/backlog/quick-query.js.map +1 -0
- package/dist/commands/backlog/show.d.ts +20 -0
- package/dist/commands/backlog/show.d.ts.map +1 -0
- package/dist/commands/backlog/show.js +95 -0
- package/dist/commands/backlog/show.js.map +1 -0
- package/dist/commands/backlog/update.d.ts +25 -0
- package/dist/commands/backlog/update.d.ts.map +1 -0
- package/dist/commands/backlog/update.js +113 -0
- package/dist/commands/backlog/update.js.map +1 -0
- package/dist/commands/bug/bug-context-gatherer.d.ts +58 -0
- package/dist/commands/bug/bug-context-gatherer.d.ts.map +1 -0
- package/dist/commands/bug/bug-context-gatherer.js +228 -0
- package/dist/commands/bug/bug-context-gatherer.js.map +1 -0
- package/dist/commands/bug/bug-reflection.d.ts +70 -0
- package/dist/commands/bug/bug-reflection.d.ts.map +1 -0
- package/dist/commands/bug/bug-reflection.js +343 -0
- package/dist/commands/bug/bug-reflection.js.map +1 -0
- package/dist/commands/capture/capture-reflection.d.ts +139 -0
- package/dist/commands/capture/capture-reflection.d.ts.map +1 -0
- package/dist/commands/capture/capture-reflection.js +583 -0
- package/dist/commands/capture/capture-reflection.js.map +1 -0
- package/dist/commands/capture.d.ts +22 -0
- package/dist/commands/capture.d.ts.map +1 -0
- package/dist/commands/capture.js +301 -0
- package/dist/commands/capture.js.map +1 -0
- package/dist/commands/changelog/changelog-reflection.d.ts +65 -0
- package/dist/commands/changelog/changelog-reflection.d.ts.map +1 -0
- package/dist/commands/changelog/changelog-reflection.js +252 -0
- package/dist/commands/changelog/changelog-reflection.js.map +1 -0
- package/dist/commands/compact.d.ts +15 -0
- package/dist/commands/compact.d.ts.map +1 -0
- package/dist/commands/compact.js +113 -0
- package/dist/commands/compact.js.map +1 -0
- package/dist/commands/config.d.ts +10 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +85 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/context-new.d.ts +18 -0
- package/dist/commands/context-new.d.ts.map +1 -0
- package/dist/commands/context-new.js +265 -0
- package/dist/commands/context-new.js.map +1 -0
- package/dist/commands/context.d.ts +16 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +82 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/documentation/documentation-pipeline.d.ts +130 -0
- package/dist/commands/documentation/documentation-pipeline.d.ts.map +1 -0
- package/dist/commands/documentation/documentation-pipeline.js +716 -0
- package/dist/commands/documentation/documentation-pipeline.js.map +1 -0
- package/dist/commands/documentation/documentation-reflection.d.ts +54 -0
- package/dist/commands/documentation/documentation-reflection.d.ts.map +1 -0
- package/dist/commands/documentation/documentation-reflection.js +338 -0
- package/dist/commands/documentation/documentation-reflection.js.map +1 -0
- package/dist/commands/explore/explore-reflection-pipeline.d.ts +117 -0
- package/dist/commands/explore/explore-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/explore/explore-reflection-pipeline.js +503 -0
- package/dist/commands/explore/explore-reflection-pipeline.js.map +1 -0
- package/dist/commands/explore/index.d.ts +29 -0
- package/dist/commands/explore/index.d.ts.map +1 -0
- package/dist/commands/explore/index.js +30 -0
- package/dist/commands/explore/index.js.map +1 -0
- package/dist/commands/explore.d.ts +20 -0
- package/dist/commands/explore.d.ts.map +1 -0
- package/dist/commands/explore.js +224 -0
- package/dist/commands/explore.js.map +1 -0
- package/dist/commands/git/git-context-gatherer.d.ts +101 -0
- package/dist/commands/git/git-context-gatherer.d.ts.map +1 -0
- package/dist/commands/git/git-context-gatherer.js +284 -0
- package/dist/commands/git/git-context-gatherer.js.map +1 -0
- package/dist/commands/git/git-pipeline.d.ts +75 -0
- package/dist/commands/git/git-pipeline.d.ts.map +1 -0
- package/dist/commands/git/git-pipeline.js +530 -0
- package/dist/commands/git/git-pipeline.js.map +1 -0
- package/dist/commands/git/git-reflection.d.ts +50 -0
- package/dist/commands/git/git-reflection.d.ts.map +1 -0
- package/dist/commands/git/git-reflection.js +193 -0
- package/dist/commands/git/git-reflection.js.map +1 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts +106 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.js +534 -0
- package/dist/commands/handoff/handoff-reflection-pipeline.js.map +1 -0
- package/dist/commands/handoff/handoff-save.d.ts +16 -0
- package/dist/commands/handoff/handoff-save.d.ts.map +1 -0
- package/dist/commands/handoff/handoff-save.js +72 -0
- package/dist/commands/handoff/handoff-save.js.map +1 -0
- package/dist/commands/handoff/index.d.ts +19 -0
- package/dist/commands/handoff/index.d.ts.map +1 -0
- package/dist/commands/handoff/index.js +55 -0
- package/dist/commands/handoff/index.js.map +1 -0
- package/dist/commands/handoff-ai-orig.d.ts +27 -0
- package/dist/commands/handoff-ai-orig.d.ts.map +1 -0
- package/dist/commands/handoff-ai-orig.js +405 -0
- package/dist/commands/handoff-ai-orig.js.map +1 -0
- package/dist/commands/handoff-ai.d.ts +27 -0
- package/dist/commands/handoff-ai.d.ts.map +1 -0
- package/dist/commands/handoff-ai.js +405 -0
- package/dist/commands/handoff-ai.js.map +1 -0
- package/dist/commands/handoff-enhanced-orig.d.ts +25 -0
- package/dist/commands/handoff-enhanced-orig.d.ts.map +1 -0
- package/dist/commands/handoff-enhanced-orig.js +349 -0
- package/dist/commands/handoff-enhanced-orig.js.map +1 -0
- package/dist/commands/handoff-enhanced.d.ts +25 -0
- package/dist/commands/handoff-enhanced.d.ts.map +1 -0
- package/dist/commands/handoff-enhanced.js +349 -0
- package/dist/commands/handoff-enhanced.js.map +1 -0
- package/dist/commands/handoff-orig.d.ts +10 -0
- package/dist/commands/handoff-orig.d.ts.map +1 -0
- package/dist/commands/handoff-orig.js +167 -0
- package/dist/commands/handoff-orig.js.map +1 -0
- package/dist/commands/handoff.d.ts +10 -0
- package/dist/commands/handoff.d.ts.map +1 -0
- package/dist/commands/handoff.js +167 -0
- package/dist/commands/handoff.js.map +1 -0
- package/dist/commands/init-copilot.d.ts +6 -0
- package/dist/commands/init-copilot.d.ts.map +1 -0
- package/dist/commands/init-copilot.js +151 -0
- package/dist/commands/init-copilot.js.map +1 -0
- package/dist/commands/init-cursor.d.ts +5 -0
- package/dist/commands/init-cursor.d.ts.map +1 -0
- package/dist/commands/init-cursor.js +95 -0
- package/dist/commands/init-cursor.js.map +1 -0
- package/dist/commands/init-enhanced.d.ts +20 -0
- package/dist/commands/init-enhanced.d.ts.map +1 -0
- package/dist/commands/init-enhanced.js +430 -0
- package/dist/commands/init-enhanced.js.map +1 -0
- package/dist/commands/init.d.ts +16 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +213 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/magic-prompt.d.ts +20 -0
- package/dist/commands/magic-prompt.d.ts.map +1 -0
- package/dist/commands/magic-prompt.js +166 -0
- package/dist/commands/magic-prompt.js.map +1 -0
- package/dist/commands/magic-simple.d.ts +20 -0
- package/dist/commands/magic-simple.d.ts.map +1 -0
- package/dist/commands/magic-simple.js +32 -0
- package/dist/commands/magic-simple.js.map +1 -0
- package/dist/commands/magic.d.ts +20 -0
- package/dist/commands/magic.d.ts.map +1 -0
- package/dist/commands/magic.js +144 -0
- package/dist/commands/magic.js.map +1 -0
- package/dist/commands/plan/plan-reflection-pipeline.d.ts +126 -0
- package/dist/commands/plan/plan-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/plan/plan-reflection-pipeline.js +554 -0
- package/dist/commands/plan/plan-reflection-pipeline.js.map +1 -0
- package/dist/commands/plan.d.ts +20 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +253 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/prd/index.d.ts +21 -0
- package/dist/commands/prd/index.d.ts.map +1 -0
- package/dist/commands/prd/index.js +41 -0
- package/dist/commands/prd/index.js.map +1 -0
- package/dist/commands/prd/prd-pipeline-enhanced.d.ts +82 -0
- package/dist/commands/prd/prd-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/prd/prd-pipeline-enhanced.js +565 -0
- package/dist/commands/prd/prd-pipeline-enhanced.js.map +1 -0
- package/dist/commands/prd/prd-pipeline.d.ts +106 -0
- package/dist/commands/prd/prd-pipeline.d.ts.map +1 -0
- package/dist/commands/prd/prd-pipeline.js +491 -0
- package/dist/commands/prd/prd-pipeline.js.map +1 -0
- package/dist/commands/prd/prd-reflection-enhanced.d.ts +63 -0
- package/dist/commands/prd/prd-reflection-enhanced.d.ts.map +1 -0
- package/dist/commands/prd/prd-reflection-enhanced.js +310 -0
- package/dist/commands/prd/prd-reflection-enhanced.js.map +1 -0
- package/dist/commands/prd/prd-reflection.d.ts +59 -0
- package/dist/commands/prd/prd-reflection.d.ts.map +1 -0
- package/dist/commands/prd/prd-reflection.js +548 -0
- package/dist/commands/prd/prd-reflection.js.map +1 -0
- package/dist/commands/reflect.d.ts +24 -0
- package/dist/commands/reflect.d.ts.map +1 -0
- package/dist/commands/reflect.js +135 -0
- package/dist/commands/reflect.js.map +1 -0
- package/dist/commands/ship/ship-reflection.d.ts +164 -0
- package/dist/commands/ship/ship-reflection.d.ts.map +1 -0
- package/dist/commands/ship/ship-reflection.js +732 -0
- package/dist/commands/ship/ship-reflection.js.map +1 -0
- package/dist/commands/ship-ai.d.ts +28 -0
- package/dist/commands/ship-ai.d.ts.map +1 -0
- package/dist/commands/ship-ai.js +318 -0
- package/dist/commands/ship-ai.js.map +1 -0
- package/dist/commands/ship.d.ts +17 -0
- package/dist/commands/ship.d.ts.map +1 -0
- package/dist/commands/ship.js +175 -0
- package/dist/commands/ship.js.map +1 -0
- package/dist/commands/sprint/index.d.ts +21 -0
- package/dist/commands/sprint/index.d.ts.map +1 -0
- package/dist/commands/sprint/index.js +39 -0
- package/dist/commands/sprint/index.js.map +1 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.d.ts +142 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.js +822 -0
- package/dist/commands/sprint/sprint-pipeline-enhanced.js.map +1 -0
- package/dist/commands/sprint/sprint-pipeline.d.ts +72 -0
- package/dist/commands/sprint/sprint-pipeline.d.ts.map +1 -0
- package/dist/commands/sprint/sprint-pipeline.js +363 -0
- package/dist/commands/sprint/sprint-pipeline.js.map +1 -0
- package/dist/commands/start/index.d.ts +19 -0
- package/dist/commands/start/index.d.ts.map +1 -0
- package/dist/commands/start/index.js +41 -0
- package/dist/commands/start/index.js.map +1 -0
- package/dist/commands/start/start-reflection-pipeline.d.ts +99 -0
- package/dist/commands/start/start-reflection-pipeline.d.ts.map +1 -0
- package/dist/commands/start/start-reflection-pipeline.js +458 -0
- package/dist/commands/start/start-reflection-pipeline.js.map +1 -0
- package/dist/commands/start/start-reflection.d.ts +89 -0
- package/dist/commands/start/start-reflection.d.ts.map +1 -0
- package/dist/commands/start/start-reflection.js +572 -0
- package/dist/commands/start/start-reflection.js.map +1 -0
- package/dist/commands/start/start-with-synthesis.d.ts +20 -0
- package/dist/commands/start/start-with-synthesis.d.ts.map +1 -0
- package/dist/commands/start/start-with-synthesis.js +134 -0
- package/dist/commands/start/start-with-synthesis.js.map +1 -0
- package/dist/commands/start-enhanced-orig.d.ts +19 -0
- package/dist/commands/start-enhanced-orig.d.ts.map +1 -0
- package/dist/commands/start-enhanced-orig.js +434 -0
- package/dist/commands/start-enhanced-orig.js.map +1 -0
- package/dist/commands/start-enhanced.d.ts +19 -0
- package/dist/commands/start-enhanced.d.ts.map +1 -0
- package/dist/commands/start-enhanced.js +434 -0
- package/dist/commands/start-enhanced.js.map +1 -0
- package/dist/commands/start-orig.d.ts +10 -0
- package/dist/commands/start-orig.d.ts.map +1 -0
- package/dist/commands/start-orig.js +119 -0
- package/dist/commands/start-orig.js.map +1 -0
- package/dist/commands/start.d.ts +10 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +119 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +11 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +119 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/testing/index.d.ts +21 -0
- package/dist/commands/testing/index.d.ts.map +1 -0
- package/dist/commands/testing/index.js +41 -0
- package/dist/commands/testing/index.js.map +1 -0
- package/dist/commands/testing/testing-pipeline-enhanced.d.ts +94 -0
- package/dist/commands/testing/testing-pipeline-enhanced.d.ts.map +1 -0
- package/dist/commands/testing/testing-pipeline-enhanced.js +760 -0
- package/dist/commands/testing/testing-pipeline-enhanced.js.map +1 -0
- package/dist/commands/testing/testing-pipeline.d.ts +77 -0
- package/dist/commands/testing/testing-pipeline.d.ts.map +1 -0
- package/dist/commands/testing/testing-pipeline.js +479 -0
- package/dist/commands/testing/testing-pipeline.js.map +1 -0
- package/dist/commands/uninstall-copilot.d.ts +5 -0
- package/dist/commands/uninstall-copilot.d.ts.map +1 -0
- package/dist/commands/uninstall-copilot.js +143 -0
- package/dist/commands/uninstall-copilot.js.map +1 -0
- package/dist/commands/uninstall-cursor.d.ts +6 -0
- package/dist/commands/uninstall-cursor.d.ts.map +1 -0
- package/dist/commands/uninstall-cursor.js +124 -0
- package/dist/commands/uninstall-cursor.js.map +1 -0
- package/dist/commands/vibecheck-ai.d.ts +25 -0
- package/dist/commands/vibecheck-ai.d.ts.map +1 -0
- package/dist/commands/vibecheck-ai.js +260 -0
- package/dist/commands/vibecheck-ai.js.map +1 -0
- package/dist/commands/vibecheck-aware.d.ts +19 -0
- package/dist/commands/vibecheck-aware.d.ts.map +1 -0
- package/dist/commands/vibecheck-aware.js +350 -0
- package/dist/commands/vibecheck-aware.js.map +1 -0
- package/dist/commands/vibecheck-final.d.ts +22 -0
- package/dist/commands/vibecheck-final.d.ts.map +1 -0
- package/dist/commands/vibecheck-final.js +132 -0
- package/dist/commands/vibecheck-final.js.map +1 -0
- package/dist/commands/vibecheck-natural.d.ts +18 -0
- package/dist/commands/vibecheck-natural.d.ts.map +1 -0
- package/dist/commands/vibecheck-natural.js +105 -0
- package/dist/commands/vibecheck-natural.js.map +1 -0
- package/dist/commands/vibecheck-simple.d.ts +20 -0
- package/dist/commands/vibecheck-simple.d.ts.map +1 -0
- package/dist/commands/vibecheck-simple.js +136 -0
- package/dist/commands/vibecheck-simple.js.map +1 -0
- package/dist/commands/vibecheck.d.ts +10 -0
- package/dist/commands/vibecheck.d.ts.map +1 -0
- package/dist/commands/vibecheck.js +95 -0
- package/dist/commands/vibecheck.js.map +1 -0
- package/dist/core/adapters/path-adapter.d.ts +144 -0
- package/dist/core/adapters/path-adapter.d.ts.map +1 -0
- package/dist/core/adapters/path-adapter.js +245 -0
- package/dist/core/adapters/path-adapter.js.map +1 -0
- package/dist/core/command-shortcuts.d.ts +62 -0
- package/dist/core/command-shortcuts.d.ts.map +1 -0
- package/dist/core/command-shortcuts.js +124 -0
- package/dist/core/command-shortcuts.js.map +1 -0
- package/dist/core/config/config-aware-reflection.d.ts +37 -0
- package/dist/core/config/config-aware-reflection.d.ts.map +1 -0
- package/dist/core/config/config-aware-reflection.js +97 -0
- package/dist/core/config/config-aware-reflection.js.map +1 -0
- package/dist/core/config/config-loader.d.ts +154 -0
- package/dist/core/config/config-loader.d.ts.map +1 -0
- package/dist/core/config/config-loader.js +424 -0
- package/dist/core/config/config-loader.js.map +1 -0
- package/dist/core/config/config-migrator.d.ts +150 -0
- package/dist/core/config/config-migrator.d.ts.map +1 -0
- package/dist/core/config/config-migrator.js +423 -0
- package/dist/core/config/config-migrator.js.map +1 -0
- package/dist/core/config/config-schema.d.ts +276 -0
- package/dist/core/config/config-schema.d.ts.map +1 -0
- package/dist/core/config/config-schema.js +277 -0
- package/dist/core/config/config-schema.js.map +1 -0
- package/dist/core/config/index.d.ts +260 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +283 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/config/interactive-config.d.ts +76 -0
- package/dist/core/config/interactive-config.d.ts.map +1 -0
- package/dist/core/config/interactive-config.js +315 -0
- package/dist/core/config/interactive-config.js.map +1 -0
- package/dist/core/config/path-config.d.ts +121 -0
- package/dist/core/config/path-config.d.ts.map +1 -0
- package/dist/core/config/path-config.js +210 -0
- package/dist/core/config/path-config.js.map +1 -0
- package/dist/core/config/path-resolver.d.ts +151 -0
- package/dist/core/config/path-resolver.d.ts.map +1 -0
- package/dist/core/config/path-resolver.js +343 -0
- package/dist/core/config/path-resolver.js.map +1 -0
- package/dist/core/config/project-detector.d.ts +58 -0
- package/dist/core/config/project-detector.d.ts.map +1 -0
- package/dist/core/config/project-detector.js +310 -0
- package/dist/core/config/project-detector.js.map +1 -0
- package/dist/core/config-backup/config-aware-reflection.d.ts +37 -0
- package/dist/core/config-backup/config-aware-reflection.d.ts.map +1 -0
- package/dist/core/config-backup/config-aware-reflection.js +97 -0
- package/dist/core/config-backup/config-aware-reflection.js.map +1 -0
- package/dist/core/config-backup/config-loader.d.ts +71 -0
- package/dist/core/config-backup/config-loader.d.ts.map +1 -0
- package/dist/core/config-backup/config-loader.js +288 -0
- package/dist/core/config-backup/config-loader.js.map +1 -0
- package/dist/core/config-backup/interactive-config.d.ts +76 -0
- package/dist/core/config-backup/interactive-config.d.ts.map +1 -0
- package/dist/core/config-backup/interactive-config.js +315 -0
- package/dist/core/config-backup/interactive-config.js.map +1 -0
- package/dist/core/config-backup/path-config.d.ts +121 -0
- package/dist/core/config-backup/path-config.d.ts.map +1 -0
- package/dist/core/config-backup/path-config.js +210 -0
- package/dist/core/config-backup/path-config.js.map +1 -0
- package/dist/core/config-backup/project-detector.d.ts +58 -0
- package/dist/core/config-backup/project-detector.d.ts.map +1 -0
- package/dist/core/config-backup/project-detector.js +310 -0
- package/dist/core/config-backup/project-detector.js.map +1 -0
- package/dist/core/documents/document-manager.d.ts +97 -0
- package/dist/core/documents/document-manager.d.ts.map +1 -0
- package/dist/core/documents/document-manager.js +441 -0
- package/dist/core/documents/document-manager.js.map +1 -0
- package/dist/core/documents/document-migrator.d.ts +138 -0
- package/dist/core/documents/document-migrator.d.ts.map +1 -0
- package/dist/core/documents/document-migrator.js +349 -0
- package/dist/core/documents/document-migrator.js.map +1 -0
- package/dist/core/documents/document-namer.d.ts +111 -0
- package/dist/core/documents/document-namer.d.ts.map +1 -0
- package/dist/core/documents/document-namer.js +225 -0
- package/dist/core/documents/document-namer.js.map +1 -0
- package/dist/core/documents/examples.d.ts +74 -0
- package/dist/core/documents/examples.d.ts.map +1 -0
- package/dist/core/documents/examples.js +273 -0
- package/dist/core/documents/examples.js.map +1 -0
- package/dist/core/documents/file-system.d.ts +93 -0
- package/dist/core/documents/file-system.d.ts.map +1 -0
- package/dist/core/documents/file-system.js +432 -0
- package/dist/core/documents/file-system.js.map +1 -0
- package/dist/core/documents/index.d.ts +97 -0
- package/dist/core/documents/index.d.ts.map +1 -0
- package/dist/core/documents/index.js +119 -0
- package/dist/core/documents/index.js.map +1 -0
- package/dist/core/documents/markdown-processor.d.ts +84 -0
- package/dist/core/documents/markdown-processor.d.ts.map +1 -0
- package/dist/core/documents/markdown-processor.js +302 -0
- package/dist/core/documents/markdown-processor.js.map +1 -0
- package/dist/core/documents/sequence-manager.d.ts +107 -0
- package/dist/core/documents/sequence-manager.d.ts.map +1 -0
- package/dist/core/documents/sequence-manager.js +246 -0
- package/dist/core/documents/sequence-manager.js.map +1 -0
- package/dist/core/documents/template-engine.d.ts +101 -0
- package/dist/core/documents/template-engine.d.ts.map +1 -0
- package/dist/core/documents/template-engine.js +440 -0
- package/dist/core/documents/template-engine.js.map +1 -0
- package/dist/core/handoff-quality.d.ts +164 -0
- package/dist/core/handoff-quality.d.ts.map +1 -0
- package/dist/core/handoff-quality.js +590 -0
- package/dist/core/handoff-quality.js.map +1 -0
- package/dist/core/platform/hook-adapter.d.ts +109 -0
- package/dist/core/platform/hook-adapter.d.ts.map +1 -0
- package/dist/core/platform/hook-adapter.js +527 -0
- package/dist/core/platform/hook-adapter.js.map +1 -0
- package/dist/core/platform/hook-migration.d.ts +73 -0
- package/dist/core/platform/hook-migration.d.ts.map +1 -0
- package/dist/core/platform/hook-migration.js +339 -0
- package/dist/core/platform/hook-migration.js.map +1 -0
- package/dist/core/platform/hook-migrator.d.ts +49 -0
- package/dist/core/platform/hook-migrator.d.ts.map +1 -0
- package/dist/core/platform/hook-migrator.js +305 -0
- package/dist/core/platform/hook-migrator.js.map +1 -0
- package/dist/core/platform/hook-templates.d.ts +60 -0
- package/dist/core/platform/hook-templates.d.ts.map +1 -0
- package/dist/core/platform/hook-templates.js +352 -0
- package/dist/core/platform/hook-templates.js.map +1 -0
- package/dist/core/platform/index.d.ts +82 -0
- package/dist/core/platform/index.d.ts.map +1 -0
- package/dist/core/platform/index.js +173 -0
- package/dist/core/platform/index.js.map +1 -0
- package/dist/core/platform/path-normalizer.d.ts +117 -0
- package/dist/core/platform/path-normalizer.d.ts.map +1 -0
- package/dist/core/platform/path-normalizer.js +333 -0
- package/dist/core/platform/path-normalizer.js.map +1 -0
- package/dist/core/platform/path-resolver.d.ts +120 -0
- package/dist/core/platform/path-resolver.d.ts.map +1 -0
- package/dist/core/platform/path-resolver.js +339 -0
- package/dist/core/platform/path-resolver.js.map +1 -0
- package/dist/core/platform/platform-adapter.d.ts +101 -0
- package/dist/core/platform/platform-adapter.d.ts.map +1 -0
- package/dist/core/platform/platform-adapter.js +243 -0
- package/dist/core/platform/platform-adapter.js.map +1 -0
- package/dist/core/platform/platform-detector.d.ts +122 -0
- package/dist/core/platform/platform-detector.d.ts.map +1 -0
- package/dist/core/platform/platform-detector.js +318 -0
- package/dist/core/platform/platform-detector.js.map +1 -0
- package/dist/core/platform/platform-templates.d.ts +62 -0
- package/dist/core/platform/platform-templates.d.ts.map +1 -0
- package/dist/core/platform/platform-templates.js +364 -0
- package/dist/core/platform/platform-templates.js.map +1 -0
- package/dist/core/platform/types.d.ts +54 -0
- package/dist/core/platform/types.d.ts.map +1 -0
- package/dist/core/platform/types.js +12 -0
- package/dist/core/platform/types.js.map +1 -0
- package/dist/core/polyglot-example.d.ts +115 -0
- package/dist/core/polyglot-example.d.ts.map +1 -0
- package/dist/core/polyglot-example.js +341 -0
- package/dist/core/polyglot-example.js.map +1 -0
- package/dist/core/pressure-monitor.d.ts +76 -0
- package/dist/core/pressure-monitor.d.ts.map +1 -0
- package/dist/core/pressure-monitor.js +156 -0
- package/dist/core/pressure-monitor.js.map +1 -0
- package/dist/core/reflection-pattern.d.ts +99 -0
- package/dist/core/reflection-pattern.d.ts.map +1 -0
- package/dist/core/reflection-pattern.js +294 -0
- package/dist/core/reflection-pattern.js.map +1 -0
- package/dist/core/session-log-manager.d.ts +83 -0
- package/dist/core/session-log-manager.d.ts.map +1 -0
- package/dist/core/session-log-manager.js +288 -0
- package/dist/core/session-log-manager.js.map +1 -0
- package/dist/core/simple-pipeline-base.d.ts +130 -0
- package/dist/core/simple-pipeline-base.d.ts.map +1 -0
- package/dist/core/simple-pipeline-base.js +240 -0
- package/dist/core/simple-pipeline-base.js.map +1 -0
- package/dist/core/simple-pipeline.d.ts +70 -0
- package/dist/core/simple-pipeline.d.ts.map +1 -0
- package/dist/core/simple-pipeline.js +241 -0
- package/dist/core/simple-pipeline.js.map +1 -0
- package/dist/core/utils/paths.d.ts +50 -0
- package/dist/core/utils/paths.d.ts.map +1 -0
- package/dist/core/utils/paths.js +75 -0
- package/dist/core/utils/paths.js.map +1 -0
- package/dist/core/validators/command-argument-validator.d.ts +102 -0
- package/dist/core/validators/command-argument-validator.d.ts.map +1 -0
- package/dist/core/validators/command-argument-validator.js +377 -0
- package/dist/core/validators/command-argument-validator.js.map +1 -0
- package/dist/core/validators/config-validator.d.ts +111 -0
- package/dist/core/validators/config-validator.d.ts.map +1 -0
- package/dist/core/validators/config-validator.js +433 -0
- package/dist/core/validators/config-validator.js.map +1 -0
- package/dist/core/validators/environment-validator.d.ts +138 -0
- package/dist/core/validators/environment-validator.d.ts.map +1 -0
- package/dist/core/validators/environment-validator.js +516 -0
- package/dist/core/validators/environment-validator.js.map +1 -0
- package/dist/core/validators/git-validator.d.ts +100 -0
- package/dist/core/validators/git-validator.d.ts.map +1 -0
- package/dist/core/validators/git-validator.js +288 -0
- package/dist/core/validators/git-validator.js.map +1 -0
- package/dist/core/validators/git-validator.test.d.ts +12 -0
- package/dist/core/validators/git-validator.test.d.ts.map +1 -0
- package/dist/core/validators/git-validator.test.js +40 -0
- package/dist/core/validators/git-validator.test.js.map +1 -0
- package/dist/core/validators/index.d.ts +90 -0
- package/dist/core/validators/index.d.ts.map +1 -0
- package/dist/core/validators/index.js +166 -0
- package/dist/core/validators/index.js.map +1 -0
- package/dist/core/validators/input-validator.d.ts +117 -0
- package/dist/core/validators/input-validator.d.ts.map +1 -0
- package/dist/core/validators/input-validator.js +368 -0
- package/dist/core/validators/input-validator.js.map +1 -0
- package/dist/core/validators/temp_index.d.ts +56 -0
- package/dist/core/validators/temp_index.d.ts.map +1 -0
- package/dist/core/validators/temp_index.js +94 -0
- package/dist/core/validators/temp_index.js.map +1 -0
- package/dist/core/validators/validation-error-handler.d.ts +107 -0
- package/dist/core/validators/validation-error-handler.d.ts.map +1 -0
- package/dist/core/validators/validation-error-handler.js +379 -0
- package/dist/core/validators/validation-error-handler.js.map +1 -0
- package/dist/core/validators/validation-orchestrator.d.ts +128 -0
- package/dist/core/validators/validation-orchestrator.d.ts.map +1 -0
- package/dist/core/validators/validation-orchestrator.js +301 -0
- package/dist/core/validators/validation-orchestrator.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +316 -0
- package/dist/index.js.map +1 -0
- package/dist/services/active-context-manager.d.ts +118 -0
- package/dist/services/active-context-manager.d.ts.map +1 -0
- package/dist/services/active-context-manager.js +435 -0
- package/dist/services/active-context-manager.js.map +1 -0
- package/dist/services/ai-service.d.ts +71 -0
- package/dist/services/ai-service.d.ts.map +1 -0
- package/dist/services/ai-service.js +329 -0
- package/dist/services/ai-service.js.map +1 -0
- package/dist/services/context-search.d.ts +98 -0
- package/dist/services/context-search.d.ts.map +1 -0
- package/dist/services/context-search.js +289 -0
- package/dist/services/context-search.js.map +1 -0
- package/dist/services/insight-extractor.d.ts +69 -0
- package/dist/services/insight-extractor.d.ts.map +1 -0
- package/dist/services/insight-extractor.js +343 -0
- package/dist/services/insight-extractor.js.map +1 -0
- package/dist/services/insight-quality-controller.d.ts +167 -0
- package/dist/services/insight-quality-controller.d.ts.map +1 -0
- package/dist/services/insight-quality-controller.js +543 -0
- package/dist/services/insight-quality-controller.js.map +1 -0
- package/dist/services/module-generator.d.ts +108 -0
- package/dist/services/module-generator.d.ts.map +1 -0
- package/dist/services/module-generator.js +561 -0
- package/dist/services/module-generator.js.map +1 -0
- package/dist/services/statusline-tracker.d.ts +139 -0
- package/dist/services/statusline-tracker.d.ts.map +1 -0
- package/dist/services/statusline-tracker.js +360 -0
- package/dist/services/statusline-tracker.js.map +1 -0
- package/dist/templates/ai-instructions-template.d.ts +39 -0
- package/dist/templates/ai-instructions-template.d.ts.map +1 -0
- package/dist/templates/ai-instructions-template.js +222 -0
- package/dist/templates/ai-instructions-template.js.map +1 -0
- package/dist/types/config.d.ts +128 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +49 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/documents.d.ts +87 -0
- package/dist/types/documents.d.ts.map +1 -0
- package/dist/types/documents.js +12 -0
- package/dist/types/documents.js.map +1 -0
- package/dist/types/session-log.d.ts +83 -0
- package/dist/types/session-log.d.ts.map +1 -0
- package/dist/types/session-log.js +12 -0
- package/dist/types/session-log.js.map +1 -0
- package/dist/types/session.d.ts +257 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +12 -0
- package/dist/types/session.js.map +1 -0
- package/dist/utils/ai-templates.d.ts +98 -0
- package/dist/utils/ai-templates.d.ts.map +1 -0
- package/dist/utils/ai-templates.js +179 -0
- package/dist/utils/ai-templates.js.map +1 -0
- package/dist/utils/ginko-root.d.ts +51 -0
- package/dist/utils/ginko-root.d.ts.map +1 -0
- package/dist/utils/ginko-root.js +96 -0
- package/dist/utils/ginko-root.js.map +1 -0
- package/dist/utils/helpers.d.ts +19 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +107 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/progressive-learning.d.ts +42 -0
- package/dist/utils/progressive-learning.d.ts.map +1 -0
- package/dist/utils/progressive-learning.js +248 -0
- package/dist/utils/progressive-learning.js.map +1 -0
- package/dist/utils/session-collector.d.ts +81 -0
- package/dist/utils/session-collector.d.ts.map +1 -0
- package/dist/utils/session-collector.js +387 -0
- package/dist/utils/session-collector.js.map +1 -0
- package/dist/utils/session-logger.d.ts +125 -0
- package/dist/utils/session-logger.d.ts.map +1 -0
- package/dist/utils/session-logger.js +359 -0
- package/dist/utils/session-logger.js.map +1 -0
- package/dist/utils/session-synthesizer.d.ts +36 -0
- package/dist/utils/session-synthesizer.d.ts.map +1 -0
- package/dist/utils/session-synthesizer.js +239 -0
- package/dist/utils/session-synthesizer.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: command
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-09-15
|
|
5
|
+
* @tags: [documentation, pipeline, builder, docs, readme]
|
|
6
|
+
* @related: [../../core/simple-pipeline-base.ts, ./documentation-reflection.ts]
|
|
7
|
+
* @priority: high
|
|
8
|
+
* @complexity: medium
|
|
9
|
+
* @dependencies: [simple-pipeline-base, fs-extra, chalk]
|
|
10
|
+
*/
|
|
11
|
+
import { SimplePipelineBase } from '../../core/simple-pipeline-base.js';
|
|
12
|
+
import fs from 'fs-extra';
|
|
13
|
+
import * as path from 'path';
|
|
14
|
+
import chalk from 'chalk';
|
|
15
|
+
import simpleGit from 'simple-git';
|
|
16
|
+
import { exec } from 'child_process';
|
|
17
|
+
import { promisify } from 'util';
|
|
18
|
+
const execAsync = promisify(exec);
|
|
19
|
+
/**
|
|
20
|
+
* Documentation pipeline using Simple Builder Pattern
|
|
21
|
+
* Refactored from DocumentationReflectionCommand to use SimplePipelineBase
|
|
22
|
+
* Implements ADR-013 for consistent pipeline architecture
|
|
23
|
+
* Generates comprehensive documentation artifacts
|
|
24
|
+
*/
|
|
25
|
+
export class DocumentationPipeline extends SimplePipelineBase {
|
|
26
|
+
git;
|
|
27
|
+
docsDir = '';
|
|
28
|
+
packageInfo = null;
|
|
29
|
+
existingDocs = [];
|
|
30
|
+
constructor(intent = 'Generate project documentation') {
|
|
31
|
+
super(intent);
|
|
32
|
+
this.withDomain('documentation');
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Initialize pipeline dependencies
|
|
36
|
+
*/
|
|
37
|
+
async initialize() {
|
|
38
|
+
console.log(chalk.cyan('📚 Initializing Documentation pipeline...'));
|
|
39
|
+
this.git = simpleGit();
|
|
40
|
+
// Set up docs directory
|
|
41
|
+
this.docsDir = path.join(process.cwd(), 'docs');
|
|
42
|
+
await fs.ensureDir(this.docsDir);
|
|
43
|
+
// Load package.json if available
|
|
44
|
+
await this.loadPackageInfo();
|
|
45
|
+
// Check existing documentation
|
|
46
|
+
await this.scanExistingDocs();
|
|
47
|
+
console.log(chalk.gray(` ✓ Initialized (${this.existingDocs.length} existing docs found)`));
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Load documentation-specific template
|
|
52
|
+
*/
|
|
53
|
+
loadTemplate() {
|
|
54
|
+
const template = {
|
|
55
|
+
requiredSections: [
|
|
56
|
+
'overview',
|
|
57
|
+
'installation',
|
|
58
|
+
'getting_started',
|
|
59
|
+
'api_reference',
|
|
60
|
+
'configuration',
|
|
61
|
+
'examples',
|
|
62
|
+
'troubleshooting',
|
|
63
|
+
'contributing',
|
|
64
|
+
'changelog'
|
|
65
|
+
],
|
|
66
|
+
contextToConsider: [
|
|
67
|
+
'package_json_metadata',
|
|
68
|
+
'public_api_interfaces',
|
|
69
|
+
'existing_documentation',
|
|
70
|
+
'code_comments_and_jsdoc',
|
|
71
|
+
'test_examples',
|
|
72
|
+
'common_issues_from_git_history',
|
|
73
|
+
'dependency_documentation'
|
|
74
|
+
],
|
|
75
|
+
rulesAndConstraints: [
|
|
76
|
+
'Use clear, concise language appropriate for target audience',
|
|
77
|
+
'Include working code examples for all major features',
|
|
78
|
+
'Follow team documentation standards and style guide',
|
|
79
|
+
'Link to related documentation and external resources',
|
|
80
|
+
'Include version compatibility information',
|
|
81
|
+
'Provide clear migration guides for breaking changes',
|
|
82
|
+
'Use semantic versioning in examples',
|
|
83
|
+
'Include performance considerations where relevant',
|
|
84
|
+
'Add diagrams and visuals where helpful',
|
|
85
|
+
'Maintain consistency with existing documentation'
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
this.withTemplate(template);
|
|
89
|
+
console.log(chalk.gray(' ✓ Documentation template loaded'));
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Gather documentation-specific context
|
|
94
|
+
*/
|
|
95
|
+
async gatherContext() {
|
|
96
|
+
console.log(chalk.cyan('🔍 Gathering documentation context...'));
|
|
97
|
+
// Get current branch and recent changes
|
|
98
|
+
const status = await this.git.status();
|
|
99
|
+
const branch = await this.git.branchLocal();
|
|
100
|
+
const recentCommits = await this.git.log({ maxCount: 50 });
|
|
101
|
+
// Analyze code structure
|
|
102
|
+
const codeStructure = await this.analyzeCodeStructure();
|
|
103
|
+
// Get test examples if available
|
|
104
|
+
const testExamples = await this.gatherTestExamples();
|
|
105
|
+
// Analyze common issues from git history
|
|
106
|
+
const commonIssues = this.analyzeCommonIssues(recentCommits.all);
|
|
107
|
+
// Check for existing API documentation
|
|
108
|
+
const apiDocs = await this.scanAPIDocumentation();
|
|
109
|
+
const context = {
|
|
110
|
+
conversationContext: {
|
|
111
|
+
intent: this.ctx.intent,
|
|
112
|
+
timestamp: Date.now()
|
|
113
|
+
},
|
|
114
|
+
systemState: {
|
|
115
|
+
currentBranch: branch.current,
|
|
116
|
+
modifiedFiles: status.modified,
|
|
117
|
+
hasChanges: status.files.length > 0
|
|
118
|
+
},
|
|
119
|
+
domainKnowledge: {
|
|
120
|
+
packageInfo: this.packageInfo,
|
|
121
|
+
existingDocs: this.existingDocs,
|
|
122
|
+
codeStructure: codeStructure,
|
|
123
|
+
apiDocs: apiDocs
|
|
124
|
+
},
|
|
125
|
+
pastPatterns: {
|
|
126
|
+
testExamples: testExamples,
|
|
127
|
+
commonIssues: commonIssues,
|
|
128
|
+
recentChanges: recentCommits.all.slice(0, 10)
|
|
129
|
+
},
|
|
130
|
+
projectContext: {
|
|
131
|
+
name: this.packageInfo?.name || 'Project',
|
|
132
|
+
version: this.packageInfo?.version || '1.0.0',
|
|
133
|
+
description: this.packageInfo?.description || '',
|
|
134
|
+
dependencies: this.packageInfo?.dependencies || {},
|
|
135
|
+
scripts: this.packageInfo?.scripts || {}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
this.withContext(context);
|
|
139
|
+
console.log(chalk.gray(' ✓ Context gathered'));
|
|
140
|
+
return this;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Generate documentation content
|
|
144
|
+
*/
|
|
145
|
+
generateContent() {
|
|
146
|
+
console.log(chalk.cyan('📝 Generating documentation...'));
|
|
147
|
+
// Determine what type of documentation to generate
|
|
148
|
+
const docType = this.determineDocumentationType();
|
|
149
|
+
switch (docType) {
|
|
150
|
+
case 'readme':
|
|
151
|
+
this.ctx.content = this.buildREADMEContent();
|
|
152
|
+
break;
|
|
153
|
+
case 'api':
|
|
154
|
+
this.ctx.content = this.buildAPIDocumentation();
|
|
155
|
+
break;
|
|
156
|
+
case 'guide':
|
|
157
|
+
this.ctx.content = this.buildUserGuide();
|
|
158
|
+
break;
|
|
159
|
+
case 'changelog':
|
|
160
|
+
this.ctx.content = this.buildChangelog();
|
|
161
|
+
break;
|
|
162
|
+
default:
|
|
163
|
+
this.ctx.content = this.buildREADMEContent();
|
|
164
|
+
}
|
|
165
|
+
this.adjustConfidence(0.9); // High confidence for documentation
|
|
166
|
+
console.log(chalk.gray(' ✓ Documentation generated'));
|
|
167
|
+
return this;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Build README documentation
|
|
171
|
+
*/
|
|
172
|
+
buildREADMEContent() {
|
|
173
|
+
const context = this.ctx.context;
|
|
174
|
+
const projectName = context.projectContext.name;
|
|
175
|
+
const description = context.projectContext.description;
|
|
176
|
+
const version = context.projectContext.version;
|
|
177
|
+
const sections = [];
|
|
178
|
+
// Header
|
|
179
|
+
sections.push(`# ${projectName}\n`);
|
|
180
|
+
if (description) {
|
|
181
|
+
sections.push(`> ${description}\n`);
|
|
182
|
+
}
|
|
183
|
+
// Badges
|
|
184
|
+
sections.push(``);
|
|
185
|
+
sections.push(``);
|
|
186
|
+
sections.push(`\n`);
|
|
187
|
+
// Table of Contents
|
|
188
|
+
sections.push(`## Table of Contents\n`);
|
|
189
|
+
sections.push(`- [Overview](#overview)`);
|
|
190
|
+
sections.push(`- [Features](#features)`);
|
|
191
|
+
sections.push(`- [Installation](#installation)`);
|
|
192
|
+
sections.push(`- [Getting Started](#getting-started)`);
|
|
193
|
+
sections.push(`- [Usage](#usage)`);
|
|
194
|
+
sections.push(`- [API Reference](#api-reference)`);
|
|
195
|
+
sections.push(`- [Configuration](#configuration)`);
|
|
196
|
+
sections.push(`- [Examples](#examples)`);
|
|
197
|
+
sections.push(`- [Troubleshooting](#troubleshooting)`);
|
|
198
|
+
sections.push(`- [Contributing](#contributing)`);
|
|
199
|
+
sections.push(`- [License](#license)\n`);
|
|
200
|
+
// Overview
|
|
201
|
+
sections.push(`## Overview\n`);
|
|
202
|
+
sections.push(`${projectName} is a powerful tool designed to ${this.generateProjectPurpose()}.`);
|
|
203
|
+
sections.push(`It provides a simple and intuitive interface for developers to achieve their goals efficiently.\n`);
|
|
204
|
+
// Features
|
|
205
|
+
sections.push(`## Features\n`);
|
|
206
|
+
sections.push(`- ✨ **Easy to Use**: Simple API with minimal configuration`);
|
|
207
|
+
sections.push(`- 🚀 **High Performance**: Optimized for speed and efficiency`);
|
|
208
|
+
sections.push(`- 🔧 **Extensible**: Plugin architecture for custom extensions`);
|
|
209
|
+
sections.push(`- 📚 **Well Documented**: Comprehensive documentation and examples`);
|
|
210
|
+
sections.push(`- 🧪 **Fully Tested**: Extensive test coverage for reliability`);
|
|
211
|
+
sections.push(`- 🔒 **Secure**: Built with security best practices\n`);
|
|
212
|
+
// Installation
|
|
213
|
+
sections.push(`## Installation\n`);
|
|
214
|
+
sections.push(`### Using npm`);
|
|
215
|
+
sections.push('```bash');
|
|
216
|
+
sections.push(`npm install ${projectName}`);
|
|
217
|
+
sections.push('```\n');
|
|
218
|
+
sections.push(`### Using yarn`);
|
|
219
|
+
sections.push('```bash');
|
|
220
|
+
sections.push(`yarn add ${projectName}`);
|
|
221
|
+
sections.push('```\n');
|
|
222
|
+
sections.push(`### Using pnpm`);
|
|
223
|
+
sections.push('```bash');
|
|
224
|
+
sections.push(`pnpm add ${projectName}`);
|
|
225
|
+
sections.push('```\n');
|
|
226
|
+
// Getting Started
|
|
227
|
+
sections.push(`## Getting Started\n`);
|
|
228
|
+
sections.push(`### Basic Setup`);
|
|
229
|
+
sections.push('```javascript');
|
|
230
|
+
sections.push(`const ${this.getModuleName()} = require('${projectName}');`);
|
|
231
|
+
sections.push(``);
|
|
232
|
+
sections.push(`// Initialize with default configuration`);
|
|
233
|
+
sections.push(`const instance = new ${this.getModuleName()}();`);
|
|
234
|
+
sections.push(``);
|
|
235
|
+
sections.push(`// Use the main functionality`);
|
|
236
|
+
sections.push(`instance.execute();`);
|
|
237
|
+
sections.push('```\n');
|
|
238
|
+
// Usage
|
|
239
|
+
sections.push(`## Usage\n`);
|
|
240
|
+
sections.push(`### Common Use Cases\n`);
|
|
241
|
+
sections.push(`#### Example 1: Basic Usage`);
|
|
242
|
+
sections.push('```javascript');
|
|
243
|
+
sections.push(`import { ${this.getModuleName()} } from '${projectName}';`);
|
|
244
|
+
sections.push(``);
|
|
245
|
+
sections.push(`const config = {`);
|
|
246
|
+
sections.push(` option1: 'value1',`);
|
|
247
|
+
sections.push(` option2: true`);
|
|
248
|
+
sections.push(`};`);
|
|
249
|
+
sections.push(``);
|
|
250
|
+
sections.push(`const instance = new ${this.getModuleName()}(config);`);
|
|
251
|
+
sections.push(`const result = await instance.process(data);`);
|
|
252
|
+
sections.push(`console.log(result);`);
|
|
253
|
+
sections.push('```\n');
|
|
254
|
+
// API Reference
|
|
255
|
+
sections.push(`## API Reference\n`);
|
|
256
|
+
sections.push(`### Core Classes\n`);
|
|
257
|
+
sections.push(`#### ${this.getModuleName()}`);
|
|
258
|
+
sections.push(``);
|
|
259
|
+
sections.push(`The main class that provides core functionality.\n`);
|
|
260
|
+
sections.push(`##### Constructor`);
|
|
261
|
+
sections.push('```javascript');
|
|
262
|
+
sections.push(`new ${this.getModuleName()}(options?: Options)`);
|
|
263
|
+
sections.push('```\n');
|
|
264
|
+
sections.push(`**Parameters:**`);
|
|
265
|
+
sections.push(`- \`options\` (optional): Configuration object`);
|
|
266
|
+
sections.push(` - \`option1\`: string - Description of option1`);
|
|
267
|
+
sections.push(` - \`option2\`: boolean - Description of option2\n`);
|
|
268
|
+
sections.push(`##### Methods\n`);
|
|
269
|
+
sections.push(`###### \`process(data: any): Promise<Result>\``);
|
|
270
|
+
sections.push(`Processes the input data and returns a result.\n`);
|
|
271
|
+
sections.push(`**Parameters:**`);
|
|
272
|
+
sections.push(`- \`data\`: The input data to process\n`);
|
|
273
|
+
sections.push(`**Returns:**`);
|
|
274
|
+
sections.push(`- \`Promise<Result>\`: The processed result\n`);
|
|
275
|
+
// Configuration
|
|
276
|
+
sections.push(`## Configuration\n`);
|
|
277
|
+
sections.push(`### Configuration Options\n`);
|
|
278
|
+
sections.push('```javascript');
|
|
279
|
+
sections.push(`const config = {`);
|
|
280
|
+
sections.push(` // Core options`);
|
|
281
|
+
sections.push(` debug: false, // Enable debug logging`);
|
|
282
|
+
sections.push(` timeout: 5000, // Operation timeout in ms`);
|
|
283
|
+
sections.push(` retries: 3, // Number of retry attempts`);
|
|
284
|
+
sections.push(` `);
|
|
285
|
+
sections.push(` // Advanced options`);
|
|
286
|
+
sections.push(` cache: true, // Enable caching`);
|
|
287
|
+
sections.push(` cacheSize: 100, // Maximum cache entries`);
|
|
288
|
+
sections.push(` parallel: true, // Enable parallel processing`);
|
|
289
|
+
sections.push(`};`);
|
|
290
|
+
sections.push('```\n');
|
|
291
|
+
// Examples
|
|
292
|
+
sections.push(`## Examples\n`);
|
|
293
|
+
sections.push(`### Advanced Example`);
|
|
294
|
+
sections.push('```javascript');
|
|
295
|
+
sections.push(`import { ${this.getModuleName()}, Pipeline } from '${projectName}';`);
|
|
296
|
+
sections.push(``);
|
|
297
|
+
sections.push(`// Create a processing pipeline`);
|
|
298
|
+
sections.push(`const pipeline = new Pipeline()`);
|
|
299
|
+
sections.push(` .add(step1)`);
|
|
300
|
+
sections.push(` .add(step2)`);
|
|
301
|
+
sections.push(` .add(step3);`);
|
|
302
|
+
sections.push(``);
|
|
303
|
+
sections.push(`// Process data through the pipeline`);
|
|
304
|
+
sections.push(`const result = await pipeline.execute(inputData);`);
|
|
305
|
+
sections.push('```\n');
|
|
306
|
+
sections.push(`More examples can be found in the [examples](./examples) directory.\n`);
|
|
307
|
+
// Troubleshooting
|
|
308
|
+
sections.push(`## Troubleshooting\n`);
|
|
309
|
+
sections.push(`### Common Issues\n`);
|
|
310
|
+
sections.push(`#### Issue: Module not found`);
|
|
311
|
+
sections.push(`**Solution**: Ensure the package is properly installed:`);
|
|
312
|
+
sections.push('```bash');
|
|
313
|
+
sections.push(`npm list ${projectName}`);
|
|
314
|
+
sections.push('```\n');
|
|
315
|
+
sections.push(`#### Issue: Configuration not working`);
|
|
316
|
+
sections.push(`**Solution**: Verify your configuration object matches the expected schema.\n`);
|
|
317
|
+
sections.push(`#### Issue: Performance problems`);
|
|
318
|
+
sections.push(`**Solution**: Consider enabling caching and parallel processing options.\n`);
|
|
319
|
+
// Contributing
|
|
320
|
+
sections.push(`## Contributing\n`);
|
|
321
|
+
sections.push(`We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n`);
|
|
322
|
+
sections.push(`### Development Setup`);
|
|
323
|
+
sections.push('```bash');
|
|
324
|
+
sections.push(`# Clone the repository`);
|
|
325
|
+
sections.push(`git clone https://github.com/username/${projectName}.git`);
|
|
326
|
+
sections.push(``);
|
|
327
|
+
sections.push(`# Install dependencies`);
|
|
328
|
+
sections.push(`npm install`);
|
|
329
|
+
sections.push(``);
|
|
330
|
+
sections.push(`# Run tests`);
|
|
331
|
+
sections.push(`npm test`);
|
|
332
|
+
sections.push(``);
|
|
333
|
+
sections.push(`# Build the project`);
|
|
334
|
+
sections.push(`npm run build`);
|
|
335
|
+
sections.push('```\n');
|
|
336
|
+
// License
|
|
337
|
+
sections.push(`## License\n`);
|
|
338
|
+
sections.push(`This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n`);
|
|
339
|
+
// Footer
|
|
340
|
+
sections.push(`---\n`);
|
|
341
|
+
sections.push(`**Generated with**: Ginko Documentation Pipeline`);
|
|
342
|
+
sections.push(`**Date**: ${new Date().toISOString().split('T')[0]}`);
|
|
343
|
+
sections.push(`**Confidence**: ${(this.ctx.confidence * 100).toFixed(0)}%`);
|
|
344
|
+
return sections.join('\n');
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Build API documentation
|
|
348
|
+
*/
|
|
349
|
+
buildAPIDocumentation() {
|
|
350
|
+
const sections = [];
|
|
351
|
+
sections.push(`# API Documentation\n`);
|
|
352
|
+
sections.push(`## Overview\n`);
|
|
353
|
+
sections.push(`This document provides comprehensive API reference for all public interfaces.\n`);
|
|
354
|
+
// Add API sections based on context
|
|
355
|
+
sections.push(`## Classes\n`);
|
|
356
|
+
sections.push(`### Main Classes\n`);
|
|
357
|
+
sections.push(`Documentation for core classes and their methods.\n`);
|
|
358
|
+
sections.push(`## Functions\n`);
|
|
359
|
+
sections.push(`### Utility Functions\n`);
|
|
360
|
+
sections.push(`Helper functions and utilities.\n`);
|
|
361
|
+
sections.push(`## Types\n`);
|
|
362
|
+
sections.push(`### Type Definitions\n`);
|
|
363
|
+
sections.push(`TypeScript type definitions and interfaces.\n`);
|
|
364
|
+
return sections.join('\n');
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Build user guide
|
|
368
|
+
*/
|
|
369
|
+
buildUserGuide() {
|
|
370
|
+
const sections = [];
|
|
371
|
+
sections.push(`# User Guide\n`);
|
|
372
|
+
sections.push(`## Introduction\n`);
|
|
373
|
+
sections.push(`Welcome to the comprehensive user guide.\n`);
|
|
374
|
+
sections.push(`## Getting Started\n`);
|
|
375
|
+
sections.push(`Step-by-step instructions for new users.\n`);
|
|
376
|
+
sections.push(`## Advanced Topics\n`);
|
|
377
|
+
sections.push(`In-depth coverage of advanced features.\n`);
|
|
378
|
+
return sections.join('\n');
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Build changelog
|
|
382
|
+
*/
|
|
383
|
+
buildChangelog() {
|
|
384
|
+
const sections = [];
|
|
385
|
+
const date = new Date().toISOString().split('T')[0];
|
|
386
|
+
sections.push(`# Changelog\n`);
|
|
387
|
+
sections.push(`All notable changes to this project will be documented in this file.\n`);
|
|
388
|
+
sections.push(`The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),`);
|
|
389
|
+
sections.push(`and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n`);
|
|
390
|
+
sections.push(`## [Unreleased]\n`);
|
|
391
|
+
sections.push(`### Added`);
|
|
392
|
+
sections.push(`- New features in development\n`);
|
|
393
|
+
sections.push(`### Changed`);
|
|
394
|
+
sections.push(`- Updates to existing functionality\n`);
|
|
395
|
+
sections.push(`### Fixed`);
|
|
396
|
+
sections.push(`- Bug fixes\n`);
|
|
397
|
+
sections.push(`## [${this.ctx.context?.projectContext?.version || '1.0.0'}] - ${date}\n`);
|
|
398
|
+
sections.push(`### Added`);
|
|
399
|
+
sections.push(`- Initial release`);
|
|
400
|
+
sections.push(`- Core functionality`);
|
|
401
|
+
sections.push(`- Documentation\n`);
|
|
402
|
+
return sections.join('\n');
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Validate documentation content
|
|
406
|
+
*/
|
|
407
|
+
validateContent() {
|
|
408
|
+
console.log(chalk.cyan('✅ Validating documentation...'));
|
|
409
|
+
if (!this.ctx.content) {
|
|
410
|
+
this.addError('No documentation content generated');
|
|
411
|
+
this.adjustConfidence(0.3);
|
|
412
|
+
return this;
|
|
413
|
+
}
|
|
414
|
+
// Check minimum content length
|
|
415
|
+
if (this.ctx.content.length < 500) {
|
|
416
|
+
this.addError('Documentation seems too short');
|
|
417
|
+
this.adjustConfidence(0.7);
|
|
418
|
+
}
|
|
419
|
+
// Check for key sections in README
|
|
420
|
+
if (this.ctx.content.includes('# ')) {
|
|
421
|
+
const requiredSections = ['## Installation', '## Usage', '## API'];
|
|
422
|
+
for (const section of requiredSections) {
|
|
423
|
+
if (!this.ctx.content.includes(section)) {
|
|
424
|
+
console.log(chalk.yellow(` ⚠ Missing recommended section: ${section}`));
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (this.ctx.errors.length === 0) {
|
|
429
|
+
console.log(chalk.gray(' ✓ Documentation validation passed'));
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
console.log(chalk.yellow(` ⚠ Documentation validation warnings: ${this.ctx.errors.length}`));
|
|
433
|
+
}
|
|
434
|
+
return this;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Save documentation to filesystem
|
|
438
|
+
*/
|
|
439
|
+
async save() {
|
|
440
|
+
if (!this.ctx.content) {
|
|
441
|
+
this.addError('No content to save');
|
|
442
|
+
this.adjustConfidence(0.3);
|
|
443
|
+
return this;
|
|
444
|
+
}
|
|
445
|
+
console.log(chalk.cyan('💾 Saving documentation...'));
|
|
446
|
+
// Determine filename based on content type
|
|
447
|
+
const docType = this.determineDocumentationType();
|
|
448
|
+
let filename = 'README.md';
|
|
449
|
+
switch (docType) {
|
|
450
|
+
case 'api':
|
|
451
|
+
filename = 'API.md';
|
|
452
|
+
break;
|
|
453
|
+
case 'guide':
|
|
454
|
+
filename = 'USER_GUIDE.md';
|
|
455
|
+
break;
|
|
456
|
+
case 'changelog':
|
|
457
|
+
filename = 'CHANGELOG.md';
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
const filepath = docType === 'readme'
|
|
461
|
+
? path.join(process.cwd(), filename)
|
|
462
|
+
: path.join(this.docsDir, filename);
|
|
463
|
+
await fs.writeFile(filepath, this.ctx.content, 'utf-8');
|
|
464
|
+
console.log(chalk.green(` ✅ Documentation saved to: ${path.relative(process.cwd(), filepath)}`));
|
|
465
|
+
console.log(chalk.dim(' 📚 Keep documentation up to date with code changes'));
|
|
466
|
+
this.withMetadata({ savedPath: filepath, filename: filename });
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Load package.json information
|
|
471
|
+
*/
|
|
472
|
+
async loadPackageInfo() {
|
|
473
|
+
try {
|
|
474
|
+
const packagePath = path.join(process.cwd(), 'package.json');
|
|
475
|
+
this.packageInfo = await fs.readJson(packagePath);
|
|
476
|
+
}
|
|
477
|
+
catch {
|
|
478
|
+
this.packageInfo = null;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Scan for existing documentation
|
|
483
|
+
*/
|
|
484
|
+
async scanExistingDocs() {
|
|
485
|
+
try {
|
|
486
|
+
const files = await fs.readdir(this.docsDir);
|
|
487
|
+
this.existingDocs = files.filter(f => f.endsWith('.md'));
|
|
488
|
+
}
|
|
489
|
+
catch {
|
|
490
|
+
this.existingDocs = [];
|
|
491
|
+
}
|
|
492
|
+
// Also check for README in root
|
|
493
|
+
try {
|
|
494
|
+
const rootFiles = await fs.readdir(process.cwd());
|
|
495
|
+
const readmes = rootFiles.filter(f => f.toLowerCase().includes('readme'));
|
|
496
|
+
this.existingDocs.push(...readmes);
|
|
497
|
+
}
|
|
498
|
+
catch {
|
|
499
|
+
// Ignore
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Analyze code structure
|
|
504
|
+
*/
|
|
505
|
+
async analyzeCodeStructure() {
|
|
506
|
+
const structure = {
|
|
507
|
+
hasSrc: false,
|
|
508
|
+
hasTests: false,
|
|
509
|
+
hasExamples: false,
|
|
510
|
+
mainFile: 'index.js'
|
|
511
|
+
};
|
|
512
|
+
try {
|
|
513
|
+
const files = await fs.readdir(process.cwd());
|
|
514
|
+
structure.hasSrc = files.includes('src');
|
|
515
|
+
structure.hasTests = files.includes('test') || files.includes('tests');
|
|
516
|
+
structure.hasExamples = files.includes('examples');
|
|
517
|
+
if (this.packageInfo?.main) {
|
|
518
|
+
structure.mainFile = this.packageInfo.main;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
catch {
|
|
522
|
+
// Use defaults
|
|
523
|
+
}
|
|
524
|
+
return structure;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Gather test examples
|
|
528
|
+
*/
|
|
529
|
+
async gatherTestExamples() {
|
|
530
|
+
const examples = [];
|
|
531
|
+
try {
|
|
532
|
+
const testDirs = ['test', 'tests', '__tests__', 'spec'];
|
|
533
|
+
for (const dir of testDirs) {
|
|
534
|
+
const testPath = path.join(process.cwd(), dir);
|
|
535
|
+
if (await fs.pathExists(testPath)) {
|
|
536
|
+
const files = await fs.readdir(testPath);
|
|
537
|
+
examples.push(...files.filter(f => f.includes('.test.') || f.includes('.spec.')));
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
catch {
|
|
542
|
+
// No tests found
|
|
543
|
+
}
|
|
544
|
+
return examples;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Analyze common issues from git history
|
|
548
|
+
*/
|
|
549
|
+
analyzeCommonIssues(commits) {
|
|
550
|
+
const issues = [];
|
|
551
|
+
const keywords = ['fix:', 'bug:', 'issue:', 'error:', 'problem:'];
|
|
552
|
+
commits.forEach(commit => {
|
|
553
|
+
const message = commit.message.toLowerCase();
|
|
554
|
+
for (const keyword of keywords) {
|
|
555
|
+
if (message.includes(keyword)) {
|
|
556
|
+
issues.push(commit.message);
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
return issues.slice(0, 10); // Top 10 recent issues
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Scan for API documentation
|
|
565
|
+
*/
|
|
566
|
+
async scanAPIDocumentation() {
|
|
567
|
+
const apiDocs = {
|
|
568
|
+
hasJSDoc: false,
|
|
569
|
+
hasTypeScript: false,
|
|
570
|
+
hasOpenAPI: false
|
|
571
|
+
};
|
|
572
|
+
try {
|
|
573
|
+
const files = await fs.readdir(process.cwd());
|
|
574
|
+
apiDocs.hasTypeScript = files.some(f => f.endsWith('.d.ts'));
|
|
575
|
+
apiDocs.hasOpenAPI = files.some(f => f.includes('openapi') || f.includes('swagger'));
|
|
576
|
+
}
|
|
577
|
+
catch {
|
|
578
|
+
// Use defaults
|
|
579
|
+
}
|
|
580
|
+
return apiDocs;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Determine what type of documentation to generate
|
|
584
|
+
*/
|
|
585
|
+
determineDocumentationType() {
|
|
586
|
+
const intent = this.ctx.intent.toLowerCase();
|
|
587
|
+
if (intent.includes('api'))
|
|
588
|
+
return 'api';
|
|
589
|
+
if (intent.includes('guide') || intent.includes('tutorial'))
|
|
590
|
+
return 'guide';
|
|
591
|
+
if (intent.includes('changelog') || intent.includes('release'))
|
|
592
|
+
return 'changelog';
|
|
593
|
+
if (intent.includes('readme'))
|
|
594
|
+
return 'readme';
|
|
595
|
+
// Default to README
|
|
596
|
+
return 'readme';
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Generate project purpose description
|
|
600
|
+
*/
|
|
601
|
+
generateProjectPurpose() {
|
|
602
|
+
if (this.packageInfo?.description) {
|
|
603
|
+
return this.packageInfo.description.toLowerCase();
|
|
604
|
+
}
|
|
605
|
+
// Generate based on intent
|
|
606
|
+
const intent = this.ctx.intent.toLowerCase();
|
|
607
|
+
if (intent.includes('cli'))
|
|
608
|
+
return 'provide command-line interface functionality';
|
|
609
|
+
if (intent.includes('api'))
|
|
610
|
+
return 'expose API endpoints for integration';
|
|
611
|
+
if (intent.includes('library'))
|
|
612
|
+
return 'provide reusable components and utilities';
|
|
613
|
+
return 'streamline development workflows';
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Get module name from package name
|
|
617
|
+
*/
|
|
618
|
+
getModuleName() {
|
|
619
|
+
if (!this.packageInfo?.name)
|
|
620
|
+
return 'Module';
|
|
621
|
+
const name = this.packageInfo.name;
|
|
622
|
+
// Convert kebab-case to PascalCase
|
|
623
|
+
return name
|
|
624
|
+
.split(/[-_]/)
|
|
625
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
626
|
+
.join('');
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Custom validation for documentation pipeline
|
|
630
|
+
*/
|
|
631
|
+
customValidate() {
|
|
632
|
+
if (!this.ctx.template) {
|
|
633
|
+
this.addError('Template required for documentation');
|
|
634
|
+
this.adjustConfidence(0.7);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
/**
|
|
638
|
+
* Custom recovery logic
|
|
639
|
+
*/
|
|
640
|
+
customRecover() {
|
|
641
|
+
if (this.ctx.errors.includes('Documentation seems too short')) {
|
|
642
|
+
// This is a warning, not critical
|
|
643
|
+
this.removeError('Documentation seems too short');
|
|
644
|
+
console.log(chalk.yellow(' ⚠ Consider adding more detailed documentation'));
|
|
645
|
+
this.adjustConfidence(1.1);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Custom execution logic
|
|
650
|
+
*/
|
|
651
|
+
async customExecute() {
|
|
652
|
+
// Ensure we have content
|
|
653
|
+
if (!this.ctx.content) {
|
|
654
|
+
this.generateContent();
|
|
655
|
+
}
|
|
656
|
+
// Validate the content
|
|
657
|
+
this.validateContent();
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* Main build method using fluent interface
|
|
661
|
+
*/
|
|
662
|
+
async build() {
|
|
663
|
+
try {
|
|
664
|
+
console.log(chalk.bold.cyan('\n📚 Building Documentation with Simple Pipeline Pattern\n'));
|
|
665
|
+
await this
|
|
666
|
+
.initialize()
|
|
667
|
+
.then(p => p.loadTemplate())
|
|
668
|
+
.then(p => p.gatherContext())
|
|
669
|
+
.then(p => {
|
|
670
|
+
p.generateContent();
|
|
671
|
+
p.validateContent();
|
|
672
|
+
return p;
|
|
673
|
+
})
|
|
674
|
+
.then(p => p.validate())
|
|
675
|
+
.then(p => p.recover())
|
|
676
|
+
.then(p => p.save())
|
|
677
|
+
.then(p => p.execute());
|
|
678
|
+
console.log(chalk.bold.green('\n✨ Documentation pipeline completed successfully!\n'));
|
|
679
|
+
return this.ctx.content || '';
|
|
680
|
+
}
|
|
681
|
+
catch (error) {
|
|
682
|
+
console.error(chalk.red(`\n❌ Documentation pipeline failed: ${error}`));
|
|
683
|
+
throw error;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Adapter for CLI command usage
|
|
689
|
+
* Maintains backward compatibility with existing command structure
|
|
690
|
+
*/
|
|
691
|
+
export class DocumentationReflectionCommand {
|
|
692
|
+
pipeline;
|
|
693
|
+
constructor() {
|
|
694
|
+
this.pipeline = new DocumentationPipeline();
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Execute the documentation command
|
|
698
|
+
*/
|
|
699
|
+
async execute(intent, options = {}) {
|
|
700
|
+
try {
|
|
701
|
+
// Update pipeline intent if provided
|
|
702
|
+
if (intent && intent.trim() !== '') {
|
|
703
|
+
this.pipeline = new DocumentationPipeline(intent);
|
|
704
|
+
}
|
|
705
|
+
// Build and execute the pipeline
|
|
706
|
+
await this.pipeline.build();
|
|
707
|
+
}
|
|
708
|
+
catch (error) {
|
|
709
|
+
console.error(chalk.red(`Documentation generation failed: ${error}`));
|
|
710
|
+
throw error;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
// Export for CLI use
|
|
715
|
+
export default DocumentationReflectionCommand;
|
|
716
|
+
//# sourceMappingURL=documentation-pipeline.js.map
|