pickle-rick-extension / cli
AGENTS.md454 starsChanged 9 months agoApache-2.0View on GitHub
This file provides guidance for agentic coding agents working in this repository.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- cli/CLAUDE.mdCLAUDE.md
- code-implementerSkill
- code-researcherSkill
- implementation-plannerSkill
- load-pickle-personaSkill
- plan-reviewerSkill
- prd-drafterSkill
- research-reviewerSkill
- ruthless-refactorerSkill
- ticket-managerSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 1 is common, 14 are distinctive, and 4 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 30
TypeScript: All code must be TypeScript with strict mode enabled
- Very specific: line 31
ESM: Use ES modules with .js extensions for imports (not .ts)
- Distinctive: line 32
Async/Await: Prefer async/await over Promise chains
- Distinctive: line 33
Error Handling: Use try/catch with proper error typing and messages
- Distinctive: line 58
Zod: Use Zod schemas for all external data validation
- Distinctive: line 59
Strict Types: Always define explicit return types and parameter types
- Very specific: line 60
Error Types: Use unknown for catch blocks, then narrow with instanceof
- Very specific: line 86
Barrel Exports: Use index.ts files for clean public APIs
- Distinctive: line 92
Renderables: All UI components extend renderable classes
- Distinctive: line 93
Event Handling: Use proper event listener patterns with cleanup
- Distinctive: line 94
State Management: Keep UI state in controller classes, not renderables
- Very specific: line 95
Theme: Use centralized theme constants from ./theme.js
- Distinctive: line 98
Framework: Use Bun's built-in test runner
- Distinctive: line 100
Coverage: Test public interfaces, not implementation details
- Distinctive: line 124
State Persistence: All state must be serializable to JSON via Zod schemas
- Distinctive: line 125
Cleanup: Always clean up resources (worktrees, processes, event listeners)
- Distinctive: line 129
Streaming: Use streaming APIs for CLI output and large data
- Common: line 135
No Secrets: Never commit API keys, tokens, or sensitive data
- Distinctive: line 137
Command Injection: Use parameterized arrays for exec commands
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance for agentic coding agents working in this repository.
Build & Development Commands
# Install dependencies
bun install
# Run in development mode (TUI dashboard)
bun run dev
# Build production executable
bun run build
# Type check without emitting
bun run check
# Run tests
bun test
# Run single test file
bun test src/path/to/file.test.tsCode Style Guidelines
General Principles
- TypeScript: All code must be TypeScript with strict mode enabled
- ESM: Use ES modules with
.jsextensions for imports (not.ts) - Async/Await: Prefer async/await over Promise chains
- Error Handling: Use try/catch with proper error typing and messages
Import Organization
// 1. Node.js built-ins
import { readFile } from "node:fs/promises";
import { join } from "node:path";
// 2. External dependencies
import { Command } from "commander";
import { z } from "zod";
// 3. Internal modules (relative imports with .js)
import { SessionState } from "./config/types.js";
import { GeminiEngine } from "./engines/gemini.js";Naming Conventions
- Files: kebab-case for files (e.g.,
dashboard-controller.ts) - Classes: PascalCase (e.g.,
DashboardController,GeminiEngine) - Functions/Variables: camelCase (e.g.,
createSession,sessionDir) - Constants: UPPER_SNAKE_CASE for exports (e.g.,
GLOBAL_SESSIONS_DIR) - Interfaces: PascalCase with
Iprefix only for React-like props (e.g.,DashboardUI)
Type Safety
- Zod: Use Zod schemas for all external data validation
- Strict Types: Always define explicit return types and parameter types
- Error Types: Use
unknownfor catch blocks, then narrow withinstanceof
// Good
async function loadState(sessionDir: string): Promise<SessionState | null> {
try {
const content = await readFile(path, "utf-8");
const json = JSON.parse(content);
return SessionStateSchema.parse(json);
} catch (e) {
console.error("Failed to load state:", e);
return null;
}
}
// Bad
async function loadState(path) {
try {
return JSON.parse(await readFile(path));
} catch (e) {
return null;
}
}Code Organization
- Barrel Exports: Use
index.tsfiles for clean public APIs - Single Responsibility: Each file should export one main class/function
- Dependencies: Inject dependencies, avoid global state
- Constants: Define theme and configuration constants in dedicated files
TUI Components (@opentui/core)
- Renderables: All UI components extend renderable classes
- Event Handling: Use proper event listener patterns with cleanup
- State Management: Keep UI state in controller classes, not renderables
- Theme: Use centralized theme constants from
./theme.js
Testing
- Framework: Use Bun's built-in test runner
- Structure: Group tests with
describe(), use descriptive test names - Coverage: Test public interfaces, not implementation details
- Mocking: Mock external dependencies (file system, network, CLI commands)
Error Handling Patterns
// CLI commands
try {
await executor.run();
} catch (err: unknown) {
const msg = err instanceof Error ? err.message : String(err);
console.error(pc.red(`💥 Execution failed: ${msg}`));
process.exit(1);
}
// File operations
try {
await writeFile(path, content, "utf-8");
} catch (e) {
throw new Error(`Failed to write state to ${path}: ${e}`);
}Git & Session Management
- Worktrees: Sessions execute in isolated git worktrees
- State Persistence: All state must be serializable to JSON via Zod schemas
- Cleanup: Always clean up resources (worktrees, processes, event listeners)
- Idempotency: Operations should be safe to retry
Performance Considerations
- Streaming: Use streaming APIs for CLI output and large data
- Lazy Loading: Initialize TUI components only when needed
- Memory: Clean up event listeners and intervals in component lifecycle
- Throttling: Rate-limit expensive operations like file system scans
Security Best Practices
- No Secrets: Never commit API keys, tokens, or sensitive data
- Input Validation: Validate all user input with Zod schemas
- Command Injection: Use parameterized arrays for exec commands
- Path Safety: Validate and sanitize file paths, prevent directory traversal
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

