Xpersona
T

treemd

CLAWHUB · Unverified

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

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s172jjkptk3smy0bv40ssjrz7n83fpys:treemd
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. 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: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-wei840222-treemd/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

43,729 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: treemd
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.
version: 1.0.1
homepage: https://github.com/Epistates/treemd
license: MIT
---

# treemd Skill

Skill for working with the `treemd` markdown viewer and query tool.

## Overview

`treemd` is a Rust-based CLI for markdown document analysis. It handles two primary workflows:

1. **Structural Navigation** — Explore document hierarchy top-down
2. **Query Navigation** — Navigate by asking structured questions

For scripted/agent tasks, always use CLI mode. TUI mode is reserved for human interactive viewing.

## Agent Command Gate (Mandatory)

Before 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`.

Never 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.

If no non-interactive action fits the task, do not invoke `treemd`; use another CLI workflow instead.

Verify that the installed CLI is available and record its version before relying on version-sensitive tql or output-format behavior:

```bash
command -v treemd >/dev/null && treemd --version
```

> **Project**: https://github.com/Epistates/treemd  
> **Install**: `cargo install treemd` or download binary from [releases](https://github.com/Epistates/treemd/releases)

---

## Line A: Structural Navigation

Use this when encountering an unfamiliar document. Progress from overview → locate → extract.

### Step 1: Overview

Understand the document skeleton before diving in.

```bash
treemd --tree FILE.md              # Visual tree with box-drawing characters
treemd --count FILE.md             # Heading count by level (h1–h6 breakdown + total)
treemd -l FILE.md | head -20       # Quick scan of all headings
```

### Step 2: Locate

Pinpoint the sections relevant to your goal.

```bash
treemd -l --filter "install" FILE.md        # Fuzzy heading search (case-insensitive)
treemd -l -L 2 --filter "API" FILE.md      # Narrow by heading level + keyword
treemd --at-line 150 FILE.md               # "Which heading covers line 150?"
```

### Step 3: Extract

Pull entire sections or pipe content for downstream processing.

```bash
treemd -s "Full Heading Text" FILE.md     # Extract heading + content (must match full heading text exactly)
cat FILE.md | treemd -s "Full Heading Text" -  # Pipe stdin, extract from stream
```

> **Important**: `-s` requires the **exact full heading text** (including emoji and parentheses). Partial/fuzzy matches 

_meta.json

{
  "ownerId": "kn72br41m2qw276f02hss67hss81ywdp",
  "slug": "treemd",
  "version": "1.0.2",
  "publishedAt": 1786803264752
}

references/query-language.md

# treemd Query Language (tql) Reference

A jq-like query language for navigating and extracting markdown structure.

## Element Selectors

| Selector          | Description              |
| ----------------- | ------------------------ |
| `.h`, `.heading`  | All headings (any level) |
| `.h1` - `.h6`     | Headings by level        |
| `.code`           | All code blocks          |
| `.code[rust]`     | Code blocks by language  |
| `.link`, `.a`     | All links                |
| `.link[external]` | External links only      |
| `.img`            | All images               |
| `.table`          | All tables               |
| `.list`           | All lists                |
| `.blockquote`     | All blockquotes          |

## Filters & Indexing

```
.h2[Features]        # Heading containing "Features" (fuzzy match)
.h2["Installation"]  # Heading with exact text (must match full heading including emoji)
.h2[0]               # First h2
.h2[-1]              # Last h2
.h2[1:3]             # h2s at index 1 and 2
.h2[:3]              # First 3 h2s
```

## Hierarchy Operators

```
.h1 > .h2            # Direct child h2s under h1s
.h1 >> .code         # Code blocks anywhere under h1s (descendant)
```

## Pipes

```
.h2 | text           # Get heading text (strips ##)
[.h2] | count       # Count all h2s
.code | lang        # Get code block languages
.link | url         # Get link URLs
```

## Collection Functions

| Function              | Description                   | Alias                   |
| --------------------- | ----------------------------- | ----------------------- |
| `count`               | Count elements                | `length`, `len`, `size` |
| `first`               | First element                 | `head`                  |
| `last`                | Last element                  |                         |
| `limit(n)`, `take(n)` | First n elements              |                         |
| `skip(n)`, `drop(n)`  | Skip first n elements         |                         |
| `nth(n)`              | Get element at index          |                         |
| `reverse`             | Reverse order                 |                         |
| `sort`                | Sort alphabetically           |                         |
| `sort_by(key)`        | Sort by property              |                         |
| `unique`              | Remove duplicates             |                         |
| `flatten`             | Flatten nested arrays         |                         |
| `group_by(key)`       | Group elements by key         |                         |
| `min`, `max`          | Min/max numeric value         |                         |
| `add`                 | Sum numbers or concat strings |                         |

## String Functions

| Function                  | Description             |
| ------------------------- | ----------------------- |
| `text`                    | Get text representation |
| `upper`, `lower`          | Case conversi

skill-card.md

## Description:

Markdown document analysis and navigation using the treemd CLI.

This skill is ready for commercial/non-commercial use.

## Publisher:

[wei840222](https://clawhub.ai/user/wei840222)

### License/Terms of Use:

MIT-0

## Use Case:

Developers 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.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Installing the external treemd CLI from an untrusted or unreviewed source could introduce ordinary supply-chain risk.

Mitigation: Install treemd only from a trusted source; in stricter environments, pin a reviewed version and verify release checksums or signatures before use.

Risk: Invoking treemd without a non-interactive action flag can launch the TUI or file picker and block an agent session.

Mitigation: Use one of the documented non-interactive flags such as --tree, --list, --count, --section, --query, --help, or --version for agent tasks.

Risk: Section extraction can fail when the requested heading text is partial or does not exactly match the document heading.

Mitigation: List or filter headings first, then pass the exact full heading text to --section.

Risk: Version-sensitive tql syntax or output-format behavior may differ across installed treemd versions.

Mitigation: Check and record treemd --version before relying on version-sensitive query or output behavior.

## Reference(s):

- [treemd Query Language (tql) Reference](references/query-language.md)
- [treemd project homepage](https://github.com/Epistates/treemd)
- [treemd releases](https://github.com/Epistates/treemd/releases)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, guidance]

**Output Format:** [Markdown guidance with inline shell commands and optional plain text, JSON, JSONL, or Markdown CLI output]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires the external treemd CLI; scripted agent usage must include a non-interactive action flag.]

## Skill Version(s):

1.0.2 (source: server release metadata; artifact frontmatter reports 1.0.1)

## Ethical Considerations:

Users 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.

Sponsored

Ads related to treemd and adjacent AI workflows.