### Start Sandbox Server Source: https://codespeak.dev/docs/getting-started/django-oscar Run this command to start the Django Oscar sandbox server. ```bash sandbox/manage.py runserver ``` -------------------------------- ### Start Django Server Source: https://codespeak.dev/docs/getting-started/quickstart After integrating a Django back-end, use this command to start the development server. The URL will be provided in the console. ```bash uv run manage.py runserver ``` -------------------------------- ### Install Hatch and Run Tests Source: https://codespeak.dev/docs/getting-started/mixed-mode Install the 'hatch' build tool and execute the project's test suite to ensure the environment is correctly set up. ```bash pushd packages/markitdown uv pip install hatch hatch test popd ``` -------------------------------- ### Install MarkItDown and Convert a Test File Source: https://codespeak.dev/docs/getting-started/mixed-mode Install the MarkItDown package in editable mode with all extras and use it to convert a sample DOCX file. ```bash uv pip install -e 'packages/markitdown[all]' markitdown packages/markitdown/tests/test_files/test_with_comment.docx ``` -------------------------------- ### Start the Sandbox Site Source: https://codespeak.dev/docs/getting-started/django-oscar Activate the virtual environment and start the Django Oscar sandbox development server. Visit the provided URL to confirm the site is running. ```bash source venv/bin/activate make sandbox sandbox/manage.py runserver ``` -------------------------------- ### Set Up Python Environment Source: https://codespeak.dev/docs/getting-started/coverage Set up a Python virtual environment using `uv` and install the `hatch` build tool. ```bash uv venv --python=3.12 .venv source .venv/bin/activate uv pip install hatch ``` -------------------------------- ### Install CodeSpeak CLI Source: https://codespeak.dev/docs/getting-started/installation Installs the CodeSpeak command-line interface using the uv tool manager. ```bash uv tool install codespeak-cli ``` -------------------------------- ### Auto-configured Test Runner Command Example Source: https://codespeak.dev/docs/getting-started/coverage An example of the test runner command that CodeSpeak might write to `codespeak.json` after auto-configuration. ```bash Auto-configured test runner for spec 'packages/markitdown/src/markitdown/converters/eml_converter.cs.md': cd packages/markitdown && hatch run pytest tests/ --json-report --json-report-file={tests_report_file} --cov=src/markitdown --cov-branch --cov-report=json:{tests_coverage_report_file} --tb=short ``` -------------------------------- ### Example Spec File (main.cs.md) Source: https://codespeak.dev/docs/programming-system/managed-files This is the primary spec file that defines the behavior of the generated code. ```markdown # Hello World Module ## Overview A simple program that outputs a message "Hello from test!" to console ``` -------------------------------- ### Install uv Package Manager Source: https://codespeak.dev/docs/getting-started/installation Installs the uv package manager using a curl script. Restart your terminal or source your shell configuration file after installation. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Example Spec File with Imports Source: https://codespeak.dev/docs/getting-started/takeover Illustrates how a CodeSpeak spec file (`app.cs.md`) imports other spec files, defining the dependency order for processing during a build. The example shows imports for filesystem, terminal, and presentation specs. ```markdown --- import specs/file-ops.cs.md import specs/terminal.cs.md import specs/presentation.cs.md --- # Core Model, Panels, Context Menu, and Settings ... ``` -------------------------------- ### Verify CodeSpeak Installation Source: https://codespeak.dev/docs/getting-started/installation Checks if the CodeSpeak CLI has been installed successfully by displaying its version. ```bash codespeak --version ``` -------------------------------- ### Example Generated Spec Structure Source: https://codespeak.dev/docs/getting-started/takeover An example of the directory structure and spec file names generated by the `codespeak takeover` process for the Folio project. ```bash specs/ app.cs.md — core model, panels, context menu, settings file-ops.cs.md — filesystem operations and archive support presentation.cs.md — theming and file formatting terminal.cs.md — the integrated terminal panel ``` -------------------------------- ### Verify uv Installation Source: https://codespeak.dev/docs/getting-started/installation Checks if the uv package manager has been installed successfully by displaying its version. ```bash uv --version ``` -------------------------------- ### Path-based Takeover Example Source: https://codespeak.dev/docs/reference/takeover Use this command when you know the specific module boundary you want to extract. The output file defaults to the stem of the first path provided. ```bash codespeak takeover src/module_a/ src/module_b.py ``` -------------------------------- ### Whitelist Glob Pattern Source: https://codespeak.dev/docs/programming-system/managed-files Example of using a glob pattern to whitelist multiple configuration files. ```bash codespeak whitelist 'config/*.yaml' ``` -------------------------------- ### Build Progress Output Source: https://codespeak.dev/docs/getting-started/quickstart This is an example of the terminal output shown after a successful build, indicating the progress and completion of the build process. ```text ╭──────────── CodeSpeak Progress: Funny Geese Demo: Animating bouncing geese with click interactions ────────────╮ │ ✓ Process specification (0.1s) │ │ ✓ Collect project information (0.1s) │ │ ✓ Implement specification (39.9s) │ │ ╰─ ✓ Collect context & plan work (39.7s) │ │ ✓ Finalize spec build (0.2s) │ ╰─────────────────────────────────────────────── Alpha Preview ────────────────────────────────────────────────╯ Processing spec 1/1: spec.cs.md Built successfully. ``` -------------------------------- ### Example Simple Spec for Todoer App Source: https://codespeak.dev/docs/programming-system/stylistic-guidelines This is an example of a basic specification for a personal ToDo app, outlining its purpose, tech stack, data structure, user permissions, and user stories. ```plaintext Todoer is a personal ToDo app. ### Tech Stack - Django - Tailwind CSS ### Data - Todo list item - content: plain text - created_at - marked_as_done_at ### Users and permissions - users can sign in with Google (no email/password sign in) - every user sees only their own todo items ### User stories - add a new entry - mark entry as Done (checkbox) - remove an entry ``` -------------------------------- ### Example Spec for Funny Geese Demo Source: https://codespeak.dev/docs/getting-started/quickstart Define the user experience and technology stack for your project in a Markdown file. This example outlines goose animation and interaction. ```markdown # Funny Geese Demo The app animates geese (🪿) bouncing around the screen, tumbling. ## UX A click on a free space creates a new medium-sized goose flying in a random direction. A click on a goose makes it bigger. When a goose gets too big it disappears with an animated pop. ## Technology - Use pure HTML + JS - Use Tailwind CSS for styling ``` -------------------------------- ### Coverage Improvement Output Example Source: https://codespeak.dev/docs/getting-started/coverage Example output showing the progress of CodeSpeak's coverage improvement process, including test counts and coverage percentages. ```text Initial state: ran 227 tests, observed 6 test failures. Coverage: 84% Iteration 1: ran 231 tests, observed 8 test failures. Coverage: 88% Iteration 2: ran 231 tests, observed 6 test failures. Coverage: 100% Reached target coverage. ``` -------------------------------- ### Configure Alternative Model Provider Source: https://codespeak.dev/docs/reference/model-selection Set the ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY environment variables to use an alternative Anthropic-compatible model provider. This example uses Z.ai. ```bash export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic" export ANTHROPIC_API_KEY="your-zai-api-key" ``` -------------------------------- ### Clone MarkItDown Project Source: https://codespeak.dev/docs/getting-started/coverage Clone the CodeSpeak fork of the MarkItDown project to follow along with the setup instructions. ```bash git clone https://github.com/codespeak-dev/markitdown markitdown-codespeak && cd markitdown-codespeak ``` -------------------------------- ### Invalid Import Path Examples Source: https://codespeak.dev/docs/programming-system/imports CodeSpeak enforces strict rules for import paths. Relative paths like `./` or `../`, absolute paths, and paths containing `.` or `..` components are not allowed. ```markdown --- // ✓ Valid import storage.cs.md import lib/base.cs.md import utils/helpers.cs.md // ✗ Invalid — will produce an error import ./storage.cs.md import ../shared/utils.cs.md import /absolute/path/to/spec.cs.md import ~/my-specs/common.cs.md import lib\..\storage.cs.md --- ``` -------------------------------- ### Auto-configure Test Runner Source: https://codespeak.dev/docs/getting-started/testing-workflow Run this command to let CodeSpeak automatically detect and configure your project's test runner. This is useful for initial setup or when the test runner configuration is unknown. ```bash codespeak test --auto-configure --spec spec.cs.md ``` -------------------------------- ### Notification for Non-Managed File Modification Source: https://codespeak.dev/docs/programming-system/managed-files Example notification shown when a non-managed file is modified during a build. ```text CodeSpeak modified 1 file not directly managed by the current spec: - pyproject.toml To disallow modifications to non-managed files, add this to codespeak.json: "strictManagedFilesControl": true To suppress this notification, add this to codespeak.json: "suppressNonManagedFilesNotification": true To allow editing these files when working on the current spec, run: codespeak update-managed-files 'pyproject.toml' To always allow editing these files, run: codespeak whitelist 'pyproject.toml' ``` -------------------------------- ### Single-line Comments Source: https://codespeak.dev/docs/programming-system/comments Single-line comments must start at the beginning of a line. Any text following '//' on the same line is ignored. ```codespeak // This is a single-line comment // It has to start at the beginning of a line http://foo.bar <--- not a comment ``` -------------------------------- ### Example Spec Section: Keyboard Passthrough Rules Source: https://codespeak.dev/docs/getting-started/takeover A Markdown snippet from a CodeSpeak spec file detailing specific keyboard passthrough rules for the terminal panel. This section captures intent that might be lost in pure code translation. ```markdown ## Keyboard passthrough When the terminal panel is focused, only the following keys are handled by the application itself rather than forwarded to the terminal process: - Ctrl+T (toggle terminal visibility) - Ctrl+\ (kill terminal session) - Ctrl+Up / Ctrl+Down (resize terminal panel) All other keypresses are forwarded to the shell. ``` -------------------------------- ### Remove Feature from Spec Source: https://codespeak.dev/docs/getting-started/quickstart Edit the spec file to remove unwanted features. This example removes the player leaderboard details. ```markdown In the top-right corner, a leaderboard of all players is displayed. For each player, it shows:- name- number of geese created- number of geese popped 🎉Every player gets a random name from a list of names built by combining a cute adjective with an animal name, e.g. "Huggable Alpaca" and an emoji avatar, e.g. 🦙. ``` -------------------------------- ### Add a Speed Slider Feature to Spec Source: https://codespeak.dev/docs/getting-started/quickstart Modify the spec file to add new features. This example adds a speed slider to control goose animation speed. ```markdown A click on a goose makes it bigger. When a goose gets too big it disappears with an animated pop.## UIThe bottom-right corner has a speed slider:- in the middle by default- moving the slider to the left slows the geese down- moving to the right speeds them up## Technology- Use pure HTML + JS ``` -------------------------------- ### Set Up Python Virtual Environment Source: https://codespeak.dev/docs/getting-started/mixed-mode Create and activate a Python virtual environment using 'uv' for the MarkItDown project to manage dependencies. ```bash uv venv --python=3.12 .venv source .venv/bin/activate ``` -------------------------------- ### Initialize a new CodeSpeak project Source: https://codespeak.dev/docs/reference/init Run this command in the directory where you want to create a new CodeSpeak project. It sets up the necessary configuration files and project structure. ```bash codespeak init ``` -------------------------------- ### Build the Project from Specification Source: https://codespeak.dev/docs/getting-started/quickstart Compile your project specification into an executable HTML file. This command processes the spec file and generates the necessary output. ```bash codespeak build spec.cs.md ``` -------------------------------- ### Initialize a New CodeSpeak Project Source: https://codespeak.dev/docs/getting-started/quickstart Use this command to create a new CodeSpeak project directory structure and initialize a git repository. ```bash mkdir my-project cd my-project codespeak init ``` -------------------------------- ### Try New Converter Source: https://codespeak.dev/docs/getting-started/mixed-mode Test the newly generated converter by running the `markitdown` command on a sample `.eml` fixture file. ```bash markitdown packages/markitdown/tests/test_files/test_email.eml ``` -------------------------------- ### Set Up Virtual Environment Source: https://codespeak.dev/docs/getting-started/django-oscar Create and activate a Python virtual environment for the Django Oscar project. This isolates project dependencies. ```bash make venv ``` -------------------------------- ### Project File Structure After Build Source: https://codespeak.dev/docs/getting-started/quickstart After building, an HTML file is generated in the project directory. Open 'index.html' in your browser to view the project. ```text . ├── codespeak.json ├── index.html # <--- open this file └── spec.cs.md ``` -------------------------------- ### Build with CodeSpeak Source: https://codespeak.dev/docs/getting-started/django-oscar Build the project using CodeSpeak after configuring the specifications and whitelisted files. This command generates the necessary code, tests, and integrates the new feature. ```bash codespeak build ``` -------------------------------- ### Codespeak Build Command Synopsis Source: https://codespeak.dev/docs/reference/build This is the basic command structure for building a project with codespeak. It shows the optional spec path and available flags. ```bash codespeak build [spec_path] [--skip-tests] [--no-interactive] ``` -------------------------------- ### Build Command Source: https://codespeak.dev/docs/programming-system/managed-files Command to build the spec, skipping tests. ```bash codespeak build --skip-tests ``` -------------------------------- ### Run Modular Takeover Source: https://codespeak.dev/docs/getting-started/takeover Invoke the `codespeak takeover` command without any paths to initiate the modular takeover process. This will analyze the codebase and open an interactive web wizard for module structure proposal. ```bash codespeak takeover ``` -------------------------------- ### Run Project Tests Source: https://codespeak.dev/docs/getting-started/mixed-mode Execute project tests using `hatch test` within the project directory. Ensure the `GITHUB_ACTIONS` environment variable is set if needed. ```bash pushd packages/markitdown GITHUB_ACTIONS=1 hatch test popd ``` ```bash 192 passed, 37 skipped in 47.65s ``` -------------------------------- ### Log in to CodeSpeak Source: https://codespeak.dev/docs/getting-started/installation Initiates the login process for CodeSpeak. Follow the prompts to log in using Google or email/password. ```bash codespeak login ``` -------------------------------- ### Import Multiple Specs and Subdirectories Source: https://codespeak.dev/docs/programming-system/imports You can import multiple specs and reference specs located in subdirectories. All import paths are relative to the project root. ```markdown --- import lib/base.cs.md import utils/helpers.cs.md --- # My app Uses shared library and utility specs. ``` -------------------------------- ### Whitelist with glob patterns Source: https://codespeak.dev/docs/reference/whitelist Use this command to add multiple files matching glob patterns to the whitelist. ```bash codespeak whitelist 'src/**/__init__.py' 'config/*.yaml' ``` -------------------------------- ### codespeak run command synopsis Source: https://codespeak.dev/docs/reference/run This is the basic command structure for running the codespeak application. It shows the command name, an optional spec path, and available flags. ```bash codespeak run [spec_path] [--skip-tests] [--no-interactive] [--no-diff-check] ``` -------------------------------- ### Takeover Build Progress Output Source: https://codespeak.dev/docs/reference/takeover During the build, CodeSpeak displays analyzed sessions and prompts. This output shows the progress of specification extraction and Claude Code session analysis. ```text ✓ Extract specification (2m 34s) ╰─ ✓ Analyze Claude Code sessions (0.0s) - 24 sessions, 150 prompts: "Implement @ideation/blog.md Plan first", "react-dom-client.development.js:5530 Uncaught Error: Hydration failed because...", and 147 more ╰─ ✓ Write specification (2m 34s) ``` -------------------------------- ### Verify Project Tests Source: https://codespeak.dev/docs/getting-started/django-oscar Run the project's test suite using pytest to ensure the environment is set up correctly and all tests pass. ```bash venv/bin/pytest --sqlite ``` -------------------------------- ### Build Project with CodeSpeak Source: https://codespeak.dev/docs/getting-started/mixed-mode Build the project using CodeSpeak, specifying the desired Anthropic model for complex mixed-mode projects. ```bash CODESPEAK_ANTHROPIC_STANDARD_MODEL=claude-opus-4-6 codespeak build ``` -------------------------------- ### Apply a Detailed Change Request from File Source: https://codespeak.dev/docs/getting-started/code-change-requests After creating and editing a change request file, use this command to apply the detailed changes to the generated code. This ensures all specified fixes are implemented. ```bash codespeak change ``` -------------------------------- ### Build a Spec with Dependencies Source: https://codespeak.dev/docs/programming-system/imports When building a spec that has dependencies, CodeSpeak processes the specs in the order they are imported. Changed specs are rebuilt, while unchanged ones are skipped. ```bash codespeak build main.cs.md --skip-tests ``` ```bash Processing spec 1/2: storage.cs.md ... Processing spec 2/2: main.cs.md App built successfully. ``` -------------------------------- ### Configure CodeSpeak Whitelisted Files Source: https://codespeak.dev/docs/getting-started/django-oscar Add the `utils.py` file to the `whitelisted_files` in `codespeak.json`. This ensures CodeSpeak can modify the file to integrate the new report. ```json "whitelisted_files": [ "src/oscar/apps/dashboard/reports/utils.py" ] ``` -------------------------------- ### Create a New Change Request File Source: https://codespeak.dev/docs/getting-started/code-change-requests Use this command to generate a template file for detailed code change requests. This is helpful for complex issues that require more explanation than a simple message. ```bash codespeak change --new ``` -------------------------------- ### Clone Folio Project Source: https://codespeak.dev/docs/getting-started/takeover Clone the Folio project repository to your local machine. This is a prerequisite step before running the takeover process. ```bash git clone git@github.com:codespeak-dev/folio.git cd folio ``` -------------------------------- ### codespeak impl Command Synopsis Source: https://codespeak.dev/docs/reference/impl This is the basic command structure for implementing project specifications. It takes an optional spec path and several flags to modify its behavior. ```bash codespeak impl [spec_path] [--skip-tests] [--no-interactive] [--no-diff-check] ``` -------------------------------- ### Whitelist a single file Source: https://codespeak.dev/docs/reference/whitelist Use this command to add a single file to the whitelist. ```bash codespeak whitelist pyproject.toml ``` -------------------------------- ### Project Configuration File (pyproject.toml) Source: https://codespeak.dev/docs/programming-system/managed-files This TOML file contains project configuration and is not directly managed by the spec. ```toml [project] name = "hello" version = "0.1.0" requires-python = ">=3.13" dependencies = [] ``` -------------------------------- ### Clone the MarkItDown Repository Source: https://codespeak.dev/docs/getting-started/mixed-mode Clone the Microsoft MarkItDown repository to your local machine to begin adding new features. ```bash git clone git@github.com:microsoft/markitdown.git cd markitdown ``` -------------------------------- ### Codespeak Takeover Command Synopsis Source: https://codespeak.dev/docs/reference/takeover This is the general command-line synopsis for the codespeak takeover command, showing available arguments and flags. ```bash codespeak takeover [paths...] [-o OUTPUT] [-f] [--cc-context | --no-cc-context] [--cc-session-dir DIR] [--cc-original-root PATH] [--no-interactive] ``` -------------------------------- ### Auto-configure Test Runner Source: https://codespeak.dev/docs/getting-started/coverage Run `codespeak coverage --auto-configure` to let CodeSpeak detect and set up your project's test runner command. ```bash codespeak coverage --auto-configure ``` -------------------------------- ### Whitelist File Command Source: https://codespeak.dev/docs/programming-system/managed-files Command to add a file to a project-wide whitelist in codespeak.json, allowing any spec to modify it. ```bash codespeak whitelist 'pyproject.toml' ``` -------------------------------- ### codespeak whitelist command synopsis Source: https://codespeak.dev/docs/reference/whitelist This is the general synopsis for the codespeak whitelist command. ```bash codespeak whitelist [--no-interactive] ``` -------------------------------- ### Create EML Converter Specification Source: https://codespeak.dev/docs/getting-started/mixed-mode Define a new converter specification for EML files in a new '.cs.md' file within the converters directory. ```markdown # EmlConverter Converts RFC 5322 email files (.eml) to Markdown using Python's built-in `email` module. ## Accepts `.eml` extension or `message/rfc822` MIME type. ## Output Structure 1. **Headers section**: From, To, Cc, Subject, Date as `**Key:** value` pairs 2. **Body**: plain text preferred; if only HTML, convert to markdown 3. **Attachments section** (if any): list with filename, MIME type, human-readable size ## Parsing Requirements - Decode RFC 2047 encoded headers (e.g., `=?UTF-8?B?...?=") - Decode body content (base64, quoted-printable) - Handle multipart: walk parts, prefer `text/plain` over `text/html` - For `message/rfc822` parts: recursively format as quoted nested message - Extract attachment metadata without decoding attachment content ``` -------------------------------- ### Configure CodeSpeak Specs Source: https://codespeak.dev/docs/getting-started/mixed-mode Register the newly created EML converter specification in the 'codespeak.json' file. ```json "specs": [ "packages/markitdown/src/markitdown/converters/eml_converter.cs.md" ] ``` -------------------------------- ### Inspect Generated Files Source: https://codespeak.dev/docs/getting-started/django-oscar Check the status of your project after running `codespeak build`. This command shows which files were modified or newly created by CodeSpeak. ```bash $ git status Changes not staged for commit: modified: src/oscar/apps/dashboard/reports/utils.py Untracked files: src/oscar/apps/order/line_reports.py src/oscar/templates/oscar/dashboard/reports/partials/order_line_report.html tests/functional/dashboard/test_line_reports.py tests/integration/order/test_line_reports.py ``` -------------------------------- ### Path-Based Takeover Command Source: https://codespeak.dev/docs/getting-started/takeover Execute the takeover command by providing the source file paths directly. This bypasses the interactive wizard and extracts a single spec covering only the specified files. ```bash codespeak takeover src/archive.go src/archive_zip.go ``` -------------------------------- ### Change Request Synopsis with Optional Arguments Source: https://codespeak.dev/docs/reference/change This shows the general command structure for 'codespeak change', including the optional message and flags for controlling the process. ```bash codespeak change [spec_path] [-m MESSAGE] [--new] [--skip-tests] [--no-interactive] ``` -------------------------------- ### Run Coverage Improvement Source: https://codespeak.dev/docs/reference/coverage Execute the coverage improvement process with a specified target and maximum iterations. The `spec_path` is optional. ```bash codespeak coverage [spec_path] --target N --max-iterations M [--no-interactive] ``` -------------------------------- ### Strict Mode Configuration Source: https://codespeak.dev/docs/programming-system/managed-files JSON configuration to prevent CodeSpeak from writing to non-managed files during builds. ```json { "strictManagedFilesControl": true } ``` -------------------------------- ### Set Anthropic API Key Environment Variable Source: https://codespeak.dev/docs/getting-started/installation Sets the ANTHROPIC_API_KEY environment variable. Replace with your actual Anthropic API key. ```bash export ANTHROPIC_API_KEY= ``` -------------------------------- ### Apply Change Request with Inline Message Source: https://codespeak.dev/docs/reference/change Use this to apply a change request directly by providing a descriptive message. This is useful for quick fixes. ```bash codespeak change -m "description of the problem" ``` -------------------------------- ### Inspect Project Status Source: https://codespeak.dev/docs/getting-started/mixed-mode Use `git status` to view modified and untracked files after CodeSpeak generates new code and fixtures. ```bash $ git status Changes not staged for commit: modified: packages/markitdown/src/markitdown/_markitdown.py modified: packages/markitdown/src/markitdown/converters/__init__.py modified: packages/markitdown/tests/_test_vectors.py Untracked files: packages/markitdown/src/markitdown/converters/_eml_converter.py packages/markitdown/tests/test_files/test_email.eml packages/markitdown/tests/test_files/test_email_html_only.eml packages/markitdown/tests/test_files/test_email_nested.eml ``` -------------------------------- ### Code Change Request for Multi-Spec Projects Source: https://codespeak.dev/docs/getting-started/code-change-requests When working with multiple specs, specify the target spec file to ensure the code change request is applied correctly. This is useful for organizing changes in larger projects. ```bash codespeak change path/to/spec.cs.md -m "description of the problem" ``` -------------------------------- ### Auto-configure Test Runner Source: https://codespeak.dev/docs/reference/coverage Automatically configure the test runner commands for CodeSpeak. This is the recommended approach for setting up test execution with coverage reporting. ```bash codespeak test --auto-configure ``` -------------------------------- ### Generated Managed File (main.py) Source: https://codespeak.dev/docs/programming-system/managed-files This Python file is generated by the spec and is considered a managed file. ```python from hello import hello def main(): hello() if __name__ == "__main__": main() ``` -------------------------------- ### Run Coverage Improvement Source: https://codespeak.dev/docs/getting-started/coverage Execute `codespeak coverage` with target coverage and iteration limits to automatically add missing tests. ```bash codespeak coverage --target 100 --max-iterations 5 ``` -------------------------------- ### Configure CodeSpeak Spec Registration Source: https://codespeak.dev/docs/getting-started/django-oscar Register the new order line report specification in the `codespeak.json` file. This tells CodeSpeak where to find the report definition. ```json "specs": [ "src/oscar/apps/order/line_reports.spec.md" ] ``` -------------------------------- ### Configure Spec File Paths Source: https://codespeak.dev/docs/reference/codespeak-json Specify an array of paths to spec files relative to the project root. Used by CodeSpeak to identify files for processing. ```json { "specs": [ "src/converters/eml_converter.cs.md", "src/reports/line_report.spec.md" ] } ``` -------------------------------- ### Add Django Back-end and Stats Feature to Spec Source: https://codespeak.dev/docs/getting-started/quickstart Enhance the project by integrating a Django back-end and adding a real-time player leaderboard. This involves updating the spec with UI and technology details. ```markdown ## UI### Speed SliderThe bottom-right corner has a speed slider:- in the middle by default- moving the slider to the left slows the geese down- moving to the right speeds them up### StatsIn the top-right corner, a leaderboard of all players is displayed. For each player, it shows:- name- number of geese created- number of geese popped 🎉Every player gets a random name from a list of names built by combining a cute adjective with an animal name, e.g. "Huggable Alpaca" and an emoji avatar, e.g. 🦙.Stats are updated in real time.## Technology- Use pure HTML + JS- HTML + JS- Django- Use Tailwind CSS for styling ``` -------------------------------- ### Run tests and iteratively fix failures Source: https://codespeak.dev/docs/reference/test This is the primary command for running tests and automatically fixing failures. It repeats the process until all tests pass or the maximum number of iterations is reached. ```bash codespeak test [spec_path] [--auto-configure] [--max-iterations N] [--no-interactive] ``` -------------------------------- ### Whitelist Files with Glob Patterns Source: https://codespeak.dev/docs/reference/codespeak-json Utilize glob patterns within the `whitelisted_files` array to specify multiple files matching a pattern for modification. ```json { "whitelisted_files": [ "src/**/__init__.py" ] } ``` -------------------------------- ### Clone Django Oscar Repository Source: https://codespeak.dev/docs/getting-started/django-oscar Clone the official Django Oscar repository to your local machine. This is the first step before making any modifications. ```bash git clone git@github.com:django-oscar/django-oscar.git cd django-oscar ``` -------------------------------- ### Updated Spec File with Dependency Source: https://codespeak.dev/docs/programming-system/managed-files The spec file is updated to include a dependency on the 'rich' library. ```markdown # Hello World Module ## Overview -A simple program that outputs a message "Hello from test!" to console +A simple program that outputs a message "Hello, CodeSpeak!" to console + +## Dependencies + +Uses `rich` library for nice terminal UI. ``` -------------------------------- ### Claude Code Integration Consent Prompt Source: https://codespeak.dev/docs/reference/takeover This prompt appears on first use, asking for permission to read Claude Code session history to enrich spec extraction. Your choice is saved per-project. ```text CodeSpeak can read your Claude Code session history to better understand the intent behind your code. Is this fine? [Y] Allow [N] Not now [D] No, never ``` -------------------------------- ### Basic Code Change Request Source: https://codespeak.dev/docs/getting-started/code-change-requests Use this command to fix a bug in the generated code when the spec is correct but the implementation has an error. It applies to the current project's default spec. ```bash codespeak change -m "Number of geese displayed is off by 1" ``` -------------------------------- ### Execute a Task by Name Source: https://codespeak.dev/docs/reference/task Use this command to run a specific task within the CodeSpeak task engine. Task names are case-insensitive and support CamelHumps abbreviation. You can optionally specify a specification file or run in non-interactive mode. ```bash codespeak task [--spec SPEC] [--no-interactive] ``` -------------------------------- ### Whitelist Files for Modification Source: https://codespeak.dev/docs/reference/codespeak-json Define an array of files that CodeSpeak is permitted to modify but does not own. This ensures controlled access to external files. ```json { "whitelisted_files": [ "src/converters/__init__.py", "src/app/_registry.py" ] } ``` -------------------------------- ### Run Specific Test Files or Tests Source: https://codespeak.dev/docs/getting-started/django-oscar Execute specific parts of the Django Oscar test suite, such as a single file or an individual test case, using pytest. ```bash venv/bin/pytest --sqlite tests/integration/offer/test_availability.py virtualenv/bin/pytest --sqlite tests/integration/offer/test_availability.py::TestASuspendedOffer::test_is_unavailable ``` -------------------------------- ### Declare Dependency on Another Spec Source: https://codespeak.dev/docs/programming-system/imports Use the `import` directive within the frontmatter of a spec file to declare a dependency on another spec. CodeSpeak will build the imported spec first. ```markdown --- import storage.cs.md --- # memo app This is a simple Python CLI app that supports simple creation and retrieval of memos ## CLI commands `memo add ` - creates a new memo with given content `memo show` - shows all memos, grouped by day of the creation `memo find ` - finds a given memo by substring `memo delete ` - deletes a given memo by substring ## UI App uses `rich` library for pretty terminal UI ``` -------------------------------- ### Add all violations from the last build to managed files Source: https://codespeak.dev/docs/reference/update-managed-files This command adds all files that were flagged as managed file violations during the last build to the current spec's managed files list. This is useful for quickly addressing multiple violations. ```bash codespeak update-managed-files ``` -------------------------------- ### Update Managed Files Command Source: https://codespeak.dev/docs/programming-system/managed-files Command to add a file to the managed files list for the current spec only. ```bash codespeak update-managed-files 'pyproject.toml' ``` -------------------------------- ### Suppress Notification Configuration Source: https://codespeak.dev/docs/programming-system/managed-files JSON configuration to hide notifications about non-managed file modifications. ```json { "suppressNonManagedFilesNotification": true } ``` -------------------------------- ### Multi-line Comments Source: https://codespeak.dev/docs/programming-system/comments Multi-line comments are enclosed by ''. Any text between these delimiters, including newlines, is treated as a comment. ```codespeak ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.