{"owner":"subquery","repo":"subql","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n\n## Plan and Reivew\n\n### Before Starting work\n- Always in planning mode, to make a plan\n- After the plan is made, make sure to write the plan to ./.claude/tasks/TASK_NAME.md\n- The plan should be a detailed implementation and the reasoning behind them as well as the tasks broken down\n- If the task requires external knowledge or certain dependencies, also research to get the latest knowledge. (Use the Task tool for research)\n- Don't over plan it, always design an MVP\n- Once you make the plan, firstly ask me to review it . Do not continue until I approve the plan\n\n### While implementing\n- The plan should be updated as you work\n- After completing tasks in the plan you should append a detailed description of the channges you made, so the following tasks can be handed over to other engineers\n\n## Development Commands\n\n### Building\n- `yarn build` - Build all packages in the workspace using TypeScript\n- Individual package builds use `tsc -b` and copy necessary files (e.g., CLI templates)\n\n### Testing\n- `yarn test` - Run Jest tests with coverage in UTC timezone\n- `yarn test:ci` - Run tests in CI mode with specific patterns\n- `yarn test:docker` - Run tests in Docker containers\n\n### Linting and Code Quality\n- `yarn lint` - Run ESLint across all TypeScript files in packages\n- Uses ESLint with TypeScript support, Prettier, and various plugins\n- Configured with husky pre-commit hooks and lint-staged\n\n### CLI-Specific Commands (packages/cli)\n- `yarn build` - Builds CLI and copies templates to lib/\n- `yarn format` - Format code using Prettier\n- `yarn codegen` - Generate GraphQL and API client code\n- `yarn codegen:graphql` - Generate GraphQL types\n- `yarn codegen:chs` - Generate consumer host service API client\n\n## Project Architecture\n\n### Monorepo Structure\nThis is a Yarn workspace monorepo containing multiple packages:\n\n- **`@subql/cli`** - Command-line interface for SubQuery projects (OCLIF-based)\n- **`@subql/node`** - Substrate-specific SubQuery indexer implementation\n- **`@subql/node-core`** - Core chain-agnostic indexing functionality\n- **`@subql/query`** - GraphQL query service\n- **`@subql/common`** - Shared utilities and types\n- **`@subql/common-substrate`** - Substrate-specific common utilities\n- **`@subql/types-core`** - Core type definitions\n- **`@subql/utils`** - General utility functions\n\n### CLI Commands Architecture\nThe CLI uses OCLIF framework with commands organized by functionality:\n\n- **Core project lifecycle**: `init`, `build`, `publish`\n- **Code generation**: `codegen` (GraphQL types, ABI imports)\n- **Multi-chain support**: `multi-chain add`\n- **Network operations**: Commands for SubQuery Network (deployments, projects, API keys, boosts)\n- **OnFinality hosting**: Project and deployment management\n- **Migration tools**: Project upgrade utilities\n- **MCP integration**: Model Context Protocol support for AI tools\n\n### Key Technologies\n- **TypeScript** throughout with strict configuration\n- **OCLIF** for CLI framework\n- **Jest** for testing with custom module mapping for workspace packages\n- **ESBuild** and **Webpack** for bundling\n- **GraphQL** code generation\n- **Zod** for schema validation\n- **Ethers.js** for Ethereum integration\n- **WalletConnect** for wallet interactions\n\n### Development Patterns\n\n#### Package Dependencies\nUses Yarn workspace protocol (`workspace:~`) for internal package dependencies to ensure proper linking during development.\n\n#### Testing Setup\n- Custom Jest configuration with module name mapping for workspace packages\n- UTC timezone enforcement for consistent test behavior\n- Coverage collection across multiple packages\n- Special handling for Polkadot packages in transform ignore patterns\n\n#### CLI Command Structure\nCommands follow a consistent pattern:\n- Input validation using Zod schemas\n- Adapter functions for shared logic between CLI and MCP modes\n- Structured logging and error handling\n- Progress indication using ora spinner\n\n#### MCP Integration\nThe CLI supports Model Context Protocol for AI tool integration, allowing commands to be executed through AI interfaces like Cursor.\n\n### Build System\n- TypeScript compilation with project references\n- Template copying for CLI (EJS templates in src/template → lib/template)\n- OCLIF manifest generation for command discovery\n- Automatic README generation from command help\n\n### Network Support\nSubQuery supports multiple blockchain networks:\n- Polkadot/Substrate (primary)\n- Ethereum and EVM-compatible chains\n- Cosmos/CosmWasm\n- Algorand, NEAR, Stellar, Solana, Starknet, Concordium\n\nEach network has its own implementation repository, with this repo containing the core Substrate implementation and shared components.\n"}}