Nyvo Docs
  • Introduction
  • Overview
    • Mission
    • Vision
  • The Product
    • Key Features
      • AI-Powered Prompt Interface
      • Full-Stack dApp Generation
      • One-Click Deployment
      • High-Performance Blockchain Support
      • Customizable UI & Theming
      • Integration and Composability
      • Developer-Friendly Export and Extension
      • Built-in Wallet & Identity Solutions
    • Use Cases and Examples
      • DeFi and Token Launchpads
      • NFT Marketplaces and Games
      • DAOs and Governance Platforms
      • Social and Utility dApps
      • Enterprise and Real-World Asset Apps
  • How Nyvo works
    • 1. Natural Language Understanding
    • 2. Solution Planning
    • 3. Smart Contract Code Generation
    • 4. Automated Testing & Validation
    • 5. Frontend Generation
    • 6. User Review and Iteration
    • 7. Deployment to Blockchain
    • Conclusion
  • Platform Architecture
    • Nyvo Studio
    • AI Orchestration Engine
    • Code Generation Models
      • Smart Contract Generator
      • Frontend/UI Generator
      • Documentation & Instruction Generator
    • Template & Module Library
    • Compilation & Testing Sandbox
    • Hosting Infrastructure
    • Data Storage & Security
  • Developer Guide & API
    • Architectural Overview
      • Program Deployment
      • Wallet Interactions & Security
      • UI Binding to On-Chain Data
      • Integration with Solana Runtime
    • Building dApps with Nyvo: Step-by-Step Guide
      • 1. Define the dApp Prompt
      • 2. Configuration & Module Selection
      • 3. Program Generation and Deployment
      • 4. Front-End Generation and Binding
      • 5. Testing the dApp
      • 6. Deployment to Production
  • Supported dApp Modules
    • Staking Module
    • Marketplace Module
    • Launchpad Module
    • Governance Module
    • Other Utility Modules
  • API and Abstraction Layers
    • Smart Contract Abstraction
    • Transaction Management API
    • Front-End and UI Components
    • Security Considerations in the API
  • Infrastructure & Performance
    • Deterministic Address Derivation (PDAs)
    • Transaction Simulation and Compute Units
    • Solana Fee Model and Cost Prediction
  • Rent-Exemption and Storage Costs
  • Combining Modules and Cross-Program Interactions
  • Best Practices: Security, Testing, and Maintenance
  • Pricing & Revenue Projection
    • Target Market & Addressable Users
    • Pricing Model & Tiers
      • Freemium (Free Tier)
      • Premium (Subscription Tier)
      • Lifetime (One-Time Purchase)
    • User Adoption Forecast
    • Revenue Projections
    • Marketing & Acquisition Channels
    • Expansion Plans & Future Monetization
  • Prompt Engineering
    • Key Strategies for Effective Solana-Focused Prompts
      • Set the AI’s Role and Context Upfront
      • Be Clear and Specific in Your Request
      • Provide Context from Your Project
      • Structure Prompts for Both Code and Explanations
      • Take an Iterative Approach
    • Building a Prompt Library
    • Debugging and Refining AI Outputs
    • Examples for Common dApp Scenarios
      • Example 1: Staking Dashboard dApp
      • Example 2: NFT Marketplace / Platform
      • Example 3: Crowdfunding (Fundraising) dApp
    • Final Tips
  • Legal & Socials
    • The Nyvo Whitepaper
    • Legal Disclaimer
    • Socials
Powered by GitBook
On this page
  1. Prompt Engineering
  2. Key Strategies for Effective Solana-Focused Prompts

Structure Prompts for Both Code and Explanations

PreviousProvide Context from Your ProjectNextTake an Iterative Approach

Last updated 1 month ago

CtrlK

Since Nyvo generates not just on-chain code but also off-chain code (and possibly even deployment scripts or config), it helps to structure your prompt so the AI cleanly outputs multiple components. For example, you might instruct: “Provide the Anchor program code and the React front-end code, each in separate markdown code blocks with appropriate file names or comments indicating the file.” This tells the AI to organize the response in a readable way. Some prompting patterns to consider:

  • File-by-file prompts: If you want the output separated (one for program.rs, one for App.jsx, etc.), explicitly ask for that. For example: “First, show the Solana program code (Rust, Anchor) in a rust code block, then the front-end code in a tsx block.” The AI can sometimes follow such formatting instructions to make the result easier to navigate.

  • Ask for comments and docs: To help you understand the AI-generated code, include in your prompt “Add comments to explain each major section of the code” or “Include docstrings or inline comments for clarity.” Well-commented code is easier to debug and maintain. Nyvo’s output can then serve as not only code but also a bit of documentation for you. For instance, asking the AI to // explain why certain checks are done in the code can yield helpful inline comments.

  • Specify frameworks/libraries: Solana development often involves specific libraries (e.g., @solana/web3.js for JavaScript, anchor-lang for Rust, or Metaplex APIs for NFTs). If your dApp needs an integration (for example, using the Metaplex NFT standard or Serum for a DEX), mention those by name. This ensures the AI brings in the correct usage patterns or SDK calls in the generated code, rather than something generic.

By structuring your prompt and including these details, you’re effectively giving the AI a blueprint to follow. It can then fill in the sections with code accordingly, increasing the chance that nothing important is omitted.