Dynamic prompt patterns powered by Claude Code
PatternForge is a blazing-fast TUI (Terminal User Interface) that brings the power of Fabric-style patterns to Claude Code. Create, edit, and manage reusable AI prompts with an elegant interface and Vim-style keybindings.
- π― Dynamic Pattern Loading - Patterns are markdown files you can edit anytime
- π Category Navigation - Organize patterns by category (Bug, Tickets, Refactor, etc.)
- βοΈ Pattern Variables - Forms with configurable fields (priority, environment, etc.)
- π Community Patterns - Clone and sync patterns from git repositories
- π {{input}} Templating - Control exactly where user content goes
- β‘ Vim Keybindings - j/k navigation, natural for terminal users
- π§ Live Editing - Press
mto edit patterns in Vi, changes apply instantly - π Token Stats - See input/output tokens and execution time
- π Copy to Clipboard - One key press to copy results
- π¨ Beautiful TUI - Built with Bubbletea and Lipgloss
- π Fast & Lightweight - Pure Go, single binary, no dependencies
# 1. Launch PatternForge
$ patternforge
# 2. Select a category, then a pattern
> π Tickets
> π« Create Ticket βοΈ
# 3. Fill in variables (if pattern has them)
Priority: [low] medium [high]
Type: [bug] feature [task]
# 4. Paste your content, press Ctrl+D
# 5. Get beautiful results with stats
β¨ Result
[Your formatted ticket here]
π 172 tokens input + 612 output = 784 total | 3.2s
# 6. Press 'y' to copy output- Go 1.21+ - Install Go
- Claude Code - Required for AI processing
pip install claude-code claude auth login
- Git - For community patterns (optional)
- Vi/Vim - For editing patterns (usually pre-installed on macOS/Linux)
# Clone the repository
git clone https://github.com/Pierre-Malherbe/PatternForge.git
cd patternforge
# Install dependencies
make deps
# Build
make build
# Install system-wide (optional)
make install# Use default patterns directory (./patterns)
patternforge
# Use custom patterns directory
patternforge ~/my-patterns# Sync community patterns from repositories
patternforge upgrade
# List configured repositories
patternforge repo list
# Add a pattern repository
patternforge repo add https://github.com/user/patterns-repo
# Remove a repository
patternforge repo remove <name>On first run, PatternForge will:
- β Check if Claude Code is installed
- π Ask where to save results
- π Offer to enable community patterns (clones official repo)
- π― Launch the TUI
- Select Category - Browse patterns by category
- Select Pattern - Use
j/kor arrow keys, pressenter - Configure Variables - Fill in form fields (if pattern has variables)
- Input Content - Paste or type your content
- Process - Press
Ctrl+Dto send to Claude Code - View Results - Scroll through output, see token stats
- Copy/Save - Press
yto copy, orsto save to file
| Key | Action |
|---|---|
j / β |
Move down |
k / β |
Move up |
enter |
Select category/pattern |
esc |
Back to categories |
m |
Modify selected pattern (opens Vi) |
n |
Create new pattern (opens Vi) |
U |
Upgrade/sync repositories |
S |
Settings |
/ |
Search |
q |
Quit |
| Key | Action |
|---|---|
β / β / Tab |
Navigate fields |
β / β |
Change selection (for select fields) |
enter |
Continue to input |
esc |
Back |
| Key | Action |
|---|---|
Ctrl+D |
Process with Claude Code |
Esc |
Back to pattern selection |
| Key | Action |
|---|---|
j/k or β/β |
Scroll output |
y |
Copy output to clipboard |
s |
Save output to file |
Esc |
New pattern |
q |
Quit |
Patterns are simple Markdown files in the patterns/ directory.
# π Code Review
> Review code for bugs and improvements
[Category: Review]
## Prompt
Analyze this code and provide feedback:
{{input}}
Include:
1. Bugs found
2. Improvements
3. Security issuesAdd configurable fields that appear as a form before input:
# π« Create Ticket
> Generate a well-structured ticket
[Category: Tickets]
## Variables
- priority: Priority | select | low,medium,high,critical | medium
- type: Type | select | bug,feature,task | task
- env: Environment | select | dev,staging,prod | prod
## Prompt
Create a ticket with:
- Priority: {{var:priority}}
- Type: {{var:type}}
- Environment: {{var:env}}
Description:
{{input}}- name: Label | type | options | default | placeholder
Types:
text- Simple text input (default)select- Dropdown with options (comma-separated)multiline- Multi-line text area
Examples:
- priority: Priority | select | low,medium,high | medium
- description: Description | text | | | Enter details...
- notes: Notes | multilineControl where user content is inserted:
## Prompt
Analyze this code:
{{input}}
Provide detailed feedback.Without {{input}}: User content is appended at the end.
Add the official patterns repository:
patternforge repo add https://github.com/Pierre-Malherbe/patternforge-patterns
patternforge upgradeOr enable during first launch setup.
Patterns are loaded from multiple sources with priority:
- Local patterns (
./patterns) - Highest priority - Community patterns (from repositories) - Merged, local wins on conflict
# List all configured repos
patternforge repo list
# Add a new repository
patternforge repo add https://github.com/user/patterns
# Remove a repository
patternforge repo remove patterns
# Sync all repositories (also available via 'U' key in TUI)
patternforge upgradePatternForge follows Clean Architecture principles:
PatternForge/
βββ cmd/patternforge/ # Application entrypoint
β βββ main.go # CLI & subcommands
β βββ model.go # Main TUI model (state machine)
βββ internal/
β βββ pattern/ # Pattern loading, parsing, variables
β βββ repository/ # Git operations for community patterns
β βββ config/ # Settings & repository configuration
β βββ claude/ # Claude Code executor
β βββ ui/
β βββ screens/ # TUI screens (selection, variables, input, results)
β βββ styles/ # Centralized lipgloss styles
βββ patterns/ # User's local pattern files
make test# Build for both Apple Silicon and Intel
make build-macos
# Outputs:
# bin/patternforge-darwin-arm64
# bin/patternforge-darwin-amd64Q: "claude CLI not found"
pip install claude-code
claude --versionQ: "Pattern not showing up"
- Check file is in
patterns/directory - Ensure filename ends with
.md - Press
Uto reload or restart PatternForge
Q: "Variables not working"
- Check
## Variablessection exists - Format:
- name: Label | type | options | default - Use
{{var:name}}in prompt
Q: "Repository sync failed"
- Ensure git is installed:
git --version - Check internet connection
- Verify repository URL is correct
- Claude Code Docs: https://docs.anthropic.com/claude/docs/claude-code
- Fabric Project: https://github.com/danielmiessler/fabric
- Official Patterns: https://github.com/Pierre-Malherbe/patternforge-patterns
- Bubbletea: https://github.com/charmbracelet/bubbletea
Contributions welcome! Areas for improvement:
- More community patterns
- Pattern validation
- Export results (PDF, HTML)
- Custom themes
- Windows support testing
MIT License - See LICENSE file
Built with β€οΈ in π«π· for the Claude Code community