Compare commits

...

76 Commits

Author SHA1 Message Date
github-actions[bot]
dd213eb965 chore(release): Update version to v1.4.306 2025-09-01 03:20:53 +00:00
Kayvan Sylvan
d205dbcdac Merge pull request #1742 from ksylvan/kayvan/0831-deprecate-pattern
Documentation and Pattern Updates
2025-08-31 20:18:13 -07:00
Kayvan Sylvan
f8ff9129b5 docs: add Windows install via winget and Docker deployment instructions
- Add winget installation method for Windows
- Add Docker Hub and GHCR image references
- Include docker run examples for setup/patterns
- Remove deprecated PowerShell download link
- Delete unused show_fabric_options_markmap pattern
- Update suggest_pattern with new AI patterns
- Add personal development patterns for storytelling
2025-08-31 20:14:47 -07:00
github-actions[bot]
f9d01b5ebb chore(release): Update version to v1.4.305 2025-08-31 16:13:26 +00:00
Kayvan Sylvan
2c7f4753a2 Merge pull request #1741 from ksylvan/kayvan/ci/0831-fix-tag-ref
CI: Fix Release Description Update
2025-08-31 09:10:59 -07:00
Changelog Bot
9b261b9adf chore: incoming 1741 changelog entry 2025-08-31 09:08:59 -07:00
Kayvan Sylvan
a23b6d518f fix: update release workflow to support manual dispatch with custom tag
## CHANGES

- Support custom tag from client payload in workflow
- Fallback to github.ref_name when no custom tag provided
- Enable manual release triggers with specified tag parameter
2025-08-31 09:03:22 -07:00
github-actions[bot]
bc73bdb704 chore(release): Update version to v1.4.304 2025-08-31 15:40:12 +00:00
Kayvan Sylvan
f22c144786 Merge pull request #1740 from ksylvan/kayvan/fix/0831-run-generate-changelog-after-go-releaser
Restore our custom Changelog Updates in GitHub Actions
2025-08-31 08:37:48 -07:00
Kayvan Sylvan
eb759251ad ci: add changelog generation step to release workflow and support fork releases
- Add changelog generation step to GitHub release workflow
- Create updateReleaseForRepo helper method for release updates
- Add fork detection logic in UpdateReleaseDescription method
- Implement upstream repository release update for forks
- Add fallback to current repository when upstream fails
- Enhance error handling with detailed repository context
- Remove duplicate success logging from main method
2025-08-31 08:30:18 -07:00
github-actions[bot]
19b512c3ab chore(release): Update version to v1.4.303 2025-08-31 14:38:39 +00:00
Kayvan Sylvan
a4ce90970a Merge pull request #1736 from tonymet/winget-publishing
Winget Publishing and GoReleaser
2025-08-31 07:36:12 -07:00
Kayvan Sylvan
8d2fda3af9 ci: harden release pipeline; gate to upstream, migrate tokens, remove docker-on-tag
CHANGES
- Gate release and version workflows to upstream owner only.
- Switch tagging and releases to built-in GITHUB_TOKEN.
- Replace environment passing with step outputs across workflows.
- Remove docker-publish-on-tag workflow to reduce duplication and complexity.
- Add OCI description label to Docker image.
- Document GHCR multi-arch annotations for accurate package descriptions.
- Update README with new ARM binary release announcement.
- Simplify GoReleaser config by removing comments and extras.
2025-08-31 07:34:00 -07:00
Anthony Metzidis
aa59d58deb chore: goreleaser and winget support 2025-08-31 07:15:25 -07:00
github-actions[bot]
d209ee38c7 chore(release): Update version to v1.4.302 2025-08-28 19:40:57 +00:00
Kayvan Sylvan
c20be027fe Merge pull request #1737 from ksylvan/0828-OmriH-Elister-new-patterns-plus-dependabot
Add New Psychological Analysis Patterns + devalue version bump
2025-08-28 12:38:25 -07:00
Kayvan Sylvan
3ef3509bfd feat: add 'create_story_about_person' and 'heal_person' patterns; bump devalue
CHANGES
- Add create_story_about_person system pattern with narrative workflow
- Add heal_person system pattern for compassionate healing plans
- Update pattern_explanations to register new patterns and renumber indices
- Extend pattern_descriptions with entries, tags, and concise descriptions
- Add pattern_extracts for both patterns with full instruction blocks
- Bump devalue dependency from 5.1.1 to 5.3.2
- Refresh lockfile snapshots to reference updated devalue version
- Sync web static pattern_descriptions with new patterns

Updates `devalue` from 5.1.1 to 5.3.2
- [Release notes](https://github.com/sveltejs/devalue/releases)
- [Changelog](https://github.com/sveltejs/devalue/blob/main/CHANGELOG.md)
- [Commits](sveltejs/devalue@v5.1.1...v5.3.2)

---
updated-dependencies:
- dependency-name: devalue
  dependency-version: 5.3.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-28 12:35:23 -07:00
github-actions[bot]
7142b020ef chore(release): Update version to v1.4.301 2025-08-28 14:13:15 +00:00
Kayvan Sylvan
1b9f07b525 Merge pull request #1735 from ksylvan/kayvan/0828-ci-fixes
Fix Docker Build Path Configuration
2025-08-28 07:10:36 -07:00
Kayvan Sylvan
dcfc94ca07 fix: update Docker workflow to use specific Dockerfile and monitor markdown file changes
• Add explicit Dockerfile path to Docker build action
• Remove markdown files from workflow paths-ignore filter
• Enable CI triggers for documentation file changes
• Specify Docker build context with custom file location
2025-08-28 07:08:30 -07:00
github-actions[bot]
0e85861a46 chore(release): Update version to v1.4.300 2025-08-28 06:41:30 +00:00
Kayvan Sylvan
7c5a040287 Merge pull request #1732 from ksylvan/kayvan/docker-publishing
CI Infra: Changelog Generation Tool + Docker Image Pubishing
2025-08-27 23:39:04 -07:00
Kayvan Sylvan
08eb48c2e7 ci: add tag-based multi-arch Docker publish to GHCR and Docker Hub
CHANGES
- Add GitHub Actions workflow to publish Docker images on tags
- Build multi-arch images with Buildx and QEMU across amd64, arm64
- Tag images using semver; push to GHCR and Docker Hub
- Set :latest only for highest semver tag via imagetools
- Gate patterns workflow steps on detected changes instead of failing
- Auto-detect GitHub owner and repo from git remote URL
- Remove hardcoded repository values in changelog release manager
- Normalize image names to lowercase for registry compatibility
- Enable GitHub Actions cache for faster Docker builds
- Add VS Code dictionary entries for Docker-related terms
2025-08-27 23:35:44 -07:00
github-actions[bot]
e40d4e6623 chore(release): Update version to v1.4.299 2025-08-27 18:07:33 +00:00
Kayvan Sylvan
51bd1ebadf Merge pull request #1731 from ksylvan/0827-update-ollama-library-for-cve-fixes
chore: upgrade ollama dependency from v0.9.0 to v0.11.7
2025-08-27 11:05:04 -07:00
Kayvan Sylvan
d3de731967 chore: upgrade ollama dependency from v0.9.0 to v0.11.7
• Update ollama package to version 0.11.7
• Refresh go.sum with new dependency checksums

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2025-0317](https://nvd.nist.gov/vuln/detail/CVE-2025-0317)
- **CVSS Score**: 7.5 (High)
- **Description**: A vulnerability in ollama/ollama versions <=0.3.14 allows a malicious user to upload and create a customized GGUF model file on the Ollama server. This can lead to a division by zero error in the ggufPadding function, causing the server to crash and resulting in a Denial of Service (DoS) attack.
- **Affected**: Ollama server versions ≤ 0.3.14
- **Impact**: Denial of Service through division by zero error

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2025-0315](https://nvd.nist.gov/vuln/detail/CVE-2025-0315)
- **CVSS Score**: 7.5 (High)
- **Description**: Vulnerability allows Denial of Service via customized GGUF model file upload on Ollama server.
- **Affected**: Ollama/ollama versions ≤ 0.3.14
- **Impact**: Denial of Service through malicious GGUF model file uploads

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2024-12886](https://nvd.nist.gov/vuln/detail/CVE-2024-12886)
- **CVSS Score**: 7.5 (High)
- **Description**: An Out-Of-Memory (OOM) vulnerability exists in the ollama server version 0.3.14. This vulnerability can be triggered when a malicious API server responds with a gzip bomb HTTP response, leading to the ollama server crashing.
- **Affected**: Ollama server version 0.3.14
- **Impact**: Denial of Service through memory exhaustion via gzip bomb attack

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2024-8063](https://nvd.nist.gov/vuln/detail/CVE-2024-8063)
- **CVSS Score**: 7.5 (High)
- **Description**: Security vulnerability with high severity rating
- **Impact**: Requires patching for security compliance

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2024-12055](https://nvd.nist.gov/vuln/detail/CVE-2024-12055)
- **CVSS Score**: 7.5 (High)
- **Description**: High-severity security vulnerability requiring immediate attention
- **Impact**: Critical security flaw needing remediation

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2025-51471](https://nvd.nist.gov/vuln/detail/CVE-2025-51471)
- **CVSS Score**: 6.9 (Medium)
- **Description**: Medium severity security vulnerability
- **Impact**: Security risk requiring patching as part of comprehensive security updates

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2025-46394](https://nvd.nist.gov/vuln/detail/CVE-2025-46394)
- **CVSS Score**: 3.2 (Low)
- **Description**: Low-severity security issue
- **Impact**: Minor security concern addressed as part of comprehensive security maintenance

- **Link**: [https://nvd.nist.gov/vuln/detail/CVE-2024-58251](https://nvd.nist.gov/vuln/detail/CVE-2024-58251)
- **CVSS Score**: 2.5 (Low)
- **Description**: Low-severity security vulnerability
- **Impact**: Minimal security risk addressed for comprehensive security posture

This comprehensive security fix addresses **8 CVEs** total:
- **5 High Severity** vulnerabilities (CVSS 7.5)
- **1 Medium Severity** vulnerability (CVSS 6.9)
- **2 Low Severity** vulnerabilities (CVSS 3.2 and 2.5)

The majority of high-severity issues are related to **Ollama server vulnerabilities** that could lead to Denial of Service attacks through various vectors including division by zero errors, memory exhaustion, and malicious file uploads. These fixes ensure robust protection against these attack vectors and maintain system availability.

**Priority**: The high-severity Ollama vulnerabilities should be considered critical for any systems running Ollama server components, as they can lead to service disruption and potential system crashes.
2025-08-27 10:53:31 -07:00
github-actions[bot]
458b0a5e1c chore(release): Update version to v1.4.298 2025-08-27 14:11:48 +00:00
Kayvan Sylvan
b8f64bd554 Merge pull request #1730 from ksylvan/0827-simplify-docker
Modernize Dockerfile with Best Practices Implementation
2025-08-27 07:09:12 -07:00
Kayvan Sylvan
1622a34331 chore: remove docker-test framework and simplify production docker setup
- Remove entire docker-test directory and testing infrastructure
- Delete complex test runner script and environment files
- Simplify production Dockerfile with multi-stage build optimization
- Remove docker-compose.yml and start-docker.sh helper scripts
- Update README with cleaner Docker usage instructions
- Streamline container build process and reduce image size
2025-08-27 07:00:52 -07:00
github-actions[bot]
6b9f4c1fb8 chore(release): Update version to v1.4.297 2025-08-26 15:11:22 +00:00
Kayvan Sylvan
4d2061a641 Merge pull request #1729 from ksylvan/0826-community-docs
Add GitHub Community Health Documents
2025-08-26 08:08:52 -07:00
Kayvan Sylvan
713f6e46fe docs: add contributing, security, support, and code-of-conduct docs; add docs index
CHANGES
- Add CODE_OF_CONDUCT defining respectful, collaborative community behavior
- Add CONTRIBUTING with setup, testing, PR, changelog requirements
- Add SECURITY policy with reporting process and response timelines
- Add SUPPORT guide for bugs, features, discussions, expectations
- Add docs README indexing guides, quick starts, contributor essentials
2025-08-26 07:10:08 -07:00
github-actions[bot]
efadc81974 chore(release): Update version to v1.4.296 2025-08-26 03:15:57 +00:00
Kayvan Sylvan
ea54f60dcc Merge pull request #1728 from ksylvan/0825-debug-logging-cleanup
Refactor Logging System to Use Centralized Debug Logger
2025-08-25 20:13:26 -07:00
Kayvan Sylvan
4008125e37 refactor: replace stderr prints with centralized debuglog.Log and improve auth messaging
- Replace fmt.Fprintf/os.Stderr with centralized debuglog.Log across CLI
- Add unconditional Log function to debuglog for important messages
- Improve OAuth flow messaging and token refresh diagnostics
- Update tests to capture debuglog output via SetOutput
- Convert Perplexity streaming errors to unified debug logging
- Emit file write notifications through debuglog instead of stderr
- Warn on ambiguous model selection using centralized logger
- Announce large audio processing steps via debuglog progress messages
- Standardize extension registry and patterns warnings through debuglog
2025-08-25 20:09:55 -07:00
github-actions[bot]
da94411bf3 chore(release): Update version to v1.4.295 2025-08-24 20:22:53 +00:00
Kayvan Sylvan
ab7b37be10 Merge pull request #1727 from ksylvan/0824-anthropic-beta-logs
Standardize Anthropic Beta Failure Logging
2025-08-24 13:20:19 -07:00
Kayvan Sylvan
772337bf0d refactor: route Anthropic beta failure logs through internal debug logger
CHANGES
- Replace fmt.Fprintf stderr with debuglog.Debug for beta failures
- Import internal log package and remove os dependency
- Standardize logging level to debuglog.Basic for beta errors
- Preserve fallback stream behavior when beta features fail
- Maintain message send fallback when beta options fail
2025-08-24 13:10:57 -07:00
github-actions[bot]
1e30c4e136 chore(release): Update version to v1.4.294 2025-08-20 16:37:50 +00:00
Kayvan Sylvan
e12a40ad4f Merge pull request #1723 from ksylvan/0820-venice-ai-provider
docs: update README with Venice AI provider and Windows install script
2025-08-20 09:35:18 -07:00
Kayvan Sylvan
97beaecbeb docs: update README with Venice AI provider and Windows install script
- Add Venice AI provider configuration with API endpoint
- Document Venice AI as privacy-first open-source provider
- Include PowerShell installation script for Windows users
- Add debug levels section to table of contents
- Update recent major features with v1.4.294 release notes
- Configure Venice AI base URL and response settings
2025-08-20 09:30:29 -07:00
github-actions[bot]
7af6817bac chore(release): Update version to v1.4.293 2025-08-19 11:29:38 +00:00
Kayvan Sylvan
50ecc32d85 Merge pull request #1718 from ksylvan/0819-debug-log-levels
Implement Configurable Debug Logging Levels
2025-08-19 04:27:08 -07:00
Kayvan Sylvan
ff1ef380a7 feat: add --debug flag with levels and centralized logging
CHANGES
- Add --debug flag controlling runtime logging verbosity levels
- Introduce internal/log package with Off, Basic, Detailed, Trace
- Replace ad-hoc Debugf and globals with centralized debug logger
- Wire debug level during early CLI argument parsing
- Add bash, zsh, fish completions for --debug levels
- Document debug levels in README with usage examples
- Add comprehensive STT guide covering models, flags, workflows
- Simplify splitAudioFile signature and log ffmpeg chunking operations
- Remove FABRIC_STT_DEBUG environment variable and related code
- Clean minor code paths in vendors and template modules
2025-08-19 04:23:40 -07:00
github-actions[bot]
6a3a7e82d1 chore(release): Update version to v1.4.292 2025-08-19 00:55:22 +00:00
Kayvan Sylvan
34bc0b5e31 Merge pull request #1717 from ksylvan/0818-feature-default-model-indicator
Highlight default vendor/model in model listing
2025-08-18 17:52:57 -07:00
Kayvan Sylvan
ce59999503 feat: highlight default vendor/model in listings, pass registry defaults
CHANGES
- Update PrintWithVendor signature to accept default vendor and model
- Mark default vendor/model with asterisk in non-shell output
- Compare vendor and model case-insensitively when marking
- Pass registry defaults to PrintWithVendor from CLI
- Add test ensuring default selection appears with asterisk
- Keep shell completion output unchanged without default markers
2025-08-18 16:58:25 -07:00
Kayvan Sylvan
9bb4ccf740 docs: update version number in README updates section from v1.4.290 to v1.4.291 2025-08-18 08:13:55 -07:00
github-actions[bot]
900b13f08c chore(release): Update version to v1.4.291 2025-08-18 15:05:02 +00:00
Kayvan Sylvan
6824f0c0a7 Merge pull request #1715 from ksylvan/0818-openai-transcribe-using-openai-models
Add speech-to-text via OpenAI with transcription flags and completions
2025-08-18 08:02:36 -07:00
Kayvan Sylvan
a2481406db feat: add speech-to-text via OpenAI with transcription flags and completions
CHANGES
- Add --transcribe-file flag to transcribe audio or video
- Add --transcribe-model flag with model listing and completion
- Add --split-media-file flag to chunk files over 25MB
- Implement OpenAI transcription using Whisper and GPT-4o Transcribe
- Integrate transcription pipeline into CLI before readability processing
- Provide zsh, bash, fish completions for new transcription flags
- Validate media extensions and enforce 25MB upload limits
- Update README with release and corrected pattern link path
2025-08-18 07:59:50 -07:00
github-actions[bot]
171f7eb3ab chore(release): Update version to v1.4.290 2025-08-17 23:52:24 +00:00
Kayvan Sylvan
dccc70c433 Merge pull request #1714 from ksylvan/0817-simple-pattern-to-model-mapping-via-env-vars
Add Per-Pattern Model Mapping via Environment Variables
2025-08-17 16:49:46 -07:00
Kayvan Sylvan
e5ec9acfac feat: add per-pattern model mapping support via environment variables
• Add per-pattern model mapping documentation section
• Implement environment variable lookup for pattern-specific models
• Support vendor|model format in environment variable specification
• Check pattern-specific model when no model explicitly set
• Transform pattern names to uppercase environment variable format
• Add table of contents entry for new feature
• Enable shell startup file configuration for patterns
2025-08-17 16:15:23 -07:00
github-actions[bot]
f0eb9f90a3 chore(release): Update version to v1.4.289 2025-08-16 21:22:43 +00:00
Kayvan Sylvan
758425f98a Merge pull request #1710 from ksylvan/0816-no-variable-replacement-flag
Add `--no-variable-replacement` Flag for Literal Pattern Handling
2025-08-16 14:20:18 -07:00
Kayvan Sylvan
b4b5b0a4d9 feat: add --no-variable-replacement flag to disable pattern variable substitution
- Introduce CLI flag to skip pattern variable replacement.
- Wire flag into domain request and session builder.
- Avoid applying input variables when replacement is disabled.
- Provide PatternsEntity.GetWithoutVariables for input-only pattern processing support.
- Refactor patterns code into reusable load and apply helpers.
- Update bash, zsh, fish completions with new flag.
- Document flag in README and CLI help output.
- Add unit tests covering GetWithoutVariables path and behavior.
- Ensure {{input}} placeholder appends when missing in patterns.
2025-08-16 14:12:06 -07:00
github-actions[bot]
81a47ecab7 chore(release): Update version to v1.4.288 2025-08-16 16:19:42 +00:00
Kayvan Sylvan
0bce5c7b6e Merge pull request #1709 from ksylvan/0816-fix-youtube-transcripts
Enhanced YouTube Subtitle Language Fallback Handling
2025-08-16 09:17:09 -07:00
Kayvan Sylvan
992936dbd8 fix: improve YouTube subtitle language fallback handling in yt-dlp integration
- Fix typo "Gemmini" to "Gemini" in README
- Add "kballard" and "shellquote" to VSCode dictionary
- Add "YTDLP" to VSCode spell checker
- Enhance subtitle language options with fallback variants
- Build language options string with comma-separated alternatives
2025-08-16 09:14:03 -07:00
github-actions[bot]
48d74290f3 chore(release): Update version to v1.4.287 2025-08-16 07:29:23 +00:00
Kayvan Sylvan
3d4e967b92 Merge pull request #1706 from ksylvan/0814-readme-updates
Gemini Thinking Support and README (New Features) automation
2025-08-16 00:26:55 -07:00
Kayvan Sylvan
d8690c7cec feat: add release updates section and Gemini thinking support
- Add comprehensive "Recent Major Features" section to README
- Introduce new readme_updates Python script for automation
- Enable Gemini thinking configuration with token budgets
- Update CLI help text for Gemini thinking support
- Add comprehensive test coverage for Gemini thinking
- Create documentation for README update automation
- Reorganize README navigation structure with changelog section
2025-08-16 00:21:12 -07:00
github-actions[bot]
7eed9c3c64 chore(release): Update version to v1.4.286 2025-08-14 14:18:00 +00:00
Kayvan Sylvan
97b75cb153 Merge pull request #1700 from ksylvan/0813-thinking-flag-plus-suggest-pattern-overhault
Introduce Thinking Config Across Anthropic and OpenAI Providers
2025-08-14 07:15:40 -07:00
Kayvan Sylvan
b485a4584f refactor: extract token budget constants for thinking levels with validation bounds
## CHANGES

- Extract hardcoded token values into named constants
- Add comprehensive documentation for token budget purposes
- Implement token validation bounds (1-10000) in parsing
- Replace magic numbers with semantic constant references
- Improve code maintainability through constant extraction
2025-08-14 07:11:04 -07:00
Kayvan Sylvan
f4dbafc638 feat: add cross-provider --thinking flag mapping to Anthropic/OpenAI
CHANGES
- Add --thinking flag to set reasoning level cross-vendors
- Map Anthropic thinking levels and token budgets appropriately
- Translate OpenAI reasoning effort from thinking levels
- Propagate Thinking through ChatOptions, server, and dry-run output
- Update zsh, bash, fish completions with thinking choices
- Expand suggest_pattern docs with categories, workflows, usage examples
- Remove outdated suggest_pattern user files to avoid duplication
- Add VSCode dictionary terms: Anki, DMARC, wireframes
- Extend tests to include Thinking defaults in ChatOptions
2025-08-14 07:06:31 -07:00
github-actions[bot]
eae56e0038 chore(release): Update version to v1.4.285 2025-08-13 13:35:14 +00:00
Kayvan Sylvan
72a5e49855 Merge pull request #1698 from ksylvan/0812-claude-sonnet-1m-context
Enable One Million Token Context Beta Feature for Sonnet-4
2025-08-13 06:32:50 -07:00
Kayvan Sylvan
17b7d96da1 chore: upgrade anthropic-sdk-go to v1.9.1 and add beta feature support for context-1m
## CHANGES

- Upgrade anthropic-sdk-go from v1.7.0 to v1.9.1
- Upgrade golang.org/x/crypto from v0.39.0 to v0.40.0
- Add modelBetas map for beta feature configuration
- Implement context-1m-2025-08-07 beta for Claude Sonnet 4
- Add beta header support in streaming requests
- Add beta header support in standard requests
- Implement fallback mechanism when beta features fail
- Preserve existing beta headers in OAuth transport
- Add test coverage for model beta configuration
2025-08-12 22:30:27 -07:00
github-actions[bot]
1b2d9ec0ed chore(release): Update version to v1.4.284 2025-08-12 18:51:24 +00:00
Kayvan Sylvan
63fe320b16 Merge pull request #1695 from ksylvan/0812-make-installing-completions-super-easy
Introduce One-Liner Curl Install for Completions
2025-08-12 11:48:57 -07:00
Changelog Bot
aafca303ad chore: incoming 1695 changelog entry 2025-08-12 11:48:21 -07:00
Kayvan Sylvan
41821efd27 refactor: standardize obtain_completion_files logging; use stderr-only printf
CHANGES
- Replace print_info with tagged printf directed to stderr.
- Replace print_dry_run with tagged printf directed to stderr.
- Add comment enforcing stderr-only output inside this function.
- Preserve dry-run behavior by echoing path only on stdout.
- Retain error handling using print_error for directory creation.
- Normalize log message prefixes to [INFO] and [DRY-RUN].
- Avoid stdout pollution by routing informational messages to stderr.
2025-08-12 11:16:25 -07:00
Kayvan Sylvan
3a4082a1f3 fix: convert GitHub blob/tree URLs to raw and validate completion downloads
CHANGES
- Add helper to translate GitHub blob/tree to raw URLs
- Use effective URL in curl and wget download paths
- Validate downloaded files are non-empty and not HTML
- Redirect info and dry-run messages to standard error
- Relocate temporary directory cleanup trap into main execution
- Improve error messages when completion download sources appear invalid
2025-08-12 10:49:55 -07:00
Kayvan Sylvan
b6fa44d003 docs: add quick install method for shell completions without cloning repo
## CHANGES

- Add one-liner curl install for completions
- Support downloading completions when files missing locally
- Add dry-run option for preview changes
- Enable custom download source via environment variable
- Create temp directory for downloaded completion files
- Add automatic cleanup of temporary files
- Update documentation with new installation methods
2025-08-12 10:00:11 -07:00
82 changed files with 3909 additions and 3169 deletions

View File

@@ -1,9 +1,12 @@
## What this Pull Request (PR) does
Please briefly describe what this PR does.
## Related issues
Please reference any open issues this PR relates to in here.
If it closes an issue, type `closes #[ISSUE_NUMBER]`.
## Screenshots
Provide any screenshots you may find relevant to facilitate us understanding your PR.

View File

@@ -20,13 +20,13 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod

View File

@@ -11,22 +11,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Verify Changes in Patterns Folder
id: check-changes
run: |
git fetch origin
if git diff --quiet HEAD~1 -- data/patterns; then
echo "No changes detected in patterns folder."
exit 1
echo "changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected in patterns folder."
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Zip the Patterns Folder
if: steps.check-changes.outputs.changes == 'true'
run: zip -r patterns.zip data/patterns/
- name: Upload Patterns Artifact
if: steps.check-changes.outputs.changes == 'true'
uses: actions/upload-artifact@v4
with:
name: patterns

View File

@@ -15,149 +15,43 @@ jobs:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Run tests
run: go test -v ./...
get_version:
name: Get version
runs-on: ubuntu-latest
outputs:
latest_tag: ${{ steps.get_version.outputs.latest_tag }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from source
id: get_version
shell: bash
run: |
if [ ! -f "nix/pkgs/fabric/version.nix" ]; then
echo "Error: version.nix file not found"
exit 1
fi
version=$(cat nix/pkgs/fabric/version.nix | tr -d '"' | tr -cd '0-9.')
if [ -z "$version" ]; then
echo "Error: version is empty"
exit 1
fi
if ! echo "$version" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+' > /dev/null; then
echo "Error: Invalid version format: $version"
exit 1
fi
echo "latest_tag=v$version" >> $GITHUB_OUTPUT
build:
name: Build binaries for Windows, macOS, and Linux
needs: [test, get_version]
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [amd64, arm64]
exclude:
- os: windows-latest
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: ./go.mod
- name: Build binary on Linux and macOS
if: matrix.os != 'windows-latest'
env:
GOOS: ${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}
GOARCH: ${{ matrix.arch }}
run: |
OS_NAME="${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}"
go build -o fabric-${OS_NAME}-${{ matrix.arch }} ./cmd/fabric
- name: Build binary on Windows
if: matrix.os == 'windows-latest'
env:
GOOS: windows
GOARCH: ${{ matrix.arch }}
run: |
go build -o fabric-windows-${{ matrix.arch }}.exe ./cmd/fabric
- name: Upload build artifact
if: matrix.os != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: fabric-${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}-${{ matrix.arch }}
path: fabric-${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}-${{ matrix.arch }}
- name: Upload build artifact
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: fabric-windows-${{ matrix.arch }}.exe
path: fabric-windows-${{ matrix.arch }}.exe
- name: Create release if it doesn't exist
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if ! gh release view ${{ needs.get_version.outputs.latest_tag }} >/dev/null 2>&1; then
gh release create ${{ needs.get_version.outputs.latest_tag }} --title "Release ${{ needs.get_version.outputs.latest_tag }}" --notes "Automated release for ${{ needs.get_version.outputs.latest_tag }}"
else
echo "Release ${{ needs.get_version.outputs.latest_tag }} already exists."
fi
- name: Upload release artifact
if: matrix.os == 'windows-latest'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.get_version.outputs.latest_tag }} fabric-windows-${{ matrix.arch }}.exe
- name: Upload release artifact
if: matrix.os != 'windows-latest'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
OS_NAME="${{ matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}"
gh release upload ${{ needs.get_version.outputs.latest_tag }} fabric-${OS_NAME}-${{ matrix.arch }}
update_release_notes:
needs: [build, get_version]
# only run in main upstream repo
if: ${{ github.repository_owner == 'danielmiessler' }}
name: Build & Release with Goreleaser
needs: [test]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Update release description
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
args: release --clean
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go run ./cmd/generate_changelog --sync-db
go run ./cmd/generate_changelog --release ${{ needs.get_version.outputs.latest_tag }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Release Description
run: go run ./cmd/generate_changelog --release ${{ github.event.client_payload.tag || github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -6,7 +6,6 @@ on:
- main # Monitor the main branch
paths-ignore:
- "data/patterns/**"
- "**/*.md"
- "data/strategies/**"
- "cmd/generate_changelog/*.db"
- "cmd/generate_changelog/incoming/*.txt"
@@ -22,12 +21,13 @@ concurrency:
jobs:
update-version:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: >
${{ github.repository_owner == 'danielmiessler' }} &&
github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
fetch-depth: 0
@@ -49,12 +49,13 @@ jobs:
run: |
latest_tag=$(git tag --sort=-creatordate | head -n 1)
echo "Latest tag is: $latest_tag"
echo "tag=$latest_tag" >> $GITHUB_OUTPUT
echo "tag=$latest_tag" >> $GITHUB_ENV # Save the latest tag to environment file
- name: Increment patch version
id: increment_version
run: |
latest_tag=${{ env.tag }}
latest_tag=${{ steps.get_latest_tag.outputs.tag }}
major=$(echo "$latest_tag" | cut -d. -f1 | sed 's/v//')
minor=$(echo "$latest_tag" | cut -d. -f2)
patch=$(echo "$latest_tag" | cut -d. -f3)
@@ -62,19 +63,21 @@ jobs:
new_version="${major}.${minor}.${new_patch}"
new_tag="v${new_version}"
echo "New version is: $new_version"
echo "new_version=$new_version" >> $GITHUB_OUTPUT
echo "new_version=$new_version" >> $GITHUB_ENV # Save the new version to environment file
echo "New tag is: $new_tag"
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
echo "new_tag=$new_tag" >> $GITHUB_ENV # Save the new tag to environment file
- name: Update version.go file
run: |
echo "package main" > cmd/fabric/version.go
echo "" >> cmd/fabric/version.go
echo "var version = \"${{ env.new_tag }}\"" >> cmd/fabric/version.go
echo "var version = \"${{ steps.increment_version.outputs.new_tag }}\"" >> cmd/fabric/version.go
- name: Update version.nix file
run: |
echo "\"${{ env.new_version }}\"" > nix/pkgs/fabric/version.nix
echo "\"${{ steps.increment_version.outputs.new_version }}\"" > nix/pkgs/fabric/version.nix
- name: Format source code
run: |
@@ -88,7 +91,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go run ./cmd/generate_changelog --process-prs ${{ env.new_tag }}
go run ./cmd/generate_changelog --process-prs ${{ steps.increment_version.outputs.new_tag }}
go run ./cmd/generate_changelog --sync-db
- name: Commit changes
run: |
@@ -101,7 +104,7 @@ jobs:
# and removing the incoming/ directory.
if ! git diff --staged --quiet; then
git commit -m "chore(release): Update version to ${{ env.new_tag }}"
git commit -m "chore(release): Update version to ${{ steps.increment_version.outputs.new_tag }}"
else
echo "No changes to commit."
fi
@@ -114,10 +117,10 @@ jobs:
- name: Create a new tag
env:
GITHUB_TOKEN: ${{ secrets.TAG_PAT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }} # Push the new tag
git tag ${{ steps.increment_version.outputs.new_tag }}
git push origin ${{ steps.increment_version.outputs.new_tag }} # Push the new tag
- name: Dispatch event to trigger release workflow
env:
@@ -127,4 +130,4 @@ jobs:
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/dispatches \
-d '{"event_type": "tag_created", "client_payload": {"tag": "${{ env.new_tag }}"}}'
-d '{"event_type": "tag_created", "client_payload": {"tag": "${{ steps.increment_version.outputs.new_tag }}"}}'

36
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,36 @@
# Read the documentation at https://goreleaser.com
version: 2
project_name: fabric
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
main: ./cmd/fabric
binary: fabric
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
formats: [zip]

23
.vscode/settings.json vendored
View File

@@ -4,6 +4,7 @@
"addextension",
"adduser",
"AIML",
"Anki",
"anthropics",
"Aoede",
"atotto",
@@ -12,6 +13,7 @@
"Behrens",
"blindspots",
"Bombal",
"Buildx",
"Callirhoe",
"Callirrhoe",
"Cerebras",
@@ -24,15 +26,19 @@
"danielmiessler",
"davidanson",
"Debugf",
"debuglog",
"dedup",
"deepseek",
"Despina",
"direnv",
"DMARC",
"DOCKERHUB",
"dryrun",
"dsrp",
"editability",
"Eisler",
"elif",
"Elister",
"envrc",
"Erinome",
"Errorf",
@@ -53,11 +59,13 @@
"godotenv",
"gofmt",
"goimports",
"golint",
"gomod",
"gonic",
"goopenai",
"GOPATH",
"gopkg",
"Goreleaser",
"GOROOT",
"Graphviz",
"grokai",
@@ -69,10 +77,12 @@
"Hormozi's",
"horts",
"HTMLURL",
"imagetools",
"jaredmontoya",
"jessevdk",
"Jina",
"joho",
"kballard",
"Keploy",
"Kore",
"ksylvan",
@@ -96,12 +106,17 @@
"mbed",
"metacharacters",
"Miessler",
"modeline",
"modelines",
"mpga",
"nometa",
"numpy",
"ollama",
"ollamaapi",
"Omri",
"openaiapi",
"opencode",
"opencontainers",
"openrouter",
"Orus",
"osascript",
@@ -127,6 +142,9 @@
"seaborn",
"semgrep",
"sess",
"sgaunet",
"shellquote",
"SSEHTTP",
"storer",
"Streamlit",
"stretchr",
@@ -147,13 +165,16 @@
"videoid",
"webp",
"WEBVTT",
"winget",
"wipecontext",
"wipesession",
"wireframes",
"Worktree",
"writeups",
"xclip",
"yourpatternname",
"youtu"
"youtu",
"YTDLP"
],
"cSpell.ignorePaths": ["go.mod", ".gitignore", "CHANGELOG.md"],
"markdownlint.config": {

View File

@@ -1,5 +1,238 @@
# Changelog
## v1.4.306 (2025-09-01)
### PR [#1742](https://github.com/danielmiessler/Fabric/pull/1742) by [ksylvan](https://github.com/ksylvan): Documentation and Pattern Updates
- Add winget installation method for Windows users
- Include Docker Hub and GHCR image references with docker run examples
- Remove deprecated PowerShell download link and unused show_fabric_options_markmap pattern
- Update suggest_pattern with new AI patterns
- Add personal development patterns for storytelling
## v1.4.305 (2025-08-31)
### PR [#1741](https://github.com/danielmiessler/Fabric/pull/1741) by [ksylvan](https://github.com/ksylvan): CI: Fix Release Description Update
- Fix: update release workflow to support manual dispatch with custom tag
- Support custom tag from client payload in workflow
- Fallback to github.ref_name when no custom tag provided
- Enable manual release triggers with specified tag parameter
## v1.4.304 (2025-08-31)
### PR [#1740](https://github.com/danielmiessler/Fabric/pull/1740) by [ksylvan](https://github.com/ksylvan): Restore our custom Changelog Updates in GitHub Actions
- Add changelog generation step to GitHub release workflow
- Create updateReleaseForRepo helper method for release updates
- Add fork detection logic in UpdateReleaseDescription method
- Implement upstream repository release update for forks
- Enhance error handling with detailed repository context
## v1.4.303 (2025-08-28)
### PR [#1736](https://github.com/danielmiessler/Fabric/pull/1736) by [tonymet](https://github.com/tonymet): Winget Publishing and GoReleaser
- Added GoReleaser support for improved package distribution
- Winget and Docker publishing moved to ksylvan/fabric-packager GitHub repo
- Hardened release pipeline by gating workflows to upstream owner only
- Migrated from custom tokens to built-in GITHUB_TOKEN for enhanced security
- Removed docker-publish-on-tag workflow to reduce duplication and complexity
- Added ARM binary release support with updated documentation
## v1.4.302 (2025-08-28)
### PR [#1737](https://github.com/danielmiessler/Fabric/pull/1737) by [ksylvan](https://github.com/ksylvan) and [OmriH-Elister](https://github.com/OmriH-Elister): Add New Psychological Analysis Patterns + devalue version bump
- Add create_story_about_person system pattern with narrative workflow
- Add heal_person system pattern for compassionate healing plans
- Update pattern_explanations to register new patterns and renumber indices
- Extend pattern_descriptions with entries, tags, and concise descriptions
- Bump devalue dependency from 5.1.1 to 5.3.2
## v1.4.301 (2025-08-28)
### PR [#1735](https://github.com/danielmiessler/Fabric/pull/1735) by [ksylvan](https://github.com/ksylvan): Fix Docker Build Path Configuration
- Fix: update Docker workflow to use specific Dockerfile and monitor markdown file changes
- Add explicit Dockerfile path to Docker build action
- Remove markdown files from workflow paths-ignore filter
- Enable CI triggers for documentation file changes
- Specify Docker build context with custom file location
## v1.4.300 (2025-08-28)
### PR [#1732](https://github.com/danielmiessler/Fabric/pull/1732) by [ksylvan](https://github.com/ksylvan): CI Infra: Changelog Generation Tool + Docker Image Pubishing
- Add GitHub Actions workflow to publish Docker images on tags
- Build multi-arch images with Buildx and QEMU across amd64, arm64
- Tag images using semver; push to GHCR and Docker Hub
- Gate patterns workflow steps on detected changes instead of failing
- Auto-detect GitHub owner and repo from git remote URL
## v1.4.299 (2025-08-27)
### PR [#1731](https://github.com/danielmiessler/Fabric/pull/1731) by [ksylvan](https://github.com/ksylvan): chore: upgrade ollama dependency from v0.9.0 to v0.11.7
- Updated ollama package from version 0.9.0 to 0.11.7
- Fixed 8 security vulnerabilities including 5 high-severity CVEs that could cause denial of service attacks
- Patched Ollama server vulnerabilities related to division by zero errors and memory exhaustion
- Resolved security flaws that allowed malicious GGUF model file uploads to crash the server
- Enhanced system stability and security posture through comprehensive dependency upgrade
## v1.4.298 (2025-08-27)
### PR [#1730](https://github.com/danielmiessler/Fabric/pull/1730) by [ksylvan](https://github.com/ksylvan): Modernize Dockerfile with Best Practices Implementation
- Remove docker-test framework and simplify production docker setup by eliminating complex testing infrastructure
- Delete entire docker-test directory including test runner scripts and environment configuration files
- Implement multi-stage build optimization in production Dockerfile to improve build efficiency
- Remove docker-compose.yml and start-docker.sh helper scripts to streamline container workflow
- Update README documentation with cleaner Docker usage instructions and reduced image size benefits
## v1.4.297 (2025-08-26)
### PR [#1729](https://github.com/danielmiessler/Fabric/pull/1729) by [ksylvan](https://github.com/ksylvan): Add GitHub Community Health Documents
- Add CODE_OF_CONDUCT defining respectful, collaborative community behavior
- Add CONTRIBUTING with setup, testing, PR, changelog requirements
- Add SECURITY policy with reporting process and response timelines
- Add SUPPORT guide for bugs, features, discussions, expectations
- Add docs README indexing guides, quick starts, contributor essentials
## v1.4.296 (2025-08-26)
### PR [#1728](https://github.com/danielmiessler/Fabric/pull/1728) by [ksylvan](https://github.com/ksylvan): Refactor Logging System to Use Centralized Debug Logger
- Replace fmt.Fprintf/os.Stderr with centralized debuglog.Log across CLI and add unconditional Log function for important messages
- Improve OAuth flow messaging and token refresh diagnostics with better error handling
- Update tests to capture debuglog output via SetOutput for better test coverage
- Convert Perplexity streaming errors to unified debug logging and emit file write notifications through debuglog
- Standardize extension registry warnings and announce large audio processing steps via centralized logger
## v1.4.295 (2025-08-24)
### PR [#1727](https://github.com/danielmiessler/Fabric/pull/1727) by [ksylvan](https://github.com/ksylvan): Standardize Anthropic Beta Failure Logging
- Refactor: route Anthropic beta failure logs through internal debug logger
- Replace fmt.Fprintf stderr with debuglog.Debug for beta failures
- Import internal log package and remove os dependency
- Standardize logging level to debuglog.Basic for beta errors
- Preserve fallback stream behavior when beta features fail
## v1.4.294 (2025-08-20)
### PR [#1723](https://github.com/danielmiessler/Fabric/pull/1723) by [ksylvan](https://github.com/ksylvan): docs: update README with Venice AI provider and Windows install script
- Add Venice AI provider configuration with API endpoint
- Document Venice AI as privacy-first open-source provider
- Include PowerShell installation script for Windows users
- Add debug levels section to table of contents
- Update recent major features with v1.4.294 release notes
## v1.4.293 (2025-08-19)
### PR [#1718](https://github.com/danielmiessler/Fabric/pull/1718) by [ksylvan](https://github.com/ksylvan): Implement Configurable Debug Logging Levels
- Add --debug flag controlling runtime logging verbosity levels
- Introduce internal/log package with Off, Basic, Detailed, Trace
- Replace ad-hoc Debugf and globals with centralized debug logger
- Wire debug level during early CLI argument parsing
- Add bash, zsh, fish completions for --debug levels
## v1.4.292 (2025-08-18)
### PR [#1717](https://github.com/danielmiessler/Fabric/pull/1717) by [ksylvan](https://github.com/ksylvan): Highlight default vendor/model in model listing
- Update PrintWithVendor signature to accept default vendor and model
- Mark default vendor/model with asterisk in non-shell output
- Compare vendor and model case-insensitively when marking
- Pass registry defaults to PrintWithVendor from CLI
- Add test ensuring default selection appears with asterisk
### Direct commits
- Docs: update version number in README updates section from v1.4.290 to v1.4.291
## v1.4.291 (2025-08-18)
### PR [#1715](https://github.com/danielmiessler/Fabric/pull/1715) by [ksylvan](https://github.com/ksylvan): feat: add speech-to-text via OpenAI with transcription flags and comp…
- Add --transcribe-file flag to transcribe audio or video
- Add --transcribe-model flag with model listing and completion
- Add --split-media-file flag to chunk files over 25MB
- Implement OpenAI transcription using Whisper and GPT-4o Transcribe
- Integrate transcription pipeline into CLI before readability processing
## v1.4.290 (2025-08-17)
### PR [#1714](https://github.com/danielmiessler/Fabric/pull/1714) by [ksylvan](https://github.com/ksylvan): feat: add per-pattern model mapping support via environment variables
- Add per-pattern model mapping support via environment variables
- Implement environment variable lookup for pattern-specific models
- Support vendor|model format in environment variable specification
- Enable shell startup file configuration for patterns
- Transform pattern names to uppercase environment variable format
## v1.4.289 (2025-08-16)
### PR [#1710](https://github.com/danielmiessler/Fabric/pull/1710) by [ksylvan](https://github.com/ksylvan): feat: add --no-variable-replacement flag to disable pattern variable …
- Add --no-variable-replacement flag to disable pattern variable substitution
- Introduce CLI flag to skip pattern variable replacement and wire it into domain request and session builder
- Provide PatternsEntity.GetWithoutVariables for input-only pattern processing support
- Refactor patterns code into reusable load and apply helpers
- Update bash, zsh, fish completions with new flag and document in README and CLI help output
## v1.4.288 (2025-08-16)
### PR [#1709](https://github.com/danielmiessler/Fabric/pull/1709) by [ksylvan](https://github.com/ksylvan): Enhanced YouTube Subtitle Language Fallback Handling
- Fix: improve YouTube subtitle language fallback handling in yt-dlp integration
- Fix typo "Gemmini" to "Gemini" in README
- Add "kballard" and "shellquote" to VSCode dictionary
- Add "YTDLP" to VSCode spell checker
- Enhance subtitle language options with fallback variants
## v1.4.287 (2025-08-14)
### PR [#1706](https://github.com/danielmiessler/Fabric/pull/1706) by [ksylvan](https://github.com/ksylvan): Gemini Thinking Support and README (New Features) automation
- Add comprehensive "Recent Major Features" section to README
- Introduce new readme_updates Python script for automation
- Enable Gemini thinking configuration with token budgets
- Update CLI help text for Gemini thinking support
- Add comprehensive test coverage for Gemini thinking
## v1.4.286 (2025-08-14)
### PR [#1700](https://github.com/danielmiessler/Fabric/pull/1700) by [ksylvan](https://github.com/ksylvan): Introduce Thinking Config Across Anthropic and OpenAI Providers
- Add --thinking CLI flag for configurable reasoning levels across providers
- Implement Anthropic ThinkingConfig with standardized budgets and tokens
- Map OpenAI reasoning effort from thinking levels
- Show thinking level in dry-run formatted options
- Overhaul suggest_pattern docs with categories, workflows, usage examples
## v1.4.285 (2025-08-13)
### PR [#1698](https://github.com/danielmiessler/Fabric/pull/1698) by [ksylvan](https://github.com/ksylvan): Enable One Million Token Context Beta Feature for Sonnet-4
- Chore: upgrade anthropic-sdk-go to v1.9.1 and add beta feature support for context-1m
- Add modelBetas map for beta feature configuration
- Implement context-1m-2025-08-07 beta for Claude Sonnet 4
- Add beta header support with fallback handling
- Preserve existing beta headers in OAuth transport
## v1.4.284 (2025-08-12)
### PR [#1695](https://github.com/danielmiessler/Fabric/pull/1695) by [ksylvan](https://github.com/ksylvan): Introduce One-Liner Curl Install for Completions
- Add one-liner curl install method for shell completions without requiring repository cloning
- Support downloading completions when files are missing locally with dry-run option for previewing changes
- Enable custom download source via environment variable and create temporary directory for downloaded completion files
- Add automatic cleanup of temporary files and validate downloaded files are non-empty and not HTML
- Improve error handling and standardize logging by routing informational messages to stderr to avoid stdout pollution
## v1.4.283 (2025-08-12)
### PR [#1692](https://github.com/danielmiessler/Fabric/pull/1692) by [ksylvan](https://github.com/ksylvan): Add Vendor Selection Support for Models

148
README.md
View File

@@ -47,6 +47,55 @@ It's all really exciting and powerful, but _it's not easy to integrate this func
Fabric organizes prompts by real-world task, allowing people to create, collect, and organize their most important AI solutions in a single place for use in their favorite tools. And if you're command-line focused, you can use Fabric itself as the interface!
## Updates
Dear Users,
We've been doing so many exciting things here at Fabric, I wanted to give a quick summary here to give you a sense of our development velocity!
Below are the **new features and capabilities** we've added (newest first):
### Recent Major Features
- [v1.4.303](https://github.com/danielmiessler/fabric/releases/tag/v1.4.303) (Aug 29, 2025) — **New Binary Releases**: Linux ARM and Windows ARM targets. You can run Fabric on the Raspberry PI and on your Windows Surface!
- [v1.4.294](https://github.com/danielmiessler/fabric/releases/tag/v1.4.294) (Aug 20, 2025) — **Venice AI Support**: Added the Venice AI provider. Venice is a Privacy-First, Open-Source AI provider. See their ["About Venice"](https://docs.venice.ai/overview/about-venice) page for details.
- [v1.4.291](https://github.com/danielmiessler/fabric/releases/tag/v1.4.291) (Aug 18, 2025) — **Speech To Text**: Add OpenAI speech-to-text support with `--transcribe-file`, `--transcribe-model`, and `--split-media-file` flags.
- [v1.4.287](https://github.com/danielmiessler/fabric/releases/tag/v1.4.287) (Aug 16, 2025) — **AI Reasoning**: Add Thinking to Gemini models and introduce `readme_updates` python script
- [v1.4.286](https://github.com/danielmiessler/fabric/releases/tag/v1.4.286) (Aug 14, 2025) — **AI Reasoning**: Introduce Thinking Config Across Anthropic and OpenAI Providers
- [v1.4.285](https://github.com/danielmiessler/fabric/releases/tag/v1.4.285) (Aug 13, 2025) — **Extended Context**: Enable One Million Token Context Beta Feature for Sonnet-4
- [v1.4.284](https://github.com/danielmiessler/fabric/releases/tag/v1.4.284) (Aug 12, 2025) — **Easy Shell Completions Setup**: Introduce One-Liner Curl Install for Completions
- [v1.4.283](https://github.com/danielmiessler/fabric/releases/tag/v1.4.283) (Aug 12, 2025) — **Model Management**: Add Vendor Selection Support for Models
- [v1.4.282](https://github.com/danielmiessler/fabric/releases/tag/v1.4.282) (Aug 11, 2025) — **Enhanced Shell Completions**: Enhanced Shell Completions for Fabric CLI Binaries
- [v1.4.281](https://github.com/danielmiessler/fabric/releases/tag/v1.4.281) (Aug 11, 2025) — **Gemini Search Tool**: Add Web Search Tool Support for Gemini Models
- [v1.4.278](https://github.com/danielmiessler/fabric/releases/tag/v1.4.278) (Aug 9, 2025) — **Enhance YouTube Transcripts**: Enhance YouTube Support with Custom yt-dlp Arguments
- [v1.4.277](https://github.com/danielmiessler/fabric/releases/tag/v1.4.277) (Aug 8, 2025) — **Desktop Notifications**: Add cross-platform desktop notifications to Fabric CLI
- [v1.4.274](https://github.com/danielmiessler/fabric/releases/tag/v1.4.274) (Aug 7, 2025) — **Claude 4.1 Added**: Add Support for Claude Opus 4.1 Model
- [v1.4.271](https://github.com/danielmiessler/fabric/releases/tag/v1.4.271) (Jul 28, 2025) — **AI Summarized Release Notes**: Enable AI summary updates for GitHub releases
- [v1.4.268](https://github.com/danielmiessler/fabric/releases/tag/v1.4.268) (Jul 26, 2025) — **Gemini TTS Voice Selection**: add Gemini TTS voice selection and listing functionality
- [v1.4.267](https://github.com/danielmiessler/fabric/releases/tag/v1.4.267) (Jul 26, 2025) — **Text-to-Speech**: Update Gemini Plugin to New SDK with TTS Support
- [v1.4.258](https://github.com/danielmiessler/fabric/releases/tag/v1.4.258) (Jul 17, 2025) — **Onboarding Improved**: Add startup check to initialize config and .env file automatically
- [v1.4.257](https://github.com/danielmiessler/fabric/releases/tag/v1.4.257) (Jul 17, 2025) — **OpenAI Routing Control**: Introduce CLI Flag to Disable OpenAI Responses API
- [v1.4.252](https://github.com/danielmiessler/fabric/releases/tag/v1.4.252) (Jul 16, 2025) — **Hide Thinking Block**: Optional Hiding of Model Thinking Process with Configurable Tags
- [v1.4.246](https://github.com/danielmiessler/fabric/releases/tag/v1.4.246) (Jul 14, 2025) — **Automatic ChangeLog Updates**: Add AI-powered changelog generation with high-performance Go tool and comprehensive caching
- [v1.4.245](https://github.com/danielmiessler/fabric/releases/tag/v1.4.245) (Jul 11, 2025) — **Together AI**: Together AI Support with OpenAI Fallback Mechanism Added
- [v1.4.232](https://github.com/danielmiessler/fabric/releases/tag/v1.4.232) (Jul 6, 2025) — **Add Custom**: Add Custom Patterns Directory Support
- [v1.4.231](https://github.com/danielmiessler/fabric/releases/tag/v1.4.231) (Jul 5, 2025) — **OAuth Auto-Auth**: OAuth Authentication Support for Anthropic (Use your Max Subscription)
- [v1.4.230](https://github.com/danielmiessler/fabric/releases/tag/v1.4.230) (Jul 5, 2025) — **Model Management**: Add advanced image generation parameters for OpenAI models with four new CLI flags
- [v1.4.227](https://github.com/danielmiessler/fabric/releases/tag/v1.4.227) (Jul 4, 2025) — **Add Image**: Add Image Generation Support to Fabric
- [v1.4.226](https://github.com/danielmiessler/fabric/releases/tag/v1.4.226) (Jul 4, 2025) — **Web Search**: OpenAI Plugin Now Supports Web Search Functionality
- [v1.4.225](https://github.com/danielmiessler/fabric/releases/tag/v1.4.225) (Jul 4, 2025) — **Web Search**: Runtime Web Search Control via Command-Line `--search` Flag
- [v1.4.224](https://github.com/danielmiessler/fabric/releases/tag/v1.4.224) (Jul 1, 2025) — **Add code_review**: Add code_review pattern and updates in Pattern_Descriptions
- [v1.4.222](https://github.com/danielmiessler/fabric/releases/tag/v1.4.222) (Jul 1, 2025) — **OpenAI Plugin**: OpenAI Plugin Migrates to New Responses API
- [v1.4.218](https://github.com/danielmiessler/fabric/releases/tag/v1.4.218) (Jun 27, 2025) — **Model Management**: Add Support for OpenAI Search and Research Model Variants
- [v1.4.217](https://github.com/danielmiessler/fabric/releases/tag/v1.4.217) (Jun 26, 2025) — **New YouTube**: New YouTube Transcript Endpoint Added to REST API
- [v1.4.212](https://github.com/danielmiessler/fabric/releases/tag/v1.4.212) (Jun 23, 2025) — **Add Langdock**: Add Langdock AI and enhance generic OpenAI compatible support
- [v1.4.211](https://github.com/danielmiessler/fabric/releases/tag/v1.4.211) (Jun 19, 2025) — **REST API**: REST API and Web UI Now Support Dynamic Pattern Variables
- [v1.4.210](https://github.com/danielmiessler/fabric/releases/tag/v1.4.210) (Jun 18, 2025) — **Add Citations**: Add Citation Support to Perplexity Response
- [v1.4.208](https://github.com/danielmiessler/fabric/releases/tag/v1.4.208) (Jun 17, 2025) — **Add Perplexity**: Add Perplexity AI Provider with Token Limits Support
- [v1.4.203](https://github.com/danielmiessler/fabric/releases/tag/v1.4.203) (Jun 14, 2025) — **Add Amazon Bedrock**: Add support for Amazon Bedrock
These features represent our commitment to making Fabric the most powerful and flexible AI augmentation framework available!
## Intro videos
Keep in mind that many of these were recorded when Fabric was Python-based, so remember to use the current [install instructions](#installation) below.
@@ -60,9 +109,11 @@ Keep in mind that many of these were recorded when Fabric was Python-based, so r
- [`fabric`](#fabric)
- [What and why](#what-and-why)
- [Updates](#updates)
- [Recent Major Features](#recent-major-features)
- [Intro videos](#intro-videos)
- [Navigation](#navigation)
- [Updates](#updates)
- [Changelog](#changelog)
- [Philosophy](#philosophy)
- [Breaking problems into components](#breaking-problems-into-components)
- [Too many prompts](#too-many-prompts)
@@ -76,18 +127,23 @@ Keep in mind that many of these were recorded when Fabric was Python-based, so r
- [Using package managers](#using-package-managers)
- [macOS (Homebrew)](#macos-homebrew)
- [Arch Linux (AUR)](#arch-linux-aur)
- [Windows](#windows-1)
- [From Source](#from-source)
- [Docker](#docker)
- [Environment Variables](#environment-variables)
- [Setup](#setup)
- [Per-Pattern Model Mapping](#per-pattern-model-mapping)
- [Add aliases for all patterns](#add-aliases-for-all-patterns)
- [Save your files in markdown using aliases](#save-your-files-in-markdown-using-aliases)
- [Migration](#migration)
- [Upgrading](#upgrading)
- [Shell Completions](#shell-completions)
- [Quick install (no clone required)](#quick-install-no-clone-required)
- [Zsh Completion](#zsh-completion)
- [Bash Completion](#bash-completion)
- [Fish Completion](#fish-completion)
- [Usage](#usage)
- [Debug Levels](#debug-levels)
- [Our approach to prompting](#our-approach-to-prompting)
- [Examples](#examples)
- [Just use the Patterns](#just-use-the-patterns)
@@ -111,7 +167,7 @@ Keep in mind that many of these were recorded when Fabric was Python-based, so r
<br />
## Updates
## Changelog
Fabric is evolving rapidly.
@@ -156,7 +212,16 @@ To install Fabric, you can use the latest release binaries or install it from th
#### Windows
`https://github.com/danielmiessler/fabric/releases/latest/download/fabric-windows-amd64.exe`
Via PowerShell, just copy and paste and run the following snippet to install the binary into `{HOME}\.local\bin`. Please make sure that directory is included in your `PATH`.
```powershell
$ErrorActionPreference = "Stop"
$LATEST="https://github.com/danielmiessler/fabric/releases/latest/download/fabric-windows-amd64.exe"
$DIR="${HOME}\.local\bin"
New-Item -Path $DIR -ItemType Directory -Force
Invoke-WebRequest -URI "${LATEST}" -outfile "${DIR}\fabric.exe"
& "${DIR}\fabric.exe" /version
```
#### macOS (arm64)
@@ -191,6 +256,12 @@ alias fabric='fabric-ai'
`yay -S fabric-ai`
#### Windows
Use the official Microsoft supported `Winget` tool:
`winget install danielmiessler.Fabric`
### From Source
To install Fabric, [make sure Go is installed](https://go.dev/doc/install), and then run the following command.
@@ -200,6 +271,35 @@ To install Fabric, [make sure Go is installed](https://go.dev/doc/install), and
go install github.com/danielmiessler/fabric/cmd/fabric@latest
```
### Docker
Run Fabric using pre-built Docker images:
```bash
# Use latest image from Docker Hub
docker run --rm -it kayvan/fabric:latest --version
# Use specific version from GHCR
docker run --rm -it ghcr.io/ksylvan/fabric:v1.4.305 --version
# Run setup (first time)
mkdir -p $HOME/.fabric-config
docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:latest --setup
# Use Fabric with your patterns
docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:latest -p summarize
# Run the REST API server
docker run --rm -it -p 8080:8080 -v $HOME/.fabric-config:/root/.config/fabric kayvan/fabric:latest --serve
```
**Images available at:**
- Docker Hub: [kayvan/fabric](https://hub.docker.com/repository/docker/kayvan/fabric/general)
- GHCR: [ksylvan/fabric](https://github.com/ksylvan/fabric/pkgs/container/fabric)
See [scripts/docker/README.md](./scripts/docker/README.md) for building custom images and advanced configuration.
### Environment Variables
You may need to set some environment variables in your `~/.bashrc` on linux or `~/.zshrc` file on mac to be able to run the `fabric` command. Here is an example of what you can add:
@@ -235,6 +335,13 @@ fabric --setup
If everything works you are good to go.
### Per-Pattern Model Mapping
You can configure specific models for individual patterns using environment variables
like `FABRIC_MODEL_PATTERN_NAME=vendor|model`
This makes it easy to maintain these per-pattern model mappings in your shell startup files.
### Add aliases for all patterns
In order to add aliases for all your patterns and use them directly as commands ie. `summarize` instead of `fabric --pattern summarize`
@@ -428,6 +535,25 @@ Fabric provides shell completion scripts for Zsh, Bash, and Fish
shells, making it easier to use the CLI by providing tab completion
for commands and options.
#### Quick install (no clone required)
You can install completions directly via a one-liner:
```bash
curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh | sh
```
Optional variants:
```bash
# Dry-run (see actions without changing your system)
curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh | sh -s -- --dry-run
# Override the download source (advanced)
FABRIC_COMPLETIONS_BASE_URL="https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions" \
sh -c "$(curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh)"
```
#### Zsh Completion
To enable Zsh completion:
@@ -523,6 +649,7 @@ Application Options:
--printsession= Print session
--readability Convert HTML input into a clean, readable view
--input-has-vars Apply variables to user input
--no-variable-replacement Disable pattern variable replacement
--dry-run Show what would be sent to the model without actually sending it
--serve Serve the Fabric Rest API
--serveOllama Serve the Fabric Rest API with ollama endpoints
@@ -556,11 +683,22 @@ Application Options:
--notification-command= Custom command to run for notifications (overrides built-in
notifications)
--yt-dlp-args= Additional arguments to pass to yt-dlp (e.g. '--cookies-from-browser brave')
--thinking= Set reasoning/thinking level (e.g., off, low, medium, high, or
numeric tokens for Anthropic or Google Gemini)
--debug= Set debug level (0: off, 1: basic, 2: detailed, 3: trace)
Help Options:
-h, --help Show this help message
```
### Debug Levels
Use the `--debug` flag to control runtime logging:
- `0`: off (default)
- `1`: basic debug info
- `2`: detailed debugging
- `3`: trace level
## Our approach to prompting
Fabric _Patterns_ are different than most prompts you'll see.
@@ -570,7 +708,7 @@ Fabric _Patterns_ are different than most prompts you'll see.
Here's an example of a Fabric Pattern.
```bash
https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md
https://github.com/danielmiessler/Fabric/blob/main/data/patterns/extract_wisdom/system.md
```
<img width="1461" alt="pattern-example" src="https://github.com/danielmiessler/fabric/assets/50654/b910c551-9263-405f-9735-71ca69bbab6d">

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.283"
var version = "v1.4.306"

Binary file not shown.

View File

@@ -3,6 +3,9 @@ package internal
import (
"context"
"fmt"
"os/exec"
"regexp"
"strings"
"github.com/danielmiessler/fabric/cmd/generate_changelog/internal/cache"
"github.com/danielmiessler/fabric/cmd/generate_changelog/internal/config"
@@ -17,17 +20,50 @@ type ReleaseManager struct {
repo string
}
// getGitHubInfo extracts owner and repo from git remote origin URL
func getGitHubInfo() (owner, repo string, err error) {
cmd := exec.Command("git", "remote", "get-url", "origin")
output, err := cmd.Output()
if err != nil {
return "", "", fmt.Errorf("failed to get git remote URL: %w", err)
}
url := strings.TrimSpace(string(output))
// Handle both SSH and HTTPS URLs
// SSH: git@github.com:owner/repo.git
// HTTPS: https://github.com/owner/repo.git
var re *regexp.Regexp
if strings.HasPrefix(url, "git@") {
re = regexp.MustCompile(`git@github\.com:([^/]+)/([^/.]+)(?:\.git)?`)
} else {
re = regexp.MustCompile(`https://github\.com/([^/]+)/([^/.]+)(?:\.git)?`)
}
matches := re.FindStringSubmatch(url)
if len(matches) < 3 {
return "", "", fmt.Errorf("invalid GitHub URL format: %s", url)
}
return matches[1], matches[2], nil
}
func NewReleaseManager(cfg *config.Config) (*ReleaseManager, error) {
cache, err := cache.New(cfg.CacheFile)
if err != nil {
return nil, fmt.Errorf("failed to create cache: %w", err)
}
owner, repo, err := getGitHubInfo()
if err != nil {
return nil, fmt.Errorf("failed to get GitHub repository info: %w", err)
}
return &ReleaseManager{
cache: cache,
githubToken: cfg.GitHubToken,
owner: "danielmiessler",
repo: "fabric",
owner: owner,
repo: repo,
}, nil
}
@@ -65,17 +101,49 @@ func (rm *ReleaseManager) UpdateReleaseDescription(version string) error {
client = github.NewClient(nil)
}
release, _, err := client.Repositories.GetReleaseByTag(ctx, rm.owner, rm.repo, version)
// Check if current repository is a fork by getting repo details
repo, _, err := client.Repositories.Get(ctx, rm.owner, rm.repo)
if err != nil {
return fmt.Errorf("failed to get repository info: %w", err)
}
// If repository is a fork, try updating the upstream (parent) repository first
if repo.Parent != nil {
parentOwner := repo.Parent.Owner.GetLogin()
parentRepo := repo.Parent.GetName()
fmt.Printf("Repository is a fork of %s/%s, attempting to update upstream release...\n", parentOwner, parentRepo)
err := rm.updateReleaseForRepo(ctx, client, parentOwner, parentRepo, version, releaseBody)
if err == nil {
fmt.Printf("Successfully updated release description for %s in upstream repository %s/%s\n", version, parentOwner, parentRepo)
return nil
}
fmt.Printf("Failed to update upstream repository: %v\nFalling back to current repository...\n", err)
}
// Update current repository (either not a fork or upstream update failed)
err = rm.updateReleaseForRepo(ctx, client, rm.owner, rm.repo, version, releaseBody)
if err != nil {
return fmt.Errorf("failed to update release description for version %s in repository %s/%s: %w", version, rm.owner, rm.repo, err)
}
fmt.Printf("Successfully updated release description for %s in repository %s/%s\n", version, rm.owner, rm.repo)
return nil
}
func (rm *ReleaseManager) updateReleaseForRepo(ctx context.Context, client *github.Client, owner, repo, version, releaseBody string) error {
release, _, err := client.Repositories.GetReleaseByTag(ctx, owner, repo, version)
if err != nil {
return fmt.Errorf("failed to get release for version %s: %w", version, err)
}
release.Body = &releaseBody
_, _, err = client.Repositories.EditRelease(ctx, rm.owner, rm.repo, *release.ID, release)
_, _, err = client.Repositories.EditRelease(ctx, owner, repo, *release.ID, release)
if err != nil {
return fmt.Errorf("failed to update release description for version %s: %w", version, err)
}
fmt.Printf("Successfully updated release description for %s\n", version)
return nil
}

View File

@@ -59,6 +59,13 @@ _fabric_gemini_voices() {
compadd -X "Gemini TTS Voices:" ${voices}
}
_fabric_transcription_models() {
local -a models
local cmd=${words[1]}
models=(${(f)"$($cmd --list-transcription-models --shell-complete-list 2>/dev/null)"})
compadd -X "Transcription Models:" ${models}
}
_fabric() {
local curcontext="$curcontext" state line
typeset -A opt_args
@@ -100,12 +107,14 @@ _fabric() {
'(-u --scrape_url)'{-u,--scrape_url}'[Scrape website URL to markdown using Jina AI]:url:' \
'(-q --scrape_question)'{-q,--scrape_question}'[Search question using Jina AI]:question:' \
'(-e --seed)'{-e,--seed}'[Seed to be used for LMM generation]:seed:' \
'(--thinking)--thinking[Set reasoning/thinking level]:level:(off low medium high)' \
'(-w --wipecontext)'{-w,--wipecontext}'[Wipe context]:context:_fabric_contexts' \
'(-W --wipesession)'{-W,--wipesession}'[Wipe session]:session:_fabric_sessions' \
'(--printcontext)--printcontext[Print context]:context:_fabric_contexts' \
'(--printsession)--printsession[Print session]:session:_fabric_sessions' \
'(--readability)--readability[Convert HTML input into a clean, readable view]' \
'(--input-has-vars)--input-has-vars[Apply variables to user input]' \
'(--no-variable-replacement)--no-variable-replacement[Disable pattern variable replacement]' \
'(--dry-run)--dry-run[Show what would be sent to the model without actually sending it]' \
'(--serve)--serve[Serve the Fabric Rest API]' \
'(--serveOllama)--serveOllama[Serve the Fabric Rest API with ollama endpoints]' \
@@ -133,6 +142,10 @@ _fabric() {
'(--think-start-tag)--think-start-tag[Start tag for thinking sections (default: <think>)]:start tag:' \
'(--think-end-tag)--think-end-tag[End tag for thinking sections (default: </think>)]:end tag:' \
'(--disable-responses-api)--disable-responses-api[Disable OpenAI Responses API (default: false)]' \
'(--transcribe-file)--transcribe-file[Audio or video file to transcribe]:audio file:_files -g "*.mp3 *.mp4 *.mpeg *.mpga *.m4a *.wav *.webm"' \
'(--transcribe-model)--transcribe-model[Model to use for transcription (separate from chat model)]:transcribe model:_fabric_transcription_models' \
'(--split-media-file)--split-media-file[Split audio/video files larger than 25MB using ffmpeg]' \
'(--debug)--debug[Set debug level (0=off, 1=basic, 2=detailed, 3=trace)]:debug level:(0 1 2 3)' \
'(--notification)--notification[Send desktop notification when command completes]' \
'(--notification-command)--notification-command[Custom command to run for notifications]:notification command:' \
'(-h --help)'{-h,--help}'[Show this help message]' \

View File

@@ -13,7 +13,7 @@ _fabric() {
_get_comp_words_by_ref -n : cur prev words cword
# Define all possible options/flags
local opts="--pattern -p --variable -v --context -C --session --attachment -a --setup -S --temperature -t --topp -T --stream -s --presencepenalty -P --raw -r --frequencypenalty -F --listpatterns -l --listmodels -L --listcontexts -x --listsessions -X --updatepatterns -U --copy -c --model -m --vendor -V --modelContextLength --output -o --output-session --latest -n --changeDefaultModel -d --youtube -y --playlist --transcript --transcript-with-timestamps --comments --metadata --yt-dlp-args --language -g --scrape_url -u --scrape_question -q --seed -e --wipecontext -w --wipesession -W --printcontext --printsession --readability --input-has-vars --dry-run --serve --serveOllama --address --api-key --config --search --search-location --image-file --image-size --image-quality --image-compression --image-background --suppress-think --think-start-tag --think-end-tag --disable-responses-api --voice --list-gemini-voices --notification --notification-command --version --listextensions --addextension --rmextension --strategy --liststrategies --listvendors --shell-complete-list --help -h"
local opts="--pattern -p --variable -v --context -C --session --attachment -a --setup -S --temperature -t --topp -T --stream -s --presencepenalty -P --raw -r --frequencypenalty -F --listpatterns -l --listmodels -L --listcontexts -x --listsessions -X --updatepatterns -U --copy -c --model -m --vendor -V --modelContextLength --output -o --output-session --latest -n --changeDefaultModel -d --youtube -y --playlist --transcript --transcript-with-timestamps --comments --metadata --yt-dlp-args --language -g --scrape_url -u --scrape_question -q --seed -e --thinking --wipecontext -w --wipesession -W --printcontext --printsession --readability --input-has-vars --no-variable-replacement --dry-run --serve --serveOllama --address --api-key --config --search --search-location --image-file --image-size --image-quality --image-compression --image-background --suppress-think --think-start-tag --think-end-tag --disable-responses-api --transcribe-file --transcribe-model --split-media-file --voice --list-gemini-voices --notification --notification-command --debug --version --listextensions --addextension --rmextension --strategy --liststrategies --listvendors --shell-complete-list --help -h"
# Helper function for dynamic completions
_fabric_get_list() {
@@ -58,6 +58,10 @@ _fabric() {
COMPREPLY=($(compgen -W "$(_fabric_get_list --listsessions)" -- "${cur}"))
return 0
;;
--thinking)
COMPREPLY=($(compgen -W "off low medium high" -- "${cur}"))
return 0
;;
--rmextension)
COMPREPLY=($(compgen -W "$(_fabric_get_list --listextensions)" -- "${cur}"))
return 0
@@ -70,8 +74,16 @@ _fabric() {
COMPREPLY=($(compgen -W "$(_fabric_get_list --list-gemini-voices)" -- "${cur}"))
return 0
;;
--transcribe-model)
COMPREPLY=($(compgen -W "$(_fabric_get_list --list-transcription-models)" -- "${cur}"))
return 0
;;
--debug)
COMPREPLY=($(compgen -W "0 1 2 3" -- "${cur}"))
return 0
;;
# Options requiring file/directory paths
-a | --attachment | -o | --output | --config | --addextension | --image-file)
-a | --attachment | -o | --output | --config | --addextension | --image-file | --transcribe-file)
_filedir
return 0
;;

View File

@@ -47,6 +47,11 @@ function __fabric_get_gemini_voices
$cmd --list-gemini-voices --shell-complete-list 2>/dev/null
end
function __fabric_get_transcription_models
set cmd (commandline -opc)[1]
$cmd --list-transcription-models --shell-complete-list 2>/dev/null
end
# Main completion function
function __fabric_register_completions
set cmd $argv[1]
@@ -72,6 +77,7 @@ function __fabric_register_completions
complete -c $cmd -s u -l scrape_url -d "Scrape website URL to markdown using Jina AI"
complete -c $cmd -s q -l scrape_question -d "Search question using Jina AI"
complete -c $cmd -s e -l seed -d "Seed to be used for LMM generation"
complete -c $cmd -l thinking -d "Set reasoning/thinking level" -a "off low medium high"
complete -c $cmd -s w -l wipecontext -d "Wipe context" -a "(__fabric_get_contexts)"
complete -c $cmd -s W -l wipesession -d "Wipe session" -a "(__fabric_get_sessions)"
complete -c $cmd -l printcontext -d "Print context" -a "(__fabric_get_contexts)"
@@ -91,6 +97,9 @@ function __fabric_register_completions
complete -c $cmd -l think-start-tag -d "Start tag for thinking sections (default: <think>)"
complete -c $cmd -l think-end-tag -d "End tag for thinking sections (default: </think>)"
complete -c $cmd -l voice -d "TTS voice name for supported models (e.g., Kore, Charon, Puck)" -a "(__fabric_get_gemini_voices)"
complete -c $cmd -l transcribe-file -d "Audio or video file to transcribe" -r -a "*.mp3 *.mp4 *.mpeg *.mpga *.m4a *.wav *.webm"
complete -c $cmd -l transcribe-model -d "Model to use for transcription (separate from chat model)" -a "(__fabric_get_transcription_models)"
complete -c $cmd -l debug -d "Set debug level (0=off, 1=basic, 2=detailed, 3=trace)" -a "0 1 2 3"
complete -c $cmd -l notification-command -d "Custom command to run for notifications (overrides built-in notifications)"
# Boolean flags (no arguments)
@@ -112,8 +121,9 @@ function __fabric_register_completions
complete -c $cmd -l metadata -d "Output video metadata"
complete -c $cmd -l yt-dlp-args -d "Additional arguments to pass to yt-dlp (e.g. '--cookies-from-browser brave')"
complete -c $cmd -l readability -d "Convert HTML input into a clean, readable view"
complete -c $cmd -l input-has-vars -d "Apply variables to user input"
complete -c $cmd -l dry-run -d "Show what would be sent to the model without actually sending it"
complete -c $cmd -l input-has-vars -d "Apply variables to user input"
complete -c $cmd -l no-variable-replacement -d "Disable pattern variable replacement"
complete -c $cmd -l dry-run -d "Show what would be sent to the model without actually sending it"
complete -c $cmd -l search -d "Enable web search tool for supported models (Anthropic, OpenAI, Gemini)"
complete -c $cmd -l serve -d "Serve the Fabric Rest API"
complete -c $cmd -l serveOllama -d "Serve the Fabric Rest API with ollama endpoints"
@@ -125,6 +135,7 @@ function __fabric_register_completions
complete -c $cmd -l shell-complete-list -d "Output raw list without headers/formatting (for shell completion)"
complete -c $cmd -l suppress-think -d "Suppress text enclosed in thinking tags"
complete -c $cmd -l disable-responses-api -d "Disable OpenAI Responses API (default: false)"
complete -c $cmd -l split-media-file -d "Split audio/video files larger than 25MB using ffmpeg"
complete -c $cmd -l notification -d "Send desktop notification when command completes"
complete -c $cmd -s h -l help -d "Show this help message"
end

View File

@@ -8,6 +8,10 @@ set -e
# Global variables
DRY_RUN=false
# Base URL to fetch completion files when not available locally
# Can be overridden via environment variable FABRIC_COMPLETIONS_BASE_URL
FABRIC_COMPLETIONS_BASE_URL="${FABRIC_COMPLETIONS_BASE_URL:-https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions}"
TEMP_DIR=""
# Colors for output
RED='\033[0;31m'
@@ -50,6 +54,109 @@ execute_command() {
fi
}
# Simple downloader that prefers curl, falls back to wget
to_github_raw_url() {
in_url="$1"
case "$in_url" in
https://github.com/*/*/blob/*)
# Convert blob URL to raw
# https://github.com/{owner}/{repo}/blob/{ref}/path -> https://raw.githubusercontent.com/{owner}/{repo}/{ref}/path
echo "$in_url" | sed -E 's#https://github.com/([^/]+)/([^/]+)/blob/([^/]+)/#https://raw.githubusercontent.com/\1/\2/\3/#'
;;
https://github.com/*/*/tree/*)
# Convert tree URL base + file path to raw
# https://github.com/{owner}/{repo}/tree/{ref}/path -> https://raw.githubusercontent.com/{owner}/{repo}/{ref}/path
echo "$in_url" | sed -E 's#https://github.com/([^/]+)/([^/]+)/tree/([^/]+)/#https://raw.githubusercontent.com/\1/\2/\3/#'
;;
*)
echo "$in_url"
;;
esac
}
# Simple downloader that prefers curl, falls back to wget
download_file() {
url="$1"
dest="$2"
if [ "$DRY_RUN" = true ]; then
print_dry_run "Would download: $url -> $dest"
return 0
fi
eff_url="$(to_github_raw_url "$url")"
if command -v curl >/dev/null 2>&1; then
curl -fsSL "$eff_url" -o "$dest"
return $?
elif command -v wget >/dev/null 2>&1; then
wget -q "$eff_url" -O "$dest"
return $?
else
print_error "Neither 'curl' nor 'wget' is available to download: $url"
return 1
fi
}
# Attempt to obtain completion files. If local copies are missing,
# download them into a temporary directory and return that directory path.
obtain_completion_files() {
obf_script_dir="$1"
obf_need_download=false
if [ ! -f "$obf_script_dir/_fabric" ] || [ ! -f "$obf_script_dir/fabric.bash" ] || [ ! -f "$obf_script_dir/fabric.fish" ]; then
obf_need_download=true
fi
if [ "$obf_need_download" = false ]; then
echo "$obf_script_dir"
return 0
fi
# Note: write only to stderr in this function except for the final echo which returns the path
printf "%s\n" "[INFO] Local completion files not found; will download from GitHub." 1>&2
printf "%s\n" "[INFO] Source: $FABRIC_COMPLETIONS_BASE_URL" 1>&2
if [ "$DRY_RUN" = true ]; then
printf "%s\n" "[DRY-RUN] Would create temporary directory for downloads" 1>&2
echo "$obf_script_dir" # Keep using original for dry-run copies
return 0
fi
TEMP_DIR="$(mktemp -d 2>/dev/null || mktemp -d -t fabric-completions)"
if [ ! -d "$TEMP_DIR" ]; then
print_error "Failed to create temporary directory for downloads."
return 1
fi
if ! download_file "$FABRIC_COMPLETIONS_BASE_URL/_fabric" "$TEMP_DIR/_fabric"; then
print_error "Failed to download _fabric"
return 1
fi
if [ ! -s "$TEMP_DIR/_fabric" ] || head -n1 "$TEMP_DIR/_fabric" | grep -qi "^<!DOCTYPE\|^<html"; then
print_error "Downloaded _fabric appears invalid (empty or HTML). Check FABRIC_COMPLETIONS_BASE_URL."
return 1
fi
if ! download_file "$FABRIC_COMPLETIONS_BASE_URL/fabric.bash" "$TEMP_DIR/fabric.bash"; then
print_error "Failed to download fabric.bash"
return 1
fi
if [ ! -s "$TEMP_DIR/fabric.bash" ] || head -n1 "$TEMP_DIR/fabric.bash" | grep -qi "^<!DOCTYPE\|^<html"; then
print_error "Downloaded fabric.bash appears invalid (empty or HTML). Check FABRIC_COMPLETIONS_BASE_URL."
return 1
fi
if ! download_file "$FABRIC_COMPLETIONS_BASE_URL/fabric.fish" "$TEMP_DIR/fabric.fish"; then
print_error "Failed to download fabric.fish"
return 1
fi
if [ ! -s "$TEMP_DIR/fabric.fish" ] || head -n1 "$TEMP_DIR/fabric.fish" | grep -qi "^<!DOCTYPE\|^<html"; then
print_error "Downloaded fabric.fish appears invalid (empty or HTML). Check FABRIC_COMPLETIONS_BASE_URL."
return 1
fi
echo "$TEMP_DIR"
}
# Ensure directory exists, try sudo on permission failure
ensure_dir() {
dir="$1"
@@ -266,6 +373,7 @@ setup_fish_completions() {
setup_other_shell_completions() {
fabric_cmd="$1"
shell_name="$2"
script_dir="$3"
print_warning "Shell '$shell_name' is not directly supported."
print_info "You can manually source the completion files:"
@@ -289,8 +397,14 @@ DESCRIPTION:
This script automatically installs shell completions for the fabric CLI
based on your current shell and the installed fabric command name.
The script looks for completion files in the same directory as the script,
so it can be run from anywhere.
The script will use completion files from the same directory as the script
when available. If they are not present (e.g., when running via curl), it
will download them from GitHub:
$FABRIC_COMPLETIONS_BASE_URL
You can override the download source by setting
FABRIC_COMPLETIONS_BASE_URL to your preferred location.
Supports: zsh, bash, fish
@@ -301,9 +415,11 @@ DESCRIPTION:
4. Try multiple standard completion directories
EXAMPLES:
./setup-completions.sh # Install completions
./setup-completions.sh --dry-run # Show what would be done
./setup-completions.sh --help # Show this help
./setup-completions.sh # Install completions
./setup-completions.sh --dry-run # Show what would be done
FABRIC_COMPLETIONS_BASE_URL="https://raw.githubusercontent.com/<owner>/<repo>/main/completions" \\
./setup-completions.sh # Override download source
./setup-completions.sh --help # Show this help
EOF
}
@@ -337,19 +453,19 @@ main() {
print_info ""
fi
# Get script directory
# Get script directory and obtain completion files (local or downloaded)
script_dir="$(get_script_dir)"
# Check if completion files exist
if [ ! -f "$script_dir/_fabric" ] || [ ! -f "$script_dir/fabric.bash" ] || [ ! -f "$script_dir/fabric.fish" ]; then
print_error "Completion files not found. Make sure you're running this script from the fabric completions directory."
print_error "Expected files:"
print_error " $script_dir/_fabric"
print_error " $script_dir/fabric.bash"
print_error " $script_dir/fabric.fish"
script_dir="$(obtain_completion_files "$script_dir" || echo "")"
if [ -z "$script_dir" ]; then
print_error "Unable to obtain completion files. Aborting."
exit 1
fi
# If we downloaded into a temp dir, arrange cleanup at process exit
if [ -n "$TEMP_DIR" ] && [ -d "$TEMP_DIR" ]; then
trap 'if [ -n "$TEMP_DIR" ] && [ -d "$TEMP_DIR" ]; then rm -rf "$TEMP_DIR"; fi' EXIT INT TERM
fi
# Detect fabric command
fabric_cmd="$(detect_fabric_command)"
print_info "Detected fabric command: $fabric_cmd"
@@ -370,7 +486,7 @@ main() {
setup_fish_completions "$fabric_cmd" "$script_dir"
;;
*)
setup_other_shell_completions "$fabric_cmd" "$shell_name"
setup_other_shell_completions "$fabric_cmd" "$shell_name" "$script_dir"
;;
esac

View File

@@ -0,0 +1,26 @@
You are an expert creative writer specializing in character-driven narratives, and a keen observer of human psychology. Your task is to craft a compelling, realistic short story based on a psychological profile or personal data provided by the user.
**Input:**
The user will provide a psychological profile or descriptive data about a fictional or real person. This input will be clearly delimited by triple backticks (```). It may include personality traits, habits, fears, motivations, strengths, weaknesses, background information, or specific behavioral patterns.
**Task Steps:**
1. **Analyze Profile:** Carefully read and internalize the provided psychological profile. Identify the core personality traits, typical reactions, strengths, and vulnerabilities of the individual.
2. **Brainstorm Challenges:** Based on the analysis from Step 1, generate 3-5 common, relatable, everyday problems or minor dilemmas that a person with this specific profile might genuinely encounter. These challenges should be varied and could span social, professional, personal, or emotional domains.
3. **Develop Strategies:** For each identified problem from Step 2, devise 1-2 specific, plausible methods or strategies that the character, consistent with their psychological profile, would naturally employ (or attempt to employ) to navigate, cope with, or solve these challenges. Consider both internal thought processes and external actions.
4. **Construct Narrative:** Weave these problems and the character's responses into a cohesive, engaging short story (approximately 500-700 words, 3-5 paragraphs). The story should have a clear narrative flow, introducing the character, presenting the challenges, and showing their journey through them.
5. **Maintain Consistency:** Throughout the story, ensure the character's actions, dialogue, internal monologue, and emotional reactions are consistently aligned with the psychological profile provided. The story should feel authentic to the character.
**Output Requirements:**
* **Format:** A continuous narrative short story.
* **Tone:** Empathetic, realistic, and engaging.
* **Content:** The story must clearly depict the character facing everyday problems and demonstrate their unique methods and strategies for navigating these challenges, directly reflecting the input profile.
* **Length:** Approximately 500-700 words.
* **Avoid:** Overly dramatic or fantastical scenarios unless the profile explicitly suggests such a context. Focus on the 'everyday common problems'.
**Example of Input Format:**
```
[Psychological Profile/Data Here]
```

View File

@@ -0,0 +1,53 @@
# IDENTITY and PURPOSE
You are an AI assistant whose primary responsibility is to interpret and analyze psychological profiles and/or psychology data files provided as input. Your role is to carefully process this data and use your expertise to develop a tailored plan aimed at spiritual and mental healing, as well as overall life improvement for the subject. You must approach each case with sensitivity, applying psychological knowledge and holistic strategies to create actionable, personalized recommendations that address both mental and spiritual well-being. Your focus is on structured, compassionate, and practical guidance that can help the individual make meaningful improvements in their life.
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
# STEPS
- Carefully review the psychological-profile and/or psychology data file provided as input.
- Analyze the data to identify key issues, strengths, and areas needing improvement related to the subject's mental and spiritual well-being.
- Develop a comprehensive plan that includes specific strategies for spiritual healing, mental health improvement, and overall life enhancement.
- Structure your output to clearly outline recommendations, resources, and actionable steps tailored to the individual's unique profile.
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- Ensure your output is organized, clear, and easy to follow, using headings, subheadings, and bullet points where appropriate.
- Ensure you follow ALL these instructions when creating your output.
# INPUT
INPUT:# IDENTITY and PURPOSE
You are an AI assistant whose primary responsibility is to interpret and analyze psychological profiles and/or psychology data files provided as input. Your role is to carefully process this data and use your expertise to develop a tailored plan aimed at spiritual and mental healing, as well as overall life improvement for the subject. You must approach each case with sensitivity, applying psychological knowledge and holistic strategies to create actionable, personalized recommendations that address both mental and spiritual well-being. Your focus is on structured, compassionate, and practical guidance that can help the individual make meaningful improvements in their life.
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
# STEPS
- Carefully review the psychological-profile and/or psychology data file provided as input.
- Analyze the data to identify key issues, strengths, and areas needing improvement related to the subject's mental and spiritual well-being.
- Develop a comprehensive plan that includes specific strategies for spiritual healing, mental health improvement, and overall life enhancement.
- Structure your output to clearly outline recommendations, resources, and actionable steps tailored to the individual's unique profile.
# OUTPUT INSTRUCTIONS
- Only output Markdown.
- Ensure your output is organized, clear, and easy to follow, using headings, subheadings, and bullet points where appropriate.
- Ensure you follow ALL these instructions when creating your output.
# INPUT
INPUT:

View File

@@ -88,136 +88,138 @@
84. **create_security_update**: Creates concise security updates for newsletters, covering stories, threats, advisories, vulnerabilities, and a summary of key issues.
85. **create_show_intro**: Creates compelling short intros for podcasts, summarizing key topics and themes discussed in the episode.
86. **create_sigma_rules**: Extracts Tactics, Techniques, and Procedures (TTPs) from security news and converts them into Sigma detection rules for host-based detections.
87. **create_story_explanation**: Summarizes complex content in a clear, approachable story format that makes the concepts easy to understand.
88. **create_stride_threat_model**: Create a STRIDE-based threat model for a system design, identifying assets, trust boundaries, data flows, and prioritizing threats with mitigations.
89. **create_summary**: Summarizes content into a 20-word sentence, 10 main points (16 words max), and 5 key takeaways in Markdown format.
90. **create_tags**: Identifies at least 5 tags from text content for mind mapping tools, including authors and existing tags if present.
91. **create_threat_scenarios**: Identifies likely attack methods for any system by providing a narrative-based threat model, balancing risk and opportunity.
92. **create_ttrc_graph**: Creates a CSV file showing the progress of Time to Remediate Critical Vulnerabilities over time using given data.
93. **create_ttrc_narrative**: Creates a persuasive narrative highlighting progress in reducing the Time to Remediate Critical Vulnerabilities metric over time.
94. **create_upgrade_pack**: Extracts world model and task algorithm updates from content, providing beliefs about how the world works and task performance.
95. **create_user_story**: Writes concise and clear technical user stories for new features in complex software programs, formatted for all stakeholders.
96. **create_video_chapters**: Extracts interesting topics and timestamps from a transcript, providing concise summaries of key moments.
97. **create_visualization**: Transforms complex ideas into visualizations using intricate ASCII art, simplifying concepts where necessary.
98. **dialog_with_socrates**: Engages in deep, meaningful dialogues to explore and challenge beliefs using the Socratic method.
99. **enrich_blog_post**: Enhances Markdown blog files by applying instructions to improve structure, visuals, and readability for HTML rendering.
100. **explain_code**: Explains code, security tool output, configuration text, and answers questions based on the provided input.
101. **explain_docs**: Improves and restructures tool documentation into clear, concise instructions, including overviews, usage, use cases, and key features.
102. **explain_math**: Helps you understand mathematical concepts in a clear and engaging way.
103. **explain_project**: Summarizes project documentation into clear, concise sections covering the project, problem, solution, installation, usage, and examples.
104. **explain_terms**: Produces a glossary of advanced terms from content, providing a definition, analogy, and explanation of why each term matters.
105. **export_data_as_csv**: Extracts and outputs all data structures from the input in properly formatted CSV data.
106. **extract_algorithm_update_recommendations**: Extracts concise, practical algorithm update recommendations from the input and outputs them in a bulleted list.
107. **extract_article_wisdom**: Extracts surprising, insightful, and interesting information from content, categorizing it into sections like summary, ideas, quotes, facts, references, and recommendations.
108. **extract_book_ideas**: Extracts and outputs 50 to 100 of the most surprising, insightful, and interesting ideas from a book's content.
109. **extract_book_recommendations**: Extracts and outputs 50 to 100 practical, actionable recommendations from a book's content.
110. **extract_business_ideas**: Extracts top business ideas from content and elaborates on the best 10 with unique differentiators.
111. **extract_controversial_ideas**: Extracts and outputs controversial statements and supporting quotes from the input in a structured Markdown list.
112. **extract_core_message**: Extracts and outputs a clear, concise sentence that articulates the core message of a given text or body of work.
113. **extract_ctf_writeup**: Extracts a short writeup from a warstory-like text about a cyber security engagement.
114. **extract_domains**: Extracts domains and URLs from content to identify sources used for articles, newsletters, and other publications.
115. **extract_extraordinary_claims**: Extracts and outputs a list of extraordinary claims from conversations, focusing on scientifically disputed or false statements.
116. **extract_ideas**: Extracts and outputs all the key ideas from input, presented as 15-word bullet points in Markdown.
117. **extract_insights**: Extracts and outputs the most powerful and insightful ideas from text, formatted as 16-word bullet points in the INSIGHTS section, also IDEAS section.
118. **extract_insights_dm**: Extracts and outputs all valuable insights and a concise summary of the content, including key points and topics discussed.
119. **extract_instructions**: Extracts clear, actionable step-by-step instructions and main objectives from instructional video transcripts, organizing them into a concise list.
120. **extract_jokes**: Extracts jokes from text content, presenting each joke with its punchline in separate bullet points.
121. **extract_latest_video**: Extracts the latest video URL from a YouTube RSS feed and outputs the URL only.
122. **extract_main_activities**: Extracts key events and activities from transcripts or logs, providing a summary of what happened.
123. **extract_main_idea**: Extracts the main idea and key recommendation from the input, summarizing them in 15-word sentences.
124. **extract_most_redeeming_thing**: Extracts the most redeeming aspect from an input, summarizing it in a single 15-word sentence.
125. **extract_patterns**: Extracts and analyzes recurring, surprising, and insightful patterns from input, providing detailed analysis and advice for builders.
126. **extract_poc**: Extracts proof of concept URLs and validation methods from security reports, providing the URL and command to run.
127. **extract_predictions**: Extracts predictions from input, including specific details such as date, confidence level, and verification method.
128. **extract_primary_problem**: Extracts the primary problem with the world as presented in a given text or body of work.
129. **extract_primary_solution**: Extracts the primary solution for the world as presented in a given text or body of work.
130. **extract_product_features**: Extracts and outputs a list of product features from the provided input in a bulleted format.
131. **extract_questions**: Extracts and outputs all questions asked by the interviewer in a conversation or interview.
132. **extract_recipe**: Extracts and outputs a recipe with a short meal description, ingredients with measurements, and preparation steps.
133. **extract_recommendations**: Extracts and outputs concise, practical recommendations from a given piece of content in a bulleted list.
134. **extract_references**: Extracts and outputs a bulleted list of references to art, stories, books, literature, and other sources from content.
135. **extract_skills**: Extracts and classifies skills from a job description into a table, separating each skill and classifying it as either hard or soft.
136. **extract_song_meaning**: Analyzes a song to provide a summary of its meaning, supported by detailed evidence from lyrics, artist commentary, and fan analysis.
137. **extract_sponsors**: Extracts and lists official sponsors and potential sponsors from a provided transcript.
138. **extract_videoid**: Extracts and outputs the video ID from any given URL.
139. **extract_wisdom**: Extracts surprising, insightful, and interesting information from text on topics like human flourishing, AI, learning, and more.
140. **extract_wisdom_agents**: Extracts valuable insights, ideas, quotes, and references from content, emphasizing topics like human flourishing, AI, learning, and technology.
141. **extract_wisdom_dm**: Extracts all valuable, insightful, and thought-provoking information from content, focusing on topics like human flourishing, AI, learning, and technology.
142. **extract_wisdom_nometa**: Extracts insights, ideas, quotes, habits, facts, references, and recommendations from content, focusing on human flourishing, AI, technology, and related topics.
143. **find_female_life_partner**: Analyzes criteria for finding a female life partner and provides clear, direct, and poetic descriptions.
144. **find_hidden_message**: Extracts overt and hidden political messages, justifications, audience actions, and a cynical analysis from content.
145. **find_logical_fallacies**: Identifies and analyzes fallacies in arguments, classifying them as formal or informal with detailed reasoning.
146. **get_wow_per_minute**: Determines the wow-factor of content per minute based on surprise, novelty, insight, value, and wisdom, measuring how rewarding the content is for the viewer.
147. **get_youtube_rss**: Returns the RSS URL for a given YouTube channel based on the channel ID or URL.
148. **humanize**: Rewrites AI-generated text to sound natural, conversational, and easy to understand, maintaining clarity and simplicity.
149. **identify_dsrp_distinctions**: Encourages creative, systems-based thinking by exploring distinctions, boundaries, and their implications, drawing on insights from prominent systems thinkers.
150. **identify_dsrp_perspectives**: Explores the concept of distinctions in systems thinking, focusing on how boundaries define ideas, influence understanding, and reveal or obscure insights.
151. **identify_dsrp_relationships**: Encourages exploration of connections, distinctions, and boundaries between ideas, inspired by systems thinkers to reveal new insights and patterns in complex systems.
152. **identify_dsrp_systems**: Encourages organizing ideas into systems of parts and wholes, inspired by systems thinkers to explore relationships and how changes in organization impact meaning and understanding.
153. **identify_job_stories**: Identifies key job stories or requirements for roles.
154. **improve_academic_writing**: Refines text into clear, concise academic language while improving grammar, coherence, and clarity, with a list of changes.
155. **improve_prompt**: Improves an LLM/AI prompt by applying expert prompt writing strategies for better results and clarity.
156. **improve_report_finding**: Improves a penetration test security finding by providing detailed descriptions, risks, recommendations, references, quotes, and a concise summary in markdown format.
157. **improve_writing**: Refines text by correcting grammar, enhancing style, improving clarity, and maintaining the original meaning. skills.
158. **judge_output**: Evaluates Honeycomb queries by judging their effectiveness, providing critiques and outcomes based on language nuances and analytics relevance.
159. **label_and_rate**: Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
160. **md_callout**: Classifies content and generates a markdown callout based on the provided text, selecting the most appropriate type.
161. **official_pattern_template**: Template to use if you want to create new fabric patterns.
162. **prepare_7s_strategy**: Prepares a comprehensive briefing document from 7S's strategy capturing organizational profile, strategic elements, and market dynamics with clear, concise, and organized content.
163. **provide_guidance**: Provides psychological and life coaching advice, including analysis, recommendations, and potential diagnoses, with a compassionate and honest tone.
164. **rate_ai_response**: Rates the quality of AI responses by comparing them to top human expert performance, assigning a letter grade, reasoning, and providing a 1-100 score based on the evaluation.
165. **rate_ai_result**: Assesses the quality of AI/ML/LLM work by deeply analyzing content, instructions, and output, then rates performance based on multiple dimensions, including coverage, creativity, and interdisciplinary thinking.
166. **rate_content**: Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
167. **rate_value**: Produces the best possible output by deeply analyzing and understanding the input and its intended purpose.
168. **raw_query**: Fully digests and contemplates the input to produce the best possible result based on understanding the sender's intent.
169. **recommend_artists**: Recommends a personalized festival schedule with artists aligned to your favorite styles and interests, including rationale.
170. **recommend_pipeline_upgrades**: Optimizes vulnerability-checking pipelines by incorporating new information and improving their efficiency, with detailed explanations of changes.
171. **recommend_talkpanel_topics**: Produces a clean set of proposed talks or panel talking points for a person based on their interests and goals, formatted for submission to a conference organizer.
172. **refine_design_document**: Refines a design document based on a design review by analyzing, mapping concepts, and implementing changes using valid Markdown.
173. **review_design**: Reviews and analyzes architecture design, focusing on clarity, component design, system integrations, security, performance, scalability, and data management.
174. **sanitize_broken_html_to_markdown**: Converts messy HTML into clean, properly formatted Markdown, applying custom styling and ensuring compatibility with Vite.
175. **show_fabric_options_markmap**: Visualizes the functionality of the Fabric framework by representing its components, commands, and features based on the provided input.
176. **solve_with_cot**: Provides detailed, step-by-step responses with chain of thought reasoning, using structured thinking, reflection, and output sections.
177. **suggest_pattern**: Suggests appropriate fabric patterns or commands based on user input, providing clear explanations and options for users.
178. **summarize**: Summarizes content into a 20-word sentence, main points, and takeaways, formatted with numbered lists in Markdown.
179. **summarize_board_meeting**: Creates formal meeting notes from board meeting transcripts for corporate governance documentation.
180. **summarize_debate**: Summarizes debates, identifies primary disagreement, extracts arguments, and provides analysis of evidence and argument strength to predict outcomes.
181. **summarize_git_changes**: Summarizes recent project updates from the last 7 days, focusing on key changes with enthusiasm.
182. **summarize_git_diff**: Summarizes and organizes Git diff changes with clear, succinct commit messages and bullet points.
183. **summarize_lecture**: Extracts relevant topics, definitions, and tools from lecture transcripts, providing structured summaries with timestamps and key takeaways.
184. **summarize_legislation**: Summarizes complex political proposals and legislation by analyzing key points, proposed changes, and providing balanced, positive, and cynical characterizations.
185. **summarize_meeting**: Analyzes meeting transcripts to extract a structured summary, including an overview, key points, tasks, decisions, challenges, timeline, references, and next steps.
186. **summarize_micro**: Summarizes content into a 20-word sentence, 3 main points, and 3 takeaways, formatted in clear, concise Markdown.
187. **summarize_newsletter**: Extracts the most meaningful, interesting, and useful content from a newsletter, summarizing key sections such as content, opinions, tools, companies, and follow-up items in clear, structured Markdown.
188. **summarize_paper**: Summarizes an academic paper by detailing its title, authors, technical approach, distinctive features, experimental setup, results, advantages, limitations, and conclusion in a clear, structured format using human-readable Markdown.
189. **summarize_prompt**: Summarizes AI chat prompts by describing the primary function, unique approach, and expected output in a concise paragraph. The summary is focused on the prompt's purpose without unnecessary details or formatting.
190. **summarize_pull-requests**: Summarizes pull requests for a coding project by providing a summary and listing the top PRs with human-readable descriptions.
191. **summarize_rpg_session**: Summarizes a role-playing game session by extracting key events, combat stats, character changes, quotes, and more.
192. **t_analyze_challenge_handling**: Provides 8-16 word bullet points evaluating how well challenges are being addressed, calling out any lack of effort.
193. **t_check_metrics**: Analyzes deep context from the TELOS file and input instruction, then provides a wisdom-based output while considering metrics and KPIs to assess recent improvements.
194. **t_create_h3_career**: Summarizes context and produces wisdom-based output by deeply analyzing both the TELOS File and the input instruction, considering the relationship between the two.
195. **t_create_opening_sentences**: Describes from TELOS file the person's identity, goals, and actions in 4 concise, 32-word bullet points, humbly.
196. **t_describe_life_outlook**: Describes from TELOS file a person's life outlook in 5 concise, 16-word bullet points.
197. **t_extract_intro_sentences**: Summarizes from TELOS file a person's identity, work, and current projects in 5 concise and grounded bullet points.
198. **t_extract_panel_topics**: Creates 5 panel ideas with titles and descriptions based on deep context from a TELOS file and input.
199. **t_find_blindspots**: Identify potential blindspots in thinking, frames, or models that may expose the individual to error or risk.
200. **t_find_negative_thinking**: Analyze a TELOS file and input to identify negative thinking in documents or journals, followed by tough love encouragement.
201. **t_find_neglected_goals**: Analyze a TELOS file and input instructions to identify goals or projects that have not been worked on recently.
202. **t_give_encouragement**: Analyze a TELOS file and input instructions to evaluate progress, provide encouragement, and offer recommendations for continued effort.
203. **t_red_team_thinking**: Analyze a TELOS file and input instructions to red-team thinking, models, and frames, then provide recommendations for improvement.
204. **t_threat_model_plans**: Analyze a TELOS file and input instructions to create threat models for a life plan and recommend improvements.
205. **t_visualize_mission_goals_projects**: Analyze a TELOS file and input instructions to create an ASCII art diagram illustrating the relationship of missions, goals, and projects.
206. **t_year_in_review**: Analyze a TELOS file to create insights about a person or entity, then summarize accomplishments and visualizations in bullet points.
207. **to_flashcards**: Create Anki flashcards from a given text, focusing on concise, optimized questions and answers without external context.
208. **transcribe_minutes**: Extracts (from meeting transcription) meeting minutes, identifying actionables, insightful ideas, decisions, challenges, and next steps in a structured format.
209. **translate**: Translates sentences or documentation into the specified language code while maintaining the original formatting and tone.
210. **tweet**: Provides a step-by-step guide on crafting engaging tweets with emojis, covering Twitter basics, account creation, features, and audience targeting.
211. **write_essay**: Writes essays in the style of a specified author, embodying their unique voice, vocabulary, and approach. Uses `author_name` variable.
212. **write_essay_pg**: Writes concise, clear essays in the style of Paul Graham, focusing on simplicity, clarity, and illumination of the provided topic.
213. **write_hackerone_report**: Generates concise, clear, and reproducible bug bounty reports, detailing vulnerability impact, steps to reproduce, and exploit details for triagers.
214. **write_latex**: Generates syntactically correct LaTeX code for a new.tex document, ensuring proper formatting and compatibility with pdflatex.
215. **write_micro_essay**: Writes concise, clear, and illuminating essays on the given topic in the style of Paul Graham.
216. **write_nuclei_template_rule**: Generates Nuclei YAML templates for detecting vulnerabilities using HTTP requests, matchers, extractors, and dynamic data extraction.
217. **write_pull-request**: Drafts detailed pull request descriptions, explaining changes, providing reasoning, and identifying potential bugs from the git diff command output.
218. **write_semgrep_rule**: Creates accurate and working Semgrep rules based on input, following syntax guidelines and specific language considerations.
219. **youtube_summary**: Create concise, timestamped Youtube video summaries that highlight key points.
87. **create_story_about_person**: Creates compelling, realistic short stories based on psychological profiles, showing how characters navigate everyday problems using strategies consistent with their personality traits.
88. **create_story_explanation**: Summarizes complex content in a clear, approachable story format that makes the concepts easy to understand.
89. **create_stride_threat_model**: Create a STRIDE-based threat model for a system design, identifying assets, trust boundaries, data flows, and prioritizing threats with mitigations.
90. **create_summary**: Summarizes content into a 20-word sentence, 10 main points (16 words max), and 5 key takeaways in Markdown format.
91. **create_tags**: Identifies at least 5 tags from text content for mind mapping tools, including authors and existing tags if present.
92. **create_threat_scenarios**: Identifies likely attack methods for any system by providing a narrative-based threat model, balancing risk and opportunity.
93. **create_ttrc_graph**: Creates a CSV file showing the progress of Time to Remediate Critical Vulnerabilities over time using given data.
94. **create_ttrc_narrative**: Creates a persuasive narrative highlighting progress in reducing the Time to Remediate Critical Vulnerabilities metric over time.
95. **create_upgrade_pack**: Extracts world model and task algorithm updates from content, providing beliefs about how the world works and task performance.
96. **create_user_story**: Writes concise and clear technical user stories for new features in complex software programs, formatted for all stakeholders.
97. **create_video_chapters**: Extracts interesting topics and timestamps from a transcript, providing concise summaries of key moments.
98. **create_visualization**: Transforms complex ideas into visualizations using intricate ASCII art, simplifying concepts where necessary.
99. **dialog_with_socrates**: Engages in deep, meaningful dialogues to explore and challenge beliefs using the Socratic method.
100. **enrich_blog_post**: Enhances Markdown blog files by applying instructions to improve structure, visuals, and readability for HTML rendering.
101. **explain_code**: Explains code, security tool output, configuration text, and answers questions based on the provided input.
102. **explain_docs**: Improves and restructures tool documentation into clear, concise instructions, including overviews, usage, use cases, and key features.
103. **explain_math**: Helps you understand mathematical concepts in a clear and engaging way.
104. **explain_project**: Summarizes project documentation into clear, concise sections covering the project, problem, solution, installation, usage, and examples.
105. **explain_terms**: Produces a glossary of advanced terms from content, providing a definition, analogy, and explanation of why each term matters.
106. **export_data_as_csv**: Extracts and outputs all data structures from the input in properly formatted CSV data.
107. **extract_algorithm_update_recommendations**: Extracts concise, practical algorithm update recommendations from the input and outputs them in a bulleted list.
108. **extract_article_wisdom**: Extracts surprising, insightful, and interesting information from content, categorizing it into sections like summary, ideas, quotes, facts, references, and recommendations.
109. **extract_book_ideas**: Extracts and outputs 50 to 100 of the most surprising, insightful, and interesting ideas from a book's content.
110. **extract_book_recommendations**: Extracts and outputs 50 to 100 practical, actionable recommendations from a book's content.
111. **extract_business_ideas**: Extracts top business ideas from content and elaborates on the best 10 with unique differentiators.
112. **extract_controversial_ideas**: Extracts and outputs controversial statements and supporting quotes from the input in a structured Markdown list.
113. **extract_core_message**: Extracts and outputs a clear, concise sentence that articulates the core message of a given text or body of work.
114. **extract_ctf_writeup**: Extracts a short writeup from a warstory-like text about a cyber security engagement.
115. **extract_domains**: Extracts domains and URLs from content to identify sources used for articles, newsletters, and other publications.
116. **extract_extraordinary_claims**: Extracts and outputs a list of extraordinary claims from conversations, focusing on scientifically disputed or false statements.
117. **extract_ideas**: Extracts and outputs all the key ideas from input, presented as 15-word bullet points in Markdown.
118. **extract_insights**: Extracts and outputs the most powerful and insightful ideas from text, formatted as 16-word bullet points in the INSIGHTS section, also IDEAS section.
119. **extract_insights_dm**: Extracts and outputs all valuable insights and a concise summary of the content, including key points and topics discussed.
120. **extract_instructions**: Extracts clear, actionable step-by-step instructions and main objectives from instructional video transcripts, organizing them into a concise list.
121. **extract_jokes**: Extracts jokes from text content, presenting each joke with its punchline in separate bullet points.
122. **extract_latest_video**: Extracts the latest video URL from a YouTube RSS feed and outputs the URL only.
123. **extract_main_activities**: Extracts key events and activities from transcripts or logs, providing a summary of what happened.
124. **extract_main_idea**: Extracts the main idea and key recommendation from the input, summarizing them in 15-word sentences.
125. **extract_most_redeeming_thing**: Extracts the most redeeming aspect from an input, summarizing it in a single 15-word sentence.
126. **extract_patterns**: Extracts and analyzes recurring, surprising, and insightful patterns from input, providing detailed analysis and advice for builders.
127. **extract_poc**: Extracts proof of concept URLs and validation methods from security reports, providing the URL and command to run.
128. **extract_predictions**: Extracts predictions from input, including specific details such as date, confidence level, and verification method.
129. **extract_primary_problem**: Extracts the primary problem with the world as presented in a given text or body of work.
130. **extract_primary_solution**: Extracts the primary solution for the world as presented in a given text or body of work.
131. **extract_product_features**: Extracts and outputs a list of product features from the provided input in a bulleted format.
132. **extract_questions**: Extracts and outputs all questions asked by the interviewer in a conversation or interview.
133. **extract_recipe**: Extracts and outputs a recipe with a short meal description, ingredients with measurements, and preparation steps.
134. **extract_recommendations**: Extracts and outputs concise, practical recommendations from a given piece of content in a bulleted list.
135. **extract_references**: Extracts and outputs a bulleted list of references to art, stories, books, literature, and other sources from content.
136. **extract_skills**: Extracts and classifies skills from a job description into a table, separating each skill and classifying it as either hard or soft.
137. **extract_song_meaning**: Analyzes a song to provide a summary of its meaning, supported by detailed evidence from lyrics, artist commentary, and fan analysis.
138. **extract_sponsors**: Extracts and lists official sponsors and potential sponsors from a provided transcript.
139. **extract_videoid**: Extracts and outputs the video ID from any given URL.
140. **extract_wisdom**: Extracts surprising, insightful, and interesting information from text on topics like human flourishing, AI, learning, and more.
141. **extract_wisdom_agents**: Extracts valuable insights, ideas, quotes, and references from content, emphasizing topics like human flourishing, AI, learning, and technology.
142. **extract_wisdom_dm**: Extracts all valuable, insightful, and thought-provoking information from content, focusing on topics like human flourishing, AI, learning, and technology.
143. **extract_wisdom_nometa**: Extracts insights, ideas, quotes, habits, facts, references, and recommendations from content, focusing on human flourishing, AI, technology, and related topics.
144. **find_female_life_partner**: Analyzes criteria for finding a female life partner and provides clear, direct, and poetic descriptions.
145. **find_hidden_message**: Extracts overt and hidden political messages, justifications, audience actions, and a cynical analysis from content.
146. **find_logical_fallacies**: Identifies and analyzes fallacies in arguments, classifying them as formal or informal with detailed reasoning.
147. **get_wow_per_minute**: Determines the wow-factor of content per minute based on surprise, novelty, insight, value, and wisdom, measuring how rewarding the content is for the viewer.
148. **get_youtube_rss**: Returns the RSS URL for a given YouTube channel based on the channel ID or URL.
149. **heal_person**: Develops a comprehensive plan for spiritual and mental healing based on psychological profiles, providing personalized recommendations for mental health improvement and overall life enhancement.
150. **humanize**: Rewrites AI-generated text to sound natural, conversational, and easy to understand, maintaining clarity and simplicity.
151. **identify_dsrp_distinctions**: Encourages creative, systems-based thinking by exploring distinctions, boundaries, and their implications, drawing on insights from prominent systems thinkers.
152. **identify_dsrp_perspectives**: Explores the concept of distinctions in systems thinking, focusing on how boundaries define ideas, influence understanding, and reveal or obscure insights.
153. **identify_dsrp_relationships**: Encourages exploration of connections, distinctions, and boundaries between ideas, inspired by systems thinkers to reveal new insights and patterns in complex systems.
154. **identify_dsrp_systems**: Encourages organizing ideas into systems of parts and wholes, inspired by systems thinkers to explore relationships and how changes in organization impact meaning and understanding.
155. **identify_job_stories**: Identifies key job stories or requirements for roles.
156. **improve_academic_writing**: Refines text into clear, concise academic language while improving grammar, coherence, and clarity, with a list of changes.
157. **improve_prompt**: Improves an LLM/AI prompt by applying expert prompt writing strategies for better results and clarity.
158. **improve_report_finding**: Improves a penetration test security finding by providing detailed descriptions, risks, recommendations, references, quotes, and a concise summary in markdown format.
159. **improve_writing**: Refines text by correcting grammar, enhancing style, improving clarity, and maintaining the original meaning. skills.
160. **judge_output**: Evaluates Honeycomb queries by judging their effectiveness, providing critiques and outcomes based on language nuances and analytics relevance.
161. **label_and_rate**: Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
162. **md_callout**: Classifies content and generates a markdown callout based on the provided text, selecting the most appropriate type.
163. **official_pattern_template**: Template to use if you want to create new fabric patterns.
164. **prepare_7s_strategy**: Prepares a comprehensive briefing document from 7S's strategy capturing organizational profile, strategic elements, and market dynamics with clear, concise, and organized content.
165. **provide_guidance**: Provides psychological and life coaching advice, including analysis, recommendations, and potential diagnoses, with a compassionate and honest tone.
166. **rate_ai_response**: Rates the quality of AI responses by comparing them to top human expert performance, assigning a letter grade, reasoning, and providing a 1-100 score based on the evaluation.
167. **rate_ai_result**: Assesses the quality of AI/ML/LLM work by deeply analyzing content, instructions, and output, then rates performance based on multiple dimensions, including coverage, creativity, and interdisciplinary thinking.
168. **rate_content**: Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
169. **rate_value**: Produces the best possible output by deeply analyzing and understanding the input and its intended purpose.
170. **raw_query**: Fully digests and contemplates the input to produce the best possible result based on understanding the sender's intent.
171. **recommend_artists**: Recommends a personalized festival schedule with artists aligned to your favorite styles and interests, including rationale.
172. **recommend_pipeline_upgrades**: Optimizes vulnerability-checking pipelines by incorporating new information and improving their efficiency, with detailed explanations of changes.
173. **recommend_talkpanel_topics**: Produces a clean set of proposed talks or panel talking points for a person based on their interests and goals, formatted for submission to a conference organizer.
174. **refine_design_document**: Refines a design document based on a design review by analyzing, mapping concepts, and implementing changes using valid Markdown.
175. **review_design**: Reviews and analyzes architecture design, focusing on clarity, component design, system integrations, security, performance, scalability, and data management.
176. **sanitize_broken_html_to_markdown**: Converts messy HTML into clean, properly formatted Markdown, applying custom styling and ensuring compatibility with Vite.
177. **show_fabric_options_markmap**: Visualizes the functionality of the Fabric framework by representing its components, commands, and features based on the provided input.
178. **solve_with_cot**: Provides detailed, step-by-step responses with chain of thought reasoning, using structured thinking, reflection, and output sections.
179. **suggest_pattern**: Suggests appropriate fabric patterns or commands based on user input, providing clear explanations and options for users.
180. **summarize**: Summarizes content into a 20-word sentence, main points, and takeaways, formatted with numbered lists in Markdown.
181. **summarize_board_meeting**: Creates formal meeting notes from board meeting transcripts for corporate governance documentation.
182. **summarize_debate**: Summarizes debates, identifies primary disagreement, extracts arguments, and provides analysis of evidence and argument strength to predict outcomes.
183. **summarize_git_changes**: Summarizes recent project updates from the last 7 days, focusing on key changes with enthusiasm.
184. **summarize_git_diff**: Summarizes and organizes Git diff changes with clear, succinct commit messages and bullet points.
185. **summarize_lecture**: Extracts relevant topics, definitions, and tools from lecture transcripts, providing structured summaries with timestamps and key takeaways.
186. **summarize_legislation**: Summarizes complex political proposals and legislation by analyzing key points, proposed changes, and providing balanced, positive, and cynical characterizations.
187. **summarize_meeting**: Analyzes meeting transcripts to extract a structured summary, including an overview, key points, tasks, decisions, challenges, timeline, references, and next steps.
188. **summarize_micro**: Summarizes content into a 20-word sentence, 3 main points, and 3 takeaways, formatted in clear, concise Markdown.
189. **summarize_newsletter**: Extracts the most meaningful, interesting, and useful content from a newsletter, summarizing key sections such as content, opinions, tools, companies, and follow-up items in clear, structured Markdown.
190. **summarize_paper**: Summarizes an academic paper by detailing its title, authors, technical approach, distinctive features, experimental setup, results, advantages, limitations, and conclusion in a clear, structured format using human-readable Markdown.
191. **summarize_prompt**: Summarizes AI chat prompts by describing the primary function, unique approach, and expected output in a concise paragraph. The summary is focused on the prompt's purpose without unnecessary details or formatting.
192. **summarize_pull-requests**: Summarizes pull requests for a coding project by providing a summary and listing the top PRs with human-readable descriptions.
193. **summarize_rpg_session**: Summarizes a role-playing game session by extracting key events, combat stats, character changes, quotes, and more.
194. **t_analyze_challenge_handling**: Provides 8-16 word bullet points evaluating how well challenges are being addressed, calling out any lack of effort.
195. **t_check_metrics**: Analyzes deep context from the TELOS file and input instruction, then provides a wisdom-based output while considering metrics and KPIs to assess recent improvements.
196. **t_create_h3_career**: Summarizes context and produces wisdom-based output by deeply analyzing both the TELOS File and the input instruction, considering the relationship between the two.
197. **t_create_opening_sentences**: Describes from TELOS file the person's identity, goals, and actions in 4 concise, 32-word bullet points, humbly.
198. **t_describe_life_outlook**: Describes from TELOS file a person's life outlook in 5 concise, 16-word bullet points.
199. **t_extract_intro_sentences**: Summarizes from TELOS file a person's identity, work, and current projects in 5 concise and grounded bullet points.
200. **t_extract_panel_topics**: Creates 5 panel ideas with titles and descriptions based on deep context from a TELOS file and input.
201. **t_find_blindspots**: Identify potential blindspots in thinking, frames, or models that may expose the individual to error or risk.
202. **t_find_negative_thinking**: Analyze a TELOS file and input to identify negative thinking in documents or journals, followed by tough love encouragement.
203. **t_find_neglected_goals**: Analyze a TELOS file and input instructions to identify goals or projects that have not been worked on recently.
204. **t_give_encouragement**: Analyze a TELOS file and input instructions to evaluate progress, provide encouragement, and offer recommendations for continued effort.
205. **t_red_team_thinking**: Analyze a TELOS file and input instructions to red-team thinking, models, and frames, then provide recommendations for improvement.
206. **t_threat_model_plans**: Analyze a TELOS file and input instructions to create threat models for a life plan and recommend improvements.
207. **t_visualize_mission_goals_projects**: Analyze a TELOS file and input instructions to create an ASCII art diagram illustrating the relationship of missions, goals, and projects.
208. **t_year_in_review**: Analyze a TELOS file to create insights about a person or entity, then summarize accomplishments and visualizations in bullet points.
209. **to_flashcards**: Create Anki flashcards from a given text, focusing on concise, optimized questions and answers without external context.
210. **transcribe_minutes**: Extracts (from meeting transcription) meeting minutes, identifying actionables, insightful ideas, decisions, challenges, and next steps in a structured format.
211. **translate**: Translates sentences or documentation into the specified language code while maintaining the original formatting and tone.
212. **tweet**: Provides a step-by-step guide on crafting engaging tweets with emojis, covering Twitter basics, account creation, features, and audience targeting.
213. **write_essay**: Writes essays in the style of a specified author, embodying their unique voice, vocabulary, and approach. Uses `author_name` variable.
214. **write_essay_pg**: Writes concise, clear essays in the style of Paul Graham, focusing on simplicity, clarity, and illumination of the provided topic.
215. **write_hackerone_report**: Generates concise, clear, and reproducible bug bounty reports, detailing vulnerability impact, steps to reproduce, and exploit details for triagers.
216. **write_latex**: Generates syntactically correct LaTeX code for a new.tex document, ensuring proper formatting and compatibility with pdflatex.
217. **write_micro_essay**: Writes concise, clear, and illuminating essays on the given topic in the style of Paul Graham.
218. **write_nuclei_template_rule**: Generates Nuclei YAML templates for detecting vulnerabilities using HTTP requests, matchers, extractors, and dynamic data extraction.
219. **write_pull-request**: Drafts detailed pull request descriptions, explaining changes, providing reasoning, and identifying potential bugs from the git diff command output.
220. **write_semgrep_rule**: Creates accurate and working Semgrep rules based on input, following syntax guidelines and specific language considerations.
221. **youtube_summary**: Create concise, timestamped Youtube video summaries that highlight key points.

View File

@@ -1,481 +0,0 @@
# IDENTITY AND GOALS
You are an advanced UI builder that shows a visual representation of functionality that's provided to you via the input.
# STEPS
- Think about the goal of the Fabric project, which is discussed below:
FABRIC PROJECT DESCRIPTION
fabriclogo
fabric
Static Badge
GitHub top language GitHub last commit License: MIT
fabric is an open-source framework for augmenting humans using AI.
Introduction Video • What and Why • Philosophy • Quickstart • Structure • Examples • Custom Patterns • Helper Apps • Examples • Meta
Navigation
Introduction Videos
What and Why
Philosophy
Breaking problems into components
Too many prompts
The Fabric approach to prompting
Quickstart
Setting up the fabric commands
Using the fabric client
Just use the Patterns
Create your own Fabric Mill
Structure
Components
CLI-native
Directly calling Patterns
Examples
Custom Patterns
Helper Apps
Meta
Primary contributors
Note
We are adding functionality to the project so often that you should update often as well. That means: git pull; pipx install . --force; fabric --update; source ~/.zshrc (or ~/.bashrc) in the main directory!
March 13, 2024 — We just added pipx install support, which makes it way easier to install Fabric, support for Claude, local models via Ollama, and a number of new Patterns. Be sure to update and check fabric -h for the latest!
Introduction videos
Note
These videos use the ./setup.sh install method, which is now replaced with the easier pipx install . method. Other than that everything else is still the same.
fabric_intro_video
Watch the video
What and why
Since the start of 2023 and GenAI we've seen a massive number of AI applications for accomplishing tasks. It's powerful, but it's not easy to integrate this functionality into our lives.
In other words, AI doesn't have a capabilities problem—it has an integration problem.
Fabric was created to address this by enabling everyone to granularly apply AI to everyday challenges.
Philosophy
AI isn't a thing; it's a magnifier of a thing. And that thing is human creativity.
We believe the purpose of technology is to help humans flourish, so when we talk about AI we start with the human problems we want to solve.
Breaking problems into components
Our approach is to break problems into individual pieces (see below) and then apply AI to them one at a time. See below for some examples.
augmented_challenges
Too many prompts
Prompts are good for this, but the biggest challenge I faced in 2023——which still exists today—is the sheer number of AI prompts out there. We all have prompts that are useful, but it's hard to discover new ones, know if they are good or not, and manage different versions of the ones we like.
One of fabric's primary features is helping people collect and integrate prompts, which we call Patterns, into various parts of their lives.
Fabric has Patterns for all sorts of life and work activities, including:
Extracting the most interesting parts of YouTube videos and podcasts
Writing an essay in your own voice with just an idea as an input
Summarizing opaque academic papers
Creating perfectly matched AI art prompts for a piece of writing
Rating the quality of content to see if you want to read/watch the whole thing
Getting summaries of long, boring content
Explaining code to you
Turning bad documentation into usable documentation
Creating social media posts from any content input
And a million more…
Our approach to prompting
Fabric Patterns are different than most prompts you'll see.
First, we use Markdown to help ensure maximum readability and editability. This not only helps the creator make a good one, but also anyone who wants to deeply understand what it does. Importantly, this also includes the AI you're sending it to!
Here's an example of a Fabric Pattern.
https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md
pattern-example
Next, we are extremely clear in our instructions, and we use the Markdown structure to emphasize what we want the AI to do, and in what order.
And finally, we tend to use the System section of the prompt almost exclusively. In over a year of being heads-down with this stuff, we've just seen more efficacy from doing that. If that changes, or we're shown data that says otherwise, we will adjust.
Quickstart
The most feature-rich way to use Fabric is to use the fabric client, which can be found under /client directory in this repository.
Setting up the fabric commands
Follow these steps to get all fabric related apps installed and configured.
Navigate to where you want the Fabric project to live on your system in a semi-permanent place on your computer.
# Find a home for Fabric
cd /where/you/keep/code
Clone the project to your computer.
# Clone Fabric to your computer
git clone https://github.com/danielmiessler/fabric.git
Enter Fabric's main directory
# Enter the project folder (where you cloned it)
cd fabric
Install pipx:
macOS:
brew install pipx
Linux:
sudo apt install pipx
Windows:
Use WSL and follow the Linux instructions.
Install fabric
pipx install .
Run setup:
fabric --setup
Restart your shell to reload everything.
Now you are up and running! You can test by running the help.
# Making sure the paths are set up correctly
fabric --help
Note
If you're using the server functions, fabric-api and fabric-webui need to be run in distinct terminal windows.
Using the fabric client
Once you have it all set up, here's how to use it.
Check out the options fabric -h
us the results in
realtime. NOTE: You will not be able to pipe the
output into another command.
--list, -l List available patterns
--clear Clears your persistent model choice so that you can
once again use the --model flag
--update, -u Update patterns. NOTE: This will revert the default
model to gpt4-turbo. please run --changeDefaultModel
to once again set default model
--pattern PATTERN, -p PATTERN
The pattern (prompt) to use
--setup Set up your fabric instance
--changeDefaultModel CHANGEDEFAULTMODEL
Change the default model. For a list of available
models, use the --listmodels flag.
--model MODEL, -m MODEL
Select the model to use. NOTE: Will not work if you
have set a default model. please use --clear to clear
persistence before using this flag
--vendor VENDOR, -V VENDOR
Specify vendor for the selected model (e.g., -V "LM Studio" -m openai/gpt-oss-20b)
--listmodels List all available models
--remoteOllamaServer REMOTEOLLAMASERVER
The URL of the remote ollamaserver to use. ONLY USE
THIS if you are using a local ollama server in an non-
default location or port
--context, -c Use Context file (context.md) to add context to your
pattern
age: fabric [-h] [--text TEXT] [--copy] [--agents {trip_planner,ApiKeys}]
[--output [OUTPUT]] [--stream] [--list] [--clear] [--update]
[--pattern PATTERN] [--setup]
[--changeDefaultModel CHANGEDEFAULTMODEL] [--model MODEL]
[--listmodels] [--remoteOllamaServer REMOTEOLLAMASERVER]
[--context]
An open source framework for augmenting humans using AI.
options:
-h, --help show this help message and exit
--text TEXT, -t TEXT Text to extract summary from
--copy, -C Copy the response to the clipboard
--agents {trip_planner,ApiKeys}, -a {trip_planner,ApiKeys}
Use an AI agent to help you with a task. Acceptable
values are 'trip_planner' or 'ApiKeys'. This option
cannot be used with any other flag.
--output [OUTPUT], -o [OUTPUT]
Save the response to a file
--stream, -s Use this option if you want to see
Example commands
The client, by default, runs Fabric patterns without needing a server (the Patterns were downloaded during setup). This means the client connects directly to OpenAI using the input given and the Fabric pattern used.
Run the summarize Pattern based on input from stdin. In this case, the body of an article.
pbpaste | fabric --pattern summarize
Run the analyze_claims Pattern with the --stream option to get immediate and streaming results.
pbpaste | fabric --stream --pattern analyze_claims
Run the extract_wisdom Pattern with the --stream option to get immediate and streaming results from any YouTube video (much like in the original introduction video).
yt --transcript https://youtube.com/watch?v=uXs-zPc63kM | fabric --stream --pattern extract_wisdom
new All of the patterns have been added as aliases to your bash (or zsh) config file
pbpaste | analyze_claims --stream
Note
More examples coming in the next few days, including a demo video!
Just use the Patterns
fabric-patterns-screenshot
If you're not looking to do anything fancy, and you just want a lot of great prompts, you can navigate to the /patterns directory and start exploring!
We hope that if you used nothing else from Fabric, the Patterns by themselves will make the project useful.
You can use any of the Patterns you see there in any AI application that you have, whether that's ChatGPT or some other app or website. Our plan and prediction is that people will soon be sharing many more than those we've published, and they will be way better than ours.
The wisdom of crowds for the win.
Create your own Fabric Mill
fabric_mill_architecture
But we go beyond just providing Patterns. We provide code for you to build your very own Fabric server and personal AI infrastructure!
Structure
Fabric is themed off of, well… fabric—as in…woven materials. So, think blankets, quilts, patterns, etc. Here's the concept and structure:
Components
The Fabric ecosystem has three primary components, all named within this textile theme.
The Mill is the (optional) server that makes Patterns available.
Patterns are the actual granular AI use cases (prompts).
Stitches are chained together Patterns that create advanced functionality (see below).
Looms are the client-side apps that call a specific Pattern hosted by a Mill.
CLI-native
One of the coolest parts of the project is that it's command-line native!
Each Pattern you see in the /patterns directory can be used in any AI application you use, but you can also set up your own server using the /server code and then call APIs directly!
Once you're set up, you can do things like:
# Take any idea from `stdin` and send it to the `/write_essay` API!
echo "An idea that coding is like speaking with rules." | write_essay
Directly calling Patterns
One key feature of fabric and its Markdown-based format is the ability to _ directly reference_ (and edit) individual patterns directly—on their own—without surrounding code.
As an example, here's how to call the direct location of the extract_wisdom pattern.
https://github.com/danielmiessler/fabric/blob/main/patterns/extract_wisdom/system.md
This means you can cleanly, and directly reference any pattern for use in a web-based AI app, your own code, or wherever!
Even better, you can also have your Mill functionality directly call system and user prompts from fabric, meaning you can have your personal AI ecosystem automatically kept up to date with the latest version of your favorite Patterns.
Here's what that looks like in code:
https://github.com/danielmiessler/fabric/blob/main/server/fabric_api_server.py
# /extwis
@app.route("/extwis", methods=["POST"])
@auth_required # Require authentication
def extwis():
data = request.get_json()
# Warn if there's no input
if "input" not in data:
return jsonify({"error": "Missing input parameter"}), 400
# Get data from client
input_data = data["input"]
# Set the system and user URLs
system_url = "https://raw.githubusercontent.com/danielmiessler/fabric/main/patterns/extract_wisdom/system.md"
user_url = "https://raw.githubusercontent.com/danielmiessler/fabric/main/patterns/extract_wisdom/user.md"
# Fetch the prompt content
system_content = fetch_content_from_url(system_url)
user_file_content = fetch_content_from_url(user_url)
# Build the API call
system_message = {"role": "system", "content": system_content}
user_message = {"role": "user", "content": user_file_content + "\n" + input_data}
messages = [system_message, user_message]
try:
response = openai.chat.completions.create(
model="gpt-4-1106-preview",
messages=messages,
temperature=0.0,
top_p=1,
frequency_penalty=0.1,
presence_penalty=0.1,
)
assistant_message = response.choices[0].message.content
return jsonify({"response": assistant_message})
except Exception as e:
return jsonify({"error": str(e)}), 500
Examples
Here's an abridged output example from the extract_wisdom pattern (limited to only 10 items per section).
# Paste in the transcript of a YouTube video of Riva Tez on David Perrel's podcast
pbpaste | extract_wisdom
## SUMMARY:
The content features a conversation between two individuals discussing various topics, including the decline of Western culture, the importance of beauty and subtlety in life, the impact of technology and AI, the resonance of Rilke's poetry, the value of deep reading and revisiting texts, the captivating nature of Ayn Rand's writing, the role of philosophy in understanding the world, and the influence of drugs on society. They also touch upon creativity, attention spans, and the importance of introspection.
## IDEAS:
1. Western culture is perceived to be declining due to a loss of values and an embrace of mediocrity.
2. Mass media and technology have contributed to shorter attention spans and a need for constant stimulation.
3. Rilke's poetry resonates due to its focus on beauty and ecstasy in everyday objects.
4. Subtlety is often overlooked in modern society due to sensory overload.
5. The role of technology in shaping music and performance art is significant.
6. Reading habits have shifted from deep, repetitive reading to consuming large quantities of new material.
7. Revisiting influential books as one ages can lead to new insights based on accumulated wisdom and experiences.
8. Fiction can vividly illustrate philosophical concepts through characters and narratives.
9. Many influential thinkers have backgrounds in philosophy, highlighting its importance in shaping reasoning skills.
10. Philosophy is seen as a bridge between theology and science, asking questions that both fields seek to answer.
## QUOTES:
1. "You can't necessarily think yourself into the answers. You have to create space for the answers to come to you."
2. "The West is dying and we are killing her."
3. "The American Dream has been replaced by mass packaged mediocrity porn, encouraging us to revel like happy pigs in our own meekness."
4. "There's just not that many people who have the courage to reach beyond consensus and go explore new ideas."
5. "I'll start watching Netflix when I've read the whole of human history."
6. "Rilke saw beauty in everything... He sees it's in one little thing, a representation of all things that are beautiful."
7. "Vanilla is a very subtle flavor... it speaks to sort of the sensory overload of the modern age."
8. "When you memorize chapters [of the Bible], it takes a few months, but you really understand how things are structured."
9. "As you get older, if there's books that moved you when you were younger, it's worth going back and rereading them."
10. "She [Ayn Rand] took complicated philosophy and embodied it in a way that anybody could resonate with."
## HABITS:
1. Avoiding mainstream media consumption for deeper engagement with historical texts and personal research.
2. Regularly revisiting influential books from youth to gain new insights with age.
3. Engaging in deep reading practices rather than skimming or speed-reading material.
4. Memorizing entire chapters or passages from significant texts for better understanding.
5. Disengaging from social media and fast-paced news cycles for more focused thought processes.
6. Walking long distances as a form of meditation and reflection.
7. Creating space for thoughts to solidify through introspection and stillness.
8. Embracing emotions such as grief or anger fully rather than suppressing them.
9. Seeking out varied experiences across different careers and lifestyles.
10. Prioritizing curiosity-driven research without specific goals or constraints.
## FACTS:
1. The West is perceived as declining due to cultural shifts away from traditional values.
2. Attention spans have shortened due to technological advancements and media consumption habits.
3. Rilke's poetry emphasizes finding beauty in everyday objects through detailed observation.
4. Modern society often overlooks subtlety due to sensory overload from various stimuli.
5. Reading habits have evolved from deep engagement with texts to consuming large quantities quickly.
6. Revisiting influential books can lead to new insights based on accumulated life experiences.
7. Fiction can effectively illustrate philosophical concepts through character development and narrative arcs.
8. Philosophy plays a significant role in shaping reasoning skills and understanding complex ideas.
9. Creativity may be stifled by cultural nihilism and protectionist attitudes within society.
10. Short-term thinking undermines efforts to create lasting works of beauty or significance.
## REFERENCES:
1. Rainer Maria Rilke's poetry
2. Netflix
3. Underworld concert
4. Katy Perry's theatrical performances
5. Taylor Swift's performances
6. Bible study
7. Atlas Shrugged by Ayn Rand
8. Robert Pirsig's writings
9. Bertrand Russell's definition of philosophy
10. Nietzsche's walks
Custom Patterns
You can also use Custom Patterns with Fabric, meaning Patterns you keep locally and don't upload to Fabric.
One possible place to store them is ~/.config/custom-fabric-patterns.
Then when you want to use them, simply copy them into ~/.config/fabric/patterns.
cp -a ~/.config/custom-fabric-patterns/* ~/.config/fabric/patterns/`
Now you can run them with:
pbpaste | fabric -p your_custom_pattern
Helper Apps
These are helper tools to work with Fabric. Examples include things like getting transcripts from media files, getting metadata about media, etc.
yt (YouTube)
yt is a command that uses the YouTube API to pull transcripts, pull user comments, get video duration, and other functions. It's primary function is to get a transcript from a video that can then be stitched (piped) into other Fabric Patterns.
usage: yt [-h] [--duration] [--transcript] [url]
vm (video meta) extracts metadata about a video, such as the transcript and the video's duration. By Daniel Miessler.
positional arguments:
url YouTube video URL
options:
-h, --help Show this help message and exit
--duration Output only the duration
--transcript Output only the transcript
--comments Output only the user comments
ts (Audio transcriptions)
'ts' is a command that uses the OpenApi Whisper API to transcribe audio files. Due to the context window, this tool uses pydub to split the files into 10 minute segments. for more information on pydub, please refer https://github.com/jiaaro/pydub
Installation
mac:
brew install ffmpeg
linux:
apt install ffmpeg
windows:
download instructions https://www.ffmpeg.org/download.html
ts -h
usage: ts [-h] audio_file
Transcribe an audio file.
positional arguments:
audio_file The path to the audio file to be transcribed.
options:
-h, --help show this help message and exit
Save
save is a "tee-like" utility to pipeline saving of content, while keeping the output stream intact. Can optionally generate "frontmatter" for PKM utilities like Obsidian via the "FABRIC_FRONTMATTER" environment variable
If you'd like to default variables, set them in ~/.config/fabric/.env. FABRIC_OUTPUT_PATH needs to be set so save where to write. FABRIC_FRONTMATTER_TAGS is optional, but useful for tracking how tags have entered your PKM, if that's important to you.
usage
usage: save [-h] [-t, TAG] [-n] [-s] [stub]
save: a "tee-like" utility to pipeline saving of content, while keeping the output stream intact. Can optionally generate "frontmatter" for PKM utilities like Obsidian via the
"FABRIC_FRONTMATTER" environment variable
positional arguments:
stub stub to describe your content. Use quotes if you have spaces. Resulting format is YYYY-MM-DD-stub.md by default
options:
-h, --help show this help message and exit
-t, TAG, --tag TAG add an additional frontmatter tag. Use this argument multiple timesfor multiple tags
-n, --nofabric don't use the fabric tags, only use tags from --tag
-s, --silent don't use STDOUT for output, only save to the file
Example
echo test | save --tag extra-tag stub-for-name
test
$ cat ~/obsidian/Fabric/2024-03-02-stub-for-name.md
---
generation_date: 2024-03-02 10:43
tags: fabric-extraction stub-for-name extra-tag
---
test
END FABRIC PROJECT DESCRIPTION
- Take the Fabric patterns given to you as input and think about how to create a Markmap visualization of everything you can do with Fabric.
Examples: Analyzing videos, summarizing articles, writing essays, etc.
- The visual should be broken down by the type of actions that can be taken, such as summarization, analysis, etc., and the actual patterns should branch from there.
# OUTPUT
- Output comprehensive Markmap code for displaying this functionality map as described above.
- NOTE: This is Markmap, NOT Markdown.
- Output the Markmap code and nothing else.

View File

@@ -1,23 +1,128 @@
# IDENTITY and PURPOSE
You are an AI assistant tasked with creating a new feature for a fabric command-line tool. Your primary responsibility is to develop a pattern that suggests appropriate fabric patterns or commands based on user input. You are knowledgeable about fabric commands and understand the need to expand the tool's functionality. Your role involves analyzing user requests, determining the most suitable fabric commands or patterns, and providing helpful suggestions to users.
You are an expert AI assistant specialized in the Fabric framework - an open-source tool for augmenting human capabilities with AI. Your primary responsibility is to analyze user requests and suggest the most appropriate fabric patterns or commands to accomplish their goals. You have comprehensive knowledge of all available patterns, their categories, capabilities, and use cases.
Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.
# STEPS
- Analyze the user's input to understand their specific needs and context
- Determine the appropriate fabric pattern or command based on the user's request
- Generate a response that suggests the relevant fabric command(s) or pattern(s)
- Provide explanations or multiple options when applicable
- If no specific command is found, suggest using `create_pattern`
## 1. ANALYZE USER INPUT
- Parse the user's request to understand their primary objective
- Identify the type of content they're working with (text, code, data, etc.)
- Determine the desired output format or outcome
- Consider the user's level of expertise with fabric
## 2. CATEGORIZE THE REQUEST
Match the request to one or more of these primary categories:
- **AI** - AI-related patterns for model guidance, art prompts, evaluation
- **ANALYSIS** - Analysis and evaluation of content, data, claims, debates
- **BILL** - Legislative bill analysis and implications
- **BUSINESS** - Business strategy, agreements, sales, presentations
- **CLASSIFICATION** - Content categorization and tagging
- **CONVERSION** - Format conversion between different data types
- **CR THINKING** - Critical thinking, logical analysis, bias detection
- **CREATIVITY** - Creative writing, essay generation, artistic content
- **DEVELOPMENT** - Software development, coding, project design
- **DEVOPS** - Infrastructure, deployment, pipeline management
- **EXTRACT** - Information extraction from various content types
- **GAMING** - RPG, D&D, gaming-related content creation
- **LEARNING** - Educational content, tutorials, explanations
- **OTHER** - Miscellaneous patterns that don't fit other categories
- **RESEARCH** - Academic research, paper analysis, investigation
- **REVIEW** - Evaluation and review of content, code, designs
- **SECURITY** - Cybersecurity analysis, threat modeling, vulnerability assessment
- **SELF** - Personal development, guidance, self-improvement
- **STRATEGY** - Strategic analysis, planning, decision-making
- **SUMMARIZE** - Content summarization at various levels of detail
- **VISUALIZE** - Data visualization, diagrams, charts, graphics
- **WISDOM** - Wisdom extraction, insights, life lessons
- **WRITING** - Writing assistance, improvement, formatting
## 3. SUGGEST APPROPRIATE PATTERNS
- Recommend 1-3 most suitable patterns based on the analysis
- Prioritize patterns that directly address the user's main objective
- Consider alternative patterns for different approaches to the same goal
- Include both primary and secondary pattern suggestions when relevant
## 4. PROVIDE CONTEXT AND USAGE
- Explain WHY each suggested pattern is appropriate
- Include the exact fabric command syntax
- Mention any important considerations or limitations
- Suggest complementary patterns if applicable
# OUTPUT INSTRUCTIONS
- Only output Markdown
- Provide suggestions for fabric commands or patterns based on the user's input
- Include explanations or multiple options when appropriate
- If suggesting `create_pattern`, include instructions for saving and using the new pattern
- Format the output to be clear and easy to understand for users new to fabric
- Ensure the response aligns with the goal of making fabric more accessible and user-friendly
- Ensure you follow ALL these instructions when creating your output
- Structure your response with clear headings and sections
- Provide specific fabric command examples: `fabric --pattern pattern_name`
- Include brief explanations of what each pattern does
- If multiple patterns could work, rank them by relevance
- For complex requests, suggest a workflow using multiple patterns
- If no existing pattern fits perfectly, suggest `create_pattern` with specific guidance
- Format the output to be actionable and easy to follow
- Ensure suggestions align with making fabric more accessible and powerful
# PATTERN MATCHING GUIDELINES
## Common Request Types and Best Patterns
**AI**: ai, create_ai_jobs_analysis, create_art_prompt, create_pattern, create_prediction_block, extract_mcp_servers, extract_wisdom_agents, generate_code_rules, improve_prompt, judge_output, rate_ai_response, rate_ai_result, raw_query, solve_with_cot, suggest_pattern, summarize_prompt
**ANALYSIS**: ai, analyze_answers, analyze_bill, analyze_bill_short, analyze_candidates, analyze_cfp_submission, analyze_claims, analyze_comments, analyze_debate, analyze_email_headers, analyze_incident, analyze_interviewer_techniques, analyze_logs, analyze_malware, analyze_military_strategy, analyze_mistakes, analyze_paper, analyze_paper_simple, analyze_patent, analyze_personality, analyze_presentation, analyze_product_feedback, analyze_proposition, analyze_prose, analyze_prose_json, analyze_prose_pinker, analyze_risk, analyze_sales_call, analyze_spiritual_text, analyze_tech_impact, analyze_terraform_plan, analyze_threat_report, analyze_threat_report_cmds, analyze_threat_report_trends, apply_ul_tags, check_agreement, compare_and_contrast, create_ai_jobs_analysis, create_idea_compass, create_investigation_visualization, create_prediction_block, create_recursive_outline, create_tags, dialog_with_socrates, extract_main_idea, extract_predictions, find_hidden_message, find_logical_fallacies, get_wow_per_minute, identify_dsrp_distinctions, identify_dsrp_perspectives, identify_dsrp_relationships, identify_dsrp_systems, identify_job_stories, label_and_rate, prepare_7s_strategy, provide_guidance, rate_content, rate_value, recommend_artists, recommend_talkpanel_topics, review_design, summarize_board_meeting, t_analyze_challenge_handling, t_check_dunning_kruger, t_check_metrics, t_describe_life_outlook, t_extract_intro_sentences, t_extract_panel_topics, t_find_blindspots, t_find_negative_thinking, t_red_team_thinking, t_threat_model_plans, t_year_in_review, write_hackerone_report
**BILL**: analyze_bill, analyze_bill_short
**BUSINESS**: check_agreement, create_ai_jobs_analysis, create_formal_email, create_hormozi_offer, create_loe_document, create_logo, create_newsletter_entry, create_prd, explain_project, extract_business_ideas, extract_product_features, extract_skills, extract_sponsors, identify_job_stories, prepare_7s_strategy, rate_value, t_check_metrics, t_create_h3_career, t_visualize_mission_goals_projects, t_year_in_review, transcribe_minutes
**CLASSIFICATION**: apply_ul_tags
**CONVERSION**: clean_text, convert_to_markdown, create_graph_from_input, export_data_as_csv, extract_videoid, get_youtube_rss, humanize, md_callout, sanitize_broken_html_to_markdown, to_flashcards, transcribe_minutes, translate, tweet, write_latex
**CR THINKING**: capture_thinkers_work, create_idea_compass, create_markmap_visualization, dialog_with_socrates, extract_alpha, extract_controversial_ideas, extract_extraordinary_claims, extract_predictions, extract_primary_problem, extract_wisdom_nometa, find_hidden_message, find_logical_fallacies, solve_with_cot, summarize_debate, t_analyze_challenge_handling, t_check_dunning_kruger, t_find_blindspots, t_find_negative_thinking, t_find_neglected_goals, t_red_team_thinking
**CREATIVITY**: create_mnemonic_phrases, write_essay
**DEVELOPMENT**: agility_story, analyze_logs, analyze_prose_json, answer_interview_question, ask_secure_by_design_questions, ask_uncle_duke, coding_master, create_coding_feature, create_coding_project, create_command, create_design_document, create_git_diff_commit, create_loe_document, create_mermaid_visualization, create_mermaid_visualization_for_github, create_pattern, create_prd, create_sigma_rules, create_user_story, explain_code, explain_docs, explain_project, export_data_as_csv, extract_algorithm_update_recommendations, extract_mcp_servers, extract_poc, extract_product_features, generate_code_rules, get_youtube_rss, identify_job_stories, improve_prompt, official_pattern_template, recommend_pipeline_upgrades, refine_design_document, review_code, review_design, sanitize_broken_html_to_markdown, suggest_pattern, summarize_git_changes, summarize_git_diff, summarize_pull-requests, write_nuclei_template_rule, write_pull-request, write_semgrep_rule
**DEVOPS**: analyze_terraform_plan
**EXTRACT**: analyze_comments, create_aphorisms, create_tags, create_video_chapters, extract_algorithm_update_recommendations, extract_alpha, extract_article_wisdom, extract_book_ideas, extract_book_recommendations, extract_business_ideas, extract_controversial_ideas, extract_core_message, extract_ctf_writeup, extract_domains, extract_extraordinary_claims, extract_ideas, extract_insights, extract_insights_dm, extract_instructions, extract_jokes, extract_latest_video, extract_main_activities, extract_main_idea, extract_mcp_servers, extract_most_redeeming_thing, extract_patterns, extract_poc, extract_predictions, extract_primary_problem, extract_primary_solution, extract_product_features, extract_questions, extract_recipe, extract_recommendations, extract_references, extract_skills, extract_song_meaning, extract_sponsors, extract_videoid, extract_wisdom, extract_wisdom_agents, extract_wisdom_dm, extract_wisdom_nometa, extract_wisdom_short, generate_code_rules, t_extract_intro_sentences, t_extract_panel_topics
**GAMING**: create_npc, create_rpg_summary, summarize_rpg_session
**LEARNING**: analyze_answers, ask_uncle_duke, coding_master, create_diy, create_flash_cards, create_quiz, create_reading_plan, create_story_explanation, dialog_with_socrates, explain_code, explain_docs, explain_math, explain_project, explain_terms, extract_references, improve_academic_writing, provide_guidance, solve_with_cot, summarize_lecture, summarize_paper, to_flashcards, write_essay_pg
**OTHER**: extract_jokes
**RESEARCH**: analyze_candidates, analyze_claims, analyze_paper, analyze_paper_simple, analyze_patent, analyze_proposition, analyze_spiritual_text, analyze_tech_impact, capture_thinkers_work, create_academic_paper, extract_extraordinary_claims, extract_references, find_hidden_message, find_logical_fallacies, identify_dsrp_distinctions, identify_dsrp_perspectives, identify_dsrp_relationships, identify_dsrp_systems, improve_academic_writing, recommend_artists, summarize_paper, write_essay_pg, write_latex, write_micro_essay
**REVIEW**: analyze_cfp_submission, analyze_presentation, analyze_prose, get_wow_per_minute, judge_output, label_and_rate, rate_ai_response, rate_ai_result, rate_content, rate_value, review_code, review_design
**SECURITY**: analyze_email_headers, analyze_incident, analyze_logs, analyze_malware, analyze_risk, analyze_terraform_plan, analyze_threat_report, analyze_threat_report_cmds, analyze_threat_report_trends, ask_secure_by_design_questions, create_command, create_cyber_summary, create_graph_from_input, create_investigation_visualization, create_network_threat_landscape, create_report_finding, create_security_update, create_sigma_rules, create_stride_threat_model, create_threat_scenarios, create_ttrc_graph, create_ttrc_narrative, extract_ctf_writeup, improve_report_finding, recommend_pipeline_upgrades, review_code, t_red_team_thinking, t_threat_model_plans, write_hackerone_report, write_nuclei_template_rule, write_semgrep_rule
**SELF**: analyze_mistakes, analyze_personality, analyze_spiritual_text, create_better_frame, create_diy, create_reading_plan, create_story_about_person, dialog_with_socrates, extract_article_wisdom, extract_book_ideas, extract_book_recommendations, extract_insights, extract_insights_dm, extract_most_redeeming_thing, extract_recipe, extract_recommendations, extract_song_meaning, extract_wisdom, extract_wisdom_dm, extract_wisdom_short, find_female_life_partner, heal_person, provide_guidance, recommend_artists, t_check_dunning_kruger, t_create_h3_career, t_describe_life_outlook, t_find_neglected_goals, t_give_encouragement
**STRATEGY**: analyze_military_strategy, create_better_frame, prepare_7s_strategy, t_analyze_challenge_handling, t_find_blindspots, t_find_negative_thinking, t_find_neglected_goals, t_red_team_thinking, t_threat_model_plans, t_visualize_mission_goals_projects
**SUMMARIZE**: capture_thinkers_work, create_5_sentence_summary, create_micro_summary, create_newsletter_entry, create_show_intro, create_summary, extract_core_message, extract_latest_video, extract_main_idea, summarize, summarize_board_meeting, summarize_debate, summarize_git_changes, summarize_git_diff, summarize_lecture, summarize_legislation, summarize_meeting, summarize_micro, summarize_newsletter, summarize_paper, summarize_pull-requests, summarize_rpg_session, youtube_summary
**VISUALIZE**: create_excalidraw_visualization, create_graph_from_input, create_idea_compass, create_investigation_visualization, create_keynote, create_logo, create_markmap_visualization, create_mermaid_visualization, create_mermaid_visualization_for_github, create_video_chapters, create_visualization, enrich_blog_post, t_visualize_mission_goals_projects
**WISDOM**: extract_alpha, extract_article_wisdom, extract_book_ideas, extract_insights, extract_most_redeeming_thing, extract_recommendations, extract_wisdom, extract_wisdom_dm, extract_wisdom_nometa, extract_wisdom_short
**WRITING**: analyze_prose_json, analyze_prose_pinker, apply_ul_tags, clean_text, compare_and_contrast, convert_to_markdown, create_5_sentence_summary, create_academic_paper, create_aphorisms, create_better_frame, create_design_document, create_diy, create_formal_email, create_hormozi_offer, create_keynote, create_micro_summary, create_newsletter_entry, create_prediction_block, create_prd, create_show_intro, create_story_explanation, create_summary, create_tags, create_user_story, enrich_blog_post, explain_docs, explain_terms, humanize, improve_academic_writing, improve_writing, label_and_rate, md_callout, official_pattern_template, recommend_talkpanel_topics, refine_design_document, summarize, summarize_debate, summarize_lecture, summarize_legislation, summarize_meeting, summarize_micro, summarize_newsletter, summarize_paper, summarize_rpg_session, t_create_opening_sentences, t_describe_life_outlook, t_extract_intro_sentences, t_extract_panel_topics, t_give_encouragement, t_year_in_review, transcribe_minutes, tweet, write_essay, write_essay_pg, write_hackerone_report, write_latex, write_micro_essay, write_pull-request
## Workflow Suggestions
- For complex analysis: First use an extract pattern, then an analyze pattern, finally a summarize pattern
- For content creation: Use relevant create_patterns followed by improve_ patterns for refinement
- For research projects: Combine extract_, analyze_, and summarize_ patterns in sequence
# INPUT
INPUT:
INPUT:

File diff suppressed because it is too large Load Diff

View File

@@ -1,919 +0,0 @@
# Suggest Pattern
## OVERVIEW
What It Does: Fabric is an open-source framework designed to augment human capabilities using AI, making it easier to integrate AI into daily tasks.
Why People Use It: Users leverage Fabric to seamlessly apply AI for solving everyday challenges, enhancing productivity, and fostering human creativity through technology.
## HOW TO USE IT
Most Common Syntax: The most common usage involves executing Fabric commands in the terminal, such as `fabric --pattern <PATTERN_NAME>`.
## COMMON USE CASES
For Summarizing Content: `fabric --pattern summarize`
For Analyzing Claims: `fabric --pattern analyze_claims`
For Extracting Wisdom from Videos: `fabric --pattern extract_wisdom`
For creating custom patterns: `fabric --pattern create_pattern`
- One possible place to store them is ~/.config/custom-fabric-patterns.
- Then when you want to use them, simply copy them into ~/.config/fabric/patterns.
`cp -a ~/.config/custom-fabric-patterns/* ~/.config/fabric/patterns/`
- Now you can run them with: `pbpaste | fabric -p your_custom_pattern`
## MOST IMPORTANT AND USED OPTIONS AND FEATURES
- **--pattern PATTERN, -p PATTERN**: Specifies the pattern (prompt) to use. Useful for applying specific AI prompts to your input.
- **--stream, -s**: Streams results in real-time. Ideal for getting immediate feedback from AI operations.
- **--update, -u**: Updates patterns. Ensures you're using the latest AI prompts for your tasks.
- **--model MODEL, -m MODEL**: Selects the AI model to use. Allows customization of the AI backend for different tasks.
- **--setup, -S**: Sets up your Fabric instance. Essential for first-time users to configure Fabric correctly.
- **--list, -l**: Lists available patterns. Helps users discover new AI prompts for various applications.
- **--context, -C**: Uses a Context file to add context to your pattern. Enhances the relevance of AI responses by providing additional background information.
## PATTERNS
**Key pattern to use: `suggest_pattern`** - suggests appropriate fabric patterns or commands based on user input.
### agility_story
Generate a user story and acceptance criteria in JSON format based on the given topic.
### ai
Interpret questions deeply and provide concise, insightful answers in Markdown bullet points.
### analyze_answers
Evaluate quiz answers for correctness based on learning objectives and generated quiz questions.
### analyze_bill
Analyzes legislation to identify overt and covert goals, examining bills for hidden agendas and true intentions.
### analyze_bill_short
Provides a concise analysis of legislation, identifying overt and covert goals in a brief, structured format.
### analyze_candidates
Compare and contrast two political candidates based on key issues and policies.
### analyze_cfp_submission
Review and evaluate conference speaking session submissions based on clarity, relevance, depth, and engagement potential.
### analyze_claims
Analyse and rate truth claims with evidence, counter-arguments, fallacies, and final recommendations.
### analyze_comments
Evaluate internet comments for content, categorize sentiment, and identify reasons for praise, criticism, and neutrality.
### analyze_debate
Rate debates on insight, emotionality, and present an unbiased, thorough analysis of arguments, agreements, and disagreements.
### analyze_email_headers
Provide cybersecurity analysis and actionable insights on SPF, DKIM, DMARC, and ARC email header results.
### analyze_incident
Efficiently extract and organize key details from cybersecurity breach articles, focusing on attack type, vulnerable components, attacker and target info, incident details, and remediation steps.
### analyze_interviewer_techniques
This exercise involves analyzing interviewer techniques, identifying their unique qualities, and succinctly articulating what makes them stand out in a clear, simple format.
### analyze_logs
Analyse server log files to identify patterns, anomalies, and issues, providing data-driven insights and recommendations for improving server reliability and performance.
### analyze_malware
Analyse malware details, extract key indicators, techniques, and potential detection strategies, and summarize findings concisely for a malware analyst's use in identifying and responding to threats.
### analyze_military_strategy
Analyse a historical battle, offering in-depth insights into strategic decisions, strengths, weaknesses, tactical approaches, logistical factors, pivotal moments, and consequences for a comprehensive military evaluation.
### analyze_mistakes
Analyse past mistakes in thinking patterns, map them to current beliefs, and offer recommendations to improve accuracy in predictions.
### analyze_paper
Analyses research papers by summarizing findings, evaluating rigor, and assessing quality to provide insights for documentation and review.
### analyze_paper_simple
Analyzes academic papers with a focus on primary findings, research quality, and study design evaluation.
### analyze_patent
Analyse a patent's field, problem, solution, novelty, inventive step, and advantages in detail while summarizing and extracting keywords.
### analyze_personality
Performs a deep psychological analysis of a person in the input, focusing on their behavior, language, and psychological traits.
### analyze_presentation
Reviews and critiques presentations by analyzing the content, speaker's underlying goals, self-focus, and entertainment value.
### analyze_product_feedback
A prompt for analyzing and organizing user feedback by identifying themes, consolidating similar comments, and prioritizing them based on usefulness.
### analyze_proposition
Analyzes a ballot proposition by identifying its purpose, impact, arguments for and against, and relevant background information.
### analyze_prose
Evaluates writing for novelty, clarity, and prose, providing ratings, improvement recommendations, and an overall score.
### analyze_prose_json
Evaluates writing for novelty, clarity, prose, and provides ratings, explanations, improvement suggestions, and an overall score in a JSON format.
### analyze_prose_pinker
Evaluates prose based on Steven Pinker's The Sense of Style, analyzing writing style, clarity, and bad writing elements.
### analyze_risk
Conducts a risk assessment of a third-party vendor, assigning a risk score and suggesting security controls based on analysis of provided documents and vendor website.
### analyze_sales_call
Rates sales call performance across multiple dimensions, providing scores and actionable feedback based on transcript analysis.
### analyze_spiritual_text
Compares and contrasts spiritual texts by analyzing claims and differences with the King James Bible.
### analyze_tech_impact
Analyzes the societal impact, ethical considerations, and sustainability of technology projects, evaluating their outcomes and benefits.
### analyze_terraform_plan
Analyzes Terraform plan outputs to assess infrastructure changes, security risks, cost implications, and compliance considerations.
### analyze_threat_report
Extracts surprising insights, trends, statistics, quotes, references, and recommendations from cybersecurity threat reports, summarizing key findings and providing actionable information.
### analyze_threat_report_cmds
Extract and synthesize actionable cybersecurity commands from provided materials, incorporating command-line arguments and expert insights for pentesters and non-experts.
### analyze_threat_report_trends
Extract up to 50 surprising, insightful, and interesting trends from a cybersecurity threat report in markdown format.
### answer_interview_question
Generates concise, tailored responses to technical interview questions, incorporating alternative approaches and evidence to demonstrate the candidate's expertise and experience.
### ask_secure_by_design_questions
Generates a set of security-focused questions to ensure a project is built securely by design, covering key components and considerations.
### ask_uncle_duke
Coordinates a team of AI agents to research and produce multiple software development solutions based on provided specifications, and conducts detailed code reviews to ensure adherence to best practices.
### capture_thinkers_work
Analyze philosophers or philosophies and provide detailed summaries about their teachings, background, works, advice, and related concepts in a structured template.
### check_agreement
Analyze contracts and agreements to identify important stipulations, issues, and potential gotchas, then summarize them in Markdown.
### clean_text
Fix broken or malformatted text by correcting line breaks, punctuation, capitalization, and paragraphs without altering content or spelling.
### coding_master
Explain a coding concept to a beginner, providing examples, and formatting code in markdown with specific output sections like ideas, recommendations, facts, and insights.
### compare_and_contrast
Compare and contrast a list of items in a markdown table, with items on the left and topics on top.
### convert_to_markdown
Convert content to clean, complete Markdown format, preserving all original structure, formatting, links, and code blocks without alterations.
### create_5_sentence_summary
Create concise summaries or answers to input at 5 different levels of depth, from 5 words to 1 word.
### create_academic_paper
Generate a high-quality academic paper in LaTeX format with clear concepts, structured content, and a professional layout.
### create_ai_jobs_analysis
Analyze job categories' susceptibility to automation, identify resilient roles, and provide strategies for personal adaptation to AI-driven changes in the workforce.
### create_aphorisms
Find and generate a list of brief, witty statements.
### create_art_prompt
Generates a detailed, compelling visual description of a concept, including stylistic references and direct AI instructions for creating art.
### create_better_frame
Identifies and analyzes different frames of interpreting reality, emphasizing the power of positive, productive lenses in shaping outcomes.
### create_coding_feature
Generates secure and composable code features using modern technology and best practices from project specifications.
### create_coding_project
Generate wireframes and starter code for any coding ideas that you have.
### create_command
Helps determine the correct parameters and switches for penetration testing tools based on a brief description of the objective.
### create_cyber_summary
Summarizes cybersecurity threats, vulnerabilities, incidents, and malware with a 25-word summary and categorized bullet points, after thoroughly analyzing and mapping the provided input.
### create_design_document
Creates a detailed design document for a system using the C4 model, addressing business and security postures, and including a system context diagram.
### create_diy
Creates structured "Do It Yourself" tutorial patterns by analyzing prompts, organizing requirements, and providing step-by-step instructions in Markdown format.
### create_excalidraw_visualization
Creates complex Excalidraw diagrams to visualize relationships between concepts and ideas in structured format.
### create_flash_cards
Creates flashcards for key concepts, definitions, and terms with question-answer format for educational purposes.
### create_formal_email
Crafts professional, clear, and respectful emails by analyzing context, tone, and purpose, ensuring proper structure and formatting.
### create_git_diff_commit
Generates Git commands and commit messages for reflecting changes in a repository, using conventional commits and providing concise shell commands for updates.
### create_graph_from_input
Generates a CSV file with progress-over-time data for a security program, focusing on relevant metrics and KPIs.
### create_hormozi_offer
Creates a customized business offer based on principles from Alex Hormozi's book, "$100M Offers."
### create_idea_compass
Organizes and structures ideas by exploring their definition, evidence, sources, and related themes or consequences.
### create_investigation_visualization
Creates detailed Graphviz visualizations of complex input, highlighting key aspects and providing clear, well-annotated diagrams for investigative analysis and conclusions.
### create_keynote
Creates TED-style keynote presentations with a clear narrative, structured slides, and speaker notes, emphasizing impactful takeaways and cohesive flow.
### create_loe_document
Creates detailed Level of Effort documents for estimating work effort, resources, and costs for tasks or projects.
### create_logo
Creates simple, minimalist company logos without text, generating AI prompts for vector graphic logos based on input.
### create_markmap_visualization
Transforms complex ideas into clear visualizations using MarkMap syntax, simplifying concepts into diagrams with relationships, boxes, arrows, and labels.
### create_mermaid_visualization
Creates detailed, standalone visualizations of concepts using Mermaid (Markdown) syntax, ensuring clarity and coherence in diagrams.
### create_mermaid_visualization_for_github
Creates standalone, detailed visualizations using Mermaid (Markdown) syntax to effectively explain complex concepts, ensuring clarity and precision.
### create_micro_summary
Summarizes content into a concise, 20-word summary with main points and takeaways, formatted in Markdown.
### create_mnemonic_phrases
Creates memorable mnemonic sentences from given words to aid in memory retention and learning.
### create_network_threat_landscape
Analyzes open ports and services from a network scan and generates a comprehensive, insightful, and detailed security threat report in Markdown.
### create_newsletter_entry
Condenses provided article text into a concise, objective, newsletter-style summary with a title in the style of Frontend Weekly.
### create_npc
Generates a detailed D&D 5E NPC, including background, flaws, stats, appearance, personality, goals, and more in Markdown format.
### create_pattern
Extracts, organizes, and formats LLM/AI prompts into structured sections, detailing the AI's role, instructions, output format, and any provided examples for clarity and accuracy.
### create_prd
Creates a precise Product Requirements Document (PRD) in Markdown based on input.
### create_prediction_block
Extracts and formats predictions from input into a structured Markdown block for a blog post.
### create_quiz
Generates review questions based on learning objectives from the input, adapted to the specified student level, and outputs them in a clear markdown format.
### create_reading_plan
Creates a three-phase reading plan based on an author or topic to help the user become significantly knowledgeable, including core, extended, and supplementary readings.
### create_recursive_outline
Breaks down complex tasks or projects into manageable, hierarchical components with recursive outlining for clarity and simplicity.
### create_report_finding
Creates a detailed, structured security finding report in markdown, including sections on Description, Risk, Recommendations, References, One-Sentence-Summary, and Quotes.
### create_rpg_summary
Summarizes an in-person RPG session with key events, combat details, player stats, and role-playing highlights in a structured format.
### create_security_update
Creates concise security updates for newsletters, covering stories, threats, advisories, vulnerabilities, and a summary of key issues.
### create_show_intro
Creates compelling short intros for podcasts, summarizing key topics and themes discussed in the episode.
### create_sigma_rules
Extracts Tactics, Techniques, and Procedures (TTPs) from security news and converts them into Sigma detection rules for host-based detections.
### create_story_explanation
Summarizes complex content in a clear, approachable story format that makes the concepts easy to understand.
### create_stride_threat_model
Create a STRIDE-based threat model for a system design, identifying assets, trust boundaries, data flows, and prioritizing threats with mitigations.
### create_summary
Summarizes content into a 20-word sentence, 10 main points (16 words max), and 5 key takeaways in Markdown format.
### create_tags
Identifies at least 5 tags from text content for mind mapping tools, including authors and existing tags if present.
### create_threat_scenarios
Identifies likely attack methods for any system by providing a narrative-based threat model, balancing risk and opportunity.
### create_ttrc_graph
Creates a CSV file showing the progress of Time to Remediate Critical Vulnerabilities over time using given data.
### create_ttrc_narrative
Creates a persuasive narrative highlighting progress in reducing the Time to Remediate Critical Vulnerabilities metric over time.
### create_upgrade_pack
Extracts world model and task algorithm updates from content, providing beliefs about how the world works and task performance.
### create_user_story
Writes concise and clear technical user stories for new features in complex software programs, formatted for all stakeholders.
### create_video_chapters
Extracts interesting topics and timestamps from a transcript, providing concise summaries of key moments.
### create_visualization
Transforms complex ideas into visualizations using intricate ASCII art, simplifying concepts where necessary.
### dialog_with_socrates
Engages in deep, meaningful dialogues to explore and challenge beliefs using the Socratic method.
### enrich_blog_post
Enhances Markdown blog files by applying instructions to improve structure, visuals, and readability for HTML rendering.
### explain_code
Explains code, security tool output, configuration text, and answers questions based on the provided input.
### explain_docs
Improves and restructures tool documentation into clear, concise instructions, including overviews, usage, use cases, and key features.
### explain_math
Helps you understand mathematical concepts in a clear and engaging way.
### explain_project
Summarizes project documentation into clear, concise sections covering the project, problem, solution, installation, usage, and examples.
### explain_terms
Produces a glossary of advanced terms from content, providing a definition, analogy, and explanation of why each term matters.
### export_data_as_csv
Extracts and outputs all data structures from the input in properly formatted CSV data.
### extract_algorithm_update_recommendations
Extracts concise, practical algorithm update recommendations from the input and outputs them in a bulleted list.
### extract_article_wisdom
Extracts surprising, insightful, and interesting information from content, categorizing it into sections like summary, ideas, quotes, facts, references, and recommendations.
### extract_book_ideas
Extracts and outputs 50 to 100 of the most surprising, insightful, and interesting ideas from a book's content.
### extract_book_recommendations
Extracts and outputs 50 to 100 practical, actionable recommendations from a book's content.
### extract_business_ideas
Extracts top business ideas from content and elaborates on the best 10 with unique differentiators.
### extract_controversial_ideas
Extracts and outputs controversial statements and supporting quotes from the input in a structured Markdown list.
### extract_core_message
Extracts and outputs a clear, concise sentence that articulates the core message of a given text or body of work.
### extract_ctf_writeup
Extracts a short writeup from a warstory-like text about a cyber security engagement.
### extract_domains
Extracts domains and URLs from content to identify sources used for articles, newsletters, and other publications.
### extract_extraordinary_claims
Extracts and outputs a list of extraordinary claims from conversations, focusing on scientifically disputed or false statements.
### extract_ideas
Extracts and outputs all the key ideas from input, presented as 15-word bullet points in Markdown.
### extract_insights
Extracts and outputs the most powerful and insightful ideas from text, formatted as 16-word bullet points in the INSIGHTS section, also IDEAS section.
### extract_insights_dm
Extracts and outputs all valuable insights and a concise summary of the content, including key points and topics discussed.
### extract_instructions
Extracts clear, actionable step-by-step instructions and main objectives from instructional video transcripts, organizing them into a concise list.
### extract_jokes
Extracts jokes from text content, presenting each joke with its punchline in separate bullet points.
### extract_latest_video
Extracts the latest video URL from a YouTube RSS feed and outputs the URL only.
### extract_main_activities
Extracts key events and activities from transcripts or logs, providing a summary of what happened.
### extract_main_idea
Extracts the main idea and key recommendation from the input, summarizing them in 15-word sentences.
### extract_most_redeeming_thing
Extracts the most redeeming aspect from an input, summarizing it in a single 15-word sentence.
### extract_patterns
Extracts and analyzes recurring, surprising, and insightful patterns from input, providing detailed analysis and advice for builders.
### extract_poc
Extracts proof of concept URLs and validation methods from security reports, providing the URL and command to run.
### extract_predictions
Extracts predictions from input, including specific details such as date, confidence level, and verification method.
### extract_primary_problem
Extracts the primary problem with the world as presented in a given text or body of work.
### extract_primary_solution
Extracts the primary solution for the world as presented in a given text or body of work.
### extract_product_features
Extracts and outputs a list of product features from the provided input in a bulleted format.
### extract_questions
Extracts and outputs all questions asked by the interviewer in a conversation or interview.
### extract_recipe
Extracts and outputs a recipe with a short meal description, ingredients with measurements, and preparation steps.
### extract_recommendations
Extracts and outputs concise, practical recommendations from a given piece of content in a bulleted list.
### extract_references
Extracts and outputs a bulleted list of references to art, stories, books, literature, and other sources from content.
### extract_skills
Extracts and classifies skills from a job description into a table, separating each skill and classifying it as either hard or soft.
### extract_song_meaning
Analyzes a song to provide a summary of its meaning, supported by detailed evidence from lyrics, artist commentary, and fan analysis.
### extract_sponsors
Extracts and lists official sponsors and potential sponsors from a provided transcript.
### extract_videoid
Extracts and outputs the video ID from any given URL.
### extract_wisdom
Extracts surprising, insightful, and interesting information from text on topics like human flourishing, AI, learning, and more.
### extract_wisdom_agents
Extracts valuable insights, ideas, quotes, and references from content, emphasizing topics like human flourishing, AI, learning, and technology.
### extract_wisdom_dm
Extracts all valuable, insightful, and thought-provoking information from content, focusing on topics like human flourishing, AI, learning, and technology.
### extract_wisdom_nometa
Extracts insights, ideas, quotes, habits, facts, references, and recommendations from content, focusing on human flourishing, AI, technology, and related topics.
### find_female_life_partner
Analyzes criteria for finding a female life partner and provides clear, direct, and poetic descriptions.
### find_hidden_message
Extracts overt and hidden political messages, justifications, audience actions, and a cynical analysis from content.
### find_logical_fallacies
Identifies and analyzes fallacies in arguments, classifying them as formal or informal with detailed reasoning.
### get_wow_per_minute
Determines the wow-factor of content per minute based on surprise, novelty, insight, value, and wisdom, measuring how rewarding the content is for the viewer.
### get_youtube_rss
Returns the RSS URL for a given YouTube channel based on the channel ID or URL.
### humanize
Rewrites AI-generated text to sound natural, conversational, and easy to understand, maintaining clarity and simplicity.
### identify_dsrp_distinctions
Encourages creative, systems-based thinking by exploring distinctions, boundaries, and their implications, drawing on insights from prominent systems thinkers.
### identify_dsrp_perspectives
Explores the concept of distinctions in systems thinking, focusing on how boundaries define ideas, influence understanding, and reveal or obscure insights.
### identify_dsrp_relationships
Encourages exploration of connections, distinctions, and boundaries between ideas, inspired by systems thinkers to reveal new insights and patterns in complex systems.
### identify_dsrp_systems
Encourages organizing ideas into systems of parts and wholes, inspired by systems thinkers to explore relationships and how changes in organization impact meaning and understanding.
### identify_job_stories
Identifies key job stories or requirements for roles.
### improve_academic_writing
Refines text into clear, concise academic language while improving grammar, coherence, and clarity, with a list of changes.
### improve_prompt
Improves an LLM/AI prompt by applying expert prompt writing strategies for better results and clarity.
### improve_report_finding
Improves a penetration test security finding by providing detailed descriptions, risks, recommendations, references, quotes, and a concise summary in markdown format.
### improve_writing
Refines text by correcting grammar, enhancing style, improving clarity, and maintaining the original meaning.
### judge_output
Evaluates Honeycomb queries by judging their effectiveness, providing critiques and outcomes based on language nuances and analytics relevance.
### label_and_rate
Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
### md_callout
Classifies content and generates a markdown callout based on the provided text, selecting the most appropriate type.
### official_pattern_template
Template to use if you want to create new fabric patterns.
### prepare_7s_strategy
Prepares a comprehensive briefing document from 7S's strategy capturing organizational profile, strategic elements, and market dynamics with clear, concise, and organized content.
### provide_guidance
Provides psychological and life coaching advice, including analysis, recommendations, and potential diagnoses, with a compassionate and honest tone.
### rate_ai_response
Rates the quality of AI responses by comparing them to top human expert performance, assigning a letter grade, reasoning, and providing a 1-100 score based on the evaluation.
### rate_ai_result
Assesses the quality of AI/ML/LLM work by deeply analyzing content, instructions, and output, then rates performance based on multiple dimensions, including coverage, creativity, and interdisciplinary thinking.
### rate_content
Labels content with up to 20 single-word tags and rates it based on idea count and relevance to human meaning, AI, and other related themes, assigning a tier (S, A, B, C, D) and a quality score.
### rate_value
Produces the best possible output by deeply analyzing and understanding the input and its intended purpose.
### raw_query
Fully digests and contemplates the input to produce the best possible result based on understanding the sender's intent.
### recommend_artists
Recommends a personalized festival schedule with artists aligned to your favorite styles and interests, including rationale.
### recommend_pipeline_upgrades
Optimizes vulnerability-checking pipelines by incorporating new information and improving their efficiency, with detailed explanations of changes.
### recommend_talkpanel_topics
Produces a clean set of proposed talks or panel talking points for a person based on their interests and goals, formatted for submission to a conference organizer.
### refine_design_document
Refines a design document based on a design review by analyzing, mapping concepts, and implementing changes using valid Markdown.
### review_design
Reviews and analyzes architecture design, focusing on clarity, component design, system integrations, security, performance, scalability, and data management.
### sanitize_broken_html_to_markdown
Converts messy HTML into clean, properly formatted Markdown, applying custom styling and ensuring compatibility with Vite.
### show_fabric_options_markmap
Visualizes the functionality of the Fabric framework by representing its components, commands, and features based on the provided input.
### solve_with_cot
Provides detailed, step-by-step responses with chain of thought reasoning, using structured thinking, reflection, and output sections.
### suggest_pattern
Suggests appropriate fabric patterns or commands based on user input, providing clear explanations and options for users.
### summarize
Summarizes content into a 20-word sentence, main points, and takeaways, formatted with numbered lists in Markdown.
### summarize_board_meeting
Creates formal meeting notes from board meeting transcripts for corporate governance documentation.
### summarize_debate
Summarizes debates, identifies primary disagreement, extracts arguments, and provides analysis of evidence and argument strength to predict outcomes.
### summarize_git_changes
Summarizes recent project updates from the last 7 days, focusing on key changes with enthusiasm.
### summarize_git_diff
Summarizes and organizes Git diff changes with clear, succinct commit messages and bullet points.
### summarize_lecture
Extracts relevant topics, definitions, and tools from lecture transcripts, providing structured summaries with timestamps and key takeaways.
### summarize_legislation
Summarizes complex political proposals and legislation by analyzing key points, proposed changes, and providing balanced, positive, and cynical characterizations.
### summarize_meeting
Analyzes meeting transcripts to extract a structured summary, including an overview, key points, tasks, decisions, challenges, timeline, references, and next steps.
### summarize_micro
Summarizes content into a 20-word sentence, 3 main points, and 3 takeaways, formatted in clear, concise Markdown.
### summarize_newsletter
Extracts the most meaningful, interesting, and useful content from a newsletter, summarizing key sections such as content, opinions, tools, companies, and follow-up items in clear, structured Markdown.
### summarize_paper
Summarizes an academic paper by detailing its title, authors, technical approach, distinctive features, experimental setup, results, advantages, limitations, and conclusion in a clear, structured format using human-readable Markdown.
### summarize_prompt
Summarizes AI chat prompts by describing the primary function, unique approach, and expected output in a concise paragraph. The summary is focused on the prompt's purpose without unnecessary details or formatting.
### summarize_pull-requests
Summarizes pull requests for a coding project by providing a summary and listing the top PRs with human-readable descriptions.
### summarize_rpg_session
Summarizes a role-playing game session by extracting key events, combat stats, character changes, quotes, and more.
### t_analyze_challenge_handling
Provides 8-16 word bullet points evaluating how well challenges are being addressed, calling out any lack of effort.
### t_check_metrics
Analyzes deep context from the TELOS file and input instruction, then provides a wisdom-based output while considering metrics and KPIs to assess recent improvements.
### t_create_h3_career
Summarizes context and produces wisdom-based output by deeply analyzing both the TELOS File and the input instruction, considering the relationship between the two.
### t_create_opening_sentences
Describes from TELOS file the person's identity, goals, and actions in 4 concise, 32-word bullet points, humbly.
### t_describe_life_outlook
Describes from TELOS file a person's life outlook in 5 concise, 16-word bullet points.
### t_extract_intro_sentences
Summarizes from TELOS file a person's identity, work, and current projects in 5 concise and grounded bullet points.
### t_extract_panel_topics
Creates 5 panel ideas with titles and descriptions based on deep context from a TELOS file and input.
### t_find_blindspots
Identify potential blindspots in thinking, frames, or models that may expose the individual to error or risk.
### t_find_negative_thinking
Analyze a TELOS file and input to identify negative thinking in documents or journals, followed by tough love encouragement.
### t_find_neglected_goals
Analyze a TELOS file and input instructions to identify goals or projects that have not been worked on recently.
### t_give_encouragement
Analyze a TELOS file and input instructions to evaluate progress, provide encouragement, and offer recommendations for continued effort.
### t_red_team_thinking
Analyze a TELOS file and input instructions to red-team thinking, models, and frames, then provide recommendations for improvement.
### t_threat_model_plans
Analyze a TELOS file and input instructions to create threat models for a life plan and recommend improvements.
### t_visualize_mission_goals_projects
Analyze a TELOS file and input instructions to create an ASCII art diagram illustrating the relationship of missions, goals, and projects.
### t_year_in_review
Analyze a TELOS file to create insights about a person or entity, then summarize accomplishments and visualizations in bullet points.
### to_flashcards
Create Anki flashcards from a given text, focusing on concise, optimized questions and answers without external context.
### transcribe_minutes
Extracts (from meeting transcription) meeting minutes, identifying actionables, insightful ideas, decisions, challenges, and next steps in a structured format.
### translate
Translates sentences or documentation into the specified language code while maintaining the original formatting and tone.
### tweet
Provides a step-by-step guide on crafting engaging tweets with emojis, covering Twitter basics, account creation, features, and audience targeting.
### write_essay
Writes essays in the style of a specified author, embodying their unique voice, vocabulary, and approach. Uses `author_name` variable.
### write_essay_pg
Writes concise, clear essays in the style of Paul Graham, focusing on simplicity, clarity, and illumination of the provided topic.
### write_hackerone_report
Generates concise, clear, and reproducible bug bounty reports, detailing vulnerability impact, steps to reproduce, and exploit details for triagers.
### write_latex
Generates syntactically correct LaTeX code for a new.tex document, ensuring proper formatting and compatibility with pdflatex.
### write_micro_essay
Writes concise, clear, and illuminating essays on the given topic in the style of Paul Graham.
### write_nuclei_template_rule
Generates Nuclei YAML templates for detecting vulnerabilities using HTTP requests, matchers, extractors, and dynamic data extraction.
### write_pull-request
Drafts detailed pull request descriptions, explaining changes, providing reasoning, and identifying potential bugs from the git diff command output.
### write_semgrep_rule
Creates accurate and working Semgrep rules based on input, following syntax guidelines and specific language considerations.
### youtube_summary
Create concise, timestamped Youtube video summaries that highlight key points.

26
docs/CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,26 @@
# Code of Conduct
## Our Expectation
We expect all contributors and community members to act with basic human decency and common sense.
This project exists to help people augment their capabilities with AI, and we welcome contributions from anyone who shares this mission. We assume good faith and trust that everyone involved is here to build something valuable together.
## Guidelines
- **Be respectful**: Treat others as you'd want to be treated in a professional setting
- **Be constructive**: Focus on the work and help make the project better
- **Be collaborative**: We're all working toward the same goal - making Fabric more useful
- **Use good judgment**: If you're not sure whether something is appropriate, it probably isn't
## Reporting Issues
If someone is being genuinely disruptive or harmful, please email the maintainers directly. We'll address legitimate concerns promptly and fairly.
## Enforcement
Maintainers reserve the right to remove content and restrict access for anyone who consistently acts in bad faith or disrupts the community.
---
*This project assumes contributors are adults who can work together professionally. If you can't do that, this isn't the right place for you.*

155
docs/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,155 @@
# Contributing to Fabric
Thanks for contributing to Fabric! Here's what you need to know to get started quickly.
## Quick Setup
### Prerequisites
- Go 1.24+ installed
- Git configured with your details
### Getting Started
```bash
# Clone and setup
git clone https://github.com/danielmiessler/fabric.git
cd fabric
go build -o fabric ./cmd/fabric
./fabric --setup
# Run tests
go test ./...
```
## Development Guidelines
### Code Style
- Follow standard Go conventions (`gofmt`, `golint`)
- Use meaningful variable and function names
- Write tests for new functionality
- Keep functions focused and small
### Commit Messages
Use descriptive commit messages:
```text
feat: add new pattern for code analysis
fix: resolve OAuth token refresh issue
docs: update installation instructions
```
### Project Structure
- `cmd/` - Executable commands
- `internal/` - Private application code
- `data/patterns/` - AI patterns
- `docs/` - Documentation
## Pull Request Process
### Changelog Generation (REQUIRED)
Before submitting your PR, generate a changelog entry:
```bash
cd cmd/generate_changelog
go build -o generate_changelog .
./generate_changelog --incoming-pr YOUR_PR_NUMBER
```
**Requirements:**
- PR must be open and mergeable
- Working directory must be clean
- GitHub token available (GITHUB_TOKEN env var)
**Optional flags:**
- `--ai-summarize` - Enhanced AI-generated summaries
- `--push` - Auto-push the changelog commit
### PR Guidelines
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Write/update tests
5. Generate changelog entry (see above)
6. Submit PR with clear description
### Review Process
- PRs require maintainer review
- Address feedback promptly
- Keep PRs focused on single features/fixes
- Update changelog if you make significant changes
## Testing
### Run Tests
```bash
# All tests
go test ./...
# Specific package
go test ./internal/cli
# With coverage
go test -cover ./...
```
### Test Requirements
- Unit tests for core functionality
- Integration tests for external dependencies
- Examples in documentation
## Patterns
### Creating Patterns
Patterns go in `data/patterns/[pattern-name]/system.md`:
```markdown
# IDENTITY and PURPOSE
You are an expert at...
# STEPS
- Step 1
- Step 2
# OUTPUT
- Output format requirements
# EXAMPLE
Example output here
```
### Pattern Guidelines
- Use clear, actionable language
- Provide specific output formats
- Include examples when helpful
- Test with multiple AI providers
## Documentation
- Update README.md for new features
- Add docs to `docs/` for complex features
- Include usage examples
- Keep documentation current
## Getting Help
- Check existing issues first
- Ask questions in discussions
- Tag maintainers for urgent issues
- Be patient - maintainers are volunteers
## License
By contributing, you agree your contributions will be licensed under the MIT License.

88
docs/README.md Normal file
View File

@@ -0,0 +1,88 @@
# Fabric Documentation
Welcome to the Fabric documentation! This directory contains detailed guides and technical documentation for various features and components of Fabric.
## 📚 Available Documentation
### Core Features
**[Automated-Changelog-Usage.md](./Automated-Changelog-Usage.md)**
Complete guide for developers on using the automated changelog system. Covers the workflow for generating PR changelog entries during development, including setup, validation, and CI/CD integration.
**[YouTube-Processing.md](./YouTube-Processing.md)**
Comprehensive guide for processing YouTube videos and playlists with Fabric. Covers transcript extraction, comment processing, metadata retrieval, and advanced yt-dlp configurations.
**[Using-Speech-To-Text.md](./Using-Speech-To-Text.md)**
Documentation for Fabric's speech-to-text capabilities using OpenAI's Whisper models. Learn how to transcribe audio and video files and process them through Fabric patterns.
### User Interface & Experience
**[Desktop-Notifications.md](./Desktop-Notifications.md)**
Guide to setting up desktop notifications for Fabric commands. Useful for long-running tasks and multitasking scenarios with cross-platform notification support.
**[Shell-Completions.md](./Shell-Completions.md)**
Instructions for setting up intelligent tab completion for Fabric in Zsh, Bash, and Fish shells. Includes automated installation and manual setup options.
**[Gemini-TTS.md](./Gemini-TTS.md)**
Complete guide for using Google Gemini's text-to-speech features with Fabric. Covers voice selection, audio generation, and integration with Fabric patterns.
### Development & Architecture
**[Automated-ChangeLog.md](./Automated-ChangeLog.md)**
Technical documentation outlining the automated CHANGELOG system architecture for CI/CD integration. Details the infrastructure and workflow for maintainers.
**[Project-Restructured.md](./Project-Restructured.md)**
Project restructuring plan and architectural decisions. Documents the transition to standard Go conventions and project organization improvements.
**[NOTES.md](./NOTES.md)**
Development notes on refactoring efforts, model management improvements, and architectural changes. Includes technical details on vendor and model abstraction.
### Audio Resources
**[voices/README.md](./voices/README.md)**
Index of Gemini TTS voice samples demonstrating different AI voice characteristics available in Fabric.
## 🗂️ Additional Resources
### Configuration Files
- `./notification-config.yaml` - Example notification configuration
### Images
- `images/` - Screenshots and visual documentation assets
- `fabric-logo-gif.gif` - Animated Fabric logo
- `fabric-summarize.png` - Screenshot of summarization feature
- `svelte-preview.png` - Web interface preview
## 🚀 Quick Start
New to Fabric? Start with these essential docs:
1. **[../README.md](../README.md)** - Main project README with installation and basic usage
2. **[Shell-Completions.md](./Shell-Completions.md)** - Set up tab completion for better CLI experience
3. **[YouTube-Processing.md](./YouTube-Processing.md)** - Learn one of Fabric's most popular features
4. **[Desktop-Notifications.md](./Desktop-Notifications.md)** - Get notified when long tasks complete
## 🔧 For Contributors
Contributing to Fabric? These docs are essential:
1. **[./CONTRIBUTING.md](./CONTRIBUTING.md)** - Contribution guidelines and setup
2. **[Automated-Changelog-Usage.md](./Automated-Changelog-Usage.md)** - Required workflow for PR submissions
3. **[Project-Restructured.md](./Project-Restructured.md)** - Understanding project architecture
4. **[NOTES.md](./NOTES.md)** - Current development priorities and patterns
## 📝 Documentation Standards
When adding new documentation:
- Use clear, descriptive filenames
- Include practical examples and use cases
- Update this README index with your new docs
- Follow the established markdown formatting conventions
- Test all code examples before publication
---
*For general help and support, see [./SUPPORT.md](./SUPPORT.md)*

158
docs/SECURITY.md Normal file
View File

@@ -0,0 +1,158 @@
# Security Policy
## Supported Versions
We aim to provide security updates for the latest version of Fabric.
We recommend always using the latest version of Fabric for security fixes and improvements.
## Reporting Security Vulnerabilities
**Please DO NOT report security vulnerabilities through public GitHub issues.**
### Preferred Reporting Method
Send security reports directly to: **<kayvan@sylvan.com>** and CC to the project maintainer at **<daniel@danielmiessler.com>**
### What to Include
Please provide the following information:
1. **Vulnerability Type**: What kind of security issue (e.g., injection, authentication bypass, etc.)
2. **Affected Components**: Which parts of Fabric are affected
3. **Impact Assessment**: What could an attacker accomplish
4. **Reproduction Steps**: Clear steps to reproduce the vulnerability
5. **Proposed Fix**: If you have suggestions for remediation
6. **Disclosure Timeline**: Your preferred timeline for public disclosure
### Example Report Format
```text
Subject: [SECURITY] Brief description of vulnerability
Vulnerability Type: SQL Injection
Affected Component: Pattern database queries
Impact: Potential data exposure
Severity: High
Reproduction Steps:
1. Navigate to...
2. Submit payload: ...
3. Observe...
Evidence:
[Screenshots, logs, or proof of concept]
Suggested Fix:
Use parameterized queries instead of string concatenation...
```
## Security Considerations
### API Keys and Secrets
- Never commit API keys to the repository
- Store secrets in environment variables or secure configuration
- Use the built-in setup process for key management
- Regularly rotate API keys
### Input Validation
- All user inputs are validated before processing
- Special attention to pattern definitions and user content
- URL validation for web scraping features
### AI Provider Integration
- Secure communication with AI providers (HTTPS/TLS)
- Token handling follows provider best practices
- No sensitive data logged or cached unencrypted
### Network Security
- Web server endpoints properly authenticated when required
- CORS policies appropriately configured
- Rate limiting implemented where necessary
## Vulnerability Response Process
1. **Report Received**: We'll acknowledge receipt within 24 hours
2. **Initial Assessment**: We'll evaluate severity and impact within 72 hours
3. **Investigation**: We'll investigate and develop fixes
4. **Fix Development**: We'll create and test patches
5. **Coordinated Disclosure**: We'll work with reporter on disclosure timeline
6. **Release**: We'll release patched version with security advisory
### Timeline Expectations
- **Critical**: 1-7 days
- **High**: 7-30 days
- **Medium**: 30-90 days
- **Low**: Next scheduled release
## Bug Bounty
We don't currently offer a formal bug bounty program, but we deeply appreciate security research and will:
- Acknowledge contributors in release notes
- Provide credit in security advisories
- Consider swag or small rewards for significant findings
## Security Best Practices for Users
### Installation
- Download Fabric only from official sources
- Verify checksums when available
- Keep installations up to date
### Configuration
- Use strong, unique API keys
- Don't share configuration files containing secrets
- Set appropriate file permissions on config directories
### Usage
- Be cautious with patterns that process sensitive data
- Review AI provider terms for data handling
- Consider using local models for sensitive content
## Known Security Limitations
### AI Provider Dependencies
Fabric relies on external AI providers. Security depends partly on:
- Provider security practices
- Data transmission security
- Provider data handling policies
### Pattern Execution
Custom patterns could potentially:
- Process sensitive inputs inappropriately
- Generate outputs containing sensitive information
- Be used for adversarial prompt injection
**Recommendation**: Review patterns carefully, especially those from untrusted sources.
## Security Updates
Security updates are distributed through:
- GitHub Releases with security tags
- Security advisories on GitHub
- Project documentation updates
Subscribe to the repository to receive notifications about security updates.
## Contact
For non-security issues, please use GitHub issues.
For security concerns, email: **<kayvan@sylvan.com>** and CC to **<daniel@danielmiessler.com>**
---
*We take security seriously and appreciate the security research community's help in keeping Fabric secure.*

148
docs/SUPPORT.md Normal file
View File

@@ -0,0 +1,148 @@
# Support
## Getting Help with Fabric
Need help with Fabric? Here are the best ways to get assistance:
## 📖 Documentation First
Before reaching out, check these resources:
- **[README.md](../README.md)** - Installation, usage, and examples
- **[docs/](./README.md)** - Detailed documentation
- **[Patterns](../data/patterns/)** - Browse available AI patterns
## 🐛 Bug Reports
Found a bug? Please create an issue:
**[Report a Bug](https://github.com/danielmiessler/fabric/issues/new?template=bug.yml)**
Include:
- Fabric version (`fabric --version`)
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error messages/logs
## 💡 Feature Requests
Have an idea for Fabric? We'd love to hear it:
**[Request a Feature](https://github.com/danielmiessler/fabric/issues/new)**
Describe:
- What you want to achieve
- Why it would be useful
- How you envision it working
- Any alternatives you've considered
## 🤔 Questions & Discussions
For general questions, usage help, or community discussion:
**[GitHub Discussions](https://github.com/danielmiessler/fabric/discussions)**
Great for:
- "How do I...?" questions
- Sharing patterns you've created
- Getting community advice
- Feature brainstorming
## 🏷️ Issue Labels
When creating issues, maintainers will add appropriate labels:
- `bug` - Something isn't working
- `enhancement` - New feature request
- `documentation` - Documentation improvements
- `help wanted` - Community contributions welcome
- `good first issue` - Great for new contributors
- `question` - General questions
- `pattern` - Related to AI patterns
## 📋 Issue Templates
We provide templates to help you create detailed reports:
- **Bug Report** - Structured bug reporting
- **Feature Request** - Detailed feature proposals
- **Pattern Submission** - New pattern contributions
## 🔒 Security Issues
**DO NOT create public issues for security vulnerabilities.**
See our [Security Policy](./SECURITY.md) for proper reporting procedures.
## ⚡ Response Times
We're a community-driven project with volunteer maintainers:
- **Bugs**: We aim to acknowledge within 48 hours
- **Features**: Response time varies based on complexity
- **Questions**: Community often responds quickly
- **Security**: See security policy for timelines
## 🛠️ Self-Help Tips
Before creating an issue, try:
1. **Update Fabric**: `go install github.com/danielmiessler/fabric/cmd/fabric@latest`
2. **Check existing issues**: Someone might have the same problem
3. **Run setup**: `fabric --setup` can fix configuration issues
4. **Test minimal example**: Isolate the problem
## 🤝 Community Guidelines
When asking for help:
- Be specific and provide context
- Include relevant details and error messages
- Be patient - maintainers are volunteers
- Help others when you can
- Say thanks when someone helps you
## 📞 Emergency Contact
For urgent security issues only:
- Email: <security@fabric.ai> (if available)
- Maintainer: <daniel@danielmiessler.com>
## 🎯 What We Can Help With
**We can help with:**
- Installation and setup issues
- Usage questions and examples
- Bug reports and fixes
- Feature discussions
- Pattern creation guidance
- Integration questions
**We cannot help with:**
- Custom development for your specific use case
- Troubleshooting your specific AI provider issues
- General AI or programming tutorials
- Commercial support agreements
## 💪 Contributing Back
The best way to get help is to help others:
- Answer questions in discussions
- Improve documentation
- Share useful patterns
- Report bugs clearly
- Review pull requests
See our [Contributing Guide](./CONTRIBUTING.md) for details.
---
*Remember: We're all here to make Fabric better. Be kind, be helpful, and let's build something amazing together!*

View File

@@ -4,10 +4,24 @@ Fabric comes with shell completion support for Zsh, Bash, and Fish shells. These
## Quick Setup (Automated)
For a quick automated installation, use the setup script:
You can install completions without cloning the repo:
```bash
# Run the automated setup script
# No-clone install (Zsh/Bash/Fish supported)
curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh | sh
# Optional: dry-run first
curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh | sh -s -- --dry-run
# Optional: override the download source
FABRIC_COMPLETIONS_BASE_URL="https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions" \
sh -c "$(curl -fsSL https://raw.githubusercontent.com/danielmiessler/Fabric/refs/heads/main/completions/setup-completions.sh)"
```
Or, if you have the repository locally:
```bash
# Run the automated setup script from a cloned repo
./completions/setup-completions.sh
# Or see what it would do first
@@ -22,6 +36,8 @@ The script will:
- Install the completion file with the correct name
- Provide instructions for enabling the completions
If the completion files aren't present locally (e.g., when running via `curl`), the script will automatically download them from GitHub.
For manual installation or troubleshooting, see the detailed instructions below.
## Manual Installation

View File

@@ -0,0 +1,139 @@
# Using Speech-To-Text (STT) with Fabric
Fabric supports speech-to-text transcription of audio and video files using OpenAI's transcription models. This feature allows you to convert spoken content into text that can then be processed through Fabric's patterns.
## Overview
The STT feature integrates OpenAI's Whisper and GPT-4o transcription models to convert audio/video files into text. The transcribed text is automatically passed as input to your chosen pattern or chat session.
## Requirements
- OpenAI API key configured in Fabric
- For files larger than 25MB: `ffmpeg` installed on your system
- Supported audio/video formats: `.mp3`, `.mp4`, `.mpeg`, `.mpga`, `.m4a`, `.wav`, `.webm`
## Basic Usage
### Simple Transcription
To transcribe an audio file and send the result to a pattern:
```bash
fabric --transcribe-file /path/to/audio.mp3 --transcribe-model whisper-1 --pattern summarize
```
### Transcription Only
To just transcribe a file without applying a pattern:
```bash
fabric --transcribe-file /path/to/audio.mp3 --transcribe-model whisper-1
```
## Command Line Flags
### Required Flags
- `--transcribe-file`: Path to the audio or video file to transcribe
- `--transcribe-model`: Model to use for transcription (required when using transcription)
### Optional Flags
- `--split-media-file`: Automatically split files larger than 25MB into chunks using ffmpeg
## Available Models
You can list all available transcription models with:
```bash
fabric --list-transcription-models
```
Currently supported models:
- `whisper-1`: OpenAI's Whisper model
- `gpt-4o-mini-transcribe`: GPT-4o Mini transcription model
- `gpt-4o-transcribe`: GPT-4o transcription model
## File Size Handling
### Files Under 25MB
Files under the 25MB limit are processed directly without any special handling.
### Files Over 25MB
For files exceeding OpenAI's 25MB limit, you have two options:
1. **Manual handling**: The command will fail with an error message suggesting to use `--split-media-file`
2. **Automatic splitting**: Use the `--split-media-file` flag to automatically split the file into chunks
```bash
fabric --transcribe-file large_recording.mp4 --transcribe-model whisper-1 --split-media-file --pattern summarize
```
When splitting is enabled:
- Fabric uses `ffmpeg` to split the file into 10-minute segments initially
- If segments are still too large, it reduces the segment time by half repeatedly
- All segments are transcribed and the results are concatenated
- Temporary files are automatically cleaned up after processing
## Integration with Patterns
The transcribed text is seamlessly integrated into Fabric's workflow:
1. File is transcribed using the specified model
2. Transcribed text becomes the input message
3. Text is sent to the specified pattern or chat session
### Example Workflows
**Meeting transcription and summarization:**
```bash
fabric --transcribe-file meeting.mp4 --transcribe-model gpt-4o-transcribe --pattern summarize
```
**Interview analysis:**
```bash
fabric --transcribe-file interview.mp3 --transcribe-model whisper-1 --pattern extract_insights
```
**Large video file processing:**
```bash
fabric --transcribe-file presentation.mp4 --transcribe-model gpt-4o-transcribe --split-media-file --pattern create_summary
```
## Error Handling
Common error scenarios:
- **Unsupported format**: Only the listed audio/video formats are supported
- **File too large**: Use `--split-media-file` for files over 25MB
- **Missing ffmpeg**: Install ffmpeg for automatic file splitting
- **Invalid model**: Use `--list-transcription-models` to see available models
- **Missing model**: The `--transcribe-model` flag is required when using `--transcribe-file`
## Technical Details
### Implementation
- Transcription is handled in `internal/cli/transcribe.go:14`
- OpenAI-specific implementation in `internal/plugins/ai/openai/openai_audio.go:41`
- File splitting uses ffmpeg with configurable segment duration
- Supports any vendor that implements the `transcriber` interface
### Processing Pipeline
1. CLI validates file format and size
2. If file > 25MB and splitting enabled, file is split using ffmpeg
3. Each file/segment is sent to OpenAI's transcription API
4. Results are concatenated with spaces between segments
5. Transcribed text is passed as input to the main Fabric pipeline
### Vendor Support
Currently, only OpenAI is supported for transcription, but the interface allows for future expansion to other vendors that provide transcription capabilities.

6
go.mod
View File

@@ -5,7 +5,7 @@ go 1.24.0
toolchain go1.24.2
require (
github.com/anthropics/anthropic-sdk-go v1.7.0
github.com/anthropics/anthropic-sdk-go v1.9.1
github.com/atotto/clipboard v0.1.4
github.com/aws/aws-sdk-go-v2 v1.36.4
github.com/aws/aws-sdk-go-v2/config v1.27.27
@@ -21,7 +21,7 @@ require (
github.com/joho/godotenv v1.5.1
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/mattn/go-sqlite3 v1.14.28
github.com/ollama/ollama v0.9.0
github.com/ollama/ollama v0.11.7
github.com/openai/openai-go v1.8.2
github.com/otiai10/copy v1.14.1
github.com/pkg/errors v0.9.1
@@ -117,7 +117,7 @@ require (
go.opentelemetry.io/otel/metric v1.36.0 // indirect
go.opentelemetry.io/otel/trace v1.36.0 // indirect
golang.org/x/arch v0.18.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/crypto v0.40.0 // indirect
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sync v0.16.0 // indirect

16
go.sum
View File

@@ -17,8 +17,8 @@ github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kk
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
github.com/anthropics/anthropic-sdk-go v1.7.0 h1:5iVf5fG/2gqVsOce8mq02r/WdgqpokM/8DXg2Ue6C9Y=
github.com/anthropics/anthropic-sdk-go v1.7.0/go.mod h1:3qSNQ5NrAmjC8A2ykuruSQttfqfdEYNZY5o8c0XSHB8=
github.com/anthropics/anthropic-sdk-go v1.9.1 h1:raRhZKmayVSVZtLpLDd6IsMXvxLeeSU03/2IBTerWlg=
github.com/anthropics/anthropic-sdk-go v1.9.1/go.mod h1:WTz31rIUHUHqai2UslPpw5CwXrQP3geYBioRV4WOLvE=
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA=
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
@@ -180,8 +180,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/ollama/ollama v0.9.0 h1:GvdGhi8G/QMnFrY0TMLDy1bXua+Ify8KTkFe4ZY/OZs=
github.com/ollama/ollama v0.9.0/go.mod h1:aio9yQ7nc4uwIbn6S0LkGEPgn8/9bNQLL1nHuH+OcD0=
github.com/ollama/ollama v0.11.7 h1:CuYjaJ/YEnvLDpJocJbbVdpdVFyGA/OP6lKFyzZD4dI=
github.com/ollama/ollama v0.11.7/go.mod h1:9+1//yWPsDE2u+l1a5mpaKrYw4VdnSsRU3ioq5BvMms=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
github.com/openai/openai-go v1.8.2 h1:UqSkJ1vCOPUpz9Ka5tS0324EJFEuOvMc+lA/EarJWP8=
@@ -268,8 +268,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b h1:QoALfVG9rhQ/M7vYDScfPdWjGL9dlsVVM5VGh7aKoAA=
golang.org/x/exp v0.0.0-20250531010427-b6e5de432a8b/go.mod h1:U6Lno4MTRCDY+Ba7aCcauB9T60gsv5s4ralQzP72ZoQ=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -327,8 +327,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg=
golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=

View File

@@ -9,6 +9,7 @@ import (
"github.com/danielmiessler/fabric/internal/core"
"github.com/danielmiessler/fabric/internal/domain"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins/db/fsdb"
"github.com/danielmiessler/fabric/internal/tools/notifications"
)
@@ -18,6 +19,19 @@ func handleChatProcessing(currentFlags *Flags, registry *core.PluginRegistry, me
if messageTools != "" {
currentFlags.AppendMessage(messageTools)
}
// Check for pattern-specific model via environment variable
if currentFlags.Pattern != "" && currentFlags.Model == "" {
envVar := "FABRIC_MODEL_" + strings.ToUpper(strings.ReplaceAll(currentFlags.Pattern, "-", "_"))
if modelSpec := os.Getenv(envVar); modelSpec != "" {
parts := strings.SplitN(modelSpec, "|", 2)
if len(parts) == 2 {
currentFlags.Vendor = parts[0]
currentFlags.Model = parts[1]
} else {
currentFlags.Model = modelSpec
}
}
}
var chatter *core.Chatter
if chatter, err = registry.GetChatter(currentFlags.Model, currentFlags.ModelContextLength,
@@ -122,7 +136,7 @@ func handleChatProcessing(currentFlags *Flags, registry *core.PluginRegistry, me
if chatOptions.Notification {
if err = sendNotification(chatOptions, chatReq.PatternName, result); err != nil {
// Log notification error but don't fail the main command
fmt.Fprintf(os.Stderr, "Failed to send notification: %v\n", err)
debuglog.Log("Failed to send notification: %v\n", err)
}
}

View File

@@ -3,10 +3,10 @@ package cli
import (
"encoding/json"
"fmt"
"os"
"strings"
"github.com/danielmiessler/fabric/internal/core"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins/ai/openai"
"github.com/danielmiessler/fabric/internal/tools/converter"
"github.com/danielmiessler/fabric/internal/tools/youtube"
@@ -34,7 +34,7 @@ func Cli(version string) (err error) {
var registry, err2 = initializeFabric()
if err2 != nil {
if !currentFlags.Setup {
fmt.Fprintln(os.Stderr, err2.Error())
debuglog.Log("%s\n", err2.Error())
currentFlags.Setup = true
}
// Return early if registry is nil to prevent panics in subsequent handlers
@@ -74,6 +74,15 @@ func Cli(version string) (err error) {
return
}
// Handle transcription if specified
if currentFlags.TranscribeFile != "" {
var transcriptionMessage string
if transcriptionMessage, err = handleTranscription(currentFlags, registry); err != nil {
return
}
currentFlags.Message = AppendMessage(currentFlags.Message, transcriptionMessage)
}
// Process HTML readability if needed
if currentFlags.HtmlReadability {
if msg, cleanErr := converter.HtmlReadability(currentFlags.Message); cleanErr != nil {

View File

@@ -13,6 +13,7 @@ import (
"github.com/danielmiessler/fabric/internal/chat"
"github.com/danielmiessler/fabric/internal/domain"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/util"
"github.com/jessevdk/go-flags"
"golang.org/x/text/language"
@@ -23,90 +24,90 @@ import (
// Chat parameter defaults set in the struct tags must match domain.Default* constants
type Flags struct {
Pattern string `short:"p" long:"pattern" yaml:"pattern" description:"Choose a pattern from the available patterns" default:""`
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=#role:expert -v=#points:30"`
Context string `short:"C" long:"context" description:"Choose a context from the available contexts" default:""`
Session string `long:"session" description:"Choose a session from the available sessions"`
Attachments []string `short:"a" long:"attachment" description:"Attachment path or URL (e.g. for OpenAI image recognition messages)"`
Setup bool `short:"S" long:"setup" description:"Run setup for all reconfigurable parts of fabric"`
Temperature float64 `short:"t" long:"temperature" yaml:"temperature" description:"Set temperature" default:"0.7"`
TopP float64 `short:"T" long:"topp" yaml:"topp" description:"Set top P" default:"0.9"`
Stream bool `short:"s" long:"stream" yaml:"stream" description:"Stream"`
PresencePenalty float64 `short:"P" long:"presencepenalty" yaml:"presencepenalty" description:"Set presence penalty" default:"0.0"`
Raw bool `short:"r" long:"raw" yaml:"raw" description:"Use the defaults of the model without sending chat options (like temperature etc.) and use the user role instead of the system role for patterns."`
FrequencyPenalty float64 `short:"F" long:"frequencypenalty" yaml:"frequencypenalty" description:"Set frequency penalty" default:"0.0"`
ListPatterns bool `short:"l" long:"listpatterns" description:"List all patterns"`
ListAllModels bool `short:"L" long:"listmodels" description:"List all available models"`
ListAllContexts bool `short:"x" long:"listcontexts" description:"List all contexts"`
ListAllSessions bool `short:"X" long:"listsessions" description:"List all sessions"`
UpdatePatterns bool `short:"U" long:"updatepatterns" description:"Update patterns"`
Message string `hidden:"true" description:"Messages to send to chat"`
Copy bool `short:"c" long:"copy" description:"Copy to clipboard"`
Model string `short:"m" long:"model" yaml:"model" description:"Choose model"`
Vendor string `short:"V" long:"vendor" yaml:"vendor" description:"Specify vendor for the selected model (e.g., -V \"LM Studio\" -m openai/gpt-oss-20b)"`
ModelContextLength int `long:"modelContextLength" yaml:"modelContextLength" description:"Model context length (only affects ollama)"`
Output string `short:"o" long:"output" description:"Output to file" default:""`
OutputSession bool `long:"output-session" description:"Output the entire session (also a temporary one) to the output file"`
LatestPatterns string `short:"n" long:"latest" description:"Number of latest patterns to list" default:"0"`
ChangeDefaultModel bool `short:"d" long:"changeDefaultModel" description:"Change default model"`
YouTube string `short:"y" long:"youtube" description:"YouTube video or play list \"URL\" to grab transcript, comments from it and send to chat or print it put to the console and store it in the output file"`
YouTubePlaylist bool `long:"playlist" description:"Prefer playlist over video if both ids are present in the URL"`
YouTubeTranscript bool `long:"transcript" description:"Grab transcript from YouTube video and send to chat (it is used per default)."`
YouTubeTranscriptWithTimestamps bool `long:"transcript-with-timestamps" description:"Grab transcript from YouTube video with timestamps and send to chat"`
YouTubeComments bool `long:"comments" description:"Grab comments from YouTube video and send to chat"`
YouTubeMetadata bool `long:"metadata" description:"Output video metadata"`
YtDlpArgs string `long:"yt-dlp-args" yaml:"ytDlpArgs" description:"Additional arguments to pass to yt-dlp (e.g. '--cookies-from-browser brave')"`
Language string `short:"g" long:"language" description:"Specify the Language Code for the chat, e.g. -g=en -g=zh" default:""`
ScrapeURL string `short:"u" long:"scrape_url" description:"Scrape website URL to markdown using Jina AI"`
ScrapeQuestion string `short:"q" long:"scrape_question" description:"Search question using Jina AI"`
Seed int `short:"e" long:"seed" yaml:"seed" description:"Seed to be used for LMM generation"`
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
PrintContext string `long:"printcontext" description:"Print context"`
PrintSession string `long:"printsession" description:"Print session"`
HtmlReadability bool `long:"readability" description:"Convert HTML input into a clean, readable view"`
InputHasVars bool `long:"input-has-vars" description:"Apply variables to user input"`
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
Serve bool `long:"serve" description:"Serve the Fabric Rest API"`
ServeOllama bool `long:"serveOllama" description:"Serve the Fabric Rest API with ollama endpoints"`
ServeAddress string `long:"address" description:"The address to bind the REST API" default:":8080"`
ServeAPIKey string `long:"api-key" description:"API key used to secure server routes" default:""`
Config string `long:"config" description:"Path to YAML config file"`
Version bool `long:"version" description:"Print current version"`
ListExtensions bool `long:"listextensions" description:"List all registered extensions"`
AddExtension string `long:"addextension" description:"Register a new extension from config file path"`
RemoveExtension string `long:"rmextension" description:"Remove a registered extension by name"`
Strategy string `long:"strategy" description:"Choose a strategy from the available strategies" default:""`
ListStrategies bool `long:"liststrategies" description:"List all strategies"`
ListVendors bool `long:"listvendors" description:"List all vendors"`
ShellCompleteOutput bool `long:"shell-complete-list" description:"Output raw list without headers/formatting (for shell completion)"`
Search bool `long:"search" description:"Enable web search tool for supported models (Anthropic, OpenAI, Gemini)"`
SearchLocation string `long:"search-location" description:"Set location for web search results (e.g., 'America/Los_Angeles')"`
ImageFile string `long:"image-file" description:"Save generated image to specified file path (e.g., 'output.png')"`
ImageSize string `long:"image-size" description:"Image dimensions: 1024x1024, 1536x1024, 1024x1536, auto (default: auto)"`
ImageQuality string `long:"image-quality" description:"Image quality: low, medium, high, auto (default: auto)"`
ImageCompression int `long:"image-compression" description:"Compression level 0-100 for JPEG/WebP formats (default: not set)"`
ImageBackground string `long:"image-background" description:"Background type: opaque, transparent (default: opaque, only for PNG/WebP)"`
SuppressThink bool `long:"suppress-think" yaml:"suppressThink" description:"Suppress text enclosed in thinking tags"`
ThinkStartTag string `long:"think-start-tag" yaml:"thinkStartTag" description:"Start tag for thinking sections" default:"<think>"`
ThinkEndTag string `long:"think-end-tag" yaml:"thinkEndTag" description:"End tag for thinking sections" default:"</think>"`
DisableResponsesAPI bool `long:"disable-responses-api" yaml:"disableResponsesAPI" description:"Disable OpenAI Responses API (default: false)"`
Voice string `long:"voice" yaml:"voice" description:"TTS voice name for supported models (e.g., Kore, Charon, Puck)" default:"Kore"`
ListGeminiVoices bool `long:"list-gemini-voices" description:"List all available Gemini TTS voices"`
Notification bool `long:"notification" yaml:"notification" description:"Send desktop notification when command completes"`
NotificationCommand string `long:"notification-command" yaml:"notificationCommand" description:"Custom command to run for notifications (overrides built-in notifications)"`
}
var debug = false
func Debugf(format string, a ...interface{}) {
if debug {
fmt.Printf("DEBUG: "+format, a...)
}
Pattern string `short:"p" long:"pattern" yaml:"pattern" description:"Choose a pattern from the available patterns" default:""`
PatternVariables map[string]string `short:"v" long:"variable" description:"Values for pattern variables, e.g. -v=#role:expert -v=#points:30"`
Context string `short:"C" long:"context" description:"Choose a context from the available contexts" default:""`
Session string `long:"session" description:"Choose a session from the available sessions"`
Attachments []string `short:"a" long:"attachment" description:"Attachment path or URL (e.g. for OpenAI image recognition messages)"`
Setup bool `short:"S" long:"setup" description:"Run setup for all reconfigurable parts of fabric"`
Temperature float64 `short:"t" long:"temperature" yaml:"temperature" description:"Set temperature" default:"0.7"`
TopP float64 `short:"T" long:"topp" yaml:"topp" description:"Set top P" default:"0.9"`
Stream bool `short:"s" long:"stream" yaml:"stream" description:"Stream"`
PresencePenalty float64 `short:"P" long:"presencepenalty" yaml:"presencepenalty" description:"Set presence penalty" default:"0.0"`
Raw bool `short:"r" long:"raw" yaml:"raw" description:"Use the defaults of the model without sending chat options (like temperature etc.) and use the user role instead of the system role for patterns."`
FrequencyPenalty float64 `short:"F" long:"frequencypenalty" yaml:"frequencypenalty" description:"Set frequency penalty" default:"0.0"`
ListPatterns bool `short:"l" long:"listpatterns" description:"List all patterns"`
ListAllModels bool `short:"L" long:"listmodels" description:"List all available models"`
ListAllContexts bool `short:"x" long:"listcontexts" description:"List all contexts"`
ListAllSessions bool `short:"X" long:"listsessions" description:"List all sessions"`
UpdatePatterns bool `short:"U" long:"updatepatterns" description:"Update patterns"`
Message string `hidden:"true" description:"Messages to send to chat"`
Copy bool `short:"c" long:"copy" description:"Copy to clipboard"`
Model string `short:"m" long:"model" yaml:"model" description:"Choose model"`
Vendor string `short:"V" long:"vendor" yaml:"vendor" description:"Specify vendor for the selected model (e.g., -V \"LM Studio\" -m openai/gpt-oss-20b)"`
ModelContextLength int `long:"modelContextLength" yaml:"modelContextLength" description:"Model context length (only affects ollama)"`
Output string `short:"o" long:"output" description:"Output to file" default:""`
OutputSession bool `long:"output-session" description:"Output the entire session (also a temporary one) to the output file"`
LatestPatterns string `short:"n" long:"latest" description:"Number of latest patterns to list" default:"0"`
ChangeDefaultModel bool `short:"d" long:"changeDefaultModel" description:"Change default model"`
YouTube string `short:"y" long:"youtube" description:"YouTube video or play list \"URL\" to grab transcript, comments from it and send to chat or print it put to the console and store it in the output file"`
YouTubePlaylist bool `long:"playlist" description:"Prefer playlist over video if both ids are present in the URL"`
YouTubeTranscript bool `long:"transcript" description:"Grab transcript from YouTube video and send to chat (it is used per default)."`
YouTubeTranscriptWithTimestamps bool `long:"transcript-with-timestamps" description:"Grab transcript from YouTube video with timestamps and send to chat"`
YouTubeComments bool `long:"comments" description:"Grab comments from YouTube video and send to chat"`
YouTubeMetadata bool `long:"metadata" description:"Output video metadata"`
YtDlpArgs string `long:"yt-dlp-args" yaml:"ytDlpArgs" description:"Additional arguments to pass to yt-dlp (e.g. '--cookies-from-browser brave')"`
Language string `short:"g" long:"language" description:"Specify the Language Code for the chat, e.g. -g=en -g=zh" default:""`
ScrapeURL string `short:"u" long:"scrape_url" description:"Scrape website URL to markdown using Jina AI"`
ScrapeQuestion string `short:"q" long:"scrape_question" description:"Search question using Jina AI"`
Seed int `short:"e" long:"seed" yaml:"seed" description:"Seed to be used for LMM generation"`
WipeContext string `short:"w" long:"wipecontext" description:"Wipe context"`
WipeSession string `short:"W" long:"wipesession" description:"Wipe session"`
PrintContext string `long:"printcontext" description:"Print context"`
PrintSession string `long:"printsession" description:"Print session"`
HtmlReadability bool `long:"readability" description:"Convert HTML input into a clean, readable view"`
InputHasVars bool `long:"input-has-vars" description:"Apply variables to user input"`
NoVariableReplacement bool `long:"no-variable-replacement" description:"Disable pattern variable replacement"`
DryRun bool `long:"dry-run" description:"Show what would be sent to the model without actually sending it"`
Serve bool `long:"serve" description:"Serve the Fabric Rest API"`
ServeOllama bool `long:"serveOllama" description:"Serve the Fabric Rest API with ollama endpoints"`
ServeAddress string `long:"address" description:"The address to bind the REST API" default:":8080"`
ServeAPIKey string `long:"api-key" description:"API key used to secure server routes" default:""`
Config string `long:"config" description:"Path to YAML config file"`
Version bool `long:"version" description:"Print current version"`
ListExtensions bool `long:"listextensions" description:"List all registered extensions"`
AddExtension string `long:"addextension" description:"Register a new extension from config file path"`
RemoveExtension string `long:"rmextension" description:"Remove a registered extension by name"`
Strategy string `long:"strategy" description:"Choose a strategy from the available strategies" default:""`
ListStrategies bool `long:"liststrategies" description:"List all strategies"`
ListVendors bool `long:"listvendors" description:"List all vendors"`
ShellCompleteOutput bool `long:"shell-complete-list" description:"Output raw list without headers/formatting (for shell completion)"`
Search bool `long:"search" description:"Enable web search tool for supported models (Anthropic, OpenAI, Gemini)"`
SearchLocation string `long:"search-location" description:"Set location for web search results (e.g., 'America/Los_Angeles')"`
ImageFile string `long:"image-file" description:"Save generated image to specified file path (e.g., 'output.png')"`
ImageSize string `long:"image-size" description:"Image dimensions: 1024x1024, 1536x1024, 1024x1536, auto (default: auto)"`
ImageQuality string `long:"image-quality" description:"Image quality: low, medium, high, auto (default: auto)"`
ImageCompression int `long:"image-compression" description:"Compression level 0-100 for JPEG/WebP formats (default: not set)"`
ImageBackground string `long:"image-background" description:"Background type: opaque, transparent (default: opaque, only for PNG/WebP)"`
SuppressThink bool `long:"suppress-think" yaml:"suppressThink" description:"Suppress text enclosed in thinking tags"`
ThinkStartTag string `long:"think-start-tag" yaml:"thinkStartTag" description:"Start tag for thinking sections" default:"<think>"`
ThinkEndTag string `long:"think-end-tag" yaml:"thinkEndTag" description:"End tag for thinking sections" default:"</think>"`
DisableResponsesAPI bool `long:"disable-responses-api" yaml:"disableResponsesAPI" description:"Disable OpenAI Responses API (default: false)"`
TranscribeFile string `long:"transcribe-file" yaml:"transcribeFile" description:"Audio or video file to transcribe"`
TranscribeModel string `long:"transcribe-model" yaml:"transcribeModel" description:"Model to use for transcription (separate from chat model)"`
SplitMediaFile bool `long:"split-media-file" yaml:"splitMediaFile" description:"Split audio/video files larger than 25MB using ffmpeg"`
Voice string `long:"voice" yaml:"voice" description:"TTS voice name for supported models (e.g., Kore, Charon, Puck)" default:"Kore"`
ListGeminiVoices bool `long:"list-gemini-voices" description:"List all available Gemini TTS voices"`
ListTranscriptionModels bool `long:"list-transcription-models" description:"List all available transcription models"`
Notification bool `long:"notification" yaml:"notification" description:"Send desktop notification when command completes"`
NotificationCommand string `long:"notification-command" yaml:"notificationCommand" description:"Custom command to run for notifications (overrides built-in notifications)"`
Thinking domain.ThinkingLevel `long:"thinking" yaml:"thinking" description:"Set reasoning/thinking level (e.g., off, low, medium, high, or numeric tokens for Anthropic or Google Gemini)"`
Debug int `long:"debug" description:"Set debug level (0=off, 1=basic, 2=detailed, 3=trace)" default:"0"`
}
// Init Initialize flags. returns a Flags struct and an error
func Init() (ret *Flags, err error) {
debuglog.SetLevel(debuglog.LevelFromInt(parseDebugLevel(os.Args[1:])))
// Track which yaml-configured flags were set on CLI
usedFlags := make(map[string]bool)
yamlArgsScan := os.Args[1:]
@@ -122,11 +123,11 @@ func Init() (ret *Flags, err error) {
shortTag := field.Tag.Get("short")
if longTag != "" {
flagToYamlTag[longTag] = yamlTag
Debugf("Mapped long flag %s to yaml tag %s\n", longTag, yamlTag)
debuglog.Debug(debuglog.Detailed, "Mapped long flag %s to yaml tag %s\n", longTag, yamlTag)
}
if shortTag != "" {
flagToYamlTag[shortTag] = yamlTag
Debugf("Mapped short flag %s to yaml tag %s\n", shortTag, yamlTag)
debuglog.Debug(debuglog.Detailed, "Mapped short flag %s to yaml tag %s\n", shortTag, yamlTag)
}
}
}
@@ -138,7 +139,7 @@ func Init() (ret *Flags, err error) {
if flag != "" {
if yamlTag, exists := flagToYamlTag[flag]; exists {
usedFlags[yamlTag] = true
Debugf("CLI flag used: %s (yaml: %s)\n", flag, yamlTag)
debuglog.Debug(debuglog.Detailed, "CLI flag used: %s (yaml: %s)\n", flag, yamlTag)
}
}
}
@@ -150,6 +151,7 @@ func Init() (ret *Flags, err error) {
if args, err = parser.Parse(); err != nil {
return
}
debuglog.SetLevel(debuglog.LevelFromInt(ret.Debug))
// Check to see if a ~/.config/fabric/config.yaml config file exists (only when user didn't specify a config)
if ret.Config == "" {
@@ -157,7 +159,7 @@ func Init() (ret *Flags, err error) {
if defaultConfigPath, err := util.GetDefaultConfigPath(); err == nil && defaultConfigPath != "" {
ret.Config = defaultConfigPath
} else if err != nil {
Debugf("Could not determine default config path: %v\n", err)
debuglog.Debug(debuglog.Detailed, "Could not determine default config path: %v\n", err)
}
}
@@ -182,13 +184,13 @@ func Init() (ret *Flags, err error) {
if flagField.CanSet() {
if yamlField.Type() != flagField.Type() {
if err := assignWithConversion(flagField, yamlField); err != nil {
Debugf("Type conversion failed for %s: %v\n", yamlTag, err)
debuglog.Debug(debuglog.Detailed, "Type conversion failed for %s: %v\n", yamlTag, err)
continue
}
} else {
flagField.Set(yamlField)
}
Debugf("Applied YAML value for %s: %v\n", yamlTag, yamlField.Interface())
debuglog.Debug(debuglog.Detailed, "Applied YAML value for %s: %v\n", yamlTag, yamlField.Interface())
}
}
}
@@ -214,6 +216,22 @@ func Init() (ret *Flags, err error) {
return
}
func parseDebugLevel(args []string) int {
for i := 0; i < len(args); i++ {
arg := args[i]
if arg == "--debug" && i+1 < len(args) {
if lvl, err := strconv.Atoi(args[i+1]); err == nil {
return lvl
}
} else if strings.HasPrefix(arg, "--debug=") {
if lvl, err := strconv.Atoi(strings.TrimPrefix(arg, "--debug=")); err == nil {
return lvl
}
}
}
return 0
}
func extractFlag(arg string) string {
var flag string
if strings.HasPrefix(arg, "--") {
@@ -283,7 +301,7 @@ func loadYAMLConfig(configPath string) (*Flags, error) {
return nil, fmt.Errorf("error parsing config file: %w", err)
}
Debugf("Config: %v\n", config)
debuglog.Debug(debuglog.Detailed, "Config: %v\n", config)
return config, nil
}
@@ -438,6 +456,7 @@ func (o *Flags) BuildChatOptions() (ret *domain.ChatOptions, err error) {
FrequencyPenalty: o.FrequencyPenalty,
Raw: o.Raw,
Seed: o.Seed,
Thinking: o.Thinking,
ModelContextLength: o.ModelContextLength,
Search: o.Search,
SearchLocation: o.SearchLocation,
@@ -458,13 +477,14 @@ func (o *Flags) BuildChatOptions() (ret *domain.ChatOptions, err error) {
func (o *Flags) BuildChatRequest(Meta string) (ret *domain.ChatRequest, err error) {
ret = &domain.ChatRequest{
ContextName: o.Context,
SessionName: o.Session,
PatternName: o.Pattern,
StrategyName: o.Strategy,
PatternVariables: o.PatternVariables,
InputHasVars: o.InputHasVars,
Meta: Meta,
ContextName: o.Context,
SessionName: o.Session,
PatternName: o.Pattern,
StrategyName: o.Strategy,
PatternVariables: o.PatternVariables,
InputHasVars: o.InputHasVars,
NoVariableReplacement: o.NoVariableReplacement,
Meta: Meta,
}
var message *chat.ChatCompletionMessage

View File

@@ -64,6 +64,7 @@ func TestBuildChatOptions(t *testing.T) {
FrequencyPenalty: 0.2,
Raw: false,
Seed: 1,
Thinking: domain.ThinkingLevel(""),
SuppressThink: false,
ThinkStartTag: "<think>",
ThinkEndTag: "</think>",
@@ -88,6 +89,7 @@ func TestBuildChatOptionsDefaultSeed(t *testing.T) {
FrequencyPenalty: 0.2,
Raw: false,
Seed: 0,
Thinking: domain.ThinkingLevel(""),
SuppressThink: false,
ThinkStartTag: "<think>",
ThinkEndTag: "</think>",

View File

@@ -5,6 +5,8 @@ import (
"os"
"strconv"
openai "github.com/openai/openai-go"
"github.com/danielmiessler/fabric/internal/core"
"github.com/danielmiessler/fabric/internal/plugins/ai"
"github.com/danielmiessler/fabric/internal/plugins/ai/gemini"
@@ -39,7 +41,7 @@ func handleListingCommands(currentFlags *Flags, fabricDb *fsdb.Db, registry *cor
if currentFlags.ShellCompleteOutput {
models.Print(true)
} else {
models.PrintWithVendor(false)
models.PrintWithVendor(false, registry.Defaults.Vendor.Value, registry.Defaults.Model.Value)
}
return true, nil
}
@@ -70,5 +72,30 @@ func handleListingCommands(currentFlags *Flags, fabricDb *fsdb.Db, registry *cor
return true, nil
}
if currentFlags.ListTranscriptionModels {
listTranscriptionModels(currentFlags.ShellCompleteOutput)
return true, nil
}
return false, nil
}
// listTranscriptionModels lists all available transcription models
func listTranscriptionModels(shellComplete bool) {
models := []string{
string(openai.AudioModelWhisper1),
string(openai.AudioModelGPT4oMiniTranscribe),
string(openai.AudioModelGPT4oTranscribe),
}
if shellComplete {
for _, model := range models {
fmt.Println(model)
}
} else {
fmt.Println("Available transcription models:")
for _, model := range models {
fmt.Printf(" %s\n", model)
}
}
}

View File

@@ -7,6 +7,7 @@ import (
"strings"
"github.com/atotto/clipboard"
debuglog "github.com/danielmiessler/fabric/internal/log"
)
func CopyToClipboard(message string) (err error) {
@@ -30,7 +31,7 @@ func CreateOutputFile(message string, fileName string) (err error) {
if _, err = file.WriteString(message); err != nil {
err = fmt.Errorf("error writing to file: %v", err)
} else {
fmt.Fprintf(os.Stderr, "\n\n[Output also written to %s]\n", fileName)
debuglog.Log("\n\n[Output also written to %s]\n", fileName)
}
return
}

View File

@@ -0,0 +1,35 @@
package cli
import (
"context"
"fmt"
"github.com/danielmiessler/fabric/internal/core"
)
type transcriber interface {
TranscribeFile(ctx context.Context, filePath, model string, split bool) (string, error)
}
func handleTranscription(flags *Flags, registry *core.PluginRegistry) (message string, err error) {
vendorName := flags.Vendor
if vendorName == "" {
vendorName = "OpenAI"
}
vendor, ok := registry.VendorManager.VendorsByName[vendorName]
if !ok {
return "", fmt.Errorf("vendor %s not configured", vendorName)
}
tr, ok := vendor.(transcriber)
if !ok {
return "", fmt.Errorf("vendor %s does not support audio transcription", vendorName)
}
model := flags.TranscribeModel
if model == "" {
return "", fmt.Errorf("transcription model is required (use --transcribe-model)")
}
if message, err = tr.TranscribeFile(context.Background(), flags.TranscribeFile, model, flags.SplitMediaFile); err != nil {
return
}
return
}

View File

@@ -180,7 +180,7 @@ func (o *Chatter) BuildSession(request *domain.ChatRequest, raw bool) (session *
}
// Now we know request.Message is not nil, process template variables
if request.InputHasVars {
if request.InputHasVars && !request.NoVariableReplacement {
request.Message.Content, err = template.ApplyTemplate(request.Message.Content, request.PatternVariables, "")
if err != nil {
return nil, err
@@ -190,7 +190,12 @@ func (o *Chatter) BuildSession(request *domain.ChatRequest, raw bool) (session *
var patternContent string
inputUsed := false
if request.PatternName != "" {
pattern, err := o.db.Patterns.GetApplyVariables(request.PatternName, request.PatternVariables, request.Message.Content)
var pattern *fsdb.Pattern
if request.NoVariableReplacement {
pattern, err = o.db.Patterns.GetWithoutVariables(request.PatternName, request.Message.Content)
} else {
pattern, err = o.db.Patterns.GetApplyVariables(request.PatternName, request.PatternVariables, request.Message.Content)
}
if err != nil {
return nil, fmt.Errorf("could not get pattern %s: %v", request.PatternName, err)

View File

@@ -10,6 +10,7 @@ import (
"strconv"
"strings"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins/ai/anthropic"
"github.com/danielmiessler/fabric/internal/plugins/ai/azure"
"github.com/danielmiessler/fabric/internal/plugins/ai/bedrock"
@@ -20,7 +21,7 @@ import (
"github.com/danielmiessler/fabric/internal/plugins/ai/ollama"
"github.com/danielmiessler/fabric/internal/plugins/ai/openai"
"github.com/danielmiessler/fabric/internal/plugins/ai/openai_compatible"
"github.com/danielmiessler/fabric/internal/plugins/ai/perplexity" // Added Perplexity plugin
"github.com/danielmiessler/fabric/internal/plugins/ai/perplexity"
"github.com/danielmiessler/fabric/internal/plugins/strategy"
"github.com/samber/lo"
@@ -339,7 +340,7 @@ func (o *PluginRegistry) GetChatter(model string, modelContextLength int, vendor
} else {
availableVendors := models.FindGroupsByItem(model)
if len(availableVendors) > 1 {
fmt.Fprintf(os.Stderr, "Warning: multiple vendors provide model %s: %s. Using %s. Specify --vendor to select a vendor.\n", model, strings.Join(availableVendors, ", "), availableVendors[0])
debuglog.Log("Warning: multiple vendors provide model %s: %s. Using %s. Specify --vendor to select a vendor.\n", model, strings.Join(availableVendors, ", "), availableVendors[0])
}
ret.vendor = vendorManager.FindByName(models.FindGroupsByItemFirst(model))
}

View File

@@ -10,6 +10,7 @@ import (
"github.com/danielmiessler/fabric/internal/chat"
"github.com/danielmiessler/fabric/internal/domain"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins"
"github.com/danielmiessler/fabric/internal/plugins/ai"
"github.com/danielmiessler/fabric/internal/plugins/db/fsdb"
@@ -72,7 +73,12 @@ func TestGetChatter_WarnsOnAmbiguousModel(t *testing.T) {
r, w, _ := os.Pipe()
oldStderr := os.Stderr
os.Stderr = w
defer func() { os.Stderr = oldStderr }()
// Redirect log output to our pipe to capture unconditional log messages
debuglog.SetOutput(w)
defer func() {
os.Stderr = oldStderr
debuglog.SetOutput(oldStderr)
}()
chatter, err := registry.GetChatter("shared-model", 0, "", "", false, false)
w.Close()
@@ -81,8 +87,10 @@ func TestGetChatter_WarnsOnAmbiguousModel(t *testing.T) {
if err != nil {
t.Fatalf("GetChatter() error = %v", err)
}
if chatter.vendor.GetName() != "VendorA" {
t.Fatalf("expected vendor VendorA, got %s", chatter.vendor.GetName())
// Verify that one of the valid vendors was selected (don't care which one due to map iteration randomness)
vendorName := chatter.vendor.GetName()
if vendorName != "VendorA" && vendorName != "VendorB" {
t.Fatalf("expected vendor VendorA or VendorB, got %s", vendorName)
}
if !strings.Contains(string(warning), "multiple vendors provide model shared-model") {
t.Fatalf("expected warning about multiple vendors, got %q", string(warning))

View File

@@ -13,15 +13,16 @@ const (
)
type ChatRequest struct {
ContextName string
SessionName string
PatternName string
PatternVariables map[string]string
Message *chat.ChatCompletionMessage
Language string
Meta string
InputHasVars bool
StrategyName string
ContextName string
SessionName string
PatternName string
PatternVariables map[string]string
Message *chat.ChatCompletionMessage
Language string
Meta string
InputHasVars bool
NoVariableReplacement bool
StrategyName string
}
type ChatOptions struct {
@@ -32,6 +33,7 @@ type ChatOptions struct {
FrequencyPenalty float64
Raw bool
Seed int
Thinking ThinkingLevel
ModelContextLength int
MaxTokens int
Search bool

View File

@@ -0,0 +1,34 @@
package domain
// ThinkingLevel represents reasoning/thinking levels supported across providers.
type ThinkingLevel string
const (
ThinkingOff ThinkingLevel = "off"
ThinkingLow ThinkingLevel = "low"
ThinkingMedium ThinkingLevel = "medium"
ThinkingHigh ThinkingLevel = "high"
)
// ThinkingBudgets defines standardized token budgets for reasoning-enabled models.
// The map assigns a maximum token count to each ThinkingLevel, representing the
// amount of context or computation that can be used for reasoning at that level.
// These values (e.g., 1024 for low, 2048 for medium, 4096 for high) are used to
// Token budget constants for each ThinkingLevel.
// These values are chosen to align with typical context window sizes for LLMs at different reasoning levels.
// Adjust these if model capabilities change.
const (
// TokenBudgetLow is suitable for basic reasoning or smaller models (e.g., 1k context window).
TokenBudgetLow int64 = 1024
// TokenBudgetMedium is suitable for intermediate reasoning or mid-sized models (e.g., 2k context window).
TokenBudgetMedium int64 = 2048
// TokenBudgetHigh is suitable for advanced reasoning or large models (e.g., 4k context window).
TokenBudgetHigh int64 = 4096
)
// ThinkingBudgets defines standardized token budgets for reasoning-enabled models.
var ThinkingBudgets = map[ThinkingLevel]int64{
ThinkingLow: TokenBudgetLow,
ThinkingMedium: TokenBudgetMedium,
ThinkingHigh: TokenBudgetHigh,
}

78
internal/log/log.go Normal file
View File

@@ -0,0 +1,78 @@
package log
import (
"fmt"
"io"
"os"
"sync"
)
// Level represents the debug verbosity.
type Level int
const (
// Off disables all debug output.
Off Level = iota
// Basic provides minimal debugging information.
Basic
// Detailed provides more verbose debugging.
Detailed
// Trace is the most verbose level.
Trace
)
var (
mu sync.RWMutex
level Level = Off
output io.Writer = os.Stderr
)
// SetLevel sets the global debug level.
func SetLevel(l Level) {
mu.Lock()
level = l
mu.Unlock()
}
// LevelFromInt converts an int to a Level.
func LevelFromInt(i int) Level {
switch {
case i <= 0:
return Off
case i == 1:
return Basic
case i == 2:
return Detailed
case i >= 3:
return Trace
default:
return Off
}
}
// Debug writes a debug message if the global level permits.
func Debug(l Level, format string, a ...interface{}) {
mu.RLock()
current := level
w := output
mu.RUnlock()
if current >= l {
fmt.Fprintf(w, "DEBUG: "+format, a...)
}
}
// Log writes a message unconditionally to stderr.
// This is for important messages that should always be shown regardless of debug level.
func Log(format string, a ...interface{}) {
mu.RLock()
w := output
mu.RUnlock()
fmt.Fprintf(w, format, a...)
}
// SetOutput allows overriding the output destination for debug logs.
func SetOutput(w io.Writer) {
mu.Lock()
output = w
mu.Unlock()
}

View File

@@ -4,12 +4,14 @@ import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
"github.com/danielmiessler/fabric/internal/chat"
"github.com/danielmiessler/fabric/internal/domain"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins"
"github.com/danielmiessler/fabric/internal/util"
)
@@ -49,6 +51,10 @@ func NewClient() (ret *Client) {
string(anthropic.ModelClaudeOpus4_1_20250805),
}
ret.modelBetas = map[string][]string{
string(anthropic.ModelClaudeSonnet4_20250514): {"context-1m-2025-08-07"},
}
return
}
@@ -93,6 +99,7 @@ type Client struct {
maxTokens int
defaultRequiredUserMessage string
models []string
modelBetas map[string][]string
client anthropic.Client
}
@@ -148,6 +155,26 @@ func (an *Client) ListModels() (ret []string, err error) {
return an.models, nil
}
func parseThinking(level domain.ThinkingLevel) (anthropic.ThinkingConfigParamUnion, bool) {
lower := strings.ToLower(string(level))
switch domain.ThinkingLevel(lower) {
case domain.ThinkingOff:
disabled := anthropic.NewThinkingConfigDisabledParam()
return anthropic.ThinkingConfigParamUnion{OfDisabled: &disabled}, true
case domain.ThinkingLow, domain.ThinkingMedium, domain.ThinkingHigh:
if budget, ok := domain.ThinkingBudgets[domain.ThinkingLevel(lower)]; ok {
return anthropic.ThinkingConfigParamOfEnabled(budget), true
}
default:
if tokens, err := strconv.ParseInt(lower, 10, 64); err == nil {
if tokens >= 1 && tokens <= 10000 {
return anthropic.ThinkingConfigParamOfEnabled(tokens), true
}
}
}
return anthropic.ThinkingConfigParamUnion{}, false
}
func (an *Client) SendStream(
msgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions, channel chan string,
) (err error) {
@@ -160,7 +187,17 @@ func (an *Client) SendStream(
ctx := context.Background()
stream := an.client.Messages.NewStreaming(ctx, an.buildMessageParams(messages, opts))
params := an.buildMessageParams(messages, opts)
betas := an.modelBetas[opts.Model]
var reqOpts []option.RequestOption
if len(betas) > 0 {
reqOpts = append(reqOpts, option.WithHeader("anthropic-beta", strings.Join(betas, ",")))
}
stream := an.client.Messages.NewStreaming(ctx, params, reqOpts...)
if stream.Err() != nil && len(betas) > 0 {
debuglog.Debug(debuglog.Basic, "Anthropic beta feature %s failed: %v\n", strings.Join(betas, ","), stream.Err())
stream = an.client.Messages.NewStreaming(ctx, params)
}
for stream.Next() {
event := stream.Current()
@@ -226,6 +263,11 @@ func (an *Client) buildMessageParams(msgs []anthropic.MessageParam, opts *domain
{OfWebSearchTool20250305: &webTool},
}
}
if t, ok := parseThinking(opts.Thinking); ok {
params.Thinking = t
}
return
}
@@ -239,8 +281,21 @@ func (an *Client) Send(ctx context.Context, msgs []*chat.ChatCompletionMessage,
}
var message *anthropic.Message
if message, err = an.client.Messages.New(ctx, an.buildMessageParams(messages, opts)); err != nil {
return
params := an.buildMessageParams(messages, opts)
betas := an.modelBetas[opts.Model]
var reqOpts []option.RequestOption
if len(betas) > 0 {
reqOpts = append(reqOpts, option.WithHeader("anthropic-beta", strings.Join(betas, ",")))
}
if message, err = an.client.Messages.New(ctx, params, reqOpts...); err != nil {
if len(betas) > 0 {
debuglog.Debug(debuglog.Basic, "Anthropic beta feature %s failed: %v\n", strings.Join(betas, ","), err)
if message, err = an.client.Messages.New(ctx, params); err != nil {
return
}
} else {
return
}
}
var textParts []string

View File

@@ -168,6 +168,15 @@ func TestBuildMessageParams_WithSearchAndLocation(t *testing.T) {
}
}
func TestModelBetasConfiguration(t *testing.T) {
client := NewClient()
model := string(anthropic.ModelClaudeSonnet4_20250514)
betas, ok := client.modelBetas[model]
if !ok || len(betas) != 1 || betas[0] != "context-1m-2025-08-07" {
t.Errorf("expected beta mapping for %s", model)
}
}
func TestCitationFormatting(t *testing.T) {
// Test the citation formatting logic by creating a mock message with citations
message := &anthropic.Message{

View File

@@ -9,11 +9,11 @@ import (
"fmt"
"io"
"net/http"
"os"
"os/exec"
"strings"
"time"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/util"
"golang.org/x/oauth2"
)
@@ -46,8 +46,13 @@ func (t *OAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// Add OAuth Bearer token
newReq.Header.Set("Authorization", "Bearer "+token)
// Add the anthropic-beta header for OAuth
newReq.Header.Set("anthropic-beta", "oauth-2025-04-20")
// Add the anthropic-beta header for OAuth, preserving existing betas
existing := newReq.Header.Get("anthropic-beta")
beta := "oauth-2025-04-20"
if existing != "" {
beta = existing + "," + beta
}
newReq.Header.Set("anthropic-beta", beta)
// Set User-Agent to match AI SDK exactly
newReq.Header.Set("User-Agent", "ai-sdk/anthropic")
@@ -72,7 +77,7 @@ func (t *OAuthTransport) getValidToken(tokenIdentifier string) (string, error) {
}
// If no token exists, run OAuth flow
if token == nil {
fmt.Fprintln(os.Stderr, "No OAuth token found, initiating authentication...")
debuglog.Log("No OAuth token found, initiating authentication...\n")
newAccessToken, err := RunOAuthFlow(tokenIdentifier)
if err != nil {
return "", fmt.Errorf("failed to authenticate: %w", err)
@@ -82,11 +87,11 @@ func (t *OAuthTransport) getValidToken(tokenIdentifier string) (string, error) {
// Check if token needs refresh (5 minute buffer)
if token.IsExpired(5) {
fmt.Fprintln(os.Stderr, "OAuth token expired, refreshing...")
debuglog.Log("OAuth token expired, refreshing...\n")
newAccessToken, err := RefreshToken(tokenIdentifier)
if err != nil {
// If refresh fails, try re-authentication
fmt.Fprintln(os.Stderr, "Token refresh failed, re-authenticating...")
debuglog.Log("Token refresh failed, re-authenticating...\n")
newAccessToken, err = RunOAuthFlow(tokenIdentifier)
if err != nil {
return "", fmt.Errorf("failed to refresh or re-authenticate: %w", err)
@@ -138,13 +143,13 @@ func RunOAuthFlow(tokenIdentifier string) (token string, err error) {
if err == nil && existingToken != nil {
// If token exists but is expired, try refreshing first
if existingToken.IsExpired(5) {
fmt.Fprintln(os.Stderr, "Found expired OAuth token, attempting refresh...")
debuglog.Log("Found expired OAuth token, attempting refresh...\n")
refreshedToken, refreshErr := RefreshToken(tokenIdentifier)
if refreshErr == nil {
fmt.Fprintln(os.Stderr, "Token refresh successful")
debuglog.Log("Token refresh successful\n")
return refreshedToken, nil
}
fmt.Fprintf(os.Stderr, "Token refresh failed (%v), proceeding with full OAuth flow...\n", refreshErr)
debuglog.Log("Token refresh failed (%v), proceeding with full OAuth flow...\n", refreshErr)
} else {
// Token exists and is still valid
return existingToken.AccessToken, nil
@@ -171,10 +176,10 @@ func RunOAuthFlow(tokenIdentifier string) (token string, err error) {
oauth2.SetAuthURLParam("state", verifier),
)
fmt.Fprintln(os.Stderr, "Open the following URL in your browser. Fabric would like to authorize:")
fmt.Fprintln(os.Stderr, authURL)
debuglog.Log("Open the following URL in your browser. Fabric would like to authorize:\n")
debuglog.Log("%s\n", authURL)
openBrowser(authURL)
fmt.Fprint(os.Stderr, "Paste the authorization code here: ")
debuglog.Log("Paste the authorization code here: ")
var code string
fmt.Scanln(&code)
parts := strings.SplitN(code, "#", 2)

View File

@@ -87,6 +87,9 @@ func (c *Client) formatOptions(opts *domain.ChatOptions) string {
if opts.ImageFile != "" {
builder.WriteString(fmt.Sprintf("ImageFile: %s\n", opts.ImageFile))
}
if opts.Thinking != "" {
builder.WriteString(fmt.Sprintf("Thinking: %s\n", string(opts.Thinking)))
}
if opts.SuppressThink {
builder.WriteString("SuppressThink: enabled\n")
builder.WriteString(fmt.Sprintf("Thinking Start Tag: %s\n", opts.ThinkStartTag))

View File

@@ -6,6 +6,7 @@ import (
"encoding/binary"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/danielmiessler/fabric/internal/chat"
@@ -170,6 +171,25 @@ func (o *Client) NeedsRawMode(modelName string) bool {
return false
}
func parseThinkingConfig(level domain.ThinkingLevel) (*genai.ThinkingConfig, bool) {
lower := strings.ToLower(strings.TrimSpace(string(level)))
switch domain.ThinkingLevel(lower) {
case "", domain.ThinkingOff:
return nil, false
case domain.ThinkingLow, domain.ThinkingMedium, domain.ThinkingHigh:
if budget, ok := domain.ThinkingBudgets[domain.ThinkingLevel(lower)]; ok {
b := int32(budget)
return &genai.ThinkingConfig{IncludeThoughts: true, ThinkingBudget: &b}, true
}
default:
if tokens, err := strconv.ParseInt(lower, 10, 32); err == nil && tokens > 0 {
t := int32(tokens)
return &genai.ThinkingConfig{IncludeThoughts: true, ThinkingBudget: &t}, true
}
}
return nil, false
}
// buildGenerateContentConfig constructs the generation config with optional tools.
// When search is enabled it injects the Google Search tool. The optional search
// location accepts either:
@@ -201,6 +221,10 @@ func (o *Client) buildGenerateContentConfig(opts *domain.ChatOptions) (*genai.Ge
}
}
if tc, ok := parseThinkingConfig(opts.Thinking); ok {
cfg.ThinkingConfig = tc
}
return cfg, nil
}

View File

@@ -129,6 +129,38 @@ func TestBuildGenerateContentConfig_LanguageCodeNormalization(t *testing.T) {
}
}
func TestBuildGenerateContentConfig_Thinking(t *testing.T) {
client := &Client{}
opts := &domain.ChatOptions{Thinking: domain.ThinkingLow}
cfg, err := client.buildGenerateContentConfig(opts)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if cfg.ThinkingConfig == nil || !cfg.ThinkingConfig.IncludeThoughts {
t.Fatalf("expected thinking config with thoughts included")
}
if cfg.ThinkingConfig.ThinkingBudget == nil || *cfg.ThinkingConfig.ThinkingBudget != int32(domain.TokenBudgetLow) {
t.Errorf("expected thinking budget %d, got %+v", domain.TokenBudgetLow, cfg.ThinkingConfig.ThinkingBudget)
}
}
func TestBuildGenerateContentConfig_ThinkingTokens(t *testing.T) {
client := &Client{}
opts := &domain.ChatOptions{Thinking: domain.ThinkingLevel("123")}
cfg, err := client.buildGenerateContentConfig(opts)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if cfg.ThinkingConfig == nil || cfg.ThinkingConfig.ThinkingBudget == nil {
t.Fatalf("expected thinking config with budget")
}
if *cfg.ThinkingConfig.ThinkingBudget != 123 {
t.Errorf("expected thinking budget 123, got %d", *cfg.ThinkingConfig.ThinkingBudget)
}
}
func TestCitationFormatting(t *testing.T) {
client := &Client{}
response := &genai.GenerateContentResponse{

View File

@@ -18,7 +18,8 @@ type VendorsModels struct {
// PrintWithVendor prints models including their vendor on each line.
// When shellCompleteList is true, output is suitable for shell completion.
func (o *VendorsModels) PrintWithVendor(shellCompleteList bool) {
// Default vendor and model are highlighted with an asterisk.
func (o *VendorsModels) PrintWithVendor(shellCompleteList bool, defaultVendor, defaultModel string) {
if !shellCompleteList {
fmt.Printf("\n%v:\n", o.SelectionLabel)
}
@@ -42,7 +43,11 @@ func (o *VendorsModels) PrintWithVendor(shellCompleteList bool) {
if shellCompleteList {
fmt.Printf("%s|%s\n", groupItems.Group, item)
} else {
fmt.Printf("\t[%d]\t%s|%s\n", currentItemIndex, groupItems.Group, item)
mark := " "
if strings.EqualFold(groupItems.Group, defaultVendor) && strings.EqualFold(item, defaultModel) {
mark = " *"
}
fmt.Printf("%s\t[%d]\t%s|%s\n", mark, currentItemIndex, groupItems.Group, item)
}
}
}

View File

@@ -1,6 +1,9 @@
package ai
import (
"io"
"os"
"strings"
"testing"
)
@@ -31,3 +34,23 @@ func TestFindVendorsByModel(t *testing.T) {
t.Fatalf("FindVendorsByModel() = %v, want %v", foundVendors, []string{"vendor1"})
}
}
func TestPrintWithVendorMarksDefault(t *testing.T) {
vendors := NewVendorsModels()
vendors.AddGroupItems("vendor1", []string{"model1"}...)
vendors.AddGroupItems("vendor2", []string{"model2"}...)
r, w, _ := os.Pipe()
oldStdout := os.Stdout
os.Stdout = w
vendors.PrintWithVendor(false, "vendor2", "model2")
w.Close()
os.Stdout = oldStdout
out, _ := io.ReadAll(r)
if !strings.Contains(string(out), " *\t[2]\tvendor2|model2") {
t.Fatalf("default model not marked: %s", out)
}
}

View File

@@ -85,6 +85,9 @@ func (o *Client) buildChatCompletionParams(
ret.Seed = openai.Int(int64(opts.Seed))
}
}
if eff, ok := parseReasoningEffort(opts.Thinking); ok {
ret.ReasoningEffort = eff
}
return
}

View File

@@ -184,6 +184,19 @@ func (o *Client) NeedsRawMode(modelName string) bool {
return slices.Contains(openAIModelsNeedingRaw, modelName)
}
func parseReasoningEffort(level domain.ThinkingLevel) (shared.ReasoningEffort, bool) {
switch domain.ThinkingLevel(strings.ToLower(string(level))) {
case domain.ThinkingLow:
return shared.ReasoningEffortLow, true
case domain.ThinkingMedium:
return shared.ReasoningEffortMedium, true
case domain.ThinkingHigh:
return shared.ReasoningEffortHigh, true
default:
return "", false
}
}
func (o *Client) buildResponseParams(
inputMsgs []*chat.ChatCompletionMessage, opts *domain.ChatOptions,
) (ret responses.ResponseNewParams) {
@@ -229,6 +242,10 @@ func (o *Client) buildResponseParams(
ret.Tools = tools
}
if eff, ok := parseReasoningEffort(opts.Thinking); ok {
ret.Reasoning = shared.ReasoningParam{Effort: eff}
}
if !opts.Raw {
ret.Temperature = openai.Float(opts.Temperature)
if opts.TopP != 0 {

View File

@@ -0,0 +1,153 @@
package openai
import (
"bytes"
"context"
"fmt"
"os"
"os/exec"
"path/filepath"
"slices"
"sort"
"strings"
debuglog "github.com/danielmiessler/fabric/internal/log"
openai "github.com/openai/openai-go"
)
// MaxAudioFileSize defines the maximum allowed size for audio uploads (25MB).
const MaxAudioFileSize int64 = 25 * 1024 * 1024
// AllowedTranscriptionModels lists the models supported for transcription.
var AllowedTranscriptionModels = []string{
string(openai.AudioModelWhisper1),
string(openai.AudioModelGPT4oMiniTranscribe),
string(openai.AudioModelGPT4oTranscribe),
}
// allowedAudioExtensions defines the supported input file extensions.
var allowedAudioExtensions = map[string]struct{}{
".mp3": {},
".mp4": {},
".mpeg": {},
".mpga": {},
".m4a": {},
".wav": {},
".webm": {},
}
// TranscribeFile transcribes the given audio file using the specified model. If the file
// exceeds the size limit, it can optionally be split into chunks using ffmpeg.
func (o *Client) TranscribeFile(ctx context.Context, filePath, model string, split bool) (string, error) {
if ctx == nil {
ctx = context.Background()
}
if !slices.Contains(AllowedTranscriptionModels, model) {
return "", fmt.Errorf("model '%s' is not supported for transcription", model)
}
ext := strings.ToLower(filepath.Ext(filePath))
if _, ok := allowedAudioExtensions[ext]; !ok {
return "", fmt.Errorf("unsupported audio format '%s'", ext)
}
info, err := os.Stat(filePath)
if err != nil {
return "", err
}
var files []string
var cleanup func()
if info.Size() > MaxAudioFileSize {
if !split {
return "", fmt.Errorf("file %s exceeds 25MB limit; use --split-media-file to enable automatic splitting", filePath)
}
debuglog.Log("File %s is larger than the size limit... breaking it up into chunks...\n", filePath)
if files, cleanup, err = splitAudioFile(filePath, ext, MaxAudioFileSize); err != nil {
return "", err
}
defer cleanup()
} else {
files = []string{filePath}
}
var builder strings.Builder
for i, f := range files {
debuglog.Log("Using model %s to transcribe part %d (file name: %s)...\n", model, i+1, f)
var chunk *os.File
if chunk, err = os.Open(f); err != nil {
return "", err
}
params := openai.AudioTranscriptionNewParams{
File: chunk,
Model: openai.AudioModel(model),
}
var resp *openai.Transcription
resp, err = o.ApiClient.Audio.Transcriptions.New(ctx, params)
chunk.Close()
if err != nil {
return "", err
}
if i > 0 {
builder.WriteString(" ")
}
builder.WriteString(resp.Text)
}
return builder.String(), nil
}
// splitAudioFile splits the source file into chunks smaller than maxSize using ffmpeg.
// It returns the list of chunk file paths and a cleanup function.
func splitAudioFile(src, ext string, maxSize int64) (files []string, cleanup func(), err error) {
if _, err = exec.LookPath("ffmpeg"); err != nil {
return nil, nil, fmt.Errorf("ffmpeg not found: please install it")
}
var dir string
if dir, err = os.MkdirTemp("", "fabric-audio-*"); err != nil {
return nil, nil, err
}
cleanup = func() { os.RemoveAll(dir) }
segmentTime := 600 // start with 10 minutes
for {
pattern := filepath.Join(dir, "chunk-%03d"+ext)
debuglog.Log("Running ffmpeg to split audio into %d-second chunks...\n", segmentTime)
cmd := exec.Command("ffmpeg", "-y", "-i", src, "-f", "segment", "-segment_time", fmt.Sprintf("%d", segmentTime), "-c", "copy", pattern)
var stderr bytes.Buffer
cmd.Stderr = &stderr
if err = cmd.Run(); err != nil {
return nil, cleanup, fmt.Errorf("ffmpeg failed: %v: %s", err, stderr.String())
}
if files, err = filepath.Glob(filepath.Join(dir, "chunk-*"+ext)); err != nil {
return nil, cleanup, err
}
sort.Strings(files)
tooBig := false
for _, f := range files {
var info os.FileInfo
if info, err = os.Stat(f); err != nil {
return nil, cleanup, err
}
if info.Size() > maxSize {
tooBig = true
break
}
}
if !tooBig {
return files, cleanup, nil
}
for _, f := range files {
_ = os.Remove(f)
}
if segmentTime <= 1 {
return nil, cleanup, fmt.Errorf("unable to split file into acceptable size chunks")
}
segmentTime /= 2
}
}

View File

@@ -102,6 +102,11 @@ var ProviderMap = map[string]ProviderConfig{
BaseURL: "https://api.together.xyz/v1",
ImplementsResponses: false,
},
"Venice AI": {
Name: "Venice AI",
BaseURL: "https://api.venice.ai/api/v1",
ImplementsResponses: false,
},
}
// GetProviderByName returns the provider configuration for a given name with O(1) lookup

View File

@@ -4,9 +4,10 @@ import (
"context"
"fmt"
"os"
"sync" // Added sync package
"sync"
"github.com/danielmiessler/fabric/internal/domain"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins"
perplexity "github.com/sgaunet/perplexity-go/v2"
@@ -171,7 +172,7 @@ func (c *Client) SendStream(msgs []*chat.ChatCompletionMessage, opts *domain.Cha
if err != nil {
// Log error, can't send to string channel directly.
// Consider a mechanism to propagate this error if needed.
fmt.Fprintf(os.Stderr, "perplexity streaming error: %v\\n", err) // Corrected capitalization
debuglog.Log("perplexity streaming error: %v\n", err)
// If the error occurs during stream setup, the channel might not have been closed by the receiver loop.
// However, closing it here might cause a panic if the receiver loop also tries to close it.
// close(channel) // Caution: Uncommenting this may cause panic, as channel is closed in the receiver goroutine.

View File

@@ -148,7 +148,6 @@ func (o *VendorsManager) setupVendorTo(vendor Vendor, configuredVendors map[stri
delete(configuredVendors, vendor.GetName())
fmt.Printf("[%v] skipped\n", vendor.GetName())
}
return
}
type modelResult struct {

View File

@@ -31,6 +31,27 @@ type Pattern struct {
func (o *PatternsEntity) GetApplyVariables(
source string, variables map[string]string, input string) (pattern *Pattern, err error) {
if pattern, err = o.loadPattern(source); err != nil {
return
}
err = o.applyVariables(pattern, variables, input)
return
}
// GetWithoutVariables returns a pattern with only the {{input}} placeholder processed
// and skips template variable replacement
func (o *PatternsEntity) GetWithoutVariables(source, input string) (pattern *Pattern, err error) {
if pattern, err = o.loadPattern(source); err != nil {
return
}
o.applyInput(pattern, input)
return
}
func (o *PatternsEntity) loadPattern(source string) (pattern *Pattern, err error) {
// Determine if this is a file path
isFilePath := strings.HasPrefix(source, "\\") ||
strings.HasPrefix(source, "/") ||
@@ -39,8 +60,8 @@ func (o *PatternsEntity) GetApplyVariables(
if isFilePath {
// Resolve the file path using GetAbsolutePath
absPath, err := util.GetAbsolutePath(source)
if err != nil {
var absPath string
if absPath, err = util.GetAbsolutePath(source); err != nil {
return nil, fmt.Errorf("could not resolve file path: %v", err)
}
@@ -51,26 +72,27 @@ func (o *PatternsEntity) GetApplyVariables(
pattern, err = o.getFromDB(source)
}
if err != nil {
return
}
// Apply variables to the pattern
err = o.applyVariables(pattern, variables, input)
return
}
func (o *PatternsEntity) applyVariables(
pattern *Pattern, variables map[string]string, input string) (err error) {
// Ensure pattern has an {{input}} placeholder
// If not present, append it on a new line
func (o *PatternsEntity) ensureInput(pattern *Pattern) {
if !strings.Contains(pattern.Pattern, "{{input}}") {
if !strings.HasSuffix(pattern.Pattern, "\n") {
pattern.Pattern += "\n"
}
pattern.Pattern += "{{input}}"
}
}
func (o *PatternsEntity) applyInput(pattern *Pattern, input string) {
o.ensureInput(pattern)
pattern.Pattern = strings.ReplaceAll(pattern.Pattern, "{{input}}", input)
}
func (o *PatternsEntity) applyVariables(
pattern *Pattern, variables map[string]string, input string) (err error) {
o.ensureInput(pattern)
// Temporarily replace {{input}} with a sentinel token to protect it
// from recursive variable resolution

View File

@@ -145,6 +145,22 @@ func TestGetApplyVariables(t *testing.T) {
}
}
func TestGetWithoutVariables(t *testing.T) {
entity, cleanup := setupTestPatternsEntity(t)
defer cleanup()
createTestPattern(t, entity, "test-pattern", "Prefix {{input}} {{roam}}")
result, err := entity.GetWithoutVariables("test-pattern", "hello")
require.NoError(t, err)
assert.Equal(t, "Prefix hello {{roam}}", result.Pattern)
createTestPattern(t, entity, "no-input", "Static content")
result, err = entity.GetWithoutVariables("no-input", "hi")
require.NoError(t, err)
assert.Equal(t, "Static content\nhi", result.Pattern)
}
func TestPatternsEntity_Save(t *testing.T) {
entity, cleanup := setupTestPatternsEntity(t)
defer cleanup()

View File

@@ -10,8 +10,9 @@ import (
"strings"
"time"
debuglog "github.com/danielmiessler/fabric/internal/log"
"gopkg.in/yaml.v3"
// Add this import
)
// ExtensionDefinition represents a single extension configuration
@@ -87,9 +88,7 @@ func NewExtensionRegistry(configDir string) *ExtensionRegistry {
r.ensureConfigDir()
if err := r.loadRegistry(); err != nil {
if Debug {
fmt.Printf("Warning: could not load extension registry: %v\n", err)
}
debuglog.Log("Warning: could not load extension registry: %v\n", err)
}
return r

View File

@@ -6,6 +6,8 @@ import (
"path/filepath"
"regexp"
"strings"
debuglog "github.com/danielmiessler/fabric/internal/log"
)
var (
@@ -14,7 +16,6 @@ var (
filePlugin = &FilePlugin{}
fetchPlugin = &FetchPlugin{}
sysPlugin = &SysPlugin{}
Debug = false // Debug flag
)
var extensionManager *ExtensionManager
@@ -33,9 +34,7 @@ var pluginPattern = regexp.MustCompile(`\{\{plugin:([^:]+):([^:]+)(?::([^}]+))?\
var extensionPattern = regexp.MustCompile(`\{\{ext:([^:]+):([^:]+)(?::([^}]+))?\}\}`)
func debugf(format string, a ...interface{}) {
if Debug {
fmt.Printf(format, a...)
}
debuglog.Debug(debuglog.Trace, format, a...)
}
func ApplyTemplate(content string, variables map[string]string, input string) (string, error) {

View File

@@ -130,6 +130,7 @@ func (h *ChatHandler) HandleChat(c *gin.Context) {
TopP: request.TopP,
FrequencyPenalty: request.FrequencyPenalty,
PresencePenalty: request.PresencePenalty,
Thinking: request.Thinking,
}
session, err := chatter.Send(chatReq, opts)

View File

@@ -7,6 +7,7 @@ import (
"sort"
"strings"
debuglog "github.com/danielmiessler/fabric/internal/log"
"github.com/danielmiessler/fabric/internal/plugins"
"github.com/danielmiessler/fabric/internal/plugins/db/fsdb"
"github.com/danielmiessler/fabric/internal/tools/githelper"
@@ -335,9 +336,9 @@ func (o *PatternsLoader) createUniquePatternsFile() (err error) {
patternNamesMap[entry.Name()] = true
}
}
fmt.Fprintf(os.Stderr, "📂 Also included patterns from custom directory: %s\n", o.Patterns.CustomPatternsDir)
debuglog.Log("📂 Also included patterns from custom directory: %s\n", o.Patterns.CustomPatternsDir)
} else {
fmt.Fprintf(os.Stderr, "Warning: Could not read custom patterns directory %s: %v\n", o.Patterns.CustomPatternsDir, customErr)
debuglog.Log("Warning: Could not read custom patterns directory %s: %v\n", o.Patterns.CustomPatternsDir, customErr)
}
}

View File

@@ -181,7 +181,8 @@ func (o *YouTube) tryMethodYtDlpInternal(videoId string, language string, additi
if len(langMatch) > 2 {
langMatch = langMatch[:2]
}
args = append(args, "--sub-langs", langMatch)
langOpts := language + "," + langMatch + ".*," + langMatch
args = append(args, "--sub-langs", langOpts)
}
// Add user-provided arguments last so they take precedence

View File

@@ -26,8 +26,8 @@ schema = 3
version = "v1.3.3"
hash = "sha256-jv7ZshpSd7FZzKKN6hqlUgiR8C3y85zNIS/hq7g76Ho="
[mod."github.com/anthropics/anthropic-sdk-go"]
version = "v1.7.0"
hash = "sha256-DvpFXlUE04HeMbqQX4HIC/KMJYPXJ8rEaZkNJb1rWxs="
version = "v1.9.1"
hash = "sha256-1saDnM1DMnDLHT4RoA/EFuOvW7CIFh2tkfOJ1/+itNc="
[mod."github.com/araddon/dateparse"]
version = "v0.0.0-20210429162001-6b43995a97de"
hash = "sha256-UuX84naeRGMsFOgIgRoBHG5sNy1CzBkWPKmd6VbLwFw="
@@ -224,8 +224,8 @@ schema = 3
version = "v1.0.2"
hash = "sha256-+W9EIW7okXIXjWEgOaMh58eLvBZ7OshW2EhaIpNLSBU="
[mod."github.com/ollama/ollama"]
version = "v0.9.0"
hash = "sha256-r2eU+kMG3tuJy2B43RXsfmeltzM9t05NEmNiJAW5qr4="
version = "v0.11.7"
hash = "sha256-3Wn1JWmil0aQQ2I/r398HbnUsi8ADoroqNyPziuxn/c="
[mod."github.com/openai/openai-go"]
version = "v1.8.2"
hash = "sha256-O8aV3zEj6o8kIlzlkYaTW4RzvwR3qNUBYiN8SuTM1R0="
@@ -308,8 +308,8 @@ schema = 3
version = "v0.18.0"
hash = "sha256-tUpUPERjmRi7zldj0oPlnbnBhEkcI9iQGvP1HqlsK10="
[mod."golang.org/x/crypto"]
version = "v0.39.0"
hash = "sha256-FtwjbVoAhZkx7F2hmzi9Y0J87CVVhWcrZzun+zWQLzc="
version = "v0.40.0"
hash = "sha256-I6p2fqvz63P9MwAuoQrljI7IUbfZQvCem0ii4Q2zZng="
[mod."golang.org/x/exp"]
version = "v0.0.0-20250531010427-b6e5de432a8b"
hash = "sha256-QaFfjyB+pogCkUkJskR9xnXwkCOU828XJRrzwwLm6Ms="

View File

@@ -1 +1 @@
"1.4.283"
"1.4.306"

View File

@@ -1,116 +0,0 @@
# Docker Test Environment for API Configuration Fix
This directory contains a Docker-based testing setup for fixing the issue where Fabric calls Ollama and Bedrock APIs even when not configured. This addresses the problem where unconfigured services show error messages during model listing.
## Quick Start
```bash
# Run all tests
./scripts/docker-test/test-runner.sh
# Interactive mode - pick which test to run
./scripts/docker-test/test-runner.sh -i
# Run specific test case
./scripts/docker-test/test-runner.sh gemini-only
# Shell into test environment
./scripts/docker-test/test-runner.sh -s gemini-only
# Build image only (for development)
./scripts/docker-test/test-runner.sh -b
# Show help
./scripts/docker-test/test-runner.sh -h
```
## Test Cases
1. **no-config**: No APIs configured
2. **gemini-only**: Only Gemini configured (reproduces original issue #1195)
3. **openai-only**: Only OpenAI configured
4. **ollama-only**: Only Ollama configured
5. **bedrock-only**: Only Bedrock configured
6. **mixed**: Multiple APIs configured (Gemini + OpenAI + Ollama)
## Environment Files
Each test case has a corresponding environment file in `scripts/docker-test/env/`:
- `env.no-config` - Empty configuration
- `env.gemini-only` - Only Gemini API key
- `env.openai-only` - Only OpenAI API key
- `env.ollama-only` - Only Ollama URL
- `env.bedrock-only` - Only Bedrock configuration
- `env.mixed` - Multiple API configurations
These files are volume-mounted into the Docker container and persist changes made with `fabric -S`.
## Interactive Mode & Shell Access
The interactive mode (`-i`) provides several options:
```text
Available test cases:
1) No APIs configured (no-config)
2) Only Gemini configured (gemini-only)
3) Only OpenAI configured (openai-only)
4) Only Ollama configured (ollama-only)
5) Only Bedrock configured (bedrock-only)
6) Mixed configuration (mixed)
7) Run all tests
0) Exit
Add '!' after number to shell into test environment (e.g., '1!' to shell into no-config)
```
### Shell Mode
- Use `1!`, `2!`, etc. to shell into any test environment
- Run `fabric -S` to configure APIs interactively
- Run `fabric --listmodels` or `fabric -L` to test model listing
- Changes persist in the environment files
- Type `exit` to return to test runner
## Expected Results
**Before Fix:**
- `no-config` and `gemini-only` tests show Ollama connection errors
- Tests show Bedrock authentication errors when BEDROCK_AWS_REGION not set
- Error: `Ollama Get "http://localhost:11434/api/tags": dial tcp...`
- Error: `Bedrock failed to list foundation models...`
**After Fix:**
- Clean output with no error messages for unconfigured services
- Only configured services appear in model listings
- Ollama only initialized when `OLLAMA_API_URL` is set
- Bedrock only initialized when `BEDROCK_AWS_REGION` is set
## Implementation Details
- **Volume-mounted configs**: Environment files are mounted to `/home/testuser/.config/fabric/.env`
- **Persistent state**: Configuration changes survive between test runs
- **Single Docker image**: Built once from `scripts/docker-test/base/Dockerfile`, reused for all tests
- **Isolated environments**: Each test uses its own environment file
- **Cross-platform**: Works on macOS, Linux, and Windows with Docker
## Development Workflow
1. Make code changes to fix API initialization logic
2. Run `./scripts/docker-test/test-runner.sh no-config` to test the main issue
3. Use `./scripts/docker-test/test-runner.sh -i` for interactive testing
4. Shell into environments (`1!`, `2!`, etc.) to debug specific configurations
5. Run all tests before submitting PR: `./scripts/docker-test/test-runner.sh`
## Architecture
The fix involves:
1. **Ollama**: Override `IsConfigured()` method to check for `OLLAMA_API_URL` env var
2. **Bedrock**: Modify `hasAWSCredentials()` to require `BEDROCK_AWS_REGION`
3. **Plugin Registry**: Only initialize providers when properly configured
This prevents unnecessary API calls and eliminates confusing error messages for users.

View File

@@ -1,30 +0,0 @@
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY ./cmd/fabric ./cmd/fabric
COPY ./internal ./internal
RUN go build -o fabric ./cmd/fabric
FROM alpine:latest
RUN apk --no-cache add ca-certificates
# Create a test user
RUN adduser -D -s /bin/sh testuser
# Switch to test user
USER testuser
WORKDIR /home/testuser
# Set environment variables for the test user
ENV HOME=/home/testuser
ENV USER=testuser
COPY --from=builder /app/fabric .
# Create fabric config directory and empty .env file
RUN mkdir -p .config/fabric && touch .config/fabric/.env
ENTRYPOINT ["./fabric"]

View File

@@ -1,235 +0,0 @@
#!/usr/bin/env bash
set -e
# Get the directory where this script is located
top_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
base_name="$(basename "$top_dir")"
cd "$top_dir"/../.. || exit 1
# Check if bash version supports associative arrays
if [[ ${BASH_VERSION%%.*} -lt 4 ]]; then
echo "This script requires bash 4.0 or later for associative arrays."
echo "Current version: $BASH_VERSION"
exit 1
fi
IMAGE_NAME="fabric-test-setup"
ENV_DIR="scripts/${base_name}/env"
# Test case descriptions
declare -A test_descriptions=(
["no-config"]="No APIs configured"
["gemini-only"]="Only Gemini configured (reproduces original issue)"
["openai-only"]="Only OpenAI configured"
["ollama-only"]="Only Ollama configured"
["bedrock-only"]="Only Bedrock configured"
["mixed"]="Mixed configuration (Gemini + OpenAI + Ollama)"
)
# Test case order for consistent display
test_order=("no-config" "gemini-only" "openai-only" "ollama-only" "bedrock-only" "mixed")
build_image() {
echo "=== Building Docker image ==="
docker build -f "${top_dir}/base/Dockerfile" -t "$IMAGE_NAME" .
echo
}
check_env_file() {
local test_name="$1"
local env_file="$ENV_DIR/env.$test_name"
if [[ ! -f "$env_file" ]]; then
echo "Error: Environment file not found: $env_file"
exit 1
fi
}
run_test() {
local test_name="$1"
local description="${test_descriptions[$test_name]}"
local env_file="$ENV_DIR/env.$test_name"
check_env_file "$test_name"
echo "===================="
echo "Test: $description"
echo "Config: $test_name"
echo "Env file: $env_file"
echo "===================="
echo "Running test..."
if docker run --rm \
-e HOME=/home/testuser \
-e USER=testuser \
-v "$(pwd)/$env_file:/home/testuser/.config/fabric/.env:ro" \
"$IMAGE_NAME" --listmodels 2>&1; then
echo "✅ Test completed"
else
echo "❌ Test failed"
fi
echo
}
shell_into_env() {
local test_name="$1"
local description="${test_descriptions[$test_name]}"
local env_file="$ENV_DIR/env.$test_name"
check_env_file "$test_name"
echo "===================="
echo "Shelling into: $description"
echo "Config: $test_name"
echo "Env file: $env_file"
echo "===================="
echo "You can now run 'fabric -S' to configure, or 'fabric --listmodels' or 'fabric -L' to test."
echo "Changes to .env will persist in $env_file"
echo "Type 'exit' to return to the test runner."
echo
docker run -it --rm \
-e HOME=/home/testuser \
-e USER=testuser \
-v "$(pwd)/$env_file:/home/testuser/.config/fabric/.env" \
--entrypoint=/bin/sh \
"$IMAGE_NAME"
}
interactive_mode() {
echo "=== Interactive Mode ==="
echo "Available test cases:"
echo
local i=1
local cases=()
for test_name in "${test_order[@]}"; do
echo "$i) ${test_descriptions[$test_name]} ($test_name)"
cases[i]="$test_name"
((i++))
done
echo "$i) Run all tests"
echo "0) Exit"
echo
echo "Add '!' after number to shell into test environment (e.g., '1!' to shell into no-config)"
echo
while true; do
read -r -p "Select test case (0-$i) [or 1!, etc. to shell into test environment]: " choice
# Check for shell mode (! suffix)
local shell_mode=false
if [[ "$choice" == *"!" ]]; then
shell_mode=true
choice="${choice%!}" # Remove the ! suffix
fi
if [[ "$choice" == "0" ]]; then
if [[ "$shell_mode" == true ]]; then
echo "Cannot shell into exit option."
continue
fi
echo "Exiting..."
exit 0
elif [[ "$choice" == "$i" ]]; then
if [[ "$shell_mode" == true ]]; then
echo "Cannot shell into 'run all tests' option."
continue
fi
echo "Running all tests..."
run_all_tests
break
elif [[ "$choice" -ge 1 && "$choice" -lt "$i" ]]; then
local selected_test="${cases[$choice]}"
if [[ "$shell_mode" == true ]]; then
echo "Shelling into: ${test_descriptions[$selected_test]}"
shell_into_env "$selected_test"
else
echo "Running: ${test_descriptions[$selected_test]}"
run_test "$selected_test"
fi
read -r -p "Continue testing? (y/n): " again
if [[ "$again" != "y" && "$again" != "Y" ]]; then
break
fi
echo
else
echo "Invalid choice. Please select 0-$i (optionally with '!' for shell mode)."
fi
done
}
run_all_tests() {
echo "=== Testing PR #1645: Conditional API initialization ==="
echo
for test_name in "${test_order[@]}"; do
run_test "$test_name"
done
echo "=== Test run complete ==="
echo "Review the output above to check:"
echo "1. No Ollama connection errors when OLLAMA_URL not set"
echo "2. No Bedrock authentication errors when BEDROCK_AWS_REGION not set"
echo "3. Only configured services appear in model listings"
}
show_help() {
echo "Usage: $0 [OPTIONS] [TEST_CASE]"
echo
echo "Test PR #1645 conditional API initialization"
echo
echo "Options:"
echo " -h, --help Show this help message"
echo " -i, --interactive Run in interactive mode"
echo " -b, --build-only Build image only, don't run tests"
echo " -s, --shell TEST Shell into test environment"
echo
echo "Test cases:"
for test_name in "${test_order[@]}"; do
echo " $test_name: ${test_descriptions[$test_name]}"
done
echo
echo "Examples:"
echo " $0 # Run all tests"
echo " $0 -i # Interactive mode"
echo " $0 gemini-only # Run specific test"
echo " $0 -s gemini-only # Shell into gemini-only environment"
echo " $0 -b # Build image only"
echo
echo "Environment files are located in $ENV_DIR/ and can be edited directly."
}
# Parse command line arguments
if [[ $# -eq 0 ]]; then
build_image
run_all_tests
elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
show_help
elif [[ "$1" == "-i" || "$1" == "--interactive" ]]; then
build_image
interactive_mode
elif [[ "$1" == "-b" || "$1" == "--build-only" ]]; then
build_image
elif [[ "$1" == "-s" || "$1" == "--shell" ]]; then
if [[ -z "$2" ]]; then
echo "Error: -s/--shell requires a test case name"
echo "Use -h for help."
exit 1
fi
if [[ -z "${test_descriptions[$2]}" ]]; then
echo "Error: Unknown test case: $2"
echo "Use -h for help."
exit 1
fi
build_image
shell_into_env "$2"
elif [[ -n "${test_descriptions[$1]}" ]]; then
build_image
run_test "$1"
else
echo "Unknown test case or option: $1"
echo "Use -h for help."
exit 1
fi

View File

@@ -1,41 +1,28 @@
# Use official golang image as builder
FROM golang:1.24.2-alpine AS builder
# syntax=docker/dockerfile:1
# Set working directory
WORKDIR /app
FROM golang:1.24-alpine AS builder
WORKDIR /src
# Install build dependencies
RUN apk add --no-cache git
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o fabric ./cmd/fabric
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /fabric ./cmd/fabric
# Use scratch as final base image
FROM alpine:latest
# Copy the binary from builder
COPY --from=builder /app/fabric /fabric
LABEL org.opencontainers.image.description="A Docker image for running the Fabric CLI. See https://github.com/danielmiessler/Fabric/tree/main/scripts/docker for details."
# Copy patterns directory
COPY patterns /patterns
RUN apk add --no-cache ca-certificates \
&& mkdir -p /root/.config/fabric
# Ensure clean config directory and copy ENV file
RUN rm -rf /root/.config/fabric && \
mkdir -p /root/.config/fabric
COPY ENV /root/.config/fabric/.env
COPY --from=builder /fabric /usr/local/bin/fabric
# Add debug commands
RUN ls -la /root/.config/fabric/
# Expose port 8080
EXPOSE 8080
# Run the binary with debug output
ENTRYPOINT ["/fabric"]
CMD ["--serve"]
ENTRYPOINT ["fabric"]

View File

@@ -1,40 +1,60 @@
# Docker Deployment
# Fabric Docker Image
This directory contains Docker configuration files for running Fabric in containers.
This directory provides a simple Docker setup for running the [Fabric](https://github.com/danielmiessler/fabric) CLI.
## Files
## Build
- `Dockerfile` - Main Docker build configuration
- `docker-compose.yml` - Docker Compose stack configuration
- `start-docker.sh` - Helper script to start the stack
- `README.md` - This documentation
## Quick Start
Build the image from the repository root:
```bash
# Start the Docker stack
./start-docker.sh
# Or manually with docker-compose
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the stack
docker-compose down
docker build -t fabric -f scripts/docker/Dockerfile .
```
## Building
## Persisting configuration
Fabric stores its configuration in `~/.config/fabric/.env`. Mount this path to keep your settings on the host.
### Using a host directory
```bash
# Build the Docker image
docker build -t fabric .
# Or use docker-compose
docker-compose build
mkdir -p $HOME/.fabric-config
# Run setup to create the .env and download patterns
docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric fabric --setup
```
## Configuration
Subsequent runs can reuse the same directory:
Make sure to configure your environment variables and API keys before running the Docker stack. See the main README.md for setup instructions.
```bash
docker run --rm -it -v $HOME/.fabric-config:/root/.config/fabric fabric -p your-pattern
```
### Mounting a single .env file
If you only want to persist the `.env` file:
```bash
# assuming .env exists in the current directory
docker run --rm -it -v $PWD/.env:/root/.config/fabric/.env fabric -p your-pattern
```
## Running the server
Expose port 8080 to use Fabric's REST API:
```bash
docker run --rm -it -p 8080:8080 -v $HOME/.fabric-config:/root/.config/fabric fabric --serve
```
The API will be available at `http://localhost:8080`.
## Multi-arch builds and GHCR packages
For multi-arch Docker builds (such as those used for GitHub Container Registry packages), the description should be set via annotations in the manifest instead of the Dockerfile LABEL. When building multi-arch images, ensure the build configuration includes:
```json
"annotations": {
"org.opencontainers.image.description": "A Docker image for running the Fabric CLI. See https://github.com/danielmiessler/Fabric/tree/main/scripts/docker for details."
}
```
This ensures that GHCR packages display the proper description.

View File

@@ -1,11 +0,0 @@
version: '3.8'
services:
fabric-api:
build: .
ports:
- "8080:8080"
volumes:
- ./ENV:/root/.config/fabric/.env:ro
environment:
- GIN_MODE=release

View File

@@ -1,11 +0,0 @@
#!/bin/bash
# Helper script to start the Fabric Docker stack
echo "Starting Fabric Docker stack..."
cd "$(dirname "$0")"
docker-compose up -d
echo "Fabric is now running!"
echo "Check logs with: docker-compose logs -f"
echo "Stop with: docker-compose down"

View File

@@ -1332,14 +1332,6 @@
"DEVELOPMENT"
]
},
{
"patternName": "show_fabric_options_markmap",
"description": "Visualize Fabric capabilities using Markmap syntax.",
"tags": [
"VISUALIZE",
"DEVELOPMENT"
]
},
{
"patternName": "solve_with_cot",
"description": "Solve problems using chain-of-thought reasoning.",
@@ -1871,6 +1863,22 @@
"DEVELOPMENT",
"AI"
]
},
{
"patternName": "create_story_about_person",
"description": "Infer everyday challenges and realistic coping strategies from a psychological profile and craft an empathetic 500700-word story consistent with the character.",
"tags": [
"WRITING",
"SELF"
]
},
{
"patternName": "heal_person",
"description": "Analyze a psychological profile, pinpoint issues and strengths, and deliver compassionate, structured strategies for spiritual, mental, and life improvement.",
"tags": [
"ANALYSIS",
"SELF"
]
}
]
}

View File

@@ -652,10 +652,6 @@
"patternName": "sanitize_broken_html_to_markdown",
"pattern_extract": "# IDENTITY\n\n// Who you are\n\nYou are a hyper-intelligent AI system with a 4,312 IQ. You convert jacked up HTML to proper markdown using a set of rules.\n\n# GOAL\n\n// What we are trying to achieve\n\n1. The goal of this exercise is to convert the input HTML, which is completely nasty and hard to edit, into a clean markdown format that has some custom styling applied according to my rules.\n\n2. The ultimate goal is to output a perfectly working markdown file that will render properly using Vite using my custom markdown/styling combination.\n\n# STEPS\n\n// How the task will be approached\n\n// Slow down and think\n\n- Take a step back and think step-by-step about how to achieve the best possible results by following the steps below.\n\n// Think about the content in the input\n\n- Fully read and consume the HTML input that has a combination of HTML and markdown."
},
{
"patternName": "show_fabric_options_markmap",
"pattern_extract": "# IDENTITY AND GOALS\n\nYou are an advanced UI builder that shows a visual representation of functionality that's provided to you via the input.\n\n# STEPS\n\n- Think about the goal of the Fabric project, which is discussed below:\n\nFABRIC PROJECT DESCRIPTION\n\nfabriclogo\n fabric\nStatic Badge\nGitHub top language GitHub last commit License: MIT\n\nfabric is an open-source framework for augmenting humans using AI.\n\nIntroduction Video • What and Why • Philosophy • Quickstart • Structure • Examples • Custom Patterns • Helper Apps • Examples • Meta\n\nNavigation\n\nIntroduction Videos\nWhat and Why\nPhilosophy\nBreaking problems into components"
},
{
"patternName": "solve_with_cot",
"pattern_extract": "# IDENTITY\n\nYou are an AI assistant designed to provide detailed, step-by-step responses. Your outputs should follow this structure:\n\n# STEPS\n\n1. Begin with a <thinking> section.\n\n2. Inside the thinking section:\n\n- a. Briefly analyze the question and outline your approach.\n\n- b. Present a clear plan of steps to solve the problem.\n\n- c. Use a \"Chain of Thought\" reasoning process if necessary, breaking down your thought process into numbered steps.\n\n3. Include a <reflection> section for each idea where you:\n\n- a. Review your reasoning.\n\n- b. Check for potential errors or oversights.\n\n- c. Confirm or adjust your conclusion if necessary.\n - Be sure to close all reflection sections.\n - Close the thinking section with </thinking>."
@@ -907,6 +903,14 @@
{
"patternName": "generate_code_rules",
"pattern_extract": "# IDENTITY AND PURPOSE You are a senior developer and expert prompt engineer. Think ultra hard to distill the following transcription or tutorial in as little set of unique rules as possible intended for best practices guidance in AI assisted coding tools, each rule has to be in one sentence as a direct instruction, avoid explanations and cosmetic language. Output in Markdown, I prefer bullet dash (-). --- # TRANSCRIPT"
},
{
"patternName": "create_story_about_person",
"pattern_extract": "You are an expert creative writer specializing in character-driven narratives, and a keen observer of human psychology. Your task is to craft a compelling, realistic short story based on a psychological profile or personal data provided by the user. **Input:** The user will provide a psychological profile or descriptive data about a fictional or real person. This input will be clearly delimited by triple backticks (```). It may include personality traits, habits, fears, motivations, strengths, weaknesses, background information, or specific behavioral patterns. **Task Steps:** 1. **Analyze Profile:** Carefully read and internalize the provided psychological profile. Identify the core personality traits, typical reactions, strengths, and vulnerabilities of the individual. 2. **Brainstorm Challenges:** Based on the analysis from Step 1, generate 3-5 common, relatable, everyday problems or minor dilemmas that a person with this specific profile might genuinely encounter. These challenges should be varied and could span social, professional, personal, or emotional domains. 3. **Develop Strategies:** For each identified problem from Step 2, devise 1-2 specific, plausible methods or strategies that the character, consistent with their psychological profile, would naturally employ (or attempt to employ) to navigate, cope with, or solve these challenges. Consider both internal thought processes and external actions. 4. **Construct Narrative:** Weave these problems and the character's responses into a cohesive, engaging short story (approximately 500-700 words, 3-5 paragraphs). The story should have a clear narrative flow, introducing the character, presenting the challenges, and showing their journey through them. 5. **Maintain Consistency:** Throughout the story, ensure the character's actions, dialogue, internal monologue, and emotional reactions are consistently aligned with the psychological profile provided. The story should feel authentic to the character. **Output Requirements:** * **Format:** A continuous narrative short story. * **Tone:** Empathetic, realistic, and engaging. * **Content:** The story must clearly depict the character facing everyday problems and demonstrate their unique methods and strategies for navigating these challenges, directly reflecting the input profile. * **Length:** Approximately 500-700 words. * **Avoid:** Overly dramatic or fantastical scenarios unless the profile explicitly suggests such a context. Focus on the 'everyday common problems'. **Example of Input Format:** ``` [Psychological Profile/Data Here] ```"
},
{
"patternName": "heal_person",
"pattern_extract": "# IDENTITY and PURPOSE You are an AI assistant whose primary responsibility is to interpret and analyze psychological profiles and/or psychology data files provided as input. Your role is to carefully process this data and use your expertise to develop a tailored plan aimed at spiritual and mental healing, as well as overall life improvement for the subject. You must approach each case with sensitivity, applying psychological knowledge and holistic strategies to create actionable, personalized recommendations that address both mental and spiritual well-being. Your focus is on structured, compassionate, and practical guidance that can help the individual make meaningful improvements in their life. Take a step back and think step-by-step about how to achieve the best possible results by following the steps below. # STEPS - Carefully review the psychological-profile and/or psychology data file provided as input. - Analyze the data to identify key issues, strengths, and areas needing improvement related to the subject's mental and spiritual well-being. - Develop a comprehensive plan that includes specific strategies for spiritual healing, mental health improvement, and overall life enhancement. - Structure your output to clearly outline recommendations, resources, and actionable steps tailored to the individual's unique profile. # OUTPUT INSTRUCTIONS - Only output Markdown. - Ensure your output is organized, clear, and easy to follow, using headings, subheadings, and bullet points where appropriate. - Ensure you follow ALL these instructions when creating your output. # INPUT INPUT:# IDENTITY and PURPOSE You are an AI assistant whose primary responsibility is to interpret and analyze psychological profiles and/or psychology data files provided as input. Your role is to carefully process this data and use your expertise to develop a tailored plan aimed at spiritual and mental healing, as well as overall life improvement for the subject. You must approach each case with sensitivity, applying psychological knowledge and holistic strategies to create actionable, personalized recommendations that address both mental and spiritual well-being. Your focus is on structured, compassionate, and practical guidance that can help the individual make meaningful improvements in their life. Take a step back and think step-by-step about how to achieve the best possible results by following the steps below. # STEPS - Carefully review the psychological-profile and/or psychology data file provided as input. - Analyze the data to identify key issues, strengths, and areas needing improvement related to the subject's mental and spiritual well-being. - Develop a comprehensive plan that includes specific strategies for spiritual healing, mental health improvement, and overall life enhancement. - Structure your output to clearly outline recommendations, resources, and actionable steps tailored to the individual's unique profile. # OUTPUT INSTRUCTIONS - Only output Markdown. - Ensure your output is organized, clear, and easy to follow, using headings, subheadings, and bullet points where appropriate. - Ensure you follow ALL these instructions when creating your output. # INPUT INPUT:"
}
]
}

View File

@@ -0,0 +1,99 @@
# README Update Scripts
This directory contains automation scripts for updating the main README.md file with release information from the changelog database.
## `update_readme_features.py`
A Python script that generates the "Recent Major Features" section for the README by extracting and filtering release information from the changelog SQLite database.
### Usage
```bash
# Generate the Recent Major Features section with default limit (20 releases)
python scripts/readme_updates/update_readme_features.py
# Specify a custom limit
python scripts/readme_updates/update_readme_features.py --limit 15
# Use a custom database path
python scripts/readme_updates/update_readme_features.py --db /path/to/changelog.db
```
### How It Works
1. **Database Connection**: Connects to `cmd/generate_changelog/changelog.db` (or custom path)
2. **Data Extraction**: Queries the `versions` table for release information
3. **Feature Filtering**: Uses heuristics to identify feature/improvement releases
4. **Markdown Generation**: Formats output to match README style
### Feature Detection Heuristics
The script uses keyword-based heuristics to filter releases:
#### Include Keywords (Features/Improvements)
- new, feature, feat, add, introduce, enable, support
- improve, enhance, performance, speed
- option, flag, argument, parameter
- integration, provider, search, tts, audio, model
- cli, ui, web, oauth, sync, database
- notifications, desktop, reasoning, thinking
#### Exclude Keywords (Non-Features)
- fix, bug, hotfix
- ci, cd, pipeline, chore
- docs, readme, refactor, style, typo
- test, bump, deps, dependency
- merge, revert, format, lint, build
- release, prepare, coverage, security
### Integration with README
To update the README with new release features:
```bash
# Generate the features and save to a temporary file
python scripts/readme_updates/update_readme_features.py --limit 20 > /tmp/recent_features.md
# Manually replace the "### Recent Major Features" section in README.md
# with the generated content
```
### Database Schema
The script expects the following SQLite table structure:
```sql
CREATE TABLE versions (
name TEXT PRIMARY KEY,
date DATETIME,
commit_sha TEXT,
pr_numbers TEXT,
ai_summary TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
```
### Date Format Support
The script can parse various date formats:
- ISO 8601 with timezone: `2025-08-14 14:11:04+00:00`
- ISO 8601 basic: `2025-08-14T14:11:04`
- Date only: `2025-08-14`
- US format: `08/14/2025`
Output format is standardized to: `Aug 14, 2025`
### Maintenance Notes
- **AI Summary Format Changes**: If the format of AI summaries changes, update the `extract_title_desc()` and `split_summary()` functions
- **Keyword Tuning**: Adjust `INCLUDE_RE` and `EXCLUDE_RE` patterns as needed
- **Title Extraction**: The script attempts to extract concise titles from feature descriptions
- **Description Length**: Descriptions are limited to 200 characters for readability
### Future Enhancements
Potential improvements for automated README updates:
- Add section delimiter markers in README for automated replacement
- Create a GitHub Action to run on new releases
- Add support for categorizing features by type
- Implement confidence scoring for feature detection

View File

@@ -0,0 +1,281 @@
#!/usr/bin/env python3
"""
Generate the '### Recent Major Features' markdown section for README from the changelog SQLite DB.
- Connects to cmd/generate_changelog/changelog.db
- Extracts version, date, and AI summaries from the 'versions' table
- Heuristically filters for feature/improvement items (excludes CI/CD/docs/bug fixes)
- Formats output to match README style:
- [vX.Y.Z](https://github.com/danielmiessler/fabric/releases/tag/vX.Y.Z) (Aug 14, 2025) — **Feature Name**: Short description
Usage:
python scripts/readme_updates/update_readme_features.py --limit 20
"""
import argparse
import sqlite3
from pathlib import Path
from datetime import datetime
import re
import sys
from typing import List, Optional, Tuple
# Heuristics for filtering feature-related lines
EXCLUDE_RE = re.compile(
r"(?i)\b(fix|bug|hotfix|ci|cd|pipeline|chore|docs|doc|readme|refactor|style|typo|"
"test|tests|bump|deps|dependency|merge|revert|format|lint|build|release\b|prepare|"
"codeowners|coverage|security)\b"
)
INCLUDE_RE = re.compile(
r"(?i)\b(new|feature|feat|add|added|introduce|enable|support|improve|enhance|"
"performance|speed|option|flag|argument|parameter|integration|provider|search|tts|"
"audio|model|cli|ui|web|oauth|sync|database|notifications|desktop|reasoning|thinking)\b"
)
def parse_args():
"""Parse command-line arguments."""
p = argparse.ArgumentParser(
description="Generate README 'Recent Major Features' markdown from changelog DB."
)
p.add_argument(
"--limit", type=int, default=20, help="Maximum number of releases to include."
)
p.add_argument(
"--db",
type=str,
default=None,
help="Optional path to changelog.db (defaults to repo cmd/generate_changelog/changelog.db)",
)
return p.parse_args()
def repo_root() -> Path:
"""Get the repository root directory."""
# scripts/readme_updates/update_readme_features.py -> repo root is parent.parent.parent
return Path(__file__).resolve().parent.parent.parent
def db_path(args) -> Path:
"""Determine the database path."""
if args.db:
return Path(args.db).expanduser().resolve()
return repo_root() / "cmd" / "generate_changelog" / "changelog.db"
def connect(dbfile: Path):
"""Connect to the SQLite database."""
if not dbfile.exists():
print(f"ERROR: changelog database not found: {dbfile}", file=sys.stderr)
sys.exit(1)
return sqlite3.connect(str(dbfile))
def normalize_version(name: str) -> str:
"""Ensure version string starts with 'v'."""
n = str(name).strip()
return n if n.startswith("v") else f"v{n}"
def parse_date(value) -> str:
"""Parse various date formats and return formatted string."""
if value is None:
return "(Unknown date)"
# Handle the ISO format with timezone from the database
s = str(value).strip()
# Try to parse the ISO format with timezone
if "+" in s or "T" in s:
# Remove timezone info and microseconds for simpler parsing
s_clean = s.split("+")[0].split(".")[0]
try:
dt = datetime.strptime(s_clean, "%Y-%m-%d %H:%M:%S")
return dt.strftime("%b %d, %Y").replace(" 0", " ")
except ValueError:
pass
# Fallback formats
fmts = [
"%Y-%m-%d",
"%Y-%m-%d %H:%M:%S",
"%Y-%m-%dT%H:%M:%S",
"%Y/%m/%d",
"%m/%d/%Y",
]
for fmt in fmts:
try:
dt = datetime.strptime(s, fmt)
return dt.strftime("%b %d, %Y").replace(" 0", " ")
except ValueError:
continue
# Return original if we can't parse it
return f"({s})"
def split_summary(text: str) -> List[str]:
"""Split AI summary into individual lines/bullets."""
if not text:
return []
lines = []
# Split by newlines first
for line in text.split("\n"):
line = line.strip()
if not line:
continue
# Remove markdown headers
line = re.sub(r"^#+\s+", "", line)
# Remove PR links and author info
line = re.sub(
r"^PR\s+\[#\d+\]\([^)]+\)\s+by\s+\[[^\]]+\]\([^)]+\):\s*", "", line
)
# Remove bullet points
line = re.sub(r"^[-*•]\s+", "", line)
if line:
lines.append(line)
return lines
def is_feature_line(line: str) -> bool:
"""Check if a line describes a feature/improvement (not a bug fix or CI/CD)."""
line_lower = line.lower()
# Strong exclusions first
if any(
word in line_lower
for word in ["chore:", "fix:", "docs:", "test:", "ci:", "build:", "refactor:"]
):
return False
if EXCLUDE_RE.search(line):
return False
return bool(INCLUDE_RE.search(line))
def extract_title_desc(line: str) -> Tuple[str, str]:
"""Extract title and description from a feature line."""
# Remove any markdown formatting
line = re.sub(r"\*\*([^*]+)\*\*", r"\1", line)
# Look for colon separator first
if ":" in line:
parts = line.split(":", 1)
if len(parts) == 2:
title = parts[0].strip()
desc = parts[1].strip()
# Clean up the title
title = (
title.replace("Introduce ", "")
.replace("Enable ", "")
.replace("Add ", "")
)
title = title.replace("Implement ", "").replace("Support ", "")
# Make title more concise
if len(title) > 30:
# Try to extract key words
key_words = []
for word in title.split():
if word[0].isupper() or "-" in word or "_" in word:
key_words.append(word)
if key_words:
title = " ".join(key_words[:3])
return (title, desc)
# Fallback: use first sentence as description
sentences = re.split(r"[.!?]\s+", line)
if sentences:
desc = sentences[0].strip()
# Extract a title from the description
if "thinking" in desc.lower():
return ("AI Reasoning", desc)
elif "token" in desc.lower() and "context" in desc.lower():
return ("Extended Context", desc)
elif "curl" in desc.lower() or "install" in desc.lower():
return ("Easy Setup", desc)
elif "vendor" in desc.lower() or "model" in desc.lower():
return ("Model Management", desc)
elif "notification" in desc.lower():
return ("Desktop Notifications", desc)
elif "tts" in desc.lower() or "speech" in desc.lower():
return ("Text-to-Speech", desc)
elif "oauth" in desc.lower() or "auth" in desc.lower():
return ("OAuth Auto-Auth", desc)
elif "search" in desc.lower() and "web" in desc.lower():
return ("Web Search", desc)
else:
# Generic title from first significant words
words = desc.split()[:2]
title = " ".join(words)
return (title, desc)
return ("Feature", line)
def pick_feature(ai_summary: str) -> Optional[Tuple[str, str]]:
"""Pick the best feature line from the AI summary."""
lines = split_summary(ai_summary)
# Look for the first feature line
for line in lines:
if is_feature_line(line):
title, desc = extract_title_desc(line)
# Clean up description - remove redundant info
desc = desc[:200] if len(desc) > 200 else desc # Limit length
return (title, desc)
return None
def build_item(
version: str, date_str: str, feature_title: str, feature_desc: str
) -> str:
"""Build a markdown list item for a release."""
url = f"https://github.com/danielmiessler/fabric/releases/tag/{version}"
return f"- [{version}]({url}) ({date_str}) — **{feature_title}**: {feature_desc}"
def main():
"""Main function."""
args = parse_args()
dbfile = db_path(args)
conn = connect(dbfile)
cur = conn.cursor()
# Query the database
cur.execute("SELECT name, date, ai_summary FROM versions ORDER BY date DESC")
rows = cur.fetchall()
items = []
for name, date, summary in rows:
version = normalize_version(name)
date_fmt = parse_date(date)
feat = pick_feature(summary or "")
if not feat:
continue
title, desc = feat
items.append(build_item(version, date_fmt, title, desc))
if len(items) >= args.limit:
break
conn.close()
# Output the markdown
print("### Recent Major Features")
print()
for item in items:
print(item)
if __name__ == "__main__":
main()

8
web/pnpm-lock.yaml generated
View File

@@ -941,8 +941,8 @@ packages:
resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==}
engines: {node: '>=8'}
devalue@5.1.1:
resolution: {integrity: sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==}
devalue@5.3.2:
resolution: {integrity: sha512-UDsjUbpQn9kvm68slnrs+mfxwFkIflOhkanmyabZ8zOYk8SMEIbJ3TK+88g70hSIeytu4y18f0z/hYHMTrXIWw==}
devlop@1.1.0:
resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
@@ -2704,7 +2704,7 @@ snapshots:
'@types/cookie': 0.6.0
acorn: 8.14.1
cookie: 1.0.2
devalue: 5.1.1
devalue: 5.3.2
esm-env: 1.2.2
kleur: 4.1.5
magic-string: 0.30.17
@@ -3060,7 +3060,7 @@ snapshots:
detect-libc@2.0.4:
optional: true
devalue@5.1.1: {}
devalue@5.3.2: {}
devlop@1.1.0:
dependencies:

View File

@@ -1332,14 +1332,6 @@
"DEVELOPMENT"
]
},
{
"patternName": "show_fabric_options_markmap",
"description": "Visualize Fabric capabilities using Markmap syntax.",
"tags": [
"VISUALIZE",
"DEVELOPMENT"
]
},
{
"patternName": "solve_with_cot",
"description": "Solve problems using chain-of-thought reasoning.",
@@ -1871,6 +1863,22 @@
"DEVELOPMENT",
"AI"
]
},
{
"patternName": "create_story_about_person",
"description": "Infer everyday challenges and realistic coping strategies from a psychological profile and craft an empathetic 500700-word story consistent with the character.",
"tags": [
"WRITING",
"SELF"
]
},
{
"patternName": "heal_person",
"description": "Analyze a psychological profile, pinpoint issues and strengths, and deliver compassionate, structured strategies for spiritual, mental, and life improvement.",
"tags": [
"ANALYSIS",
"SELF"
]
}
]
}