knap
하는 일
이 스킬은 변수, 필터, 간단한 로직이 있는 템플릿을 렌더링하도록 에이전트를 가르칩니다. 같은 레이아웃을 여러 데이터로 채워 비슷한 메모나 문서를 많이 만드는 사람에게 맞습니다.
사용하는 경우
- ✓데이터 목록이 있고 항목마다 메모를 만들고 싶을 때.
- ✓JSON 파일의 값으로 템플릿을 채우고 싶을 때.
- ✓웹 콘텐츠를 템플릿을 써서 메모 형식으로 정리하고 싶을 때.
스킬 링크
https://github.com/kepano/obsidian-skills/blob/main/skills/knap/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“CSV 파일에 있는 책 제목 목록을, 제 템플릿으로 책마다 메모 하나씩 만들어 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 템플릿과 데이터를 결합해 Markdown 출력을 만들며, 그 결과는 화면에 출력하거나 파일로 저장합니다. 템플릿 문법은 도구의 내장 도움말로 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Knap
Use Knap CLI to render Markdown templates with variables, filters, and logic.
If not installed: npm install -g knap (requires Node.js 20 or later). Alternatively, use npx knap.
Run knap --help for available commands and options. Discover the language through the CLI's offline reference:
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.
Usage
Render a template with JSON variables:
knap render template.md --data article.json -o note.md
Supply a template and data inline:
knap render -t '# {{ title | trim }}' --data-json '{"title":"Hello"}'
Override a variable or pipe JSON data:
knap render template.md --data article.json --set 'title=Custom title'
cat article.json | knap render template.md --data -
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:
---
{{ 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:
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:
defuddle parse https://example.com/article --md --json \
| knap render template.md --data - -o note.md
Defuddle's JSON properties, such as title and content, become template variables directly.
Batch rendering
Create one file per CSV row, JSON array object, or JSON file in a folder:
knap batch template.md --data articles.csv --output-dir notes \
--filename '{{ title | safe_name }}.md'
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.
자주 묻는 질문
데이터는 어떤 형식이어야 하나요?
스킬은 데이터가 JSON 객체여야 하며, 그 속성이 템플릿 변수가 된다고 설명합니다.
많은 파일을 한 번에 만들 수 있나요?
네. 데이터로 Markdown 파일을 일괄 생성하는 것을 다룹니다.
설치가 필요한가요?
네. Knap 명령줄 도구가 필요하며 npm으로 설치합니다. Node.js 20 이상이 필요합니다.
상세 정보
작성자의 원본 설명
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.
repo: kepano/obsidian-skills
인기도
- GitHub 스타
- 51k
- 순위
- #3417
- 라이선스
- MIT
- 업데이트
- 2026. 9. 15.
댓글
- …