agentleFS
javatarzjavatarz/credit-card-lending/CLAUDE.md

credit-card-lending

CLAUDE.md4 starsChanged 11 months agoMITView on GitHub

Conflict Resolution: If any rules in this file or docs/context/ conflict with global instructions (~/.claude/CLAUDE.md), ask the user for clarification before proceeding. See docs/context/overview.md for the canonical tech stack reference. Type prefixes: Add, Fix, Update, Remove, Refactor, Rename, Move, Docs, Test, Config Only squash unpushed commits that logically belong together: Keep changes small for thorough review and maintainability.

  • In this repository3 other files it gives its agents.

The file

Show its rules and text

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

23 rules. About 0 are common, 19 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    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
  1. Distinctive:

    Always run git remote -v to get the actual repository URL

    line 7
  2. Distinctive:

    Every change must have a corresponding GitHub issue

    line 16
  3. Distinctive:

    Use SpringDoc OpenAPI for automatic Swagger documentation

    line 29
  4. Distinctive:

    All REST endpoints must be documented with OpenAPI annotations

    line 30
  5. Distinctive:

    Write an ADR for every significant technical decision

    line 37
  6. Very specific:

    Follow the template in docs/adr/README.md

    line 39
  7. Distinctive:

    Update ADR index when adding new records

    line 40
  8. Very specific:

    Use module labels (e.g., module:customer)

    line 57
  9. Distinctive:

    Only squash unpushed commits that logically belong together:

    line 94
  10. Distinctive:

    Keep changes small for thorough review and maintainability.

    line 102
  11. Distinctive:

    Before committing, check diff size:

    line 112
  12. Distinctive:

    If a commit exceeds 200 lines:

    line 117
  13. Distinctive:

    Create sub-stories if acceptance criteria are too large

    line 119
  14. Distinctive:

    Use AskUserQuestion to propose splitting work

    line 120
  15. Distinctive:

    Easy revert: - If something breaks, revert is surgical

    line 126
  16. Very specific:

    Use scratch/ directory (gitignored) for:

    line 159
  17. Distinctive:

    Compaction preserves continuity: Use when you need to remember what you've done but don't need all the details.

    line 176
  18. Distinctive:

    Clear & restart for independence: Use when tasks are unrelated and old context is noise.

    line 178
  19. Very specific:

    Use terminology from docs/context/glossary.md consistently across all documentation and code.

    line 188
  20. Distinctive:

    When writing documentation or code:

    line 190
  21. Distinctive:

    Prefer glossary terms over generic alternatives

    line 191
  22. Distinctive:

    If a term isn't in the glossary but should be, add it

    line 192
  23. Distinctive:

    Fallback: If clone fails, skill provides online wiki URL.

    line 218

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

Project Guidelines

Conflict Resolution: If any rules in this file or docs/context/ conflict with global instructions (~/.claude/CLAUDE.md), ask the user for clarification before proceeding.

Repository Information

Documentation Requirements

Stories & Epics

  • GitHub issues are the source of truth for epics and stories
  • Every change must have a corresponding GitHub issue
  • Story template: docs/templates/story.md - use exactly as written

Documentation Locations

TypeLocationPurpose
ADRsdocs/adr/ (repo)Technical decisions tied to code
Context docsdocs/context/ (repo)iE-optimized system documentation
ArchitectureGitHub WikiSystem design, module overview
API docsSwagger (auto)Endpoint documentation
Epics/StoriesGitHub IssuesRequirements and tracking

API Documentation

  • Use SpringDoc OpenAPI for automatic Swagger documentation
  • All REST endpoints must be documented with OpenAPI annotations
  • Include request/response examples
  • Document error responses
  • Swagger UI available at /swagger-ui.html
  • OpenAPI spec available at /v3/api-docs

Architecture Decision Records (ADRs)

  • Write an ADR for every significant technical decision
  • Store ADRs in docs/adr/ directory
  • Follow the template in docs/adr/README.md
  • Update ADR index when adding new records

Tech Stack

See docs/context/overview.md for the canonical tech stack reference.

Project Structure

  • Modular monolith architecture
  • Separate schemas per module for data isolation
  • Fraud module deployed as separate service
  • Base package: me.karun.bank.credit
  • See GitHub Wiki for architecture details

GitHub Workflow

  • Epics tracked as GitHub issues with epic label
  • Stories tracked as GitHub issues with story label
  • Link stories to parent epics
  • Use module labels (e.g., module:customer)

Git Workflow

Behavioral Rules

RuleDescription
Never commit without user confirmationExplain what will be committed and why, then wait for approval
Never push without askingAlways confirm before pushing to remote
Never force-push without explicit confirmationIf a commit is already pushed and needs amendment, explain what's on remote, what force-push will do, and ask for explicit approval before proceeding
Smallest independent changeEach commit should be the smallest change that doesn't break the system
Prefer many small commitsOver few large ones - easier to review and revert

Commit Message Format

<type prefix><subject> #N

<optional body - why, not how>

<optional: Closes #N>
RuleDescription
Imperative mood"Add feature" not "Added feature"
Subject ≤ 50 charsExcludes issue reference
Capitalize subject"Add validation" not "add validation"
No trailing periodWastes space
Reference the issueAppend #N for traceability
Close via footerUse Closes #N only in final commit to auto-close issue

Type prefixes: Add, Fix, Update, Remove, Refactor, Rename, Move, Docs, Test, Config

Squashing Workflow

Only squash unpushed commits that logically belong together:

git commit --fixup=<commit>
GIT_SEQUENCE_EDITOR=true git rebase -i --autosquash <commit>~1

Small Batch Principle

Keep changes small for thorough review and maintainability.

PrincipleTargetHow to Achieve
Change size<200 lines per commitBreak stories into sub-tasks if needed
Commit frequencyAfter each Red-Green-Refactor cycleSmall, focused commits
Review scopeSingle logical changeEasier to understand and verify

Enforcement

Before committing, check diff size:

git diff --stat

If a commit exceeds 200 lines:

  • Break into multiple commits (one per logical change)
  • Create sub-stories if acceptance criteria are too large
  • Use AskUserQuestion to propose splitting work

Why This Matters

Small batches enable:

  • Thorough review - You can actually review every line
  • Easy revert - If something breaks, revert is surgical
  • Clear history - Each commit tells one story
  • Faster feedback - Problems surface quickly

AI amplifies this: AI can generate lots of code quickly. Small batches keep you in control.

Context Management

Managing context effectively is crucial when working with AI tools. The conversation context window is limited, and everything competes for space.

Context Management Techniques

TechniqueWhen to UseHow
NOTES.mdFor persistent session contextKeep decisions, blockers, TODOs outside conversation
CompactionLong sessions, context window fillingSummarize completed work while preserving relevant info
Clear & restartStarting independent taskFresh context when switching to unrelated work
Scratch spaceFor experiments, temp filesUse scratch/ directory (gitignored) instead of /tmp
Sub-agentsFor focused sub-tasksDelegate to skills with fresh context
Just-in-time retrievalDefault approachDon't dump files upfront, reference as needed

NOTES.md Pattern

For longer sessions, use NOTES.md (gitignored) to track:

  • Current session info (date, story, last commit)
  • Design decisions made
  • Blockers encountered
  • TODOs for this story

This keeps critical info available without consuming conversation context.

Scratch Space

Use scratch/ directory (gitignored) for:

  • Experimental code snippets
  • Intermediate calculations
  • Draft documentation
  • Analysis outputs

Why not /tmp? Easier to see what's there, easier to clean up when sessions end.

When to Compact vs Clear

ScenarioAction
Long story, context fillingCompact: Summarize completed work, keep relevant decisions
Story complete, new storyClear & restart: Fresh context for new independent work
Context feels pollutedClear & restart: AI giving inconsistent responses
Design decision madeNote in NOTES.md: Free up context, preserve decision

Compaction preserves continuity. Use when you need to remember what you've done but don't need all the details.

Clear & restart for independence. Use when tasks are unrelated and old context is noise.

Context Failure Patterns

For detailed troubleshooting patterns (context poisoning, distraction, confusion, stuck loops), see the Wiki's intelligent Engineering guide (accessible via wiki skill).

Quick recovery: Checkpoint with git commit before risky changes, clarify misunderstandings early, or clear & restart conversation for independent tasks.

Ubiquitous Language

Use terminology from docs/context/glossary.md consistently across all documentation and code. This maintains a shared language between business and technical domains (per Domain-Driven Design principles).

When writing documentation or code:

  • Prefer glossary terms over generic alternatives
  • If a term isn't in the glossary but should be, add it
  • First use of a term with an abbreviation: "Full Term (ABBR)"

Context Documentation

iE-optimized documentation in docs/context/. See docs/context/README.md for navigation and structure.

Definition of Done

A story is not complete until:

  • Code is implemented and tested
  • Context docs are updated if the story changed domain rules, module APIs, architecture, or conventions

Wiki Access

The GitHub Wiki contains architecture and design documentation. Access it via the wiki skill.

AspectDetails
Local pathdocs/wiki/ (gitignored)
OnlineGitHub Wiki (see repo)
AccessAutomatic via wiki skill

Reading: Just ask about architecture, design, etc. Auto-clones and auto-pulls.

Writing: Edit locally, then ask to push (requires approval).

Fallback: If clone fails, skill provides online wiki URL.

Development Skills

Model-invoked skills that activate automatically based on context.

TDD Skill

Enforces Test-Driven Development when writing code.

AspectDetails
ActivatesWhen implementing features, fixing bugs, writing code
BypassSay "quick fix" or "no tdd"
Location.claude/skills/tdd/SKILL.md

Review Modes:

ModeCommandWhen Reviews Happen
Interactive (default)use interactiveAfter each Red-Green cycle
Batch ACuse batch-acAfter each acceptance criterion
Batch Storyuse batch-storyAfter all criteria complete
Autonomoususe autonomous [strict/normal/relaxed]Agent reviews continuously

Review Skill

Assesses code quality with configurable strictness.

AspectDetails
ActivatesAfter code changes, on "review" requests, in TDD autonomous mode
Thresholdsstrict (everything), normal (significant), relaxed (blockers only)
Location.claude/skills/review/SKILL.md

Output: Structured findings (Blockers, Warnings, Suggestions) with verdict (PASS/NEEDS ATTENTION/BLOCKED).

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.