agentleFS
remigius-labsremigius-labs/knap-skill/knap/SKILL.md

knap

Skill0 starsChanged 2 months agoMITView on GitHub

Use when generating Markdown or Obsidian notes from structured data (JSON, CSV, a folder of JSON files) with a template, or when the user mentions Knap, knap.md, Kepano's template language, "render notes from data", "one note per record", frontmatter from JSON, or Obsidian Web Clipper templates.

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. kepano/obsidian-skills★ 49ksame name
    2. codetesla51/skills★ 32same name
    3. dharmikbhesaniya/obsidian-skill★ 0same name
    4. lucasmaher-hash/claude-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Not for: HTML DOM filters (html_to_json, remove_html, library API only), TSV, non-object JSON.

    line 17

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Knap CLI

Knap is Kepano's Markdown template engine (npm knap, MIT, powers Obsidian Web Clipper and Importer). Data in, Markdown out. Syntax is Twig/Liquid-style. knap --help is the flag reference; this skill is the parts that bite.

When to use

  • One note from one JSON object (render)
  • One file per record from a CSV, a JSON array, or a folder of JSON files (batch)
  • Frontmatter, wikilinks, callouts, tables for Obsidian from data
  • Turning a saved link into a note: npx defuddle parse URL --markdown --json | knap render tpl.md --data -

Not for: HTML DOM filters (html_to_json, remove_html, library API only), TSV, non-object JSON.

Setup

knap --version || npm i -g knap   # Node 20+

Commands

knap render tpl.md --data one.json --output note.md          # one note
cat one.json | knap render tpl.md --data -                   # pipe data (one stdin only)
knap render -t '# {{ title }}' --set title=Hi                # inline, --set = strings only
knap batch tpl.md --data recs.json --output-dir notes \
  --filename '{{ date | date:"YYYY-MM-DD" }}-{{ name | safe_name | kebab }}.md' --dry-run
knap batch tpl.md --data ./json-folder --output-dir notes --overwrite   # keeps basenames

In scripts use set -euo pipefail: knap exits 1 on any error and the pipe examples otherwise mask a failed cat. Always --dry-run a batch first. Batch validates everything before writing; duplicate filenames fail even with --overwrite. Errors exit 1, print file:line:col code, and leave --output untouched.

Template syntax (verified on 0.4.0)

{{ title }}  {{ author.name }}  {{ rows.0.k }}  {{ rows[1].v }}
{{ title | trim | upper }}          {{ published | date:"YYYY-MM-DD" }}
{{ channel ?? "unknown" }}          {# there is NO default filter, use ?? #}
{% if status == "OPEN" %}…{% elseif x %}…{% else %}…{% endif %}
{% for p in people %}- {{ p }}
{% endfor %}
{% set h = title | upper %}{{ h }}

Obsidian frontmatter and links

---
type: lead
date: {{ date | date:"YYYY-MM-DD" }}
status: {{ status | lower }}
tags:
{{ tags | list }}
---
Related: {{ people | wikilink | join:", " }}
{{ "text" | callout:"warning" }}
{{ rows | table }}

Gotchas (each one cost a failed run)

SymptomFix
UNKNOWN_FILTER: "default"Use {{ x ?? "fallback" }}
tags: - "a" broken YAMLPut {{ tags | list }} on its own line under tags:, or {{ tags | yaml_property:"tags" }}
["[[A]]","[[B]]"] in outputwikilink on an array returns JSON, add | join:", "
PARSE_ERROR: Unexpected character '-'{{-/-}} whitespace trim is not supported in the CLI, drop the dashes
Stray blank lines around loops/ifsPut each {% %} tag on its own line: Knap removes that whole line. Inline tags keep surrounding text as-is
Time shifted by hoursdate renders in local timezone, feed date-only strings for dates
--set enabled=false is truthy--set values are strings, use JSON data for booleans/numbers
Batch wrote nothingA single bad record fails the whole batch, read the record N in the error

Filter names: knap has no list command, see filters.md here. Unknown filter names are errors, not passthrough.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.