supercli
AGENTS.md231 starsChanged 5 months agoMITView on GitHub
Note: This project uses Bun as the package manager (bun@1.2.21). Uses bun test (Bun's built-in test runner). Test files use *.test.ts convention.
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repositoryOne other file it gives its agents.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 11 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
15
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
- Very specific: line 42
Use absolute imports with path aliases: @/components/ui/button for web app
- Very specific: line 43
Use workspace imports for cross-package dependencies: @super/db, @super/auth
- Distinctive: line 44
Import order: React/Next → External libs → Internal aliases → Relative imports
- Distinctive: line 48
No semicolons at end of statements
- Distinctive: line 49
Use double quotes for strings
- Distinctive: line 52
No explicit return type on function components (inferred)
- Very specific: line 63
Use type for type aliases when possible
- Very specific: line 65
Use interface for object shapes that may be extended
- Distinctive: line 66
Prefer explicit return types on library functions
- Distinctive: line 69
Use try-catch for async operations
- Very specific: line 72
Use ! operator sparingly; prefer proper null checks
- Very specific: line 82
Use cn() utility from @/lib/utils for conditional classes
- Distinctive: line 83
Prefer semantic CSS variables over hardcoded values
- Very specific: line 84
Use data-slot attributes for component identification
- Distinctive: line 85
Follow CVA (class-variance-authority) pattern for variants
- Very specific: line 89
Always regenerate client after schema changes: bun run db:generate
- Very specific: line 90
Use @map() for custom table names in snake_case
- Distinctive: line 91
Add indexes for frequently queried foreign keys
- Very specific: line 123
Run: bun run lint (from root) or bun run lint (from web directory)
- Distinctive: line 127
No pre-commit hooks configured yet
- Very specific: line 138
Always run bun run db:generate after modifying schema.prisma
- Very specific: line 139
Use workspace:* for internal package dependencies
- Very specific: line 140
Keep components in components/ folder, organized by feature
- Very specific: line 141
Use barrel exports (index.ts) for clean package APIs
- Distinctive: line 142
Prefer Server Components; mark 'use client' only when necessary
- Very specific: line 143
Follow existing patterns in apps/web/components/ui/ for new UI components
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Agent Instructions for Supercode Monorepo
Build Commands
# Root level commands
bun run dev # Start all dev servers
bun run build # Build all packages and apps
bun run lint # Run linting across all packages
bun run typecheck # Run TypeScript checks across all packages
# Individual app/package commands
bun run dev:web # Start only web app (Next.js)
bun run dev:api # Start only API app
bun run dev:cli # Start only CLI app
# Package-specific commands (run from package directory)
cd packages/db && bun run db:generate # Generate Prisma client
cd packages/db && bun run db:migrate # Deploy Prisma migrationsNote: This project uses Bun as the package manager (bun@1.2.21).
Testing
Uses bun test (Bun's built-in test runner). Test files use *.test.ts convention.
# Run all tests
bun test
# Run a single test file
bun test path/to/file.test.ts
# Run tests in watch mode
bun test --watchCode Style Guidelines
Imports
- Use absolute imports with path aliases:
@/components/ui/buttonfor web app - Use workspace imports for cross-package dependencies:
@super/db,@super/auth - Import order: React/Next → External libs → Internal aliases → Relative imports
- Group imports by category with blank lines between groups
Formatting
- No semicolons at end of statements
- Use double quotes for strings
- 2-space indentation
- Trailing commas in multi-line objects/arrays
- No explicit return type on function components (inferred)
Naming Conventions
- Components: PascalCase (e.g.,
Button.tsx,HeroSection.tsx) - Files: kebab-case for non-component files (e.g.,
utils.ts,query-provider.tsx) - Functions: camelCase (e.g.,
signIn,getSession) - Types/Interfaces: PascalCase (e.g.,
VariantProps) - Constants: UPPER_SNAKE_CASE for true constants
Types & TypeScript
- Strict mode enabled (
strict: truein tsconfig) - Use
typefor type aliases when possible - Export types explicitly when needed for consumers
- Use
interfacefor object shapes that may be extended - Prefer explicit return types on library functions
Error Handling
- Use try-catch for async operations
- Validate with Zod for form/API inputs
- Return early pattern for guard clauses
- Use
!operator sparingly; prefer proper null checks
React Patterns
- Server Components by default (Next.js App Router)
- 'use client' directive only when needed (hooks, browser APIs)
- Composition pattern for component variants (see
buttonVariantspattern) forwardRefpattern for component ref forwarding- Destructure props in function parameters
Styling (Tailwind CSS v4)
- Use
cn()utility from@/lib/utilsfor conditional classes - Prefer semantic CSS variables over hardcoded values
- Use
data-slotattributes for component identification - Follow CVA (class-variance-authority) pattern for variants
Database (Prisma)
- Schema location:
packages/db/prisma/schema.prisma - Always regenerate client after schema changes:
bun run db:generate - Use
@map()for custom table names in snake_case - Add indexes for frequently queried foreign keys
Monorepo Structure
apps/
web/ # Next.js 16 web app (main)
api/ # API app (scaffolded)
supercode-cli/ # CLI app (scaffolded)
packages/
db/ # Prisma database client
auth/ # Better-Auth authentication
secrets/ # Infisical secrets wrapper (@super/secrets)
ui/ # Shared UI components (empty)
sdk/ # SDK package (empty)
config/ # Shared config (empty)
dashboard/ # Dashboard componentsEnvironment Variables
- Web app:
apps/web/.envorapps/.env.local - Required for auth:
GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET,NEXT_PUBLIC_BETTER_AUTH_URL - Required for DB:
DATABASE_URL - Voice/STT:
SMALLEST_API_KEY(Smallest.ai Pulse STT — the only STT provider),SMALLEST_MODEL,STT_LANGUAGE. Voice TTS (spoken reply):VOICE_REPLY(on|off),ELEVENLABS_VOICE_ID,ELEVENLABS_TTS_MODEL(macOSsayfallback when no key). NoteELEVENLABS_API_KEYdoubles as both STT and TTS key historically; STT now always routes to Smallest.ai. - Voice web search (server):
CONTEXT_DEV_API_KEY(Context.dev — web search provider; fallback legacy aliasCONTEXTDEV_API_KEY),EXA_API_KEY(web search provider; the server tries the provider the model picked, then falls back to the other),FIRECRAWL_API_KEY(Firecrawl web search provider — optional third provider; the voice agent may use context.dev, exa, or firecrawl depending on the request). - Voice open-app tool (server): no key needed; the
/api/voice/chatopen_apptool runsopenlocally on the Mac the server runs on. - Voice system-control tool (server): no key needed; the
/api/voice/chatsystem_controltool runs locally on the Mac the server runs on — volume up/down/mute/unmute (osascript, no permission), lock screen (CGSession -suspend), sleep display (pmset displaysleepnow), quit app (osascripttell application to quit), and media play/pause/next/prev (System Events key codes — needs Accessibility permission). - Voice screen-region selection (client): Cmd+drag over any window selects a screen region; Jarvis then crops its screen-vision frame to that region and sends
screenSelection: trueso the server tells the model to focus only on the selected content (e.g. select part of a page → "explain this"). Escape or a new Cmd+drag clears/replaces. Implemented inapps/jarvis/Jarvis/managers/ScreenSelectionManager.swift(borderless.screenSaveroverlay windows that ignore mouse events; global + local event monitors — global drag end is detected viaNSEvent.pressedMouseButtonssince global monitors don't receive mouseUp) with crop math inScreenVisionManager.croppedScreenImageDataURL(rect:displayID:); server flag handled in the/api/voice/chathandler. - Secrets:
INFISICAL_CLIENT_ID,INFISICAL_CLIENT_SECRET(when Infisical is configured)
Linting
- ESLint configured for web app only (
apps/web/eslint.config.mjs) - Uses
eslint-config-next/core-web-vitalsandeslint-config-next/typescript - Run:
bun run lint(from root) orbun run lint(from web directory)
Git
- Branch naming:
supercli-#<issue-number> - No pre-commit hooks configured yet
Key Dependencies
- Framework: Next.js 16, React 19, TypeScript 5
- Auth: Better-Auth with Prisma adapter
- DB: PostgreSQL with Prisma ORM
- UI: Radix UI primitives + Tailwind CSS v4
- State: TanStack Query (React Query)
- Forms: React Hook Form + Zod
Conventions to Follow
- Always run
bun run db:generateafter modifyingschema.prisma - Use
workspace:*for internal package dependencies - Keep components in
components/folder, organized by feature - Use barrel exports (
index.ts) for clean package APIs - Prefer Server Components; mark 'use client' only when necessary
- Follow existing patterns in
apps/web/components/ui/for new UI components
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.

