Pins this version in aipm.package.json and aipm-lock.json.
aipm add @obsidianmd/knap@1.0.0
Without project tracking
Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.
aipm add @obsidianmd/knap@1.0.0 --no-init
How to use
Install the skill above, then run this in your AI tool:
/knap <your description>
About
Use Knap CLI to render Markdown templates with variables, filters, and logic.
Source
What gets added to your project
Preview every file this package writes on install before you run the command above.
Summary
Render Markdown from templates and structured data using Knap CLI. Use when the user asks to apply a Knap template, turn JSON or CSV data into notes, batch-generate Markdown files, or format Defuddle output into a note.
Skill instructions
Knap
Use Knap CLI to render Markdown templates with variables, filters, and logic.
Check availability with knap --help. If it is missing, explain that Knap requires Node.js 20 or later and offer installation with npm install -g knap or execution with npx knap. Do not claim a template was rendered if the tool is unavailable or returns an error.
Run knap --help for available commands and options. Discover the language through the CLI's offline reference:
bash
knap help syntax
knap help filters
knap help filter date
knap help tags
knap help tag for
Use the lists to find names, then request individual help for syntax, parameters, and examples with expected output.
Data must be a JSON object; its properties become template variables. --set overrides literal top-level keys with strings. Use JSON for nested objects, arrays, numbers, and booleans.
Choose one template source (file, -t, or stdin) and one data source (--data or --data-json). Only one input can read stdin. Without a template file or -t, Knap reads the template from stdin.
Output defaults to stdout. -o creates parent directories and overwrites the destination after rendering succeeds. Errors exit with status 1; diagnostics go to stderr. Warnings can accompany successful output.
Templates
Use {{ variable }} for values, | for filters, and {% ... %} for logic. For example, save this as template.md:
knap
---
{{ title | yaml_property:"title" }}
{{ tags | yaml_property:"tags" }}
---
# {{ title | trim }}
{% if author %}
By {{ author }}
{% endif %}
{{ content }}
Use yaml_property for complete frontmatter properties so values are quoted and indented correctly. The CLI includes standard filters, but does not supply Web Clipper browser variables, selectors, prompts, or DOM-dependent HTML filters. Supply variables through JSON.
Check a template before rendering:
bash
knap validate template.md
Validation checks syntax, filter names, and static filter arguments without data or file output. It does not check variable existence, runtime values, or dynamic arguments; render with real data to check runtime behavior. Diagnostics go to stderr and include relevant help commands.
Defuddle pipeline
Extract a web page as JSON with Markdown content, then render it into a note:
Use --data articles.json for an array or --data ./articles for a folder of JSON objects. CSV headers become variable names and values remain strings. Piped data defaults to JSON; add --format csv for piped CSV.
Use --dry-run to validate and list output paths without writing files. Existing files require --overwrite, including during a dry run. Duplicate output names within a batch are errors even with --overwrite.
Filename templates must produce a single filename with its extension, without directories. Use safe_name for data-derived names. Without --filename, Knap preserves source JSON basenames or numbers CSV rows and array items as 1.md, 2.md, and so on.
Add this badge to a GitHub README so readers can open the package page and install the same version.
[](https://www.aipm-registry.com/skills/obsidianmd/knap/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)
This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.
AI assistant context
What this skill is for
@obsidianmd/knap@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: Render Markdown from templates and structured data using Knap CLI. Use when the user asks to apply a Knap template, turn JSON or CSV data into notes, batch-generate Markdown files, or format Defuddle output into a note.
Run aipm add @obsidianmd/knap@1.0.0 in a project that has AIPM initialized.
Supported tools
@obsidianmd/knap@1.0.0 supports All tools.
Before installing
AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.