{"id":"8c49717f-6adf-46e7-88cd-1535a94a85a9","entityType":"agent","slug":"clawhub-wei840222-treemd","name":"treemd","canonicalUrl":"https://www.xpersona.co/agent/clawhub-wei840222-treemd","canonicalPath":"/agent/clawhub-wei840222-treemd","generatedAt":"2026-10-11T14:14:49.350Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":null},"description":"Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context. Skill: treemd Owner: wei840222 Summary: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s172jjkptk3smy0bv40ssjrz7n83fpys:treemd","sourceUrl":"https://clawhub.ai/wei840222/treemd","homepage":"https://clawhub.ai/wei840222/skills/treemd","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/wei840222/treemd","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/wei840222/skills/treemd","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown ele"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":null},"stars":null,"forks":null,"downloads":1082,"packageName":null,"latestVersion":"1.0.2","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T10:56:29.471Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T10:56:29.484Z","lastCrawledAt":"2026-10-11T10:56:29.471Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T10:56:29.471Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.2","createdAt":"2026-08-15T14:14:24.752Z","changelog":"treemd 1.0.2 changelog: - Clarified skill usage by adding a mandatory \"Agent Command Gate,\" specifying that agent tasks must use non-interactive flags only, never launch the TUI or file picker. - Updated stdin section to limit examples/documentation to CLI (non-interactive) modes. - Relocated and condensed human-only TUI documentation outside the agent skill. - Removed the `skill-card.md` file. - Removed Openclaw-specific metadata from SKILL.md.","fileCount":4,"zipByteSize":6677},{"version":"1.0.1","createdAt":"2026-05-20T09:49:29.799Z","changelog":"Fix -s section matching requires exact full heading text; fix exit code for missing sections (1 not 0); clarify -o flag limitations; fix stats pipe field access to dot notation","fileCount":4,"zipByteSize":6283},{"version":"1.0.0","createdAt":"2026-05-06T13:56:09.728Z","changelog":"Initial release: markdown document analysis and navigation with treemd CLI","fileCount":3,"zipByteSize":4778}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s172jjkptk3smy0bv40ssjrz7n83fpys:treemd","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T14:14:49.349Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":null},"readme":"Skill: treemd\n\nOwner: wei840222\n\nSummary: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context.\n\nTags: latest:1.0.2\n\nVersion history:\n\nv1.0.2 | 2026-08-15T14:14:24.752Z | auto\n\ntreemd 1.0.2 changelog:\n\n- Clarified skill usage by adding a mandatory \"Agent Command Gate,\" specifying that agent tasks must use non-interactive flags only, never launch the TUI or file picker.\n- Updated stdin section to limit examples/documentation to CLI (non-interactive) modes.\n- Relocated and condensed human-only TUI documentation outside the agent skill.\n- Removed the `skill-card.md` file.\n- Removed Openclaw-specific metadata from SKILL.md.\n\nv1.0.1 | 2026-05-20T09:49:29.799Z | user\n\nFix -s section matching requires exact full heading text; fix exit code for missing sections (1 not 0); clarify -o flag limitations; fix stats pipe field access to dot notation\n\nv1.0.0 | 2026-05-06T13:56:09.728Z | user\n\nInitial release: markdown document analysis and navigation with treemd CLI\n\nArchive index:\n\nArchive v1.0.2: 4 files, 6677 bytes\n\nFiles: references/query-language.md (5376b), skill-card.md (2502b), SKILL.md (7849b), _meta.json (125b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: treemd\ndescription: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context.\nversion: 1.0.1\nhomepage: https://github.com/Epistates/treemd\nlicense: MIT\n---\n\n# treemd Skill\n\nSkill for working with the `treemd` markdown viewer and query tool.\n\n## Overview\n\n`treemd` is a Rust-based CLI for markdown document analysis. It handles two primary workflows:\n\n1. **Structural Navigation** — Explore document hierarchy top-down\n2. **Query Navigation** — Navigate by asking structured questions\n\nFor scripted/agent tasks, always use CLI mode. TUI mode is reserved for human interactive viewing.\n\n## Agent Command Gate (Mandatory)\n\nBefore invoking `treemd`, include at least one non-interactive action flag: `--tree`, `--list`/`-l`, `--count`, `--at-line`, `--section`/`-s`, `--query`/`-q`, `--query-help`, `--help`, or `--version`.\n\nNever invoke `treemd` with only a file path, a directory, a glob, or no arguments. Those forms launch the interactive TUI or file picker and can block an agent session.\n\nIf no non-interactive action fits the task, do not invoke `treemd`; use another CLI workflow instead.\n\nVerify that the installed CLI is available and record its version before relying on version-sensitive tql or output-format behavior:\n\n```bash\ncommand -v treemd >/dev/null && treemd --version\n```\n\n> **Project**: https://github.com/Epistates/treemd  \n> **Install**: `cargo install treemd` or download binary from [releases](https://github.com/Epistates/treemd/releases)\n\n---\n\n## Line A: Structural Navigation\n\nUse this when encountering an unfamiliar document. Progress from overview → locate → extract.\n\n### Step 1: Overview\n\nUnderstand the document skeleton before diving in.\n\n```bash\ntreemd --tree FILE.md              # Visual tree with box-drawing characters\ntreemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)\ntreemd -l FILE.md | head -20       # Quick scan of all headings\n```\n\n### Step 2: Locate\n\nPinpoint the sections relevant to your goal.\n\n```bash\ntreemd -l --filter \"install\" FILE.md        # Fuzzy heading search (case-insensitive)\ntreemd -l -L 2 --filter \"API\" FILE.md      # Narrow by heading level + keyword\ntreemd --at-line 150 FILE.md               # \"Which heading covers line 150?\"\n```\n\n### Step 3: Extract\n\nPull entire sections or pipe content for downstream processing.\n\n```bash\ntreemd -s \"Full Heading Text\" FILE.md     # Extract heading + content (must match full heading text exactly)\ncat FILE.md | treemd -s \"Full Heading Text\" -  # Pipe stdin, extract from stream\n```\n\n> **Important**: `-s` requires the **exact full heading text** (including emoji and parentheses). Partial/fuzzy matches like `treemd -s \"Installation\"` will return `Section 'Installation' not found`. The `-o` flag has no effect in `-s` mode — output is always plain markdown.\n\n#### Output Format Options\n\nAttach `-o` to `--list` or `--tree` only (not `-s`):\n\n- `-o plain`: Human-readable text (default)\n- `-o json`: JSON array for scripting/parsing (works with `--list` and `--tree`)\n- `-o tree`: Box-drawing tree structure (`--tree` only; using with `--list` returns an error)\n\nFor tql (`-q`) queries, use `--query-output` instead of `-o`. Available formats:\n\n- `--query-output plain`: Human-readable text (default)\n- `--query-output json`: Compact JSON\n- `--query-output json-pretty`: Pretty-printed JSON\n- `--query-output jsonl`: Line-delimited JSON\n- `--query-output md`: Raw markdown rendering\n- `--query-output tree`: Box-drawing tree structure\n\n---\n\n## Line B: Query Navigation\n\nUse this when you already know what to look for. Jump directly to answers via the tql (treemd query language) — a jq-like markdown DOM traversal engine.\n\n### Element Selectors\n\nQuery syntax mirrors CSS/JQuery selectors operating on markdown AST:\n\n```bash\ntreemd -q '.h2' FILE.md                # All h2 headings\ntreemd -q '.code[rust]' FILE.md        # Rust code block elements\ntreemd -q '.link | url' FILE.md        # All link URLs (pipe extraction)\ntreemd -q '.h2 | text' FILE.md         # Strip markdown syntax, get plain text\n```\n\n### Hierarchy & Filters\n\nNavigate parent-child relationships and apply predicate filters:\n\n```bash\ntreemd -q '.h1[Features] > .h2' FILE.md           # Direct child h2 under \"Features\"\ntreemd -q '.h1 >> .code' FILE.md                  # Code blocks anywhere under h1\ntreemd -q '.h | select(contains(\"API\"))' FILE.md  # Headings containing \"API\"\ntreemd -q '[.h2] | limit(5)' FILE.md              # First 5 h2 elements\n```\n\n### Aggregation & Document Statistics\n\n```bash\ntreemd -q 'stats' FILE.md              # Document metrics (headings, links, code blocks)\ntreemd -q 'levels' FILE.md             # Heading count per level\ntreemd -q 'langs' FILE.md              # Code block language distribution\ntreemd -q '[.h2] | count' FILE.md      # Total h2 count\n```\n\n> **Note**: Aggregation functions (`stats`, `levels`, `langs`, `types`) do not require `. |` prefix — use them directly as shown above.\n\n#### tql Query Output Formats\n\nUse `--query-output` for tql results:\n\n```bash\ntreemd -q '.h2 | text' --query-output json FILE.md      # Compact JSON\ntreemd -q '.h2 | text' --query-output json-pretty FILE.md # Pretty-printed JSON\ntreemd -q '.link' --query-output jsonl FILE.md          # Line-delimited JSON\ntreemd -q '.h2 | text' --query-output md FILE.md       # Markdown rendering\ntreemd -q '.h1' --query-output tree FILE.md              # Box-drawing tree\n```\n\nFull tql syntax reference: `references/query-language.md`.\n\n---\n\n## Stdin Input (CLI Mode)\n\n```bash\ncat README.md | treemd -l -            # Read markdown from stdin\n```\n\n## TUI Mode (Human-only)\n\nDo not invoke TUI or file picker modes from agent tasks. Keep interactive keybindings and themes in human-facing documentation, outside this agent skill.\n\n## Integration Patterns\n\n### Pattern: Extract Section for Analysis\n\n```bash\nSECTION=$(treemd -s \"Full Heading Text (with emoji)\" README.md)  # Must use exact full heading\n```\n\n### Pattern: Extract Heading Section Content (tql)\n\n```bash\ntreemd -q '.h1[\"API Reference\"] | content' FILE.md   # Full section under heading\n```\n\n### Pattern: Heading Tree as JSON\n\n```bash\ntreemd --tree -o json FILE.md | jq '.'\n```\n\n### Pattern: Find Specific Headings\n\n```bash\n# Structural line\ntreemd -l --filter \"Config\" FILE.md\n\n# Query line (equivalent)\ntreemd -q '.h | select(contains(\"Config\"))' FILE.md\n```\n\n### Pattern: Document Statistics Pipeline\n\n```bash\ntreemd -q 'stats' --query-output json FILE.md | jq '.code_blocks'\ntreemd -q 'levels' --query-output json FILE.md | jq '.h1'\n```\n\n> **Note**: Aggregation queries output plain text by default. Always add `--query-output json` when piping to `jq`.\n\n## Error Handling\n\n- **Missing section**: `treemd -s \"NonExistent\" FILE.md` exits with code `1` and prints `Section 'NonExistent' not found` to stderr. Check for non-zero exit code to detect missing sections.\n- **Invalid tql syntax**: Exits with a non-zero code and an error message on stderr.\n- **Unsupported `--query-output` value**: Exits with error \"Unknown output format\" — use supported values only (`plain`, `json`, `json-pretty`, `jsonl`, `md`, `tree`).\n\n## Notes\n\n- File picker filters to `.md` / `.markdown` extensions only\n- tql supports element selectors, hierarchy operators (`>`, `>>`), pipes (`|`), and collection/string/filter/aggregation functions\n- JSON output is compatible with `jq` pipelines\n- Run `treemd --query-help` for the complete built-in tql reference (same content as `references/query-language.md`)\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn72br41m2qw276f02hss67hss81ywdp\",\n  \"slug\": \"treemd\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1786803264752\n}\n\nFile v1.0.2:references/query-language.md\n\n# treemd Query Language (tql) Reference\n\nA jq-like query language for navigating and extracting markdown structure.\n\n## Element Selectors\n\n| Selector          | Description              |\n| ----------------- | ------------------------ |\n| `.h`, `.heading`  | All headings (any level) |\n| `.h1` - `.h6`     | Headings by level        |\n| `.code`           | All code blocks          |\n| `.code[rust]`     | Code blocks by language  |\n| `.link`, `.a`     | All links                |\n| `.link[external]` | External links only      |\n| `.img`            | All images               |\n| `.table`          | All tables               |\n| `.list`           | All lists                |\n| `.blockquote`     | All blockquotes          |\n\n## Filters & Indexing\n\n```\n.h2[Features]        # Heading containing \"Features\" (fuzzy match)\n.h2[\"Installation\"]  # Heading with exact text (must match full heading including emoji)\n.h2[0]               # First h2\n.h2[-1]              # Last h2\n.h2[1:3]             # h2s at index 1 and 2\n.h2[:3]              # First 3 h2s\n```\n\n## Hierarchy Operators\n\n```\n.h1 > .h2            # Direct child h2s under h1s\n.h1 >> .code         # Code blocks anywhere under h1s (descendant)\n```\n\n## Pipes\n\n```\n.h2 | text           # Get heading text (strips ##)\n[.h2] | count       # Count all h2s\n.code | lang        # Get code block languages\n.link | url         # Get link URLs\n```\n\n## Collection Functions\n\n| Function              | Description                   | Alias                   |\n| --------------------- | ----------------------------- | ----------------------- |\n| `count`               | Count elements                | `length`, `len`, `size` |\n| `first`               | First element                 | `head`                  |\n| `last`                | Last element                  |                         |\n| `limit(n)`, `take(n)` | First n elements              |                         |\n| `skip(n)`, `drop(n)`  | Skip first n elements         |                         |\n| `nth(n)`              | Get element at index          |                         |\n| `reverse`             | Reverse order                 |                         |\n| `sort`                | Sort alphabetically           |                         |\n| `sort_by(key)`        | Sort by property              |                         |\n| `unique`              | Remove duplicates             |                         |\n| `flatten`             | Flatten nested arrays         |                         |\n| `group_by(key)`       | Group elements by key         |                         |\n| `min`, `max`          | Min/max numeric value         |                         |\n| `add`                 | Sum numbers or concat strings |                         |\n\n## String Functions\n\n| Function                  | Description             |\n| ------------------------- | ----------------------- |\n| `text`                    | Get text representation |\n| `upper`, `lower`          | Case conversion         |\n| `trim`                    | Strip whitespace        |\n| `split(sep)`              | Split by separator      |\n| `join(sep)`               | Join with separator     |\n| `replace(a, b)`           | Replace substring       |\n| `slugify`                 | URL-friendly slug       |\n| `lines`, `words`, `chars` | Count lines/words/chars |\n\n## Filter Functions\n\n| Function         | Description             | Alias             |\n| ---------------- | ----------------------- | ----------------- |\n| `select(cond)`   | Keep if condition true  | `where`, `filter` |\n| `contains(s)`    | Contains substring      | `includes`        |\n| `startswith(s)`  | Starts with prefix      |                   |\n| `endswith(s)`    | Ends with suffix        |                   |\n| `matches(regex)` | Matches regex pattern   |                   |\n| `any`, `all`     | Check if any/all truthy |                   |\n| `not`            | Negate boolean          |                   |\n\n## Content Functions\n\n| Function             | Description                    |\n| -------------------- | ------------------------------ |\n| `content`            | Section content (for headings) |\n| `md`                 | Raw markdown                   |\n| `url`, `href`, `src` | Get URL/link/image source      |\n| `lang`               | Code block language            |\n\n## Aggregation Functions\n\n| Function | Description                  |\n| -------- | ---------------------------- |\n| `stats`  | Document statistics          |\n| `levels` | Heading count by level       |\n| `langs`  | Code block count by language |\n| `types`  | Link types count             |\n\n## Examples\n\n```bash\n# List all h2 headings\ntreemd -q '.h2' doc.md\n\n# Get heading text only\ntreemd -q '.h2 | text' doc.md\n\n# Count headings\ntreemd -q '[.h2] | count' doc.md\n\n# First 5 headings\ntreemd -q '[.h] | limit(5)' doc.md\n\n# Filter headings (three equivalent ways)\ntreemd -q '.h | select(contains(\"API\"))' doc.md\ntreemd -q '.h | where(contains(\"API\"))' doc.md\ntreemd -q '.h[API]' doc.md\n\n# All Rust code blocks\ntreemd -q '.code[rust]' doc.md\n\n# h2s under \"Features\" section\ntreemd -q '.h1[Features] > .h2' doc.md\n\n# All link URLs\ntreemd -q '.link | url' doc.md\n\n# Document stats\nstats | .words       # Extract 'words' field (use dot notation, not 'stats | words')\n\n# JSON output\ntreemd -q '.h2 | text' --query-output json doc.md\n```\n\nFile v1.0.2:skill-card.md\n\n## Description:\n\nMarkdown document analysis and navigation using the treemd CLI.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[wei840222](https://clawhub.ai/user/wei840222)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to inspect Markdown structure, locate relevant sections, query Markdown elements with tql, and extract content without loading entire large documents into context.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Installing the external treemd CLI from an untrusted or unreviewed source could introduce ordinary supply-chain risk.\n\nMitigation: Install treemd only from a trusted source; in stricter environments, pin a reviewed version and verify release checksums or signatures before use.\n\nRisk: Invoking treemd without a non-interactive action flag can launch the TUI or file picker and block an agent session.\n\nMitigation: Use one of the documented non-interactive flags such as --tree, --list, --count, --section, --query, --help, or --version for agent tasks.\n\nRisk: Section extraction can fail when the requested heading text is partial or does not exactly match the document heading.\n\nMitigation: List or filter headings first, then pass the exact full heading text to --section.\n\nRisk: Version-sensitive tql syntax or output-format behavior may differ across installed treemd versions.\n\nMitigation: Check and record treemd --version before relying on version-sensitive query or output behavior.\n\n## Reference(s):\n\n- [treemd Query Language (tql) Reference](references/query-language.md)\n- [treemd project homepage](https://github.com/Epistates/treemd)\n- [treemd releases](https://github.com/Epistates/treemd/releases)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and optional plain text, JSON, JSONL, or Markdown CLI output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires the external treemd CLI; scripted agent usage must include a non-interactive action flag.]\n\n## Skill Version(s):\n\n1.0.2 (source: server release metadata; artifact frontmatter reports 1.0.1)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.1: 4 files, 6283 bytes\n\nFiles: references/query-language.md (5376b), skill-card.md (1954b), SKILL.md (7521b), _meta.json (125b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: treemd\ndescription: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context.\nversion: 1.0.1\nhomepage: https://github.com/Epistates/treemd\nlicense: MIT\nmetadata:\n  openclaw:\n    emoji: 🌳\n    requires:\n      bins: [treemd]\n---\n\n# treemd Skill\n\nSkill for working with the `treemd` markdown viewer and query tool.\n\n## Overview\n\n`treemd` is a Rust-based CLI for markdown document analysis. It handles two primary workflows:\n\n1. **Structural Navigation** — Explore document hierarchy top-down\n2. **Query Navigation** — Navigate by asking structured questions\n\nFor scripted/agent tasks, always use CLI mode. TUI mode is reserved for human interactive viewing.\n\n> **Project**: https://github.com/Epistates/treemd  \n> **Install**: `cargo install treemd` or download binary from [releases](https://github.com/Epistates/treemd/releases)\n\n---\n\n## Line A: Structural Navigation\n\nUse this when encountering an unfamiliar document. Progress from overview → locate → extract.\n\n### Step 1: Overview\n\nUnderstand the document skeleton before diving in.\n\n```bash\ntreemd --tree FILE.md              # Visual tree with box-drawing characters\ntreemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)\ntreemd -l FILE.md | head -20       # Quick scan of all headings\n```\n\n### Step 2: Locate\n\nPinpoint the sections relevant to your goal.\n\n```bash\ntreemd -l --filter \"install\" FILE.md        # Fuzzy heading search (case-insensitive)\ntreemd -l -L 2 --filter \"API\" FILE.md      # Narrow by heading level + keyword\ntreemd --at-line 150 FILE.md               # \"Which heading covers line 150?\"\n```\n\n### Step 3: Extract\n\nPull entire sections or pipe content for downstream processing.\n\n```bash\ntreemd -s \"Full Heading Text\" FILE.md     # Extract heading + content (must match full heading text exactly)\ncat FILE.md | treemd -s \"Full Heading Text\" -  # Pipe stdin, extract from stream\n```\n\n> **Important**: `-s` requires the **exact full heading text** (including emoji and parentheses). Partial/fuzzy matches like `treemd -s \"Installation\"` will return `Section 'Installation' not found`. The `-o` flag has no effect in `-s` mode — output is always plain markdown.\n\n#### Output Format Options\n\nAttach `-o` to `--list` or `--tree` only (not `-s`):\n\n- `-o plain`: Human-readable text (default)\n- `-o json`: JSON array for scripting/parsing (works with `--list` and `--tree`)\n- `-o tree`: Box-drawing tree structure (`--tree` only; using with `--list` returns an error)\n\nFor tql (`-q`) queries, use `--query-output` instead of `-o`. Available formats:\n\n- `--query-output plain`: Human-readable text (default)\n- `--query-output json`: Compact JSON\n- `--query-output json-pretty`: Pretty-printed JSON\n- `--query-output jsonl`: Line-delimited JSON\n- `--query-output md`: Raw markdown rendering\n- `--query-output tree`: Box-drawing tree structure\n\n---\n\n## Line B: Query Navigation\n\nUse this when you already know what to look for. Jump directly to answers via the tql (treemd query language) — a jq-like markdown DOM traversal engine.\n\n### Element Selectors\n\nQuery syntax mirrors CSS/JQuery selectors operating on markdown AST:\n\n```bash\ntreemd -q '.h2' FILE.md                # All h2 headings\ntreemd -q '.code[rust]' FILE.md        # Rust code block elements\ntreemd -q '.link | url' FILE.md        # All link URLs (pipe extraction)\ntreemd -q '.h2 | text' FILE.md         # Strip markdown syntax, get plain text\n```\n\n### Hierarchy & Filters\n\nNavigate parent-child relationships and apply predicate filters:\n\n```bash\ntreemd -q '.h1[Features] > .h2' FILE.md           # Direct child h2 under \"Features\"\ntreemd -q '.h1 >> .code' FILE.md                  # Code blocks anywhere under h1\ntreemd -q '.h | select(contains(\"API\"))' FILE.md  # Headings containing \"API\"\ntreemd -q '[.h2] | limit(5)' FILE.md              # First 5 h2 elements\n```\n\n### Aggregation & Document Statistics\n\n```bash\ntreemd -q 'stats' FILE.md              # Document metrics (headings, links, code blocks)\ntreemd -q 'levels' FILE.md             # Heading count per level\ntreemd -q 'langs' FILE.md              # Code block language distribution\ntreemd -q '[.h2] | count' FILE.md      # Total h2 count\n```\n\n> **Note**: Aggregation functions (`stats`, `levels`, `langs`, `types`) do not require `. |` prefix — use them directly as shown above.\n\n#### tql Query Output Formats\n\nUse `--query-output` for tql results:\n\n```bash\ntreemd -q '.h2 | text' --query-output json FILE.md      # Compact JSON\ntreemd -q '.h2 | text' --query-output json-pretty FILE.md # Pretty-printed JSON\ntreemd -q '.link' --query-output jsonl FILE.md          # Line-delimited JSON\ntreemd -q '.h2 | text' --query-output md FILE.md       # Markdown rendering\ntreemd -q '.h1' --query-output tree FILE.md              # Box-drawing tree\n```\n\nFull tql syntax reference: `references/query-language.md`.\n\n---\n\n## Stdin & Directory Input\n\n```bash\ncat README.md | treemd -l -            # Read markdown from stdin\ntreemd ./docs/                         # File picker in directory\ntreemd *.md                            # Multi-file picker\n```\n\n## TUI Mode\n\nReserved for human interactive sessions only. Not usable by agents.\n\n```bash\ntreemd FILE.md          # Launch dual-pane interactive viewer\n```\n\nKeybindings: vim-style (`j`/`k` for up/down, `h`/`l` for collapse/expand, `/` for search, `q` for quit).\n\nThemes: `--theme <OceanDark|Nord|Dracula|Solarized|Monokai|Gruvbox|TokyoNight|CatppuccinMocha>`\n\n## Integration Patterns\n\n### Pattern: Extract Section for Analysis\n\n```bash\nSECTION=$(treemd -s \"Full Heading Text (with emoji)\" README.md)  # Must use exact full heading\n```\n\n### Pattern: Extract Heading Section Content (tql)\n\n```bash\ntreemd -q '.h1[\"API Reference\"] | content' FILE.md   # Full section under heading\n```\n\n### Pattern: Heading Tree as JSON\n\n```bash\ntreemd --tree -o json FILE.md | jq '.'\n```\n\n### Pattern: Find Specific Headings\n\n```bash\n# Structural line\ntreemd -l --filter \"Config\" FILE.md\n\n# Query line (equivalent)\ntreemd -q '.h | select(contains(\"Config\"))' FILE.md\n```\n\n### Pattern: Document Statistics Pipeline\n\n```bash\ntreemd -q 'stats' --query-output json FILE.md | jq '.code_blocks'\ntreemd -q 'levels' --query-output json FILE.md | jq '.h1'\n```\n\n> **Note**: Aggregation queries output plain text by default. Always add `--query-output json` when piping to `jq`.\n\n## Error Handling\n\n- **Missing section**: `treemd -s \"NonExistent\" FILE.md` exits with code `1` and prints `Section 'NonExistent' not found` to stderr. Check for non-zero exit code to detect missing sections.\n- **Invalid tql syntax**: Exits with a non-zero code and an error message on stderr.\n- **Unsupported `--query-output` value**: Exits with error \"Unknown output format\" — use supported values only (`plain`, `json`, `json-pretty`, `jsonl`, `md`, `tree`).\n\n## Notes\n\n- File picker filters to `.md` / `.markdown` extensions only\n- tql supports element selectors, hierarchy operators (`>`, `>>`), pipes (`|`), and collection/string/filter/aggregation functions\n- JSON output is compatible with `jq` pipelines\n- Run `treemd --query-help` for the complete built-in tql reference (same content as `references/query-language.md`)\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn72br41m2qw276f02hss67hss81ywdp\",\n  \"slug\": \"treemd\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779270569799\n}\n\nFile v1.0.1:references/query-language.md\n\n# treemd Query Language (tql) Reference\n\nA jq-like query language for navigating and extracting markdown structure.\n\n## Element Selectors\n\n| Selector          | Description              |\n| ----------------- | ------------------------ |\n| `.h`, `.heading`  | All headings (any level) |\n| `.h1` - `.h6`     | Headings by level        |\n| `.code`           | All code blocks          |\n| `.code[rust]`     | Code blocks by language  |\n| `.link`, `.a`     | All links                |\n| `.link[external]` | External links only      |\n| `.img`            | All images               |\n| `.table`          | All tables               |\n| `.list`           | All lists                |\n| `.blockquote`     | All blockquotes          |\n\n## Filters & Indexing\n\n```\n.h2[Features]        # Heading containing \"Features\" (fuzzy match)\n.h2[\"Installation\"]  # Heading with exact text (must match full heading including emoji)\n.h2[0]               # First h2\n.h2[-1]              # Last h2\n.h2[1:3]             # h2s at index 1 and 2\n.h2[:3]              # First 3 h2s\n```\n\n## Hierarchy Operators\n\n```\n.h1 > .h2            # Direct child h2s under h1s\n.h1 >> .code         # Code blocks anywhere under h1s (descendant)\n```\n\n## Pipes\n\n```\n.h2 | text           # Get heading text (strips ##)\n[.h2] | count       # Count all h2s\n.code | lang        # Get code block languages\n.link | url         # Get link URLs\n```\n\n## Collection Functions\n\n| Function              | Description                   | Alias                   |\n| --------------------- | ----------------------------- | ----------------------- |\n| `count`               | Count elements                | `length`, `len`, `size` |\n| `first`               | First element                 | `head`                  |\n| `last`                | Last element                  |                         |\n| `limit(n)`, `take(n)` | First n elements              |                         |\n| `skip(n)`, `drop(n)`  | Skip first n elements         |                         |\n| `nth(n)`              | Get element at index          |                         |\n| `reverse`             | Reverse order                 |                         |\n| `sort`                | Sort alphabetically           |                         |\n| `sort_by(key)`        | Sort by property              |                         |\n| `unique`              | Remove duplicates             |                         |\n| `flatten`             | Flatten nested arrays         |                         |\n| `group_by(key)`       | Group elements by key         |                         |\n| `min`, `max`          | Min/max numeric value         |                         |\n| `add`                 | Sum numbers or concat strings |                         |\n\n## String Functions\n\n| Function                  | Description             |\n| ------------------------- | ----------------------- |\n| `text`                    | Get text representation |\n| `upper`, `lower`          | Case conversion         |\n| `trim`                    | Strip whitespace        |\n| `split(sep)`              | Split by separator      |\n| `join(sep)`               | Join with separator     |\n| `replace(a, b)`           | Replace substring       |\n| `slugify`                 | URL-friendly slug       |\n| `lines`, `words`, `chars` | Count lines/words/chars |\n\n## Filter Functions\n\n| Function         | Description             | Alias             |\n| ---------------- | ----------------------- | ----------------- |\n| `select(cond)`   | Keep if condition true  | `where`, `filter` |\n| `contains(s)`    | Contains substring      | `includes`        |\n| `startswith(s)`  | Starts with prefix      |                   |\n| `endswith(s)`    | Ends with suffix        |                   |\n| `matches(regex)` | Matches regex pattern   |                   |\n| `any`, `all`     | Check if any/all truthy |                   |\n| `not`            | Negate boolean          |                   |\n\n## Content Functions\n\n| Function             | Description                    |\n| -------------------- | ------------------------------ |\n| `content`            | Section content (for headings) |\n| `md`                 | Raw markdown                   |\n| `url`, `href`, `src` | Get URL/link/image source      |\n| `lang`               | Code block language            |\n\n## Aggregation Functions\n\n| Function | Description                  |\n| -------- | ---------------------------- |\n| `stats`  | Document statistics          |\n| `levels` | Heading count by level       |\n| `langs`  | Code block count by language |\n| `types`  | Link types count             |\n\n## Examples\n\n```bash\n# List all h2 headings\ntreemd -q '.h2' doc.md\n\n# Get heading text only\ntreemd -q '.h2 | text' doc.md\n\n# Count headings\ntreemd -q '[.h2] | count' doc.md\n\n# First 5 headings\ntreemd -q '[.h] | limit(5)' doc.md\n\n# Filter headings (three equivalent ways)\ntreemd -q '.h | select(contains(\"API\"))' doc.md\ntreemd -q '.h | where(contains(\"API\"))' doc.md\ntreemd -q '.h[API]' doc.md\n\n# All Rust code blocks\ntreemd -q '.code[rust]' doc.md\n\n# h2s under \"Features\" section\ntreemd -q '.h1[Features] > .h2' doc.md\n\n# All link URLs\ntreemd -q '.link | url' doc.md\n\n# Document stats\nstats | .words       # Extract 'words' field (use dot notation, not 'stats | words')\n\n# JSON output\ntreemd -q '.h2 | text' --query-output json doc.md\n```\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nMarkdown document analysis and navigation using the treemd CLI for heading trees, section extraction, tql queries, and programmatic Markdown inspection. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[wei840222](https://clawhub.ai/user/wei840222) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this skill to inspect, navigate, query, and extract content from Markdown documents without loading entire large files into context. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill relies on an external treemd CLI binary. <br>\nMitigation: Install treemd only from a trusted source and verify the binary before use. <br>\nRisk: Markdown files inspected by the agent may contain sensitive content. <br>\nMitigation: Use the skill only on Markdown files that are appropriate for the agent to inspect. <br>\n\n\n## Reference(s): <br>\n- [treemd Query Language Reference](references/query-language.md) <br>\n- [treemd project](https://github.com/Epistates/treemd) <br>\n- [treemd releases](https://github.com/Epistates/treemd/releases) <br>\n- [ClawHub skill page](https://clawhub.ai/wei840222/treemd) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Shell commands, Markdown, JSON, Text] <br>\n**Output Format:** [Markdown guidance with inline shell commands and treemd output format notes.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Requires the external treemd CLI binary.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: release evidence and SKILL.md frontmatter) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.0: 3 files, 4778 bytes\n\nFiles: references/query-language.md (3772b), SKILL.md (6991b), _meta.json (125b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: treemd\ndescription: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context.\n---\n\n# treemd Skill\n\nSkill for working with the `treemd` markdown viewer and query tool.\n\n## Overview\n\n`treemd` is a Rust-based CLI for markdown document analysis. It handles two primary workflows:\n\n1. **Structural Navigation** — Explore document hierarchy top-down\n2. **Query Navigation** — Navigate by asking structured questions\n\nFor scripted/agent tasks, always use CLI mode. TUI mode is reserved for human interactive viewing.\n\n> **Project**: https://github.com/Epistates/treemd  \n> **Install**: `cargo install treemd` or download binary from [releases](https://github.com/Epistates/treemd/releases)\n\n---\n\n## Line A: Structural Navigation\n\nUse this when encountering an unfamiliar document. Progress from overview → locate → extract.\n\n### Step 1: Overview\n\nUnderstand the document skeleton before diving in.\n\n```bash\ntreemd --tree FILE.md              # Visual tree with box-drawing characters\ntreemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)\ntreemd -l FILE.md | head -20       # Quick scan of all headings\n```\n\n### Step 2: Locate\n\nPinpoint the sections relevant to your goal.\n\n```bash\ntreemd -l --filter \"install\" FILE.md        # Fuzzy heading search (case-insensitive)\ntreemd -l -L 2 --filter \"API\" FILE.md      # Narrow by heading level + keyword\ntreemd --at-line 150 FILE.md               # \"Which heading covers line 150?\"\n```\n\n### Step 3: Extract\n\nPull entire sections or pipe content for downstream processing.\n\n```bash\ntreemd -s \"Installation\" FILE.md          # Extract heading + content until next h1/h2\ntreemd -s \"Usage\" FILE.md -o json         # Structured JSON output for scripting\ncat FILE.md | treemd -s \"Prerequisites\" -  # Pipe stdin, extract from stream\n```\n\n#### Output Format Options\n\nAttach `-o` to `--list`, `--tree`, or `-s` only:\n\n- `-o plain`: Human-readable text (default)\n- `-o json`: JSON array for scripting/parsing\n- `-o tree`: Box-drawing tree structure\n\nFor tql (`-q`) queries, use `--query-output` instead of `-o`. Available formats:\n\n- `--query-output plain`: Human-readable text (default)\n- `--query-output json`: Compact JSON\n- `--query-output json-pretty`: Pretty-printed JSON\n- `--query-output jsonl`: Line-delimited JSON\n- `--query-output md`: Raw markdown rendering\n- `--query-output tree`: Box-drawing tree structure\n\n---\n\n## Line B: Query Navigation\n\nUse this when you already know what to look for. Jump directly to answers via the tql (treemd query language) — a jq-like markdown DOM traversal engine.\n\n### Element Selectors\n\nQuery syntax mirrors CSS/JQuery selectors operating on markdown AST:\n\n```bash\ntreemd -q '.h2' FILE.md                # All h2 headings\ntreemd -q '.code[rust]' FILE.md        # Rust code block elements\ntreemd -q '.link | url' FILE.md        # All link URLs (pipe extraction)\ntreemd -q '.h2 | text' FILE.md         # Strip markdown syntax, get plain text\n```\n\n### Hierarchy & Filters\n\nNavigate parent-child relationships and apply predicate filters:\n\n```bash\ntreemd -q '.h1[Features] > .h2' FILE.md           # Direct child h2 under \"Features\"\ntreemd -q '.h1 >> .code' FILE.md                  # Code blocks anywhere under h1\ntreemd -q '.h | select(contains(\"API\"))' FILE.md  # Headings containing \"API\"\ntreemd -q '[.h2] | limit(5)' FILE.md              # First 5 h2 elements\n```\n\n### Aggregation & Document Statistics\n\n```bash\ntreemd -q 'stats' FILE.md              # Document metrics (headings, links, code blocks)\ntreemd -q 'levels' FILE.md             # Heading count per level\ntreemd -q 'langs' FILE.md              # Code block language distribution\ntreemd -q '[.h2] | count' FILE.md      # Total h2 count\n```\n\n> **Note**: Aggregation functions (`stats`, `levels`, `langs`, `types`) do not require `. |` prefix — use them directly as shown above.\n\n#### tql Query Output Formats\n\nUse `--query-output` for tql results:\n\n```bash\ntreemd -q '.h2 | text' --query-output json FILE.md      # Compact JSON\ntreemd -q '.h2 | text' --query-output json-pretty FILE.md # Pretty-printed JSON\ntreemd -q '.link' --query-output jsonl FILE.md          # Line-delimited JSON\ntreemd -q '.h2 | text' --query-output md FILE.md       # Markdown rendering\ntreemd -q '.h1' --query-output tree FILE.md              # Box-drawing tree\n```\n\nFull tql syntax reference: `references/query-language.md`.\n\n---\n\n## Stdin & Directory Input\n\n```bash\ncat README.md | treemd -l -            # Read markdown from stdin\ntreemd ./docs/                         # File picker in directory\ntreemd *.md                            # Multi-file picker\n```\n\n## TUI Mode\n\nReserved for human interactive sessions only. Not usable by agents.\n\n```bash\ntreemd FILE.md          # Launch dual-pane interactive viewer\n```\n\nKeybindings: vim-style (`j`/`k` for up/down, `h`/`l` for collapse/expand, `/` for search, `q` for quit).\n\nThemes: `--theme <OceanDark|Nord|Dracula|Solarized|Monokai|Gruvbox|TokyoNight|CatppuccinMocha>`\n\n## Integration Patterns\n\n### Pattern: Extract Section for Analysis\n```bash\nSECTION=$(treemd -s \"Installation\" README.md)\n```\n\n### Pattern: Extract Heading Section Content (tql)\n```bash\ntreemd -q '.h1[\"API Reference\"] | content' FILE.md   # Full section under heading\n```\n\n### Pattern: Heading Tree as JSON\n```bash\ntreemd --tree -o json FILE.md | jq '.'\n```\n\n### Pattern: Find Specific Headings\n```bash\n# Structural line\ntreemd -l --filter \"Config\" FILE.md\n\n# Query line (equivalent)\ntreemd -q '.h | select(contains(\"Config\"))' FILE.md\n```\n\n### Pattern: Document Statistics Pipeline\n```bash\ntreemd -q 'stats' --query-output json FILE.md | jq '.code_blocks'\ntreemd -q 'levels' --query-output json FILE.md | jq '.h1'\n```\n\n> **Note**: Aggregation queries output plain text by default. Always add `--query-output json` when piping to `jq`.\n\n## Error Handling\n\n- **Missing section**: `treemd -s \"NonExistent\" FILE.md` exits with code `0` and prints nothing when the section is not found. Check output emptiness to detect missing sections.\n- **Invalid tql syntax**: Exits with a non-zero code and an error message on stderr.\n- **Unsupported `--query-output` value**: Exits with error \"Unknown output format\" — use supported values only (`plain`, `json`, `json-pretty`, `jsonl`, `md`, `tree`).\n\n## Notes\n\n- File picker filters to `.md` / `.markdown` extensions only\n- tql supports element selectors, hierarchy operators (`>`, `>>`), pipes (`|`), and collection/string/filter/aggregation functions\n- JSON output is compatible with `jq` pipelines\n- Run `treemd --query-help` for the complete built-in tql reference (same content as `references/query-language.md`)\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn72br41m2qw276f02hss67hss81ywdp\",\n  \"slug\": \"treemd\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1778075769728\n}\n\nFile v1.0.0:references/query-language.md\n\n# treemd Query Language (tql) Reference\n\nA jq-like query language for navigating and extracting markdown structure.\n\n## Element Selectors\n\n| Selector | Description |\n|----------|-------------|\n| `.h`, `.heading` | All headings (any level) |\n| `.h1` - `.h6` | Headings by level |\n| `.code` | All code blocks |\n| `.code[rust]` | Code blocks by language |\n| `.link`, `.a` | All links |\n| `.link[external]` | External links only |\n| `.img` | All images |\n| `.table` | All tables |\n| `.list` | All lists |\n| `.blockquote` | All blockquotes |\n\n## Filters & Indexing\n\n```\n.h2[Features]        # Heading containing \"Features\" (fuzzy match)\n.h2[\"Installation\"]  # Heading with exact text\n.h2[0]               # First h2\n.h2[-1]              # Last h2\n.h2[1:3]             # h2s at index 1 and 2\n.h2[:3]              # First 3 h2s\n```\n\n## Hierarchy Operators\n\n```\n.h1 > .h2            # Direct child h2s under h1s\n.h1 >> .code         # Code blocks anywhere under h1s (descendant)\n```\n\n## Pipes\n\n```\n.h2 | text           # Get heading text (strips ##)\n[.h2] | count       # Count all h2s\n.code | lang        # Get code block languages\n.link | url         # Get link URLs\n```\n\n## Collection Functions\n\n| Function | Description | Alias |\n|----------|-------------|-------|\n| `count` | Count elements | `length`, `len`, `size` |\n| `first` | First element | `head` |\n| `last` | Last element | |\n| `limit(n)`, `take(n)` | First n elements | |\n| `skip(n)`, `drop(n)` | Skip first n elements | |\n| `nth(n)` | Get element at index | |\n| `reverse` | Reverse order | |\n| `sort` | Sort alphabetically | |\n| `sort_by(key)` | Sort by property | |\n| `unique` | Remove duplicates | |\n| `flatten` | Flatten nested arrays | |\n| `group_by(key)` | Group elements by key | |\n| `min`, `max` | Min/max numeric value | |\n| `add` | Sum numbers or concat strings | |\n\n## String Functions\n\n| Function | Description |\n|----------|-------------|\n| `text` | Get text representation |\n| `upper`, `lower` | Case conversion |\n| `trim` | Strip whitespace |\n| `split(sep)` | Split by separator |\n| `join(sep)` | Join with separator |\n| `replace(a, b)` | Replace substring |\n| `slugify` | URL-friendly slug |\n| `lines`, `words`, `chars` | Count lines/words/chars |\n\n## Filter Functions\n\n| Function | Description | Alias |\n|----------|-------------|-------|\n| `select(cond)` | Keep if condition true | `where`, `filter` |\n| `contains(s)` | Contains substring | `includes` |\n| `startswith(s)` | Starts with prefix | |\n| `endswith(s)` | Ends with suffix | |\n| `matches(regex)` | Matches regex pattern | |\n| `any`, `all` | Check if any/all truthy | |\n| `not` | Negate boolean | |\n\n## Content Functions\n\n| Function | Description |\n|----------|-------------|\n| `content` | Section content (for headings) |\n| `md` | Raw markdown |\n| `url`, `href`, `src` | Get URL/link/image source |\n| `lang` | Code block language |\n\n## Aggregation Functions\n\n| Function | Description |\n|----------|-------------|\n| `stats` | Document statistics |\n| `levels` | Heading count by level |\n| `langs` | Code block count by language |\n| `types` | Link types count |\n\n## Examples\n\n```bash\n# List all h2 headings\ntreemd -q '.h2' doc.md\n\n# Get heading text only\ntreemd -q '.h2 | text' doc.md\n\n# Count headings\ntreemd -q '[.h2] | count' doc.md\n\n# First 5 headings\ntreemd -q '[.h] | limit(5)' doc.md\n\n# Filter headings (three equivalent ways)\ntreemd -q '.h | select(contains(\"API\"))' doc.md\ntreemd -q '.h | where(contains(\"API\"))' doc.md\ntreemd -q '.h[API]' doc.md\n\n# All Rust code blocks\ntreemd -q '.code[rust]' doc.md\n\n# h2s under \"Features\" section\ntreemd -q '.h1[Features] > .h2' doc.md\n\n# All link URLs\ntreemd -q '.link | url' doc.md\n\n# Document stats\ntreemd -q 'stats' doc.md\n\n# JSON output\ntreemd -q '.h2 | text' --query-output json doc.md\n```","readmeExcerpt":"Skill: treemd Owner: wei840222 Summary: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"command -v treemd >/dev/null && treemd --version"},{"language":"bash","snippet":"treemd --tree FILE.md              # Visual tree with box-drawing characters\ntreemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)\ntreemd -l FILE.md | head -20       # Quick scan of all headings"},{"language":"bash","snippet":"treemd -l --filter \"install\" FILE.md        # Fuzzy heading search (case-insensitive)\ntreemd -l -L 2 --filter \"API\" FILE.md      # Narrow by heading level + keyword\ntreemd --at-line 150 FILE.md               # \"Which heading covers line 150?\""},{"language":"bash","snippet":"treemd -s \"Full Heading Text\" FILE.md     # Extract heading + content (must match full heading text exactly)\ncat FILE.md | treemd -s \"Full Heading Text\" -  # Pipe stdin, extract from stream"},{"language":"bash","snippet":"treemd -q '.h2' FILE.md                # All h2 headings\ntreemd -q '.code[rust]' FILE.md        # Rust code block elements\ntreemd -q '.link | url' FILE.md        # All link URLs (pipe extraction)\ntreemd -q '.h2 | text' FILE.md         # Strip markdown syntax, get plain text"},{"language":"bash","snippet":"treemd -q '.h1[Features] > .h2' FILE.md           # Direct child h2 under \"Features\"\ntreemd -q '.h1 >> .code' FILE.md                  # Code blocks anywhere under h1\ntreemd -q '.h | select(contains(\"API\"))' FILE.md  # Headings containing \"API\"\ntreemd -q '[.h2] | limit(5)' FILE.md              # First 5 h2 elements"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: treemd\ndescription: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context.\nversion: 1.0.1\nhomepage: https://github.com/Epistates/treemd\nlicense: MIT\n---\n\n# treemd Skill\n\nSkill for working with the `treemd` markdown viewer and query tool.\n\n## Overview\n\n`treemd` is a Rust-based CLI for markdown document analysis. It handles two primary workflows:\n\n1. **Structural Navigation** — Explore document hierarchy top-down\n2. **Query Navigation** — Navigate by asking structured questions\n\nFor scripted/agent tasks, always use CLI mode. TUI mode is reserved for human interactive viewing.\n\n## Agent Command Gate (Mandatory)\n\nBefore invoking `treemd`, include at least one non-interactive action flag: `--tree`, `--list`/`-l`, `--count`, `--at-line`, `--section`/`-s`, `--query`/`-q`, `--query-help`, `--help`, or `--version`.\n\nNever invoke `treemd` with only a file path, a directory, a glob, or no arguments. Those forms launch the interactive TUI or file picker and can block an agent session.\n\nIf no non-interactive action fits the task, do not invoke `treemd`; use another CLI workflow instead.\n\nVerify that the installed CLI is available and record its version before relying on version-sensitive tql or output-format behavior:\n\n```bash\ncommand -v treemd >/dev/null && treemd --version\n```\n\n> **Project**: https://github.com/Epistates/treemd  \n> **Install**: `cargo install treemd` or download binary from [releases](https://github.com/Epistates/treemd/releases)\n\n---\n\n## Line A: Structural Navigation\n\nUse this when encountering an unfamiliar document. Progress from overview → locate → extract.\n\n### Step 1: Overview\n\nUnderstand the document skeleton before diving in.\n\n```bash\ntreemd --tree FILE.md              # Visual tree with box-drawing characters\ntreemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)\ntreemd -l FILE.md | head -20       # Quick scan of all headings\n```\n\n### Step 2: Locate\n\nPinpoint the sections relevant to your goal.\n\n```bash\ntreemd -l --filter \"install\" FILE.md        # Fuzzy heading search (case-insensitive)\ntreemd -l -L 2 --filter \"API\" FILE.md      # Narrow by heading level + keyword\ntreemd --at-line 150 FILE.md               # \"Which heading covers line 150?\"\n```\n\n### Step 3: Extract\n\nPull entire sections or pipe content for downstream processing.\n\n```bash\ntreemd -s \"Full Heading Text\" FILE.md     # Extract heading + content (must match full heading text exactly)\ncat FILE.md | treemd -s \"Full Heading Text\" -  # Pipe stdin, extract from stream\n```\n\n> **Important**: `-s` requires the **exact full heading text** (including emoji and parentheses). Partial/fuzzy matches "},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn72br41m2qw276f02hss67hss81ywdp\",\n  \"slug\": \"treemd\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1786803264752\n}"},{"path":"references/query-language.md","content":"# treemd Query Language (tql) Reference\n\nA jq-like query language for navigating and extracting markdown structure.\n\n## Element Selectors\n\n| Selector          | Description              |\n| ----------------- | ------------------------ |\n| `.h`, `.heading`  | All headings (any level) |\n| `.h1` - `.h6`     | Headings by level        |\n| `.code`           | All code blocks          |\n| `.code[rust]`     | Code blocks by language  |\n| `.link`, `.a`     | All links                |\n| `.link[external]` | External links only      |\n| `.img`            | All images               |\n| `.table`          | All tables               |\n| `.list`           | All lists                |\n| `.blockquote`     | All blockquotes          |\n\n## Filters & Indexing\n\n```\n.h2[Features]        # Heading containing \"Features\" (fuzzy match)\n.h2[\"Installation\"]  # Heading with exact text (must match full heading including emoji)\n.h2[0]               # First h2\n.h2[-1]              # Last h2\n.h2[1:3]             # h2s at index 1 and 2\n.h2[:3]              # First 3 h2s\n```\n\n## Hierarchy Operators\n\n```\n.h1 > .h2            # Direct child h2s under h1s\n.h1 >> .code         # Code blocks anywhere under h1s (descendant)\n```\n\n## Pipes\n\n```\n.h2 | text           # Get heading text (strips ##)\n[.h2] | count       # Count all h2s\n.code | lang        # Get code block languages\n.link | url         # Get link URLs\n```\n\n## Collection Functions\n\n| Function              | Description                   | Alias                   |\n| --------------------- | ----------------------------- | ----------------------- |\n| `count`               | Count elements                | `length`, `len`, `size` |\n| `first`               | First element                 | `head`                  |\n| `last`                | Last element                  |                         |\n| `limit(n)`, `take(n)` | First n elements              |                         |\n| `skip(n)`, `drop(n)`  | Skip first n elements         |                         |\n| `nth(n)`              | Get element at index          |                         |\n| `reverse`             | Reverse order                 |                         |\n| `sort`                | Sort alphabetically           |                         |\n| `sort_by(key)`        | Sort by property              |                         |\n| `unique`              | Remove duplicates             |                         |\n| `flatten`             | Flatten nested arrays         |                         |\n| `group_by(key)`       | Group elements by key         |                         |\n| `min`, `max`          | Min/max numeric value         |                         |\n| `add`                 | Sum numbers or concat strings |                         |\n\n## String Functions\n\n| Function                  | Description             |\n| ------------------------- | ----------------------- |\n| `text`                    | Get text representation |\n| `upper`, `lower`          | Case conversi"},{"path":"skill-card.md","content":"## Description:\n\nMarkdown document analysis and navigation using the treemd CLI.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[wei840222](https://clawhub.ai/user/wei840222)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to inspect Markdown structure, locate relevant sections, query Markdown elements with tql, and extract content without loading entire large documents into context.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Installing the external treemd CLI from an untrusted or unreviewed source could introduce ordinary supply-chain risk.\n\nMitigation: Install treemd only from a trusted source; in stricter environments, pin a reviewed version and verify release checksums or signatures before use.\n\nRisk: Invoking treemd without a non-interactive action flag can launch the TUI or file picker and block an agent session.\n\nMitigation: Use one of the documented non-interactive flags such as --tree, --list, --count, --section, --query, --help, or --version for agent tasks.\n\nRisk: Section extraction can fail when the requested heading text is partial or does not exactly match the document heading.\n\nMitigation: List or filter headings first, then pass the exact full heading text to --section.\n\nRisk: Version-sensitive tql syntax or output-format behavior may differ across installed treemd versions.\n\nMitigation: Check and record treemd --version before relying on version-sensitive query or output behavior.\n\n## Reference(s):\n\n- [treemd Query Language (tql) Reference](references/query-language.md)\n- [treemd project homepage](https://github.com/Epistates/treemd)\n- [treemd releases](https://github.com/Epistates/treemd/releases)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and optional plain text, JSON, JSONL, or Markdown CLI output]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Requires the external treemd CLI; scripted agent usage must include a non-interactive action flag.]\n\n## Skill Version(s):\n\n1.0.2 (source: server release metadata; artifact frontmatter reports 1.0.1)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire documents into context. Skill: treemd Owner: wei840222 Summary: Markdown document analysis and navigation using the treemd CLI. Use when exploring markdown structure (heading trees, section extraction), querying markdown elements via tql (treemd query language), or piping markdown content for programmatic analysis. Also use before reading or editing large markdown files to survey structure, locate relevant sections, and avoid loading entire","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1263,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T10:56:29.484Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:14:49.350Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}