javi-forge 0.1.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/.gitignore.template +105 -0
- package/.releaserc +44 -0
- package/README.md +45 -0
- package/ai-config/.skillignore +15 -0
- package/ai-config/AUTO_INVOKE.md +300 -0
- package/ai-config/agents/_TEMPLATE.md +93 -0
- package/ai-config/agents/business/api-designer.md +1657 -0
- package/ai-config/agents/business/business-analyst.md +1331 -0
- package/ai-config/agents/business/product-strategist.md +206 -0
- package/ai-config/agents/business/project-manager.md +178 -0
- package/ai-config/agents/business/requirements-analyst.md +1277 -0
- package/ai-config/agents/business/technical-writer.md +1679 -0
- package/ai-config/agents/creative/ux-designer.md +205 -0
- package/ai-config/agents/data-ai/ai-engineer.md +487 -0
- package/ai-config/agents/data-ai/analytics-engineer.md +953 -0
- package/ai-config/agents/data-ai/data-engineer.md +173 -0
- package/ai-config/agents/data-ai/data-scientist.md +672 -0
- package/ai-config/agents/data-ai/mlops-engineer.md +814 -0
- package/ai-config/agents/data-ai/prompt-engineer.md +772 -0
- package/ai-config/agents/development/angular-expert.md +620 -0
- package/ai-config/agents/development/backend-architect.md +795 -0
- package/ai-config/agents/development/database-specialist.md +212 -0
- package/ai-config/agents/development/frontend-specialist.md +686 -0
- package/ai-config/agents/development/fullstack-engineer.md +668 -0
- package/ai-config/agents/development/golang-pro.md +338 -0
- package/ai-config/agents/development/java-enterprise.md +400 -0
- package/ai-config/agents/development/javascript-pro.md +422 -0
- package/ai-config/agents/development/nextjs-pro.md +474 -0
- package/ai-config/agents/development/python-pro.md +570 -0
- package/ai-config/agents/development/react-pro.md +487 -0
- package/ai-config/agents/development/rust-pro.md +246 -0
- package/ai-config/agents/development/spring-boot-4-expert.md +326 -0
- package/ai-config/agents/development/typescript-pro.md +336 -0
- package/ai-config/agents/development/vue-specialist.md +605 -0
- package/ai-config/agents/infrastructure/cloud-architect.md +472 -0
- package/ai-config/agents/infrastructure/deployment-manager.md +358 -0
- package/ai-config/agents/infrastructure/devops-engineer.md +455 -0
- package/ai-config/agents/infrastructure/incident-responder.md +519 -0
- package/ai-config/agents/infrastructure/kubernetes-expert.md +705 -0
- package/ai-config/agents/infrastructure/monitoring-specialist.md +674 -0
- package/ai-config/agents/infrastructure/performance-engineer.md +658 -0
- package/ai-config/agents/orchestrator.md +241 -0
- package/ai-config/agents/quality/accessibility-auditor.md +1204 -0
- package/ai-config/agents/quality/code-reviewer-compact.md +123 -0
- package/ai-config/agents/quality/code-reviewer.md +363 -0
- package/ai-config/agents/quality/dependency-manager.md +743 -0
- package/ai-config/agents/quality/e2e-test-specialist.md +1005 -0
- package/ai-config/agents/quality/performance-tester.md +1086 -0
- package/ai-config/agents/quality/security-auditor.md +133 -0
- package/ai-config/agents/quality/test-engineer.md +453 -0
- package/ai-config/agents/specialists/api-designer.md +87 -0
- package/ai-config/agents/specialists/backend-architect.md +73 -0
- package/ai-config/agents/specialists/code-reviewer.md +77 -0
- package/ai-config/agents/specialists/db-optimizer.md +75 -0
- package/ai-config/agents/specialists/devops-engineer.md +83 -0
- package/ai-config/agents/specialists/documentation-writer.md +78 -0
- package/ai-config/agents/specialists/frontend-developer.md +75 -0
- package/ai-config/agents/specialists/performance-analyst.md +82 -0
- package/ai-config/agents/specialists/refactor-specialist.md +74 -0
- package/ai-config/agents/specialists/security-auditor.md +74 -0
- package/ai-config/agents/specialists/test-engineer.md +81 -0
- package/ai-config/agents/specialists/ux-consultant.md +76 -0
- package/ai-config/agents/specialized/agent-generator.md +1190 -0
- package/ai-config/agents/specialized/blockchain-developer.md +149 -0
- package/ai-config/agents/specialized/code-migrator.md +892 -0
- package/ai-config/agents/specialized/context-manager.md +978 -0
- package/ai-config/agents/specialized/documentation-writer.md +1078 -0
- package/ai-config/agents/specialized/ecommerce-expert.md +1756 -0
- package/ai-config/agents/specialized/embedded-engineer.md +1714 -0
- package/ai-config/agents/specialized/error-detective.md +1034 -0
- package/ai-config/agents/specialized/fintech-specialist.md +1659 -0
- package/ai-config/agents/specialized/freelance-project-planner-v2.md +1988 -0
- package/ai-config/agents/specialized/freelance-project-planner-v3.md +2136 -0
- package/ai-config/agents/specialized/freelance-project-planner-v4.md +4503 -0
- package/ai-config/agents/specialized/freelance-project-planner.md +722 -0
- package/ai-config/agents/specialized/game-developer.md +1963 -0
- package/ai-config/agents/specialized/healthcare-dev.md +1620 -0
- package/ai-config/agents/specialized/mobile-developer.md +188 -0
- package/ai-config/agents/specialized/parallel-plan-executor.md +506 -0
- package/ai-config/agents/specialized/plan-executor.md +485 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/00-INDEX.md +485 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/01-CORE.md +3493 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/02-SELF-CORRECTION.md +778 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/03-PROGRESSIVE-SETUP.md +918 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/04-DEPLOYMENT.md +1537 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/05-TESTING.md +2633 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/06-OPERATIONS.md +5610 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/INSTALL.md +335 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/QUICK-REFERENCE.txt +215 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/README.md +260 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/START-HERE.md +379 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/WORKFLOW-DIAGRAM.md +355 -0
- package/ai-config/agents/specialized/solo-dev-planner-modular/solo-dev-planner.md +279 -0
- package/ai-config/agents/specialized/template-writer.md +347 -0
- package/ai-config/agents/specialized/test-runner.md +99 -0
- package/ai-config/agents/specialized/vibekanban-smart-worker.md +244 -0
- package/ai-config/agents/specialized/wave-executor.md +138 -0
- package/ai-config/agents/specialized/workflow-optimizer.md +1114 -0
- package/ai-config/commands/git/changelog.md +32 -0
- package/ai-config/commands/git/ci-local.md +70 -0
- package/ai-config/commands/git/commit.md +35 -0
- package/ai-config/commands/git/fix-issue.md +23 -0
- package/ai-config/commands/git/pr-create.md +42 -0
- package/ai-config/commands/git/pr-review.md +50 -0
- package/ai-config/commands/git/worktree.md +39 -0
- package/ai-config/commands/refactoring/cleanup.md +24 -0
- package/ai-config/commands/refactoring/dead-code.md +40 -0
- package/ai-config/commands/refactoring/extract.md +31 -0
- package/ai-config/commands/testing/e2e.md +30 -0
- package/ai-config/commands/testing/tdd.md +36 -0
- package/ai-config/commands/testing/test-coverage.md +30 -0
- package/ai-config/commands/testing/test-fix.md +24 -0
- package/ai-config/commands/workflow/generate-agents-md.md +85 -0
- package/ai-config/commands/workflow/planning.md +47 -0
- package/ai-config/commands/workflows/compound.md +89 -0
- package/ai-config/commands/workflows/plan.md +77 -0
- package/ai-config/commands/workflows/review.md +78 -0
- package/ai-config/commands/workflows/work.md +75 -0
- package/ai-config/config.yaml +18 -0
- package/ai-config/hooks/_TEMPLATE.md +96 -0
- package/ai-config/hooks/block-dangerous-commands.md +75 -0
- package/ai-config/hooks/commit-guard.md +90 -0
- package/ai-config/hooks/context-loader.md +73 -0
- package/ai-config/hooks/improve-prompt.md +91 -0
- package/ai-config/hooks/learning-log.md +72 -0
- package/ai-config/hooks/model-router.md +86 -0
- package/ai-config/hooks/secret-scanner.md +64 -0
- package/ai-config/hooks/skill-validator.md +102 -0
- package/ai-config/hooks/task-artifact.md +114 -0
- package/ai-config/hooks/validate-workflow.md +100 -0
- package/ai-config/prompts/base.md +71 -0
- package/ai-config/prompts/modes/debug.md +34 -0
- package/ai-config/prompts/modes/deploy.md +40 -0
- package/ai-config/prompts/modes/research.md +32 -0
- package/ai-config/prompts/modes/review.md +33 -0
- package/ai-config/prompts/review-policy.md +79 -0
- package/ai-config/skills/_TEMPLATE.md +157 -0
- package/ai-config/skills/backend/api-gateway/SKILL.md +254 -0
- package/ai-config/skills/backend/bff-concepts/SKILL.md +239 -0
- package/ai-config/skills/backend/bff-spring/SKILL.md +364 -0
- package/ai-config/skills/backend/chi-router/SKILL.md +396 -0
- package/ai-config/skills/backend/error-handling/SKILL.md +255 -0
- package/ai-config/skills/backend/exceptions-spring/SKILL.md +323 -0
- package/ai-config/skills/backend/fastapi/SKILL.md +302 -0
- package/ai-config/skills/backend/gateway-spring/SKILL.md +390 -0
- package/ai-config/skills/backend/go-backend/SKILL.md +457 -0
- package/ai-config/skills/backend/gradle-multimodule/SKILL.md +274 -0
- package/ai-config/skills/backend/graphql-concepts/SKILL.md +352 -0
- package/ai-config/skills/backend/graphql-spring/SKILL.md +398 -0
- package/ai-config/skills/backend/grpc-concepts/SKILL.md +283 -0
- package/ai-config/skills/backend/grpc-spring/SKILL.md +445 -0
- package/ai-config/skills/backend/jwt-auth/SKILL.md +412 -0
- package/ai-config/skills/backend/notifications-concepts/SKILL.md +259 -0
- package/ai-config/skills/backend/recommendations-concepts/SKILL.md +261 -0
- package/ai-config/skills/backend/search-concepts/SKILL.md +263 -0
- package/ai-config/skills/backend/search-spring/SKILL.md +375 -0
- package/ai-config/skills/backend/spring-boot-4/SKILL.md +172 -0
- package/ai-config/skills/backend/websockets/SKILL.md +532 -0
- package/ai-config/skills/data-ai/ai-ml/SKILL.md +423 -0
- package/ai-config/skills/data-ai/analytics-concepts/SKILL.md +195 -0
- package/ai-config/skills/data-ai/analytics-spring/SKILL.md +340 -0
- package/ai-config/skills/data-ai/duckdb-analytics/SKILL.md +440 -0
- package/ai-config/skills/data-ai/langchain/SKILL.md +238 -0
- package/ai-config/skills/data-ai/mlflow/SKILL.md +302 -0
- package/ai-config/skills/data-ai/onnx-inference/SKILL.md +290 -0
- package/ai-config/skills/data-ai/powerbi/SKILL.md +352 -0
- package/ai-config/skills/data-ai/pytorch/SKILL.md +274 -0
- package/ai-config/skills/data-ai/scikit-learn/SKILL.md +321 -0
- package/ai-config/skills/data-ai/vector-db/SKILL.md +301 -0
- package/ai-config/skills/database/graph-databases/SKILL.md +218 -0
- package/ai-config/skills/database/graph-spring/SKILL.md +361 -0
- package/ai-config/skills/database/pgx-postgres/SKILL.md +512 -0
- package/ai-config/skills/database/redis-cache/SKILL.md +343 -0
- package/ai-config/skills/database/sqlite-embedded/SKILL.md +388 -0
- package/ai-config/skills/database/timescaledb/SKILL.md +320 -0
- package/ai-config/skills/docs/api-documentation/SKILL.md +293 -0
- package/ai-config/skills/docs/docs-spring/SKILL.md +377 -0
- package/ai-config/skills/docs/mustache-templates/SKILL.md +190 -0
- package/ai-config/skills/docs/technical-docs/SKILL.md +447 -0
- package/ai-config/skills/frontend/astro-ssr/SKILL.md +441 -0
- package/ai-config/skills/frontend/frontend-design/SKILL.md +54 -0
- package/ai-config/skills/frontend/frontend-web/SKILL.md +368 -0
- package/ai-config/skills/frontend/mantine-ui/SKILL.md +396 -0
- package/ai-config/skills/frontend/tanstack-query/SKILL.md +439 -0
- package/ai-config/skills/frontend/zod-validation/SKILL.md +417 -0
- package/ai-config/skills/frontend/zustand-state/SKILL.md +350 -0
- package/ai-config/skills/infrastructure/chaos-engineering/SKILL.md +244 -0
- package/ai-config/skills/infrastructure/chaos-spring/SKILL.md +378 -0
- package/ai-config/skills/infrastructure/devops-infra/SKILL.md +435 -0
- package/ai-config/skills/infrastructure/docker-containers/SKILL.md +420 -0
- package/ai-config/skills/infrastructure/kubernetes/SKILL.md +456 -0
- package/ai-config/skills/infrastructure/opentelemetry/SKILL.md +546 -0
- package/ai-config/skills/infrastructure/traefik-proxy/SKILL.md +474 -0
- package/ai-config/skills/infrastructure/woodpecker-ci/SKILL.md +315 -0
- package/ai-config/skills/mobile/ionic-capacitor/SKILL.md +504 -0
- package/ai-config/skills/mobile/mobile-ionic/SKILL.md +448 -0
- package/ai-config/skills/prompt-improver/SKILL.md +125 -0
- package/ai-config/skills/quality/ghagga-review/SKILL.md +216 -0
- package/ai-config/skills/references/hooks-patterns/SKILL.md +238 -0
- package/ai-config/skills/references/mcp-servers/SKILL.md +275 -0
- package/ai-config/skills/references/plugins-reference/SKILL.md +110 -0
- package/ai-config/skills/references/skills-reference/SKILL.md +420 -0
- package/ai-config/skills/references/subagent-templates/SKILL.md +193 -0
- package/ai-config/skills/systems-iot/modbus-protocol/SKILL.md +410 -0
- package/ai-config/skills/systems-iot/mqtt-rumqttc/SKILL.md +408 -0
- package/ai-config/skills/systems-iot/rust-systems/SKILL.md +386 -0
- package/ai-config/skills/systems-iot/tokio-async/SKILL.md +324 -0
- package/ai-config/skills/testing/playwright-e2e/SKILL.md +289 -0
- package/ai-config/skills/testing/testcontainers/SKILL.md +299 -0
- package/ai-config/skills/testing/vitest-testing/SKILL.md +381 -0
- package/ai-config/skills/workflow/ci-local-guide/SKILL.md +118 -0
- package/ai-config/skills/workflow/claude-automation-recommender/SKILL.md +299 -0
- package/ai-config/skills/workflow/claude-md-improver/SKILL.md +158 -0
- package/ai-config/skills/workflow/finishing-a-development-branch/SKILL.md +117 -0
- package/ai-config/skills/workflow/git-github/SKILL.md +334 -0
- package/ai-config/skills/workflow/git-github/references/examples.md +160 -0
- package/ai-config/skills/workflow/git-workflow/SKILL.md +214 -0
- package/ai-config/skills/workflow/ide-plugins/SKILL.md +277 -0
- package/ai-config/skills/workflow/ide-plugins-intellij/SKILL.md +401 -0
- package/ai-config/skills/workflow/obsidian-brain-workflow/SKILL.md +199 -0
- package/ai-config/skills/workflow/using-git-worktrees/SKILL.md +100 -0
- package/ai-config/skills/workflow/verification-before-completion/SKILL.md +73 -0
- package/ai-config/skills/workflow/wave-workflow/SKILL.md +178 -0
- package/ci-local/README.md +170 -0
- package/ci-local/ci-local.sh +297 -0
- package/ci-local/hooks/commit-msg +74 -0
- package/ci-local/hooks/pre-commit +162 -0
- package/ci-local/hooks/pre-push +41 -0
- package/ci-local/install.sh +49 -0
- package/ci-local/semgrep.yml +214 -0
- package/dist/commands/analyze.d.ts +9 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +55 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/analyze.test.d.ts +2 -0
- package/dist/commands/analyze.test.d.ts.map +1 -0
- package/dist/commands/analyze.test.js +145 -0
- package/dist/commands/analyze.test.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +158 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/doctor.test.d.ts +2 -0
- package/dist/commands/doctor.test.d.ts.map +1 -0
- package/dist/commands/doctor.test.js +200 -0
- package/dist/commands/doctor.test.js.map +1 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +283 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/init.test.d.ts +2 -0
- package/dist/commands/init.test.d.ts.map +1 -0
- package/dist/commands/init.test.js +271 -0
- package/dist/commands/init.test.js.map +1 -0
- package/dist/commands/sync.d.ts +8 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +201 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/constants.d.ts +21 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +57 -0
- package/dist/constants.js.map +1 -0
- package/dist/e2e/aggressive.e2e.test.d.ts +2 -0
- package/dist/e2e/aggressive.e2e.test.d.ts.map +1 -0
- package/dist/e2e/aggressive.e2e.test.js +350 -0
- package/dist/e2e/aggressive.e2e.test.js.map +1 -0
- package/dist/e2e/commands.e2e.test.d.ts +2 -0
- package/dist/e2e/commands.e2e.test.d.ts.map +1 -0
- package/dist/e2e/commands.e2e.test.js +213 -0
- package/dist/e2e/commands.e2e.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +82 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/common.d.ts +17 -0
- package/dist/lib/common.d.ts.map +1 -0
- package/dist/lib/common.js +111 -0
- package/dist/lib/common.js.map +1 -0
- package/dist/lib/common.test.d.ts +2 -0
- package/dist/lib/common.test.d.ts.map +1 -0
- package/dist/lib/common.test.js +316 -0
- package/dist/lib/common.test.js.map +1 -0
- package/dist/lib/frontmatter.d.ts +18 -0
- package/dist/lib/frontmatter.d.ts.map +1 -0
- package/dist/lib/frontmatter.js +61 -0
- package/dist/lib/frontmatter.js.map +1 -0
- package/dist/lib/frontmatter.test.d.ts +2 -0
- package/dist/lib/frontmatter.test.d.ts.map +1 -0
- package/dist/lib/frontmatter.test.js +257 -0
- package/dist/lib/frontmatter.test.js.map +1 -0
- package/dist/lib/template.d.ts +24 -0
- package/dist/lib/template.d.ts.map +1 -0
- package/dist/lib/template.js +78 -0
- package/dist/lib/template.js.map +1 -0
- package/dist/lib/template.test.d.ts +2 -0
- package/dist/lib/template.test.d.ts.map +1 -0
- package/dist/lib/template.test.js +201 -0
- package/dist/lib/template.test.js.map +1 -0
- package/dist/types/index.d.ts +48 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ui/AnalyzeUI.d.ts +7 -0
- package/dist/ui/AnalyzeUI.d.ts.map +1 -0
- package/dist/ui/AnalyzeUI.js +100 -0
- package/dist/ui/AnalyzeUI.js.map +1 -0
- package/dist/ui/App.d.ts +13 -0
- package/dist/ui/App.d.ts.map +1 -0
- package/dist/ui/App.js +100 -0
- package/dist/ui/App.js.map +1 -0
- package/dist/ui/CIContext.d.ts +9 -0
- package/dist/ui/CIContext.d.ts.map +1 -0
- package/dist/ui/CIContext.js +9 -0
- package/dist/ui/CIContext.js.map +1 -0
- package/dist/ui/CISelector.d.ts +8 -0
- package/dist/ui/CISelector.d.ts.map +1 -0
- package/dist/ui/CISelector.js +45 -0
- package/dist/ui/CISelector.js.map +1 -0
- package/dist/ui/Doctor.d.ts +3 -0
- package/dist/ui/Doctor.d.ts.map +1 -0
- package/dist/ui/Doctor.js +89 -0
- package/dist/ui/Doctor.js.map +1 -0
- package/dist/ui/Header.d.ts +8 -0
- package/dist/ui/Header.d.ts.map +1 -0
- package/dist/ui/Header.js +30 -0
- package/dist/ui/Header.js.map +1 -0
- package/dist/ui/MemorySelector.d.ts +8 -0
- package/dist/ui/MemorySelector.d.ts.map +1 -0
- package/dist/ui/MemorySelector.js +46 -0
- package/dist/ui/MemorySelector.js.map +1 -0
- package/dist/ui/NameInput.d.ts +8 -0
- package/dist/ui/NameInput.d.ts.map +1 -0
- package/dist/ui/NameInput.js +69 -0
- package/dist/ui/NameInput.js.map +1 -0
- package/dist/ui/OptionSelector.d.ts +12 -0
- package/dist/ui/OptionSelector.d.ts.map +1 -0
- package/dist/ui/OptionSelector.js +69 -0
- package/dist/ui/OptionSelector.js.map +1 -0
- package/dist/ui/Progress.d.ts +11 -0
- package/dist/ui/Progress.d.ts.map +1 -0
- package/dist/ui/Progress.js +58 -0
- package/dist/ui/Progress.js.map +1 -0
- package/dist/ui/StackSelector.d.ts +9 -0
- package/dist/ui/StackSelector.d.ts.map +1 -0
- package/dist/ui/StackSelector.js +65 -0
- package/dist/ui/StackSelector.js.map +1 -0
- package/dist/ui/Summary.d.ts +12 -0
- package/dist/ui/Summary.d.ts.map +1 -0
- package/dist/ui/Summary.js +114 -0
- package/dist/ui/Summary.js.map +1 -0
- package/dist/ui/SyncUI.d.ts +10 -0
- package/dist/ui/SyncUI.d.ts.map +1 -0
- package/dist/ui/SyncUI.js +64 -0
- package/dist/ui/SyncUI.js.map +1 -0
- package/dist/ui/Welcome.d.ts +7 -0
- package/dist/ui/Welcome.d.ts.map +1 -0
- package/dist/ui/Welcome.js +45 -0
- package/dist/ui/Welcome.js.map +1 -0
- package/dist/ui/theme.d.ts +10 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +9 -0
- package/dist/ui/theme.js.map +1 -0
- package/modules/engram/.gitignore-snippet.txt +6 -0
- package/modules/engram/.mcp-config-snippet.json +11 -0
- package/modules/engram/README.md +146 -0
- package/modules/engram/install-engram.sh +216 -0
- package/modules/ghagga/.env.example +43 -0
- package/modules/ghagga/README.md +153 -0
- package/modules/ghagga/docker-compose.yml +80 -0
- package/modules/ghagga/setup-ghagga.sh +139 -0
- package/modules/memory-simple/.project/NOTES.md +22 -0
- package/modules/memory-simple/README.md +23 -0
- package/modules/obsidian-brain/.obsidian/app.json +23 -0
- package/modules/obsidian-brain/.obsidian/appearance.json +5 -0
- package/modules/obsidian-brain/.obsidian/bookmarks.json +34 -0
- package/modules/obsidian-brain/.obsidian/community-plugins.json +1 -0
- package/modules/obsidian-brain/.obsidian/core-plugins-migration.json +21 -0
- package/modules/obsidian-brain/.obsidian/core-plugins.json +18 -0
- package/modules/obsidian-brain/.obsidian/daily-notes.json +5 -0
- package/modules/obsidian-brain/.obsidian/graph.json +37 -0
- package/modules/obsidian-brain/.obsidian/hotkeys.json +14 -0
- package/modules/obsidian-brain/.obsidian/plugins/dataview/data.json +25 -0
- package/modules/obsidian-brain/.obsidian/plugins/obsidian-kanban/data.json +29 -0
- package/modules/obsidian-brain/.obsidian/plugins/templater-obsidian/data.json +18 -0
- package/modules/obsidian-brain/.obsidian/snippets/project-memory.css +71 -0
- package/modules/obsidian-brain/.obsidian-gitignore-snippet.txt +8 -0
- package/modules/obsidian-brain/.project/Attachments/.gitkeep +0 -0
- package/modules/obsidian-brain/.project/Memory/BLOCKERS.md +78 -0
- package/modules/obsidian-brain/.project/Memory/CONTEXT.md +102 -0
- package/modules/obsidian-brain/.project/Memory/DASHBOARD.md +73 -0
- package/modules/obsidian-brain/.project/Memory/DECISIONS.md +87 -0
- package/modules/obsidian-brain/.project/Memory/KANBAN.md +15 -0
- package/modules/obsidian-brain/.project/Memory/README.md +61 -0
- package/modules/obsidian-brain/.project/Memory/WAVES.md +78 -0
- package/modules/obsidian-brain/.project/Sessions/TEMPLATE.md +99 -0
- package/modules/obsidian-brain/.project/Templates/ADR.md +33 -0
- package/modules/obsidian-brain/.project/Templates/Blocker.md +21 -0
- package/modules/obsidian-brain/.project/Templates/Session.md +88 -0
- package/modules/obsidian-brain/README.md +268 -0
- package/modules/obsidian-brain/new-wave.sh +182 -0
- package/package.json +51 -0
- package/schemas/agent.schema.json +34 -0
- package/schemas/ai-config.schema.json +28 -0
- package/schemas/skill.schema.json +44 -0
- package/src/commands/analyze.test.ts +145 -0
- package/src/commands/analyze.ts +69 -0
- package/src/commands/doctor.test.ts +208 -0
- package/src/commands/doctor.ts +163 -0
- package/src/commands/init.test.ts +298 -0
- package/src/commands/init.ts +285 -0
- package/src/constants.ts +69 -0
- package/src/e2e/aggressive.e2e.test.ts +557 -0
- package/src/e2e/commands.e2e.test.ts +298 -0
- package/src/index.tsx +106 -0
- package/src/lib/common.test.ts +318 -0
- package/src/lib/common.ts +127 -0
- package/src/lib/frontmatter.test.ts +291 -0
- package/src/lib/frontmatter.ts +77 -0
- package/src/lib/template.test.ts +226 -0
- package/src/lib/template.ts +99 -0
- package/src/types/index.ts +53 -0
- package/src/ui/AnalyzeUI.tsx +133 -0
- package/src/ui/App.tsx +175 -0
- package/src/ui/CIContext.tsx +25 -0
- package/src/ui/CISelector.tsx +72 -0
- package/src/ui/Doctor.tsx +122 -0
- package/src/ui/Header.tsx +48 -0
- package/src/ui/MemorySelector.tsx +73 -0
- package/src/ui/NameInput.tsx +82 -0
- package/src/ui/OptionSelector.tsx +100 -0
- package/src/ui/Progress.tsx +88 -0
- package/src/ui/StackSelector.tsx +101 -0
- package/src/ui/Summary.tsx +134 -0
- package/src/ui/Welcome.tsx +54 -0
- package/src/ui/theme.ts +10 -0
- package/stryker.config.json +19 -0
- package/tasks/_TEMPLATE/files-edited.md +3 -0
- package/tasks/_TEMPLATE/plan.md +3 -0
- package/tasks/_TEMPLATE/research.md +3 -0
- package/tasks/_TEMPLATE/verification.md +5 -0
- package/templates/common/dependabot/cargo.yml +11 -0
- package/templates/common/dependabot/github-actions.yml +16 -0
- package/templates/common/dependabot/gomod.yml +15 -0
- package/templates/common/dependabot/gradle.yml +15 -0
- package/templates/common/dependabot/header.yml +3 -0
- package/templates/common/dependabot/maven.yml +15 -0
- package/templates/common/dependabot/npm.yml +20 -0
- package/templates/common/dependabot/pip.yml +11 -0
- package/templates/dependabot.yml +162 -0
- package/templates/github/ci-go.yml +41 -0
- package/templates/github/ci-java.yml +45 -0
- package/templates/github/ci-monorepo.yml +150 -0
- package/templates/github/ci-node.yml +42 -0
- package/templates/github/ci-python.yml +42 -0
- package/templates/github/ci-rust.yml +42 -0
- package/templates/github/dependabot-automerge.yml +40 -0
- package/templates/gitlab/gitlab-ci-go.yml +88 -0
- package/templates/gitlab/gitlab-ci-java.yml +79 -0
- package/templates/gitlab/gitlab-ci-monorepo.yml +126 -0
- package/templates/gitlab/gitlab-ci-node.yml +63 -0
- package/templates/gitlab/gitlab-ci-python.yml +147 -0
- package/templates/gitlab/gitlab-ci-rust.yml +67 -0
- package/templates/global/claude-settings.json +98 -0
- package/templates/global/codex-config.toml +8 -0
- package/templates/global/copilot-instructions/base-rules.instructions.md +13 -0
- package/templates/global/copilot-instructions/sdd-orchestrator.instructions.md +37 -0
- package/templates/global/gemini-commands/cleanup.toml +20 -0
- package/templates/global/gemini-commands/commit.toml +15 -0
- package/templates/global/gemini-commands/dead-code.toml +22 -0
- package/templates/global/gemini-commands/plan.toml +30 -0
- package/templates/global/gemini-commands/review.toml +17 -0
- package/templates/global/gemini-commands/sdd-apply.toml +22 -0
- package/templates/global/gemini-commands/sdd-ff.toml +14 -0
- package/templates/global/gemini-commands/sdd-new.toml +21 -0
- package/templates/global/gemini-commands/sdd-verify.toml +21 -0
- package/templates/global/gemini-commands/tdd.toml +26 -0
- package/templates/global/gemini-settings.json +8 -0
- package/templates/global/opencode-config.json +44 -0
- package/templates/global/sdd-instructions.md +47 -0
- package/templates/global/sdd-orchestrator-claude.md +46 -0
- package/templates/global/sdd-orchestrator-copilot.md +34 -0
- package/templates/renovate.json +69 -0
- package/templates/woodpecker/monorepo/backend.yml +34 -0
- package/templates/woodpecker/monorepo/frontend.yml +34 -0
- package/templates/woodpecker/monorepo/summary.yml +25 -0
- package/templates/woodpecker/woodpecker-go.yml +51 -0
- package/templates/woodpecker/woodpecker-java.yml +67 -0
- package/templates/woodpecker/woodpecker-node.yml +47 -0
- package/templates/woodpecker/woodpecker-python.yml +108 -0
- package/templates/woodpecker/woodpecker-rust.yml +57 -0
- package/tsconfig.json +19 -0
- package/vitest.config.ts +16 -0
- package/workflows/reusable-build-go.yml +111 -0
- package/workflows/reusable-build-java.yml +120 -0
- package/workflows/reusable-build-node.yml +145 -0
- package/workflows/reusable-build-python.yml +159 -0
- package/workflows/reusable-build-rust.yml +135 -0
- package/workflows/reusable-docker.yml +120 -0
- package/workflows/reusable-ghagga-review.yml +165 -0
- package/workflows/reusable-release.yml +91 -0
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: documentation-writer
|
|
3
|
+
description: Automated documentation specialist for technical writing, API docs, user guides, and comprehensive documentation
|
|
4
|
+
trigger: >
|
|
5
|
+
documentation, API docs, README, user guide, technical writing, JSDoc, Swagger,
|
|
6
|
+
OpenAPI, docstring, markdown, Javadoc, code comments, wiki
|
|
7
|
+
category: specialized
|
|
8
|
+
color: yellow
|
|
9
|
+
tools: Write, Read, MultiEdit, Bash, Grep, Glob
|
|
10
|
+
config:
|
|
11
|
+
model: haiku
|
|
12
|
+
metadata:
|
|
13
|
+
version: "2.0"
|
|
14
|
+
updated: "2026-02"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
You are a documentation writing specialist with expertise in technical writing, API documentation, user guides, and automated documentation generation.
|
|
18
|
+
|
|
19
|
+
## Core Expertise
|
|
20
|
+
- Technical documentation and writing
|
|
21
|
+
- API documentation (OpenAPI, Swagger, GraphQL)
|
|
22
|
+
- Code documentation and comments
|
|
23
|
+
- User guides and tutorials
|
|
24
|
+
- Architecture documentation
|
|
25
|
+
- README files and wikis
|
|
26
|
+
- Documentation automation and generation
|
|
27
|
+
- Documentation-as-code practices
|
|
28
|
+
|
|
29
|
+
## Technical Stack
|
|
30
|
+
- **Doc Generators**: JSDoc, TypeDoc, Sphinx, Doxygen, GoDoc
|
|
31
|
+
- **API Docs**: Swagger/OpenAPI, Postman, Insomnia, GraphQL Playground
|
|
32
|
+
- **Static Sites**: Docusaurus, MkDocs, VuePress, GitBook
|
|
33
|
+
- **Diagrams**: Mermaid, PlantUML, Draw.io, Lucidchart
|
|
34
|
+
- **Formats**: Markdown, reStructuredText, AsciiDoc, LaTeX
|
|
35
|
+
- **Publishing**: GitHub Pages, Read the Docs, Netlify, Vercel
|
|
36
|
+
- **Testing**: Vale, textlint, markdown-lint, write-good
|
|
37
|
+
|
|
38
|
+
## Automated Documentation Framework
|
|
39
|
+
```typescript
|
|
40
|
+
// documentation-generator.ts
|
|
41
|
+
import * as fs from 'fs/promises';
|
|
42
|
+
import * as path from 'path';
|
|
43
|
+
import * as ts from 'typescript';
|
|
44
|
+
import { parse as parseJSDoc } from 'comment-parser';
|
|
45
|
+
import * as marked from 'marked';
|
|
46
|
+
import * as yaml from 'js-yaml';
|
|
47
|
+
|
|
48
|
+
interface DocumentationConfig {
|
|
49
|
+
projectPath: string;
|
|
50
|
+
outputPath: string;
|
|
51
|
+
format: 'markdown' | 'html' | 'json';
|
|
52
|
+
includes: string[];
|
|
53
|
+
excludes: string[];
|
|
54
|
+
templates?: Map<string, string>;
|
|
55
|
+
plugins?: DocumentationPlugin[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface DocumentationSection {
|
|
59
|
+
id: string;
|
|
60
|
+
title: string;
|
|
61
|
+
content: string;
|
|
62
|
+
level: number;
|
|
63
|
+
children: DocumentationSection[];
|
|
64
|
+
metadata?: any;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
class DocumentationGenerator {
|
|
68
|
+
private config: DocumentationConfig;
|
|
69
|
+
private sections: Map<string, DocumentationSection> = new Map();
|
|
70
|
+
private templates: Map<string, HandlebarsTemplate> = new Map();
|
|
71
|
+
private analyzers: Map<string, CodeAnalyzer> = new Map();
|
|
72
|
+
|
|
73
|
+
constructor(config: DocumentationConfig) {
|
|
74
|
+
this.config = config;
|
|
75
|
+
this.initializeAnalyzers();
|
|
76
|
+
this.loadTemplates();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async generate(): Promise<Documentation> {
|
|
80
|
+
// Analyze project structure
|
|
81
|
+
const structure = await this.analyzeProjectStructure();
|
|
82
|
+
|
|
83
|
+
// Extract code documentation
|
|
84
|
+
const codeDoc = await this.extractCodeDocumentation();
|
|
85
|
+
|
|
86
|
+
// Generate API documentation
|
|
87
|
+
const apiDoc = await this.generateAPIDocs();
|
|
88
|
+
|
|
89
|
+
// Create user guides
|
|
90
|
+
const guides = await this.generateUserGuides();
|
|
91
|
+
|
|
92
|
+
// Generate architecture docs
|
|
93
|
+
const architecture = await this.generateArchitectureDocs();
|
|
94
|
+
|
|
95
|
+
// Generate README
|
|
96
|
+
const readme = await this.generateREADME({
|
|
97
|
+
structure,
|
|
98
|
+
codeDoc,
|
|
99
|
+
apiDoc,
|
|
100
|
+
guides,
|
|
101
|
+
architecture,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Compile full documentation
|
|
105
|
+
const documentation = this.compileDocumentation({
|
|
106
|
+
readme,
|
|
107
|
+
architecture,
|
|
108
|
+
api: apiDoc,
|
|
109
|
+
guides,
|
|
110
|
+
code: codeDoc,
|
|
111
|
+
changelog: await this.generateChangelog(),
|
|
112
|
+
contributing: await this.generateContributing(),
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Validate documentation
|
|
116
|
+
await this.validateDocumentation(documentation);
|
|
117
|
+
|
|
118
|
+
// Write documentation
|
|
119
|
+
await this.writeDocumentation(documentation);
|
|
120
|
+
|
|
121
|
+
return documentation;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private async analyzeProjectStructure(): Promise<ProjectStructure> {
|
|
125
|
+
const structure: ProjectStructure = {
|
|
126
|
+
root: this.config.projectPath,
|
|
127
|
+
files: [],
|
|
128
|
+
directories: [],
|
|
129
|
+
languages: new Set(),
|
|
130
|
+
frameworks: new Set(),
|
|
131
|
+
dependencies: new Map(),
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// Scan project files
|
|
135
|
+
await this.scanDirectory(this.config.projectPath, structure);
|
|
136
|
+
|
|
137
|
+
// Detect languages and frameworks
|
|
138
|
+
await this.detectTechnologies(structure);
|
|
139
|
+
|
|
140
|
+
// Analyze dependencies
|
|
141
|
+
await this.analyzeDependencies(structure);
|
|
142
|
+
|
|
143
|
+
return structure;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private async extractCodeDocumentation(): Promise<CodeDocumentation> {
|
|
147
|
+
const docs: CodeDocumentation = {
|
|
148
|
+
classes: [],
|
|
149
|
+
functions: [],
|
|
150
|
+
interfaces: [],
|
|
151
|
+
types: [],
|
|
152
|
+
constants: [],
|
|
153
|
+
modules: [],
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// Find all source files
|
|
157
|
+
const sourceFiles = await this.findSourceFiles();
|
|
158
|
+
|
|
159
|
+
for (const file of sourceFiles) {
|
|
160
|
+
const analyzer = this.getAnalyzer(file);
|
|
161
|
+
if (analyzer) {
|
|
162
|
+
const fileDoc = await analyzer.analyze(file);
|
|
163
|
+
this.mergeDocumentation(docs, fileDoc);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return docs;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private async generateAPIDocs(): Promise<APIDocumentation> {
|
|
171
|
+
const apiDoc: APIDocumentation = {
|
|
172
|
+
endpoints: [],
|
|
173
|
+
schemas: [],
|
|
174
|
+
authentication: [],
|
|
175
|
+
examples: [],
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// Find API definition files
|
|
179
|
+
const openApiFiles = await this.findFiles('**/openapi.{yaml,yml,json}');
|
|
180
|
+
const swaggerFiles = await this.findFiles('**/swagger.{yaml,yml,json}');
|
|
181
|
+
|
|
182
|
+
// Parse OpenAPI/Swagger
|
|
183
|
+
for (const file of [...openApiFiles, ...swaggerFiles]) {
|
|
184
|
+
const content = await fs.readFile(file, 'utf-8');
|
|
185
|
+
const spec = file.endsWith('.json')
|
|
186
|
+
? JSON.parse(content)
|
|
187
|
+
: yaml.load(content);
|
|
188
|
+
|
|
189
|
+
apiDoc.endpoints.push(...this.extractEndpoints(spec));
|
|
190
|
+
apiDoc.schemas.push(...this.extractSchemas(spec));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// Find route handlers
|
|
194
|
+
const routes = await this.findRouteHandlers();
|
|
195
|
+
apiDoc.endpoints.push(...routes);
|
|
196
|
+
|
|
197
|
+
// Generate examples
|
|
198
|
+
apiDoc.examples = this.generateAPIExamples(apiDoc.endpoints);
|
|
199
|
+
|
|
200
|
+
return apiDoc;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
private async generateUserGuides(): Promise<UserGuide[]> {
|
|
204
|
+
const guides: UserGuide[] = [];
|
|
205
|
+
|
|
206
|
+
// Getting Started Guide
|
|
207
|
+
guides.push({
|
|
208
|
+
id: 'getting-started',
|
|
209
|
+
title: 'Getting Started',
|
|
210
|
+
sections: [
|
|
211
|
+
await this.generateInstallation(),
|
|
212
|
+
await this.generateQuickStart(),
|
|
213
|
+
await this.generateBasicUsage(),
|
|
214
|
+
],
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// User Guide
|
|
218
|
+
guides.push({
|
|
219
|
+
id: 'user-guide',
|
|
220
|
+
title: 'User Guide',
|
|
221
|
+
sections: [
|
|
222
|
+
await this.generateFeatures(),
|
|
223
|
+
await this.generateConfiguration(),
|
|
224
|
+
await this.generateAdvancedUsage(),
|
|
225
|
+
],
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// Troubleshooting Guide
|
|
229
|
+
guides.push({
|
|
230
|
+
id: 'troubleshooting',
|
|
231
|
+
title: 'Troubleshooting',
|
|
232
|
+
sections: [
|
|
233
|
+
await this.generateCommonIssues(),
|
|
234
|
+
await this.generateFAQ(),
|
|
235
|
+
await this.generateSupport(),
|
|
236
|
+
],
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
return guides;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
private async generateArchitectureDocs(): Promise<ArchitectureDocumentation> {
|
|
243
|
+
const architecture: ArchitectureDocumentation = {
|
|
244
|
+
overview: await this.generateArchitectureOverview(),
|
|
245
|
+
components: await this.analyzeComponents(),
|
|
246
|
+
dataFlow: await this.analyzeDataFlow(),
|
|
247
|
+
diagrams: await this.generateDiagrams(),
|
|
248
|
+
decisions: await this.findArchitectureDecisions(),
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
return architecture;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
private async generateREADME(data: any): Promise<string> {
|
|
255
|
+
const template = this.templates.get('readme') || this.getDefaultREADMETemplate();
|
|
256
|
+
|
|
257
|
+
const context = {
|
|
258
|
+
projectName: await this.detectProjectName(),
|
|
259
|
+
description: await this.generateDescription(data),
|
|
260
|
+
badges: this.generateBadges(),
|
|
261
|
+
installation: await this.generateInstallation(),
|
|
262
|
+
usage: await this.generateBasicUsage(),
|
|
263
|
+
features: await this.generateFeatureList(data),
|
|
264
|
+
documentation: this.generateDocLinks(),
|
|
265
|
+
contributing: 'See [CONTRIBUTING.md](CONTRIBUTING.md)',
|
|
266
|
+
license: await this.detectLicense(),
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
return template(context);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
private async generateInstallation(): Promise<DocumentationSection> {
|
|
273
|
+
const packageManagers = await this.detectPackageManagers();
|
|
274
|
+
const installCommands: string[] = [];
|
|
275
|
+
|
|
276
|
+
if (packageManagers.has('npm')) {
|
|
277
|
+
installCommands.push('npm install');
|
|
278
|
+
}
|
|
279
|
+
if (packageManagers.has('yarn')) {
|
|
280
|
+
installCommands.push('yarn install');
|
|
281
|
+
}
|
|
282
|
+
if (packageManagers.has('pip')) {
|
|
283
|
+
installCommands.push('pip install -r requirements.txt');
|
|
284
|
+
}
|
|
285
|
+
if (packageManagers.has('go')) {
|
|
286
|
+
installCommands.push('go get');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
return {
|
|
290
|
+
id: 'installation',
|
|
291
|
+
title: 'Installation',
|
|
292
|
+
level: 2,
|
|
293
|
+
content: this.formatInstallation(installCommands),
|
|
294
|
+
children: [],
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
private formatInstallation(commands: string[]): string {
|
|
299
|
+
if (commands.length === 0) {
|
|
300
|
+
return 'No installation steps detected.';
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return `
|
|
304
|
+
## Prerequisites
|
|
305
|
+
|
|
306
|
+
- Node.js >= 14.0.0 (if using npm/yarn)
|
|
307
|
+
- Python >= 3.7 (if using pip)
|
|
308
|
+
- Go >= 1.16 (if using go modules)
|
|
309
|
+
|
|
310
|
+
## Install Dependencies
|
|
311
|
+
|
|
312
|
+
\`\`\`bash
|
|
313
|
+
${commands[0]}
|
|
314
|
+
\`\`\`
|
|
315
|
+
|
|
316
|
+
${commands.length > 1 ? `
|
|
317
|
+
### Alternative Package Managers
|
|
318
|
+
|
|
319
|
+
${commands.slice(1).map(cmd => `\`\`\`bash\n${cmd}\n\`\`\``).join('\n\n')}
|
|
320
|
+
` : ''}
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
private async generateQuickStart(): Promise<DocumentationSection> {
|
|
325
|
+
const examples = await this.findExamples();
|
|
326
|
+
|
|
327
|
+
return {
|
|
328
|
+
id: 'quick-start',
|
|
329
|
+
title: 'Quick Start',
|
|
330
|
+
level: 2,
|
|
331
|
+
content: `
|
|
332
|
+
## Quick Start
|
|
333
|
+
|
|
334
|
+
### Basic Example
|
|
335
|
+
|
|
336
|
+
\`\`\`javascript
|
|
337
|
+
${examples[0] || '// Add your first example here'}
|
|
338
|
+
\`\`\`
|
|
339
|
+
|
|
340
|
+
### Running the Application
|
|
341
|
+
|
|
342
|
+
\`\`\`bash
|
|
343
|
+
npm start
|
|
344
|
+
\`\`\`
|
|
345
|
+
|
|
346
|
+
### Verify Installation
|
|
347
|
+
|
|
348
|
+
\`\`\`bash
|
|
349
|
+
npm test
|
|
350
|
+
\`\`\`
|
|
351
|
+
`,
|
|
352
|
+
children: [],
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
private async generateChangelog(): Promise<DocumentationSection> {
|
|
357
|
+
const changelog = await this.parseChangelog();
|
|
358
|
+
|
|
359
|
+
if (!changelog) {
|
|
360
|
+
return this.generateDefaultChangelog();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return {
|
|
364
|
+
id: 'changelog',
|
|
365
|
+
title: 'Changelog',
|
|
366
|
+
level: 1,
|
|
367
|
+
content: changelog,
|
|
368
|
+
children: [],
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
private async generateContributing(): Promise<DocumentationSection> {
|
|
373
|
+
return {
|
|
374
|
+
id: 'contributing',
|
|
375
|
+
title: 'Contributing',
|
|
376
|
+
level: 1,
|
|
377
|
+
content: `
|
|
378
|
+
# Contributing
|
|
379
|
+
|
|
380
|
+
We welcome contributions! Please see our [Code of Conduct](CODE_OF_CONDUCT.md) first.
|
|
381
|
+
|
|
382
|
+
## How to Contribute
|
|
383
|
+
|
|
384
|
+
1. Fork the repository
|
|
385
|
+
2. Create your feature branch (\`git checkout -b feature/amazing-feature\`)
|
|
386
|
+
3. Commit your changes (\`git commit -m 'Add some amazing feature'\`)
|
|
387
|
+
4. Push to the branch (\`git push origin feature/amazing-feature\`)
|
|
388
|
+
5. Open a Pull Request
|
|
389
|
+
|
|
390
|
+
## Development Setup
|
|
391
|
+
|
|
392
|
+
\`\`\`bash
|
|
393
|
+
# Clone your fork
|
|
394
|
+
git clone https://github.com/your-username/project-name.git
|
|
395
|
+
|
|
396
|
+
# Install dependencies
|
|
397
|
+
npm install
|
|
398
|
+
|
|
399
|
+
# Run tests
|
|
400
|
+
npm test
|
|
401
|
+
|
|
402
|
+
# Run development server
|
|
403
|
+
npm run dev
|
|
404
|
+
\`\`\`
|
|
405
|
+
|
|
406
|
+
## Coding Standards
|
|
407
|
+
|
|
408
|
+
- Follow existing code style
|
|
409
|
+
- Write tests for new features
|
|
410
|
+
- Update documentation as needed
|
|
411
|
+
- Keep commits atomic and descriptive
|
|
412
|
+
|
|
413
|
+
## Pull Request Process
|
|
414
|
+
|
|
415
|
+
1. Update the README.md with details of changes
|
|
416
|
+
2. Update the CHANGELOG.md with your changes
|
|
417
|
+
3. Ensure all tests pass
|
|
418
|
+
4. Request review from maintainers
|
|
419
|
+
`,
|
|
420
|
+
children: [],
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
private compileDocumentation(sections: any): Documentation {
|
|
425
|
+
return {
|
|
426
|
+
version: '1.0.0',
|
|
427
|
+
generated: new Date(),
|
|
428
|
+
format: this.config.format,
|
|
429
|
+
sections: Object.entries(sections).map(([key, value]) => ({
|
|
430
|
+
id: key,
|
|
431
|
+
title: this.titleCase(key),
|
|
432
|
+
content: value,
|
|
433
|
+
level: 1,
|
|
434
|
+
children: [],
|
|
435
|
+
})),
|
|
436
|
+
metadata: {
|
|
437
|
+
generator: 'documentation-writer',
|
|
438
|
+
config: this.config,
|
|
439
|
+
},
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
private async validateDocumentation(doc: Documentation): Promise<void> {
|
|
444
|
+
const errors: string[] = [];
|
|
445
|
+
|
|
446
|
+
// Check for broken links
|
|
447
|
+
const links = this.extractLinks(doc);
|
|
448
|
+
for (const link of links) {
|
|
449
|
+
if (!await this.validateLink(link)) {
|
|
450
|
+
errors.push(`Broken link: ${link}`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Check for missing sections
|
|
455
|
+
const requiredSections = ['readme', 'installation', 'usage'];
|
|
456
|
+
for (const section of requiredSections) {
|
|
457
|
+
if (!doc.sections.find(s => s.id === section)) {
|
|
458
|
+
errors.push(`Missing required section: ${section}`);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
// Check code examples
|
|
463
|
+
const codeBlocks = this.extractCodeBlocks(doc);
|
|
464
|
+
for (const block of codeBlocks) {
|
|
465
|
+
if (!this.validateCodeBlock(block)) {
|
|
466
|
+
errors.push(`Invalid code block: ${block.language}`);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (errors.length > 0) {
|
|
471
|
+
console.warn('Documentation validation warnings:', errors);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
private async writeDocumentation(doc: Documentation): Promise<void> {
|
|
476
|
+
const outputPath = this.config.outputPath;
|
|
477
|
+
|
|
478
|
+
// Create output directory
|
|
479
|
+
await fs.mkdir(outputPath, { recursive: true });
|
|
480
|
+
|
|
481
|
+
// Write main documentation
|
|
482
|
+
for (const section of doc.sections) {
|
|
483
|
+
const fileName = `${section.id}.md`;
|
|
484
|
+
const filePath = path.join(outputPath, fileName);
|
|
485
|
+
await fs.writeFile(filePath, this.formatSection(section));
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
// Generate index
|
|
489
|
+
const index = this.generateIndex(doc);
|
|
490
|
+
await fs.writeFile(path.join(outputPath, 'index.md'), index);
|
|
491
|
+
|
|
492
|
+
// Generate HTML if requested
|
|
493
|
+
if (this.config.format === 'html') {
|
|
494
|
+
await this.generateHTML(doc);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Generate JSON if requested
|
|
498
|
+
if (this.config.format === 'json') {
|
|
499
|
+
await fs.writeFile(
|
|
500
|
+
path.join(outputPath, 'documentation.json'),
|
|
501
|
+
JSON.stringify(doc, null, 2)
|
|
502
|
+
);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
private formatSection(section: DocumentationSection): string {
|
|
507
|
+
const heading = '#'.repeat(section.level) + ' ' + section.title;
|
|
508
|
+
const content = section.content;
|
|
509
|
+
const children = section.children
|
|
510
|
+
.map(child => this.formatSection(child))
|
|
511
|
+
.join('\n\n');
|
|
512
|
+
|
|
513
|
+
return `${heading}\n\n${content}\n\n${children}`.trim();
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
private generateIndex(doc: Documentation): string {
|
|
517
|
+
const toc = this.generateTableOfContents(doc);
|
|
518
|
+
|
|
519
|
+
return `# Documentation
|
|
520
|
+
|
|
521
|
+
${toc}
|
|
522
|
+
|
|
523
|
+
## Overview
|
|
524
|
+
|
|
525
|
+
This documentation was automatically generated on ${doc.generated.toISOString()}.
|
|
526
|
+
|
|
527
|
+
## Sections
|
|
528
|
+
|
|
529
|
+
${doc.sections.map(s => `- [${s.title}](${s.id}.md)`).join('\n')}
|
|
530
|
+
|
|
531
|
+
## Quick Links
|
|
532
|
+
|
|
533
|
+
- [Getting Started](getting-started.md)
|
|
534
|
+
- [API Reference](api.md)
|
|
535
|
+
- [Contributing](contributing.md)
|
|
536
|
+
- [Changelog](changelog.md)
|
|
537
|
+
`;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
private generateTableOfContents(doc: Documentation): string {
|
|
541
|
+
const toc: string[] = ['## Table of Contents\n'];
|
|
542
|
+
|
|
543
|
+
for (const section of doc.sections) {
|
|
544
|
+
toc.push(this.generateTOCEntry(section, 0));
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
return toc.join('\n');
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
private generateTOCEntry(section: DocumentationSection, depth: number): string {
|
|
551
|
+
const indent = ' '.repeat(depth);
|
|
552
|
+
const entry = `${indent}- [${section.title}](#${section.id})`;
|
|
553
|
+
const children = section.children
|
|
554
|
+
.map(child => this.generateTOCEntry(child, depth + 1))
|
|
555
|
+
.join('\n');
|
|
556
|
+
|
|
557
|
+
return children ? `${entry}\n${children}` : entry;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
private async generateHTML(doc: Documentation): Promise<void> {
|
|
561
|
+
const html = `
|
|
562
|
+
<!DOCTYPE html>
|
|
563
|
+
<html lang="en">
|
|
564
|
+
<head>
|
|
565
|
+
<meta charset="UTF-8">
|
|
566
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
567
|
+
<title>Documentation</title>
|
|
568
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown.min.css">
|
|
569
|
+
<style>
|
|
570
|
+
body {
|
|
571
|
+
box-sizing: border-box;
|
|
572
|
+
min-width: 200px;
|
|
573
|
+
max-width: 980px;
|
|
574
|
+
margin: 0 auto;
|
|
575
|
+
padding: 45px;
|
|
576
|
+
}
|
|
577
|
+
</style>
|
|
578
|
+
</head>
|
|
579
|
+
<body class="markdown-body">
|
|
580
|
+
${doc.sections.map(s => this.sectionToHTML(s)).join('\n')}
|
|
581
|
+
</body>
|
|
582
|
+
</html>
|
|
583
|
+
`;
|
|
584
|
+
|
|
585
|
+
await fs.writeFile(
|
|
586
|
+
path.join(this.config.outputPath, 'index.html'),
|
|
587
|
+
html
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
private sectionToHTML(section: DocumentationSection): string {
|
|
592
|
+
const html = marked.parse(this.formatSection(section));
|
|
593
|
+
return `<section id="${section.id}">${html}</section>`;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
private initializeAnalyzers(): void {
|
|
597
|
+
this.analyzers.set('.ts', new TypeScriptAnalyzer());
|
|
598
|
+
this.analyzers.set('.js', new JavaScriptAnalyzer());
|
|
599
|
+
this.analyzers.set('.py', new PythonAnalyzer());
|
|
600
|
+
this.analyzers.set('.go', new GoAnalyzer());
|
|
601
|
+
this.analyzers.set('.java', new JavaAnalyzer());
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
private getAnalyzer(file: string): CodeAnalyzer | undefined {
|
|
605
|
+
const ext = path.extname(file);
|
|
606
|
+
return this.analyzers.get(ext);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
private async findSourceFiles(): Promise<string[]> {
|
|
610
|
+
const files: string[] = [];
|
|
611
|
+
const extensions = ['.ts', '.js', '.py', '.go', '.java', '.rs'];
|
|
612
|
+
|
|
613
|
+
for (const ext of extensions) {
|
|
614
|
+
const pattern = `**/*${ext}`;
|
|
615
|
+
const found = await this.findFiles(pattern);
|
|
616
|
+
files.push(...found);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
return files;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
private async findFiles(pattern: string): Promise<string[]> {
|
|
623
|
+
// Implementation would use glob or similar
|
|
624
|
+
return [];
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
private extractLinks(doc: Documentation): string[] {
|
|
628
|
+
const links: string[] = [];
|
|
629
|
+
const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
630
|
+
|
|
631
|
+
for (const section of doc.sections) {
|
|
632
|
+
const matches = section.content.matchAll(linkRegex);
|
|
633
|
+
for (const match of matches) {
|
|
634
|
+
links.push(match[2]);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
return links;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
private async validateLink(link: string): Promise<boolean> {
|
|
642
|
+
if (link.startsWith('http')) {
|
|
643
|
+
// Check external link
|
|
644
|
+
try {
|
|
645
|
+
const response = await fetch(link, { method: 'HEAD' });
|
|
646
|
+
return response.ok;
|
|
647
|
+
} catch {
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
} else {
|
|
651
|
+
// Check local file
|
|
652
|
+
try {
|
|
653
|
+
await fs.access(path.join(this.config.projectPath, link));
|
|
654
|
+
return true;
|
|
655
|
+
} catch {
|
|
656
|
+
return false;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
private extractCodeBlocks(doc: Documentation): CodeBlock[] {
|
|
662
|
+
const blocks: CodeBlock[] = [];
|
|
663
|
+
const codeRegex = /```(\w+)?\n([\s\S]*?)```/g;
|
|
664
|
+
|
|
665
|
+
for (const section of doc.sections) {
|
|
666
|
+
const matches = section.content.matchAll(codeRegex);
|
|
667
|
+
for (const match of matches) {
|
|
668
|
+
blocks.push({
|
|
669
|
+
language: match[1] || 'text',
|
|
670
|
+
code: match[2],
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
return blocks;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
private validateCodeBlock(block: CodeBlock): boolean {
|
|
679
|
+
// Basic validation - could be extended with syntax checking
|
|
680
|
+
return block.code.trim().length > 0;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
private titleCase(str: string): string {
|
|
684
|
+
return str.charAt(0).toUpperCase() + str.slice(1).replace(/-/g, ' ');
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
private getDefaultREADMETemplate(): HandlebarsTemplate {
|
|
688
|
+
return (context: any) => `# ${context.projectName}
|
|
689
|
+
|
|
690
|
+
${context.badges}
|
|
691
|
+
|
|
692
|
+
${context.description}
|
|
693
|
+
|
|
694
|
+
## Installation
|
|
695
|
+
|
|
696
|
+
${context.installation}
|
|
697
|
+
|
|
698
|
+
## Usage
|
|
699
|
+
|
|
700
|
+
${context.usage}
|
|
701
|
+
|
|
702
|
+
## Features
|
|
703
|
+
|
|
704
|
+
${context.features}
|
|
705
|
+
|
|
706
|
+
## Documentation
|
|
707
|
+
|
|
708
|
+
${context.documentation}
|
|
709
|
+
|
|
710
|
+
## Contributing
|
|
711
|
+
|
|
712
|
+
${context.contributing}
|
|
713
|
+
|
|
714
|
+
## License
|
|
715
|
+
|
|
716
|
+
${context.license}
|
|
717
|
+
`;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// Additional helper methods...
|
|
721
|
+
private async detectProjectName(): Promise<string> {
|
|
722
|
+
try {
|
|
723
|
+
const packageJson = await fs.readFile(
|
|
724
|
+
path.join(this.config.projectPath, 'package.json'),
|
|
725
|
+
'utf-8'
|
|
726
|
+
);
|
|
727
|
+
return JSON.parse(packageJson).name;
|
|
728
|
+
} catch {
|
|
729
|
+
return path.basename(this.config.projectPath);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
private async generateDescription(data: any): Promise<string> {
|
|
734
|
+
// Generate description based on analyzed data
|
|
735
|
+
return 'A comprehensive project with excellent documentation.';
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
private generateBadges(): string {
|
|
739
|
+
return `
|
|
740
|
+
[](https://github.com/user/repo/actions)
|
|
741
|
+
[](https://codecov.io/gh/user/repo)
|
|
742
|
+
[](LICENSE)
|
|
743
|
+
[](https://www.npmjs.com/package/package)
|
|
744
|
+
`;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
private async generateFeatureList(data: any): Promise<string> {
|
|
748
|
+
const features = [
|
|
749
|
+
'✨ Feature 1',
|
|
750
|
+
'🚀 Feature 2',
|
|
751
|
+
'🔧 Feature 3',
|
|
752
|
+
];
|
|
753
|
+
|
|
754
|
+
return features.join('\n');
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
private generateDocLinks(): string {
|
|
758
|
+
return `
|
|
759
|
+
- [Getting Started](docs/getting-started.md)
|
|
760
|
+
- [API Reference](docs/api.md)
|
|
761
|
+
- [User Guide](docs/user-guide.md)
|
|
762
|
+
- [Contributing](CONTRIBUTING.md)
|
|
763
|
+
`;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
private async detectLicense(): Promise<string> {
|
|
767
|
+
try {
|
|
768
|
+
await fs.access(path.join(this.config.projectPath, 'LICENSE'));
|
|
769
|
+
return 'This project is licensed under the terms in the [LICENSE](LICENSE) file.';
|
|
770
|
+
} catch {
|
|
771
|
+
return 'License information not available.';
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// Analyzer implementations
|
|
777
|
+
abstract class CodeAnalyzer {
|
|
778
|
+
abstract analyze(file: string): Promise<CodeDocumentation>;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
class TypeScriptAnalyzer extends CodeAnalyzer {
|
|
782
|
+
async analyze(file: string): Promise<CodeDocumentation> {
|
|
783
|
+
const source = await fs.readFile(file, 'utf-8');
|
|
784
|
+
const sourceFile = ts.createSourceFile(
|
|
785
|
+
file,
|
|
786
|
+
source,
|
|
787
|
+
ts.ScriptTarget.Latest,
|
|
788
|
+
true
|
|
789
|
+
);
|
|
790
|
+
|
|
791
|
+
const docs: CodeDocumentation = {
|
|
792
|
+
classes: [],
|
|
793
|
+
functions: [],
|
|
794
|
+
interfaces: [],
|
|
795
|
+
types: [],
|
|
796
|
+
constants: [],
|
|
797
|
+
modules: [],
|
|
798
|
+
};
|
|
799
|
+
|
|
800
|
+
ts.forEachChild(sourceFile, node => {
|
|
801
|
+
if (ts.isClassDeclaration(node) && node.name) {
|
|
802
|
+
docs.classes.push(this.extractClass(node));
|
|
803
|
+
} else if (ts.isFunctionDeclaration(node) && node.name) {
|
|
804
|
+
docs.functions.push(this.extractFunction(node));
|
|
805
|
+
} else if (ts.isInterfaceDeclaration(node)) {
|
|
806
|
+
docs.interfaces.push(this.extractInterface(node));
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
|
|
810
|
+
return docs;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
private extractClass(node: ts.ClassDeclaration): any {
|
|
814
|
+
return {
|
|
815
|
+
name: node.name?.getText(),
|
|
816
|
+
documentation: this.extractJSDoc(node),
|
|
817
|
+
members: [],
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
private extractFunction(node: ts.FunctionDeclaration): any {
|
|
822
|
+
return {
|
|
823
|
+
name: node.name?.getText(),
|
|
824
|
+
documentation: this.extractJSDoc(node),
|
|
825
|
+
parameters: node.parameters.map(p => p.name.getText()),
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
private extractInterface(node: ts.InterfaceDeclaration): any {
|
|
830
|
+
return {
|
|
831
|
+
name: node.name.getText(),
|
|
832
|
+
documentation: this.extractJSDoc(node),
|
|
833
|
+
properties: [],
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
private extractJSDoc(node: ts.Node): string {
|
|
838
|
+
const text = node.getFullText();
|
|
839
|
+
const match = text.match(/\/\*\*([\s\S]*?)\*\//);
|
|
840
|
+
return match ? match[1].trim() : '';
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
class JavaScriptAnalyzer extends CodeAnalyzer {
|
|
845
|
+
async analyze(file: string): Promise<CodeDocumentation> {
|
|
846
|
+
// Similar to TypeScript but for JavaScript
|
|
847
|
+
return {
|
|
848
|
+
classes: [],
|
|
849
|
+
functions: [],
|
|
850
|
+
interfaces: [],
|
|
851
|
+
types: [],
|
|
852
|
+
constants: [],
|
|
853
|
+
modules: [],
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
class PythonAnalyzer extends CodeAnalyzer {
|
|
859
|
+
async analyze(file: string): Promise<CodeDocumentation> {
|
|
860
|
+
// Python-specific analysis
|
|
861
|
+
return {
|
|
862
|
+
classes: [],
|
|
863
|
+
functions: [],
|
|
864
|
+
interfaces: [],
|
|
865
|
+
types: [],
|
|
866
|
+
constants: [],
|
|
867
|
+
modules: [],
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
class GoAnalyzer extends CodeAnalyzer {
|
|
873
|
+
async analyze(file: string): Promise<CodeDocumentation> {
|
|
874
|
+
// Go-specific analysis
|
|
875
|
+
return {
|
|
876
|
+
classes: [],
|
|
877
|
+
functions: [],
|
|
878
|
+
interfaces: [],
|
|
879
|
+
types: [],
|
|
880
|
+
constants: [],
|
|
881
|
+
modules: [],
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
class JavaAnalyzer extends CodeAnalyzer {
|
|
887
|
+
async analyze(file: string): Promise<CodeDocumentation> {
|
|
888
|
+
// Java-specific analysis
|
|
889
|
+
return {
|
|
890
|
+
classes: [],
|
|
891
|
+
functions: [],
|
|
892
|
+
interfaces: [],
|
|
893
|
+
types: [],
|
|
894
|
+
constants: [],
|
|
895
|
+
modules: [],
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// Type definitions
|
|
901
|
+
interface Documentation {
|
|
902
|
+
version: string;
|
|
903
|
+
generated: Date;
|
|
904
|
+
format: string;
|
|
905
|
+
sections: DocumentationSection[];
|
|
906
|
+
metadata: any;
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
interface ProjectStructure {
|
|
910
|
+
root: string;
|
|
911
|
+
files: string[];
|
|
912
|
+
directories: string[];
|
|
913
|
+
languages: Set<string>;
|
|
914
|
+
frameworks: Set<string>;
|
|
915
|
+
dependencies: Map<string, string>;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
interface CodeDocumentation {
|
|
919
|
+
classes: any[];
|
|
920
|
+
functions: any[];
|
|
921
|
+
interfaces: any[];
|
|
922
|
+
types: any[];
|
|
923
|
+
constants: any[];
|
|
924
|
+
modules: any[];
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
interface APIDocumentation {
|
|
928
|
+
endpoints: any[];
|
|
929
|
+
schemas: any[];
|
|
930
|
+
authentication: any[];
|
|
931
|
+
examples: any[];
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
interface UserGuide {
|
|
935
|
+
id: string;
|
|
936
|
+
title: string;
|
|
937
|
+
sections: DocumentationSection[];
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
interface ArchitectureDocumentation {
|
|
941
|
+
overview: DocumentationSection;
|
|
942
|
+
components: any[];
|
|
943
|
+
dataFlow: any[];
|
|
944
|
+
diagrams: any[];
|
|
945
|
+
decisions: any[];
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
interface CodeBlock {
|
|
949
|
+
language: string;
|
|
950
|
+
code: string;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
interface HandlebarsTemplate {
|
|
954
|
+
(context: any): string;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
interface DocumentationPlugin {
|
|
958
|
+
name: string;
|
|
959
|
+
process(doc: Documentation): Promise<Documentation>;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
// Export the generator
|
|
963
|
+
export { DocumentationGenerator, DocumentationConfig, Documentation };
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
## API Documentation Templates
|
|
967
|
+
```typescript
|
|
968
|
+
// api-templates.ts
|
|
969
|
+
export const apiTemplates = {
|
|
970
|
+
endpoint: `
|
|
971
|
+
## {{method}} {{path}}
|
|
972
|
+
|
|
973
|
+
{{description}}
|
|
974
|
+
|
|
975
|
+
### Parameters
|
|
976
|
+
|
|
977
|
+
{{#if pathParams}}
|
|
978
|
+
#### Path Parameters
|
|
979
|
+
| Name | Type | Required | Description |
|
|
980
|
+
|------|------|----------|-------------|
|
|
981
|
+
{{#each pathParams}}
|
|
982
|
+
| {{name}} | {{type}} | {{required}} | {{description}} |
|
|
983
|
+
{{/each}}
|
|
984
|
+
{{/if}}
|
|
985
|
+
|
|
986
|
+
{{#if queryParams}}
|
|
987
|
+
#### Query Parameters
|
|
988
|
+
| Name | Type | Required | Description |
|
|
989
|
+
|------|------|----------|-------------|
|
|
990
|
+
{{#each queryParams}}
|
|
991
|
+
| {{name}} | {{type}} | {{required}} | {{description}} |
|
|
992
|
+
{{/each}}
|
|
993
|
+
{{/if}}
|
|
994
|
+
|
|
995
|
+
### Request Body
|
|
996
|
+
|
|
997
|
+
\`\`\`json
|
|
998
|
+
{{requestExample}}
|
|
999
|
+
\`\`\`
|
|
1000
|
+
|
|
1001
|
+
### Response
|
|
1002
|
+
|
|
1003
|
+
#### Success Response ({{successCode}})
|
|
1004
|
+
|
|
1005
|
+
\`\`\`json
|
|
1006
|
+
{{responseExample}}
|
|
1007
|
+
\`\`\`
|
|
1008
|
+
|
|
1009
|
+
#### Error Responses
|
|
1010
|
+
|
|
1011
|
+
{{#each errorResponses}}
|
|
1012
|
+
- **{{code}}**: {{description}}
|
|
1013
|
+
{{/each}}
|
|
1014
|
+
|
|
1015
|
+
### Example
|
|
1016
|
+
|
|
1017
|
+
\`\`\`bash
|
|
1018
|
+
curl -X {{method}} \\
|
|
1019
|
+
{{curlExample}}
|
|
1020
|
+
\`\`\`
|
|
1021
|
+
`,
|
|
1022
|
+
|
|
1023
|
+
schema: `
|
|
1024
|
+
## {{name}}
|
|
1025
|
+
|
|
1026
|
+
{{description}}
|
|
1027
|
+
|
|
1028
|
+
### Properties
|
|
1029
|
+
|
|
1030
|
+
| Property | Type | Required | Description |
|
|
1031
|
+
|----------|------|----------|-------------|
|
|
1032
|
+
{{#each properties}}
|
|
1033
|
+
| {{name}} | {{type}} | {{required}} | {{description}} |
|
|
1034
|
+
{{/each}}
|
|
1035
|
+
|
|
1036
|
+
### Example
|
|
1037
|
+
|
|
1038
|
+
\`\`\`json
|
|
1039
|
+
{{example}}
|
|
1040
|
+
\`\`\`
|
|
1041
|
+
`,
|
|
1042
|
+
};
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
## Best Practices
|
|
1046
|
+
1. **Comprehensive Coverage**: Document all aspects of the project
|
|
1047
|
+
2. **Consistency**: Maintain consistent style and format
|
|
1048
|
+
3. **Automation**: Automate documentation generation
|
|
1049
|
+
4. **Examples**: Include practical, working examples
|
|
1050
|
+
5. **Versioning**: Version documentation with code
|
|
1051
|
+
6. **Accessibility**: Ensure documentation is accessible
|
|
1052
|
+
7. **Maintenance**: Keep documentation up-to-date
|
|
1053
|
+
|
|
1054
|
+
## Documentation Strategies
|
|
1055
|
+
- API-first documentation approach
|
|
1056
|
+
- Documentation-as-code methodology
|
|
1057
|
+
- Automated extraction from code
|
|
1058
|
+
- Interactive documentation with examples
|
|
1059
|
+
- Multi-format output (MD, HTML, PDF)
|
|
1060
|
+
- Continuous documentation integration
|
|
1061
|
+
- Documentation testing and validation
|
|
1062
|
+
|
|
1063
|
+
## Approach
|
|
1064
|
+
- Analyze project structure and code
|
|
1065
|
+
- Extract documentation from comments
|
|
1066
|
+
- Generate comprehensive API docs
|
|
1067
|
+
- Create user-friendly guides
|
|
1068
|
+
- Build architecture documentation
|
|
1069
|
+
- Validate all documentation
|
|
1070
|
+
- Publish in multiple formats
|
|
1071
|
+
|
|
1072
|
+
## Output Format
|
|
1073
|
+
- Provide complete documentation frameworks
|
|
1074
|
+
- Include template libraries
|
|
1075
|
+
- Document API specifications
|
|
1076
|
+
- Add user guide templates
|
|
1077
|
+
- Include architecture diagrams
|
|
1078
|
+
- Provide validation tools
|