main
md 40 lines 1.37 KB
Rendered Raw
1 # Prompt Include
2
3 Automatically inject persistent behavioral rules and preferences into the system prompt from project files.
4
5 ## What It Does
6
7 This plugin scans a workspace for `*.promptinclude.md` files, applies gitignore-aware filtering and token budgets, and makes the collected content available for prompt injection.
8
9 ## Main Behavior
10
11 - **Workspace scanning**
12 - Recursively searches for files matching `*.promptinclude.md`.
13 - **Ignore support**
14 - Respects ignore patterns derived from gitignore-style content.
15 - **Budgeted inclusion**
16 - Applies per-file and total token limits.
17 - Crops oversized files when they partially fit within the remaining token budget.
18 - **Structured scan result**
19 - Returns included file content together with path, token count, status, and skipped count.
20
21 ## Key Files
22
23 - **Scanner**
24 - `helpers/scanner.py` implements file discovery, ignore handling, token budgeting, and trimming.
25 - **Configuration**
26 - `default_config.yaml` contains prompt-include scanning defaults.
27 - **Prompts and UI**
28 - `prompts/` and `webui/` provide integration with the broader app.
29
30 ## Configuration Scope
31
32 - **Settings section**: `agent`
33 - **Per-project config**: `true`
34 - **Per-agent config**: `true`
35
36 ## Plugin Metadata
37
38 - **Name**: `_promptinclude`
39 - **Title**: `Prompt Include`
40 - **Description**: Persistent behavioral rules and preferences auto-injected into system prompt.