Docs
Search⌘ K
  • Home
  • About The Graph
  • Supported Networks
  • Protocol Contracts
  • AI Tooling
  • Subgraphs
    • Substreams
      • Indexer Software
        • Gateway Software
          • Data Services
            • Resources
              Subgraphs > Tooling

              2 minutes

              Agent Skills for Subgraphs

              A collection of AI agent skills providing expert knowledge for developing, testing, and deploying subgraphs with The Graph protocol.

              Overview

              This repository provides subgraph development expertise for AI coding assistants in two formats:

              FormatLocationUse With
              Claude Code Pluginskills/Claude Code CLI
              OpenClaw Skillsopenclaw/OpenClaw / Clawdbot

              Same knowledge, different agent platforms.

              Skills

              Subgraph Development

              Core development knowledge including:

              • Schema design and GraphQL types
              • Manifest configuration (subgraph.yaml)
              • AssemblyScript mapping handlers
              • Data source templates
              • Contract bindings and calls
              • Subgraph Composition - Combine multiple subgraphs
              • Common Patterns - ERC20, DEX, NFT, Lending, Staking, Governance
              • Subgraph Uncrashable (safe code generation)
              • Deployment workflows

              Subgraph Optimization

              Performance best practices from The Graph docs:

              • Pruning with indexerHints
              • Arrays with @derivedFrom
              • Immutable entities and Bytes as IDs
              • Avoiding eth_calls
              • Timeseries and aggregations
              • Grafting for hotfixes

              Subgraph Testing

              Quality assurance with Matchstick and Subgraph Linter:

              • Subgraph Linter - Static analysis to catch bugs before runtime
              • Common Errors - Troubleshooting guide for indexing issues
              • Unit testing setup and patterns with Matchstick
              • Mock events and contract calls
              • Entity assertions
              • Data source mocking
              • CI/CD integration

              Installation

              Claude Code

              1# Add as a Claude Code plugin2claude plugins add PaulieB14/subgraphs-skills

              OpenClaw / Clawdbot

              1# Copy skills to OpenClaw directory2cp -r openclaw/subgraph-* ~/.openclaw/skills/34# Or via ClawHub (when published)5clawdbot skill install subgraph-dev6clawdbot skill install subgraph-optimization7clawdbot skill install subgraph-testing

              Usage Examples

              Once installed, the AI assistant will have access to subgraph development expertise:

              Schema Design:

              “Create a schema for tracking DEX swaps with proper relationships”

              Optimization:

              “How do I optimize my subgraph for faster indexing?”

              Testing:

              “Write unit tests for my Transfer event handler”

              Resources

              • Subgraph Best Practices
              • Subgraph Composition - Combine multiple subgraphs
              • Subgraph Linter - Static analysis tool
              • Subgraph Uncrashable - Safe code generation
              • Matchstick Testing Framework
              • AssemblyScript API

              Platforms

              This skill pack works with:

              PlatformDescriptionLink
              Claude CodeAnthropic’s official CLI for Claudeclaude.ai/claude-code⁠
              OpenClawOpen-source AI agent frameworkgithub.com/openclaw/openclaw⁠

              Acknowledgments

              • Built with Claude⁠ (Anthropic’s AI assistant)
              • Subgraph expertise from The Graph Documentation
              • Inspired by AGENTS.md⁠ format
              • OpenClaw format based on substreams-skills⁠
              ⁠Edit on GitHub⁠

              CursorSmart Contract Analysis with Cana CLI
              On this page
              • Overview
              • Skills
              • Subgraph Development
              • Subgraph Optimization
              • Subgraph Testing
              • Installation
              • Claude Code
              • OpenClaw / Clawdbot
              • Usage Examples
              • Resources
              • Platforms
              • Acknowledgments
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service