Skip to content

PaulieB14/Subgraph-Skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subgraphs Skills

Claude Code OpenClaw The Graph License: MIT

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:

Format Location Use With
Claude Code Plugin skills/ Claude Code CLI
OpenClaw Skills openclaw/ OpenClaw / Clawdbot

Same knowledge, different agent platforms.

Skills

🛠️ subgraph-dev

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

# Add as a Claude Code plugin
claude plugins add PaulieB14/subgraphs-skills

OpenClaw / Clawdbot

# Copy skills to OpenClaw directory
cp -r openclaw/subgraph-* ~/.openclaw/skills/

# Or via ClawHub (when published)
clawdbot skill install subgraph-dev
clawdbot skill install subgraph-optimization
clawdbot skill install subgraph-testing

Manual

Clone this repository and reference it in your agent's configuration.

Repository Structure

subgraphs-skills/
├── .claude-plugin/
│   └── manifest.json           # Claude Code plugin metadata
├── skills/                     # Claude Code format
│   ├── subgraph-dev/
│   │   ├── SKILL.md
│   │   └── references/
│   │       ├── schema-types.md
│   │       ├── assemblyscript-api.md
│   │       ├── subgraph-composition.md
│   │       ├── subgraph-uncrashable.md
│   │       └── patterns.md
│   ├── subgraph-optimization/
│   │   ├── SKILL.md
│   │   └── references/
│   │       └── performance-benchmarks.md
│   └── subgraph-testing/
│       ├── SKILL.md
│       └── references/
│           ├── matchstick-api.md
│           ├── subgraph-linter.md
│           └── common-errors.md
├── openclaw/                   # OpenClaw format (YAML frontmatter)
│   ├── README.md
│   ├── subgraph-dev/
│   │   └── SKILL.md
│   ├── subgraph-optimization/
│   │   └── SKILL.md
│   └── subgraph-testing/
│       └── SKILL.md
├── examples/                   # Working code examples
│   ├── README.md
│   └── erc20-token/
├── scripts/
├── package.json
└── README.md

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

Platforms

This skill pack works with:

Platform Description Link
Claude Code Anthropic's official CLI for Claude claude.ai/claude-code
OpenClaw Open-source AI agent framework github.com/openclaw/openclaw

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Acknowledgments

License

MIT

About

AI agent skills for developing, testing, and optimizing subgraphs with The Graph protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors