This repository contains custom patterns for the fabric tool, enhancing its functionality for specific use cases.
Fabric is a powerful AI-assistant tool that helps with various tasks.
This repository extends fabric's capabilities by adding custom patterns for specialized tasks.
The patterns in this repository are designed to be used with fabric's --pattern flag.
Each pattern is a separate file in the patterns directory, and each file contains a system description,
input instructions, output instructions, and an example input and output.
To use these custom patterns with fabric:
- Ensure you have fabric installed and configured.
- Clone this repository to your local machine.
- Run the update script to add these patterns to your fabric configuration:
On MacOS and Linux:
./update-fabric.shOn Windows, in a PowerShell window:
./update-fabric.ps1This will copy the custom patterns into the correct location, at which point they are seen by fabric.
Note: The file custom_pattern_explanations.md is also installed in ~/.config/fabric/patterns. This
file contains brief one-line summaries of the custom patterns.
The update-fabric also installs the fabric-bootstrap and model-defs scripts in
the $HOME/.config/fabric directory.
The bootstrap script implements the Aliases for All Patterns startup shell suggestions from the fabric project.
On MacOS/Linux systems, you only have to add this line to your shell startup (in .zshrc or .bashrc):
if [ -f "$HOME/.config/fabric/fabric-bootstrap.inc" ]; then . "$HOME/.config/fabric/fabric-bootstrap.inc"; fion Windows, in your PowerShell startup script (referenced by $PROFILE), add this snippet:
$fabricPath = Join-Path $HOME ".config/fabric"
$fabricBootstrapPath = "$fabricPath\fabric-bootstrap.ps1"
if (Test-Path -Path $fabricBootstrapPath) {
Write-Host "Sourcing additional script: $fabricBootstrapPath"
. $fabricBootstrapPath
}
else {
Write-Host "Additional script not found: $fabricBootstrapPath"
}Now, when you create a new shell, all your fabric patterns are available as aliases.