TheGraph subgraph development with AssemblyScript handlers, schema definitions, and Matchstick testing. Triggers on subgraph, thegraph, graphql, mapping.ts.
Builds TheGraph subgraphs with AssemblyScript event handlers and schema definitions. Triggers on "subgraph", "thegraph", or "graphql" keywords to create blockchain indexers with entity mappings and Matchstick tests.
/plugin marketplace add settlemint/agent-marketplace/plugin install devtools@settlemintThis skill inherits all available tools. When active, it can use any tool Claude has access to.
<mcp_first> CRITICAL: TheGraph has no Context7 docs. Use OctoCode to search graph-ts.
MCPSearch({ query: "select:mcp__plugin_devtools_octocode__githubSearchCode" })
// graph-ts type definitions
mcp__octocode__githubSearchCode({
keywordsToSearch: ["BigInt", "Bytes", "Address", "store"],
owner: "graphprotocol",
repo: "graph-tooling",
path: "packages/ts/common",
mainResearchGoal: "Understand graph-ts type system",
researchGoal: "Find BigInt, Bytes, Address type definitions",
reasoning: "Need current API for AssemblyScript types"
})
// Entity patterns
mcp__octocode__githubSearchCode({
keywordsToSearch: ["Entity", "save", "load"],
owner: "graphprotocol",
repo: "graph-tooling",
path: "packages/ts",
mainResearchGoal: "Understand graph-ts entity patterns",
researchGoal: "Find entity save/load patterns",
reasoning: "Need current API for entity persistence"
})
// Matchstick testing
mcp__octocode__githubSearchCode({
keywordsToSearch: ["createMockedFunction", "newMockEvent", "assert"],
owner: "LimeChain",
repo: "matchstick",
path: "packages/matchstick-as/assembly",
mainResearchGoal: "Understand Matchstick testing",
researchGoal: "Find mock and assertion patterns",
reasoning: "Need current API for subgraph unit testing"
})
</mcp_first>
<quick_start> Schema (schema.graphql):
type Transfer @entity {
id: Bytes!
from: Bytes!
to: Bytes!
amount: BigInt!
blockNumber: BigInt!
timestamp: BigInt!
}
Handler (mapping.ts):
import { Transfer as TransferEvent } from "../generated/Token/Token";
import { Transfer } from "../generated/schema";
export function handleTransfer(event: TransferEvent): void {
let entity = new Transfer(event.transaction.hash.concatI32(event.logIndex.toI32()));
entity.from = event.params.from;
entity.to = event.params.to;
entity.amount = event.params.value;
entity.blockNumber = event.block.number;
entity.timestamp = event.block.timestamp;
entity.save(); // REQUIRED!
}
</quick_start>
<assemblyscript_rules> AssemblyScript is NOT TypeScript:
Bytes for addressesBigInt for numbersBigDecimal for decimals.save() to persistComposite IDs:
// ✅ Correct
event.transaction.hash.concatI32(event.logIndex.toI32())
// ❌ Wrong - string concatenation
event.transaction.hash.toHexString() + "-" + event.logIndex.toString()
</assemblyscript_rules>
<constraints> **Banned:** async/await, closures, try/catch, forget `.save()`, skip codegen, use Number (use BigInt), mutable globalsRequired:
id: Bytes! or id: ID!.save() after changescodegen after schema/ABI changescompile after mapping changes
</constraints>
<success_criteria>
id field.save()codegen runs without errorscompile succeedsThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.