addon-langgraph-agent
Add-on: LangGraph Agent
Use this skill when a project needs multi-step agent execution (tool use, checkpoints, and bounded loops) through LangGraph.
Compatibility
- Works with
architect-python-uv-fastapi-sqlalchemyandarchitect-nextjs-bun-app. - Can be combined with
addon-langchain-llmfor shared provider setup. - Can be combined with
addon-google-agent-dev-kitwhen ADK interop is needed.
Inputs
Collect:
AGENT_SCOPE: tasks the agent is explicitly allowed to perform.CHECKPOINT_BACKEND:memory|postgres|redis.ALLOW_TOOLS: explicit tool allow-list.MAX_STEPS: default10.TIMEOUT_SECONDS: default45.
Integration Workflow
- Add dependencies:
- Python:
uv add langgraph langchain-core pydantic-settings
- Next.js:
# Use the project's package manager (examples):
bun add @langchain/langgraph zod
pnpm add @langchain/langgraph zod
- Add files by architecture:
- Python API:
src/{{MODULE_NAME}}/agent/state.py
src/{{MODULE_NAME}}/agent/graph.py
src/{{MODULE_NAME}}/agent/tools.py
src/{{MODULE_NAME}}/api/routes/agent.py
- Next.js:
src/lib/agent/state.ts
src/lib/agent/graph.ts
src/lib/agent/tools.ts
src/app/api/agent/runs/route.ts
- Expose run lifecycle endpoints:
- Create run (
POST /v1/agent/runsor app-equivalent route). - Fetch run status (
GET /v1/agent/runs/{run_id}or app-equivalent route).
- Persist run telemetry:
run_id,status,steps,started_at,finished_at,error.
Required Template
Agent run response shape
{
"runId": "uuid",
"status": "queued"
}
Guardrails
-
Documentation contract for generated code:
- Python: write module docstrings and docstrings for public classes, methods, and functions.
- Next.js/TypeScript: write JSDoc for exported components, hooks, utilities, and route handlers.
- Add concise rationale comments only for non-obvious logic, invariants, or safety constraints.
- Apply this contract even when using template snippets below; expand templates as needed.
-
Restrict tools to explicit allow-list only.
-
Enforce max-step and timeout boundaries.
-
Persist failure state for post-run inspection.
-
Return deterministic fallback on provider/tool failure.
Validation Checklist
- Confirm generated code includes required docstrings/JSDoc and rationale comments for non-obvious logic.
uv run ruff check . || true
uv run mypy src || true
# Use the project's package manager (examples):
bun run lint || true
pnpm run lint || true
rg -n "runId|MAX_STEPS|timeout|allow-list" src || true
- Manual checks:
- Run creation returns stable run id format.
- Agent aborts safely after max steps.
Decision Justification Rule
- Every non-trivial decision must include a concrete justification.
- Capture the alternatives considered and why they were rejected.
- State tradeoffs and residual risks for the chosen option.
- If justification is missing, treat the task as incomplete and surface it as a blocker.
More from ajrlewis/ai-skills
architect-python-uv-fastapi-sqlalchemy
Use when scaffolding production-ready FastAPI services with uv, SQLAlchemy, Alembic, Postgres, Docker, and CI gates.
11addon-rag-ingestion-pipeline
Use when adding multi-format RAG ingest, chunk, embed, and retrieval pipelines; pair with architect-python-uv-batch or architect-python-uv-fastapi-sqlalchemy.
11addon-docling-legal-chunk-embed
Use when you need legal PDF to markdown extraction plus clause chunking and embedding prep; pair with addon-rag-ingestion-pipeline and architect-python-uv-batch.
10addon-llm-ancient-greek-translation
Use when adding Koine or Attic Greek translation to Next.js content flows; pair with ui-editorial-writing-surface and addon-nostr-nip23-longform.
10architect-python-uv-batch
Use when scaffolding production-ready Python uv batch or worker projects with Docker required by default.
10addon-human-pr-review-gate
Use when agent-generated code must pass a human PR review gate with trusted checks and merge blocks; pair with addon-decision-justification-ledger and architect-stack-selector.
9