一键导入
query
Query structured data (JSON, JSONL, TOML, YAML, XML, CSV, Markdown) using jq, mdq, and yq. Use instead of grep/cat/sed for structured files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Query structured data (JSON, JSONL, TOML, YAML, XML, CSV, Markdown) using jq, mdq, and yq. Use instead of grep/cat/sed for structured files.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Debug and investigate foci platform internals. API logs, payload logs, session files, CC backend transcripts, cache diagnosis, service logs, and common investigation patterns. Read the relevant subfile before investigating.
Security scanner for untrusted code and AI agent skills. Detects credential theft, code injection, privacy violations, deception, resource abuse, and ethical issues before you read or activate untrusted content.
How to operate as a foci agent — the tools you call, how your prompts and turns are built, the databases behind your state, and the config that shapes you. Read the relevant subfile before doing related work.
Finding text on disk — use ack, not grep (grep is only for filtering the piped output of other commands). Conventions for fast, correct file-content search across a codebase.
Drive a live browser via accessibility-tree snapshots — navigate, click, fill forms, select, press keys, screenshot. Use when a task needs interacting with a real web page (logins, JS-rendered content, multi-step flows), not a static read (that's web_fetch).
Developing the foci platform itself (Go server + backends). Architecture, the CC/opencode backends, the routing/delivery model, and the turn/steer/ask lifecycle — the internals you need when CODING foci, not when operating as an agent. Read the relevant subfile before changing that area.
| name | query |
| description | Query structured data (JSON, JSONL, TOML, YAML, XML, CSV, Markdown) using jq, mdq, and yq. Use instead of grep/cat/sed for structured files. |
Query structured data instead of dumping it into context. Three tools, one per format family.
# Extract a field
jq '.field' file.json
# Extract nested field
jq '.parent.child' file.json
# Array iteration
jq -r '.[] | .name' file.json
# Filter JSONL logs
cat log.jsonl | jq 'select(.level == "ERROR")'
# Multiple fields
jq '{name: .name, cost: .cost_usd}' file.json
# Count entries
cat log.jsonl | jq -s 'length'
# Sort and limit
jq -s 'sort_by(.cost_usd) | reverse | .[:5]' file.jsonl
Never grep JSONL — lines are multi-KB JSON blobs. Always use jq.
# Extract a section by heading
mdq '# Section Name' file.md
# Nested section
mdq '## Parent > ### Child' file.md
# List items
mdq '# Section > list' file.md
# Code blocks
mdq '# Section > code' file.md
# Tables
mdq '# Section > table' file.md
Use instead of cat for large markdown files. Extract just the section you need.
mdq selects sections, not headings. mdq '# Foo' returns the heading AND all its content.
yq auto-detects format from file extensions. No -p flag needed for .toml, .yaml, .yml, .xml, .csv files.
# Read TOML
yq '.section.key' file.toml
yq -oy '.' file.toml # TOML → YAML (readable)
yq -oj '.' file.toml # TOML → JSON
# Read YAML
yq '.key' file.yaml
yq '.items[0].name' file.yaml
# Read XML
yq '.root.element' file.xml
# Read CSV
yq '.[0]' file.csv # First row
# List all keys at a level
yq 'keys' file.toml
yq '.section | keys' file.toml
# Filter arrays
yq '.agents[] | select(.id == "myagent")' file.toml
# Format conversion
yq -o json file.toml # TOML → JSON
yq -o toml file.yaml # YAML → TOML
# Piping (no file extension — use -p to specify input format)
cat something | yq -p toml '.key'
Supported formats: YAML, JSON, TOML, XML, CSV, TSV, HCL, properties, base64, URI, shell, Lua, INI.
Output format flag: -oy (YAML), -oj (JSON), -ot (TOML), -ox (XML).
Input format flag (-p): Only needed when piping or reading files with non-standard extensions.
| Data format | Tool | Notes |
|---|---|---|
.json, .jsonl | jq | Pipe JSONL, don't load whole file |
.md | mdq | Query by heading structure |
.toml | yq | Config files, foci.toml |
.yaml, .yml | yq | Docker compose, k8s, etc. |
.xml | yq | |
.csv | yq |
Structured queries beat line numbers. Line numbers change on edits; section titles and keys usually don't. You can guess or fuzzy-match headings and keys when you can't guess line numbers.
Optimistic pattern: Try the key you expect, fall back to listing keys:
yq '.agents[0].thinking' file.toml || yq '.agents[0] | keys' file.toml