agentleFS
SentryKnown publishergetsentry/action-onlyrobots/CLAUDE.md

action-onlyrobots

CLAUDE.md18 starsChanged 16 months agoApache-2.0View on GitHub

This file provides guidance to Claude Code when working with this repository. This is a Cloudflare Worker that acts as a GitHub webhook receiver for pull requests. Its purpose is to enforce "agentic development only" by evaluating code changes and determining whether they appear to be written by AI agents rather than humans. MANDATORY after ANY code changes: - Run pnpm run typecheck to verify TypeScript compilation - Run pnpm run lint to check code style - Run pnpm run…

  • Reads credentials
  • Installs packages

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, 11 are distinctive, and 7 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.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check run creation for reporting results

    line 34
  2. Very specific:

    Run pnpm run typecheck to verify TypeScript compilation

    line 65
  3. Very specific:

    Run pnpm run lint to check code style

    line 66
  4. Very specific:

    Run pnpm run test to verify LLM integration works

    line 67
  5. Distinctive:

    Ensure all lint-staged hooks pass on commit

    line 68
  6. Very specific:

    Create .env file with OPENAI_API_KEY=sk-your-key-here

    line 73
  7. Very specific:

    Use pnpm run test for full test suite or pnpm run test:watch for development

    line 75
  8. Very specific:

    Use wrangler secret for sensitive values

    line 85
  9. Distinctive:

    Use Biome for formatting and linting

    line 89
  10. Distinctive:

    Follow TypeScript strict mode

    line 90
  11. Very specific:

    Prefer const over let

    line 91
  12. Distinctive:

    Use explicit return types for functions

    line 92
  13. Distinctive:

    Keep functions focused and single-purpose

    line 93
  14. Distinctive:

    High confidence required: Only flag as AI when confidence is >75% with strong indicators

    line 104
  15. Distinctive:

    Consider OpenAI rate limits for high-traffic repositories

    line 130
  16. Distinctive:

    Always verify webhook signatures in production

    line 143
  17. Distinctive:

    Never log or expose secrets

    line 144
  18. Distinctive:

    Use least-privilege access for GitHub API

    line 146

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

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

CLAUDE.md

This file provides guidance to Claude Code when working with this repository.

Repository Overview

This is a Cloudflare Worker that acts as a GitHub webhook receiver for pull requests. Its purpose is to enforce "agentic development only" by evaluating code changes and determining whether they appear to be written by AI agents rather than humans.

Repository Structure

no-humans-agent/
├── src/
│   ├── index.ts      # Main webhook handler and Cloudflare Worker entry
│   ├── types.ts      # TypeScript interfaces for GitHub webhooks
│   ├── github.ts     # GitHub API integration and webhook verification
│   └── evaluator.ts  # Code evaluation logic to detect human-written code
├── wrangler.toml     # Cloudflare Worker configuration
├── tsconfig.json     # TypeScript configuration
├── biome.json        # Code formatting and linting configuration
└── package.json      # Project dependencies and scripts

Core Components

Webhook Handler (src/index.ts)

  • Cloudflare Worker fetch handler
  • Processes GitHub pull_request events
  • Orchestrates evaluation and reporting

GitHub Integration (src/github.ts)

  • Webhook signature verification using HMAC-SHA256
  • GitHub API client for fetching PR files
  • Check run creation for reporting results

LLM Evaluator (src/llm-evaluator.ts)

  • Uses OpenAI GPT-4o-mini for intelligent code analysis
  • Detects AI tool attribution (Claude Code, Cursor, etc.)
  • Analyzes code patterns, style, and quality indicators
  • Provides detailed reasoning and confidence scores

Development Commands

# Install dependencies
pnpm install

# Run development server
pnpm run dev

# Deploy to Cloudflare
pnpm run deploy

# Type checking
pnpm run typecheck

# Code formatting and linting
pnpm run lint
pnpm run lint:fix

Code Validation Requirements

MANDATORY after ANY code changes:

  • Run pnpm run typecheck to verify TypeScript compilation
  • Run pnpm run lint to check code style
  • Run pnpm run test to verify LLM integration works
  • Ensure all lint-staged hooks pass on commit

Testing Setup

Required for testing:

  • Create .env file with OPENAI_API_KEY=sk-your-key-here
  • Tests make real OpenAI API calls to validate functionality
  • Use pnpm run test for full test suite or pnpm run test:watch for development

Configuration

Environment Variables

  • GITHUB_WEBHOOK_SECRET: Secret for verifying webhook signatures (optional but recommended)
  • OPENAI_API_KEY: OpenAI API key for LLM-based code evaluation (required)

Wrangler Configuration

  • Set in wrangler.toml
  • Use wrangler secret for sensitive values

Code Style Guidelines

  • Use Biome for formatting and linting
  • Follow TypeScript strict mode
  • Prefer const over let
  • Use explicit return types for functions
  • Keep functions focused and single-purpose

Evaluation Strategy

The LLM evaluator uses OpenAI's GPT-4o-mini to analyze code changes and determine if they appear human or AI-generated.

Core Principle: Err on the Side of Not Failing PRs

CRITICAL: The system is designed to DEFAULT TO HUMAN AUTHORSHIP. We prioritize avoiding false positives (incorrectly blocking human developers) over catching all AI-generated code. This means:

  • Default assumption: Code is human-written unless proven otherwise
  • High confidence required: Only flag as AI when confidence is >75% with strong indicators
  • PR context matters: Human patterns (no description, terse titles, CI/CD changes) can override AI detection
  • Better to miss AI code than falsely flag human developers

Detection Indicators

Priority Indicators:

  • AI Tool Attribution: Direct mentions of "Claude Code", "Cursor", "GitHub Copilot", etc.
  • Commit Messages: References to AI assistance

Analysis Criteria:

  • Code style consistency and professionalism
  • Comment quality (JSDoc vs casual)
  • Debugging artifacts and temporary code
  • TypeScript usage patterns
  • Error handling and code structure

Deployment Notes

  1. Set required environment variables in Cloudflare:
    • OPENAI_API_KEY: Your OpenAI API key
    • GITHUB_WEBHOOK_SECRET: GitHub webhook secret (optional)
  2. GitHub webhook should be configured for:
    • Event: Pull requests
    • Actions: opened, synchronize, reopened
  3. Worker needs to respond within Cloudflare's timeout limits
  4. Consider OpenAI rate limits for high-traffic repositories

Future Enhancements

Consider adding:

  • GitHub App authentication for check runs
  • Configurable evaluation rules
  • Webhook event filtering
  • Result caching for large PRs
  • Integration with GitHub Actions

Security Considerations

  • Always verify webhook signatures in production
  • Never log or expose secrets
  • Validate all incoming data
  • Use least-privilege access for GitHub API

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.