agentleFS
poco-aipoco-ai/poco-claw/AGENTS.md

poco-claw

AGENTS.md1.4k starsChanged 7 months agoMITView on GitHub

This file provides guidance for AI coding agents working with code in this repository. Poco is a multi-service AI agent execution platform that orchestrates Claude AI agents to perform coding tasks. The system consists of four main components: Each Python service has its own directory with a pyproject.toml. Run commands from within the service directory: Guideline: Always start migrations with --autogenerate + upgrade head, then manually review and adjust the generated revision file. Do not hand-write a migration from scratch…

  • Reads credentials
  • Installs packages

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the poco-ai/poco-claw repository that our weekly crawl found: only 2 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about poco-ai/poco-claw

The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

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

26 rules. About 0 are common, 17 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

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

    All comments must be in English

    line 140
  2. Distinctive:

    Keep comments concise - omit obvious comments

    line 141
  3. Distinctive:

    Follow Google Python Style Guide for docstrings

    line 142
  4. Very specific:

    All Python code MUST use proper type annotations.

    line 146
  5. Very specific:

    Use Tailwind CSS v4 utility classes with CSS variables.

    line 192
  6. Distinctive:

    All pages must follow these spacing rules to maintain consistent visual breathing room:

    line 202
  7. Distinctive:

    All user-facing text MUST use i18n translations, NOT hardcoded strings:

    line 215
  8. Distinctive:

    Use feature-first organization with internal layering:

    line 232
  9. Very specific:

    Do not import from features/*/services/*.

    line 245
  10. Distinctive:

    Do not let low-level features depend on shell/container modules (avoid reverse dependencies)

    line 246
  11. Distinctive:

    Prefer one primary component per file

    line 250
  12. Distinctive:

    If a component exceeds ~300 lines or mixes unrelated responsibilities, split it

    line 252
  13. Very specific:

    Keep render logic declarative.

    line 253
  14. Very specific:

    Keep server data access in feature api modules

    line 258
  15. Very specific:

    Keep feature state in feature hooks/context (model layer), not in route files

    line 259
  16. Distinctive:

    Avoid duplicated derived state.

    line 260
  17. Distinctive:

    Use optimistic updates only with rollback handling for failures

    line 261
  18. Distinctive:

    Keep API request/response types near the feature consuming them

    line 267
  19. Distinctive:

    Avoid component-to-component type coupling through container modules

    line 269
  20. Very specific:

    Default to Server Components.

    line 273
  21. Very specific:

    Place route-specific loading UI in loading.tsx

    line 274
  22. Distinctive:

    Keep route files thin; delegate business logic to feature modules

    line 275
  23. Very specific:

    Use proxy route app/api/v1/[...path]/route.ts for browser-side API forwarding

    line 276
  24. Distinctive:

    Avoid unnecessary re-renders caused by unstable object/array literals in props

    line 283
  25. Distinctive:

    Before submitting frontend changes:

    line 287
  26. Distinctive:

    All services can run independently for local development

    line 314

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

AGENTS.md

This file provides guidance for AI coding agents working with code in this repository.

Project Overview

Poco is a multi-service AI agent execution platform that orchestrates Claude AI agents to perform coding tasks. The system consists of four main components:

  • Frontend (Next.js 16) - Web UI for task management and monitoring
  • Backend (FastAPI) - API server, database management, and session orchestration
  • Executor (FastAPI + Claude Agent SDK) - Agent execution engine with hook-based extensibility
  • Executor Manager (FastAPI + APScheduler) - Task scheduling and dispatch service

Architecture Flow

  1. User creates task via Frontend
  2. Executor Manager receives task, creates session via Backend
  3. Executor Manager schedules task with APScheduler
  4. Task Dispatcher sends task to Executor with callback URL
  5. Executor runs Claude Agent SDK with configured hooks
  6. Hooks send progress callbacks to Executor Manager during execution
  7. Executor Manager forwards callbacks to Backend for persistence
  8. Frontend polls Backend for session status updates

Development Commands

Frontend (Next.js)

cd frontend
pnpm install        # Install dependencies
pnpm dev            # Development server
pnpm build          # Build for production
pnpm start          # Start production server
pnpm lint           # ESLint
pnpm format         # Prettier

Python Services (Backend, Executor, Executor Manager)

Each Python service has its own directory with a pyproject.toml. Run commands from within the service directory:

cd <service>        # backend/, executor/, or executor_manager/
uv sync             # Install dependencies
uv run python -m app.main    # Run development server
# Or directly with uvicorn:
uvicorn app.main:app --reload

Database Migrations (Backend)

cd backend
uv run -m alembic revision --autogenerate -m "description"  # Autogenerate migration (review and adjust)
uv run -m alembic upgrade head                               # Apply migrations
uv run -m alembic downgrade -1                               # Rollback one migration

Guideline: Always start migrations with --autogenerate + upgrade head, then manually review and adjust the generated revision file. Do not hand-write a migration from scratch as the first step.

Pre-commit Hooks

pre-commit install      # Install hooks
pre-commit run --all-files  # Run manually

Technology Stack

Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4, shadcn/ui, pnpm

Backend Services: Python 3.12+, FastAPI, Uvicorn, SQLAlchemy 2.0, Alembic, Pydantic Settings, PostgreSQL

Executor: claude-agent-sdk, FastAPI

Executor Manager: APScheduler, httpx, FastAPI

Package Managers: UV for Python, pnpm for Node.js

Python Package Index: Tsinghua mirror (https://pypi.tuna.tsinghua.edu.cn/simple)

Code Organization

Backend (backend/app/)

  • api/v1/ - API endpoints (sessions, callback)
  • core/ - Settings, error handlers, middleware, observability
  • models/ - SQLAlchemy models (agent_session, agent_message, tool_execution, usage_log)
  • repositories/ - Data access layer (session_repository, message_repository, etc.)
  • schemas/ - Pydantic schemas (session, callback, response)
  • services/ - Business logic (session_service, callback_service)
  • main.py - FastAPI app factory

Executor (executor/app/)

  • core/ - AgentExecutor engine, workspace management, callback client
  • hooks/ - Hook system for extensibility (base, manager, callback, todo, workspace)
  • utils/ - Serializer, git platform clients (GitHub, GitLab)
  • schemas/ - Request, response, callback, state schemas and enums
  • api/v1/ - Task execution callback endpoint

Executor Manager (executor_manager/app/)

  • core/settings.py - Service configuration
  • scheduler/ - APScheduler config and task dispatcher
  • services/ - Backend and executor API clients
  • schemas/ - Task and callback schemas
  • api/v1/ - Task creation, status, and callback endpoints

Frontend (frontend/)

  • app/ - App Router routes, layouts, loading states, proxy routes
  • features/ - Domain modules (chat, projects, capabilities, scheduled-tasks, etc.)
  • components/ - Cross-feature shared components (ui/, shared/, shell/)
  • hooks/ - Cross-feature reusable hooks only
  • lib/ - Framework-agnostic utilities, i18n setup, startup preload logic
  • services/ - Global infrastructure only (e.g., API client); do not put feature business logic here
  • types/ - Global shared types only; feature-specific types stay in each feature

Key Design Patterns

  • Repository Pattern - Data access abstraction in backend/app/repositories/
  • Service Layer - Business logic in backend/app/services/
  • Hook Pattern - Plugin-based extensibility in executor/app/hooks/
  • Abstract Base Classes - Git platform clients extend BaseGitClient

Environment Configuration

Each Python service requires a .env file. See backend/.env.example for the Backend template.

Backend: DATABASE_URL, HOST, PORT, CORS_ORIGINS, SECRET_KEY, DEBUG Executor Manager: backend_url, callback_base_url, max_concurrent_tasks, callback_token Executor: DEFAULT_MODEL, workspace mount path

Development Standards

Code Comments

  • All comments must be in English
  • Keep comments concise - omit obvious comments
  • Follow Google Python Style Guide for docstrings

Type Annotations (Python 3.12+)

All Python code MUST use proper type annotations. Since we use Python 3.12+, prefer built-in generic types over typing module (e.g., list[T] instead of List[T], T | None instead of Optional[T]).

Backend Layer Separation

Repositories (backend/app/repositories/):

  • Database operations only (CRUD)
  • No business logic
  • Return SQLAlchemy model instances

Services (backend/app/services/):

  • Business logic
  • Transaction management
  • Orchestrate multiple repository calls
  • Return types: SQLAlchemy models OR Pydantic schemas
  • DO NOT return dict[str, Any] - use explicit schemas for type safety

Database Injection:

Database sessions MUST be injected via FastAPI dependency injection at the API endpoint level, then passed as parameters to service/repository methods. Each request gets its own db session from the connection pool.

Schemas (backend/app/schemas/):

  • Data transfer objects
  • Define API request/response contracts
  • Pydantic models for validation and serialization
  • Naming: {Entity}{Action}Request / {Entity}Response (e.g., SessionCreateRequest, CallbackResponse)
  • Internal/nested models use descriptive names (e.g., TaskConfig, AgentCurrentState)

API Endpoint Exception Handling

Global handlers in app/core/errors/exception_handlers.py process:

  • AppException -> 400 with error code
  • HTTPException -> preserve status code
  • Exception -> 500 with stack trace logged

Rules:

  • DO NOT catch Exception to re-raise as HTTPException(500, ...) (redundant)
  • DO raise AppException for business errors, HTTPException for HTTP-specific errors
  • DO NOT log errors - global handler uses logger.exception()

Frontend Styling

Use Tailwind CSS v4 utility classes with CSS variables. All colors, shadows, and spacing should reference the design system variables in app/globals.css:

  • Colors: var(--background), var(--foreground), var(--primary), var(--border), etc.
  • Shadows: var(--shadow-sm), var(--shadow-md), var(--shadow-lg), etc.
  • Border radius: var(--radius)

DO NOT hardcode colors like #ffffff or write raw CSS without using these variables.

Frontend Spacing System

All pages must follow these spacing rules to maintain consistent visual breathing room:

  • Content shell: pt-8 pb-6 px-4 sm:px-6, max-w-4xl (use max-w-none for wide grid layouts)
  • CardHeader / CardContent: Global defaults in components/ui/card.tsx already include pt-5 pb-2 (header) and pt-4 (content). Do NOT re-add these per-instance.
  • Toolbar/title to content below: mb-6
  • Between major sections or card groups: gap-6 or space-y-6
  • Between list items within a card: space-y-3
  • Title to subtitle: space-y-1.5

Reference implementations: CapabilityContentShell, TeamContentShell.

Frontend Internationalization (i18n)

All user-facing text MUST use i18n translations, NOT hardcoded strings:

import { useT } from "@/lib/i18n/client";
const { t } = useT();

// ✅ Correct
<Button>{t("sidebar.newTask")}</Button>

// ❌ Wrong
<Button>New Task</Button>

Translation files: frontend/lib/i18n/locales/{lng}/translation.json | Config: frontend/lib/i18n/settings.ts

Frontend Architecture and Boundaries

Use feature-first organization with internal layering:

  • Recommended internal layout for each feature: api/, model/, ui/, lib/, index.ts
  • api/: backend calls and DTO mapping only
  • model/: business state, domain types, feature hooks/actions
  • ui/: feature UI components/pages
  • lib/: pure utility functions scoped to the feature
  • index.ts: public surface of the feature

Boundary rules:

  • app/ should compose feature public APIs and should not import deep internals from other features
  • Cross-feature imports should go through features/<feature>/index.ts whenever possible
  • Do not import from features/*/services/*; use features/*/api/* instead
  • Do not let low-level features depend on shell/container modules (avoid reverse dependencies)

Frontend Component Standards

  • Prefer one primary component per file
  • Split large components into container + presentational parts
  • If a component exceeds ~300 lines or mixes unrelated responsibilities, split it
  • Keep render logic declarative; move heavy data shaping into hooks or lib/
  • Reuse shared UI primitives from components/ui and shared composites from components/shared

Frontend State and Data Flow

  • Keep server data access in feature api modules
  • Keep feature state in feature hooks/context (model layer), not in route files
  • Avoid duplicated derived state; compute from source state with memoization
  • Use optimistic updates only with rollback handling for failures
  • Co-locate domain-specific state with the owning feature

Frontend Type Safety

  • No any unless absolutely unavoidable; use explicit interfaces/types
  • Keep API request/response types near the feature consuming them
  • Validate untrusted external input with schema validation (e.g., zod) before mutation calls
  • Avoid component-to-component type coupling through container modules

Next.js App Router Conventions

  • Default to Server Components; add "use client" only when interactivity is required
  • Place route-specific loading UI in loading.tsx
  • Keep route files thin; delegate business logic to feature modules
  • Use proxy route app/api/v1/[...path]/route.ts for browser-side API forwarding

Frontend Performance Guidelines

  • Dynamic-import heavy viewers/editors and browser-only libraries
  • Memoize expensive computations and stable callbacks in hot rendering paths
  • Virtualize or paginate long lists when item count is large
  • Avoid unnecessary re-renders caused by unstable object/array literals in props

Frontend Quality Gates

Before submitting frontend changes:

  • pnpm lint must pass
  • pnpm build must pass
  • Manually verify key flows impacted by changes (create task, chat execution, project switching, capabilities CRUD)

Linting and Formatting

Python:

  • Ruff for linting and formatting
  • Pyrefly for type checking
  • Configured in root pyproject.toml and .pre-commit-config.yaml

TypeScript/React:

  • ESLint with Next.js config
  • Prettier for formatting
  • Configured in .pre-commit-config.yaml

Important Notes

  • The workspace mount path in executor/app/core/engine.py is hardcoded to /Users/qychen/01-Develop/toto
  • APScheduler uses in-memory job storage (jobs lost on restart)
  • Callback endpoints use token-based authentication
  • Git operations support GitHub and GitLab platforms
  • All services can run independently for local development

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.