Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add near/agent-skills --skill "near-ai"
Install specific skill from multi-skill repository
# Description
NEAR AI agent development and integration. Use when building AI agents on NEAR, integrating AI models, creating agent workflows, or implementing AI-powered dApps on NEAR Protocol.
# SKILL.md
name: near-ai
description: NEAR AI agent development and integration. Use when building AI agents on NEAR, integrating AI models, creating agent workflows, or implementing AI-powered dApps on NEAR Protocol.
license: MIT
metadata:
author: near
version: "1.0.0"
NEAR AI Development
Comprehensive guide for building AI agents and AI-powered applications on NEAR Protocol, including NEAR AI integration, agent workflows, and AI model deployment.
When to Apply
Reference these guidelines when:
- Building AI agents on NEAR
- Integrating AI models with NEAR smart contracts
- Creating agent-based workflows
- Implementing AI-powered dApps
- Using NEAR AI infrastructure
- Building with NEAR AI Assistant
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Agent Architecture | CRITICAL | arch- |
| 2 | AI Integration | HIGH | ai- |
| 3 | Agent Communication | HIGH | comm- |
| 4 | Model Deployment | MEDIUM-HIGH | model- |
| 5 | Agent Workflows | MEDIUM | workflow- |
| 6 | Security & Privacy | MEDIUM | security- |
| 7 | Best Practices | MEDIUM | best- |
Quick Reference
1. Agent Architecture (CRITICAL)
arch-agent-structure- Design modular agent architecturearch-state-management- Manage agent state on-chain vs off-chainarch-agent-registry- Register agents in NEAR AI registryarch-composability- Build composable agentsarch-agent-capabilities- Define clear agent capabilities
2. AI Integration (HIGH)
ai-model-selection- Choose appropriate AI modelsai-inference-endpoints- Use NEAR AI inference endpointsai-prompt-engineering- Design effective prompts for agentsai-context-management- Manage conversation contextai-response-validation- Validate and sanitize AI responses
3. Agent Communication (HIGH)
comm-agent-protocol- Implement standard agent communication protocolscomm-message-format- Use structured message formatscomm-async-messaging- Handle asynchronous agent communicationcomm-multi-agent- Coordinate multiple agentscomm-human-in-loop- Implement human-in-the-loop patterns
4. Model Deployment (MEDIUM-HIGH)
model-hosting- Deploy models on NEAR AI infrastructuremodel-versioning- Version and update AI modelsmodel-optimization- Optimize models for inferencemodel-monitoring- Monitor model performancemodel-fallbacks- Implement fallback strategies
5. Agent Workflows (MEDIUM)
workflow-task-planning- Implement agent task planningworkflow-execution- Execute multi-step workflowsworkflow-error-handling- Handle workflow errors gracefullyworkflow-state-persistence- Persist workflow stateworkflow-composability- Compose workflows from smaller tasks
6. Security & Privacy (MEDIUM)
security-input-validation- Validate user inputs to agentssecurity-output-sanitization- Sanitize agent outputssecurity-access-control- Implement agent access controlsecurity-data-privacy- Protect user data privacysecurity-prompt-injection- Prevent prompt injection attacks
7. Best Practices (MEDIUM)
best-error-messages- Provide clear error messagesbest-logging- Log agent interactions for debuggingbest-testing- Test agent behavior comprehensivelybest-documentation- Document agent capabilities and APIsbest-user-feedback- Collect and incorporate user feedback
How to Use
Read individual rule files for detailed explanations and code examples:
rules/arch-agent-structure.md
rules/ai-inference-endpoints.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect code example with explanation
- Correct code example with explanation
- Additional context and NEAR AI-specific patterns
NEAR AI Components
NEAR AI Hub
Central registry for AI agents, models, and datasets on NEAR.
NEAR AI Assistant
Infrastructure for building conversational AI agents.
Agent Registry
On-chain registry for discovering and interacting with agents.
Inference Endpoints
Decentralized inference infrastructure for AI models.
Resources
- NEAR AI Documentation: https://docs.near.ai/
- NEAR AI Hub: https://app.near.ai/
- NEAR AI GitHub: https://github.com/near/nearai
- Agent Examples: https://github.com/near/nearai/tree/main/examples
- NEAR AI Research: https://near.ai/research
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.