How dai-motoki/zoltraak works
Main Components in the System
• Command Line Interface (CLI) Layer:
• Represented by files like zoltraak/cli.py.
• Provides the entry point for users to input natural language prompts and options (e.g., choice of compiler).
• Conversion/Compilation Core:
• The converter module (zoltraak/converter.py) and code generator modules (zoltraak/gencode.py and gencodebase.py) form the heart of prompt compilation.
• They take input natural language instructions (呪文) and process them through various “compiler” approaches as outlined (e.g., dev_func, dev_obj, biz_consult) to generate requirements and code.
• Grimoires (Modular “Magic” Spell Sets):
• The zoltraak/grimoires directory is organized into several submodules:
▪ Compiler: Contains a variety of domain-specific markdown files and scripts for converting prompts into detailed output.
▪ Formatter: Holds files (e.g., md_comment.md and language-specific variations) that define how prompts or generated code should be formatted.
▪ Encryption, Interpretspec, SoftDB, and Developer: Provide additional capabilities, like encryption of the “呪文” and support for developer-specific compilations.
• LLM Integration:
• The zoltraak/llms directory (with files such as claude.py and gemini.py) interfaces with external language model APIs.
• Utility Components:
• Folder zoltraak/utils contains helper utilities (e.g., process_text.py, prompt_import.py) that aid processing.
• Tests, scripts (run_tests.sh), and CI/CD integration files should be represented as supporting/testing infrastructure, ensuring that the core conversion logic is maintained.
• Package & Distribution:
• Files like setup.py, requirements.txt, and shell scripts for updating/upload (update_and_upload.sh, update_version.py) indicate the packaging, deployment, and distribution pipeline.
Relationships and Data Flow
• User Input:
• Conversion Flow:
• From the CLI, show data flow into the converter (zoltraak/converter.py), which in turn routes the prompt to one or more compilers defined in the Grimoires.
• Integration with LLMs:
• That during conversion the system may call out to external LLMs via the llms layer (e.g., via claude.py).
• Output Generation:
• After conversion and formatting (using the Formatter modules in grimoires/formatter), output files (requirements documents, generated Python code, Markdown files) are produced.
• Caching & CI/CD:
• A caching component that checks file hashes (as described under “キャッシング” in the README) to avoid unnecessary reconversions.
Architectural Patterns and Design Principles
• Modularity:
• Plugin-like nature of the Grimoires, where different “compiler” and “formatter” modules can be added or updated independently.
• Separation of Concerns:
• Extensibility:
• Extensibility points where additional compilers or output formatters can be integrated. The directory structure under grimoires is a key example.
Technologies and Frameworks
• Python is the primary language, with modules such as setuptools for packaging.
• Shell scripting is used for test execution and deployment.
• External APIs: Anthropic’s API (and possibly others like Gemini) are key for LLM functionality.
• GitHub Actions (.github/workflows) signals CI/CD integration.