docs: slim down README and extract detailed docs to docs/
Move comprehensive documentation (settings, templates, output targets, frontmatter presets, etc.) from the 510-line README into 9 focused files under docs/. README is now a scannable overview with links to each doc. Replace GitHub links with Codeberg equivalents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cc2d196911
commit
e7243e3cc1
10 changed files with 468 additions and 471 deletions
500
README.md
500
README.md
|
|
@ -7,506 +7,64 @@
|
|||
[](LICENSE)
|
||||
[](package.json)
|
||||
|
||||
**The ultimate context management plugin for AI-powered Obsidian workflows.**
|
||||
|
||||
Copy your vault's conventions, structure, and content to any LLM with a single hotkey.
|
||||
Supports Claude, GPT-4, Gemini, and any other AI assistant.
|
||||
|
||||
[Features](#features) • [Installation](#installation) • [Quick Start](#quick-start) • [Documentation](#documentation)
|
||||
|
||||
---
|
||||
|
||||
<img src="https://img.shields.io/badge/Multi--LLM-Support-FF6B6B?style=for-the-badge" alt="Multi-LLM Support" />
|
||||
<img src="https://img.shields.io/badge/Smart-Truncation-4ECDC4?style=for-the-badge" alt="Smart Truncation" />
|
||||
<img src="https://img.shields.io/badge/Template-System-45B7D1?style=for-the-badge" alt="Template System" />
|
||||
<img src="https://img.shields.io/badge/Version-History-96CEB4?style=for-the-badge" alt="Version History" />
|
||||
**Copy your vault's conventions, structure, and content to any LLM with a single hotkey.**
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## The Problem
|
||||
|
||||
</div>
|
||||
|
||||
When working with AI assistants on your Obsidian vault, you constantly need to explain:
|
||||
|
||||
- How you organize files and folders
|
||||
- What link style you use (wikilinks vs markdown)
|
||||
- Your tag conventions and hierarchy
|
||||
- Your frontmatter requirements
|
||||
- Your workflows and processes
|
||||
|
||||
**This is repetitive, error-prone, and wastes tokens.** The AI forgets context between sessions, you forget to mention something, and inconsistencies creep in.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
When working with AI assistants on your Obsidian vault, you constantly re-explain your folder structure, link style, tag conventions, and frontmatter requirements. This is repetitive, error-prone, and wastes tokens.
|
||||
|
||||
## The Solution
|
||||
|
||||
</div>
|
||||
**Promptfire** stores your vault's conventions in a dedicated folder and copies everything to clipboard with one hotkey. Output adapts automatically for different LLMs (Claude, GPT-4, Gemini, etc.), and a built-in history tracks every context you generate.
|
||||
|
||||
**Promptfire** is a comprehensive context management system that:
|
||||
## Key Features
|
||||
|
||||
1. **Stores your vault's conventions** in a dedicated folder
|
||||
2. **Copies everything** to clipboard with one hotkey
|
||||
3. **Adapts output** for different LLMs (Claude, GPT-4, Gemini, etc.)
|
||||
4. **Tracks history** of generated contexts
|
||||
5. **Supports templates** for common prompt patterns
|
||||
- **Multi-LLM output targets** with per-model token limits, formats (XML, Markdown, Plain), and truncation strategies
|
||||
- **Prompt templates** with placeholders and conditionals for reusable workflows
|
||||
- **Additional context sources** from freetext, external files, or shell commands
|
||||
- **Frontmatter presets** to configure context per-note via `ai-context` YAML
|
||||
- **Granular section selection** to include only the headings you need
|
||||
- **Context history** with diff, search, and one-click restore
|
||||
- **Context generator** that walks you through setting up vault conventions
|
||||
|
||||
Paste the context into any AI chat, and the assistant immediately understands your vault.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## Features
|
||||
|
||||
</div>
|
||||
|
||||
### One-Click Context Copy
|
||||
|
||||
Press a hotkey or click the ribbon icon to copy all context files to clipboard. Output is formatted with clear separators and optional filename headers.
|
||||
|
||||
```markdown
|
||||
# === VAULT.md ===
|
||||
|
||||
Your vault conventions here...
|
||||
|
||||
---
|
||||
|
||||
# === structure.md ===
|
||||
|
||||
Your folder structure here...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Multi-LLM Output Targets
|
||||
|
||||
<div align="center">
|
||||
|
||||
| Target | Tokens | Format | Strategy |
|
||||
|--------|--------|--------|----------|
|
||||
| **Promptfire** | 200,000 | XML | Summarize headers |
|
||||
| **GPT-4o** | 128,000 | Markdown | Summarize headers |
|
||||
| **Compact** | 8,000 | Plain | Drop sections |
|
||||
|
||||
</div>
|
||||
|
||||
Configure multiple output targets with different:
|
||||
- **Token limits** - Automatic truncation to fit context windows
|
||||
- **Formats** - XML (best for Claude), Markdown, or Plain text
|
||||
- **Truncation strategies** - Smart prioritization keeps important content
|
||||
- **Wrappers** - Add `<context>...</context>` tags for structured prompts
|
||||
|
||||
**Primary target** goes to clipboard. **Secondary targets** are saved as files.
|
||||
|
||||
---
|
||||
|
||||
### Prompt Templates
|
||||
|
||||
Create reusable prompt templates that wrap around your context:
|
||||
|
||||
```markdown
|
||||
You are a code reviewer. Analyze the following context and provide feedback.
|
||||
|
||||
{{context}}
|
||||
|
||||
Focus on:
|
||||
- Code quality
|
||||
- Best practices
|
||||
- Potential bugs
|
||||
|
||||
{{#if activeNote}}
|
||||
The user is currently working on: {{activeNote}}
|
||||
{{/if}}
|
||||
```
|
||||
|
||||
**Available placeholders:**
|
||||
- `{{context}}` - The generated context
|
||||
- `{{activeNote}}` - Currently open note name
|
||||
- `{{activeNotePath}}` - Full path to active note
|
||||
- `{{date}}` - Current date (YYYY-MM-DD)
|
||||
- `{{time}}` - Current time (HH:MM)
|
||||
- `{{vaultName}}` - Your vault's name
|
||||
|
||||
**Conditionals:** `{{#if variable}}...{{else}}...{{/if}}`
|
||||
|
||||
---
|
||||
|
||||
### Additional Context Sources
|
||||
|
||||
Extend your context with content from outside the vault:
|
||||
|
||||
| Source Type | Description | Example |
|
||||
|-------------|-------------|---------|
|
||||
| **Freetext** | Custom text snippets | Project-specific instructions |
|
||||
| **External File** | Files outside the vault | `~/.config/rules.md` |
|
||||
| **Shell Command** | Command output | `git log --oneline -10` |
|
||||
|
||||
Sources can be positioned as **prefix** (before vault content) or **suffix** (after).
|
||||
|
||||
```
|
||||
# === PREFIX: Project Notes ===
|
||||
Custom context here...
|
||||
|
||||
---
|
||||
|
||||
# === VAULT.md ===
|
||||
Vault content...
|
||||
|
||||
---
|
||||
|
||||
# === SUFFIX: git log ===
|
||||
abc1234 feat: add new feature
|
||||
def5678 fix: resolve bug
|
||||
...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Granular Section Selection
|
||||
|
||||
Don't need the entire file? Select specific sections:
|
||||
|
||||
- Expand files to see their heading structure
|
||||
- Check/uncheck individual sections
|
||||
- See token counts per section
|
||||
- Reference syntax: `NoteName#Heading` or `NoteName^blockid`
|
||||
|
||||
Perfect for large context files where you only need specific parts.
|
||||
|
||||
---
|
||||
|
||||
### Context History
|
||||
|
||||
Track every context you generate:
|
||||
|
||||
- **Automatic saving** with timestamps
|
||||
- **Search and filter** past contexts
|
||||
- **Diff comparison** between versions
|
||||
- **One-click restore** to clipboard
|
||||
- **Configurable retention** (max entries, auto-cleanup)
|
||||
|
||||
Never lose track of what context you sent to which conversation.
|
||||
|
||||
---
|
||||
|
||||
### Frontmatter Presets
|
||||
|
||||
Define context configuration directly in your notes:
|
||||
|
||||
```yaml
|
||||
---
|
||||
ai-context:
|
||||
template: "code-review"
|
||||
include-linked: true
|
||||
link-depth: 2
|
||||
include-tags:
|
||||
- project/current
|
||||
exclude-paths:
|
||||
- archive/
|
||||
max-tokens: 50000
|
||||
---
|
||||
```
|
||||
|
||||
Then use **"Copy context from frontmatter preset"** - the plugin automatically:
|
||||
1. Reads the preset configuration
|
||||
2. Traverses linked notes (up to specified depth)
|
||||
3. Collects notes with matching tags
|
||||
4. Applies exclusions
|
||||
5. Fits within token budget
|
||||
6. Applies the specified template
|
||||
|
||||
**One hotkey, perfectly configured context.**
|
||||
|
||||
---
|
||||
|
||||
### Context Generator
|
||||
|
||||
Don't want to write context files manually? The generator walks you through:
|
||||
|
||||
<div align="center">
|
||||
|
||||
| Section | Options |
|
||||
|---------|---------|
|
||||
| **Language** | English, German |
|
||||
| **File Naming** | kebab-case, snake_case, camelCase, free |
|
||||
| **Link Style** | Wikilinks `[[note]]` or Markdown `[note](path)` |
|
||||
| **Tag Style** | Hierarchical `#area/tag`, Flat `#tag`, None |
|
||||
| **Frontmatter** | Required fields for all notes |
|
||||
| **Rules** | Custom conventions and forbidden actions |
|
||||
| **Structure** | Auto-detected folders with purpose descriptions |
|
||||
| **Templates** | Note templates with target folders |
|
||||
|
||||
</div>
|
||||
|
||||
Click **"Generate"** and your context files are created instantly.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## Installation
|
||||
|
||||
</div>
|
||||
|
||||
### From Community Plugins (Recommended)
|
||||
|
||||
1. Open **Settings > Community Plugins**
|
||||
2. Click **Browse** and search for "Promptfire"
|
||||
3. Click **Install**, then **Enable**
|
||||
|
||||
### From Source
|
||||
|
||||
```bash
|
||||
# Clone into your vault's plugins folder
|
||||
cd /path/to/vault/.obsidian/plugins
|
||||
git clone https://github.com/yourusername/obsidian-promptfire.git promptfire
|
||||
|
||||
# Install and build
|
||||
cd promptfire
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
# Enable in Obsidian Settings > Community Plugins
|
||||
```
|
||||
|
||||
### Development
|
||||
|
||||
```bash
|
||||
npm run dev # Watch mode with hot reload
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
See the [full documentation](docs/) for details on each feature.
|
||||
|
||||
## Quick Start
|
||||
|
||||
</div>
|
||||
|
||||
### 1. Generate Context Files
|
||||
|
||||
**1. Generate context files**
|
||||
```
|
||||
Ctrl+P > "Promptfire: Generate context files"
|
||||
```
|
||||
|
||||
Configure your preferences and click **Generate**.
|
||||
|
||||
### 2. Add Built-in Targets
|
||||
|
||||
Go to **Settings > Promptfire > Output Targets** and click **"Add Built-in Targets"**.
|
||||
|
||||
### 3. Copy Context
|
||||
**2. Add output targets**
|
||||
Settings > Promptfire > Output Targets > "Add Built-in Targets"
|
||||
|
||||
**3. Copy & paste**
|
||||
```
|
||||
Ctrl+P > "Promptfire: Copy context to clipboard"
|
||||
```
|
||||
|
||||
Or click the clipboard ribbon icon.
|
||||
|
||||
### 4. Paste into AI Chat
|
||||
|
||||
The context is now in your clipboard. Paste it into Claude, ChatGPT, or any AI assistant.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
Paste into Claude, ChatGPT, or any AI assistant.
|
||||
|
||||
## Documentation
|
||||
|
||||
</div>
|
||||
|
||||
### Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| **Copy context to clipboard** | Copy all context files |
|
||||
| **Copy context with current note** | Copy context + active note |
|
||||
| **Copy context (select sections)** | Choose specific headings |
|
||||
| **Copy context from frontmatter preset** | Use note's ai-context config |
|
||||
| **Generate context files** | Open the generator |
|
||||
| **View context history** | Browse past contexts |
|
||||
|
||||
### Settings
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| **Context folder** | Folder with context files | `_context` |
|
||||
| **Separator** | Text between files | `---` |
|
||||
| **Include filenames** | Add `# === file.md ===` headers | On |
|
||||
| **Show preview** | Preview before copying | Off |
|
||||
| **Include active note** | Always append current note | Off |
|
||||
| **Excluded files** | Files to skip | - |
|
||||
|
||||
### Context Sources
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Freetext** | Static text snippets |
|
||||
| **External File** | Absolute path to file outside vault |
|
||||
| **Shell Command** | Command + args with timeout |
|
||||
| **Position** | Prefix (before) or Suffix (after) vault content |
|
||||
| **Show labels** | Add source name headers to output |
|
||||
|
||||
### Prompt Templates
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Name** | Display name |
|
||||
| **Content** | Template with placeholders |
|
||||
| **Default** | Use automatically when copying |
|
||||
|
||||
### History
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| **Enabled** | Save generated contexts | On |
|
||||
| **Storage folder** | Where to store history | `.context-history` |
|
||||
| **Max entries** | Limit stored entries | 50 |
|
||||
| **Auto-cleanup** | Delete after X days | 30 |
|
||||
|
||||
### Output Targets
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Name** | Display name (e.g., "Claude", "GPT-4") |
|
||||
| **Max tokens** | Token limit for truncation |
|
||||
| **Format** | markdown, xml, or plain |
|
||||
| **Strategy** | summarize-headers, drop-sections, truncate |
|
||||
| **Wrapper** | Prefix/suffix text around content |
|
||||
| **Primary** | Which target goes to clipboard |
|
||||
| **Output folder** | Where to save secondary targets |
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
</div>
|
||||
|
||||
### Truncation Strategies
|
||||
|
||||
When content exceeds token limits:
|
||||
|
||||
| Strategy | Behavior |
|
||||
|----------|----------|
|
||||
| **summarize-headers** | Keep headers, summarize content. Best for structure preservation. |
|
||||
| **drop-sections** | Remove low-priority sections entirely. Keeps high-priority complete. |
|
||||
| **truncate** | Simple cut-off. Fast but loses structure. |
|
||||
|
||||
### Priority Order
|
||||
|
||||
Sections are prioritized for truncation:
|
||||
|
||||
1. **VAULT.md** - Never truncated (highest priority)
|
||||
2. **context** files - High priority
|
||||
3. **conventions** - High priority
|
||||
4. **structure** - Medium priority
|
||||
5. **Active note** - Medium priority
|
||||
6. **examples, templates** - Low priority (truncated first)
|
||||
|
||||
### Frontmatter Preset Options
|
||||
|
||||
```yaml
|
||||
ai-context:
|
||||
# Apply a saved template by name
|
||||
template: "code-review"
|
||||
|
||||
# Include linked notes
|
||||
include-linked: true
|
||||
link-depth: 2 # How deep to traverse (0-10)
|
||||
|
||||
# Include notes with these tags
|
||||
include-tags:
|
||||
- project/myproject
|
||||
- status/active
|
||||
|
||||
# Exclude paths
|
||||
exclude-paths:
|
||||
- archive/
|
||||
- templates/
|
||||
|
||||
# Exclude notes with these tags
|
||||
exclude-tags:
|
||||
- draft
|
||||
- private
|
||||
|
||||
# Token budget
|
||||
max-tokens: 50000
|
||||
|
||||
# Include the note itself
|
||||
include-active-note: true
|
||||
```
|
||||
|
||||
### XML Format (Claude Optimized)
|
||||
|
||||
When using XML format, files are wrapped in tags:
|
||||
|
||||
```xml
|
||||
<context>
|
||||
<file name="VAULT.md">
|
||||
Your vault conventions here...
|
||||
</file>
|
||||
|
||||
<file name="structure.md">
|
||||
Your folder structure here...
|
||||
</file>
|
||||
</context>
|
||||
```
|
||||
|
||||
This format is especially effective with Claude models.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
| Topic | Description |
|
||||
|-------|-------------|
|
||||
| [Getting Started](docs/getting-started.md) | Installation, first run, commands |
|
||||
| [Output Targets](docs/output-targets.md) | Multi-LLM formats and truncation |
|
||||
| [Templates](docs/templates.md) | Prompt templates, placeholders, conditionals |
|
||||
| [Context Sources](docs/context-sources.md) | Freetext, file, and shell sources |
|
||||
| [Frontmatter Presets](docs/frontmatter-presets.md) | Per-note ai-context YAML configuration |
|
||||
| [Section Selection](docs/section-selection.md) | Granular heading and block selection |
|
||||
| [History](docs/history.md) | Context history, diff, and restore |
|
||||
| [Settings](docs/settings.md) | Full settings reference |
|
||||
| [Advanced](docs/advanced.md) | Truncation strategies, priority order, XML format |
|
||||
|
||||
## Contributing
|
||||
|
||||
</div>
|
||||
|
||||
Contributions are welcome! Please:
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch
|
||||
3. Make your changes
|
||||
4. Run `npm run build` to verify
|
||||
5. Submit a pull request
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
Contributions welcome! Fork the repo, create a feature branch, run `npm run build` to verify, and submit a pull request. Report bugs and request features via [Codeberg Issues](https://codeberg.org/luca-tty/obsidian-promptfire/issues).
|
||||
|
||||
## License
|
||||
|
||||
</div>
|
||||
|
||||
MIT License - see [LICENSE](LICENSE) for details.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
## Support
|
||||
|
||||
</div>
|
||||
|
||||
- **Bug reports:** [GitHub Issues](https://github.com/yourusername/obsidian-promptfire/issues)
|
||||
- **Feature requests:** [GitHub Discussions](https://github.com/yourusername/obsidian-promptfire/discussions)
|
||||
- **Documentation:** [Wiki](https://github.com/yourusername/obsidian-promptfire/wiki)
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
**Made with care for the Obsidian community**
|
||||
|
||||
If this plugin helps your AI workflow, consider starring the repository!
|
||||
|
||||
</div>
|
||||
|
|
|
|||
56
docs/advanced.md
Normal file
56
docs/advanced.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# Advanced Usage
|
||||
|
||||
## Truncation Strategies
|
||||
|
||||
When content exceeds a target's token limit, Promptfire applies one of three strategies:
|
||||
|
||||
| Strategy | Behavior |
|
||||
|----------|----------|
|
||||
| **summarize-headers** | Keep headers, summarize content. Best for structure preservation. |
|
||||
| **drop-sections** | Remove low-priority sections entirely. Keeps high-priority content complete. |
|
||||
| **truncate** | Simple cut-off. Fast but loses structure. |
|
||||
|
||||
## Priority Order
|
||||
|
||||
Sections are prioritized during truncation (highest to lowest):
|
||||
|
||||
1. **VAULT.md** - Never truncated (highest priority)
|
||||
2. **context** files - High priority
|
||||
3. **conventions** - High priority
|
||||
4. **structure** - Medium priority
|
||||
5. **Active note** - Medium priority
|
||||
6. **examples, templates** - Low priority (truncated first)
|
||||
|
||||
## XML Format (Claude Optimized)
|
||||
|
||||
When using XML format, files are wrapped in tags:
|
||||
|
||||
```xml
|
||||
<context>
|
||||
<file name="VAULT.md">
|
||||
Your vault conventions here...
|
||||
</file>
|
||||
|
||||
<file name="structure.md">
|
||||
Your folder structure here...
|
||||
</file>
|
||||
</context>
|
||||
```
|
||||
|
||||
This format is especially effective with Claude models, as they handle structured XML well within their context window.
|
||||
|
||||
## One-Click Context Copy
|
||||
|
||||
Output is formatted with clear separators and optional filename headers:
|
||||
|
||||
```markdown
|
||||
# === VAULT.md ===
|
||||
|
||||
Your vault conventions here...
|
||||
|
||||
---
|
||||
|
||||
# === structure.md ===
|
||||
|
||||
Your folder structure here...
|
||||
```
|
||||
44
docs/context-sources.md
Normal file
44
docs/context-sources.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Context Sources
|
||||
|
||||
Extend your context with content from outside the vault.
|
||||
|
||||
## Source Types
|
||||
|
||||
| Source Type | Description | Example |
|
||||
|-------------|-------------|---------|
|
||||
| **Freetext** | Custom text snippets | Project-specific instructions |
|
||||
| **External File** | Files outside the vault | `~/.config/rules.md` |
|
||||
| **Shell Command** | Command output | `git log --oneline -10` |
|
||||
|
||||
## Positioning
|
||||
|
||||
Sources can be positioned as **prefix** (before vault content) or **suffix** (after vault content).
|
||||
|
||||
### Example Output
|
||||
|
||||
```
|
||||
# === PREFIX: Project Notes ===
|
||||
Custom context here...
|
||||
|
||||
---
|
||||
|
||||
# === VAULT.md ===
|
||||
Vault content...
|
||||
|
||||
---
|
||||
|
||||
# === SUFFIX: git log ===
|
||||
abc1234 feat: add new feature
|
||||
def5678 fix: resolve bug
|
||||
...
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Freetext** | Static text snippets |
|
||||
| **External File** | Absolute path to file outside vault |
|
||||
| **Shell Command** | Command + args with timeout |
|
||||
| **Position** | Prefix (before) or Suffix (after) vault content |
|
||||
| **Show labels** | Add source name headers to output |
|
||||
65
docs/frontmatter-presets.md
Normal file
65
docs/frontmatter-presets.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# Frontmatter Presets
|
||||
|
||||
Define context configuration directly in your notes using `ai-context` frontmatter.
|
||||
|
||||
## Basic Usage
|
||||
|
||||
Add an `ai-context` block to any note's frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
ai-context:
|
||||
template: "code-review"
|
||||
include-linked: true
|
||||
link-depth: 2
|
||||
include-tags:
|
||||
- project/current
|
||||
exclude-paths:
|
||||
- archive/
|
||||
max-tokens: 50000
|
||||
---
|
||||
```
|
||||
|
||||
Then use **"Copy context from frontmatter preset"** (via Command Palette) and the plugin automatically:
|
||||
|
||||
1. Reads the preset configuration
|
||||
2. Traverses linked notes (up to specified depth)
|
||||
3. Collects notes with matching tags
|
||||
4. Applies exclusions
|
||||
5. Fits within token budget
|
||||
6. Applies the specified template
|
||||
|
||||
**One hotkey, perfectly configured context.**
|
||||
|
||||
## All Options
|
||||
|
||||
```yaml
|
||||
ai-context:
|
||||
# Apply a saved template by name
|
||||
template: "code-review"
|
||||
|
||||
# Include linked notes
|
||||
include-linked: true
|
||||
link-depth: 2 # How deep to traverse (0-10)
|
||||
|
||||
# Include notes with these tags
|
||||
include-tags:
|
||||
- project/myproject
|
||||
- status/active
|
||||
|
||||
# Exclude paths
|
||||
exclude-paths:
|
||||
- archive/
|
||||
- templates/
|
||||
|
||||
# Exclude notes with these tags
|
||||
exclude-tags:
|
||||
- draft
|
||||
- private
|
||||
|
||||
# Token budget
|
||||
max-tokens: 50000
|
||||
|
||||
# Include the note itself
|
||||
include-active-note: true
|
||||
```
|
||||
80
docs/getting-started.md
Normal file
80
docs/getting-started.md
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
# Getting Started
|
||||
|
||||
## Installation
|
||||
|
||||
### From Community Plugins (Recommended)
|
||||
|
||||
1. Open **Settings > Community Plugins**
|
||||
2. Click **Browse** and search for "Promptfire"
|
||||
3. Click **Install**, then **Enable**
|
||||
|
||||
### From Source
|
||||
|
||||
```bash
|
||||
# Clone into your vault's plugins folder
|
||||
cd /path/to/vault/.obsidian/plugins
|
||||
git clone https://codeberg.org/luca-tty/obsidian-promptfire.git promptfire
|
||||
|
||||
# Install and build
|
||||
cd promptfire
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
# Enable in Obsidian Settings > Community Plugins
|
||||
```
|
||||
|
||||
### Development
|
||||
|
||||
```bash
|
||||
npm run dev # Watch mode with hot reload
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Generate Context Files
|
||||
|
||||
```
|
||||
Ctrl+P > "Promptfire: Generate context files"
|
||||
```
|
||||
|
||||
The generator walks you through configuring your vault conventions:
|
||||
|
||||
| Section | Options |
|
||||
|---------|---------|
|
||||
| **Language** | English, German |
|
||||
| **File Naming** | kebab-case, snake_case, camelCase, free |
|
||||
| **Link Style** | Wikilinks `[[note]]` or Markdown `[note](path)` |
|
||||
| **Tag Style** | Hierarchical `#area/tag`, Flat `#tag`, None |
|
||||
| **Frontmatter** | Required fields for all notes |
|
||||
| **Rules** | Custom conventions and forbidden actions |
|
||||
| **Structure** | Auto-detected folders with purpose descriptions |
|
||||
| **Templates** | Note templates with target folders |
|
||||
|
||||
Click **"Generate"** and your context files are created instantly.
|
||||
|
||||
### 2. Add Built-in Targets
|
||||
|
||||
Go to **Settings > Promptfire > Output Targets** and click **"Add Built-in Targets"**.
|
||||
|
||||
### 3. Copy Context
|
||||
|
||||
```
|
||||
Ctrl+P > "Promptfire: Copy context to clipboard"
|
||||
```
|
||||
|
||||
Or click the clipboard ribbon icon.
|
||||
|
||||
### 4. Paste into AI Chat
|
||||
|
||||
The context is now in your clipboard. Paste it into Claude, ChatGPT, or any AI assistant.
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| **Copy context to clipboard** | Copy all context files |
|
||||
| **Copy context with current note** | Copy context + active note |
|
||||
| **Copy context (select sections)** | Choose specific headings |
|
||||
| **Copy context from frontmatter preset** | Use note's ai-context config |
|
||||
| **Generate context files** | Open the generator |
|
||||
| **View context history** | Browse past contexts |
|
||||
30
docs/history.md
Normal file
30
docs/history.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Context History
|
||||
|
||||
Track every context you generate over time.
|
||||
|
||||
## Features
|
||||
|
||||
- **Automatic saving** - Every generated context is saved with a timestamp
|
||||
- **Search and filter** - Find past contexts quickly
|
||||
- **Diff comparison** - Compare versions to see what changed
|
||||
- **One-click restore** - Copy any past context back to clipboard
|
||||
- **Configurable retention** - Control storage limits and auto-cleanup
|
||||
|
||||
## Settings
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| **Enabled** | Save generated contexts | On |
|
||||
| **Storage folder** | Where to store history | `.context-history` |
|
||||
| **Max entries** | Limit stored entries | 50 |
|
||||
| **Auto-cleanup** | Delete after X days | 30 |
|
||||
|
||||
## Usage
|
||||
|
||||
Open history via:
|
||||
|
||||
```
|
||||
Ctrl+P > "Promptfire: View context history"
|
||||
```
|
||||
|
||||
Browse, search, compare, and restore any previous context.
|
||||
32
docs/output-targets.md
Normal file
32
docs/output-targets.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Output Targets
|
||||
|
||||
Promptfire supports multiple output targets so you can tailor context for different LLMs.
|
||||
|
||||
## Built-in Targets
|
||||
|
||||
| Target | Tokens | Format | Strategy |
|
||||
|--------|--------|--------|----------|
|
||||
| **Promptfire** | 200,000 | XML | Summarize headers |
|
||||
| **GPT-4o** | 128,000 | Markdown | Summarize headers |
|
||||
| **Compact** | 8,000 | Plain | Drop sections |
|
||||
|
||||
## Configuration
|
||||
|
||||
Each target can be configured with:
|
||||
|
||||
- **Name** - Display name (e.g., "Claude", "GPT-4")
|
||||
- **Max tokens** - Token limit for truncation
|
||||
- **Format** - `markdown`, `xml`, or `plain`
|
||||
- **Strategy** - `summarize-headers`, `drop-sections`, `truncate`
|
||||
- **Wrapper** - Prefix/suffix text around content (e.g., `<context>...</context>`)
|
||||
|
||||
## Primary vs Secondary Targets
|
||||
|
||||
- **Primary target** output goes to your clipboard.
|
||||
- **Secondary targets** are saved as files in the configured output folder.
|
||||
|
||||
This lets you generate context for multiple LLMs in a single action.
|
||||
|
||||
## Output Folder
|
||||
|
||||
Configure where secondary target files are saved in **Settings > Promptfire > Output Targets**.
|
||||
20
docs/section-selection.md
Normal file
20
docs/section-selection.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Section Selection
|
||||
|
||||
Select specific sections from your context files instead of including everything.
|
||||
|
||||
## How It Works
|
||||
|
||||
Use the command **"Copy context (select sections)"** to:
|
||||
|
||||
- Expand files to see their heading structure
|
||||
- Check/uncheck individual sections
|
||||
- See token counts per section
|
||||
|
||||
## Reference Syntax
|
||||
|
||||
- `NoteName#Heading` - Reference a specific heading
|
||||
- `NoteName^blockid` - Reference a specific block
|
||||
|
||||
## When to Use
|
||||
|
||||
Section selection is useful for large context files where you only need specific parts. Instead of copying your entire vault conventions, pick just the sections relevant to your current task.
|
||||
61
docs/settings.md
Normal file
61
docs/settings.md
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# Settings Reference
|
||||
|
||||
Complete reference of all Promptfire settings.
|
||||
|
||||
## General
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| **Context folder** | Folder with context files | `_context` |
|
||||
| **Separator** | Text between files | `---` |
|
||||
| **Include filenames** | Add `# === file.md ===` headers | On |
|
||||
| **Show preview** | Preview before copying | Off |
|
||||
| **Include active note** | Always append current note | Off |
|
||||
| **Excluded files** | Files to skip | - |
|
||||
|
||||
## Context Sources
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Freetext** | Static text snippets |
|
||||
| **External File** | Absolute path to file outside vault |
|
||||
| **Shell Command** | Command + args with timeout |
|
||||
| **Position** | Prefix (before) or Suffix (after) vault content |
|
||||
| **Show labels** | Add source name headers to output |
|
||||
|
||||
See [Context Sources](context-sources.md) for detailed usage.
|
||||
|
||||
## Prompt Templates
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Name** | Display name |
|
||||
| **Content** | Template with placeholders |
|
||||
| **Default** | Use automatically when copying |
|
||||
|
||||
See [Templates](templates.md) for placeholders and conditionals.
|
||||
|
||||
## History
|
||||
|
||||
| Setting | Description | Default |
|
||||
|---------|-------------|---------|
|
||||
| **Enabled** | Save generated contexts | On |
|
||||
| **Storage folder** | Where to store history | `.context-history` |
|
||||
| **Max entries** | Limit stored entries | 50 |
|
||||
| **Auto-cleanup** | Delete after X days | 30 |
|
||||
|
||||
See [History](history.md) for more details.
|
||||
|
||||
## Output Targets
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Name** | Display name (e.g., "Claude", "GPT-4") |
|
||||
| **Max tokens** | Token limit for truncation |
|
||||
| **Format** | markdown, xml, or plain |
|
||||
| **Strategy** | summarize-headers, drop-sections, truncate |
|
||||
| **Wrapper** | Prefix/suffix text around content |
|
||||
| **Primary** | Which target goes to clipboard |
|
||||
| **Output folder** | Where to save secondary targets |
|
||||
|
||||
See [Output Targets](output-targets.md) for format details and strategies.
|
||||
51
docs/templates.md
Normal file
51
docs/templates.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Prompt Templates
|
||||
|
||||
Create reusable prompt templates that wrap around your generated context.
|
||||
|
||||
## Example Template
|
||||
|
||||
```markdown
|
||||
You are a code reviewer. Analyze the following context and provide feedback.
|
||||
|
||||
{{context}}
|
||||
|
||||
Focus on:
|
||||
- Code quality
|
||||
- Best practices
|
||||
- Potential bugs
|
||||
|
||||
{{#if activeNote}}
|
||||
The user is currently working on: {{activeNote}}
|
||||
{{/if}}
|
||||
```
|
||||
|
||||
## Available Placeholders
|
||||
|
||||
| Placeholder | Description |
|
||||
|-------------|-------------|
|
||||
| `{{context}}` | The generated context |
|
||||
| `{{activeNote}}` | Currently open note name |
|
||||
| `{{activeNotePath}}` | Full path to active note |
|
||||
| `{{date}}` | Current date (YYYY-MM-DD) |
|
||||
| `{{time}}` | Current time (HH:MM) |
|
||||
| `{{vaultName}}` | Your vault's name |
|
||||
|
||||
## Conditionals
|
||||
|
||||
Use conditionals to include content only when a variable is available:
|
||||
|
||||
```
|
||||
{{#if variable}}
|
||||
Content shown when variable exists
|
||||
{{else}}
|
||||
Fallback content
|
||||
{{/if}}
|
||||
```
|
||||
|
||||
## Settings
|
||||
|
||||
| Setting | Description |
|
||||
|---------|-------------|
|
||||
| **Name** | Display name for the template |
|
||||
| **Content** | Template body with placeholders |
|
||||
| **Default** | Use this template automatically when copying |
|
||||
Loading…
Reference in a new issue