tokf-filter

Featured

This skill should be used when the user asks to "create a filter", "write a tokf filter", "add a filter for <tool>", "how do I filter output", or needs guidance on tokf filter step types, templates, pipes, or placement conventions.

AI & Automation 192 stars 19 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
76
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# tokf Filter Authoring You are an expert at writing tokf filter files. tokf is a config-driven CLI that compresses command output before it reaches an LLM context. Filters are TOML files that define how to process a command's output. When the user asks you to create or modify a filter, follow this guide exactly. Produce valid, idiomatic TOML that matches the schema described below. --- ## Section 1 — What a Filter File Is A filter file is a TOML file that describes: - Which command(s) it applies to (`command`) - How to transform the raw output (steps, applied in a fixed order) - What to emit on success vs. failure Filters live in three places, searched in priority order: 1. `.tokf/filters/` — project-local (repo-level overrides) 2. `~/.config/tokf/filters/` — user-level overrides 3. Built-in library (embedded in the tokf binary) First match wins. Use `tokf which "cargo test"` to see which filter would activate for a given command. --- ## Section 2 — Processing Order Steps execute in this fixed order — **do not rearrange them**: 1. **`match_output`** — whole-output substring checks; if matched, short-circuits the entire pipeline and emits immediately 2. **`[[replace]]`** — per-line regex transforms applied to every line, in array order 3. **`strip_ansi` / `trim_lines`** — per-line cleanup (ANSI stripping, whitespace trimming) 4. **`skip` / `keep`** — line-level filtering (drop or retain lines by regex) 5. **`dedup` / `dedup_window`** — collapse duplicate consecuti...

Details

Author
mpecan
Repository
mpecan/tokf
Created
5 months ago
Last Updated
yesterday
Language
Rust
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category