ask-mcp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DeepWiki Research

DeepWiki 研究

Query repositories via DeepWiki MCP to answer technical questions with precise, source-backed answers.
通过DeepWiki MCP查询代码仓库,获取有精准源码支撑的技术问题答案。

Workflow

工作流程

  1. Clarify intent
    • Recommend plan mode, if it's not activated
    • Use
      AskUserQuestion
      to resolve blind spots
    • All questions must be resolved before execution
  2. Identify references and skills
    • Match task to execution steps below
    • Locate relevant documentation and examples
  3. Write plan file (YAML task format)
    • Use
      AskUserQuestion
      for anything unclear — never guess or assume
    • Identify blockers: permissions, dependencies, unknowns
    • Plan must be complete before execution begins
  4. Execute
    • Use
      Task
      tool with subagents for parallel research
    • Subagents load skills via
      Skill
      tool
    • Track progress with
      TodoWrite
  5. When stuck: spawn subagent with
    Read
    ,
    Glob
    ,
    Grep
    , DeepWiki MCP access and load
    skills/ask-mcp
  1. 明确意图
    • 如果未激活计划模式,推荐启用该模式
    • 使用
      AskUserQuestion
      工具解决信息盲区
    • 执行前必须解决所有疑问
  2. 识别参考资料与技能
    • 将任务与下方的执行步骤匹配
    • 定位相关文档与示例
  3. 编写计划文件(YAML任务格式)
    • 任何不明确的内容都使用
      AskUserQuestion
      工具确认——绝不猜测或假设
    • 识别阻碍因素:权限、依赖项、未知内容
    • 计划必须完整才能开始执行
  4. 执行任务
    • 使用
      Task
      工具结合子Agent进行并行研究
    • 子Agent通过
      Skill
      工具加载技能
    • 使用
      TodoWrite
      跟踪进度
  5. 遇到阻塞时:创建具备
    Read
    Glob
    Grep
    、DeepWiki MCP访问权限的子Agent,并加载
    skills/ask-mcp
    技能

Execution Steps

执行步骤

1. Read Required Context in Local Repo

1. 读取本地仓库中的必要上下文

Use
/init
skill and index current repository, if you have not already
如果尚未初始化,使用
/init
技能并索引当前代码仓库

2. Identify Question Scope

2. 确定问题范围

Determine the domain:
  • Programs, client SDKs, architecture, implementation details
  • Specific components (LightAccount, ValidityProof, CPI, etc.)
明确问题所属领域:
  • 程序、客户端SDK、架构、实现细节
  • 特定组件(LightAccount、ValidityProof、CPI等)

2. Fetch Repository Context

2. 获取仓库上下文

Select the appropriate repository based on question scope:
Light Protocol (compressed accounts, state trees, ZK compression, Light SDK)
mcp__deepwiki__read_wiki_structure("Lightprotocol/light-protocol")
mcp__deepwiki__read_wiki_contents("Lightprotocol/light-protocol")
mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "your question")
Solana Development (programs, accounts, general Solana)
mcp__deepwiki__read_wiki_structure("blueshift-gg/blueshift-dashboard")
mcp__deepwiki__read_wiki_contents("blueshift-gg/blueshift-dashboard")
mcp__deepwiki__ask_question("blueshift-gg/blueshift-dashboard", "your question")
Claude Code (CLI features, commands, configuration)
mcp__deepwiki__read_wiki_structure("anthropics/claude-code")
mcp__deepwiki__read_wiki_contents("anthropics/claude-code")
mcp__deepwiki__ask_question("anthropics/claude-code", "your question")
Agent Skills (skills, subagents, patterns)
mcp__deepwiki__read_wiki_structure("anthropics/skills")
mcp__deepwiki__read_wiki_contents("anthropics/skills")
mcp__deepwiki__ask_question("anthropics/skills", "your question")
根据问题范围选择合适的代码仓库:
Light Protocol(压缩账户、状态树、ZK压缩、Light SDK)
mcp__deepwiki__read_wiki_structure("Lightprotocol/light-protocol")
mcp__deepwiki__read_wiki_contents("Lightprotocol/light-protocol")
mcp__deepwiki__ask_question("Lightprotocol/light-protocol", "your question")
Solana开发(程序、账户、通用Solana相关)
mcp__deepwiki__read_wiki_structure("blueshift-gg/blueshift-dashboard")
mcp__deepwiki__read_wiki_contents("blueshift-gg/blueshift-dashboard")
mcp__deepwiki__ask_question("blueshift-gg/blueshift-dashboard", "your question")
Claude Code(CLI功能、命令、配置)
mcp__deepwiki__read_wiki_structure("anthropics/claude-code")
mcp__deepwiki__read_wiki_contents("anthropics/claude-code")
mcp__deepwiki__ask_question("anthropics/claude-code", "your question")
Agent技能(技能、子Agent、模式)
mcp__deepwiki__read_wiki_structure("anthropics/skills")
mcp__deepwiki__read_wiki_contents("anthropics/skills")
mcp__deepwiki__ask_question("anthropics/skills", "your question")

3. Apply Precision Rules

3. 遵循精准性规则

AVOID:
  • Vague verbs: "handles", "manages", "processes", "enables", "provides"
  • Abstract nouns: "operations", "management", "coordination"
  • -ing endings when a precise verb exists
  • Marketing language: "comprehensive", "rich", "seamless", "enables", "provides capability"
  • ZK terminology in user-facing docs: "inclusion proof", "non-inclusion proof" → Instead describe what it does: "prove the address doesn't exist", "prove the account hash exists"
  • Generic descriptions: "account metadata" instead of "CompressedAccountMeta"
USE:
  • Exact function/method names
  • Concrete data structures
  • Specific operations: "sets discriminator", "creates hash", "nullifies account"
  • File:line references
  • "reference" when describing u8 indices that reference accounts in the accounts array (standard Solana terminology)
  • "CPI" as a verb (e.g., "CPIs the Account Compression Program")
  • Technical method/function names used as verbs when contextually clear
Describe exactly what happens.
需避免:
  • 模糊动词:如‘处理’、‘管理’、‘实现’、‘提供’等
  • 抽象名词:如‘操作’、‘管理’、‘协调’等
  • 已有精准动词时使用-ing形式的表述
  • 营销类话术:如‘全面的’、‘丰富的’、‘无缝的’、‘实现’、‘提供能力’等
  • 用户文档中使用ZK术语:如‘包含证明’、‘不包含证明’ → 改为描述其功能:‘证明地址不存在’、‘证明账户哈希存在’
  • 通用描述:如用‘账户元数据’代替具体的‘CompressedAccountMeta’
需使用:
  • 精确的函数/方法名称
  • 具体的数据结构
  • 特定操作:如‘设置鉴别符’、‘创建哈希’、‘作废账户’等
  • 文件:行号引用
  • 描述账户数组中u8索引时使用‘引用’(符合Solana标准术语)
  • 将"CPI"用作动词(例如‘向Account Compression Program发起CPI调用’)
  • 上下文明确时,将技术方法/函数名称用作动词
准确描述实际发生的操作。

4. Format Response

4. 格式化响应

Structure answers with:
  • Technical precision
  • Code examples with inline comments
  • Source references (file paths, line numbers)
回答需包含以下结构:
  • 技术精准性
  • 带有行内注释的代码示例
  • 来源引用(文件路径、行号)

Example Output

示例输出

Question: What do you include in instruction data for compressed account creation?
Answer:

问题:创建压缩账户时,指令数据中包含哪些内容?
回答:

Compressed Account Creation Instruction Data

压缩账户创建指令数据

Instruction data contains three components for proof verification and tree coordination.
Components:
rust
pub struct InstructionData {
    proof: ValidityProof,
    address_tree_info: PackedAddressTreeInfo,
    output_state_tree_index: u8,
    // + custom account data
}
1. Non-inclusion proof
  • ValidityProof
    proves the derived address does not exist in the specified address tree
  • Client generates via
    getValidityProof()
    RPC call
2. Tree location parameters
  • PackedAddressTreeInfo
    : Specifies which address tree registers the address (u8 index, not pubkey)
  • output_state_tree_index
    : Specifies which state tree stores the compressed account hash
3. Custom account data
  • Program-specific fields (e.g.,
    message: String
    , user data)
Execution flow:
  1. Address tree proves uniqueness, stores address
  2. State tree stores account hash
  3. ValidityProof cryptographically guarantees address is unused
Why separate trees:
Compressed accounts require client-generated cryptographic proof that address doesn't exist (unlike regular Solana where runtime checks PDA existence). Address trees enforce uniqueness; state trees store account hashes.
Packed structs use
u8
indices to reference accounts in
remaining_accounts
, reducing transaction size.
指令数据包含三个用于证明验证和树协调的组件。
组件:
rust
pub struct InstructionData {
    proof: ValidityProof,
    address_tree_info: PackedAddressTreeInfo,
    output_state_tree_index: u8,
    // + 自定义账户数据
}
1. 非存在性证明
  • ValidityProof
    用于证明派生地址未存在于指定的地址树中
  • 客户端通过
    getValidityProof()
    RPC调用生成该证明
2. 树位置参数
  • PackedAddressTreeInfo
    :指定注册地址的地址树(使用u8索引,而非公钥)
  • output_state_tree_index
    :指定存储压缩账户哈希的状态树
3. 自定义账户数据
  • 程序特定字段(例如
    message: String
    、用户数据)
执行流程:
  1. 地址树验证唯一性并存储地址
  2. 状态树存储账户哈希
  3. ValidityProof通过密码学方式保证地址未被使用
为何使用分离的树结构:
压缩账户需要客户端生成密码学证明来验证地址不存在(与常规Solana不同,常规Solana由运行时检查PDA是否存在)。地址树确保唯一性;状态树存储账户哈希。
打包结构体使用u8索引引用
remaining_accounts
中的账户,从而减少交易大小。