convex-suggest

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- GENERATED from convex-agents content/capabilities/suggest.json — do not edit by hand. -->
<!-- 由 convex-agents content/capabilities/suggest.json 生成 — 请勿手动编辑。 -->

Proactively suggest the right Convex component

主动推荐合适的Convex组件

When you see code or intent that duplicates what a Convex component already does, surface a targeted suggestion: ONE component, WHY (anchored in the user's own code or ask), and a concrete install hint. Never install without explicit consent. Never suggest more than one component at a time unless the user asks.
当你发现用户的代码或需求与某个Convex组件已实现的功能重复时,给出针对性的推荐:仅推荐一个组件,说明推荐原因(结合用户的代码或需求),并提供具体的安装提示。未经用户明确许可,绝不自动安装组件。除非用户要求,否则一次绝不推荐多个组件。

Workflow

工作流程

  1. Observe the codeSnippets and userAsk passively — never block the current task to suggest.
  2. Match against the detector rules (see generators/suggest-detector.mjs): email/SMTP → resend; push notifications → expo-push; setInterval/cron → @convex-dev/crons; shared counter increments → @convex-dev/sharded-counter; .collect().length scans → @convex-dev/aggregate; multi-step/long-running actions → @convex-dev/workflow; bounded concurrency → @convex-dev/workpool; rate-limit counters in DB → @convex-dev/rate-limiter; fs.write/S3 uploads → Convex Storage; Elasticsearch/Algolia → built-in full-text search; presence/typing → @convex-dev/presence; Pinecone/external vector DB → @convex-dev/rag; collaborative editing → @convex-dev/prosemirror-sync.
  3. After finishing the current task, offer ONE suggestion: name the component, quote the specific code or phrase that triggered it, explain why the component fits better.
  4. If the user says yes: run
    /add <component>
    or follow the installHint from the detector.
  5. If the user says no or ignores it: drop it. Do not repeat the same suggestion.
  1. 被动观察代码片段和用户需求——绝不打断当前任务进行推荐。
  2. 匹配检测器规则(详见 generators/suggest-detector.mjs):电子邮件/SMTP → resend;推送通知 → expo-push;setInterval/定时任务 → @convex-dev/crons;共享计数器递增 → @convex-dev/sharded-counter;.collect().length 扫描 → @convex-dev/aggregate;多步骤/长时间运行的操作 → @convex-dev/workflow;有限并发 → @convex-dev/workpool;数据库中的速率限制计数器 → @convex-dev/rate-limiter;fs.write/S3 上传 → Convex Storage;Elasticsearch/Algolia → 内置全文搜索;在线状态/输入状态 → @convex-dev/presence;Pinecone/外部向量数据库 → @convex-dev/rag;协同编辑 → @convex-dev/prosemirror-sync。
  3. 完成当前任务后,给出一个推荐:说明组件名称,引用触发推荐的具体代码或语句,解释该组件更适用的原因。
  4. 如果用户同意:运行
    /add <component>
    或遵循检测器提供的安装提示。
  5. 如果用户拒绝或忽略推荐:不再提及。不得重复相同的推荐。

Rules

规则

  • Passive — never interrupt the current task; surface the suggestion AFTER completing what the user asked.
  • One at a time — pick the highest-priority match; do not dump a list of five components.
  • Cite WHY from the user's own code or ask — 'I noticed you wrote
    post.likes + 1
    in a mutation that many users call concurrently; that causes OCC conflicts at scale.'
  • Never install without explicit consent — suggest, explain, wait for a yes.
  • Do not suggest a component the user has already installed.
  • Do not fire on generic coding questions unrelated to Convex (sorting arrays, writing CSS, etc.).
  • 被动式——绝不打断当前任务;仅在完成用户请求后给出推荐。
  • 一次一个——选择优先级最高的匹配项;不得一次性列出多个组件。
  • 结合用户自身代码或需求说明原因——例如:“我注意到你在一个多用户并发调用的mutation中写了
    post.likes + 1
    ;这在大规模场景下会导致OCC冲突。”
  • 未经明确许可绝不安装——先推荐、解释,等待用户同意。
  • 不得推荐用户已安装的组件。
  • 对于与Convex无关的通用编程问题(如数组排序、CSS编写等),不触发推荐。