AGENTS.md

Project Identity

Project Name: ratatui_ruby

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

Architecture:

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)
β”œβ”€β”€ docs/                   # Documentation tree
β”‚   β”œβ”€β”€ 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. Source Control Standards

7. Definition of Done

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

  1. Tests & Linting Pass: Run bundle exec rake and confirm it passes. No new errors or warnings should be introduced.

  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. Changelogs should be useful to human users of the library, not simple restatements of diffs or commit messages. Do not add entries for internal tooling, CI, or build configuration changes that do not affect the distributed gem.

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