mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Refactors the Claude Code skills for a cleaner, more intuitive dev loop. ### Changes 🏗️ - **`/pr-review` (new)**: Actual code review skill — reads the PR diff, fetches existing comments to avoid duplicates, and posts inline GitHub comments with structured feedback (Blockers / Should Fix / Nice to Have / Nit) covering correctness, security, code quality, architecture, and testing. - **`/pr-address` (was `/babysit-pr`)**: Addresses review comments and monitors CI until green. Renamed from `/babysit-pr` to `/pr-address` to better reflect its purpose. Handles bot-specific feedback (autogpt-reviewer, sentry, coderabbitai) and loops until all comments are addressed and CI is green. - **`/backend-check` + `/frontend-check` → `/check`**: Unified into a single `/check` skill that auto-detects whether backend (Python) or frontend (TypeScript) code changed and runs the appropriate formatting, linting, type checking, and tests. Shared code quality rules applied to both. - **`/code-style` enhanced**: Now covers both Python and TypeScript/React. Added learnings from real PR work: lazy `%s` logging, TOCTOU awareness, SSE protocol rules (`data:` vs `: comment`), FastAPI `Security()` vs `Depends()`, Redis pipeline atomicity, error path sanitization, mock target rules after refactoring. - **`/worktree` fixed**: Normal `git worktree` is now the default (was branchlet-first). Branchlet moved to optional section. All paths derived from `git rev-parse --show-toplevel`. - **`/pr-create`, `/openapi-regen`, `/new-block` cleaned up**: Reference `/check` and `/code-style` instead of duplicating instructions. ### Checklist 📋 #### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Verified all skill files parse correctly (valid YAML frontmatter) - [x] Verified skill auto-detection triggers updated in descriptions - [x] Verified old backend-check and frontend-check directories removed - [x] Verified pr-review and pr-address directories created with correct content
3.6 KiB
3.6 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
AutoGPT Platform is a monorepo containing:
- Backend (
backend): Python FastAPI server with async support - Frontend (
frontend): Next.js React application - Shared Libraries (
autogpt_libs): Common Python utilities
Component Documentation
- Backend: See @backend/CLAUDE.md for backend-specific commands, architecture, and development tasks
- Frontend: See @frontend/CLAUDE.md for frontend-specific commands, architecture, and development patterns
Key Concepts
- Agent Graphs: Workflow definitions stored as JSON, executed by the backend
- Blocks: Reusable components in
backend/backend/blocks/that perform specific tasks - Integrations: OAuth and API connections stored per user
- Store: Marketplace for sharing agent templates
- Virus Scanning: ClamAV integration for file upload security
Environment Configuration
Configuration Files
- Backend:
backend/.env.default(defaults) →backend/.env(user overrides) - Frontend:
frontend/.env.default(defaults) →frontend/.env(user overrides) - Platform:
.env.default(Supabase/shared defaults) →.env(user overrides)
Docker Environment Loading Order
.env.defaultfiles provide base configuration (tracked in git).envfiles provide user-specific overrides (gitignored)- Docker Compose
environment:sections provide service-specific overrides - Shell environment variables have highest precedence
Key Points
- All services use hardcoded defaults in docker-compose files (no
${VARIABLE}substitutions) - The
env_filedirective loads variables INTO containers at runtime - Backend/Frontend services use YAML anchors for consistent configuration
- Supabase services (
db/docker/docker-compose.yml) follow the same pattern
Branching Strategy
devis the main development branch. All PRs should targetdev.masteris the production branch. Only used for production releases.
Creating Pull Requests
- Create the PR against the
devbranch of the repository. - Ensure the branch name is descriptive (e.g.,
feature/add-new-block) - Use conventional commit messages (see below)
- Fill out the .github/PULL_REQUEST_TEMPLATE.md template as the PR description
- Run the github pre-commit hooks to ensure code quality.
Reviewing/Revising Pull Requests
Use /pr-review to review a PR or /pr-address to address comments.
When fetching comments manually:
gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews— top-level reviewsgh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments— inline review commentsgh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments— PR conversation comments
Conventional Commits
Use this format for commit messages and Pull Request titles:
Conventional Commit Types:
feat: Introduces a new feature to the codebasefix: Patches a bug in the codebaserefactor: Code change that neither fixes a bug nor adds a feature; also applies to removing featuresci: Changes to CI configurationdocs: Documentation-only changesdx: Improvements to the developer experience
Recommended Base Scopes:
platform: Changes affecting both frontend and backendfrontendbackendinfrablocks: Modifications/additions of individual blocks
Subscope Examples:
backend/executorbackend/dbfrontend/builder(includes changes to the block UI component)infra/prod
Use these scopes and subscopes for clarity and consistency in commit messages.