scripts
scripts
The scripts module serves as the project's central automation hub, encompassing all build processes, testing, maintenance, and utility tasks. It orchestrates critical workflows, from generating comprehensive documentation and the "LLM Agents: Du Concept à la Production" book, to running a robust Real-Conditions Test Suite, and offering a library of reusable development templates. Understanding these scripts is crucial for effective development and maintaining code quality.
Key Workflows
- Documentation & Book Generation: The
scripts/build-book.shscript is the primary orchestrator for compiling the project's documentation and the "LLM Agents: Du Concept à la Production" book into various formats (PDF, EPUB, HTML). This process is supported by general documentation generation scripts likescripts/run-docs-gen.tsandscripts/run-docs-v2.ts, and can leverage reusable FCS templates fromscripts/templates/documentationfor specific tasks.
- Testing & Quality Assurance: The
scripts/run-all-tests.tsscript serves as the entry point for executing the project's comprehensive test suite. It orchestrates thescripts/testsmodule, which houses the Real-Conditions Test Suite. This suite validates core functionality by directly importingsrc/modules and making live API calls, ensuring stability under near-production conditions. Specific tests includescripts/test-gemini-agent.tsfor agent logic,scripts/test-lm-studio.tsfor local LLM connections, andscripts/test-real-conditions-gemini.tsfor extensive Gemini API validation, utilizing helper functions likeinitApiGeminiExtendedandinitApiAdvancedfromscripts/tests.
- Development Utilities & Maintenance: Beyond core build and test, the
scriptsmodule provides various utility scripts such asscripts/check-circular-deps.tsfor code quality,scripts/fetch-models-snapshot.tsfor data management, andscripts/nanobanana.tsfor specific asset generation. Thescripts/templatesmodule further extends this by offering a library of reusable FCS templates for common development tasks likerefactoringandsync, accessible via itsindex.fcsentry point.
How Sub-modules Interact
The scripts module acts as the central orchestrator, containing the primary executable scripts that define the project's automated workflows. These orchestrating scripts often leverage the specialized capabilities of its sub-modules:
- The top-level
scriptsdirectory houses the main execution scripts (e.g.,build-book.sh,run-all-tests.ts). scripts/templatesprovides a library of reusable FCS scripts that can be invoked by the main scripts for common tasks like documentation generation, refactoring, or workspace synchronization.scripts/testscontains the actual test implementations and helper functions, which are executed and managed by the orchestrating test scripts within the top-levelscriptsdirectory (e.g.,run-all-tests.ts).
This structure ensures a clear separation of concerns: orchestration logic resides at the top level, reusable components are centralized in templates, and specific test logic is encapsulated in tests.
graph TD
A[scripts (Orchestration & Main Executables)] --> B[scripts/templates (Reusable FCS Templates)]
A --> C[scripts/tests (Real-Conditions Test Suite)]
B -- Provides reusable components for --> A
C -- Contains test implementations executed by --> A
subgraph Key Workflows
A -- "Build Book (build-book.sh)" --> B
A -- "Run All Tests (run-all-tests.ts)" --> C
A -- "Doc Generation (run-docs-gen.ts)" --> B
end