lfk
CLAUDE.md927 starsChanged 7 months agoApache-2.0View on GitHub
You are Claude Code. I use specialized agents and skills for complex tasks. Philosophy: Agent-first design, parallel execution, plan before action, test before code, security always. Key Principles: 1. Agent-First: Delegate to specialized agents for complex work 2. Parallel Execution: Use Task tool with multiple agents when possible 3. Plan Before Execute: Use Plan Mode for complex operations 4. Test-Driven: Write tests before implementation 5. Security-First: Never compromise on security Reuse existing TUI primitives instead of hand-rolling. Look for a…
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
24 rules. About 0 are common, 20 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
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
- Distinctive: line 11
Parallel Execution: Use Task tool with multiple agents when possible
- Distinctive: line 12
Plan Before Execute: Use Plan Mode for complex operations
- Distinctive: line 13
Test-Driven: Write tests before implementation
- Distinctive: line 14
Security-First: Never compromise on security
- Distinctive: line 18
When possible, always use sub-agent driven development.
- Distinctive: line 19
If you implement a new feature or update an existing one, make sure to update the documentation in the readme file and any relevant …
- Distinctive: line 20
If you change any hotkey bindings, make sure to update the documentation and inform the team.
- Distinctive: line 21
Always delegate to specialized agents.
- Distinctive: line 22
Always run security check agents.
- Distinctive: line 23
Always create unit, functional and e2e tests where applicable.
- Distinctive: line 24
Use research organizations and compare their solution.
- Distinctive: line 25
Always use agentic mode for non-trivial tasks.
- Distinctive: line 26
Always search for refactor opportunities and reusable functions before implementing a new feature or fixing a bug.
- Distinctive: line 29
Ask questions if you are unsure about any requirements or implementation details.
- Very specific: line 34
Always redact logs; never paste secrets (API keys/tokens/passwords/JWTs)
- Distinctive: line 39
No emojis in code, comments, or documentation
- Distinctive: line 40
Prefer immutability - never mutate objects or arrays
- Distinctive: line 48
Always test locally before committing
- Distinctive: line 62
If the current task already produces the relevant docs, comments, or examples, do not duplicate the same knowledge elsewhere
- Distinctive: line 63
If there is no obvious project doc location, ask before creating a new top-level doc
- Very specific: line 98
Struct + apply: add the field to configFile (or its sub-struct) in internal/ui/config_load.go and wire it through applyConfigOptions / …
- Very specific: line 99
Schema: add the property (correct type, enum, default, description) to docs/config.schema.json.
- Very specific: line 100
Docs: update the field table in docs/config-reference.md AND add a commented example to docs/config-example.yaml.
- Distinctive: line 110
All tests pass (80%+ coverage)
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
CLAUDE.md
Core Philosophy (MANDATORY)
You are Claude Code. I use specialized agents and skills for complex tasks.
Philosophy: Agent-first design, parallel execution, plan before action, test before code, security always.
Key Principles:
- Agent-First: Delegate to specialized agents for complex work
- Parallel Execution: Use Task tool with multiple agents when possible
- Plan Before Execute: Use Plan Mode for complex operations
- Test-Driven: Write tests before implementation
- Security-First: Never compromise on security
General Rules
- When possible, always use sub-agent driven development.
- If you implement a new feature or update an existing one, make sure to update the documentation in the readme file and any relevant documentation files or the in-app help.
- If you change any hotkey bindings, make sure to update the documentation and inform the team.
- Always delegate to specialized agents.
- Always run security check agents.
- Always create unit, functional and e2e tests where applicable.
- Use research organizations and compare their solution.
- Always use agentic mode for non-trivial tasks.
- Always search for refactor opportunities and reusable functions before implementing a new feature or fixing a bug.
- Wherever possible use red/green TDD.
- Research and follow best practices for code quality, security and performance.
- Ask questions if you are unsure about any requirements or implementation details.
- Whenever it's possible, prepare Makefile tasks to automate common development tasks like testing, linting, formatting, building and deploying. Make sure the Makefile is well documented and easy to use, includes help messages, help target and clear instructions for each task.
Privacy
- Always redact logs; never paste secrets (API keys/tokens/passwords/JWTs)
- Review output before sharing - remove any sensitive data
Code Style
- No emojis in code, comments, or documentation
- Prefer immutability - never mutate objects or arrays
- Many small files over few large files
- 200-400 lines typical, 800 max per file
Git
- Wherever possible, create git hooks to automate testing, linting and formatting before the code is committed.
- Conventional commits:
feat:,fix:,refactor:,docs:,test: - Always test locally before committing
- Small, focused commits
Testing
- TDD: Write tests first
- 80% minimum coverage
- Unit + integration + E2E for critical flows
- TUI tests: build a model with
basePush80Model(); assert onstripANSI(view)
Knowledge Capture
- Personal debugging notes, preferences, and temporary context → auto memory
- Team/project knowledge (architecture decisions, API changes, implementation runbooks) → follow the project's existing docs structure
- If the current task already produces the relevant docs, comments, or examples, do not duplicate the same knowledge elsewhere
- If there is no obvious project doc location, ask before creating a new top-level doc
UI / TUI Conventions (Bubble Tea)
Reuse existing TUI primitives instead of hand-rolling. Look for a shared helper before adding a view or overlay.
- Hotkeys live in the hint bar (
overlay_hintbar.go), never inside the overlay/view box. - List/selector overlays use
ui.RenderOverlayList— scrollbar, filter, cursor, description column for free. Don't hand-draw rows, scrollbars, or "(N more)". - A new overlay = 4 edits:
overlayKindenum (app_types.go), dispatch (update_overlays.go), render (view_overlays.go), hint bar (overlay_hintbar.go). Overlays route before mode handlers. - Reuse renderers: YAML →
ui.RenderYAMLContent; object paths →formatObjectPath(handles array[i]). Keep paths as[]string; never dot-join then split (k8s keys contain dots). - Fullscreen view titles use
ui.ViewTitle(2-space lead aligns with the breadcrumb); a bareTitleStyle.Rendersits a column off. - Selection styling: active column →
SelectedStyle/ActiveSelectedStyle; inactive/parent column →ParentHighlightStyle(greyish). Match these, don't invent overlay styles. - Theme styles live in three files —
styles.go(default),theme.go(runtime,ApplyTheme),theme_nocolor.go. Add or change a style in all three. - Theme switches must invalidate cached previews; fill backgrounds with
FillLinesBg(theme bg), never assume black. - Display width via
ui.Truncate/lipgloss.Width, neverlen()(multibyte + ANSI). - Numeric columns (CPU/MEM/ports/counts) sort numerically with
n/alast, not lexically. - Keys: never bind
ctrl+i/ctrl+m/ctrl+[(terminals send tab/enter/esc — they never fire; a test guards this). For a new hotkey, reuse the shortcut a similar action already uses elsewhere — don't invent a new one (y=copy name,Y=copy full). Check collisions in keybinding defaults ANDcase kb.Xdispatch, not justcase "x". Update help, hint bar, README,docs/keybindings.mdtogether. - Any movable cursor must scroll to stay visible — use
ui.VimScrollOff(explorer_highlight.go) for the scrolloff viewport; don't recompute the window ad-hoc. - Cursor movement is vim-style:
j/k,g/G(top/bottom),ctrl+d/ctrl+u(half-page),ctrl+f/ctrl+b(full page), arrows + pgup/pgdn as aliases (thekb.*defaults). - Text viewers add the fuller vim set: word motions
w/b/e(+W/B/EWORD), line0/^/$, visual modev/V/ctrl+v(char/line/block), and text objectsviw/vaw/viW/vaW. Reuseupdate_vim.go(innerWordRange/innerWORDRange) — don't reimplement. - Motions take a vim count prefix (
5j,3w,10G): digits1-9accumulate in<view>.lineInput; read it withconsumeCountPrefix(count_prefix.go), don't hand-parse. - Full-screen viewers store a return-mode so closing returns to the opener, not always the explorer.
- Caps: files ≤ 800 lines (revive), gocyclo ≤ 30. Co-locate a feature's helpers in its own file.
App State & Event Loop
- Each fullscreen viewer's fields live in a
<name>ViewStatestruct (<name>view.go), snapshotted per tab viacloneCurrentTab(tabs.go) — looseModelfields leak across tabs. - Input focus gates global keys: when a filter/search/line-input is active, handle it first; global hotkeys stay inert (
update_keys.go). - User feedback goes through
setStatusMessage(msg, isErr)+ returnscheduleStatusClear()— never print inline or block. - Renderers read
ui.Active*globals (security, columns) set inView()right before render; don't read them elsewhere.
Configuration Settings
Adding or changing a config key is not done until ALL of these are updated together — in the same PR:
- Struct + apply: add the field to
configFile(or its sub-struct) ininternal/ui/config_load.goand wire it throughapplyConfigOptions/applyConfigMaps(internal/ui/config_apply.go) into itsConfig*runtime global. - Schema: add the property (correct type, enum, default, description) to
docs/config.schema.json.TestConfigSchemaTopLevelInSync/TestConfigSchemaKeybindingsInSyncfail if you forget a top-level or keybinding key. - Docs: update the field table in
docs/config-reference.mdAND add a commented example todocs/config-example.yaml. Keep entries concise and consistent with their peers. - Tests: assert the YAML→global wiring in
internal/ui/config_wiring_test.go(TestLoadConfig_AllSettingsWired) and record the field inwiringCoveredFields.TestConfigFile_EveryFieldHasWiringCoveragefails until you do. Add focused unit tests for any validation/clamping/union-shape parsing.
These four tests are the forcing function — a new setting that skips the schema, the wiring test, or the coverage map will not pass CI.
Success Metrics
You are successful when:
- All tests pass (80%+ coverage)
- No security vulnerabilities
- Code is readable and maintainable
- User requirements are met
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.

