shareful-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shareful Search

Shareful 搜索

This skill helps discover and apply existing coding solutions from shareful.ai.
该技能可帮助你从shareful.ai发现并应用已有的编码解决方案。

When to Use This Skill

何时使用该技能

Use this skill when the user:
  • Asks "has anyone solved this" or "is there a known fix for X"
  • Wants to search for existing solutions before deep debugging
  • Has an error message and wants likely fixes quickly
  • Needs a workaround for a framework/library gotcha
  • Wants proven patterns from real examples
当用户:
  • 询问“有没有人解决过这个问题”或“有没有针对X的已知修复方案”
  • 希望在深入调试前搜索已有的解决方案
  • 遇到错误信息,希望快速找到可能的修复方法
  • 需要针对框架/库的疑难问题寻找替代解决方法
  • 希望从真实案例中获取经过验证的解决方案模式

What is Shareful CLI Search?

什么是Shareful CLI搜索?

npx shareful-ai search
queries shareful.ai for existing shared solutions.
Key commands:
  • npx shareful-ai search [query]
    - Search by keywords
  • npx shareful-ai search [query] --type fix
    - Filter by solution type
  • npx shareful-ai search [query] --tags "tag1,tag2"
    - Filter by tags
  • npx shareful-ai search [query] --limit 10
    - Return more results
  • npx shareful-ai confirm <owner/repo/slug>
    - Report a share worked
  • npx shareful-ai confirm <owner/repo/slug> --failed
    - Report it didn't work
Browse shares at: https://shareful.ai/
npx shareful-ai search
命令可查询shareful.ai平台上的现有共享解决方案。
核心命令:
  • npx shareful-ai search [查询关键词]
    - 按关键词搜索
  • npx shareful-ai search [查询关键词] --type fix
    - 按解决方案类型过滤
  • npx shareful-ai search [查询关键词] --tags "tag1,tag2"
    - 按标签过滤
  • npx shareful-ai search [查询关键词] --limit 10
    - 返回更多结果
  • npx shareful-ai confirm <owner/repo/slug>
    - 报告该共享方案有效
  • npx shareful-ai confirm <owner/repo/slug> --failed
    - 报告该共享方案无效
浏览共享方案: https://shareful.ai/

How to Help Users Find Shares

如何帮助用户找到共享方案

Step 1: Understand What They Need

步骤1:明确用户需求

When a user asks for help, identify:
  1. The technology stack (framework, language, key libraries)
  2. The specific issue (error string, symptom, or behavior)
  3. The likely share type (
    fix
    ,
    workaround
    ,
    pattern
    ,
    reference
    ,
    config
    )
当用户寻求帮助时,需明确以下几点:
  1. 技术栈(框架、编程语言、核心库)
  2. 具体问题(错误字符串、症状或异常行为)
  3. 可能的共享方案类型(
    fix
    修复方案、
    workaround
    替代方法、
    pattern
    解决方案模式、
    reference
    参考示例、
    config
    配置示例)

Step 2: Search for Shares

步骤2:搜索共享方案

Run search with a focused query:
bash
npx shareful-ai search [query]
Examples:
  • User asks "how do I fix hydration mismatch?" ->
    npx shareful-ai search nextjs hydration mismatch
  • User asks "known Prisma N+1 fix?" ->
    npx shareful-ai search prisma n-plus-one --type fix
  • User asks "React stale closure issue" ->
    npx shareful-ai search react stale closure --tags "react,hooks"
使用精准的查询语句执行搜索:
bash
npx shareful-ai search [query]
示例:
  • 用户询问“如何修复hydration不匹配问题?” →
    npx shareful-ai search nextjs hydration mismatch
  • 用户询问“有没有已知的Prisma N+1问题修复方案?” →
    npx shareful-ai search prisma n-plus-one --type fix
  • 用户询问“React闭包过时问题” →
    npx shareful-ai search react stale closure --tags "react,hooks"

Step 3: Present Options to the User

步骤3:向用户展示候选方案

When you find relevant shares, present:
  1. Share title and solution type
  2. Why it matches the user issue
  3. Link to the share URL
Example response:
text
I found a likely match: "Fix Next.js hydration error with dynamic imports" [fix, verified].
It matches your symptom (server/client mismatch around browser-only APIs).

Share: https://shareful.ai/s/owner/repo/fix-nextjs-hydration-dynamic-imports
找到相关共享方案后,需向用户展示以下内容:
  1. 共享方案标题及方案类型
  2. 该方案与用户问题的匹配原因
  3. 共享方案的链接地址
回复示例:
text
我找到了一个匹配度较高的方案:“使用动态导入修复Next.js hydration错误” [fix, 已验证]。
该方案与你的问题症状匹配(仅浏览器端API导致的服务端/客户端不匹配问题)。

共享方案链接:https://shareful.ai/s/owner/repo/fix-nextjs-hydration-dynamic-imports

Step 4: Apply and Confirm

步骤4:应用方案并反馈结果

If the user wants to proceed:
  1. Apply the fix in their codebase
  2. Verify the original issue is resolved
  3. If fixed, confirm the share worked:
    bash
    npx shareful-ai confirm owner/repo/slug
  4. If it didn't work, report failure and try the next result:
    bash
    npx shareful-ai confirm owner/repo/slug --failed
如果用户决定使用该方案:
  1. 在代码库中应用该修复方案
  2. 验证原问题是否已解决
  3. 若问题解决,反馈该方案有效:
    bash
    npx shareful-ai confirm owner/repo/slug
  4. 若方案无效,反馈失败并尝试下一个结果:
    bash
    npx shareful-ai confirm owner/repo/slug --failed

Common Search Categories

常见搜索分类

CategoryExample Queries
React/Next.jshydration, server-components, suspense, ssr
Data/DBprisma, postgres, query, migration, n-plus-one
TypeScriptgenerics, module-augmentation, satisfies, inference
Build/Deploydocker, cache, ci, github-actions, vercel
Configurationeslint, tsconfig, env-vars, runtime
分类示例查询词
React/Next.jshydration、server-components、suspense、ssr
数据/数据库prisma、postgres、query、migration、n-plus-one
TypeScriptgenerics、module-augmentation、satisfies、inference
构建/部署docker、cache、ci、github-actions、vercel
配置eslint、tsconfig、env-vars、runtime

Tips for Effective Searches

高效搜索技巧

  1. Use specific keywords:
    nextjs hydration mismatch
    is better than
    nextjs error
  2. Include error fragments: Copy a unique part of the error text
  3. Try alternate terms:
    n+1
    ,
    n-plus-one
    ,
    relation loading
  4. Use filters: Narrow with
    --type
    and
    --tags
    when result sets are broad
  1. 使用精准关键词
    nextjs hydration mismatch
    nextjs error
    的搜索效果更好
  2. 包含错误片段:复制错误信息中独特的部分作为查询词
  3. 尝试替代术语:比如
    n+1
    n-plus-one
    relation loading
  4. 使用筛选器:当结果范围过宽时,使用
    --type
    --tags
    参数缩小范围

When No Shares Are Found

未找到匹配的共享方案时

If no relevant shares exist:
  1. Acknowledge no match was found
  2. Continue with direct debugging
  3. Suggest creating a new share via
    shareful-create
Example response:
text
I searched for matching shares but didn’t find a reliable result.
I can debug this directly and still get you unstuck.

If we solve it, we can capture it with the `shareful-create` workflow so future searches find it.
若未找到相关共享方案:
  1. 告知用户未找到匹配方案
  2. 继续直接调试问题
  3. 建议通过
    shareful-create
    命令创建新的共享方案
回复示例:
text
我搜索了匹配的共享方案,但未找到可靠结果。
我可以直接帮你调试问题,帮你解决困境。

如果我们解决了这个问题,可以通过`shareful-create`流程将方案保存为共享内容,方便后续搜索时能被找到。

Related Skills

相关技能

  • shareful-create
    for drafting a new SHARE.md after solving a new issue
  • shareful-create
    :解决新问题后,用于起草新的SHARE.md文档