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
Who's talking about poco-ai/poco-claw
- sudosubin/agents.nix“agent-skills.github.poco-ai.poco-claw: init at 0.5.7”GitHub · Oct 1, 2026
- xiaolai/nlpm“Audit candidate: poco-ai/poco-claw”GitHub · Apr 18, 2026
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.
- specs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
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
- Distinctive: line 140
All comments must be in English
- Distinctive: line 141
Keep comments concise - omit obvious comments
- Distinctive: line 142
Follow Google Python Style Guide for docstrings
- Very specific: line 146
All Python code MUST use proper type annotations.
- Very specific: line 192
Use Tailwind CSS v4 utility classes with CSS variables.
- Distinctive: line 202
All pages must follow these spacing rules to maintain consistent visual breathing room:
- Distinctive: line 215
All user-facing text MUST use i18n translations, NOT hardcoded strings:
- Distinctive: line 232
Use feature-first organization with internal layering:
- Very specific: line 245
Do not import from features/*/services/*.
- Distinctive: line 246
Do not let low-level features depend on shell/container modules (avoid reverse dependencies)
- Distinctive: line 250
Prefer one primary component per file
- Distinctive: line 252
If a component exceeds ~300 lines or mixes unrelated responsibilities, split it
- Very specific: line 253
Keep render logic declarative.
- Very specific: line 258
Keep server data access in feature api modules
- Very specific: line 259
Keep feature state in feature hooks/context (model layer), not in route files
- Distinctive: line 260
Avoid duplicated derived state.
- Distinctive: line 261
Use optimistic updates only with rollback handling for failures
- Distinctive: line 267
Keep API request/response types near the feature consuming them
- Distinctive: line 269
Avoid component-to-component type coupling through container modules
- Very specific: line 273
Default to Server Components.
- Very specific: line 274
Place route-specific loading UI in loading.tsx
- Distinctive: line 275
Keep route files thin; delegate business logic to feature modules
- Very specific: line 276
Use proxy route app/api/v1/[...path]/route.ts for browser-side API forwarding
- Distinctive: line 283
Avoid unnecessary re-renders caused by unstable object/array literals in props
- Distinctive: line 287
Before submitting frontend changes:
- Distinctive: line 314
All services can run independently for local development
≈ “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.
Files
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
- User creates task via Frontend
- Executor Manager receives task, creates session via Backend
- Executor Manager schedules task with APScheduler
- Task Dispatcher sends task to Executor with callback URL
- Executor runs Claude Agent SDK with configured hooks
- Hooks send progress callbacks to Executor Manager during execution
- Executor Manager forwards callbacks to Backend for persistence
- 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 # PrettierPython 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 --reloadDatabase 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 migrationGuideline: 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 manuallyTechnology 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, observabilitymodels/- 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 clienthooks/- Hook system for extensibility (base, manager, callback, todo, workspace)utils/- Serializer, git platform clients (GitHub, GitLab)schemas/- Request, response, callback, state schemas and enumsapi/v1/- Task execution callback endpoint
Executor Manager (executor_manager/app/)
core/settings.py- Service configurationscheduler/- APScheduler config and task dispatcherservices/- Backend and executor API clientsschemas/- Task and callback schemasapi/v1/- Task creation, status, and callback endpoints
Frontend (frontend/)
app/- App Router routes, layouts, loading states, proxy routesfeatures/- Domain modules (chat, projects, capabilities, scheduled-tasks, etc.)components/- Cross-feature shared components (ui/,shared/,shell/)hooks/- Cross-feature reusable hooks onlylib/- Framework-agnostic utilities, i18n setup, startup preload logicservices/- Global infrastructure only (e.g., API client); do not put feature business logic heretypes/- 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 codeHTTPException-> preserve status codeException-> 500 with stack trace logged
Rules:
- DO NOT catch
Exceptionto re-raise asHTTPException(500, ...)(redundant) - DO raise
AppExceptionfor business errors,HTTPExceptionfor 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(usemax-w-nonefor wide grid layouts) - CardHeader / CardContent: Global defaults in
components/ui/card.tsxalready includept-5 pb-2(header) andpt-4(content). Do NOT re-add these per-instance. - Toolbar/title to content below:
mb-6 - Between major sections or card groups:
gap-6orspace-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 onlymodel/: business state, domain types, feature hooks/actionsui/: feature UI components/pageslib/: pure utility functions scoped to the featureindex.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.tswhenever possible - Do not import from
features/*/services/*; usefeatures/*/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/uiand shared composites fromcomponents/shared
Frontend State and Data Flow
- Keep server data access in feature
apimodules - Keep feature state in feature hooks/context (
modellayer), 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
anyunless 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.tsfor 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 lintmust passpnpm buildmust 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.tomland.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.pyis 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
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
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.

