fabric

Vendor: danielmiessler

Fabric is a modular, Markdown-driven prompt engineering framework that treats AI prompts as versioned, composable, crowdsourced artifacts—decoupling domain-specific reasoning scaffolds from any single LLM vendor or application runtime.

View Repository

Official Preview
fabric

Technical Specifications

Repositorydanielmiessler/fabric
GitHub Stars★ 43.5k
Forks4.2k forks
Primary LanguageGo
LicenseMIT
Technical DomainTOOLING
aiaugmentationflourishinglifework
4.8Overall
Functionality
5.0
Documentation
4.7
Activity
4.9
Ease of use
0.0

Quickstart & Installation

$ brew install fabric

Comprehensive Review

Fabric represents a deliberate architectural counterpoint to the prevailing tendency of embedding prompt logic deep inside monolithic AI applications. Conceived by Daniel Miessler, the framework's central abstraction is the "pattern"—a Markdown-encoded system prompt that encapsulates a reusable reasoning scaffold, output contract, and behavioral directive. Patterns are first-class, filesystem-resident artifacts: versionable under Git, diffable in code review, and portable across any LLM backend that accepts a system message. This design choice is deceptively consequential. By externalizing prompt logic from application code, Fabric dissolves the coupling that makes most production AI systems brittle, opaque, and difficult to audit. The Go-based CLI acts as a thin orchestration layer that ingests stdin, resolves a named pattern from a local or remote registry, composes it with user-supplied context, and dispatches the assembled payload to a configured provider—OpenAI, Anthropic, Azure, Gemini, or local runtimes via Ollama. Crucially, Fabric enforces no opinionated agent loop, no mandatory tool-calling protocol, and no proprietary memory store. Each invocation is fundamentally stateless, which eliminates an entire class of context-bleed and cross-session contamination bugs that plague stateful agent frameworks. The crowdsourced pattern registry—now numbering over 200 community-contributed patterns covering summarization, extraction, red-teaming, code review, and content analysis—functions as a living corpus of vetted prompt engineering practice, effectively a peer-reviewed library of system-prompt primitives. The REST API server exposes the same pattern-resolution pipeline over HTTP, enabling integration into CI/CD pipelines, note-taking tools, and browser extensions. While Fabric is not a full agent runtime—it deliberately omits autonomous planning, multi-step tool execution, and persistent memory—it excels as a deterministic prompt-pipeline layer that can be composed beneath or alongside more sophisticated agent frameworks. Its MIT license, Go binary distribution, and minimal dependency surface make it production-deployable with negligible operational overhead. The framework's principal limitation is the absence of structured output validation, pattern dependency graphs, and formal sandboxing for patterns that invoke external tools—gaps that matter less for text-transform workflows and more for agentic compositions.

Project Background

Fabric emerged from Daniel Miessler's observation that the post-2022 proliferation of AI applications had produced thousands of isolated, vendor-locked prompt implementations with no shared substrate for reuse, review, or portability. The design philosophy—explicitly stated as 'human flourishing via AI augmentation'—rejects the autonomous-agent maximalism that defines frameworks like AutoGPT or LangChain's agent executors. Instead, Fabric treats the prompt itself as the unit of software: a versioned, reviewable, composable artifact that any human can read, modify, and redistribute. This is a philosophically minimalist stance that prioritizes transparency and human control over emergent agentic behavior.

The core architectural breakthrough is the elevation of the system prompt from an embedded string literal to a first-class filesystem citizen. Each pattern resides as a Markdown file under a predictable directory hierarchy, making the entire prompt corpus grep-able, diff-able, and Git-trackable. This directly addresses three persistent problems in agent prompting: prompt drift across deployments, inability to audit reasoning scaffolds, and vendor lock-in via proprietary prompt APIs. By keeping the dispatch layer thin and provider-agnostic, Fabric ensures that a pattern authored once can execute against GPT-4o, Claude 3.5, Gemini 1.5, or a local Llama instance with only a configuration flag change.

Memory isolation is handled through deliberate statelessness: each CLI invocation or REST API request constructs its context window fresh from stdin, pattern content, and optional context files, then discards all state upon completion. This eliminates the cross-session contamination and context-window exhaustion bugs endemic to stateful agent frameworks. The trade-off is that Fabric does not provide long-term memory, planning loops, or tool-calling orchestration—intentionally leaving those concerns to higher-level agent runtimes that may consume Fabric as a deterministic prompt-resolution layer.

Core Use Cases

The canonical enterprise use case is structured prompt standardization across distributed teams. An organization mirrors the Fabric pattern registry into an internal Git repository, imposes pull-request review on pattern modifications, and exposes the Fabric CLI or REST API as the single sanctioned entry point for LLM invocation. This enforces output contracts, security review, and brand consistency while preserving the ability to swap underlying providers without touching application code. The REST API server enables embedding this controlled surface into CI/CD pipelines, internal Slack bots, and customer-facing tooling without distributing API keys to edge clients.

A second major use case is long-form content transformation pipelines. Content creators, researchers, and knowledge workers pipe heterogeneous inputs—YouTube transcripts via yt-dlp, article HTML via readability extractors, PDF text via pdftotext—through patterns like 'extract_wisdom', 'summarize', or 'create_keynote' to produce consistent structured outputs. Because patterns encode both the reasoning scaffold and the output schema in Markdown, the same input produces stylistically and structurally consistent output regardless of which team member executes the pipeline. This reproducibility is critical for compliance-sensitive workflows such as threat intelligence reporting or regulatory document analysis.

A third use case is security and red-teaming automation. Patterns such as 'analyze_threads', 'vulnerability_analysis', and 'explain_docs' can be composed into multi-stage assessment pipelines where raw code, threat feeds, or documentation are transformed into structured risk narratives. The stateless execution model ensures each assessment is reproducible and auditable—essential for regulatory and incident-response contexts. Developers also use Fabric as a structured prompt layer beneath autonomous agent frameworks, providing vetted system prompts that constrain agent behavior without coupling the agent runtime to any specific prompt formulation.

Quickstart Guide

Installation is deliberately minimal. On macOS, brew install fabric installs the Go binary; alternatively, go install github.com/danielmiessler/fabric@latest works on any Go-enabled system. Initial setup requires running fabric --setup, which prompts for API keys (OpenAI, Anthropic, Gemini, etc.) and writes a YAML configuration to ~/.config/fabric/.env. Local model support is configured by pointing the default model to an Ollama-served endpoint. The pattern registry is cloned to ~/.config/fabric/patterns/ and can be updated via fabric --updatepatterns.

Basic execution follows Unix pipeline conventions: echo 'Text to process' | fabric --pattern summarize resolves the 'summarize' pattern, composes it with the piped input as user content, dispatches to the configured default model, and writes the response to stdout. Pattern selection, model override, and output formatting are all CLI flags: cat report.md | fabric --pattern extract_wisdom --model claude-3-5-sonnet --output ./wisdom.md. Custom patterns are created by authoring a Markdown file in ~/.config/fabric/patterns/my_pattern/system.md and invoking via --pattern my_pattern. The REST API server launches with fabric --serve on a configurable port, exposing /pattern/{name} and /models endpoints for HTTP-based integration into TypeScript or Python services via standard fetch or requests libraries.

Practicality Assessment

Fabric is production-ready for its designed scope: deterministic prompt resolution and dispatch. The Go binary has minimal runtime dependencies, cold-start latency is negligible, and the stateless model means horizontal scaling is trivially achieved by running multiple instances behind a load balancer. Token budget management is explicit—patterns declare their expected input size, and the CLI surfaces token counts before dispatch when invoked with --dryrun. The MIT license and single-binary distribution model make enterprise deployment straightforward with no supply-chain complexity. Documentation is comprehensive, with pattern-specific READMEs, video walkthroughs, and an active community contributing patterns and helper integrations.

The principal caveats concern scope boundaries and debugging overhead. Fabric deliberately does not provide structured output validation—patterns specify output schemas in prose, not JSON Schema, so downstream consumers must implement their own parsing and validation. There is no pattern dependency graph, meaning composite patterns that reference other patterns must be orchestrated externally. Sandboxing is absent: patterns are pure text, but if Fabric is wrapped in a tool-calling agent, the agent runtime bears full responsibility for execution isolation. Debugging complex pipelines requires manual inspection of the assembled prompt-context payload, as there is no built-in trace or telemetry layer—operators typically enable verbose logging via --verbose and capture the full dispatched payload. For teams requiring observability, integration with OpenTelemetry or LangSmith must be implemented at the calling-application layer rather than within Fabric itself.

Real-world Deployments

Fabric has achieved substantial ecosystem adoption, evidenced by its 43,000+ GitHub stars and active community pattern contributions. Notable integrations include Obsidian plugins that invoke Fabric patterns directly within the note-taking surface, Raycast extensions for macOS-native prompt execution, and VS Code extensions that pipe selected code through review patterns. The framework is frequently cited in security and OSINT communities as a standard tool for threat intelligence summarization, with patterns like 'analyze_threads' and 'extract_wisdom' appearing in documented workflows from independent security researchers and red-team operators.

Enterprise adoption, while less publicly documented due to the internal nature of such deployments, is indicated by the framework's inclusion in internal tooling catalogs and its frequent appearance in conference talks on AI operations. The Warp terminal sponsorship reflects Fabric's positioning as a productivity layer for developer workflows. Community-maintained helper applications extend Fabric into browser automation, podcast transcription pipelines, and automated documentation generation. The pattern registry itself has become a reference corpus for prompt engineering pedagogy, with multiple online courses and books citing specific patterns as exemplars of system-prompt design. This dual adoption—both as a runtime tool and as an educational reference corpus—reinforces Fabric's position as a foundational layer in the open-source AI tooling stack.

Core Strengths

  • Patterns as Git-versioned Markdown artifacts decouple prompt logic from application code and LLM vendor lock-in
  • Provider-agnostic dispatch layer supports OpenAI, Anthropic, Gemini, Azure, and local Ollama runtimes through a unified configuration surface
  • Crowdsourced registry of 200+ vetted patterns functions as a peer-reviewed library of system-prompt primitives
  • Stateless execution model eliminates context-bleed contamination while exposing a REST API for pipeline integration

Considerations & Limitations

  • Requires appropriate GPU memory planning and concurrency tuning for production.

Frequently Asked Questions (FAQ)

What is fabric and what key challenges does it solve?

fabric is an open-source AI project developed primarily in Go under the MIT license. Fabric is a modular, Markdown-driven prompt engineering framework that treats AI prompts as versioned, composable, crowdsourced artifacts—decoupling domain-specific reasoning scaffolds from any single LLM vendor or application runtime.. Fabric emerged from Daniel Miessler's observation that the post-2022 proliferation of AI applications had produced thousands of isolated, vendor-locked prompt implementations with no shared substrate for reuse, review, or portability. The design philosophy—explicitly stated as 'human flourishing via AI augmentation'—rejects the autonomous-agent maximalism that defines frameworks like AutoGPT or LangChain's agent executors. Instead, Fabric treats the prompt itself as the unit of software: a versioned, reviewable, composable artifact that any human can read, modify, and redistribute. This is a philosophically minimalist stance that prioritizes transparency and human control over emergent agentic behavior. The core architectural breakthrough is the elevation of the system prompt from an embedded string literal to a first-class filesystem citizen. Each pattern resides as a Markdown file under a predictable directory hierarchy, making the entire prompt corpus grep-able, diff-able, and Git-trackable. This directly addresses three persistent problems in agent prompting: prompt drift across deployments, inability to audit reasoning scaffolds, and vendor lock-in via proprietary prompt APIs. By keeping the dispatch layer thin and provider-agnostic, Fabric ensures that a pattern authored once can execute against GPT-4o, Claude 3.5, Gemini 1.5, or a local Llama instance with only a configuration flag change. Memory isolation is handled through deliberate statelessness: each CLI invocation or REST API request constructs its context window fresh from stdin, pattern content, and optional context files, then discards all state upon completion. This eliminates the cross-session contamination and context-window exhaustion bugs endemic to stateful agent frameworks. The trade-off is that Fabric does not provide long-term memory, planning loops, or tool-calling orchestration—intentionally leaving those concerns to higher-level agent runtimes that may consume Fabric as a deterministic prompt-resolution layer.

How can I quickly install and run fabric locally?

Installation is deliberately minimal. On macOS, brew install fabric installs the Go binary; alternatively, go install github.com/danielmiessler/fabric@latest works on any Go-enabled system. Initial setup requires running fabric --setup, which prompts for API keys (OpenAI, Anthropic, Gemini, etc.) and writes a YAML configuration to ~/.config/fabric/.env. Local model support is configured by pointing the default model to an Ollama-served endpoint. The pattern registry is cloned to ~/.config/fabric/patterns/ and can be updated via fabric --updatepatterns. Basic execution follows Unix pipeline conventions: echo 'Text to process' | fabric --pattern summarize resolves the 'summarize' pattern, composes it with the piped input as user content, dispatches to the configured default model, and writes the response to stdout. Pattern selection, model override, and output formatting are all CLI flags: cat report.md | fabric --pattern extract_wisdom --model claude-3-5-sonnet --output ./wisdom.md. Custom patterns are created by authoring a Markdown file in ~/.config/fabric/patterns/my_pattern/system.md and invoking via --pattern my_pattern. The REST API server launches with fabric --serve on a configurable port, exposing /pattern/{name} and /models endpoints for HTTP-based integration into TypeScript or Python services via standard fetch or requests libraries.

What are the main use cases and strengths of fabric?

fabric is well-suited for Structured content summarization pipelines: piping YouTube transcripts, articles, or PDFs through patterns like 'extract_wisdom' or 'summarize' to produce consistent, schema-stable digests across heterogeneous input sources., Enterprise prompt standardization: maintaining an internal Git-mirrored pattern registry to enforce security review, output contracts, and brand voice across multiple teams invoking LLMs through CI/CD and internal tooling., Red-teaming and security analysis workflows: chaining patterns such as 'analyze_threat_report' or 'vulnerability_analysis' with stdin-piped code diffs to produce auditable, reproducible security assessments., Composable prompt pipelines in note-taking ecosystems: integrating Fabric with Obsidian, Raycast, or shell aliases to transform raw capture into structured knowledge artifacts without leaving the editor surface.. With an overall rating of 4.8/5, it offers strong community activity, reliable performance, and easy integration with existing AI pipelines.

What limitations or architectural considerations should be kept in mind for fabric?

Fabric is production-ready for its designed scope: deterministic prompt resolution and dispatch. The Go binary has minimal runtime dependencies, cold-start latency is negligible, and the stateless model means horizontal scaling is trivially achieved by running multiple instances behind a load balancer. Token budget management is explicit—patterns declare their expected input size, and the CLI surfaces token counts before dispatch when invoked with --dryrun. The MIT license and single-binary distribution model make enterprise deployment straightforward with no supply-chain complexity. Documentation is comprehensive, with pattern-specific READMEs, video walkthroughs, and an active community contributing patterns and helper integrations. The principal caveats concern scope boundaries and debugging overhead. Fabric deliberately does not provide structured output validation—patterns specify output schemas in prose, not JSON Schema, so downstream consumers must implement their own parsing and validation. There is no pattern dependency graph, meaning composite patterns that reference other patterns must be orchestrated externally. Sandboxing is absent: patterns are pure text, but if Fabric is wrapped in a tool-calling agent, the agent runtime bears full responsibility for execution isolation. Debugging complex pipelines requires manual inspection of the assembled prompt-context payload, as there is no built-in trace or telemetry layer—operators typically enable verbose logging via --verbose and capture the full dispatched payload. For teams requiring observability, integration with OpenTelemetry or LangSmith must be implemented at the calling-application layer rather than within Fabric itself.