tuify: Instructions file for Codex

AGENTS.md

tuify AGENTS.md is an instructions file for Codex, OpenCode from lounge/tuify. It costs 2,227 tokens per session, scanned A, original, MIT.

Project-specific instructions for coding agents working on the tuify Go application. They describe its architecture, startup sequence, required commands, and shutdown rules.

In plain words
What is it for?
Use them when developing tuify, especially in its bootstrap, internal packages, audio support, or user-interface code.
Why use it?
They help an agent make changes that fit the existing design and pass the project's build, test, formatting, and lint checks.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is lounge/tuify's own configuration. It tells Codex and OpenCode how to work on tuify itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tuify configures →

View source ↗ lounge/tuify
Reuse

Borrowing it

Nothing to install: this file belongs to lounge/tuify. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lounge/tuify/develop/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/lounge/tuify

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tuify AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lounge/tuify/agents-md/github.svg)](https://agentmods.dev/instructions/lounge/tuify/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lounge/tuify/agents-md"><img src="https://agentmods.dev/badge/instructions/lounge/tuify/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tuify AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/lounge/tuify/agents-md"><img src="https://agentmods.dev/badge/instructions/lounge/tuify/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,227 This file is loaded in full into every session.
When invoked 2,227 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02227 $0.02227
Opus 5.5 $0.00891 $0.00891
Sonnet 5.5 $0.00445 $0.00445
Haiku 4.5 $0.00223 $0.00223

Measured 11d ago against content hash 43a2ee8cb249, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tuify AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Development Guide

A file for guiding coding agents.

Commands

go build                         # build the tuify binary
go test ./...                    # run all tests
go test -run TestName ./internal/spotify   # run a single test in one package
gofmt -l .                       # CI fails hard if this lists anything
golangci-lint run ./...          # matches CI lint job; pinned to v2.14.0
go vet ./...

Linux build/test needs libasound2-dev (oto audio backend). Go 1.27+.

Architecture

main.go handles --version/--help (anything else exits 2) and calls bootstrap.Run, mapping its ErrInterrupted to exit status 130. Everything lives under internal/. Each internal package has a doc.go — read it before touching the package; the package-level comment is the source of truth for intent and invariants.

Startup sequence (internal/bootstrap)

Run owns a root context.Context that is cancelled on return. That context is threaded into auth (token refresh), spotify (polls), librespot (reconnect/transfer), and the UI model so every background goroutine unwinds at shutdown rather than running to its per-op timeout. Order matters:

  1. Load/setup config → theme.Apply(cfg.Theme) → ui.RebuildStyles() before any rendering (see Hard rule on Lipgloss style construction).
  2. authenticate returns an *authSession: the *spotify.Client plus channels for revoked-token + token-save errors that are wired into the UI via ModelOptions, and a cleanup func.
  3. startLibrespot is optional; when active it provides additional ModelOptions (WithAudioSource for the pipe → FFT path, WithLibrespotInactive for the device-dropped banner) and wires Process.OnReconnect to the transfer-back handler.
  4. zone.NewGlobal() then tea.NewProgram(..., WithAltScreen(), WithMouseCellMotion()).

UI shell + screens + submodels (internal/ui)

  • Shell (app*.go) owns the Model, view stack, event loop, and every side effect (Spotify calls, clipboard, device transfer).
  • Screens (home/playlist/track/podcast/episode/search) own local state and render themselves. They communicate with the shell via intent messages (app_intents.go).
  • Submodels (nowPlayingModel, visualizerModel, deviceSelectorModel) are long-lived state on Model that transcends the view stack.
  • The shell dispatches via small capability interfaces in common.go (listProvider, scrollable, clickable, enterable, searchAware, syncableView, backable, …). Adding a new screen means implementing the capabilities it cares about and listing them in the compile-time checks at the end of common.go (the shell finds capabilities by type assertion, so a missing or misnamed method fails silently otherwise). Capability methods are lowercase except those mirroring bubbletea/bubbles (Init, Update, View, SetSize).
  • Every frame that shows a list is wrapped in bubblezone.Scan; list rows are marked by list id and row index via zoneListDelegate (in styles.go) so clicks resolve back to specific rows even when a playlist repeats a track. Overlays and the visualizer skip the scan, and handleMouse ignores the pointer while they are up.

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 87 lines · 2,227 tokens per session scan A 43a2ee8cb249

Subscribe to this mod's changes

tuify AGENTS.md is an instructions file published in the GitHub repository lounge/tuify (29 stars, last pushed 9d ago), licensed MIT. It adds 2,227 tokens to every session, about $0.0089 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-26.

Related

tuify AGENTS.md compared with instructions from other repositories

tuify AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tuify AGENTS.mdlounge/tuifyInstructions file299d agoMITA2,227Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode