AGENTS.md

Project Identity

Project Name: ratatui_ruby

Description: A high-performance Ruby wrapper for the Ratatui TUI library.

Architecture:

Stability & Compatibility

1. File & Coding Standards

Licensing & Copyright (Strict)

Every file must begin with an SPDX-compliant header. Use the following format:

# frozen_string_literal: true

# SPDX-FileCopyrightText: 2025 Kerrick Long <me@kerricklong.com>
# SPDX-License-Identifier: AGPL-3.0-or-later

Ruby Standards

Rust Standards

2. Directory Structure Convention

The project follows a standard Gem layout with an ext/ directory for Rust code.

/
β”œβ”€β”€ .cargo/                 # Cargo configuration (linker flags)
β”œβ”€β”€ .github/                # CI/CD workflows
β”œβ”€β”€ bin/                    # Executables (console, setup)
β”œβ”€β”€ doc/                    # Documentation source (markdown for RDoc)
β”‚   β”œβ”€β”€ contributors/       # Design docs, ecosystem notes
β”‚   └── index.md
β”œβ”€β”€ ext/
β”‚   └── ratatui_ruby/       # RUST SOURCE CODE GOES HERE
β”‚       β”œβ”€β”€ src/
β”‚       β”‚   └── lib.rs      # Entry point
β”‚       β”œβ”€β”€ Cargo.toml
β”‚       └── extconf.rb      # Makefile generator
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ ratatui_ruby/
β”‚   β”‚   β”œβ”€β”€ schema/         # Ruby Data definitions
β”‚   β”‚   └── version.rb
β”‚   └── ratatui_ruby.rb     # Main loader
β”œβ”€β”€ test/
β”‚   β”œβ”€β”€ data/               # Data-driven test files
β”‚   └── ratatui_ruby/       # Unit tests
β”œβ”€β”€ vendor/                 # Vendorized style configs (goodcop)
β”œβ”€β”€ AGENTS.md               # Context for AI agents
β”œβ”€β”€ Gemfile
β”œβ”€β”€ Rakefile
β”œβ”€β”€ REUSE.toml              # Compliance definition
└── ratatui_ruby.gemspec

3. Configuration & Tooling

Development Environment

Documentation

4. The Ruby <-> Rust Bridge Contract

The Ruby Side (lib/)

The Rust Side (ext/)

5. Deployment / Release

6. Commit Message

7. Definition of Done

Before considering a task complete and returning control to the user, you MUST ensure:

  1. Default Rake Task Passes: Run bin/agent_rake to execute ALL tests and linting. Do not rely on partial test runs, or rake test, or rake lint alone. Confirm it passes with no new errors or warnings.

  2. Documentation Updated: If public APIs or observable behavior changed, update relevant doc/ files, README.md, and/or ratatui_ruby-wiki files,.

  3. Changelog Updated: If public APIs, observable behavior, or gemspec dependencies changed, update CHANGELOG.md’s Unreleased section according to the Semantic Versioning and Keep a Changelog specifications.

    • What belongs in CHANGELOG: Only changes that affect application developers or library developers who use or depend on ratatui_ruby:

    • New public APIs or widget parameters

    • Observable behavior changes (rendering, styling, layout)

    • Deprecations and removals

    • Breaking changes

    • New public examples (if they demonstrate significant features)

    • Performance improvements that affect applications

    • What does NOT belong in CHANGELOG: Internal changes that don’t affect downstream users:

    • Test additions or improvements

    • Documentation updates, RDoc fixes, markdown clarifications

    • Refactors of internal code

    • New or modified example code (unless the example itself is a major feature)

    • Internal tooling, CI/CD, or build configuration changes

    • Code style, linting, or type signature changes

    • Changelogs should be useful to downstream developers (both app and library developers), not simple restatements of diffs or commit messages.

  4. Commit Message Suggested: You MUST ensure the final message to the user includes a suggested commit message block. This is NOT optional.