Fabric
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.
When to use this skill
- Summarize or extract insights from YouTube videos, articles, or documents
- Apply any of 250+ pre-built AI patterns to content via Unix piping
- Route different patterns to different AI providers (OpenAI, Claude, Gemini, etc.)
- Create custom patterns for repeatable AI workflows
- Run Fabric as a REST API server for integration with other tools
- Process command output, files, or clipboard content through AI patterns
- Use as an AI agent utility β pipe any tool output through patterns for intelligent summarization
Instructions
Step 1: Install Fabric
curl -fsSL https://raw.githubusercontent.com/danielmiessler/fabric/main/scripts/installer/install.sh | bash
brew install fabric-ai
winget install danielmiessler.Fabric
fabric --setup
Step 2: Learn the core pipeline workflow
Fabric works as a Unix pipe. Feed content through stdin and specify a pattern:
cat article.txt | fabric -p summarize
cat document.txt | fabric -p extract_wisdom --stream
git log --oneline -20 | fabric -p summarize
pbpaste | fabric -p summarize
curl -s https://example.com/article | fabric -p summarize
Step 3: Discover patterns
fabric -l
fabric -u
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 |
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 |
Step 4: Process YouTube videos
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
Step 5: Create custom patterns
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
Step 6: Multi-provider routing and advanced usage
fabric --serve
fabric -p analyze_claims --search "claim to verify"
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
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
Step 7: Use in AI agent workflows
Fabric is a powerful utility for AI agents β pipe any tool output through patterns for intelligent analysis:
npm test 2>&1 | fabric -p analyze_logs
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
REST API server mode
Run Fabric as a microservice and call it from other tools:
fabric --serve --port 8080
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"prompts":[{"userInput":"Summarize this","patternName":"summarize"}]}'
Best practices
- Run
fabric -u before first use and regularly to get the latest community patterns.
- Use
--stream for long content to see results progressively instead of waiting.
- Create shell aliases (
alias wisdom="fabric -p extract_wisdom") for your most-used patterns.
- Use per-pattern model routing to optimize cost vs. quality for each task type.
- Keep custom patterns in
~/.config/fabric/patterns/ β they persist across updates.
- For YouTube, transcript extraction works best with videos that have captions enabled.
- Chain patterns with Unix pipes for multi-step processing workflows.
- Follow the IDENTITY β STEPS β OUTPUT INSTRUCTIONS structure when creating custom patterns.
References