Fabric — AI Prompt Patterns for Everything
Collection of 100+ AI prompt patterns for real-world tasks. Summarize articles, extract wisdom, analyze code, write essays, create presentations, and more.
What it is
Fabric is a collection of over 100 AI prompt patterns designed for real-world tasks. Each pattern is a carefully crafted system prompt that instructs an LLM to perform a specific task: summarize articles, extract key wisdom, analyze code quality, write essays, create presentations, rate content, and more. Fabric runs as a CLI tool that pipes content through these patterns.
This tool is for anyone who uses LLMs regularly and wants proven, reusable prompt templates instead of writing ad-hoc prompts for common tasks.
How it saves time or tokens
Fabric patterns are optimized through community iteration. Each pattern includes specific output formatting instructions, reducing the back-and-forth of getting the LLM to produce useful output. The CLI interface pipes content directly, eliminating copy-paste workflows. Chaining patterns enables complex workflows like 'extract key points, then create a summary, then generate social posts.'
How to use
- Install Fabric CLI.
- Configure your LLM API key.
- Pipe content through patterns.
- Chain patterns for multi-step workflows.
# Install Fabric
go install github.com/danielmiessler/fabric@latest
# Or via pip
pip install fabric-ai
# Summarize an article
curl -s https://example.com/article | fabric --pattern extract_wisdom
# Analyze code
cat main.py | fabric --pattern analyze_code
# Create a presentation outline
cat research.md | fabric --pattern create_presentation
# Chain patterns
cat article.md | fabric --pattern extract_wisdom | fabric --pattern create_summary
Example
Using the extract_wisdom pattern:
$ echo 'Long article about AI safety...' | fabric --pattern extract_wisdom
IDEAS
- AI alignment research needs more funding
- Interpretability tools are improving rapidly
- Red-teaming is becoming standard practice
INSIGHTS
- The gap between AI capabilities and safety research is narrowing
- Open-source safety tools lower the barrier to responsible development
QUOTES
- 'Safety is not a feature, it is a foundation'
RECOMMENDATIONS
- Invest in interpretability before scaling further
- Mandate red-teaming for models above certain capability thresholds
Related on TokRepo
- Prompt library — More curated prompts
- AI coding tools — Developer-focused AI tools
Common pitfalls
- Pattern quality varies. Some community patterns are well-tested while others are rough drafts. Test patterns before relying on them.
- Patterns are optimized for specific models. A pattern tuned for GPT-4 may produce different results with Claude or Gemini.
- Long input content may exceed model context limits when combined with the pattern's system prompt.
- The CLI requires API keys configured. Each invocation makes API calls, so costs accumulate with heavy use.
- Chaining patterns multiplies API calls and token usage. Use chaining selectively for high-value workflows.
Frequently Asked Questions
Fabric includes over 100 patterns covering tasks like summarization, wisdom extraction, code analysis, essay writing, presentation creation, content rating, and more. The collection grows as the community contributes new patterns.
Yes. Patterns are text files with system prompts. Create a new file in the patterns directory, write your prompt, and Fabric makes it available as a named pattern. The repository accepts community contributions.
Yes. Fabric supports multiple LLM providers including OpenAI, Anthropic Claude, Google Gemini, and local models via Ollama. Configure your preferred provider in the settings.
Yes. Use Unix pipes to chain patterns. The output of one pattern becomes the input of the next. This enables multi-step workflows like extract, summarize, and format in one command.
Yes. The CLI interface makes Fabric scriptable. Integrate it into shell scripts, cron jobs, or CI pipelines. Common automations include daily news digests and automated code review summaries.
Citations (3)
- Fabric GitHub— Fabric provides 100+ AI prompt patterns
- Anthropic Prompt Engineering— AI prompt engineering patterns
- GNU Coreutils— Unix pipeline philosophy for CLI tools
Related on TokRepo
Source & Thanks
Created by Daniel Miessler. Licensed under MIT. danielmiessler/fabric — 28K+ GitHub stars