docs/StrategyEngine/05-ConfigurationFormat.md
Strategy files use Markdown with YAML frontmatter.
Recommended extension:
.strategy.md
The body after the second --- is the Strategy user prompt body.
---
schema: everywhere.strategy/v1
id: user.example
name: "Example"
---
Prompt body here.
One file defines one Strategy. Multiple Strategies in one file are not supported.
YAML implementation choice:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
schema | string | No | everywhere.strategy/v1 | Strategy schema version. |
id | string | No | provider-derived | Stable Strategy ID. |
from | string or object | No | null | Single source to derive from. |
enabled | bool | No | true | Whether this Strategy participates in matching. |
name | string | Yes after normalization | source/provider-derived | Display name. |
description | string | No | null | Tooltip/subtitle. |
icon | string | No | null | Icon identifier, preferably Lucide icon name. |
priority | int | No | 0 | Higher appears earlier. |
when | condition object | No | true | Recommendation condition. |
tools | map string -> bool | No | null | ToolRulesets override for this Strategy. |
preprocessors | string[] | No | [] | Predefined preprocessors to run at execution. |
systemPrompt | string | No | null | System prompt override for this request. |
options | object | No | defaults | Matching/runtime options. |
| body | markdown | No | null/source body | User prompt body. |
name is required after from resolution. A raw file may omit name if its from source provides one.
fromfrom derives the current Strategy from one source.
Short form:
from: ./SKILL.md
Expanded form:
from:
source: ./SKILL.md
kind: auto
Allowed kind values:
auto
skill
strategy
markdown
url
Rules:
from is allowed.from is include-like: final output may look merged, but the source reference is preserved.from should be rejected in v1.Examples:
from: skill://my-writing-style
from:
source: E:\Everywhere\Strategies\BaseReview.strategy.md
kind: strategy
from:
source: https://example.com/strategies/research.strategy.md
kind: url
URL support is interface-ready. A v1 implementation may reject URL loading unless a network resolver is explicitly enabled.
Examples:
id: user.file-manager.summarize-selection
id: workspace.review-current-file
Rules:
builtin is a namespace assigned by the builtin provider, not by user-authored files.builtin.*.id: builtin.foo, prefer rejecting it with a validation diagnostic.enabled: true
Disabled Strategies are loaded for editing/diagnostics but skipped during matching.
name: "Summarize selected files"
description: "Summarize files selected in the file manager"
icon: FileText
priority: 80
icon should initially use names that map to existing app icon support, preferably Lucide icon names. Invalid icons should fall back to a default icon and produce a validation warning.
whenwhen controls whether a Strategy is recommended.
If absent:
when: true
Explicit true/false:
when: true
when: false
Composite conditions:
when:
all:
- attachments.selection.text:
length:
min: 1
- none:
- clipboard.text:
contains: "secret"
Supported composite operators:
all
any
none
All conditions evaluate to bool?, and only root true recommends the Strategy.
A path condition maps a context path to an operator object.
when:
all:
- extra.file_manager.selection.items:
count:
min: 1
Supported root paths:
attachments
visual
clipboard
assistant
environment
extra
Examples:
environment.os:
equals: "windows"
extra.browser.active_tab.url:
startsWith: "https://arxiv.org/"
attachments.selection.text:
regex: "\\bTODO\\b"
Full set:
equals: "value"
in: ["a", "b"]
contains: "value"
startsWith: "prefix"
endsWith: "suffix"
regex: "pattern"
glob: "*.pdf"
caseSensitive: true
Rules:
caseSensitive: true makes supported string operations case-sensitive.options.regexTimeout.null.String length:
attachments.selection.text:
length:
min: 1
max: 5000
Array count:
extra.file_manager.selection.items:
count:
min: 1
max: 20
Numeric:
extra.file_manager.selection.items:
any:
size:
max: 10485760
Supported numeric shape:
min: 0
max: 100
equals: 5
Array any:
extra.file_manager.selection.items:
any:
extension:
in: [".pdf", ".docx", ".txt"]
Array all:
extra.file_manager.selection.items:
all:
kind:
equals: "file"
Array none:
extra.file_manager.selection.items:
none:
extension:
in: [".exe", ".bat", ".cmd", ".ps1"]
Inside array operators, paths are relative to each item.
Recommended v1 paths:
attachments.files
attachments.files[].path
attachments.files[].mimeType
attachments.files[].extension
attachments.selection.text
attachments.text
attachments.visual.primary
attachments.visual.items
Examples:
attachments.files:
count:
min: 1
attachments.files:
any:
extension:
equals: ".png"
Recommended v1 paths:
clipboard.text
clipboard.hasText
clipboard.hasImage
clipboard.files
Example:
clipboard.text:
length:
min: 1
Clipboard paths can be read before matching. The Strategy details UI should disclose clipboard access.
Recommended v1 paths:
assistant.id
assistant.name
assistant.model.id
assistant.model.modalities
assistant.model.supportsToolCall
Example:
assistant.model.modalities:
contains: "image"
Recommended v1 paths:
environment.os
environment.architecture
environment.locale
environment.timeZone
environment.currentDate
Example:
environment.os:
in: ["windows", "macos"]
extra is the user-facing namespace for context collected by extra providers.
Public schema:
extra.file_manager.current_folder.path
extra.file_manager.current_folder.displayName
extra.file_manager.selection.items
extra.file_manager.selection.items[].path
extra.file_manager.selection.items[].displayName
extra.file_manager.selection.items[].kind
extra.file_manager.selection.items[].extension
extra.file_manager.selection.items[].size
Example:
extra.file_manager.selection.items:
any:
extension:
in: [".pdf", ".docx"]
Recommended future schema:
extra.browser.active_tab.url
extra.browser.active_tab.title
extra.browser.active_tab.domain
Example:
extra.browser.active_tab.url:
startsWith: "https://arxiv.org/"
Recommended future schema:
extra.workspace.root
extra.workspace.name
extra.workspace.git.branch
extra.workspace.git.hasChanges
v1 visual condition types:
visual.exists
visual.count
visual.match
visual.existsvisual.exists:
query: "//TopLevel//Button[@name='Save']"
Returns true if at least one element matches.
visual.countvisual.count:
query: "//ListViewItem[@selected=true]"
min: 1
max: 5
Returns true if the count is within range.
visual.matchvisual.match:
query: "//TopLevel/@name"
contains: "Visual Studio"
The query must select attribute values. The rest of the object uses normal string/numeric/bool operators.
Supported examples:
//Button
/TopLevel/Panel/Button
.//TextEdit[@focused=true]
//TopLevel/@name
//ListViewItem[@selected=true]
//Button[contains(@name,'Save')]
//Document[matches(@text,'error|warning')]
Supported concepts:
| Syntax | Meaning |
|---|---|
//Type | Descendant search by visual element type. |
/ | Strict parent-child step. |
. | Current primary visual element. |
* | Any element type. |
@name | Name attribute. |
@text | Text content, read only when explicitly requested. |
@process | Owning process name. |
@selected | Selected state. |
@focused | Focused state. |
@disabled | Disabled state. |
@readonly | Read-only state. |
@offscreen | Offscreen state. |
@password | Password state. |
@bounds.x | Bounds X. |
@bounds.y | Bounds Y. |
@bounds.width | Bounds width. |
@bounds.height | Bounds height. |
contains(@name,'x') | String contains. |
matches(@text,'regex') | Regex match. |
Not supported in v1:
//Button[3].tools uses the existing ToolRulesets format.
tools:
builtin.web.*: true
builtin.web.web_search: false
builtin.filesystem.read_file: true
Keys are plugin or plugin-function glob patterns. Values are booleans.
preprocessors:
- selected-text
- file-manager-selection
Rules:
Short form:
systemPrompt: "You are an expert translator."
Block form:
systemPrompt: |
You are an expert translator.
Preserve formatting when possible.
It supports the same variable interpolation as body.
All runtime options live under options.
options:
matchingTimeout: 300ms
conditionTimeout: 80ms
regexTimeout: 50ms
visualQueryTimeout: 120ms
extraTimeout: 200ms
Recommended defaults:
| Field | Default | Meaning |
|---|---|---|
matchingTimeout | 300ms | Total budget for evaluating one Strategy. |
conditionTimeout | 80ms | Budget for one condition node. |
regexTimeout | 50ms | Budget for one regex operation. |
visualQueryTimeout | 120ms | Budget for one visual query. |
extraTimeout | 200ms | Budget for one extra provider call. |
Durations support:
ms
s
Invalid durations are validation errors.
The markdown body is the user prompt template.
Please explain the selected text:
{attachments.selection.text}
Variable rules:
{path.to.value}.{Argument} remains supported for compatibility.---
schema: everywhere.strategy/v1
id: user.file-manager.summarize-selection
name: "Summarize selected files"
description: "Summarize files selected in the file manager"
icon: FileText
priority: 80
when:
all:
- extra.file_manager.selection.items:
count:
min: 1
- extra.file_manager.selection.items:
any:
extension:
in: [".pdf", ".docx", ".txt", ".md"]
tools:
builtin.filesystem.read_file: true
builtin.web.*: false
preprocessors:
- file-manager-selection
options:
matchingTimeout: 300ms
conditionTimeout: 80ms
regexTimeout: 50ms
visualQueryTimeout: 120ms
extraTimeout: 200ms
---
Please summarize the selected files:
{extra.file_manager.selection.items}
---
schema: everywhere.strategy/v1
id: user.browser.arxiv-summary
name: "Summarize arXiv paper"
description: "Summarize the currently open arXiv paper"
icon: FileText
priority: 90
when:
all:
- extra.browser.active_tab.url:
startsWith: "https://arxiv.org/"
preprocessors:
- browser-active-page
tools:
builtin.web.*: true
---
Summarize this arXiv paper:
URL: {extra.browser.active_tab.url}
Readable text:
{preprocess.browser.readable_text}
---
schema: everywhere.strategy/v1
id: user.writing.polite-rewrite
from: ./SKILL.md
name: "Polite rewrite"
description: "Rewrite selected text using my writing rules"
icon: PenLine
priority: 60
when:
all:
- attachments.selection.text:
length:
min: 1
---
Please rewrite this text politely and concisely:
{attachments.selection.text}
Because the body is present, it replaces the body loaded from SKILL.md. Other fields from the source are replaced by current fields when present.
---
schema: everywhere.strategy/v1
id: user.ide.explain-focused-editor
name: "Explain focused editor"
description: "Explain text in the focused editor"
icon: MessageSquareCode
priority: 70
when:
all:
- visual.exists:
query: ".//TextEdit[@focused=true]"
- visual.match:
query: "//TopLevel/@name"
contains: "Visual Studio"
---
Explain the current focused editor content:
{attachments.selection.text}
An implementation must validate:
schema is supported.id is valid or derivable.builtin..from has one source and no unsupported nested inheritance.enabled is bool.priority is int.when uses supported structure.tools is map string -> bool.preprocessors is string array and IDs exist when registry is known.options durations are valid.