Fabric AI Framework

repository·main·Indexed 12 days ago

https://github.com/danielmiessler/fabric

An open-source framework for solving AI integration by organizing prompts into reusable, task-oriented patterns. It provides a CLI for executing patterns such as audit_consent, audit_transparency, and check_falsifiability, and includes specialized tools like generate_changelog for Git history summaries and code2context for applying AI-generated code changes.

Tokens
227.9K
Snippets
552
Records
782
Agent score
99%

What's inside Fabric

  1. Explore available Fabric patterns by category

    main

    Fabric includes a wide variety of specialized AI patterns categorized by domain. You can use these patterns to perform specific tasks such as security analysis, business strategy, learning, visualization, and more.

    Available categories include:

    • Security Patterns: For threat analysis, malware investigation, and generating security rules (e.g., create_sigma_rules, write_semgrep_rule).
    • Business Patterns: For organizational analysis and offer creation (e.g., create_hormozi_offer).
    • Learning Patterns: For educational tools like flashcards and Socratic dialogue (e.g., create_flash_cards, dialog_with_socrates).
    • Visualization Patterns: For transforming text into diagrams, maps, or slides (e.g., create_mermaid_visualization, create_markmap_visualization).
    • Conversion Patterns: For changing data formats (e.g., convert_to_markdown, export_data_as_csv).
    • Strategy, Personal Development, Creativity, Gaming, and Wellness Patterns.
  2. Core Fabric Features Overview

    main

    Fabric provides several specialized workflows for media and development automation:

    • YouTube Processing: Extract transcripts, process comments, and retrieve metadata from YouTube videos and playlists using yt-dlp configurations.
    • Speech-to-Text: Transcribe audio and video files using OpenAI's Whisper models and process the resulting text through Fabric patterns.
    • Automated Changelog Generation: A developer workflow for generating PR changelog entries, including setup, validation, and CI/CD integration.
  3. User Interface & Experience Features

    main

    Enhance your interaction with Fabric through these features:

    • Shell Completions: Intelligent tab completion support for Zsh, Bash, and Fish shells.
    • Desktop Notifications: Cross-platform desktop notifications for long-running Fabric commands.
    • Gemini TTS: Integration with Google Gemini's text-to-speech capabilities, allowing for voice selection and audio generation within Fabric patterns.
  4. What is a DSRP System and how does it work?

    main

    In the DSRP framework, a System is defined by the organization of parts and wholes.

    Core Principles:

    • Everything is a system: Any idea or object is a system because it contains parts (e.g., a book contains paragraphs, which contain words, which contain letters).
    • Part-Whole Configurations: Meaning is constructed by organizing ideas into part-whole configurations. Changing the organization changes the meaning.
    • Contextual Existence: Nothing exists in isolation; everything exists within a system of context.
    • Zooming: Thinking involves 'zooming in' (deconstructing into parts) or 'zooming out' (generalizing into wholes). Understanding requires doing both.
    • Scalability: Every system can become a part of a larger system.

    This concept is used to move beyond simple categorization and into understanding how the organization and interactions of parts contribute to a system's overall function and purpose.

  5. What is fabric and why use it?

    main

    Overview

    fabric is an open-source framework designed for augmenting humans using AI. It addresses the "integration problem" of modern AI by organizing prompts into fundamental, real-world task units.

    Core Value Proposition

    Instead of using disparate websites or chatbots, Fabric allows you to:

    • Organize prompts by task: Create, collect, and manage AI solutions in one place.
    • Integrate into existing workflows: Use Fabric as a command-line interface or integrate its patterns into your favorite tools.
    • Focus on patterns: Use pre-defined AI patterns to solve specific problems rather than writing raw prompts every time.
  6. What is Diceware and how does it relate to entropy?

    main

    Diceware is a passphrase scheme where every possible roll of five six-sided dice (11111–66666) maps to a unique word.

    Key technical details:

    • Total combinations: $6^5 = 7776$
    • Entropy per word: $\log_2(7776) \approx 12.925$ bits
    • Total entropy: A passphrase of $N$ words carries $N \times 12.925$ bits of entropy (e.g., $\approx 77.5$ bits for six words, $\approx 129$ bits for ten words).

    This pattern helps users convert these high-entropy words into mnemonic phrases without losing the underlying security provided by the Diceware scheme.

  7. Trigger Code Review mode with [CODE REVIEW] tag

    main

    When the input contains the [CODE REVIEW] tag, Uncle Duke performs a structural and logical analysis of the provided code:

    Analysis Workflow

    1. Mental Whiteboard: Creates a diagram of class and method interactions.
    2. Execution Flow: Follows the entry point through all branches of execution.
    3. Parallel Branch Analysis: For every fork in execution, a new virtual agent is spawned to analyze that specific branch in parallel.
    4. Orphan Detection: Identifies classes or methods that do not interact with the rest of the system (listed under "Possible Orphans").

    Analysis Criteria

    • Best Practices: Adherence to SOLID, DRY, TDD, and Clean Coding.
    • Naming: Descriptive vs. non-descriptive variable names.
    • Sizing: Methods that are too long/short; classes that are too large/small.
    • Logic: Flaws in logical assumptions.
    • Testability: Whether the code is structured for effective testing.
  8. Identify unfalsifiability patterns and Kafka traps

    main

    The check_falsifiability pattern looks for specific logical failures that render an argument unscientific or uncorrectable:

    Unfalsifiability Patterns

    • Appeals to unmeasurable qualities: Using terms that cannot be quantified or observed.
    • Internal state claims: Assertions about internal states that no external party can verify.
    • Predictions without criteria: Claims that lack a timeline or specific conditions for success/failure.
    • Moving Goalposts: Redefining terms when counter-evidence arises (e.g., "That wasn't real [X]").

    Kafka Traps

    • Denial is proof of guilt: Rejecting the accusation is used as evidence that the accusation is true.
    • Questioning is ignorance: Challenging the framework is treated as proof that the challenger doesn't understand it.
    • Agreement is the only valid response: The framework allows no room for dissent.
    • Doubt is moral failure: Questioning the claim is framed as a character flaw.
  9. Extract and reuse dynamic variables

    main

    You can extract data from a response (e.g., a token or ID) using extractors and then reuse that data in subsequent requests using the extractor's name.

    To make the variable available only within the template and not in the final output, set internal: true in the extractor configuration.

    http:
      - raw:
          - |
            GET /getkey HTTP/1.1
            Host: {{Hostname}}
    
          - |
            GET /api/key={{token}} HTTP/1.1
            Host: api.target.com:443
    
        extractors:
          - type: regex
            name: token
            part: body
            internal: true
            regex:
              - 'prefix(.*)suffix'
    
        matchers:
          - type: word
            part: body
            words:
              - valid token
  10. Use Multiple Matchers and Global Matcher Conditions

    main

    A single template can contain multiple matchers to fingerprint different conditions.

    By default, if multiple matchers are present, Nuclei uses an OR operation between them (the request is successful if any matcher matches). To require that all matchers in the list must be true, use the top-level matchers-condition: and key.

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "X-Powered-By: PHP"
          - "PHPSESSID"
        condition: or
        part: header
    
      - type: word
        words:
          - "PHP"
        part: body
  11. Security and limitations of the file plugin

    main

    When using the file plugin, be aware of the following security constraints and operational limits:

    • File Size Limit: The plugin has a maximum file size limit of 1MB. Attempting to read files larger than this (e.g., .iso files) may fail or cause issues.
    • Path Traversal: Directory traversal (e.g., ../../../etc/passwd) is strictly prohibited and will result in an error.
    • Path Normalization: All provided paths are cleaned and normalized by the plugin.
    • Access Control: It is recommended to use path allow lists in production environments to carefully control which directories the plugin can access.