AGENTS.md
Project Identity
Project Name: ratatui_ruby-tea
Description: Part of the RatatuiRuby ecosystem.
1. Standards
STRICT REQUIREMENTS
-
Every file MUST begin with an SPDX-compliant header. Use
LGPL-3.0-or-laterfor code;CC-BY-SA-4.0for documentation.reuse annotatecan help you generate the header. For Ruby files, wrap SPDX comments in â / ++ to hide them from RDoc output. -
Every line of Ruby MUST be covered by tests that would stand up to mutation testing.
-
Tests must be meaningful and verify specific behavior or rendering output; simply verifying that code âdoesnât crashâ is insufficient and unacceptable.
-
Pre-commit: Use
bundle exec agent_raketo ensure commit-readiness. See Tools for detailed instructions. -
Git Pager: ALWAYS set
PAGER=catfor ALLgitcommands (e.g.,PAGER=cat git diff). This is mandatory.
Tools
-
NEVER run
bundle exec rakedirectly. NEVER runbundle exec ruby -Ilib:test ...directly. -
ALWAYS use
bundle exec agent_rake(provided by theratatui_ruby-devtoolsgem) for running tests, linting, or checking compilation. -
Usage:
-
Runs default task (compile + test + lint):
bundle exec agent_rake -
Runs specific task:
bundle exec agent_rake test:ruby(for example)
-
-
Setup:
bin/setupmust handle Bundler dependencies. -
Git: ALWAYS set
PAGER=catwithgit. THIS IS CRITICAL!
Tea-Specific Vocabulary
-
BANNED WORD: âcomponentâ â Reserved for Kit.
-
Avoid âwidgetâ for Tea units â âWidgetâ refers to Engine/Ratatui render primitives. In Tea, call them bags.
-
Bag: A module containing
Model,INITIAL,UPDATE, andVIEWconstants. Bags compose: parent bags delegate to child bags. -
Use âmodelâ, âupdateâ, âviewâ for the MVU pattern. Use âmessageâ (not âmsgâ) and âcommandâ (not âcmdâ).
Ruby Standards
-
Use
Data.definefor all value objects (Ruby 3.2+). -
Define types in
.rbsfiles. Donât useuntypedjust because itâs easy; be comprehensive and accurate. -
Every public Ruby class/method must be documented for humans in RDoc.
2. Committing
-
Who commits: DONâT stage (DONâT
git add) unless explicitly instructed. DONâT commit unless explicitly instructed. DO suggest a commit message when you finish. -
Format:
-
Format: Use Conventional Commits.
-
Body: Explanation if necessary (wrap at 72 chars).
-
DONâT list the files changed or the edits made in the body.
-
DONâT use markdown syntax (no backticks, no bolding, no lists, no links).
-
-
3. Definition of Done (DoD)
Before considering a task complete and returning control to the user, you MUST ensure:
-
Production Ready: RBS types are complete and accurate (no
untyped), errors are handled with good DX, documentation follows guidelines, high code quality (no âpre-existing debtâ excuses). -
Default Rake Task Passes: Run
bundle exec agent_rake(no args). Confirm it passes with ZERO errors or warnings. -
You will save time if you run
bundle exec agent_rake rubocop:autocorrectfirst. -
If you think the rake is looking for deleted files, STOP EVERYTHING and tell the user.
-
Documentation Updated: If public APIs or observable behavior changed, update relevant RDoc, rustdoc,
doc/files, README.md, and/orratatui_ruby-wikifiles. -
Changelog Updated: If public APIs, observable behavior, or gemspec dependencies have changed, update CHANGELOG.mdâs Unreleased section.
-
Commit Message Suggested: You MUST ensure the final message to the user includes a suggested commit message block. This is NOT optional.
-
You MUST also check
git log -n1to see the current standard AI footer (âGenerated withâ and âCo-Authored-Byâ) and include it in your suggested message.