diff --git a/.cursor/llm/README.md b/.cursor/llm/README.md new file mode 100644 index 0000000..73cf3d2 --- /dev/null +++ b/.cursor/llm/README.md @@ -0,0 +1,108 @@ +# LLM Documentation Resources + +This directory contains curated `llm.txt` files for each major dependency, library, and service used in HyperAgent. These files follow the [llms.txt standard](https://llmstxt.org/) to help AI systems understand and work with external documentation. + +## Purpose + +Each `llm.txt` file provides: +- Overview of the technology and its role in HyperAgent +- Key use cases and implementation details +- Links to official documentation +- Code examples relevant to HyperAgent +- Best practices for integration + +## Available Resources + +### Core Frameworks +- **thirdweb-llm.txt** - Thirdweb SDK for wallets, ERC-4337, and deployments +- **langgraph-llm.txt** - LangGraph for agent orchestration +- **fastapi-llm.txt** - FastAPI for backend API +- **nextjs-react-llm.txt** - Next.js and React for frontend + +### Infrastructure +- **supabase-llm.txt** - Supabase for database and multi-tenant workspaces +- **redis-llm.txt** - Redis for caching and message queuing +- **pinecone-llm.txt** - Pinecone for vector database and RAG +- **acontext-llm.txt** - Acontext for agent long-term memory + +### Blockchain & Smart Contracts +- **hardhat-foundry-llm.txt** - Hardhat and Foundry for Solidity development +- **openzeppelin-llm.txt** - OpenZeppelin Contracts library +- **slither-mythril-llm.txt** - Security auditing tools +- **erc-4337-llm.txt** - Account Abstraction standard +- **erc-8004-llm.txt** - Trustless Agents standard + +### Storage & Data +- **ipfs-pinata-llm.txt** - IPFS and Pinata for decentralized storage +- **eigenda-llm.txt** - EigenDA for verifiable data availability + +### Observability +- **opentelemetry-llm.txt** - OpenTelemetry for distributed tracing +- **mlflow-llm.txt** - MLflow for ML experiment tracking +- **tenderly-llm.txt** - Tenderly for contract simulation and monitoring +- **dune-analytics-llm.txt** - Dune Analytics for on-chain analytics + +### LLM Providers +- **anthropic-openai-llm.txt** - Anthropic (Claude) and OpenAI (GPT) for code generation +- **gemini-llm.txt** - Google Gemini for fast, cost-effective generation + +### Payments +- **x402-llm.txt** - x402 payment protocol for SKALE + +### DevOps & Deployment +- **docker-llm.txt** - Docker and Docker Compose for containerization + +## Usage + +When working on HyperAgent features that involve external dependencies: + +1. **Check the relevant `llm.txt` file first** - It contains HyperAgent-specific context +2. **Reference official docs** - Links provided for detailed information +3. **Follow best practices** - Each file includes integration best practices +4. **Use code examples** - Examples are tailored to HyperAgent's use cases + +## File Structure + +Each `llm.txt` file follows this structure: + +```markdown +# [Technology] Documentation for HyperAgent + +## Overview +Brief description and role in HyperAgent + +## Key Use Cases in HyperAgent +Specific use cases in the project + +## Documentation Links +Links to official documentation + +## Implementation in HyperAgent +Where and how it's used in the codebase + +## Code Examples +Relevant code examples + +## Best Practices +Integration best practices + +## Related Resources +Additional resources +``` + +## Maintenance + +- Update files when dependencies change +- Add new dependencies as they're integrated +- Keep documentation links current +- Update code examples when implementation changes + +## Contributing + +When adding a new dependency: +1. Create a new `{dependency}-llm.txt` file +2. Follow the standard structure +3. Include HyperAgent-specific context +4. Add links to official documentation +5. Update this README + diff --git a/.cursor/llm/acontext-llm.txt b/.cursor/llm/acontext-llm.txt new file mode 100644 index 0000000..5934e5f --- /dev/null +++ b/.cursor/llm/acontext-llm.txt @@ -0,0 +1,76 @@ +# Acontext Documentation for HyperAgent + +## Overview + +Acontext is a long-term memory system for AI agents, providing persistent context management across agent sessions. HyperAgent uses Acontext for maintaining agent memory, storing conversation history, and enabling agents to learn from past interactions. + +## Key Use Cases in HyperAgent + +- **Agent Memory**: Long-term memory for agents +- **Context Management**: Maintain context across sessions +- **Learning**: Agents learn from past interactions +- **Conversation History**: Store user-agent interactions +- **Knowledge Retention**: Persistent knowledge storage + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://docs.acontext.io/ +- **API Reference**: https://docs.acontext.io/api-reference/introduction +- **Integration Guide**: https://docs.acontext.io/integrations/intro + +### Key Concepts +- **Contexts**: Organized memory units +- **Memories**: Individual memory entries +- **Retrieval**: Semantic search over memories +- **Persistence**: Long-term storage +- **Privacy**: Workspace-scoped memories + +## Implementation in HyperAgent + +### Memory Service +- Location: `hyperagent/llm/acontext_client.py` +- Stores agent interactions +- Retrieves relevant context for agents + +### Use Cases +- SpecAgent memory of user requirements +- CodeGenAgent memory of patterns +- AuditAgent memory of vulnerabilities + +## Code Examples + +### Storing Memory +```python +from acontext import AcontextClient + +client = AcontextClient(api_key="your-api-key") + +memory_id = client.create_memory( + content="User prefers gas-optimized contracts", + metadata={"workspace_id": "ws-123", "agent": "CodeGenAgent"} +) +``` + +### Retrieving Context +```python +contexts = client.search_memories( + query="gas optimization preferences", + workspace_id="ws-123", + limit=5 +) +``` + +## Best Practices + +1. **Context Organization**: Organize by workspace and agent +2. **Metadata**: Add rich metadata for better retrieval +3. **Privacy**: Ensure workspace isolation +4. **Retention**: Define memory retention policies +5. **Retrieval**: Use semantic search for relevant context + +## Related Resources + +- Acontext GitHub: https://github.com/memodb-io/acontext +- Acontext Documentation: https://docs.acontext.io/ + diff --git a/.cursor/llm/anthropic-openai-llm.txt b/.cursor/llm/anthropic-openai-llm.txt new file mode 100644 index 0000000..12740ed --- /dev/null +++ b/.cursor/llm/anthropic-openai-llm.txt @@ -0,0 +1,91 @@ +# Anthropic & OpenAI LLM Documentation for HyperAgent + +## Overview + +Anthropic (Claude) and OpenAI (GPT) are LLM providers used by HyperAgent for code generation, reasoning, and agent operations. HyperAgent uses a multi-model routing strategy, using different models for different tasks based on complexity, cost, and quality requirements. + +## Key Use Cases in HyperAgent + +- **Code Generation**: Generate Solidity contracts from natural language +- **Complex Reasoning**: Architecture design and planning +- **Quick Edits**: Fast iterations and code modifications +- **Model Routing**: Route tasks to appropriate models +- **Cost Optimization**: Balance quality and cost + +## Documentation Links + +### Anthropic (Claude) +- **Main Docs**: https://docs.anthropic.com/ +- **API Reference**: https://docs.anthropic.com/claude/reference +- **Python SDK**: https://github.com/anthropics/anthropic-sdk-python +- **Best Practices**: https://docs.anthropic.com/claude/docs + +### OpenAI (GPT) +- **Main Docs**: https://platform.openai.com/docs +- **API Reference**: https://platform.openai.com/docs/api-reference +- **Python SDK**: https://github.com/openai/openai-python +- **Best Practices**: https://platform.openai.com/docs/guides + +### Key Concepts +- **Prompt Engineering**: Effective prompt design +- **Token Management**: Token limits and costs +- **Streaming**: Real-time response streaming +- **Function Calling**: Tool use and function calling +- **Rate Limiting**: API rate limits and handling + +## Implementation in HyperAgent + +### Multi-Model Router +- Location: `hyperagent/core/routing/multi_model_router.py` +- Routes tasks to appropriate models +- Fallback logic for failures +- Cost and latency optimization + +### Model Configuration +- Location: `config/llm.yaml` +- Model selection per task type +- Timeout and retry configuration +- Cost tracking + +## Code Examples + +### Anthropic Client +```python +from anthropic import Anthropic + +client = Anthropic(api_key="your-api-key") + +response = client.messages.create( + model="claude-3-5-sonnet-20241022", + max_tokens=4096, + messages=[{"role": "user", "content": prompt}] +) +``` + +### OpenAI Client +```python +from openai import OpenAI + +client = OpenAI(api_key="your-api-key") + +response = client.chat.completions.create( + model="gpt-4-turbo-preview", + messages=[{"role": "user", "content": prompt}], + temperature=0.7 +) +``` + +## Best Practices + +1. **Model Selection**: Use appropriate model for task complexity +2. **Prompt Design**: Write clear, specific prompts +3. **Error Handling**: Implement retry logic for API failures +4. **Cost Management**: Monitor token usage and costs +5. **Rate Limiting**: Respect API rate limits + +## Related Resources + +- Anthropic GitHub: https://github.com/anthropics +- OpenAI GitHub: https://github.com/openai +- Prompt Engineering Guide: https://www.promptingguide.ai/ + diff --git a/.cursor/llm/docker-llm.txt b/.cursor/llm/docker-llm.txt new file mode 100644 index 0000000..1ac12b6 --- /dev/null +++ b/.cursor/llm/docker-llm.txt @@ -0,0 +1,82 @@ +# Docker Documentation for HyperAgent + +## Overview + +Docker is a containerization platform used by HyperAgent for packaging services, ensuring consistent environments, and simplifying deployment. HyperAgent uses Docker and Docker Compose for local development and production deployments. + +## Key Use Cases in HyperAgent + +- **Service Containerization**: Package each microservice +- **Development Environment**: Consistent local setup +- **CI/CD**: Containerized builds and tests +- **Production Deployment**: Deploy containers to cloud +- **Dependency Isolation**: Isolate service dependencies + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://docs.docker.com/ +- **Docker Compose**: https://docs.docker.com/compose/ +- **Best Practices**: https://docs.docker.com/develop/dev-best-practices/ +- **Multi-stage Builds**: https://docs.docker.com/build/building/multi-stage/ + +### Key Concepts +- **Images**: Immutable templates for containers +- **Containers**: Running instances of images +- **Dockerfile**: Instructions for building images +- **Docker Compose**: Multi-container orchestration +- **Volumes**: Persistent data storage + +## Implementation in HyperAgent + +### Dockerfiles +- `Dockerfile` - Main backend service +- `Dockerfile.mlflow` - MLflow service +- `frontend/Dockerfile.dev` - Frontend development + +### Docker Compose +- `docker-compose.yml` - Local development setup +- Services: API, frontend, database, Redis, MLflow + +## Code Examples + +### Dockerfile +```dockerfile +FROM python:3.11-slim + +WORKDIR /app +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . +CMD ["uvicorn", "hyperagent.api.main:app", "--host", "0.0.0.0"] +``` + +### Docker Compose +```yaml +services: + api: + build: . + ports: + - "8000:8000" + environment: + - DATABASE_URL=postgresql://... + depends_on: + - db + - redis +``` + +## Best Practices + +1. **Multi-stage Builds**: Reduce image size +2. **Layer Caching**: Optimize build times +3. **Security**: Use non-root users +4. **Health Checks**: Add health check endpoints +5. **Resource Limits**: Set memory and CPU limits + +## Related Resources + +- Docker GitHub: https://github.com/docker +- Docker Hub: https://hub.docker.com/ +- Best Practices: https://docs.docker.com/develop/dev-best-practices/ + diff --git a/.cursor/llm/dune-analytics-llm.txt b/.cursor/llm/dune-analytics-llm.txt new file mode 100644 index 0000000..01df5ce --- /dev/null +++ b/.cursor/llm/dune-analytics-llm.txt @@ -0,0 +1,80 @@ +# Dune Analytics Documentation for HyperAgent + +## Overview + +Dune Analytics is a Web3 analytics platform for exploring, querying, and visualizing on-chain data from various blockchains. HyperAgent uses Dune Analytics for tracking deployed contract metrics, TVL, transaction volumes, and other on-chain analytics. + +## Key Use Cases in HyperAgent + +- **Contract Analytics**: Track deployed contract metrics +- **TVL Tracking**: Monitor total value locked +- **Transaction Analysis**: Analyze contract interactions +- **Dashboard Creation**: Build analytics dashboards +- **Performance Monitoring**: Monitor contract performance + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://docs.dune.com/ +- **Query Editor**: https://docs.dune.com/queries +- **API Reference**: https://docs.dune.com/api-reference +- **SQL Guide**: https://docs.dune.com/sql + +### Key Concepts +- **Queries**: SQL queries over blockchain data +- **Dashboards**: Visualizations of query results +- **API**: Programmatic access to queries +- **Spells**: Community-maintained data models + +## Implementation in HyperAgent + +### Analytics Integration +- Location: `hyperagent/monitoring/dune_integration.py` +- Tracks deployed contracts +- Monitors TVL and metrics + +### Metrics Tracked +- Contract deployments per chain +- Total value locked (TVL) +- Transaction volumes +- User activity +- Gas costs + +## Code Examples + +### Query Execution +```python +from dune_client import DuneClient + +client = DuneClient(api_key="your-api-key") + +result = client.execute_query( + query_id=123456, + parameters={"contract_address": "0x..."} +) + +data = result.get_rows() +``` + +### Creating Dashboard +```python +dashboard = client.create_dashboard( + name="HyperAgent Metrics", + queries=[query_id_1, query_id_2] +) +``` + +## Best Practices + +1. **Query Optimization**: Optimize SQL queries for performance +2. **Caching**: Use query caching for frequently accessed data +3. **Error Handling**: Handle API rate limits +4. **Data Freshness**: Consider query execution time +5. **Visualization**: Create clear, actionable dashboards + +## Related Resources + +- Dune Analytics: https://dune.com/ +- Dune API: https://docs.dune.com/api-reference +- SQL Reference: https://docs.dune.com/sql + diff --git a/.cursor/llm/eigenda-llm.txt b/.cursor/llm/eigenda-llm.txt new file mode 100644 index 0000000..33c65cb --- /dev/null +++ b/.cursor/llm/eigenda-llm.txt @@ -0,0 +1,74 @@ +# EigenDA Documentation for HyperAgent + +## Overview + +EigenDA (EigenLayer Data Availability) is a data availability layer that provides verifiable data storage for blockchain applications. HyperAgent uses EigenDA for storing verifiable agent traces, audit reports, and contract metadata, enabling cryptographic proof of agent actions. + +## Key Use Cases in HyperAgent + +- **Verifiable Traces**: Store agent execution traces with proofs +- **Audit Provenance**: Anchor audit reports to EigenDA +- **Contract Metadata**: Store deployment metadata verifiably +- **Agent Accountability**: Enable verification of agent decisions +- **Protocol Labs Integration**: Part of Verifiable Factory preset + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://docs.eigenlayer.xyz/eigenda/ +- **EigenLayer**: https://docs.eigenlayer.xyz/ +- **Data Availability**: https://docs.eigenlayer.xyz/eigenda/overview +- **Integration Guide**: https://docs.eigenlayer.xyz/eigenda/integration + +### Key Concepts +- **Data Availability**: Ensuring data is available for verification +- **Blob Storage**: Efficient storage for large data +- **Verification**: Cryptographic proofs of data availability +- **EigenLayer**: Restaking and security model + +## Implementation in HyperAgent + +### Verifiable Factory Preset +- Location: Protocol Labs preset implementation +- Stores agent traces and audit reports +- Enables verification of agent decisions + +### Integration Points +- Agent trace storage +- Audit report anchoring +- Contract metadata storage +- Proof generation for agent actions + +## Code Examples + +### Storing Data +```python +from eigenda_client import EigenDAClient + +client = EigenDAClient() +blob_id = await client.store_blob( + data=agent_trace_json, + namespace="hyperagent-traces" +) +``` + +### Verification +```python +proof = await client.get_availability_proof(blob_id) +is_available = await client.verify_proof(proof) +``` + +## Best Practices + +1. **Data Format**: Use structured formats (JSON) for traces +2. **Namespace Organization**: Organize by workspace/project +3. **Verification**: Always verify proofs before trusting data +4. **Cost Management**: Monitor storage costs +5. **Retention**: Define data retention policies + +## Related Resources + +- EigenLayer GitHub: https://github.com/Layr-Labs/eigenlayer-contracts +- EigenDA Specification: https://docs.eigenlayer.xyz/eigenda/ +- Protocol Labs: https://protocol.ai/ + diff --git a/.cursor/llm/erc-4337-llm.txt b/.cursor/llm/erc-4337-llm.txt new file mode 100644 index 0000000..bd7494a --- /dev/null +++ b/.cursor/llm/erc-4337-llm.txt @@ -0,0 +1,97 @@ +# ERC-4337 (Account Abstraction) Documentation for HyperAgent + +## Overview + +ERC-4337 is an Ethereum standard for account abstraction that enables smart contract wallets without requiring changes to the Ethereum protocol. HyperAgent uses ERC-4337 for gasless transactions, session keys for agents, and improved user experience. + +## Key Use Cases in HyperAgent + +- **Gasless Transactions**: Users don't need ETH for gas +- **Session Keys**: Time-limited keys for agent operations +- **Multi-signature**: Enterprise multi-sig support +- **Social Recovery**: Account recovery mechanisms +- **Batch Transactions**: Execute multiple operations in one transaction + +## Documentation Links + +### Official Specification +- **EIP-4337**: https://eips.ethereum.org/EIPS/eip-4337 +- **EntryPoint Contract**: https://github.com/eth-infinitism/account-abstraction +- **Bundler Specification**: https://eips.ethereum.org/EIPS/eip-4337#bundler-specification + +### Implementation Resources +- **Thirdweb AA**: https://portal.thirdweb.com/account-abstraction +- **Alchemy AA**: https://www.alchemy.com/account-abstraction +- **Stackup**: https://docs.stackup.sh/ + +### Key Concepts +- **Smart Contract Wallets**: Wallets implemented as contracts +- **EntryPoint**: Standard contract for executing user operations +- **Bundlers**: Network of nodes that bundle and submit operations +- **Paymasters**: Contracts that sponsor gas fees +- **User Operations**: Abstraction of transactions + +## Implementation in HyperAgent + +### Account Abstraction +- Location: `hyperagent/blockchain/erc4337.py` +- HyperAccount contract implementation +- Session key management + +### Deployment Service +- ERC-4337 deployment support +- Gasless deployment options +- Paymaster integration + +## Code Examples + +### User Operation +```solidity +struct UserOperation { + address sender; + uint256 nonce; + bytes initCode; + bytes callData; + uint256 callGasLimit; + uint256 verificationGasLimit; + uint256 preVerificationGas; + uint256 maxFeePerGas; + uint256 maxPriorityFeePerGas; + bytes paymasterAndData; + bytes signature; +} +``` + +### EntryPoint Integration +```solidity +import "@account-abstraction/contracts/interfaces/IEntryPoint.sol"; + +contract HyperAccount { + IEntryPoint public immutable entryPoint; + + function validateUserOp( + UserOperation calldata userOp, + bytes32 userOpHash, + uint256 missingAccountFunds + ) external returns (uint256) { + require(msg.sender == address(entryPoint), "UNAUTHORIZED"); + // Validation logic + return 0; + } +} +``` + +## Best Practices + +1. **Security**: Validate all user operations carefully +2. **Gas Limits**: Set appropriate gas limits +3. **Nonce Management**: Handle nonces correctly +4. **Signature Verification**: Verify signatures properly +5. **Paymaster Integration**: Use paymasters for gasless UX + +## Related Resources + +- ERC-4337 GitHub: https://github.com/eth-infinitism/account-abstraction +- EntryPoint Contract: https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/core/EntryPoint.sol +- Account Abstraction Guide: https://ethereum.org/en/developers/docs/account-abstraction/ + diff --git a/.cursor/llm/erc-8004-llm.txt b/.cursor/llm/erc-8004-llm.txt new file mode 100644 index 0000000..e4df999 --- /dev/null +++ b/.cursor/llm/erc-8004-llm.txt @@ -0,0 +1,88 @@ +# ERC-8004 (Trustless Agents) Documentation for HyperAgent + +## Overview + +ERC-8004 is a proposed standard for trustless agent identity and reputation on Ethereum. HyperAgent uses ERC-8004 for agent identity, reputation tracking, and verifiable agent actions, enabling AI agents to operate on-chain with accountability. + +## Key Use Cases in HyperAgent + +- **Agent Identity**: Unique on-chain identity for agents +- **Reputation System**: Track agent performance and trust +- **Verifiable Actions**: Prove agent decisions on-chain +- **Agent Registry**: Registry of verified agents +- **Accountability**: Cryptographic proof of agent actions + +## Documentation Links + +### Specification +- **ERC-8004 Draft**: https://eips.ethereum.org/EIPS/eip-8004 +- **Agent Registry**: On-chain registry of agents +- **Reputation System**: Trust and reputation mechanisms + +### Key Concepts +- **Agent Identity**: On-chain identity for AI agents +- **Reputation**: Trust score based on past actions +- **Attestations**: Cryptographic proofs of agent actions +- **Registry**: On-chain registry of agents +- **Verification**: Verify agent actions and decisions + +## Implementation in HyperAgent + +### Agent Registry +- Location: `hyperagent/architecture/a2a.py` +- Agent identity management +- Reputation tracking + +### Verifiable Actions +- Store agent decisions on-chain +- Generate attestations for actions +- Enable verification of agent behavior + +## Code Examples + +### Agent Identity +```solidity +contract AgentRegistry { + struct Agent { + address agentAddress; + bytes32 agentId; + uint256 reputation; + bool verified; + } + + mapping(bytes32 => Agent) public agents; + + function registerAgent(bytes32 agentId) external { + agents[agentId] = Agent({ + agentAddress: msg.sender, + agentId: agentId, + reputation: 0, + verified: false + }); + } +} +``` + +### Attestation +```solidity +struct Attestation { + bytes32 agentId; + bytes32 actionHash; + uint256 timestamp; + bytes signature; +} +``` + +## Best Practices + +1. **Identity Management**: Secure agent identity creation +2. **Reputation**: Fair reputation scoring +3. **Attestations**: Generate verifiable attestations +4. **Registry**: Maintain accurate agent registry +5. **Verification**: Enable easy verification of actions + +## Related Resources + +- ERC-8004 Discussion: https://ethereum-magicians.org/t/erc-8004-trustless-agents/XXXXX +- Agent Standards: Research on agent identity standards + diff --git a/.cursor/llm/erc1066-x402-llm.txt b/.cursor/llm/erc1066-x402-llm.txt new file mode 100644 index 0000000..7ef8d96 --- /dev/null +++ b/.cursor/llm/erc1066-x402-llm.txt @@ -0,0 +1,68 @@ +# ERC-1066-x402 Gateway SDK Resources + +## Overview +ERC-1066-x402 is a payment gateway standard for agentic commerce. HyperKit provides SDKs for both TypeScript and Python. + +## Official Packages + +### TypeScript/JavaScript SDK +- **Package**: `hyperkit-erc1066` +- **npm**: https://www.npmjs.com/package/hyperkit-erc1066 +- **Libraries.io**: https://libraries.io/npm/hyperkit-erc1066 +- **Latest Version**: 0.1.0 (Dec 20, 2025) +- **Install**: `npm install hyperkit-erc1066@0.1.0` + +### Python SDK +- **Package**: `hyperkitlabs-erc1066-x402` +- **PyPI**: https://pypi.org/project/hyperkitlabs-erc1066-x402/ +- **Latest Version**: 0.2.0 (Dec 18, 2025) +- **Install**: `pip install hyperkitlabs-erc1066-x402==0.2.0` +- **Requires**: Python >=3.8 + +## Integration Points + +### SKALE Agentic Commerce Preset +- ERC-1066-x402 is required for SKALE commerce preset +- Enables payment processing for agentic commerce workflows +- Integrates with SKALE chain adapters + +### SDK/CLI Integration +- TypeScript SDK extends HyperAgent SDK with x402Client +- Python SDK available for backend services +- Both SDKs support SKALE chain integration + +## Usage Examples + +### TypeScript +```typescript +import { X402Client } from 'hyperkit-erc1066'; + +const client = new X402Client({ + gatewayUrl: process.env.X402_GATEWAY_URL, + apiKey: process.env.X402_API_KEY, + chainId: 0x1a4, // SKALE chain ID +}); +``` + +### Python +```python +from hyperkitlabs_erc1066_x402 import X402Client + +client = X402Client( + gateway_url=os.getenv("X402_GATEWAY_URL"), + api_key=os.getenv("X402_API_KEY"), + chain_id=420 # SKALE chain ID +) +``` + +## Environment Variables +- `X402_GATEWAY_URL` - Gateway endpoint URL +- `X402_API_KEY` - API authentication key +- `SKALE_TESTNET_RPC_URL` - SKALE testnet RPC endpoint +- `SKALE_MAINNET_RPC_URL` - SKALE mainnet RPC endpoint + +## Related Resources +- See `.cursor/llm/x402-llm.txt` for x402 protocol details +- See `.cursor/llm/skale-llm.txt` for SKALE chain integration +- SKALE endpoints must be live on testnet/mainnet before integration + diff --git a/.cursor/llm/fastapi-llm.txt b/.cursor/llm/fastapi-llm.txt new file mode 100644 index 0000000..ecff568 --- /dev/null +++ b/.cursor/llm/fastapi-llm.txt @@ -0,0 +1,105 @@ +# FastAPI Documentation for HyperAgent + +## Overview + +FastAPI is a modern, fast web framework for building APIs with Python. HyperAgent uses FastAPI for the backend API gateway, providing REST endpoints for agent orchestration, project management, and deployment operations. + +## Key Use Cases in HyperAgent + +- **API Gateway**: Main entry point for all client requests +- **Multi-tenant Routing**: Route requests to appropriate workspaces +- **Authentication**: JWT-based auth with Auth0 integration +- **Rate Limiting**: Per-workspace rate limiting +- **WebSocket Support**: Real-time updates for workflow progress +- **OpenAPI Documentation**: Auto-generated API docs + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://fastapi.tiangolo.com/ +- **Tutorial**: https://fastapi.tiangolo.com/tutorial/ +- **Advanced Usage**: https://fastapi.tiangolo.com/advanced/ +- **Deployment**: https://fastapi.tiangolo.com/deployment/ + +### Key Concepts +- **Dependency Injection**: For auth, database sessions, rate limiting +- **Pydantic Models**: Request/response validation +- **Background Tasks**: For async operations +- **WebSockets**: Real-time communication +- **Middleware**: For CORS, logging, error handling + +## Implementation in HyperAgent + +### API Structure +- Main app: `hyperagent/api/main.py` +- Routes organized by domain: `hyperagent/api/routes/` +- Middleware: `hyperagent/api/middleware/` + +### Key Endpoints +- `/api/v1/workflows` - Create and manage workflows +- `/api/v1/contracts` - Contract generation and management +- `/api/v1/deployments` - Deployment operations +- `/api/v1/templates` - Contract templates +- `/api/v1/x402/` - Payment and billing endpoints + +### Authentication +- JWT token validation via Auth0 +- Workspace-scoped access control +- Session management for agent operations + +## Code Examples + +### Basic Endpoint +```python +from fastapi import APIRouter, Depends +from pydantic import BaseModel + +router = APIRouter(prefix="/api/v1/workflows") + +class WorkflowRequest(BaseModel): + prompt: str + chains: list[str] + +@router.post("/") +async def create_workflow( + request: WorkflowRequest, + user: User = Depends(get_current_user) +): + workflow = await orchestrator.create_workflow( + prompt=request.prompt, + chains=request.chains, + workspace_id=user.workspace_id + ) + return workflow +``` + +### Dependency Injection +```python +from fastapi import Depends +from hyperagent.api.middleware.auth import get_current_user +from hyperagent.db.session import get_db + +@router.get("/") +async def list_workflows( + db: Session = Depends(get_db), + user: User = Depends(get_current_user) +): + return await db.query(Workflow).filter( + Workflow.workspace_id == user.workspace_id + ).all() +``` + +## Best Practices + +1. **Type Safety**: Use Pydantic models for all request/response +2. **Error Handling**: Use HTTPException with appropriate status codes +3. **Async Operations**: Use async/await for I/O-bound operations +4. **Dependency Injection**: Leverage FastAPI's DI for reusable logic +5. **Documentation**: Use docstrings and response models for OpenAPI + +## Related Resources + +- FastAPI GitHub: https://github.com/tiangolo/fastapi +- Pydantic Documentation: https://docs.pydantic.dev/ +- Uvicorn (ASGI server): https://www.uvicorn.org/ + diff --git a/.cursor/llm/gemini-llm.txt b/.cursor/llm/gemini-llm.txt new file mode 100644 index 0000000..f5bb092 --- /dev/null +++ b/.cursor/llm/gemini-llm.txt @@ -0,0 +1,84 @@ +# Google Gemini Documentation for HyperAgent + +## Overview + +Google Gemini is an LLM used by HyperAgent for fast, cost-effective code generation and quick edits. HyperAgent uses Gemini for tasks that don't require the highest reasoning capability but benefit from speed and lower cost. + +## Key Use Cases in HyperAgent + +- **Quick Edits**: Fast code modifications and iterations +- **Cost-Effective Generation**: Lower-cost alternative for simple tasks +- **Rapid Prototyping**: Quick contract generation for testing +- **Batch Operations**: Process multiple simple tasks efficiently + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://ai.google.dev/docs +- **API Reference**: https://ai.google.dev/api +- **Python SDK**: https://github.com/google/generative-ai-python +- **Quickstart**: https://ai.google.dev/tutorials/python_quickstart + +### Key Concepts +- **Model Variants**: Different model sizes for different needs +- **Prompt Design**: Effective prompt engineering +- **Safety Settings**: Content filtering and safety +- **Streaming**: Real-time response streaming +- **Multimodal**: Support for text and code + +## Implementation in HyperAgent + +### Gemini Client +- Location: `hyperagent/llm/provider.py` +- Used for quick edit operations +- Lower cost alternative to Claude/GPT + +### Routing Strategy +- Simple tasks → Gemini (fast, cheap) +- Complex tasks → Claude/GPT (high quality) +- Automatic routing based on task complexity + +## Code Examples + +### Basic Usage +```python +import google.generativeai as genai + +genai.configure(api_key="your-api-key") + +model = genai.GenerativeModel('gemini-pro') + +response = model.generate_content( + prompt, + generation_config={ + "temperature": 0.7, + "max_output_tokens": 2048, + } +) +``` + +### Streaming +```python +response = model.generate_content( + prompt, + stream=True +) + +for chunk in response: + print(chunk.text) +``` + +## Best Practices + +1. **Task Selection**: Use for simple, well-defined tasks +2. **Prompt Clarity**: Clear prompts work best +3. **Cost Optimization**: Leverage for high-volume operations +4. **Error Handling**: Handle API errors gracefully +5. **Rate Limiting**: Respect API limits + +## Related Resources + +- Gemini GitHub: https://github.com/google/generative-ai-python +- AI Studio: https://aistudio.google.com/ +- Gemini API: https://ai.google.dev/api + diff --git a/.cursor/llm/hardhat-foundry-llm.txt b/.cursor/llm/hardhat-foundry-llm.txt new file mode 100644 index 0000000..e7fb10a --- /dev/null +++ b/.cursor/llm/hardhat-foundry-llm.txt @@ -0,0 +1,88 @@ +# Hardhat & Foundry Documentation for HyperAgent + +## Overview + +Hardhat and Foundry are development frameworks for Ethereum smart contracts. HyperAgent uses both frameworks for Solidity compilation, testing, and deployment. Foundry is preferred for gas optimization and advanced testing, while Hardhat provides better TypeScript integration. + +## Key Use Cases in HyperAgent + +- **Contract Compilation**: Compile Solidity contracts to bytecode +- **Testing**: Generate and run contract tests +- **Deployment**: Deploy contracts to EVM chains +- **Gas Estimation**: Calculate deployment and transaction costs +- **Static Analysis**: Integration with Slither for security checks + +## Documentation Links + +### Hardhat +- **Main Docs**: https://hardhat.org/docs +- **Deployment**: https://hardhat.org/hardhat-runner/docs/guides/deploying +- **Plugins**: https://hardhat.org/hardhat-runner/plugins +- **TypeScript**: https://hardhat.org/hardhat-runner/docs/guides/typescript + +### Foundry +- **Main Docs**: https://book.getfoundry.sh/ +- **Forge**: https://book.getfoundry.sh/forge/ +- **Cast**: https://book.getfoundry.sh/reference/cast/ +- **Anvil**: https://book.getfoundry.sh/reference/anvil/ + +### Key Concepts +- **Compilation**: Solidity to EVM bytecode +- **Testing**: Unit and integration tests +- **Deployment Scripts**: Automated contract deployment +- **Network Configuration**: Multi-chain support +- **Gas Optimization**: Foundry's gas reporting + +## Implementation in HyperAgent + +### Compilation Service +- Location: `hyperagent/core/services/compilation_service.py` +- Supports both Hardhat and Foundry +- Generates ABI and bytecode for deployment + +### Deployment Service +- Uses Foundry for gas-optimized deployments +- Hardhat for TypeScript integration +- Multi-chain network configuration + +### Testing Integration +- Generates test files alongside contracts +- Runs tests before deployment +- Integrates with CI/CD pipeline + +## Code Examples + +### Foundry Compilation +```bash +forge build +forge test +forge script Deploy.s.sol --rpc-url $RPC_URL --broadcast +``` + +### Hardhat Deployment +```typescript +import { ethers } from "hardhat"; + +async function deploy() { + const Contract = await ethers.getContractFactory("MyContract"); + const contract = await Contract.deploy(); + await contract.deployed(); + return contract.address; +} +``` + +## Best Practices + +1. **Gas Optimization**: Use Foundry for gas reporting +2. **Testing**: Write comprehensive tests before deployment +3. **Network Config**: Maintain separate configs per chain +4. **Version Pinning**: Pin Solidity compiler versions +5. **Security**: Run Slither/Mythril before deployment + +## Related Resources + +- Hardhat GitHub: https://github.com/NomicFoundation/hardhat +- Foundry GitHub: https://github.com/foundry-rs/foundry +- Solidity Documentation: https://docs.soliditylang.org/ +- OpenZeppelin Contracts: https://docs.openzeppelin.com/contracts + diff --git a/.cursor/llm/ipfs-pinata-llm.txt b/.cursor/llm/ipfs-pinata-llm.txt new file mode 100644 index 0000000..48fbc41 --- /dev/null +++ b/.cursor/llm/ipfs-pinata-llm.txt @@ -0,0 +1,84 @@ +# IPFS & Pinata Documentation for HyperAgent + +## Overview + +IPFS (InterPlanetary File System) is a distributed file system for storing and sharing content-addressed data. Pinata provides IPFS pinning services and APIs. HyperAgent uses IPFS/Pinata for storing contract artifacts, audit reports, and other verifiable content. + +## Key Use Cases in HyperAgent + +- **Artifact Storage**: Store generated contracts and audit reports +- **Verifiable Memory**: RAG system for agent knowledge +- **Decentralized Storage**: Persistent storage for critical data +- **Content Addressing**: Immutable, content-addressed storage +- **MCP Integration**: Pinata MCP server for agent access + +## Documentation Links + +### IPFS +- **Main Docs**: https://docs.ipfs.tech/ +- **Concepts**: https://docs.ipfs.tech/concepts/ +- **HTTP API**: https://docs.ipfs.tech/reference/http/api/ + +### Pinata +- **Main Docs**: https://docs.pinata.cloud/ +- **API Reference**: https://docs.pinata.cloud/api-pinning/pin-file-to-ipfs +- **MCP Server**: https://docs.pinata.cloud/mcp + +### Key Concepts +- **Content Addressing**: Files identified by hash +- **Pinning**: Keeping files available on IPFS +- **Gateways**: HTTP access to IPFS content +- **CID**: Content Identifier (hash of content) + +## Implementation in HyperAgent + +### RAG System +- Location: `hyperagent/rag/pinata_manager.py` +- Stores documentation and knowledge bases +- Retrieves content for agent context + +### Artifact Storage +- Contract source code +- Audit reports +- Deployment metadata +- Agent execution traces + +## Code Examples + +### Pinata Upload +```python +from pinata import PinataSDK + +pinata = PinataSDK(api_key, secret_key) + +result = pinata.pin_file_to_ipfs( + file_path="contract.sol", + pinata_metadata={"name": "MyContract"} +) + +ipfs_hash = result["IpfsHash"] +``` + +### IPFS Retrieval +```python +import requests + +ipfs_hash = "Qm..." +gateway_url = f"https://gateway.pinata.cloud/ipfs/{ipfs_hash}" +content = requests.get(gateway_url).text +``` + +## Best Practices + +1. **Pinning**: Always pin important content +2. **Metadata**: Add descriptive metadata to pins +3. **Gateways**: Use reliable IPFS gateways +4. **Backup**: Consider multiple pinning services +5. **Cost Management**: Monitor pinning costs + +## Related Resources + +- IPFS GitHub: https://github.com/ipfs/ipfs +- Pinata GitHub: https://github.com/PinataCloud +- IPFS Documentation: https://docs.ipfs.tech/ + diff --git a/.cursor/llm/langgraph-llm.txt b/.cursor/llm/langgraph-llm.txt new file mode 100644 index 0000000..11a4ee6 --- /dev/null +++ b/.cursor/llm/langgraph-llm.txt @@ -0,0 +1,102 @@ +# LangGraph Documentation for HyperAgent + +## Overview + +LangGraph is a library for building stateful, multi-actor applications with LLMs. HyperAgent uses LangGraph for orchestrating agent workflows, managing state transitions, and coordinating between specialized agents. + +## Key Use Cases in HyperAgent + +- **Agent Orchestration**: Coordinate SpecAgent, CodeGenAgent, AuditAgent, DeployAgent +- **Workflow Management**: Define and execute multi-step agent pipelines +- **State Management**: Track project state through generation → audit → deploy +- **Error Handling**: Implement retry logic and error recovery +- **Conditional Routing**: Route tasks to appropriate agents based on context + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://langchain-ai.github.io/langgraph/ +- **Python SDK**: https://python.langchain.com/docs/langgraph +- **Concepts**: https://langchain-ai.github.io/langgraph/concepts/ +- **Tutorials**: https://langchain-ai.github.io/langgraph/tutorials/ + +### Key Concepts +- **StateGraph**: Core abstraction for defining agent workflows +- **Nodes**: Individual agent steps or operations +- **Edges**: Transitions between nodes (conditional or unconditional) +- **State**: Shared state object passed between nodes +- **Checkpoints**: Persistence layer for state management + +## Implementation in HyperAgent + +### Orchestrator Service +- Main LangGraph workflow in `hyperagent/core/orchestrator.py` +- Defines agent pipeline: Spec → Design → Generate → Audit → Test → Deploy +- Manages state transitions and error recovery + +### Agent Nodes +- Each agent (SpecAgent, CodeGenAgent, etc.) is a LangGraph node +- Nodes receive state, perform operations, return updated state +- Support for async operations and tool calling + +### State Schema +- Project state includes: prompts, generated code, audit results, deployment status +- Versioned state for reproducibility +- Checkpointed for recovery and debugging + +## Code Examples + +### Basic Workflow Definition +```python +from langgraph.graph import StateGraph, END + +workflow = StateGraph(ProjectState) + +# Add nodes +workflow.add_node("spec", spec_agent) +workflow.add_node("generate", codegen_agent) +workflow.add_node("audit", audit_agent) +workflow.add_node("deploy", deploy_agent) + +# Define edges +workflow.set_entry_point("spec") +workflow.add_edge("spec", "generate") +workflow.add_conditional_edges( + "generate", + should_audit, + {"audit": "audit", "deploy": "deploy"} +) +workflow.add_edge("audit", "deploy") +workflow.add_edge("deploy", END) + +# Compile and run +app = workflow.compile() +result = await app.ainvoke(initial_state) +``` + +### State Management +```python +from typing import TypedDict + +class ProjectState(TypedDict): + prompt: str + generated_code: str + audit_results: dict + deployment_status: str + errors: list +``` + +## Best Practices + +1. **State Design**: Keep state minimal and focused +2. **Error Handling**: Implement retry logic at node level +3. **Checkpointing**: Use checkpoints for long-running workflows +4. **Conditional Routing**: Use conditional edges for dynamic workflows +5. **Async Operations**: Leverage async for I/O-bound agent operations + +## Related Resources + +- LangChain Documentation: https://python.langchain.com/ +- LangGraph GitHub: https://github.com/langchain-ai/langgraph +- State Management Guide: https://langchain-ai.github.io/langgraph/concepts/low_level/ + diff --git a/.cursor/llm/llm.txt b/.cursor/llm/llm.txt new file mode 100644 index 0000000..f9b8160 --- /dev/null +++ b/.cursor/llm/llm.txt @@ -0,0 +1,82 @@ +# HyperAgent LLM Documentation Index + +This is the main index file for HyperAgent's LLM documentation resources. Each major dependency, library, and service has its own dedicated `llm.txt` file following the [llms.txt standard](https://llmstxt.org/). + +## Purpose + +These files help AI systems understand external dependencies and their integration with HyperAgent. Each file contains: +- Technology overview and HyperAgent-specific use cases +- Links to official documentation +- Implementation details and code examples +- Best practices for integration + +## Available Documentation Files + +### Core Frameworks & Languages +- **[thirdweb-llm.txt](thirdweb-llm.txt)** - Thirdweb SDK for wallets, ERC-4337, EIP-7702, and multi-chain deployment +- **[langgraph-llm.txt](langgraph-llm.txt)** - LangGraph for agent orchestration and workflow management +- **[fastapi-llm.txt](fastapi-llm.txt)** - FastAPI for backend API gateway and REST endpoints +- **[nextjs-react-llm.txt](nextjs-react-llm.txt)** - Next.js 14+ and React for frontend UI + +### Infrastructure & Data +- **[supabase-llm.txt](supabase-llm.txt)** - Supabase (PostgreSQL) for database, multi-tenant workspaces, and RLS +- **[redis-llm.txt](redis-llm.txt)** - Redis for caching, message queuing, and session management +- **[pinecone-llm.txt](pinecone-llm.txt)** - Pinecone vector database for RAG and semantic search +- **[acontext-llm.txt](acontext-llm.txt)** - Acontext for agent long-term memory and context management + +### Smart Contract Development +- **[hardhat-foundry-llm.txt](hardhat-foundry-llm.txt)** - Hardhat and Foundry for Solidity compilation, testing, and deployment +- **[openzeppelin-llm.txt](openzeppelin-llm.txt)** - OpenZeppelin Contracts library for secure contract templates +- **[slither-mythril-llm.txt](slither-mythril-llm.txt)** - Slither, Mythril, MythX, and Echidna for security auditing + +### Blockchain Standards +- **[erc-4337-llm.txt](erc-4337-llm.txt)** - ERC-4337 Account Abstraction for gasless transactions and smart wallets +- **[erc-8004-llm.txt](erc-8004-llm.txt)** - ERC-8004 Trustless Agents for agent identity and reputation +- **[x402-llm.txt](x402-llm.txt)** - x402 payment protocol for pay-per-use services on SKALE +- **[erc1066-x402-llm.txt](erc1066-x402-llm.txt)** - ERC-1066-x402 SDKs (npm: hyperkit-erc1066, PyPI: hyperkitlabs-erc1066-x402) + +### Storage & Data Availability +- **[ipfs-pinata-llm.txt](ipfs-pinata-llm.txt)** - IPFS and Pinata for decentralized artifact storage and RAG +- **[eigenda-llm.txt](eigenda-llm.txt)** - EigenDA for verifiable data availability and agent traces + +### Observability & Monitoring +- **[opentelemetry-llm.txt](opentelemetry-llm.txt)** - OpenTelemetry for distributed tracing and metrics +- **[mlflow-llm.txt](mlflow-llm.txt)** - MLflow for LLM experiment tracking and model routing +- **[tenderly-llm.txt](tenderly-llm.txt)** - Tenderly for contract simulation, debugging, and monitoring +- **[dune-analytics-llm.txt](dune-analytics-llm.txt)** - Dune Analytics for on-chain analytics and dashboards + +### LLM Providers +- **[anthropic-openai-llm.txt](anthropic-openai-llm.txt)** - Anthropic (Claude) and OpenAI (GPT) for code generation and reasoning +- **[gemini-llm.txt](gemini-llm.txt)** - Google Gemini for fast, cost-effective code generation + +### DevOps & Deployment +- **[docker-llm.txt](docker-llm.txt)** - Docker and Docker Compose for containerization and deployment + +## How to Use + +1. **Before implementing a feature** involving an external dependency, read the relevant `llm.txt` file +2. **Reference official docs** using the provided links for detailed information +3. **Follow best practices** outlined in each file +4. **Use code examples** as starting points for implementation + +## File Naming Convention + +Files follow the pattern: `{dependency}-llm.txt` + +Examples: +- `thirdweb-llm.txt` - Thirdweb documentation +- `langgraph-llm.txt` - LangGraph documentation +- `erc-4337-llm.txt` - ERC-4337 standard documentation + +## Maintenance + +- Files are updated when dependencies change +- New dependencies get their own `llm.txt` file +- Documentation links are kept current +- Code examples reflect current implementation + +## Related Resources + +- Main HyperAgent Spec: `docs/HyperAgent Spec.md` +- Project Naming Conventions: `.cursor/llm/llm.txt` (original file) +- Skills Directory: `.cursor/skills/` diff --git a/.cursor/llm/mlflow-llm.txt b/.cursor/llm/mlflow-llm.txt new file mode 100644 index 0000000..e5c15dd --- /dev/null +++ b/.cursor/llm/mlflow-llm.txt @@ -0,0 +1,81 @@ +# MLflow Documentation for HyperAgent + +## Overview + +MLflow is an open-source platform for managing the machine learning lifecycle, including experiment tracking, model packaging, and deployment. HyperAgent uses MLflow for tracking LLM model performance, routing decisions, and agent experiment results. + +## Key Use Cases in HyperAgent + +- **Model Tracking**: Track which LLM models perform best +- **Experiment Tracking**: Compare different agent configurations +- **Routing Decisions**: Log model routing choices and outcomes +- **Performance Metrics**: Track latency, cost, and quality metrics +- **Model Registry**: Version and manage LLM configurations + +## Documentation Links + +### Official Documentation +- **Main Docs**: https://mlflow.org/docs/latest/index.html +- **Tracking**: https://mlflow.org/docs/latest/tracking.html +- **Python API**: https://mlflow.org/docs/latest/python_api/index.html +- **Quickstart**: https://mlflow.org/docs/latest/quickstart.html + +### Key Concepts +- **Experiments**: Group related runs +- **Runs**: Individual execution records +- **Metrics**: Numerical measurements +- **Parameters**: Input configurations +- **Artifacts**: Files and models + +## Implementation in HyperAgent + +### Tracking Service +- Location: `hyperagent/monitoring/mlflow_tracker.py` +- Tracks agent runs and model performance +- Logs routing decisions and outcomes + +### Metrics Tracked +- Agent execution time +- LLM response quality +- Cost per operation +- Success rates +- Error rates + +## Code Examples + +### Basic Tracking +```python +import mlflow + +mlflow.set_experiment("hyperagent-agents") + +with mlflow.start_run(): + mlflow.log_param("agent", "CodeGenAgent") + mlflow.log_param("model", "claude-opus-4.5") + mlflow.log_metric("execution_time", 2.5) + mlflow.log_metric("cost", 0.15) + mlflow.log_artifact("generated_contract.sol") +``` + +### Model Registry +```python +mlflow.register_model( + model_uri="runs:/run-id/model", + name="CodeGenAgent-v1" +) +``` + +## Best Practices + +1. **Experiment Organization**: Use clear experiment names +2. **Metric Consistency**: Use consistent metric names +3. **Artifact Management**: Store important artifacts +4. **Model Versioning**: Version models in registry +5. **Cost Tracking**: Track costs for optimization + +## Related Resources + +- MLflow GitHub: https://github.com/mlflow/mlflow +- MLflow Tracking: https://mlflow.org/docs/latest/tracking.html +- Best Practices: https://mlflow.org/docs/latest/tracking.html#best-practices + diff --git a/.cursor/llm/nextjs-react-llm.txt b/.cursor/llm/nextjs-react-llm.txt new file mode 100644 index 0000000..3f5d391 --- /dev/null +++ b/.cursor/llm/nextjs-react-llm.txt @@ -0,0 +1,103 @@ +# Next.js & React Documentation for HyperAgent + +## Overview + +Next.js is a React framework for production with features like server-side rendering, static site generation, and API routes. HyperAgent uses Next.js 14+ with App Router for the frontend, providing a modern, type-safe UI for managing workflows, viewing deployments, and monitoring agent operations. + +## Key Use Cases in HyperAgent + +- **Dashboard UI**: Project management and workflow visualization +- **Run Pipeline UI**: Real-time workflow progress tracking +- **Deployment Interface**: Multi-chain deployment configuration +- **Template Selection**: Preset and template browsing +- **Analytics**: Usage metrics and spending dashboards + +## Documentation Links + +### Official Documentation +- **Next.js Docs**: https://nextjs.org/docs +- **App Router**: https://nextjs.org/docs/app +- **React Docs**: https://react.dev/ +- **TypeScript**: https://www.typescriptlang.org/docs/ + +### Key Concepts +- **App Router**: File-based routing with layouts and loading states +- **Server Components**: React Server Components for data fetching +- **Client Components**: Interactive UI with "use client" directive +- **Tailwind CSS**: Utility-first CSS framework +- **shadcn/ui**: Component library built on Radix UI + +## Implementation in HyperAgent + +### Frontend Structure +- Location: `frontend/` directory +- App Router structure: `frontend/app/` +- Components: `frontend/components/` +- Hooks: `frontend/hooks/` + +### Key Pages +- `/` - Dashboard with project overview +- `/workflows` - Workflow management +- `/workflows/create` - Create new workflow +- `/workflows/[id]` - Workflow detail and progress +- `/deployments` - Deployment history +- `/templates` - Template library + +### State Management +- TanStack Query for server state +- Zustand for client state +- WebSocket hooks for real-time updates + +## Code Examples + +### Server Component +```typescript +// app/workflows/page.tsx +export default async function WorkflowsPage() { + const workflows = await fetchWorkflows(); + + return ( +
+
+**Features demonstrated**:
+- Real-time vulnerability scanning
+- Severity-based categorization
+- Code suggestion recommendations
+```
+
+**File Organization**:
+```
+repository-root/
+├── README.md
+├── assets/
+│ └── images/
+│ ├── dashboard.png
+│ ├── audit-flow.gif
+│ └── architecture.png
+```
+
+### 7. Quick Start / Installation
+
+**Purpose**: Minimize friction for new users to get started immediately.
+
+**Requirements**:
+- Assume minimal prior knowledge but not zero knowledge
+- Keep to 5-10 steps maximum
+- Include expected output or success indicator
+- Link to detailed setup guide for complex projects
+- Provide platform-specific instructions if applicable
+
+**Standard Structure**:
+
+```markdown
+## Quick Start
+
+### Prerequisites
+
+- Node.js 18.0 or higher
+- npm 8.0 or higher
+- Git
+
+### Installation
+
+1. **Clone the repository**
+ ```bash
+ git clone https://github.com/username/hyperkit.git
+ cd hyperkit
+ ```
+
+2. **Install dependencies**
+ ```bash
+ npm install
+ ```
+
+3. **Set up environment variables**
+ ```bash
+ cp .env.example .env
+ # Edit .env with your configuration
+ ```
+
+4. **Start development server**
+ ```bash
+ npm run dev
+ ```
+
+5. **Verify installation**
+ Open http://localhost:3000 in your browser. You should see the Hyperkit dashboard.
+
+For detailed setup instructions, see [Installation Guide](./docs/installation.md).
+```
+
+**Best Practices**:
+- Show exact commands users can copy-paste
+- Explain each step briefly
+- Show expected output: "You should see..."
+- Provide success confirmation
+- Mention common issues and solutions
+- Link to detailed documentation
+
+### 8. Usage Examples
+
+**Purpose**: Show how to use the project for common scenarios.
+
+**Requirements**:
+- Provide 2-4 clear, working examples
+- Progress from simple to complex
+- Use realistic, meaningful data (not `foo`, `bar`, `baz`)
+- Show complete code including imports
+- Include expected output or console results
+- Comment only on non-obvious lines (not line-by-line)
+
+**Example**:
+
+```markdown
+## Usage
+
+### Basic Smart Contract Audit
+
+```python
+from hyperkit import SmartContractAuditor
+
+# Initialize auditor
+auditor = SmartContractAuditor(
+ model="gpt-4",
+ chains=["ethereum", "polygon"]
+)
+
+# Audit a contract
+results = auditor.audit("path/to/contract.sol")
+
+# View findings
+for finding in results.vulnerabilities:
+ print(f"[{finding.severity}] {finding.title}")
+ print(f" Details: {finding.description}")
+```
+
+Output:
+```
+[HIGH] Unprotected reentrancy attack
+ Details: Function transfers funds before updating state...
+
+[MEDIUM] Missing input validation
+ Details: Function accepts user input without validation...
+```
+
+### Multi-Chain Deployment
+
+```bash
+hyperkit deploy \
+ --contract=./contracts/Token.sol \
+ --networks=ethereum,polygon,avalanche \
+ --report=detailed
+```
+
+### Integration with Existing Tools
+
+See [Examples Directory](./docs/examples/) for more advanced use cases.
+```
+
+### 9. Documentation Links
+
+**Purpose**: Guide users to comprehensive documentation for topics beyond the README scope.
+
+**Structure**:
+
+```markdown
+## Documentation
+
+For more information, visit:
+
+- **[User Guide](./docs/user-guide.md)** - Complete feature documentation
+- **[API Reference](./docs/api/)** - Detailed API documentation
+- **[Developer Setup](./docs/development/setup.md)** - Development environment setup
+- **[Architecture](./docs/architecture.md)** - System design and component overview
+- **[FAQ](./docs/faq.md)** - Frequently asked questions
+- **[Changelog](./CHANGELOG.md)** - Version history and updates
+```
+
+### 10. Contributing
+
+**Purpose**: Welcome and guide potential contributors.
+
+**Minimum Content**:
+
+```markdown
+## Contributing
+
+We welcome contributions! To contribute:
+
+1. **Fork** the repository
+2. **Create a feature branch** (`git checkout -b feature/amazing-feature`)
+3. **Make your changes** and commit (`git commit -m 'Add amazing feature'`)
+4. **Push to your branch** (`git push origin feature/amazing-feature`)
+5. **Open a Pull Request**
+
+For detailed contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md).
+
+### Code of Conduct
+
+Please note we have a [Code of Conduct](./CODE_OF_CONDUCT.md).
+By participating, you are expected to uphold this code.
+```
+
+**Best Practices**:
+- Link to detailed CONTRIBUTING.md for full guidelines
+- Make contribution process obvious and welcoming
+- Mention code of conduct
+- Provide multiple ways to contribute (code, docs, testing, issues)
+
+### 11. License
+
+**Purpose**: Clarify intellectual property and usage rights.
+
+**Standard Format**:
+
+```markdown
+## License
+
+This project is licensed under the [MIT License](./LICENSE) -
+see the LICENSE file for details.
+
+Contributions to this project are accepted under the same license.
+```
+
+**Recommended Licenses** (by use case):
+
+| License | Best For |
+|---------|----------|
+| **MIT** | Permissive, most popular for open source |
+| **Apache 2.0** | Commercial-friendly with patent protection |
+| **GPL-3.0** | Copyleft; ensures derived works remain open |
+| **AGPL-3.0** | Network copyleft for SaaS/cloud services |
+| **ISC** | Minimal, simple permissive license |
+
+**License File**:
+- Always include a separate `LICENSE` file in repository root
+- Use exact license text from [choosealicense.com](https://choosealicense.com)
+- Do not modify license text
+
+### 12. Citation (Optional)
+
+**When to Include**:
+- Academic or research-focused projects
+- Projects that should be cited in published work
+- Projects with published papers or documentation
+
+**Format** (BibTeX):
+
+```markdown
+## Citation
+
+If you use Hyperkit in your research, please cite:
+
+```bibtex
+@software{hyperkit2025,
+ author = {Your Name},
+ title = {Hyperkit: AI-Powered Smart Contract Auditing},
+ year = {2025},
+ url = {https://github.com/username/hyperkit}
+}
+```
+
+Or use this APA format:
+
+Your Name. (2025). Hyperkit: AI-powered smart contract auditing platform.
+Retrieved from https://github.com/username/hyperkit
+```
+
+### 13. Authors & Acknowledgments
+
+**Purpose**: Credit creators, contributors, and inspirations. Build community.
+
+**Structure**:
+
+```markdown
+## Authors
+
+- **[Your Name](https://github.com/yourname)** - Creator and Maintainer
+- **[Contributor Name](https://github.com/contributor)** - Major Contributions
+
+## Acknowledgments
+
+Special thanks to:
+
+- [Project Inspiration](https://github.com/inspiration) for the original concept
+- [Library/Tool Name](https://github.com/library) for core functionality
+- All [contributors](./CONTRIBUTORS.md) who have helped improve this project
+
+### Contributors
+
+See [CONTRIBUTORS.md](./CONTRIBUTORS.md) for a full list of contributors.
+```
+
+---
+
+## Formatting and Styling Standards
+
+### Heading Hierarchy
+
+**Correct Structure**:
+```
+# Title (H1) — One per document
+## Major Section (H2)
+### Subsection (H3)
+#### Details (H4)
+```
+
+**Do Not**:
+- Use multiple H1 headings in one document
+- Skip heading levels (e.g., H2 → H4)
+- Use headings for styling purposes only
+
+### Lists
+
+**Unordered Lists** (bullet points):
+- Use for items without inherent order
+- Use one of: `-`, `*`, or `+` consistently
+- Do not exceed 10 items per list
+- Use for features, prerequisites, steps with alternatives
+
+**Ordered Lists** (numbered):
+- Use for step-by-step procedures
+- Use for prioritized items
+- Use for ranked lists
+- Restart numbering for each list
+- Avoid nesting more than 2 levels
+
+**Example**:
+```markdown
+### Installation Steps
+
+1. Clone the repository
+ - Using HTTPS: `git clone https://...`
+ - Using SSH: `git clone git@...`
+
+2. Install dependencies
+ ```bash
+ npm install
+ ```
+
+3. Configure environment
+ - Copy `.env.example` to `.env`
+ - Update with your settings
+```
+
+### Code Blocks
+
+**Requirements**:
+- Always specify language for syntax highlighting
+- Keep examples under 20 lines
+- Include sufficient context (imports, setup)
+- Add inline comments only for non-obvious code
+- Show both input and output when relevant
+
+**Example**:
+```markdown
+```python
+from hyperkit import SmartContractAuditor
+
+# Initialize with model and chains
+auditor = SmartContractAuditor(model="gpt-4")
+
+# Audit contract
+results = auditor.audit("contract.sol")
+```
+```
+
+**Language Identifiers**:
+- `python` - Python code
+- `javascript` or `js` - JavaScript
+- `typescript` or `ts` - TypeScript
+- `bash` or `shell` - Shell commands
+- `json` - JSON data
+- `yaml` or `yml` - YAML configuration
+- `sql` - SQL queries
+- `markdown` - Markdown content
+
+### Tables
+
+**Usage**:
+- Use for comparing features, options, or structured data
+- Include clear headers
+- Align columns consistently
+- Provide explanatory text above complex tables
+
+**Example**:
+```markdown
+### Supported Networks
+
+| Network | Mainnet | Testnet | Support Level |
+|---------|---------|---------|---------------|
+| Ethereum | ✓ | ✓ | Full |
+| Polygon | ✓ | ✓ | Full |
+| Avalanche | ✓ | ✓ | Experimental |
+```
+
+### Emphasis
+
+**Guidelines**:
+- Limit emphasis to ~10% of total text
+- Use **bold** for: UI elements, command names, key terms
+- Use *italics* for: file names, variable names, conceptual terms
+- Use `code formatting` for: code, commands, technical terminology
+- Avoid ALL CAPS for emphasis; use bold instead
+
+**Example**:
+```markdown
+Run the `npm install` command to install **dependencies**.
+Configure your *.env* file with API keys.
+```
+
+### Relative Links
+
+**Best Practice**: Use relative links for internal documentation to support cloned repositories.
+
+**Example**:
+```markdown
+
+[Contribution Guidelines](./CONTRIBUTING.md)
+[Development Setup](./docs/development/setup.md)
+
+
+[Contribution Guidelines](https://github.com/username/repo/blob/main/CONTRIBUTING.md)
+```
+
+### Images and Media
+
+**File Organization**:
+```
+repository-root/
+├── README.md
+├── docs/
+├── src/
+└── assets/
+ ├── images/
+ │ ├── demo-screenshot.png
+ │ ├── architecture.png
+ │ └── workflow.gif
+ └── videos/ (optional)
+```
+
+**Image Implementation**:
+```markdown
+
+
+
+
+
+```
+
+**Image Specifications**:
+- Use descriptive alt text for accessibility
+- Crop to relevant content only
+- Compress images to reasonable file size
+- Use PNG for screenshots (lossless)
+- Use GIF or WebP for animations
+- Use JPG for photographs
+- Specify width; height adjusts automatically to maintain aspect ratio
+
+### Emoji Usage
+
+**Strategic Emoji Placement**:
+- Use emojis in section headers for visual break (maximum 1 per section)
+- Use emojis in feature lists for quick visual scanning
+- Avoid excessive emoji use (unprofessional appearance)
+- Ensure emoji choices are semantic and helpful
+- Support screen readers by including descriptive text
+
+**Recommended Emojis by Context**:
+```
+🚀 Launch, quick start, getting started
+📖 Documentation, guides, learning
+🔧 Configuration, setup, installation
+⚙️ Settings, configuration, advanced options
+🐛 Bugs, issues, troubleshooting
+✨ Features, highlights, new features
+📊 Analytics, metrics, data
+🔍 Search, find, discover
+⚡ Performance, speed, optimization
+🔐 Security, authentication, encryption
+🌐 Global, web, internet, multi-chain
+💡 Tips, ideas, insights
+❓ FAQ, questions, help
+📝 Notes, documentation, changelog
+```
+
+**Not Recommended**:
+- Random emoji not connected to content meaning
+- Multiple emoji per line (visual noise)
+- Emoji instead of actual descriptive text
+- Complex emoji that don't render consistently across platforms
+
+---
+
+## Professional Standards and Practices
+
+### Length and Scope
+
+**Optimal README Length**:
+- 500-2000 words (typically)
+- Longer READMEs may indicate content belongs in separate documentation
+- Shorter READMEs may not provide sufficient information
+
+**Content Boundaries**:
+- README: Project overview, quick start, basic usage, links to detailed docs
+- Separate Documentation: Detailed API docs, architecture, advanced topics
+- GitHub Wiki or Docs Site: Extensive tutorials, how-to guides, FAQs
+
+**Rule of Thumb**: If a section exceeds 200 words, consider moving it to separate documentation and linking from README.
+
+### Tone and Language
+
+**Voice**:
+- Professional yet approachable
+- Friendly but not flippant
+- Direct and clear
+- Use "you" to address readers
+- Avoid marketing hype or exaggeration
+- Be honest about limitations
+
+**Language**:
+- Use active voice when possible
+- Write in present tense for current features
+- Define technical terms before using
+- Avoid culture-specific idioms or references
+- Use "they/them" pronouns for inclusive language
+- Avoid gendered language
+
+**Example**:
+```
+✓ "You can audit smart contracts to identify vulnerabilities"
+✗ "Smart contracts get audited for things that might be wrong"
+
+✓ "Supports 5+ blockchains including Ethereum, Polygon, and Avalanche"
+✗ "We're super excited to offer blockchain support!"
+```
+
+### Accessibility
+
+**GitHub Markdown Rendering**:
+- Test README rendering on GitHub.com (not just local)
+- Ensure adequate color contrast if using color
+- Use alt text for all images
+- Use semantic headings for screen readers
+- Avoid image-only content; include text alternative
+- Test on mobile devices for responsive display
+
+**Automated Accessibility Checks**:
+- Use GitHub's built-in accessibility checker
+- Test with accessibility browser extensions
+- Run markdown linters for structure validation
+
+### Mobile Rendering
+
+- GitHub automatically renders markdown responsively
+- Avoid wide tables (>4 columns may not display well)
+- Test badges on small screens
+- Use relative widths for embedded content
+- Ensure code blocks are horizontally scrollable
+- Preview README on mobile device before publishing
+
+### Maintenance and Updates
+
+**Keep Current**:
+- Update README when project changes significantly
+- Fix broken links immediately
+- Update installation instructions after major updates
+- Refresh screenshots annually or after UI changes
+- Update badges to reflect current project state
+
+**Process**:
+- Link README updates to code changes in Git commits
+- Include README changes in Pull Requests
+- Review README during release planning
+- Use GitHub Issues to track documentation needs
+
+**Automation**:
+- Use GitHub Actions to check for broken links
+- Automate badge updates from CI/CD
+- Generate documentation from code comments where applicable
+- Periodically (quarterly) audit links and content accuracy
+
+---
+
+## README Checklist
+
+Before publishing or updating your README, verify:
+
+### Essential Content
+- [ ] Project title is clear and descriptive
+- [ ] Brief description explains what the project does
+- [ ] Installation/Quick Start instructions work and are current
+- [ ] At least 2-3 working usage examples provided
+- [ ] Links to detailed documentation included
+- [ ] Contributing guidelines linked (CONTRIBUTING.md exists)
+- [ ] License clearly specified
+
+### Formatting and Style
+- [ ] Uses clear heading hierarchy (one H1, proper heading levels)
+- [ ] Proper markdown syntax with no rendering errors
+- [ ] Consistent formatting throughout (bold, italics, code blocks)
+- [ ] All code blocks have language identifiers
+- [ ] Relative links used for internal documentation
+- [ ] All links tested and working
+- [ ] Images have descriptive alt text
+- [ ] Images compressed and stored in appropriate directory
+
+### Professional Quality
+- [ ] Uses active voice and clear language
+- [ ] No typos or grammar errors
+- [ ] Tone is professional yet approachable
+- [ ] Jargon defined or explained
+- [ ] Content scannable with good use of whitespace
+- [ ] Mobile-friendly; tested on small screens
+- [ ] Accessibility tested; alt text provided
+- [ ] Information current and accurate
+
+### Badges and Visuals
+- [ ] Badges (if used) are working and current
+- [ ] Screenshots/GIFs are high quality and relevant
+- [ ] Visual hierarchy draws attention to important info
+- [ ] No excessive emoji or visual clutter
+
+### GitHub Integration
+- [ ] README located in repository root
+- [ ] File named exactly `README.md` (case-sensitive)
+- [ ] Renders correctly on GitHub.com
+- [ ] Table of Contents (if present) links work correctly
+- [ ] All GitHub-specific features tested
+
+---
+
+## Example README Template
+
+```markdown
+# Project Title: Clear, Descriptive, Memorable
+
+
+
+
+
+
+
+## Overview
+
+Brief, compelling description of what your project does (2-3 sentences).
+Explain the problem it solves and its primary use cases.
+
+## Table of Contents
+
+- [Features](#features)
+- [Quick Start](#quick-start)
+- [Usage](#usage)
+- [Documentation](#documentation)
+- [Contributing](#contributing)
+- [License](#license)
+
+## Features
+
+- ✨ **Key Feature 1** - Brief description of benefit
+- 🚀 **Key Feature 2** - Brief description of benefit
+- 📊 **Key Feature 3** - Brief description of benefit
+
+## Quick Start
+
+### Prerequisites
+
+- List any required software or knowledge
+
+### Installation
+
+```bash
+# Step-by-step commands
+git clone https://github.com/username/project.git
+cd project
+npm install
+```
+
+## Usage
+
+```python
+# Working code example with context
+```
+
+## Documentation
+
+- [Full Documentation](./docs/)
+- [API Reference](./docs/api.md)
+- [Contributing Guide](./CONTRIBUTING.md)
+
+## Contributing
+
+We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
+
+## License
+
+Licensed under [MIT License](./LICENSE).
+
+## Acknowledgments
+
+Thanks to [inspiration/tools/people] for [reason].
+```
+
+---
+
+## Tools and Resources
+
+### Markdown Tools
+- **markdown-toc** - Automatically generate table of contents
+- **markdownlint** - Validate markdown syntax and style
+- **prettier** - Format markdown consistently
+
+### Badge Resources
+- **[shields.io](https://shields.io)** - Professional badge creation
+- **[Badgen](https://badgen.net)** - Alternative badge generator
+- **GitHub badges** - Build status, coverage, etc.
+
+### Testing and Validation
+- **[Markdown Preview](https://github.com/markdown-preview/markdown-preview-plus)** - Preview in editor
+- **GitHub Pages** - Preview README in rendered form
+- **Mobile browsers** - Test responsive rendering
+
+### Inspiration
+- Review READMEs of successful projects in your domain
+- Use templates: [Best-README-Template](https://github.com/othneildrew/Best-README-Template)
+- Study award-winning open-source projects
\ No newline at end of file
diff --git a/.cursor/rules/rules.mdc b/.cursor/rules/rules.mdc
new file mode 100644
index 0000000..411dffd
--- /dev/null
+++ b/.cursor/rules/rules.mdc
@@ -0,0 +1,43 @@
+---
+description: Clean Code Implementation and Project Management Best Practices
+globs:
+ - "**/*.ts"
+ - "**/*.js"
+ - "**/*.tsx"
+ - "**/*.jsx"
+alwaysApply: true
+---
+
+# Clean Code Implementation Techniques
+
+- Use descriptive, intention-revealing names for variables, functions, classes, etc.
+- Avoid vague or misleading names to improve readability and maintainability.
+- Each function or module should have one clear purpose, following Single Responsibility Principle (SRP).
+- Write code that clearly expresses intent to minimize comments; comment "why", not "what".
+- Replace magic numbers or strings with named constants for clarity.
+- Organize code into layers or modules (routes, controllers, services, models).
+- Implement centralized and consistent error handling.
+- Use modern language features like async/await for better async operations management.
+- Use code linting and formatting tools (ESLint, Prettier) automatically.
+- Write unit tests to ensure correctness and ease future refactoring.
+- Avoid duplications by abstracting repeated logic into reusable functions/classes.
+- Enforce coding standards using linters and pre-commit hooks.
+- Regularly refactor code for simplicity and reduced technical debt.
+- Avoid Emoji on UI and Codebase
+- Always Professional UI Layout Positioning, Font, Spacing, and more releants
+
+# Project Management and Collaboration
+
+- Define clear project scope, objectives, deliverables, deadlines, and constraints.
+- Assign clear roles and responsibilities for team members.
+- Use project management tools for task, version, and documentation tracking.
+- Practice regular communication, standups, reviews, and retrospectives.
+- Design APIs/modules to be idempotent and implement caching/memoization.
+- Use code reviews with multiple reviewers and integrate automated checks.
+- Employ branching strategies like GitFlow and commit with descriptive messages.
+- Maintain detailed project documentation, including API docs and architecture decisions.
+- Automate repetitive tasks such as builds, deployments, and code quality checks.
+- Use effective communication tools (Slack, Teams) for streamlined interactions.
+- Share reusable code snippets consistently.
+- Keep audit trails with reasons and author for changes and enforce access controls.
+- Adapt conflict resolution styles and encourage collaborative problem-solving.
\ No newline at end of file
diff --git a/.cursor/skills.md b/.cursor/skills.md
new file mode 100644
index 0000000..7b8a28a
--- /dev/null
+++ b/.cursor/skills.md
@@ -0,0 +1,63 @@
+# HyperAgent AI Skills Index
+
+This file provides an index of available AI skills for the HyperAgent project.
+
+## Available Skills
+
+### Backend & API
+- `fastapi/` - FastAPI backend patterns and templates
+- `fastapi-templates/` - FastAPI project templates
+
+### Agent Orchestration
+- `langgraph/` - LangGraph agent orchestration
+- `langgraph-docs/` - LangGraph documentation
+- `langchain-architecture/` - LangChain architecture patterns
+
+### Database & Storage
+- `supabase-postgres-best-practices/` - Supabase and PostgreSQL best practices
+- `database-schema-designer/` - Database schema design tools
+- `database-schema-documentation/` - Database documentation generation
+
+### Smart Contracts
+- `solidity-development/` - Solidity development patterns
+- `smart-contract-security/` - Smart contract security practices
+
+### DevOps & Infrastructure
+- `gitops-principles-skill/` - GitOps principles and patterns
+- `gitops-workflow/` - GitOps workflow automation
+- `github-workflow-automation/` - GitHub Actions automation
+- `github-actions-templates/` - GitHub Actions templates
+
+### Project Management
+- `github-projects/` - GitHub Projects management
+- `github-issues/` - GitHub Issues management
+- `planning-with-files/` - File-based planning tools
+
+### Documentation & Design
+- `api-documentation-generator/` - API documentation generation
+- `beautiful-mermaid/` - Mermaid diagram generation
+- `file-organizer/` - File organization tools
+
+### Monitoring & Observability
+- `prometheus-configuration/` - Prometheus configuration
+
+### Debugging
+- `debugging-strategies/` - Debugging strategies and tools
+
+## Usage
+
+When an AI agent needs to perform a task:
+1. Check this index for relevant skills
+2. Load the specific skill from `.cursor/skills/{skill-name}/SKILL.md`
+3. Follow the skill's instructions and use its templates/references
+4. Apply the skill's patterns to the current task
+
+## Skill Structure
+
+Each skill follows this structure:
+- `SKILL.md` - Main skill documentation
+- `references/` - Reference materials and guides
+- `templates/` - Code templates and examples
+- `scripts/` - Utility scripts (if applicable)
+- `assets/` - Additional assets (if applicable)
+
diff --git a/.cursor/skills/api-documentation-generator/SKILL.md b/.cursor/skills/api-documentation-generator/SKILL.md
new file mode 100644
index 0000000..631aa33
--- /dev/null
+++ b/.cursor/skills/api-documentation-generator/SKILL.md
@@ -0,0 +1,484 @@
+---
+name: api-documentation-generator
+description: "Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices"
+---
+
+# API Documentation Generator
+
+## Overview
+
+Automatically generate clear, comprehensive API documentation from your codebase. This skill helps you create professional documentation that includes endpoint descriptions, request/response examples, authentication details, error handling, and usage guidelines.
+
+Perfect for REST APIs, GraphQL APIs, and WebSocket APIs.
+
+## When to Use This Skill
+
+- Use when you need to document a new API
+- Use when updating existing API documentation
+- Use when your API lacks clear documentation
+- Use when onboarding new developers to your API
+- Use when preparing API documentation for external users
+- Use when creating OpenAPI/Swagger specifications
+
+## How It Works
+
+### Step 1: Analyze the API Structure
+
+First, I'll examine your API codebase to understand:
+- Available endpoints and routes
+- HTTP methods (GET, POST, PUT, DELETE, etc.)
+- Request parameters and body structure
+- Response formats and status codes
+- Authentication and authorization requirements
+- Error handling patterns
+
+### Step 2: Generate Endpoint Documentation
+
+For each endpoint, I'll create documentation including:
+
+**Endpoint Details:**
+- HTTP method and URL path
+- Brief description of what it does
+- Authentication requirements
+- Rate limiting information (if applicable)
+
+**Request Specification:**
+- Path parameters
+- Query parameters
+- Request headers
+- Request body schema (with types and validation rules)
+
+**Response Specification:**
+- Success response (status code + body structure)
+- Error responses (all possible error codes)
+- Response headers
+
+**Code Examples:**
+- cURL command
+- JavaScript/TypeScript (fetch/axios)
+- Python (requests)
+- Other languages as needed
+
+### Step 3: Add Usage Guidelines
+
+I'll include:
+- Getting started guide
+- Authentication setup
+- Common use cases
+- Best practices
+- Rate limiting details
+- Pagination patterns
+- Filtering and sorting options
+
+### Step 4: Document Error Handling
+
+Clear error documentation including:
+- All possible error codes
+- Error message formats
+- Troubleshooting guide
+- Common error scenarios and solutions
+
+### Step 5: Create Interactive Examples
+
+Where possible, I'll provide:
+- Postman collection
+- OpenAPI/Swagger specification
+- Interactive code examples
+- Sample responses
+
+## Examples
+
+### Example 1: REST API Endpoint Documentation
+
+```markdown
+## Create User
+
+Creates a new user account.
+
+**Endpoint:** `POST /api/v1/users`
+
+**Authentication:** Required (Bearer token)
+
+**Request Body:**
+\`\`\`json
+{
+ "email": "user@example.com", // Required: Valid email address
+ "password": "SecurePass123!", // Required: Min 8 chars, 1 uppercase, 1 number
+ "name": "John Doe", // Required: 2-50 characters
+ "role": "user" // Optional: "user" or "admin" (default: "user")
+}
+\`\`\`
+
+**Success Response (201 Created):**
+\`\`\`json
+{
+ "id": "usr_1234567890",
+ "email": "user@example.com",
+ "name": "John Doe",
+ "role": "user",
+ "createdAt": "2026-01-20T10:30:00Z",
+ "emailVerified": false
+}
+\`\`\`
+
+**Error Responses:**
+
+- `400 Bad Request` - Invalid input data
+ \`\`\`json
+ {
+ "error": "VALIDATION_ERROR",
+ "message": "Invalid email format",
+ "field": "email"
+ }
+ \`\`\`
+
+- `409 Conflict` - Email already exists
+ \`\`\`json
+ {
+ "error": "EMAIL_EXISTS",
+ "message": "An account with this email already exists"
+ }
+ \`\`\`
+
+- `401 Unauthorized` - Missing or invalid authentication token
+
+**Example Request (cURL):**
+\`\`\`bash
+curl -X POST https://api.example.com/api/v1/users \
+ -H "Authorization: Bearer YOUR_TOKEN" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "email": "user@example.com",
+ "password": "SecurePass123!",
+ "name": "John Doe"
+ }'
+\`\`\`
+
+**Example Request (JavaScript):**
+\`\`\`javascript
+const response = await fetch('https://api.example.com/api/v1/users', {
+ method: 'POST',
+ headers: {
+ 'Authorization': `Bearer ${token}`,
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ email: 'user@example.com',
+ password: 'SecurePass123!',
+ name: 'John Doe'
+ })
+});
+
+const user = await response.json();
+console.log(user);
+\`\`\`
+
+**Example Request (Python):**
+\`\`\`python
+import requests
+
+response = requests.post(
+ 'https://api.example.com/api/v1/users',
+ headers={
+ 'Authorization': f'Bearer {token}',
+ 'Content-Type': 'application/json'
+ },
+ json={
+ 'email': 'user@example.com',
+ 'password': 'SecurePass123!',
+ 'name': 'John Doe'
+ }
+)
+
+user = response.json()
+print(user)
+\`\`\`
+```
+
+### Example 2: GraphQL API Documentation
+
+```markdown
+## User Query
+
+Fetch user information by ID.
+
+**Query:**
+\`\`\`graphql
+query GetUser($id: ID!) {
+ user(id: $id) {
+ id
+ email
+ name
+ role
+ createdAt
+ posts {
+ id
+ title
+ publishedAt
+ }
+ }
+}
+\`\`\`
+
+**Variables:**
+\`\`\`json
+{
+ "id": "usr_1234567890"
+}
+\`\`\`
+
+**Response:**
+\`\`\`json
+{
+ "data": {
+ "user": {
+ "id": "usr_1234567890",
+ "email": "user@example.com",
+ "name": "John Doe",
+ "role": "user",
+ "createdAt": "2026-01-20T10:30:00Z",
+ "posts": [
+ {
+ "id": "post_123",
+ "title": "My First Post",
+ "publishedAt": "2026-01-21T14:00:00Z"
+ }
+ ]
+ }
+ }
+}
+\`\`\`
+
+**Errors:**
+\`\`\`json
+{
+ "errors": [
+ {
+ "message": "User not found",
+ "extensions": {
+ "code": "USER_NOT_FOUND",
+ "userId": "usr_1234567890"
+ }
+ }
+ ]
+}
+\`\`\`
+```
+
+### Example 3: Authentication Documentation
+
+```markdown
+## Authentication
+
+All API requests require authentication using Bearer tokens.
+
+### Getting a Token
+
+**Endpoint:** `POST /api/v1/auth/login`
+
+**Request:**
+\`\`\`json
+{
+ "email": "user@example.com",
+ "password": "your-password"
+}
+\`\`\`
+
+**Response:**
+\`\`\`json
+{
+ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
+ "expiresIn": 3600,
+ "refreshToken": "refresh_token_here"
+}
+\`\`\`
+
+### Using the Token
+
+Include the token in the Authorization header:
+
+\`\`\`
+Authorization: Bearer YOUR_TOKEN
+\`\`\`
+
+### Token Expiration
+
+Tokens expire after 1 hour. Use the refresh token to get a new access token:
+
+**Endpoint:** `POST /api/v1/auth/refresh`
+
+**Request:**
+\`\`\`json
+{
+ "refreshToken": "refresh_token_here"
+}
+\`\`\`
+```
+
+## Best Practices
+
+### ✅ Do This
+
+- **Be Consistent** - Use the same format for all endpoints
+- **Include Examples** - Provide working code examples in multiple languages
+- **Document Errors** - List all possible error codes and their meanings
+- **Show Real Data** - Use realistic example data, not "foo" and "bar"
+- **Explain Parameters** - Describe what each parameter does and its constraints
+- **Version Your API** - Include version numbers in URLs (/api/v1/)
+- **Add Timestamps** - Show when documentation was last updated
+- **Link Related Endpoints** - Help users discover related functionality
+- **Include Rate Limits** - Document any rate limiting policies
+- **Provide Postman Collection** - Make it easy to test your API
+
+### ❌ Don't Do This
+
+- **Don't Skip Error Cases** - Users need to know what can go wrong
+- **Don't Use Vague Descriptions** - "Gets data" is not helpful
+- **Don't Forget Authentication** - Always document auth requirements
+- **Don't Ignore Edge Cases** - Document pagination, filtering, sorting
+- **Don't Leave Examples Broken** - Test all code examples
+- **Don't Use Outdated Info** - Keep documentation in sync with code
+- **Don't Overcomplicate** - Keep it simple and scannable
+- **Don't Forget Response Headers** - Document important headers
+
+## Documentation Structure
+
+### Recommended Sections
+
+1. **Introduction**
+ - What the API does
+ - Base URL
+ - API version
+ - Support contact
+
+2. **Authentication**
+ - How to authenticate
+ - Token management
+ - Security best practices
+
+3. **Quick Start**
+ - Simple example to get started
+ - Common use case walkthrough
+
+4. **Endpoints**
+ - Organized by resource
+ - Full details for each endpoint
+
+5. **Data Models**
+ - Schema definitions
+ - Field descriptions
+ - Validation rules
+
+6. **Error Handling**
+ - Error code reference
+ - Error response format
+ - Troubleshooting guide
+
+7. **Rate Limiting**
+ - Limits and quotas
+ - Headers to check
+ - Handling rate limit errors
+
+8. **Changelog**
+ - API version history
+ - Breaking changes
+ - Deprecation notices
+
+9. **SDKs and Tools**
+ - Official client libraries
+ - Postman collection
+ - OpenAPI specification
+
+## Common Pitfalls
+
+### Problem: Documentation Gets Out of Sync
+**Symptoms:** Examples don't work, parameters are wrong, endpoints return different data
+**Solution:**
+- Generate docs from code comments/annotations
+- Use tools like Swagger/OpenAPI
+- Add API tests that validate documentation
+- Review docs with every API change
+
+### Problem: Missing Error Documentation
+**Symptoms:** Users don't know how to handle errors, support tickets increase
+**Solution:**
+- Document every possible error code
+- Provide clear error messages
+- Include troubleshooting steps
+- Show example error responses
+
+### Problem: Examples Don't Work
+**Symptoms:** Users can't get started, frustration increases
+**Solution:**
+- Test every code example
+- Use real, working endpoints
+- Include complete examples (not fragments)
+- Provide a sandbox environment
+
+### Problem: Unclear Parameter Requirements
+**Symptoms:** Users send invalid requests, validation errors
+**Solution:**
+- Mark required vs optional clearly
+- Document data types and formats
+- Show validation rules
+- Provide example values
+
+## Tools and Formats
+
+### OpenAPI/Swagger
+Generate interactive documentation:
+```yaml
+openapi: 3.0.0
+info:
+ title: My API
+ version: 1.0.0
+paths:
+ /users:
+ post:
+ summary: Create a new user
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateUserRequest'
+```
+
+### Postman Collection
+Export collection for easy testing:
+```json
+{
+ "info": {
+ "name": "My API",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "Create User",
+ "request": {
+ "method": "POST",
+ "url": "{{baseUrl}}/api/v1/users"
+ }
+ }
+ ]
+}
+```
+
+## Related Skills
+
+- `@doc-coauthoring` - For collaborative documentation writing
+- `@copywriting` - For clear, user-friendly descriptions
+- `@test-driven-development` - For ensuring API behavior matches docs
+- `@systematic-debugging` - For troubleshooting API issues
+
+## Additional Resources
+
+- [OpenAPI Specification](https://swagger.io/specification/)
+- [REST API Best Practices](https://restfulapi.net/)
+- [GraphQL Documentation](https://graphql.org/learn/)
+- [API Design Patterns](https://www.apiguide.com/)
+- [Postman Documentation](https://learning.postman.com/docs/)
+
+---
+
+**Pro Tip:** Keep your API documentation as close to your code as possible. Use tools that generate docs from code comments to ensure they stay in sync!
diff --git a/.cursor/skills/beautiful-mermaid/SKILL.md b/.cursor/skills/beautiful-mermaid/SKILL.md
new file mode 100644
index 0000000..cde7900
--- /dev/null
+++ b/.cursor/skills/beautiful-mermaid/SKILL.md
@@ -0,0 +1,171 @@
+---
+name: beautiful-mermaid
+description: Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.
+---
+
+# Beautiful Mermaid Diagram Rendering
+
+Render Mermaid diagrams as SVG and PNG images using the Beautiful Mermaid library.
+
+## Dependencies
+
+This skill requires the `agent-browser` skill for PNG rendering. Load it before proceeding with PNG capture.
+
+## Supported Diagram Types
+
+- **Flowchart** - Process flows, decision trees, CI/CD pipelines
+- **Sequence** - API calls, OAuth flows, database transactions
+- **State** - State machines, connection lifecycles
+- **Class** - UML class diagrams, design patterns
+- **Entity-Relationship** - Database schemas, data models
+
+## Available Themes
+
+Default, Dracula, Solarized, Zinc Dark, Tokyo Night, Tokyo Night Storm, Tokyo Night Light, Catppuccin Latte, Nord, Nord Light, GitHub Dark, GitHub Light, One Dark.
+
+If no theme is specified, use `default`.
+
+## Common Syntax Patterns
+
+### Flowchart Edge Labels
+
+Use pipe syntax for edge labels:
+
+```mermaid
+A -->|label| B
+A ---|label| B
+```
+
+Avoid space-dash syntax which can cause incomplete renders:
+
+```mermaid
+A -- label --> B # May cause issues
+```
+
+### Node Labels with Special Characters
+
+Wrap labels containing special characters in quotes:
+
+```mermaid
+A["Label with (parens)"]
+B["Label with / slash"]
+```
+
+## Workflow
+
+### Step 1: Generate or Validate Mermaid Code
+
+If the user provides a description rather than code, generate valid Mermaid syntax. Consult `references/mermaid-syntax.md` for full syntax details.
+
+### Step 2: Render SVG
+
+Run the rendering script to produce an SVG file:
+
+```bash
+bun run scripts/render.ts --code "graph TD; A-->B" --output diagram --theme default
+```
+
+Or from a file:
+
+```bash
+bun run scripts/render.ts --input diagram.mmd --output diagram --theme tokyo-night
+```
+
+Alternative runtimes:
+```bash
+npx tsx scripts/render.ts --code "..." --output diagram
+deno run --allow-read --allow-write --allow-net scripts/render.ts --code "..." --output diagram
+```
+
+This produces `