fabric by supercent-io/skills-template
npx skills add https://github.com/supercent-io/skills-template --skill fabricFabric 是由 Daniel Miessler 开发的开源 AI 提示词编排框架。它提供了一个可复用的 AI 提示词库,称为 模式 —— 每个模式都针对特定的现实世界任务而设计 —— 并通过简单的 Unix 标准输入/输出管道连接起来。
# macOS/Linux (一行命令)
curl -fsSL https://raw.githubusercontent.com/danielmiessler/fabric/main/scripts/installer/install.sh | bash
# macOS 通过 Homebrew
brew install fabric-ai
# Windows
winget install danielmiessler.Fabric
# 安装后 —— 配置 API 密钥和默认模型
fabric --setup
Fabric 作为 Unix 管道工作。通过标准输入提供内容并指定一个模式:
# 总结一个文件
cat article.txt | fabric -p summarize
# 实时流式输出
cat document.txt | fabric -p extract_wisdom --stream
# 将任何命令输出通过管道传输到模式
git log --oneline -20 | fabric -p summarize
# 处理剪贴板内容 (macOS)
pbpaste | fabric -p summarize
# 从 curl 管道传输
curl -s https://example.com/article | fabric -p summarize
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 列出所有可用模式
fabric -l
# 从仓库更新模式
fabric -u
# 通过关键词搜索模式
fabric -l | grep summary
fabric -l | grep code
fabric -l | grep security
关键模式:
| 模式 | 用途 |
|---|---|
summarize | 将任何内容总结为要点 |
extract_wisdom | 提取见解、引文、习惯和经验教训 |
analyze_paper | 将学术论文分解为可操作的见解 |
explain_code | 用通俗语言解释代码 |
write_essay | 根据主题或粗略笔记撰写文章 |
clean_text | 从原始文本中去除噪音和格式 |
analyze_claims | 事实核查并评估声明的可信度 |
create_summary | 创建结构化的 Markdown 总结 |
rate_content | 评估和评分内容质量 |
label_and_rate | 对内容进行分类和评分 |
improve_writing | 润色并提高文本清晰度 |
create_tags | 为内容生成相关标签 |
ask_secure_by_design | 审查代码或系统的安全问题 |
capture_thinkers_work | 提取思想家或作者的核心思想 |
create_investigation_visualization | 为复杂调查创建可视化地图 |
# 总结一个 YouTube 视频
fabric -y "https://youtube.com/watch?v=VIDEO_ID" -p summarize
# 从视频中提取关键见解
fabric -y "https://youtube.com/watch?v=VIDEO_ID" -p extract_wisdom
# 仅获取转录文本(不应用模式)
fabric -y "https://youtube.com/watch?v=VIDEO_ID" --transcript
# 带时间戳的转录文本
fabric -y "https://youtube.com/watch?v=VIDEO_ID" --transcript-with-timestamps
每个模式都是 ~/.config/fabric/patterns/ 目录下的一个文件夹,其中包含一个 system.md 文件。文件主体应遵循以下结构:
mkdir -p ~/.config/fabric/patterns/my-pattern
cat > ~/.config/fabric/patterns/my-pattern/system.md << 'EOF'
# IDENTITY AND PURPOSE
You are an expert at [task]. Your job is to [specific goal].
Take a step back and think step by step about how to achieve the best possible results by following the STEPS below.
# STEPS
1. [Step 1]
2. [Step 2]
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- [Format instruction 2]
- Do not give warnings or notes; only output the requested sections.
# INPUT
INPUT:
EOF
立即使用:
echo "input text" | fabric -p my-pattern
cat file.txt | fabric -p my-pattern --stream
# 作为 REST API 服务器运行(默认端口 8080)
fabric --serve
# 使用网络搜索功能
fabric -p analyze_claims --search "claim to verify"
# 在 ~/.config/fabric/.env 中配置每个模式的模型路由
FABRIC_MODEL_PATTERN_SUMMARIZE=anthropic|claude-opus-4-5
FABRIC_MODEL_PATTERN_EXTRACT_WISDOM=openai|gpt-4o
FABRIC_MODEL_PATTERN_EXPLAIN_CODE=google|gemini-2.0-flash
# 为常用模式创建 Shell 别名
alias summarize="fabric -p summarize"
alias wisdom="fabric -p extract_wisdom"
alias explain="fabric -p explain_code"
# 链式组合模式
cat paper.txt | fabric -p summarize | fabric -p extract_wisdom
# 保存输出
cat document.txt | fabric -p extract_wisdom > insights.md
Fabric 是 AI 代理的强大工具 —— 将任何工具的输出通过模式管道传输,进行智能分析:
# 分析测试失败
npm test 2>&1 | fabric -p analyze_logs
# 总结 git 历史以生成 PR 描述
git log --oneline origin/main..HEAD | fabric -p create_summary
# 解释代码差异
git diff HEAD~1 | fabric -p explain_code
# 总结构建错误
make build 2>&1 | fabric -p summarize
# 分析代码中的安全漏洞
cat src/auth.py | fabric -p ask_secure_by_design
# 处理日志文件
cat /var/log/app.log | tail -100 | fabric -p analyze_logs
将 Fabric 作为微服务运行,并从其他工具调用它:
# 启动服务器
fabric --serve --port 8080
# 通过 HTTP 调用
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"prompts":[{"userInput":"Summarize this","patternName":"summarize"}]}'
fabric -u 以获取最新的社区模式。--stream 以逐步查看结果,而不是等待。alias wisdom="fabric -p extract_wisdom")。~/.config/fabric/patterns/ 中 —— 它们会在更新后保留。每周安装量
397
仓库
GitHub 星标数
88
首次出现
2026年3月10日
安全审计
安装于
gemini-cli347
codex340
opencode327
github-copilot323
cursor323
kimi-cli322
Fabric is an open-source AI prompt orchestration framework by Daniel Miessler. It provides a library of reusable AI prompts called Patterns — each designed for a specific real-world task — wired into a simple Unix pipeline with stdin/stdout.
# macOS/Linux (one-liner)
curl -fsSL https://raw.githubusercontent.com/danielmiessler/fabric/main/scripts/installer/install.sh | bash
# macOS via Homebrew
brew install fabric-ai
# Windows
winget install danielmiessler.Fabric
# After install — configure API keys and default model
fabric --setup
Fabric works as a Unix pipe. Feed content through stdin and specify a pattern:
# Summarize a file
cat article.txt | fabric -p summarize
# Stream output in real time
cat document.txt | fabric -p extract_wisdom --stream
# Pipe any command output through a pattern
git log --oneline -20 | fabric -p summarize
# Process clipboard (macOS)
pbpaste | fabric -p summarize
# Pipe from curl
curl -s https://example.com/article | fabric -p summarize
# List all available patterns
fabric -l
# Update patterns from the repository
fabric -u
# Search patterns by keyword
fabric -l | grep summary
fabric -l | grep code
fabric -l | grep security
Key patterns:
| Pattern | Purpose |
|---|---|
summarize | Summarize any content into key points |
extract_wisdom | Extract insights, quotes, habits, and lessons |
analyze_paper | Break down academic papers into actionable insights |
explain_code | Explain code in plain language |
write_essay | Write essays from a topic or rough notes |
clean_text |
# Summarize a YouTube video
fabric -y "https://youtube.com/watch?v=VIDEO_ID" -p summarize
# Extract key insights from a video
fabric -y "https://youtube.com/watch?v=VIDEO_ID" -p extract_wisdom
# Get transcript only (no pattern applied)
fabric -y "https://youtube.com/watch?v=VIDEO_ID" --transcript
# Transcript with timestamps
fabric -y "https://youtube.com/watch?v=VIDEO_ID" --transcript-with-timestamps
Each pattern is a directory with a system.md file inside ~/.config/fabric/patterns/. The body should follow this structure:
mkdir -p ~/.config/fabric/patterns/my-pattern
cat > ~/.config/fabric/patterns/my-pattern/system.md << 'EOF'
# IDENTITY AND PURPOSE
You are an expert at [task]. Your job is to [specific goal].
Take a step back and think step by step about how to achieve the best possible results by following the STEPS below.
# STEPS
1. [Step 1]
2. [Step 2]
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- [Format instruction 2]
- Do not give warnings or notes; only output the requested sections.
# INPUT
INPUT:
EOF
Use it immediately:
echo "input text" | fabric -p my-pattern
cat file.txt | fabric -p my-pattern --stream
# Run as REST API server (port 8080 by default)
fabric --serve
# Use web search capability
fabric -p analyze_claims --search "claim to verify"
# Per-pattern model routing in ~/.config/fabric/.env
FABRIC_MODEL_PATTERN_SUMMARIZE=anthropic|claude-opus-4-5
FABRIC_MODEL_PATTERN_EXTRACT_WISDOM=openai|gpt-4o
FABRIC_MODEL_PATTERN_EXPLAIN_CODE=google|gemini-2.0-flash
# Create shell aliases for frequently used patterns
alias summarize="fabric -p summarize"
alias wisdom="fabric -p extract_wisdom"
alias explain="fabric -p explain_code"
# Chain patterns
cat paper.txt | fabric -p summarize | fabric -p extract_wisdom
# Save output
cat document.txt | fabric -p extract_wisdom > insights.md
Fabric is a powerful utility for AI agents — pipe any tool output through patterns for intelligent analysis:
# Analyze test failures
npm test 2>&1 | fabric -p analyze_logs
# Summarize git history for a PR description
git log --oneline origin/main..HEAD | fabric -p create_summary
# Explain a code diff
git diff HEAD~1 | fabric -p explain_code
# Summarize build errors
make build 2>&1 | fabric -p summarize
# Analyze security vulnerabilities in code
cat src/auth.py | fabric -p ask_secure_by_design
# Process log files
cat /var/log/app.log | tail -100 | fabric -p analyze_logs
Run Fabric as a microservice and call it from other tools:
# Start server
fabric --serve --port 8080
# Call via HTTP
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"prompts":[{"userInput":"Summarize this","patternName":"summarize"}]}'
fabric -u before first use and regularly to get the latest community patterns.--stream for long content to see results progressively instead of waiting.alias wisdom="fabric -p extract_wisdom") for your most-used patterns.~/.config/fabric/patterns/ — they persist across updates.Weekly Installs
397
Repository
GitHub Stars
88
First Seen
Mar 10, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
gemini-cli347
codex340
opencode327
github-copilot323
cursor323
kimi-cli322
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
54,900 周安装
| Remove noise and formatting from raw text |
analyze_claims | Fact-check and assess credibility of claims |
create_summary | Create a structured, markdown summary |
rate_content | Rate and score content quality |
label_and_rate | Categorize and score content |
improve_writing | Polish and improve text clarity |
create_tags | Generate relevant tags for content |
ask_secure_by_design | Review code or systems for security issues |
capture_thinkers_work | Extract the core ideas of a thinker or author |
create_investigation_visualization | Create a visual map of complex investigations |