agentleFS
bybren-llcbybren-llc/safe-agentic-workflow/CLAUDE.md

safe-agentic-workflow

CLAUDE.md419 starsChanged 4 months agoMITView on GitHub

Repository: {{PROJECT_NAME}} Methodology: SAFe (Scaled Agile Framework) Agentic Workflow Philosophy: "Round Table" - Equal voice, mutual respect, shared responsibility This is a SAFe multi-agent development project with 11 specialized AI agents working collaboratively. You are part of a team where your input has equal weight with human contributors. Core Principles: - Search for existing patterns before creating new ones ("Search First, Reuse Always") - Attach evidence to Linear tickets for all work - You have "stop-the-line" authority for architectural/security concerns…

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

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

18 rules. About 0 are common, 8 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search for existing patterns before creating new ones ("Search First, Reuse Always")

    line 16
  2. Distinctive:

    Follow SAFe methodology: Epic → Feature → Story → Enabler

    line 19
  3. Very specific:

    Important: Always run {{CI_VALIDATE_COMMAND}} before creating a pull request.

    line 59
  4. Distinctive:

    All work follows the SAFe hierarchy and specs-driven development:

    line 95
  5. Distinctive:

    Use in specs to highlight critical decisions:

    line 105
  6. Very specific:

    Search patterns_library/ for existing patterns

    line 114
  7. Very specific:

    Search specs/ for similar specifications

    line 115
  8. Distinctive:

    Search codebase for similar implementations

    line 116
  9. Very specific:

    Always use ORM (type safety) with RLS context helpers (withUserContext, withAdminContext, withSystemContext)

    line 154
  10. Very specific:

    Always create proper migrations (never db push in production)

    line 155
  11. Distinctive:

    Never use direct SQL or bypass RLS policies

    line 156
  12. Very specific:

    Always run {{LINT_COMMAND}} before committing.

    line 179
  13. Distinctive:

    MANDATORY: Read CONTRIBUTING.md before any development.

    line 185
  14. Very specific:

    Create feature branch: {{TICKET_PREFIX}}-{number}-{description}

    line 189
  15. Very specific:

    Create PR using .github/pull_request_template.md

    line 194
  16. Very specific:

    All PRs must be up-to-date with {{MAIN_BRANCH}}

    line 199
  17. Distinctive:

    All CI checks must pass

    line 200
  18. Very specific:

    No direct pushes to {{MAIN_BRANCH}}

    line 202

≈ “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

CLAUDE.md

AI Assistant Context for SAFe Multi-Agent Development

Repository: {{PROJECT_NAME}} Methodology: SAFe (Scaled Agile Framework) Agentic Workflow Philosophy: "Round Table" - Equal voice, mutual respect, shared responsibility


Quick Start

This is a SAFe multi-agent development project with 11 specialized AI agents working collaboratively. You are part of a team where your input has equal weight with human contributors.

Core Principles:

  • Search for existing patterns before creating new ones ("Search First, Reuse Always")
  • Attach evidence to Linear tickets for all work
  • You have "stop-the-line" authority for architectural/security concerns
  • Follow SAFe methodology: Epic → Feature → Story → Enabler

Key Resources:

  • AGENTS.md - All 11 agent roles, invocation patterns, capabilities
  • CONTRIBUTING.md - Git workflow, commit standards, PR process
  • docs/onboarding/ - Setup guides and daily workflows
  • docs/guides/ROUND-TABLE-PHILOSOPHY.md - Collaboration principles
  • patterns_library/ - Reusable code patterns (18+ patterns, 7 categories)
  • knowledge-vault/ - Evidence-verified knowledge base. To build this repo's own vault, run SAW-VAULT-BUILD.md

Development Commands

# Development server
{{DEV_COMMAND}}              # Start development server

# Build and production
{{BUILD_COMMAND}}            # Build for production
{{START_COMMAND}}            # Start production server

# Code quality
{{LINT_COMMAND}}             # Run linting
{{LINT_FIX_COMMAND}}         # Auto-fix linting issues
{{TYPE_CHECK_COMMAND}}       # TypeScript validation
{{FORMAT_CHECK_COMMAND}}     # Prettier formatting check

# Testing
{{TEST_UNIT_COMMAND}}        # Run unit tests
{{TEST_INTEGRATION_COMMAND}} # Run integration tests
{{TEST_E2E_COMMAND}}         # Run end-to-end tests

# Database (if applicable)
{{DB_MIGRATE_COMMAND}}       # Run migrations

# CI/CD validation (REQUIRED before PR)
{{CI_VALIDATE_COMMAND}}      # Run all quality checks

Important: Always run {{CI_VALIDATE_COMMAND}} before creating a pull request.


Architecture Overview

Technology Stack

  • Frontend: {{FRONTEND_FRAMEWORK}}
  • Backend: {{BACKEND_FRAMEWORK}}
  • Database: {{DATABASE_SYSTEM}}
  • ORM: {{ORM_TOOL}}
  • Authentication: {{AUTH_PROVIDER}}
  • Payments: {{PAYMENT_PROVIDER}}
  • Analytics: {{ANALYTICS_PROVIDER}}
  • UI Components: {{UI_LIBRARY}}

Repository Structure

{{PROJECT_NAME}}/
├── CLAUDE.md                    # This file - AI assistant context
├── AGENTS.md                    # Agent team quick reference
├── CONTRIBUTING.md              # Git workflow and commit standards
├── docs/                        # Documentation (onboarding, database, security, sop, workflow)
├── specs/                       # SAFe specifications (Epic/Feature/Story)
├── patterns_library/            # Reusable code patterns (7 categories)
├── .claude/                     # Claude Code harness (hooks, commands, skills, agents)
├── agent_providers/             # Agent configurations
└── scripts/                     # Utility scripts

SAFe Workflow

All work follows the SAFe hierarchy and specs-driven development:

  1. BSA creates spec in specs/{{TICKET_PREFIX}}-XXX-feature-spec.md
  2. System Architect validates architectural approach
  3. Implementation agents execute with pattern discovery
  4. QAS validates against acceptance criteria
  5. Evidence attached to Linear ticket before POPM review

Metacognitive Tags

Use in specs to highlight critical decisions:

  • #PATH_DECISION - Architectural path chosen (document alternatives)
  • #PLAN_UNCERTAINTY - Areas requiring validation
  • #EXPORT_CRITICAL - Security/compliance requirements

Pattern Discovery Protocol (MANDATORY)

Before implementing ANY feature:

  1. Search patterns_library/ for existing patterns
  2. Search specs/ for similar specifications
  3. Search codebase for similar implementations
  4. Consult documentation: CONTRIBUTING.md, docs/database/, docs/security/
  5. Propose to System Architect before implementation

Project-Specific Implementation Notes

Customize this section for your technology stack.

Authentication

Provider: {{AUTH_PROVIDER}}

  • Environment variables: See .env.template
  • Routes: {{AUTH_ROUTES}} / {{PROTECTED_ROUTES}}
  • Patterns: patterns_library/ + docs/security/SECURITY_FIRST_ARCHITECTURE.md

Payments

Provider: {{PAYMENT_PROVIDER}}

  • Webhook endpoints: {{WEBHOOK_ROUTES}}
  • Patterns: patterns_library/api/webhook-handler.md
  • Idempotency required for all payment operations

Analytics

Provider: {{ANALYTICS_PROVIDER}}

  • Privacy-first: No tracking without explicit consent (GDPR/CCPA)
  • Error boundaries: Analytics failures must not crash the app

Database

System: {{DATABASE_SYSTEM}} | ORM: {{ORM_TOOL}}

Guidelines:

  • Always use ORM (type safety) with RLS context helpers (withUserContext, withAdminContext, withSystemContext)
  • Always create proper migrations (never db push in production)
  • Never use direct SQL or bypass RLS policies

Schema Docs: docs/database/DATA_DICTIONARY.md (single source of truth)

Migration Workflow:

{{MIGRATION_CREATE_COMMAND}}     # Create migration
{{MIGRATION_TEST_COMMAND}}       # Test locally
git add {{MIGRATIONS_DIR}}/ && git commit -m "feat(db): add feature migration"
{{MIGRATION_DEPLOY_COMMAND}}     # Deploy to production

Code Quality

Linter: {{LINTER_TOOL}} | Config: {{LINTER_CONFIG_FORMAT}}

{{LINT_COMMAND}}          # Run linter
{{LINT_FIX_COMMAND}}      # Auto-fix issues

Always run {{LINT_COMMAND}} before committing. Consult your linting configuration file for project-specific rules.


CI/CD Pipeline

MANDATORY: Read CONTRIBUTING.md before any development.

PR Workflow

  1. Create feature branch: {{TICKET_PREFIX}}-{number}-{description}
  2. Implement with proper commits: type(scope): description [{{TICKET_PREFIX}}-XXX]
  3. Rebase: git rebase origin/{{MAIN_BRANCH}}
  4. Validate: {{CI_VALIDATE_COMMAND}} (must pass)
  5. Push: git push --force-with-lease
  6. Create PR using .github/pull_request_template.md
  7. Merge using "Rebase and merge" only

Branch Protection

  • All PRs must be up-to-date with {{MAIN_BRANCH}}
  • All CI checks must pass
  • CODEOWNERS reviewers required
  • No direct pushes to {{MAIN_BRANCH}}

Detailed Guides: docs/ci-cd/CI-CD-Pipeline-Guide.md | docs/workflow/

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.