diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/cadence-rules.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/cadence-rules.md index 2901b0eadb..2e84f97e19 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/cadence-rules.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/cadence-rules.md @@ -15,9 +15,9 @@ keywords: # Cadence Rules -## Introduction +## Overview -When building with AI, it is hard to make the agent consistently understand what standards it should use when building or generating responses. Cursor Rules mitigates this issue by setting up global rules, project wide rules or document specific rules that are inserted in the agent's context before reading the prompt. With Cursor Rules, you can create an assistant that can consistently understand the intended development process, desired formatted responses, and avoid common mistakes. Consider it your tool to make guard rails for agents that can reduce hallucination and incorrect development flows. +When building with AI, it's hard to make the agent consistently understand what standards it should use when building or generating responses. To migitate this issue, Cursor Rules sets up global rules, project wide rules or documents specific rules that it inserts in the agent's context before reading the prompt. With Cursor Rules, you can create an assistant that can consistently understand the intended development process, desired formatted responses, and avoid common mistakes. Consider it your tool to make guard rails for agents that can reduce hallucination and incorrect development flows. In this guide, you'll learn how to configure and use Cursor Rules that transform your AI assistant into a Flow development expert with persistent knowledge of Cadence syntax patterns, NFT standards, project configuration, and development workflows. @@ -32,38 +32,36 @@ In this guide, you'll learn how to configure and use Cursor Rules that transform > - - ## Learning Objectives -After completing this guide, you'll be able to: +After you complete this guide, you'll be able to: -- Configure and use Cursor Rules to enhance AI assistance for Flow blockchain development -- Apply specialized Cadence syntax patterns and NFT development standards through persistent AI context -- Utilize workflow-based rules to guide project setup, deployment, and debugging processes across the Flow development lifecycle -- Create your own Cadence Rules in order to supercharge your development on Flow +- Configure and use Cursor Rules to enhance AI assistance for Flow blockchain development. +- Apply specialized Cadence syntax patterns and NFT development standards through persistent AI context. +- Use workflow-based rules to guide project setup, deployment, and debugging processes across the Flow development lifecycle. +- Create your own Cadence Rules in order to supercharge your development on Flow. ## What Are Cursor Rules? -Cursor rules are a way to shape AI behavior with persistent, reusable instructions that guide how Cursor's Agent and Inline Edit assist you. Rules act as continuous context - embedding your preferences, coding standards, and workflows directly into the AI's decision-making process. Since AI models start fresh with each interaction, rules bridge this gap by automatically injecting your preferences and context into every conversation. -When active, rules are included at the beginning of the AI's context, providing consistent guidance for code generation, edit suggestions, and workflow assistance. +Cursor rules shape AI behavior with persistent, reusable instructions that guide how Cursor's Agent and Inline Edit assist you. Rules act as continuous context - embedding your preferences, coding standards, and workflows directly into the AI's decision-making process. Since AI models start fresh with each interaction, rules bridge this gap by automatically injecting your preferences and context into every conversation. +When active, rules are included at the beginning of the AI's context and provide consistent guidance for code generation, edit suggestions, and workflow assistance. Cursor offers two rule types: -- **Project Rules**: Live in `.cursor/rules`, version-controlled with your code, and apply to specific projects -- **User Rules**: Global preferences in Cursor Settings that apply across all your projects +- **Project Rules**: Live in `.cursor/rules`, version-controlled with your code, and apply to specific projects. +- **User Rules**: Global preferences in Cursor Settings that apply across all your projects. ### Rule anatomy -Each rule file is written in MDC (.mdc), a format supporting metadata and content. Control how rules are applied from the type dropdown which changes properties `description`, `globs`, `alwaysApply`. +Each rule file is written in MDC (`.mdc`), a format supporting metadata and content. Control how rules are applied from the type dropdown which changes properties `description`, `globs`, `alwaysApply`. |Rule Type |Description | |------------------------|---------------------------------------------------------------------------------| -|Always Apply |Always included in model context | -|Apply to Specific Files |Included when files matching a glob pattern are referenced | -|Apply Intellegently |Available to AI, which decides whether to include it. Must provide a description | -|Apply Manually |Only included when explicitly mentioned using `@ruleName` | +|Always Apply |Always included in model context. | +|Apply to Specific Files |Included when files matching a glob pattern are referenced. | +|Apply Intellegently |Available to AI, which decides whether to include it. Must provide a description. | +|Apply Manually |Only included when explicitly mentioned using `@ruleName`. | ```mdc --- @@ -72,10 +70,10 @@ globs: ["**/*.cdc", "**/contracts/**", "**/cadence/**"] alwaysApply: false --- -- Always implement NonFungibleToken interface for NFT contracts -- Use MetadataViews for marketplace compatibility -- Follow proper resource handling with @ and & symbols -- Include required standard functions and path conventions +- Always implement NonFungibleToken interface for NFT contracts. +- Use MetadataViews for marketplace compatibility. +- Follow proper resource handling with @ and & symbols. +- Include required standard functions and path conventions. @nft-template.cdc @@ -97,13 +95,13 @@ Project rules are stored as individual files in `.cursor/rules` and get version- Project rules excel at: -- Capturing specialized knowledge about your codebase and domain -- Establishing consistent workflows and development patterns -- Enforcing coding standards and architectural decisions across your team +- Capturing specialized knowledge about your codebase and domain. +- Establishing consistent workflows and development patterns. +- Enforcing coding standards and architectural decisions across your team. ### Nested Rules -Organize rules by placing them in .cursor/rules directories throughout your project. Nested rules automatically attach when files in their directory are referenced. +To organize rules, place them in `.cursor/rules` directories throughout your project. Nested rules automatically attach when files in their directory are referenced. ```mdc project/ @@ -116,15 +114,15 @@ project/ ## Creating a rule -Create rules using the Cursor Rule command or going to Cursor Settings > Rules. This creates a new rule file in .cursor/rules. From settings you can see all rules and their status. +Create rules with the Cursor Rule command or going to Cursor Settings > Rules. This creates a new rule file in `.cursor/rules`. From settings you can see all rules and their status. -Click on the cog icon on the upper right section of the window. Then click the "Rules and Memories" section on the left side bar. Finally click on the "+ Add Rule" button in the User Rules or Project Rules section (depending on your objective). +Click the cog icon on the upper right section of the window. Then, click "Rules and Memories" on the left side bar. Finally click "+ Add Rule" in the User Rules or Project Rules section (depending on your objective). ![Creating a Cursor Rule](./imgs/cursor_rules1.png) ### Generating rules -Generate rules directly in conversations using the `/Generate Cursor Rules` command. Useful when you’ve made decisions about agent behavior and want to reuse them. +Generate rules directly in conversations with the `/Generate Cursor Rules` command. This is useful when you’ve made decisions about agent behavior and want to reuse them. ![Generate Cursor Rules](./imgs/generate_cursor_rules.png) @@ -132,41 +130,41 @@ Generate rules directly in conversations using the `/Generate Cursor Rules` comm Good rules are focused, actionable, and scoped. -- Keep rules under 500 lines -- Split large rules into multiple, composable rules -- Provide concrete examples or referenced files -- Avoid vague guidance. Write rules like clear internal docs -- Reuse rules when repeating prompts in chat +- Keep rules under 500 lines. +- Split large rules into multiple, composable rules. +- Provide concrete examples or referenced files. +- Avoid vague guidance. Write rules like clear internal docs. +- Reuse rules when repeating prompts in chat. ## Cadence Rules -Here are a couple of Cursor Rules made by [claucondor] made for Flow development and NFTs +Here are a couple of Cursor Rules made by [claucondor] for Flow development and NFTs. ### Cadence NFT Standards The [cadence-nft-standards.mdc] rule provides comprehensive guidelines for developing NFTs using Cadence on Flow blockchain. It ensures proper implementation of: -- **Core Interface Conformance**: `NonFungibleToken`, `NFT`, and `Collection` interfaces -- **MetadataViews Integration**: Marketplace-compatible metadata standards -- **Modular Architecture**: Patterns for complex NFTs with traits, evolution, and breeding -- **Security Best Practices**: Proper resource handling and capability management -- **Event Standards**: Consistent event emission for off-chain indexing +- **Core Interface Conformance**: `NonFungibleToken`, `NFT`, and `Collection` interfaces. +- **MetadataViews Integration**: Marketplace-compatible metadata standards. +- **Modular Architecture**: Patterns for complex NFTs with traits, evolution, and breeding. +- **Security Best Practices**: Proper resource handling and capability management. +- **Event Standards**: Consistent event emission for off-chain indexing. **Perfect for:** -- New NFT projects on Flow -- NFT marketplace integration -- Complex NFT systems (traits, evolution, breeding) -- Code reviews and standards compliance -- Learning Flow NFT development +- New NFT projects on Flow. +- NFT marketplace integration. +- Complex NFT systems (traits, evolution, breeding). +- Code reviews and standards compliance. +- Learning Flow NFT development. -**Applies to:** `.cdc` files, NFT transactions, collection setup, metadata implementation +**Applies to:** `.cdc` files, NFT transactions, collection setup, metadata implementation. #### Rule Configuration ```mdc --- -description: Comprehensive standards and best practices for developing Non-Fungible Tokens (NFTs) using Cadence. Ensures proper implementation of NonFungibleToken interfaces, MetadataViews integration for marketplace compatibility, secure resource handling patterns, and advanced modular architectures for complex NFTs with traits, evolution, and breeding mechanics. Includes required standard functions, path conventions, event emission patterns, and security best practices for capability management. +description: Comprehensive standards and best practices for developing Non-Fungible Tokens (NFTs) with Cadence. Ensures proper implementation of NonFungibleToken interfaces, MetadataViews integration for marketplace compatibility, secure resource handling patterns, and advanced modular architectures for complex NFTs with traits, evolution, and breeding mechanics. Includes required standard functions, path conventions, event emission patterns, and security best practices for capability management. globs: ["**/*.cdc", "**/contracts/**", "**/cadence/**"] alwaysApply: false --- @@ -182,18 +180,18 @@ Recommended Apply config: `Apply Intelligently` #### Key Benefits -- **Ecosystem Compatibility**: Guaranteed marketplace and wallet integration -- **Security**: Proper resource handling and capability management -- **Maintainability**: Modular architecture for complex systems -- **Performance**: Gas-efficient implementations with lazy initialization -- **Standards Compliance**: Follows official Flow NFT patterns +- **Ecosystem Compatibility**: Guaranteed marketplace and wallet integration. +- **Security**: Proper resource handling and capability management. +- **Maintainability**: Modular architecture for complex systems. +- **Performance**: Gas-efficient implementations with lazy initialization. +- **Standards Compliance**: Follows official Flow NFT patterns. #### Usage Examples -- `"Create an NFT contract for collectible cards"` → Guides complete interface implementation -- `"Make my NFT marketplace compatible"` → Provides MetadataViews patterns -- `"Build evolving NFTs with traits"` → Suggests modular architecture patterns -- `"Review my NFT contract"` → Validates against all documented standards +- `"Create an NFT contract for collectible cards"` → Guides complete interface implementation. +- `"Make my NFT marketplace compatible"` → Provides MetadataViews patterns. +- `"Build evolving NFTs with traits"` → Suggests modular architecture patterns. +- `"Review my NFT contract"` → Validates against all documented standards. ### Cadence Syntax Patterns @@ -201,25 +199,25 @@ Recommended Apply config: `Apply Intelligently` The [cadence-syntax-patterns.mdc] rule provides comprehensive syntax guidance and error prevention for Cadence development. It covers essential language patterns including: -- **Resource Type Syntax**: Proper use of `@` and `&` symbols for resources and references -- **Interface Restrictions**: Correct `{}` syntax for interface constraints -- **Transaction Authorization**: Granular `auth` capabilities and permission patterns -- **Contract Member Access**: Accessing deployed contract functions and constants -- **Type Conversion & Arithmetic**: Explicit type handling and numeric operations -- **Access Control**: Field visibility, entitlements, and `view` function purity -- **Language Constructs**: Optional binding, loops, string manipulation, switch cases -- **Debugging Strategies**: Systematic error resolution and prevention techniques +- **Resource Type Syntax**: Proper use of `@` and `&` symbols for resources and references. +- **Interface Restrictions**: Correct `{}` syntax for interface constraints. +- **Transaction Authorization**: Granular `auth` capabilities and permission patterns. +- **Contract Member Access**: Accessing deployed contract functions and constants. +- **Type Conversion & Arithmetic**: Explicit type handling and numeric operations. +- **Access Control**: Field visibility, entitlements, and `view` function purity. +- **Language Constructs**: Optional binding, loops, string manipulation, switch cases. +- **Debugging Strategies**: Systematic error resolution and prevention techniques. **Perfect for:** -- Writing any Cadence contracts or transactions -- Debugging compilation errors with resources (`@`) or references (`&`) -- Fixing authorization issues in transactions -- Learning Cadence syntax and best practices -- Preventing common type system errors -- Understanding Flow blockchain development patterns +- Writing any Cadence contracts or transactions. +- Debugging compilation errors with resources (`@`) or references (`&`). +- Fixing authorization issues in transactions. +- Learning Cadence syntax and best practices. +- Preventing common type system errors. +- Understanding Flow blockchain development patterns. -**Applies to:** `.cdc` files, transaction scripts, contract development, Flow CLI usage, error debugging +**Applies to:** `.cdc` files, transaction scripts, contract development, Flow CLI usage, error debugging. #### How to Use This Rule @@ -243,12 +241,12 @@ Recommended Apply config: `Apply Intelligently` #### Key Benefits -- **Error Prevention**: Avoids common syntax mistakes before they happen -- **Faster Debugging**: Systematic approaches to resolve compilation errors -- **Best Practices**: Language-specific patterns that follow Cadence conventions -- **Authorization Mastery**: Proper transaction permission handling -- **Type Safety**: Correct resource handling and type conversions -- **Performance**: Optimized patterns for gas efficiency +- **Error Prevention**: Avoids common syntax mistakes before they happen. +- **Faster Debugging**: Systematic approaches to resolve compilation errors. +- **Best Practices**: Language-specific patterns that follow Cadence conventions. +- **Authorization Mastery**: Proper transaction permission handling. +- **Type Safety**: Correct resource handling and type conversions. +- **Performance**: Optimized patterns for gas efficiency. #### Usage Examples @@ -262,7 +260,7 @@ Recommended Apply config: `Apply Intelligently` #### Key Syntax Patterns Covered - **Resources**: `@{NonFungibleToken.NFT}` not `@NonFungibleToken.NFT` -- **Authorization**: `auth(Storage) &Account` or granular capabilities +- **Authorization**: `auth(Storage) &Account` or granular capabilities. - **Optional Binding**: `if let` syntax (no `guard let`) - **Variable Initialization**: All `var` declarations must have initial values - **Type Conversion**: Explicit conversion required for arithmetic @@ -276,26 +274,26 @@ Recommended Apply config: `Apply Intelligently` The [flow-development-workflow.mdc] rule provides comprehensive workflow methodology for Flow blockchain development covering the complete development lifecycle. It includes: -- **Documentation-First Approach**: Always reference official Flow documentation and standard examples -- **Development Sequence**: Emulator → Testnet → Mainnet progression with proper validation -- **Transaction Authorization**: Granular `auth` capabilities and permission management -- **Deployment Verification**: Post-deployment validation protocols and testing strategies -- **FCL Integration**: Frontend configuration, network management, and user experience patterns -- **Error Resolution**: Systematic debugging approaches and common error prevention -- **Optimization Techniques**: Computation limit handling and gas efficiency strategies -- **Testnet Validation**: Comprehensive validation protocols before mainnet deployment +- **Documentation-First Approach**: Always reference official Flow documentation and standard examples. +- **Development Sequence**: Emulator → Testnet → Mainnet progression with proper validation. +- **Transaction Authorization**: Granular `auth` capabilities and permission management. +- **Deployment Verification**: Post-deployment validation protocols and testing strategies. +- **FCL Integration**: Frontend configuration, network management, and user experience patterns. +- **Error Resolution**: Systematic debugging approaches and common error prevention. +- **Optimization Techniques**: Computation limit handling and gas efficiency strategies. +- **Testnet Validation**: Comprehensive validation protocols before mainnet deployment. **Perfect for:** -- Starting new Flow projects or need setup guidance -- Moving between development stages (emulator → testnet → mainnet) -- Debugging deployment or transaction authorization issues -- Integrating frontend applications with FCL -- Handling computation limits and gas optimization -- Learning Flow development best practices and official patterns -- Comprehensive project validation strategies +- Starting new Flow projects or need setup guidance. +- Moving between development stages (emulator → testnet → mainnet). +- Debugging deployment or transaction authorization issues. +- Integrating frontend applications with FCL. +- Handling computation limits and gas optimization. +- Learning Flow development best practices and official patterns. +- Comprehensive project validation strategies. -**Applies to:** Complete Flow development lifecycle, project setup, deployment, FCL integration, debugging +**Applies to:** Complete Flow development lifecycle, project setup, deployment, FCL integration, debugging. #### Manual Reference @@ -317,40 +315,40 @@ Recommended Apply config: `Apply Intelligently` #### Key Benefits -- **Systematic Approach**: Step-by-step methodology prevents common mistakes -- **Official Patterns**: Emphasizes Flow documentation and standard examples -- **Error Prevention**: Proactive strategies for avoiding deployment and integration issues -- **Full-Stack Awareness**: Covers both Cadence backend and FCL frontend integration -- **Optimization Focus**: Gas efficiency and computation limit management -- **Validation Protocols**: Comprehensive testing before production deployment +- **Systematic Approach**: Step-by-step methodology prevents common mistakes. +- **Official Patterns**: Emphasizes Flow documentation and standard examples. +- **Error Prevention**: Proactive strategies for avoiding deployment and integration issues. +- **Full-Stack Awareness**: Covers both Cadence backend and FCL frontend integration. +- **Optimization Focus**: Gas efficiency and computation limit management. +- **Validation Protocols**: Comprehensive testing before production deployment. #### Usage Examples -- `"How do I set up a new Flow project?"` → Guides project setup and configuration -- `"My transaction authorization is failing"` → Provides auth capability debugging -- `"Deploy my contract to testnet"` → Shows deployment sequence and verification -- `"FCL integration not working"` → Suggests configuration and network troubleshooting -- `"Computation limit exceeded"` → Recommends optimization strategies -- `"Prepare for mainnet deployment"` → Provides comprehensive validation checklist +- `"How do I set up a new Flow project?"` → Guides project setup and configuration. +- `"My transaction authorization is failing"` → Provides auth capability debugging. +- `"Deploy my contract to testnet"` → Shows deployment sequence and verification. +- `"FCL integration not working"` → Suggests configuration and network troubleshooting. +- `"Computation limit exceeded"` → Recommends optimization strategies. +- `"Prepare for mainnet deployment"` → Provides comprehensive validation checklist. #### Key Workflow Areas Covered -- **Project Setup**: `flow.json` configuration, FCL setup, environment management -- **Authorization**: `auth(Storage)`, `auth(BorrowValue, SaveValue)`, granular capabilities -- **Development Sequence**: Emulator testing → Frontend integration → Testnet → Validation -- **Error Resolution**: Syntax errors, deployment errors, FCL errors, computation limits -- **FCL Best Practices**: Network configuration, contract address management, user authentication -- **Optimization**: Accumulative processing, loop optimization, gas efficiency -- **Deployment**: Verification protocols, update strategies, multi-network consistency -- **Documentation Usage**: When and how to reference official Flow resources +- **Project Setup**: `flow.json` configuration, FCL setup, environment management. +- **Authorization**: `auth(Storage)`, `auth(BorrowValue, SaveValue)`, granular capabilities. +- **Development Sequence**: Emulator testing → Frontend integration → Testnet → Validation. +- **Error Resolution**: Syntax errors, deployment errors, FCL errors, computation limits. +- **FCL Best Practices**: Network configuration, contract address management, user authentication. +- **Optimization**: Accumulative processing, loop optimization, gas efficiency. +- **Deployment**: Verification protocols, update strategies, multi-network consistency. +- **Documentation Usage**: When and how to reference official Flow resources. #### Development Philosophy Emphasized -- **Documentation-Driven**: Reference official sources before creating custom solutions -- **Iterative Approach**: Fix issues one at a time, test frequently at each stage -- **Standard Compliance**: Prefer established Flow patterns over custom implementations -- **Full-Stack Awareness**: Consider entire stack from contracts to frontend UI -- **Error-Driven Learning**: Use errors as opportunities to refine understanding +- **Documentation-Driven**: Reference official sources before creating custom solutions. +- **Iterative Approach**: Fix issues one at a time, test frequently at each stage. +- **Standard Compliance**: Prefer established Flow patterns over custom implementations. +- **Full-Stack Awareness**: Consider entire stack from contracts to frontend UI. +- **Error-Driven Learning**: Use errors as opportunities to refine understanding. ### Flow Project Configuration @@ -358,26 +356,26 @@ Recommended Apply config: `Apply Intelligently` The [flow-project-config.mdc] rule provides comprehensive guidance for Flow project configuration and `flow.json` management. It covers essential configuration patterns including: -- **`flow.json` Structure**: Accounts, contracts, deployments, and networks configuration -- **Account Management**: Named accounts, addresses, private keys, and signer setup -- **Contract Registration**: Source paths, network-specific aliases, and pre-deployment setup -- **Deployment Configuration**: Network-specific deployments and contract mappings -- **FCL Integration**: Synchronizing backend deployment with frontend address configuration -- **Network Management**: Multi-network consistency across emulator, testnet, and mainnet -- **Error Prevention**: Common configuration mistakes and troubleshooting strategies -- **Address Mapping**: Contract address management and import resolution +- **`flow.json` Structure**: Accounts, contracts, deployments, and networks configuration. +- **Account Management**: Named accounts, addresses, private keys, and signer setup. +- **Contract Registration**: Source paths, network-specific aliases, and pre-deployment setup. +- **Deployment Configuration**: Network-specific deployments and contract mappings. +- **FCL Integration**: Synchronizing backend deployment with frontend address configuration. +- **Network Management**: Multi-network consistency across emulator, testnet, and mainnet. +- **Error Prevention**: Common configuration mistakes and troubleshooting strategies. +- **Address Mapping**: Contract address management and import resolution. **Perfect for:** -- Setting up new Flow projects or configuring `flow.json` -- Debugging deployment or contract resolution issues -- Managing FCL integration and address mapping problems -- Working across different networks (emulator/testnet/mainnet) -- Troubleshooting CLI errors related to signers or contract imports -- Account management and private key handling -- Contract aliasing and deployment configurations +- Setting up new Flow projects or configuring `flow.json`. +- Debugging deployment or contract resolution issues. +- Managing FCL integration and address mapping problems. +- Working across different networks (emulator/testnet/mainnet). +- Troubleshooting CLI errors related to signers or contract imports. +- Account management and private key handling. +- Contract aliasing and deployment configurations. -**Applies to:** `flow.json`, FCL config files, deployment scripts, network switching, contract imports +**Applies to:** `flow.json`, FCL config files, deployment scripts, network switching, contract imports. #### Auto Attached Configuration @@ -399,49 +397,49 @@ Recommended Apply config: `Apply Intelligently` #### Key Benefits -- **Configuration Accuracy**: Prevents common setup and deployment errors -- **Multi-Network Support**: Seamless switching between emulator, testnet, and mainnet -- **FCL Synchronization**: Ensures frontend and backend configurations stay aligned -- **Error Prevention**: Addresses typos, address mismatches, and path issues proactively -- **Deployment Success**: Proper account setup and contract registration workflows -- **Address Management**: Centralized contract address handling across environments +- **Configuration Accuracy**: Prevents common setup and deployment errors. +- **Multi-Network Support**: Seamless switching between emulator, testnet, and mainnet. +- **FCL Synchronization**: Ensures frontend and backend configurations stay aligned. +- **Error Prevention**: Addresses typos, address mismatches, and path issues proactively. +- **Deployment Success**: Proper account setup and contract registration workflows. +- **Address Management**: Centralized contract address handling across environments. #### Usage Examples -- `"Configure flow.json for new project"` → Provides complete structure and setup guidance -- `"Failed to resolve contract import"` → Suggests address mapping and alias fixes -- `"Wrong signer/network CLI error"` → Guides account and network configuration -- `"FCL can't find my contract"` → Shows frontend address configuration patterns -- `"Deploy contract to testnet"` → Provides deployment configuration and verification -- `"Switch from emulator to testnet"` → Guides network transition and address updates +- `"Configure flow.json for new project"` → Provides complete structure and setup guidance. +- `"Failed to resolve contract import"` → Suggests address mapping and alias fixes. +- `"Wrong signer/network CLI error"` → Guides account and network configuration. +- `"FCL can't find my contract"` → Shows frontend address configuration patterns. +- `"Deploy contract to testnet"` → Provides deployment configuration and verification. +- `"Switch from emulator to testnet"` → Guides network transition and address updates. #### Key Configuration Areas Covered -- **Account Setup**: Address accuracy, key file paths, network-specific accounts -- **Contract Registration**: Source paths, aliases, pre-deployment requirements -- **Deployment Management**: Signer assignment, contract lists, network specificity -- **Standard Contract Addresses**: Official addresses for NonFungibleToken, MetadataViews, FungibleToken -- **FCL Configuration**: Network settings, contract address mapping, environment variables -- **Error Prevention**: Typo checking, address consistency, permission handling -- **Multi-Network Patterns**: Network-specific aliases and deployment strategies -- **CLI Usage**: Correct `--signer`, `--network`, and `--update` flag usage +- **Account Setup**: Address accuracy, key file paths, network-specific accounts. +- **Contract Registration**: Source paths, aliases, pre-deployment requirements. +- **Deployment Management**: Signer assignment, contract lists, network specificity. +- **Standard Contract Addresses**: Official addresses for NonFungibleToken, MetadataViews, FungibleToken. +- **FCL Configuration**: Network settings, contract address mapping, environment variables. +- **Error Prevention**: Typo checking, address consistency, permission handling. +- **Multi-Network Patterns**: Network-specific aliases and deployment strategies. +- **CLI Usage**: Correct `--signer`, `--network`, and `--update` flag usage. #### Common Issues Addressed -- **"failed to get contract"**: Missing or incorrect aliases in `flow.json` -- **"failed to resolve import"**: Address mapping issues in FCL configuration -- **"Permission Denied"**: Key file accessibility and path problems -- **"transaction failed to decode"**: Network mismatch or FCL configuration errors -- **Signer/Network Mismatches**: Using emulator accounts on testnet and vice-versa -- **Address Inconsistencies**: Misaligned addresses between `flow.json` and FCL config +- **"failed to get contract"**: Missing or incorrect aliases in `flow.json`. +- **"failed to resolve import"**: Address mapping issues in FCL configuration. +- **"Permission Denied"**: Key file accessibility and path problems. +- **"transaction failed to decode"**: Network mismatch or FCL configuration errors. +- **Signer/Network Mismatches**: Using emulator accounts on testnet and vice-versa. +- **Address Inconsistencies**: Misaligned addresses between `flow.json` and FCL config. #### Best Practices Emphasized -- **Pre-deployment Registration**: Always add contracts to `flow.json` before deploying -- **Address Consistency**: Ensure addresses match across `flow.json`, FCL config, and imports -- **Environment Variables**: Use `.env` files for network-specific contract addresses -- **Network Separation**: Maintain distinct configurations for each network environment -- **Key Security**: Proper `.gitignore` setup for private key files +- **Pre-deployment Registration**: Always add contracts to `flow.json` before you deploy it. +- **Address Consistency**: Ensure addresses match across `flow.json`, FCL config, and imports. +- **Environment Variables**: Use `.env` files for network-specific contract addresses. +- **Network Separation**: Maintain distinct configurations for each network environment. +- **Key Security**: Proper `.gitignore` setup for private key files. ### User Preferences @@ -449,23 +447,23 @@ Recommended Apply config: `Apply Intelligently` The [user-preferences.mdc] rule personalizes AI assistance behavior for Flow blockchain development. It defines preferred communication style and development methodology including: -- **Communication Style**: Concise, actionable solutions with proactive error prevention explanations -- **Development Philosophy**: Documentation-driven approach with official Flow patterns preference -- **Problem-Solving Methodology**: Root cause analysis, iterative fixes, and pattern recognition -- **Code Quality Standards**: Standards compliance, consistency, and completeness requirements -- **Workflow Preferences**: Thorough setup, emulator-first testing, and systematic debugging -- **Error Resolution Style**: Reference-based solutions and prevention-focused learning -- **Full-Stack Awareness**: Solutions considering entire stack from Cadence to frontend UI -- **User Experience Focus**: Clear blockchain interaction feedback and user-friendly interfaces +- **Communication Style**: Concise, actionable solutions with proactive error prevention explanations. +- **Development Philosophy**: Documentation-driven approach with official Flow patterns preference. +- **Problem-Solving Methodology**: Root cause analysis, iterative fixes, and pattern recognition. +- **Code Quality Standards**: Standards compliance, consistency, and completeness requirements. +- **Workflow Preferences**: Thorough setup, emulator-first testing, and systematic debugging. +- **Error Resolution Style**: Reference-based solutions and prevention-focused learning. +- **Full-Stack Awareness**: Solutions that consider entire stack from Cadence to frontend UI. +- **User Experience Focus**: Clear blockchain interaction feedback and user-friendly interfaces. **Perfect for:** -- Ensuring consistent AI behavior across all Flow development projects -- Matching AI assistance style to your preferred working methodology -- Getting responses formatted in your preferred communication style -- Maintaining documentation-driven and standards-compliant approaches -- Ensuring full-stack consideration in all solutions provided -- Receiving proactive error prevention guidance with solutions +- Ensuring consistent AI behavior across all Flow development projects. +- Matching AI assistance style to your preferred working methodology. +- Getting responses formatted in your preferred communication style. +- Maintaining documentation-driven and standards-compliant approaches. +- Ensuring full-stack consideration in all solutions provided. +- Receiving proactive error prevention guidance with solutions. **Applies to:** All AI assistance, communication style, problem-solving approach, solution methodology @@ -473,9 +471,9 @@ The [user-preferences.mdc] rule personalizes AI assistance behavior for Flow blo This rule works as the **behavioral foundation** for your technical Flow rules: -- **Technical Rules** provide **WHAT** information to apply -- **User Preferences** defines **HOW** to deliver that information -- **Result**: Consistent, personalized assistance across all Flow development scenarios +- **Technical Rules** provide **WHAT** information to apply. +- **User Preferences** defines **HOW** to deliver that information. +- **Result**: Consistent, personalized assistance across all Flow development scenarios. #### Always Applied Configuration @@ -490,32 +488,32 @@ Recommended Apply config: `Always Apply` #### Key Benefits -- **Consistent Communication**: AI responses match your preferred style and level of detail -- **Methodology Alignment**: Solutions follow your preferred development philosophy -- **Error Prevention Focus**: Proactive guidance on avoiding similar issues in the future -- **Efficiency**: Concise but complete responses without unnecessary verbosity -- **Standards Compliance**: Emphasis on official Flow patterns and best practices -- **Full-Stack Perspective**: Solutions consider entire development stack implications +- **Consistent Communication**: AI responses match your preferred style and level of detail. +- **Methodology Alignment**: Solutions follow your preferred development philosophy. +- **Error Prevention Focus**: Proactive guidance on avoiding similar issues in the future. +- **Efficiency**: Concise, but complete responses without unnecessary verbosity. +- **Standards Compliance**: Emphasis on official Flow patterns and best practices. +- **Full-Stack Perspective**: Solutions consider entire development stack implications. #### How This Rule Affects AI Responses -- **Response Style**: `"Configure flow.json for testnet"` → Provides direct steps + brief prevention tips -- **Problem-Solving**: `"Authorization error"` → Root cause analysis + pattern to prevent recurrence -- **Code Solutions**: Always includes reference to official documentation when available -- **Error Debugging**: Systematic, one-issue-at-a-time approach with testing checkpoints -- **Architecture Decisions**: Prefer established Flow patterns over custom implementations -- **Learning Approach**: Uses errors as learning opportunities with rule/pattern references +- **Response Style**: `"Configure flow.json for testnet"` → Provides direct steps + brief prevention tips. +- **Problem-Solving**: `"Authorization error"` → Root cause analysis + pattern to prevent recurrence. +- **Code Solutions**: Always includes reference to official documentation when available. +- **Error Debugging**: Systematic, one-issue-at-a-time approach with testing checkpoints. +- **Architecture Decisions**: Prefer established Flow patterns over custom implementations. +- **Learning Approach**: Uses errors as learning opportunities with rule/pattern references. #### Behavioral Patterns Defined -- **Conciseness**: Clear, actionable solutions without excessive explanation -- **Practical Focus**: Working code examples prioritized over theoretical explanations -- **Documentation-Driven**: Official Flow, Cadence, FCL docs referenced first -- **Iterative Methodology**: Fix one issue at a time, test frequently -- **Standard Compliance**: Established patterns preferred over custom solutions -- **Root Cause Analysis**: Address underlying issues, not just symptoms -- **Prevention-Oriented**: Include brief explanations of why errors occurred -- **Full-Stack Consideration**: Account for contracts, transactions, FCL, and UI implications +- **Conciseness**: Clear, actionable solutions without excessive explanation. +- **Practical Focus**: Working code examples prioritized over theoretical explanations. +- **Documentation-Driven**: Official Flow, Cadence, FCL docs referenced first. +- **Iterative Methodology**: Fix one issue at a time, test frequently. +- **Standard Compliance**: Established patterns preferred over custom solutions. +- **Root Cause Analysis**: Address underlying issues, not just symptoms. +- **Prevention-Oriented**: Include brief explanations of why errors occurred. +- **Full-Stack Consideration**: Account for contracts, transactions, FCL, and UI implications. #### Configuration Recommendation diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/flow-data-sources.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/flow-data-sources.md index 9f1597196f..3b4c9a713b 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/flow-data-sources.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/flow-data-sources.md @@ -35,11 +35,11 @@ Flow Data Sources is a comprehensive repository that automatically aggregates an The repository contains Python scripts that: -- Crawl Flow-related documentation sites, GitHub repositories, and discussions -- Convert HTML content to Markdown format -- Extract code examples from GitHub repositories -- Capture community discussions and Q&A content -- Merge all content into consolidated files for easy consumption +- Crawl Flow-related documentation sites, GitHub repositories, and discussions. +- Convert HTML content to Markdown format. +- Extract code examples from GitHub repositories. +- Capture community discussions and Q&A content. +- Merge all content into consolidated files for easy consumption. Flow Data Sources automatically pulls content from: @@ -53,10 +53,10 @@ Flow Data Sources automatically pulls content from: ## Key Features -- **Daily Updates**: Content is automatically refreshed to ensure the latest information -- **Structured Format**: All content is converted to Markdown for consistent processing -- **Comprehensive Coverage**: Includes official documentation, code examples, and community discussions -- **Optimized for AI**: Designed specifically for AI tools, chatbots, and RAG pipelines +- **Daily Updates**: Content is automatically refreshed to ensure the latest information. +- **Structured Format**: All content is converted to Markdown for consistent processing. +- **Comprehensive Coverage**: Includes official documentation, code examples, and community discussions. +- **Optimized for AI**: Designed specifically for AI tools, chatbots, and RAG pipelines. ## Available Files @@ -70,33 +70,33 @@ The repository provides several merged documentation files optimized for differe ### All Merged Documentation -- **File**: [all_merged.md](https://github.com/onflow/Flow-Data-Sources/blob/main/merged_docs/all_merged.md) -- **Content**: Complete comprehensive documentation covering all aspects of Flow development -- **Use Case**: Most comprehensive knowledge base for AI tools and complex development questions -- **Size**: Very large file - may require powerful systems for processing +- **File**: [all_merged.md](https://github.com/onflow/Flow-Data-Sources/blob/main/merged_docs/all_merged.md). +- **Content**: Complete comprehensive documentation covering all aspects of Flow development. +- **Use Case**: Most comprehensive knowledge base for AI tools and complex development questions. +- **Size**: Very large file - may require powerful systems for processing. ### Essentials Merged Documentation - **File**: [essentials_merged.md](https://github.com/onflow/Flow-Data-Sources/blob/main/merged_docs/essentials_merged.md) -- **Content**: Core Flow and Cadence development essentials -- **Use Case**: Lighter alternative for systems with resource constraints -- **Size**: Smaller, more focused content for essential development needs +- **Content**: Core Flow and Cadence development essentials. +- **Use Case**: Lighter alternative for systems with resource constraints. +- **Size**: Smaller, more focused content for essential development needs. ### Cadence Only Documentation - **File**: [cadence_docs_merged.md](https://github.com/onflow/Flow-Data-Sources/blob/main/merged_docs/cadence_docs_merged.md) -- **Content**: Streamlined version only including Cadence related documentation and sample codes -- **Use Case**: Focused on Cadence language development and smart contracts -- **Size**: Cadence-specific content for specialized development needs +- **Content**: Streamlined version only including Cadence related documentation and sample codes. +- **Use Case**: Focused on Cadence language development and smart contracts. +- **Size**: Cadence-specific content for specialized development needs. ## How to Use -Flow Data Sources can be integrated with: +You can integrate Flow Data Sources with: -- **ChatGPT Plugins**: Enhance Q&A capabilities with Flow-specific knowledge -- **Custom Chatbots**: Power Discord/Telegram bots with accurate Flow information -- **RAG Systems**: Index content in vector databases for semantic search -- **Development Tools**: Provide context-aware assistance in IDEs like Cursor +- **ChatGPT Plugins**: Enhance Q&A capabilities with Flow-specific knowledge. +- **Custom Chatbots**: Power Discord/Telegram bots with accurate Flow information. +- **RAG Systems**: Index content in vector databases for semantic search. +- **Development Tools**: Provide context-aware assistance in IDEs like Cursor. ## Integration with AI Tools @@ -151,10 +151,10 @@ For integration with AI tools like Cursor or ChatGPT, use the appropriate URL as 1. **Identify Your Use Case**: Determine whether you need comprehensive or essential documentation coverage 2. **Choose Your AI Tool**: Select the AI platform you want to integrate with Flow Data Sources -3. **Follow Integration Guides**: Use the specific tutorial for your chosen AI tool (ChatGPT, Gemini, Cursor, Claude Code, etc.) -4. **Test and Validate**: Verify the integration works by asking Flow-specific development questions +3. **Follow Integration Guides**: Use the specific tutorial for your chosen AI tool (ChatGPT, Gemini, Cursor, Claude Code, and so on.) +4. **Test and Validate**: Ask Flow-specific development questions to verify that the integration works. -The Flow Data Sources repository represents a powerful resource for enhancing AI-assisted Flow development, providing comprehensive and current knowledge that adapts to the rapidly evolving Flow ecosystem. +The Flow Data Sources repository represents a powerful resource to enhance AI-assisted Flow development, and provides comprehensive and current knowledge that adapts to the rapidly evolving Flow ecosystem. diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/index.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/index.md index b567cecbe6..51e24d45f5 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/index.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/index.md @@ -17,61 +17,61 @@ keywords: # Use Flow Knowledge Base in Cursor -[Cursor] is an AI code editor that makes it easy to write code while building Flow apps. This section provides comprehensive guidance on setting up and using Cursor with Flow's extensive documentation ecosystem to enhance your development experience. +[Cursor] is an AI code editor that makes it easy to write code while building Flow apps. This section provides comprehensive guidance on how to set up and use Cursor with Flow's extensive documentation ecosystem to enhance your development experience. ## Overview To get the most out of Cursor for Flow development, you'll need to understand three key components: -1. **Flow Data Sources** - The comprehensive knowledge base that powers AI assistance -2. **Documentation Indexing** - The process of making Flow documentation available within Cursor -3. **Cadence Rules** - Persistent AI context that provides specialized Flow development guidance +1. **Flow Data Sources** - The comprehensive knowledge base that powers AI assistance. +2. **Documentation Indexing** - The process of making Flow documentation available within Cursor. +3. **Cadence Rules** - Persistent AI context that provides specialized Flow development guidance. ## [Flow Data Sources] Learn about Flow's comprehensive, auto-generated documentation repository that serves as the foundation for AI-assisted development. This resource contains the most current information about Flow, Cadence, and the broader ecosystem, specifically formatted for optimal AI integration. The Flow Data Sources guide covers: -- What Flow Data Sources contains and how it's organized -- Different file formats available for various use cases -- Integration strategies with AI tools -- Best practices for leveraging this knowledge base +- What Flow Data Sources contains and how it's organized. +- Different file formats available for various use cases. +- Integration strategies with AI tools. +- Best practices for leveraging this knowledge base. ## [Indexing Flow Documentation in Cursor] -Follow the step-by-step process for setting up Flow documentation within Cursor's AI system. This detailed guide walks you through indexing multiple documentation sources to create a comprehensive Flow development environment. +Follow the step-by-step process for how to set up Flow documentation within Cursor's AI system. This detailed guide walks you through indexing multiple documentation sources to create a comprehensive Flow development environment. The indexing documentation covers: -- Adding Flow developer documentation to Cursor -- Integrating Cadence language documentation -- Including Flow Data Sources for comprehensive coverage -- Troubleshooting common indexing issues -- Best practices for using indexed documentation +- Adding Flow developer documentation to Cursor. +- Integrating Cadence language documentation. +- Including Flow Data Sources for comprehensive coverage. +- Troubleshooting common indexing issues. +- Best practices for using indexed documentation. ## [Cadence Rules] Learn how to use Cursor Rules to enhance AI assistance for Cadence and Flow development with persistent context and automated workflows. This comprehensive guide demonstrates how to create specialized rules that transform your AI assistant into a Flow development expert with continuous knowledge of syntax patterns, NFT standards, and project workflows. The Cadence Rules guide covers: -- Understanding Cursor Rules and how they provide persistent AI context -- Five specialized rules for Flow development: NFT standards, syntax patterns, development workflows, project configuration, and user preferences -- Creating custom rules for your specific Flow development needs -- Best practices for rule organization and team collaboration -- Integration with existing Flow development tools and documentation +- Understanding Cursor Rules and how they provide persistent AI context. +- Five specialized rules for Flow development: NFT standards, syntax patterns, development workflows, project configuration, and user preferences. +- Creating custom rules for your specific Flow development needs. +- Best practices for rule organization and team collaboration. +- Integration with current Flow development tools and documentation ## Getting Started -1. **Start with Flow Data Sources**: Understand what documentation is available and how it can enhance your development workflow -2. **Follow the Indexing Guide**: Set up your Cursor environment with comprehensive Flow documentation -3. **Configure Cadence Rules**: Implement persistent AI context for consistent Flow development assistance -4. **Practice with Examples**: Use the indexed documentation and rules to build Flow applications with enhanced AI assistance +1. **Start with Flow Data Sources**: Understand what documentation is available and how it can enhance your development workflow. +2. **Follow the Indexing Guide**: Set up your Cursor environment with comprehensive Flow documentation. +3. **Configure Cadence Rules**: Implement persistent AI context for consistent Flow development assistance. +4. **Practice with Examples**: Use the indexed documentation and rules to build Flow applications with enhanced AI assistance. ## Best Practices for Cursor + Flow -- **Use Specific References**: Target `@Flow`, `@Cadence`, or `@Flow Data Sources` based on your needs -- **Leverage Cursor Rules**: Apply `@cadence-nft-standards`, `@cadence-syntax-patterns`, or other specialized rules for consistent guidance -- **Combine Sources**: Leverage multiple documentation sources and rules for comprehensive assistance -- **Verify AI Output**: Cross-reference generated code with official documentation +- **Use Specific References**: Target `@Flow`, `@Cadence`, or `@Flow Data Sources` based on your needs. +- **Leverage Cursor Rules**: Apply `@cadence-nft-standards`, `@cadence-syntax-patterns`, or other specialized rules for consistent guidance. +- **Combine Sources**: Leverage multiple documentation sources and rules for comprehensive assistance. +- **Verify AI Output**: Cross-reference generated code with official documentation. - **Stay Updated**: Refresh your documentation indexes and rules periodically for current information This integrated approach combining comprehensive documentation indexing with persistent AI context through Cursor Rules provides you with consistent, accurate, and specialized assistance throughout your Flow development process. diff --git a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/indexing-docs.md b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/indexing-docs.md index bf58e6dbb6..d5a9d63dd5 100644 --- a/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/indexing-docs.md +++ b/docs/blockchain-development-tutorials/use-AI-to-build-on-flow/cursor/indexing-docs.md @@ -15,57 +15,57 @@ keywords: # Indexing Flow Documentation in Cursor -[Cursor] is an AI code editor that makes it easy to write code while building Flow apps. To get the most accurate and helpful responses when developing Flow applications, you need to index the relevant Flow documentation within Cursor. This guide walks you through setting up comprehensive Flow knowledge in your Cursor environment. +[Cursor] is an AI code editor that makes it easy to write code while building Flow apps. To get the most accurate and helpful responses when developing Flow applications, you need to index the relevant Flow documentation within Cursor. This guide walks you through how to set up comprehensive Flow knowledge in your Cursor environment. ## Prerequisites -- [Cursor] installed on your system -- Active internet connection for documentation indexing -- Cursor Pro subscription (recommended for full documentation access) +- [Cursor] installed on your system. +- Active internet connection for documentation indexing. +- Cursor Pro subscription (recommended for full documentation access). ## Documentation Sources For optimal Flow development assistance, you'll want to index three key documentation sources: -1. **Flow Developer Documentation** - Official Flow blockchain and tooling documentation -2. **Cadence Language Documentation** - Complete Cadence programming language reference -3. **Flow Data Sources** - Comprehensive, auto-generated knowledge base with current practices +1. **Flow Developer Documentation** - Official Flow blockchain and tooling documentation. +2. **Cadence Language Documentation** - Complete Cadence programming language reference. +3. **Flow Data Sources** - Comprehensive, auto-generated knowledge base with current practices. ## Installation Steps ### Step 1: Access Documentation Settings -1. Open Cursor and navigate to **Settings** (or press `Cmd/Ctrl + ,`) -2. Go to **Features > Docs** -3. Click **"+ Add new doc"** to begin adding documentation sources +1. Open Cursor and navigate to **Settings** (or press `Cmd/Ctrl + ,`). +2. Go to **Features > Docs**. +3. Click **"+ Add new doc"** to begin adding documentation sources. ![Cursor Settings](./imgs/use-cursor-1.png) ### Step 2: Add Flow Developer Documentation 1. In the URL field, enter: `https://developers.flow.com/tools` - - **Note**: Use the `/tools` endpoint as it properly indexes all Flow documentation - - Cursor will automatically detect and crawl the entire Flow documentation site -2. Set the name as **"Flow"** -3. Click **"Confirm"** to add the documentation -4. Wait for the indexing process to complete + - **Note**: Use the `/tools` endpoint as it properly indexes all Flow documentation. + - Cursor will automatically detect and crawl the entire Flow documentation site. +2. Set the name as **"Flow"**. +3. Click **"Confirm"** to add the documentation. +4. Wait for the indexing process to complete. ![Cursor Settings](./imgs/use-cursor-2.png) ### Step 3: Add Cadence Language Documentation -1. Click **"+ Add new doc"** again +1. Click **"+ Add new doc"** again. 2. Enter the Cadence documentation URL: `https://cadence-lang.org/docs/` -3. Set the name as **"Cadence"** -4. Click **"Confirm"** to add the documentation -5. Allow time for indexing to complete +3. Set the name as **"Cadence"**. +4. Click **"Confirm"** to add the documentation. +5. Allow time for indexing to complete. ### Step 4: Add Flow Data Sources -1. Click **"+ Add new doc"** once more +1. Click **"+ Add new doc"** again. 2. Enter the Flow Data Sources URL: `https://github.com/onflow/Flow-Data-Sources/blob/main/merged_docs/all_merged.md` -3. Set the name as **"Flow Data Sources"** -4. Click **"Confirm"** to add the documentation +3. Set the name as **"Flow Data Sources"**. +4. Click **"Confirm"** to add the documentation. :::caution Resource Requirements @@ -76,19 +76,19 @@ The Flow Data Sources file is very large and comprehensive. For older developmen ### Step 5: Verify Indexing -1. Monitor the indexing progress in the **Docs** section of Cursor settings -2. Wait for all three documentation sources to show as "Indexed" or "Ready" -3. Indexing time varies depending on your internet connection and system performance +1. Monitor the indexing progress in the **Docs** section of Cursor settings. +2. Wait for all three documentation sources to show as "Indexed" or "Ready." +3. Indexing time varies depending on your internet connection and system performance. ## Using Indexed Documentation -Once indexing is complete, you can reference the documentation in your Cursor prompts: +After indexing finishes, you can reference the documentation in your Cursor prompts: ### Reference Syntax -- `@Flow` - Reference Flow developer documentation -- `@Cadence` - Reference Cadence language documentation -- `@Flow Data Sources` - Reference the comprehensive Flow knowledge base +- `@Flow` - Reference Flow developer documentation. +- `@Cadence` - Reference Cadence language documentation. +- `@Flow Data Sources` - Reference the comprehensive Flow knowledge base. ![Cursor Settings](./imgs/use-cursor-3.png) @@ -97,7 +97,7 @@ Once indexing is complete, you can reference the documentation in your Cursor pr ``` @Flow How do I deploy a contract to Flow Testnet? -@Cadence What's the syntax for creating a resource in Cadence? +@Cadence What's the syntax for how to create a resource in Cadence? @Flow Data Sources How do I implement a marketplace for NFTs with royalties? ``` @@ -128,48 +128,48 @@ Using @Flow and @Cadence, help me create a transaction that deploys an NFT contr ### Common Issues and Solutions **Documentation Not Indexed**: -- Verify all URLs are correct and accessible -- Check your internet connection stability -- Try re-adding the documentation source +- Verify all URLs are correct and accessible. +- Check your internet connection stability. +- Try to re-add the documentation source. **Outdated Information**: -- Refresh documentation by removing and re-adding sources -- Clear Cursor's cache if available in settings -- Update to the latest version of Cursor +- Remove and re-add sources to refresh documentation. +- Clear Cursor's cache if available in settings. +- Update to the latest version of Cursor. **Slow or Failed Indexing**: -- Ensure stable internet connection -- Try indexing during off-peak hours -- For Flow Data Sources, switch to the essentials merged file if needed +- Verify stable internet connection. +- Try to index during off-peak hours. +- For Flow Data Sources, switch to the essentials merged file if needed. **Inaccurate AI Responses**: -- Verify the documentation sources are properly indexed -- Try more specific prompts with clear context -- Cross-reference responses with official documentation +- Verify the documentation sources are properly indexed. +- Try more specific prompts with clear context. +- Cross-reference responses with official documentation. ### Getting Help -If you continue experiencing issues: +If you continue to experience issues: -1. Check the [Cursor documentation] for additional troubleshooting steps -2. Verify that all documentation URLs are accessible in your browser -3. Contact Cursor support through their official channels -4. Consider using alternative documentation sources if specific URLs are problematic +1. Check the [Cursor documentation] for additional troubleshooting steps. +2. Verify that all documentation URLs are accessible in your browser. +3. Contact Cursor support through their official channels. +4. Consider using alternative documentation sources if specific URLs are problematic. ## Maintaining Your Setup ### Regular Maintenance -- **Refresh Periodically**: Re-index documentation monthly to ensure current information -- **Monitor Updates**: Stay aware of major Flow or Cadence documentation updates -- **Clean Up**: Remove unused documentation sources to improve performance +- **Refresh Periodically**: Re-index documentation monthly to ensure current information. +- **Monitor Updates**: Stay aware of major Flow or Cadence documentation updates. +- **Clean Up**: Remove unused documentation sources to improve performance. ### Team Collaboration For development teams: -- Share the same documentation configuration across team members -- Document your specific setup in your project README -- Consider creating team-specific documentation sources for internal patterns and practices +- Share the same documentation configuration across team members. +- Document your specific setup in your project README. +- Consider creating team-specific documentation sources for internal patterns and practices. By following this setup guide, you'll have comprehensive Flow and Cadence documentation available directly within Cursor, enabling more accurate AI assistance and faster development workflows.