Skip to content

Conversation

@fabceolin
Copy link
Contributor

Summary

This PR extends CodeWiki with alternative LLM backend options, a comprehensive agent instructions system for fine-grained documentation control, and configurable token management settings.

New Features

Multi-LLM Backend Support

  • Claude Code CLI (--use-claude-code): Integrates with Claude Code CLI for documentation generation with clustering support
  • Gemini CLI (--use-gemini-code): Adds Gemini CLI backend with 1M token context window support

Agent Instructions System

  • Include/Exclude patterns: Selective file processing with pattern replacement for includes and pattern merging for excludes
  • Focus modules: Target specific modules for documentation
  • Doc-type customization: Control the type of documentation generated
  • Custom instructions: Pass additional instructions to the documentation agent

Configurable Token Management

  • --max-tokens: Set maximum tokens for generation
  • --max-token-per-module: Control token budget per module
  • --max-token-per-leaf-module: Fine-tune leaf module token limits
  • --max-depth: Configure hierarchical decomposition depth

Single-File Documentation Mode

  • --file option enables documentation generation for individual files instead of entire repositories

Bug Fixes

  • Use .get() for safe dict access in module tree formatting to handle missing keys
  • Make temperature parameter optional in call_llm for models that don't support it
  • Add file parameter alias in str_replace_editor for model compatibility
  • Relax type annotation for sub_module_specs parameter to Any for broader LLM response compatibility
  • Add missing MAIN_MODEL import in background_worker

Documentation

  • Updated README with customization options, token settings, and agent instructions documentation
  • Added agent instructions system architecture and extension guide to DEVELOPMENT.md

Files Changed

  • codewiki/cli/commands/generate.py
  • codewiki/cli/commands/config.py
  • codewiki/cli/adapters/doc_generator.py
  • codewiki/cli/models/config.py
  • codewiki/cli/config_manager.py
  • codewiki/src/config.py
  • codewiki/src/be/llm_services.py
  • codewiki/src/be/cluster_modules.py
  • codewiki/src/be/agent_orchestrator.py
  • codewiki/src/be/prompt_template.py
  • codewiki/src/be/claude_code_adapter.py (new)
  • codewiki/src/be/gemini_code_adapter.py (new)
  • codewiki/src/be/dependency_analyzer/ast_parser.py

Fabricio Ceolin and others added 7 commits January 15, 2026 14:27
…i/cli/commands/generate.py, codewiki/cli/adapters/doc_generator.py, codewiki/src/config.py, codewiki/src/be/dependency_analyzer/ast_parser.py, codewiki/src/be/dependency_analyzer/dependency_graphs_builder.py

fix: normalize sub_module_specs to handle both dict and list formats from different LLM providers - codewiki/src/be/agent_tools/generate_sub_module_documentations.py
…cus modules, doc-type, and custom instructions for documentation customization - codewiki/cli/models/config.py, codewiki/cli/commands/config.py, codewiki/cli/commands/generate.py, codewiki/cli/config_manager.py, codewiki/src/be/agent_orchestrator.py, codewiki/src/be/agent_tools/deps.py, codewiki/src/be/prompt_template.py

feat: add configurable max token settings (max-tokens, max-token-per-module, max-token-per-leaf-module) and max-depth for hierarchical decomposition - codewiki/cli/models/config.py, codewiki/cli/commands/config.py, codewiki/cli/config_manager.py, codewiki/src/config.py, codewiki/src/be/llm_services.py, codewiki/src/be/cluster_modules.py, codewiki/src/be/agent_tools/generate_sub_module_documentations.py
feat: add include/exclude pattern support to dependency parser with pattern replacement for includes and pattern merging for excludes - codewiki/src/be/dependency_analyzer/ast_parser.py, codewiki/src/be/dependency_analyzer/analysis/repo_analyzer.py
fix: add file parameter alias in str_replace_editor for model compatibility - codewiki/src/be/agent_tools/str_replace_editor.py
fix: add missing MAIN_MODEL import in background_worker - codewiki/src/fe/background_worker.py
docs: update README with customization options, token settings, and agent instructions documentation - README.md
docs: add agent instructions system architecture and extension guide to development docs - DEVELOPMENT.md
chore: bump version to 1.0.1 - codewiki/__init__.py, pyproject.toml

Merge branch 'main' of github.com:fabceolin/CodeWiki
…broader LLM response compatibility - codewiki/src/be/agent_tools/generate_sub_module_documentations.py
…ntation mode - codewiki/cli/adapters/doc_generator.py, codewiki/src/be/dependency_analyzer/ast_parser.py, codewiki/src/be/dependency_analyzer/dependency_graphs_builder.py, codewiki/src/config.py

fix: correct variable name from target_file to file in generate command - codewiki/cli/commands/generate.py
fix: remove -f short alias from --focus option - codewiki/cli/commands/generate.py
fix: make temperature optional in call_llm for models that don't support it - codewiki/src/be/llm_services.py
feat: add Claude Code CLI integration with --use-claude-code flag for LLM backend - codewiki/cli/commands/generate.py, codewiki/cli/adapters/doc_generator.py, codewiki/src/be/documentation_generator.py, codewiki/src/config.py
feat: add Claude Code CLI adapter with clustering and documentation generation - codewiki/src/be/claude_code_adapter.py
fix: use .get() for safe dict access in module tree formatting to handle missing keys - codewiki/src/be/prompt_template.py
fix: restore strict type annotation for sub_module_specs parameter - codewiki/src/be/agent_tools/generate_sub_module_documentations.py
chore: add poc extras with the-edge-agent dependency and remove coverage from pytest defaults - pyproject.toml
…backend with 1M token context support - codewiki/cli/commands/generate.py, codewiki/cli/adapters/doc_generator.py, codewiki/src/config.py, codewiki/src/be/gemini_code_adapter.py
…ass environment variables to subprocess - codewiki/src/be/claude_code_adapter.py, codewiki/src/config.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant