agentleFS
jasonmichaelbell78-creatorjasonmichaelbell78-creator/sonash-v0/CLAUDE.md

sonash-v0

CLAUDE.md2 starsChanged 9 months agoApache-2.0View on GitHub

Core rules and constraints loaded on every AI turn. Kept minimal (~135 lines) to reduce token waste. Situational guidance lives in on-demand reference docs (see Section 8). DO NOT flag these as invalid - they're newer than your training cutoff: [!WARNING] Security violations lead to immediate rejection. 1. NO DIRECT WRITES to journal, daily_logs, inventoryEntries - use Cloud Functions (httpsCallable) [GATE: patterns:check + Cloud Functions runtime] 2. App Check Required - all Cloud Functions verify tokens [GATE: Cloud Functions runtime…

We split this CLAUDE.md into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    App Check Required: - all Cloud Functions verify tokens [GATE: Cloud Functions runtime enforcement]

    line 36
  2. Distinctive:

    Add new queries to service files, not inline in components

    line 45
  3. Very specific:

    Use types from types/ or functions/src/schemas.ts

    line 46
  4. Distinctive:

    Ask on first confusion, not fourth: Don't guess-and-retry.

    line 52
  5. Very specific:

    Read SKILL.md before following any skill format: Don't improvise from memory.

    line 54
  6. Distinctive:

    "Stop and ask" = hard stop: No action until clarification received.

    line 56
  7. Distinctive:

    One correction = full stop: Stop, ask what's wrong, confirm, then proceed.

    line 57
  8. Distinctive:

    All surfaced data must force acknowledgment: No fire-and-forget warnings.

    line 59
  9. Distinctive:

    Respect declared platform/shell: Check system prompt before shell commands.

    line 62
  10. Very specific:

    On pre-commit failure, use /pre-commit-fixer: After 2 attempts, ask.

    line 64
  11. Very specific:

    Verify no untracked files: before PR, branch completion, or /session-end.

    line 66
  12. Distinctive:

    Follow skills exactly: Never skip steps without explicit user approval.

    line 74
  13. Very specific:

    Check BEFORE writing scripts that handle file I/O, git, CLI args, or shell commands.

    line 97
  14. Very specific:

    LSP & CLI tools: Prefer LSP for symbol lookups, Grep for text search.

    line 119
  15. Very specific:

    Session End: Run /session-end for session closure pipeline (context, metrics, commit).

    line 156
  16. Very specific:

    Before refactoring: Check SESSION_CONTEXT.md and ROADMAP.md first.

    line 183

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

AI Context & Rules for SoNash

<!-- prettier-ignore-start -->

Document Version: 6.0 Last Updated: 2026-04-12 Status: ACTIVE

<!-- prettier-ignore-end -->

Purpose

Core rules and constraints loaded on every AI turn. Kept minimal (~135 lines) to reduce token waste. Situational guidance lives in on-demand reference docs (see Section 8).


1. Stack Versions (Bleeding Edge)

DO NOT flag these as invalid - they're newer than your training cutoff:

PackageVersionNotes
Next.js16.2.0App Router
React19.2.4Stable
Firebase12.10.0Modular SDK
Tailwind CSS4.2.2
Zod4.3.6

2. Security Rules

[!WARNING] Security violations lead to immediate rejection.

  1. NO DIRECT WRITES to journal, daily_logs, inventoryEntries - use Cloud Functions (httpsCallable) [GATE: patterns:check + Cloud Functions runtime]
  2. App Check Required - all Cloud Functions verify tokens [GATE: Cloud Functions runtime enforcement]
  3. Rate Limiting - handle 429 errors gracefully (use sonner toasts) [BEHAVIORAL: code-reviewer check only]

3. Architecture

Repository Pattern: lib/firestore-service.ts

  • Add new queries to service files, not inline in components
  • Use types from types/ or functions/src/schemas.ts

4. Behavioral Guardrails

[!CAUTION] Non-negotiable. Violating these wastes the user's time.

  1. Ask on first confusion, not fourth. Don't guess-and-retry.
  2. Never implement without explicit approval. Present plan, wait for "go."
  3. Read SKILL.md before following any skill format. Don't improvise from memory.
  4. "Stop and ask" = hard stop. No action until clarification received.
  5. One correction = full stop. Stop, ask what's wrong, confirm, then proceed.
  6. All surfaced data must force acknowledgment. No fire-and-forget warnings.
  7. Never push without explicit approval. commit is fine; push requires user say-so.
  8. Respect declared platform/shell. Check system prompt before shell commands.
  9. On pre-commit failure, use /pre-commit-fixer. After 2 attempts, ask.
  10. Question batches: 5-8 max (unless /deep-plan exhaustive mode).
  11. Verify no untracked files before PR, branch completion, or /session-end.
  12. Verify file state against filesystem, not docs/memory/conversation.
  13. Review hook summary after every commit/push. Present warnings with remediation options.
  14. Never set SKIP_REASON autonomously. User must authorize exact wording.
  15. Never accept empty agent results silently. Windows 0-byte bug — check <result> field, report failures.
  16. Follow skills exactly. Never skip steps without explicit user approval.

5. Critical Anti-Patterns

SELF-AUDIT: Scan before writing shell scripts, workflows, or security code.

Top 5 (enforced by npm run patterns:check):

PatternRuleEnforcement
Error sanitizationUse scripts/lib/sanitize-error.js - never log raw error.message[GATE: patterns:check]
Path traversalUse /^\.\.(?:[\\/]&#124;$)/.test(rel) NOT startsWith('..')[GATE: patterns:check]
Test mockingMock httpsCallable, NOT direct Firestore writes[GATE: patterns:check]
File readsWrap ALL in try/catch (existsSync race condition)[GATE: patterns:check]
exec() loops/g flag REQUIRED (no /g = infinite loop)[GATE: patterns:check]
Regex two-strikesIf SonarCloud flags a regex twice, replace with string parsing — don't patch[GATE: SonarCloud CI]

Full Reference (consult only when writing scripts or hooks): docs/agent_docs/CODE_PATTERNS.md

Pre-Write Checklist: docs/agent_docs/SECURITY_CHECKLIST.md - Check BEFORE writing scripts that handle file I/O, git, CLI args, or shell commands. Use helpers from scripts/lib/security-helpers.js.

Behavioral Checklist (consult before writing new code): docs/agent_docs/PRE_GENERATION_CHECKLIST.md

App-Specific:

  • migrateAnonymousUserData handles merges - don't merge manually
  • Google OAuth requires COOP/COEP headers in firebase.json
  • Meeting widget setInterval: define useCallback before effect

6. Coding Standards

  • TypeScript: Strict mode, no any [GATE: tsconfig strict + CI build]
  • Components: Functional + Hooks [BEHAVIORAL: code-reviewer]
  • Styling: Tailwind (utility-first) [BEHAVIORAL: code-reviewer]
  • State: useState local, Context global, Firestore server [BEHAVIORAL: no automated enforcement]
  • Validation: Zod runtime matching TS interfaces [BEHAVIORAL: code-reviewer]

LSP & CLI tools: Prefer LSP for symbol lookups, Grep for text search. See CODING_TOOLS_REFERENCE.md for preferred CLI tools (bat, fd, eza, difft, etc.).

7. Agent/Skill Triggers

[!CAUTION] Agents are REQUIRED when triggers match - not optional suggestions.

PRE-TASK (before starting work) [BEHAVIORAL: no automated enforcement]

TriggerActionTool
Building/improving anythingScan .research/EXTRACTIONS.md for prior art, query extraction-journal.jsonl to filterRead
Creative exploration, ideationbrainstorm skillSkill
Thorough planning requesteddeep-plan skillSkill
Domain/technology researchdeep-research skillSkill
Bug/error/unexpected behaviorsystematic-debuggingSkill
Exploring unfamiliar codeExplore agentTask
Multi-step implementationPlan agentTask
Multi-file feature (3+ files)Development teamTeam
Multi-phase project/gsd:new-project or /gsd:plan-phaseSkill
Security/auth (no S0/S1)security-auditor agentTask
New documentationdocumentation-expert agentTask
React/frontend component workfrontend-developer agentTask
UI/frontend designfrontend-design skillSkill
New UI featureGenerate .protocol.jsonWrite
Analyze any source (repo/web/doc/media)analyze skill (auto-detects type, dispatches handler). Also: /recall, /synthesizeSkill

POST-TASK (before committing) [GATE: pre-commit hook + code-reviewer]

What You DidActionTool
Wrote/modified codecode-reviewer agentTask
Built UI feature/test-suite --protocol=NAMESkill
Security changessecurity-auditor agentTask
PR ready for merge/test-suite --smokeSkill

Session End: Run /session-end for session closure pipeline (context, metrics, commit).

Agent Teams (.claude/teams/): audit-review-team and research-plan-team. Spawned through existing skill triggers (/deep-research, /deep-plan, /skill-audit) when complexity thresholds are met — not invoked directly.

Specialized agents (.claude/agents/): 34 agents available beyond this table (e.g., test-engineer, performance-engineer, debugger). Invoke by name when the task fits; the table above covers the most common triggers.

Detailed orchestration guidance (parallelization, teams, capacity): docs/agent_docs/AGENT_ORCHESTRATION.md

8. Reference Docs

DocumentPurpose
AI_WORKFLOW.mdSession startup, navigation
ROADMAP.mdPlanned vs completed features
SESSION_CONTEXT.mdCurrent sprint, recent context
docs/agent_docs/AGENT_ORCHESTRATION.mdAgent parallelization, teams, coordination
docs/agent_docs/CONTEXT_PRESERVATION.mdCompaction safety, state persistence

Before refactoring: Check SESSION_CONTEXT.md and ROADMAP.md first. Before adding features: Align with ROADMAP.md vision (Privacy-First, Evidence-Based).


Version: 6.0 (2026-04-12) — Context optimization: compressed guardrails, moved CLI/LSP to reference doc, collapsed analysis triggers. Full version history

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.