资讯动态

Fabric suggest_pattern 模式深度解析:让 AI 帮你从 200+ 模式中选出最合适的 Prompt

发布时间:2026/9/10 3:57:53 来源:尧图企业网站定制
Fabric suggest_pattern 模式深度解析让 AI 帮你从 200 模式中选出最合适的 Prompt【免费下载链接】FabricFabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.项目地址: https://gitcode.com/GitHub_Trending/fa/Fabric导读data/patterns/suggest_pattern/system.md 是 Fabric 框架中的suggest_pattern模式定义。它把一个模式推荐器封装成可复用的 AI 提示词当你不确定该用哪个模式处理当前任务时把需求喂给fabric --pattern suggest_patternAI 会解析你的意图、按 20 个类别匹配最合适的 13 个模式并给出可直接运行的fabric --pattern 名称命令。读完本文你将掌握该模式的完整系统提示词结构、类别与模式对照关系、推荐的组合工作流以及-p/-s/-m/-C/-l等核心参数的真实底层行为。suggest_pattern 模式是什么身份与定位suggest_pattern是一个元模式meta-pattern它的输入是用户对任务的描述输出是对 Fabric 模式的推荐。其系统提示词在开篇即声明了自己的职责You are an expert AI assistant specialized in the Fabric framework... Your primary responsibility is to analyze user requests and suggest the most appropriate fabric patterns or commands to accomplish their goals.这意味着它不属于 ANALYSIS、SUMMARIZE 这类处理内容的模式而是帮助使用者导航整个模式库的工具。它的存在本身也被列入 AI 类别中suggest_pattern - Recommend Fabric patterns based on user requirements见 data/patterns/suggest_pattern/user.md。四步处理流程STEPS系统提示词把推荐过程拆解为四个明确步骤ANALYZE USER INPUT解析用户输入先理解用户的主要目标判断输入内容类型文本、代码、数据等确定期望的输出格式并考虑用户对 Fabric 的熟练程度。从源码看这一步最终落地的就是模式库的查找——internal/plugins/db/fsdb/patterns.go 中的GetApplyVariables/GetWithoutVariables会把用户的{{input}}注入模式模板而用户输入正是通过 stdin 或命令行参数传入见 internal/cli/flags.go 对 stdin 与 position argument 的处理。CATEGORIZE THE REQUEST归类请求把请求匹配到 20 个主类别AI、ANALYSIS、BILL、BUSINESS、CLASSIFICATION、CONVERSION、CR THINKING、CREATIVITY、DEVELOPMENT、DEVOPS、EXTRACT、GAMING、LEARNING、OTHER、RESEARCH、REVIEW、SECURITY、SELF、STRATEGY、SUMMARIZE、VISUALIZE、WISDOM、WELLNESS、WRITING。这一分类体系是推荐算法的骨架。SUGGEST APPROPRIATE PATTERNS推荐合适模式基于分析推荐 13 个最合适的模式优先覆盖用户核心目标同时考虑达到同一目标的不同路径必要时给出主推与备选。PROVIDE CONTEXT AND USAGE给出上下文与用法解释每个推荐模式的理由附上精确的fabric --pattern pattern_name命令语法说明注意事项与限制并在适用时建议互补模式。类别到模式的完整对照表系统提示词内置了一张常见请求类型 → 最佳模式的映射表PATTERN MATCHING GUIDELINES这是推荐的核心依据。以下完整继承该表并补全关键说明类别代表模式节选完整列表见源码AIai、create_art_prompt、create_pattern、improve_prompt、judge_output、rate_ai_response、rate_ai_result、raw_query、suggest_pattern、summarize_promptANALYSISanalyze_answers、analyze_bill、analyze_claims、analyze_debate、analyze_paper、analyze_patent、analyze_prose、compare_and_contrast、check_falsifiability、find_logical_fallacies等BILLanalyze_bill、analyze_bill_shortBUSINESScheck_agreement、concall_summary、create_formal_email、create_hormozi_offer、create_prd、create_upgrade_pack、extract_business_ideas等CLASSIFICATIONapply_ul_tagsCONVERSIONclean_text、convert_to_markdown、create_slides、export_data_as_csv、humanize、to_flashcards、translate、write_latex等CR THINKINGaudit_consent、audit_transparency、detect_mind_virus、extract_alpha、find_logical_fallacies、t_red_team_thinking等CREATIVITYcreate_mnemonic_phrases、write_essayDEVELOPMENTagility_story、coding_master、create_coding_feature、create_coding_project、create_command、create_git_diff_commit、create_prd、explain_code、review_code、review_design、summarize_git_diff、suggest_pattern等DEVOPSanalyze_terraform_planEXTRACTextract_affiliate_products、extract_alpha、extract_article_wisdom、extract_ideas、extract_insights、extract_patterns、extract_references、extract_wisdom等GAMINGcreate_npc、create_rpg_summary、summarize_rpg_sessionLEARNINGanalyze_answers、create_flash_cards、create_quiz、explain_code、explain_math、summarize_lecture、summarize_paper等OTHERextract_jokesRESEARCHanalyze_candidates、analyze_claims、analyze_paper、analyze_patent、capture_thinkers_work、extract_references、summarize_paper、write_latex等REVIEWanalyze_cfp_submission、analyze_prose、judge_output、label_and_rate、rate_ai_response、rate_content、review_code等SECURITYanalyze_email_headers、analyze_incident、analyze_malware、analyze_threat_report、create_sigma_rules、create_stride_threat_model、greybeard_secure_prompt_engineer、write_hackerone_report等SELFanalyze_mistakes、create_better_frame、extract_wisdom、heal_person、provide_guidance、recommend_yoga_practice等STRATEGYanalyze_military_strategy、prepare_7s_strategy、t_find_blindspots、t_red_team_thinking等SUMMARIZEcapture_thinkers_work、create_5_sentence_summary、create_summary、summarize、summarize_debate、summarize_meeting、summarize_paper、youtube_summary等VISUALIZEcreate_conceptmap、create_excalidraw_visualization、create_mermaid_visualization、create_slides、create_visualization等WISDOMextract_alpha、extract_article_wisdom、extract_insights、extract_wisdom、extract_wisdom_with_attribution等WELLNESSanalyze_spiritual_text、heal_person、recommend_yoga_practice、t_give_encouragement等WRITINGapply_ul_tags、clean_text、create_academic_paper、fix_typos、humanize、improve_writing、tweet、write_essay、write_micro_essay等说明表中为各类别代表性条目系统提示词原文对每类都列出了完整模式清单字段可直接在 data/patterns/suggest_pattern/system.md 中查阅user.md 中还按 AI、ANALYSIS、EXTRACTION、SUMMARIZATION、WRITING、DEVELOPMENT、SECURITY、BUSINESS、LEARNING、VISUALIZATION、CONVERSION、STRATEGY、PERSONAL DEVELOPMENT、CREATIVITY、GAMING、OTHER、WELLNESS 等分组给出了每个模式的一句话功能简介见 data/patterns/suggest_pattern/user.md。组合工作流建议系统提示词还内置了三条工作流建议用于覆盖单模式无法胜任的复杂任务复杂分析先使用一个 extract 模式再使用 analyze 模式最后使用 summarize 模式内容创作先使用相关的 create_ 系列模式再用 improve_ 系列模式进行润色研究项目按 extract_、analyze_、summarize_ 的顺序串联使用。输出规范让推荐可执行系统提示词对输出格式提出了明确约束这也是评判推荐质量的标准只输出 Markdown用清晰的标题与小节组织回答给出具体的命令示例fabric --pattern pattern_name附带每个模式的简短说明多个模式可用时按相关性排序复杂请求建议用多模式工作流若现有模式都不完全匹配建议使用create_pattern并提供具体指引详见 data/patterns/create_pattern/system.md 与配套的 data/patterns/create_pattern/user.md输出要可行动、易跟随让 Fabric 更易用、更强大。如何实际运行 suggest_pattern前置准备首次使用先运行fabric --setup即-S完成初始化。从源码看初始化会触发 internal/tools/patterns_loader.go 的Setup()与PopulateDB()从默认仓库https://github.com/danielmiessler/fabric.git的data/patterns目录拉取全部模式到本地配置目录并生成unique_patterns.txt索引文件。查看可用模式fabric --listpatterns-l。在 internal/cli/listing.go 中该命令读取模式名称列表并输出若本地尚无模式会打印引导提示告诉你运行--setup或--updatepatterns。更新模式到最新fabric --updatepatterns-U。核心用法示例# 用管道把任务描述喂给 suggest_pattern echo 我想从一段采访视频中提炼人生智慧 | fabric --pattern suggest_pattern # 或者直接在命令行传参 fabric --pattern suggest_pattern 帮我分析一份合同的风险点 # 查看某个模式的完整内容便于自行判断是否合适 fabric --readpattern analyze_claims # 流式输出推荐结果即时反馈 echo 总结这篇论文的核心发现 | fabric -p suggest_pattern -s推荐结果的落地suggest_pattern给出的推荐本身就是命令模板例如它可能建议echo 内容 | fabric --pattern extract_wisdom echo 内容 | fabric --pattern analyze_claims echo 内容 | fabric --pattern summarize把这些命令复制执行即完成推荐 → 使用的闭环。理解模式装载与优先级推荐结果的底层支撑系统提示词与用户输入如何组装当执行fabric --pattern suggest_pattern时internal/core/chatter.go 的BuildSession会执行以下组装若有-C上下文先读取对应 Context 文件内容调用o.db.Patterns.GetApplyVariables(patternName, variables, input)加载模式文件见 internal/plugins/db/fsdb/patterns.go把{{input}}占位符替换为用户输入若用户输入不含{{input}}占位符ensureInput会自动把输入追加到模式末尾internal/plugins/db/fsdb/patterns.go上下文 模式内容作为 system message 拼接用户输入作为 user message 发送给模型internal/core/chatter.go。也就是说suggest_pattern的推荐质量 系统提示词中的模式目录知识 用户输入 所用模型的推理能力。自定义模式目录让推荐覆盖私有模式如果你自建了模式可以让suggest_pattern的推荐空间更贴近实际# 存放自定义模式 mkdir -p ~/.config/custom-fabric-patterns # 把自建模式复制进 fabric 模式目录 cp -a ~/.config/custom-fabric-patterns/* ~/.config/fabric/patterns/ # 之后即可直接使用 pbpaste | fabric -p your_custom_pattern从源码看这套机制有双重保障internal/tools/custom_patterns/custom_patterns.go 会把~/展开为绝对路径目录不存在时自动创建0755 权限模式查找时自定义目录优先于主目录internal/plugins/db/fsdb/patterns.go 先检查CustomPatternsDir/name/system.md未命中才回退到主模式目录而 internal/tools/patterns_loader.go 的PersistPatterns在--updatepatterns拉取新版本时会保留自定义模式避免更新覆盖私有文件。模式变量给推荐注入约束系统提示词以{{input}}接收任务描述你也可以通过-v传入变量如-v#role:expert、-v#points:30。变量替换由 internal/plugins/template 完成替换逻辑见 internal/plugins/db/fsdb/patterns.go先把{{input}}替换为哨兵 token 防止递归解析再处理其余变量最后把哨兵还原为用户输入。常用参数速查下表整合了 user.md 中最常用参数与 internal/cli/flags.go 中真实的定义与默认值参数短参作用默认值/说明源码依据--pattern PATTERN-p指定要使用的模式提示词空若可执行文件名非 fabric会自动作为模式名flags.go--stream-s实时流式输出结果默认关闭流式路径见 chatter.go--updatepatterns-U更新模式库从默认 Git 仓库拉取data/patternspatterns_loader.go--model MODEL-m选择 AI 模型空可配合-V指定供应商--setup-S运行初始化配置所有可配置项布尔开关--listpatterns-l列出所有可用模式布尔开关无模式时会给出引导提示--context CONTEXT-C使用 Context 文件为模式补充背景空上下文与模式内容拼接为 system messagechatter.go--variable KEY:VALUE-v注入模式变量可多次传入如-v#role:expert--readpattern NAME—在终端打印指定模式的完整内容布尔开关listing.go--latest N-n列出最近 N 个模式默认0不列出listing.go--temperature-t采样温度默认0.7--topp-T核采样 top-p默认0.9--output FILE-o输出到文件空非空时同时打印并写入文件--language CODE-g指定回复语言空非en时会在 system message 追加语言约束chatter.go--strategy NAME—选择思维策略如 cot、tot空策略提示词拼接在模式内容之前--config PATH—指定 YAML 配置文件默认~/.config/fabric/config.yaml注意--update/-u在本文档语境中指代模式更新当前仓库中对应的正式参数是--updatepatterns/-U另有--scrape_url使用-u短参。使用时请以fabric --help输出为准。从源码理解推荐系统的两个边界推荐范围 本地模式库suggest_pattern的推荐依据是系统提示词中硬编码的模式清单。若你的本地模式库与提示词清单不一致例如通过自定义目录新增了模式推荐结果可能不包含最新模式——此时可结合fabric --listpatterns人工补查或用create_pattern补充缺失的模式。文件名解析特性internal/plugins/db/fsdb/patterns.go 中的LooksLikePatternFilePath显示以\、/、~、.开头的模式名会被当作文件路径直接读取。这意味着你甚至可以直接运行fabric --pattern /path/to/my/custom/system.md把任意符合 system/user 结构的提示词文件当模式用——这是 REST API 路由会拒绝、仅 CLI 开放的能力。小结suggest_pattern是 Fabric 生态中连接用户需求与模式库的智能路由层它用结构化的四步推理解析 → 归类 → 推荐 → 附用法把 200 模式的庞大目录变成可对话的助手。其系统提示词既是提示词工程的范本身份声明、分步 STEPS、类别映射表、输出约束一应俱全也直接支撑了让 Fabric 更易用、更强大的项目目标。配合--listpatterns、--readpattern、自定义模式目录与create_pattern你可以把推荐结果无缝接入自己的日常 AI 工作流。【免费下载链接】FabricFabric is an open-source framework for augmenting humans using AI. It provides a modular system for solving specific problems using a crowdsourced set of AI prompts that can be used anywhere.项目地址: https://gitcode.com/GitHub_Trending/fa/Fabric创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价