diff --git a/skills/obsidian-clipper-template-creator/SKILL.md b/skills/obsidian-clipper-template-creator/SKILL.md new file mode 100644 index 00000000..e96b6866 --- /dev/null +++ b/skills/obsidian-clipper-template-creator/SKILL.md @@ -0,0 +1,54 @@ +--- +name: obsidian-clipper-template-creator +description: Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content. +--- + +# Obsidian Web Clipper Template Creator + +This skill helps you create importable JSON templates for the Obsidian Web Clipper. + +## Workflow + +1. **Identify User Intent:** specific site (YouTube), specific type (Recipe), or general clipping? +2. **Check Existing Bases:** The user likely has a "Base" schema defined in `Templates/Bases/`. + * **Action:** Read `Templates/Bases/*.base` to find a matching category (e.g., `Recipes.base`). + * **Action:** Use the properties defined in the Base to structure the Clipper template properties. + * See [references/bases-workflow.md](references/bases-workflow.md) for details. +3. **Fetch & Analyze Reference URL:** Validate variables against a real page. + * **Action:** Ask the user for a sample URL of the content they want to clip (if not provided). + * **Action:** Use `WebFetch` to retrieve the page HTML. + * **Action:** Analyze the HTML for Schema.org JSON, Meta tags, and CSS selectors. + * See [references/analysis-workflow.md](references/analysis-workflow.md) for analysis techniques. +4. **Draft the JSON:** Create a valid JSON object following the schema. + * See [references/json-schema.md](references/json-schema.md). +5. **Verify Variables:** Ensure the chosen variables (Preset, Schema, Selector) exist in your analysis. + * See [references/variables.md](references/variables.md). + +## Output Format + +**ALWAYS** output the final result as a JSON code block that the user can copy and import. + +```json +{ + "schemaVersion": "0.1.0", + "name": "My Template", + ... +} +``` + +## Resources + +* [references/variables.md](references/variables.md) - Available data variables. +* [references/filters.md](references/filters.md) - Formatting filters. +* [references/json-schema.md](references/json-schema.md) - JSON structure documentation. +* [references/bases-workflow.md](references/bases-workflow.md) - How to map Bases to Templates. +* [references/analysis-workflow.md](references/analysis-workflow.md) - How to validate page data. + +### Official Documentation +* [Variables](https://help.obsidian.md/web-clipper/variables) +* [Filters](https://help.obsidian.md/web-clipper/filters) +* [Templates](https://help.obsidian.md/web-clipper/templates) + +## Examples + +See [assets/](assets/) for JSON examples. diff --git a/skills/obsidian-clipper-template-creator/assets/clipping-template.json b/skills/obsidian-clipper-template-creator/assets/clipping-template.json new file mode 100644 index 00000000..85947e61 --- /dev/null +++ b/skills/obsidian-clipper-template-creator/assets/clipping-template.json @@ -0,0 +1,51 @@ +{ + "schemaVersion": "0.1.0", + "name": "General Clipping", + "behavior": "create", + "noteContentFormat": "{{content}}", + "properties": [ + { + "name": "categories", + "value": "[[Clippings]]", + "type": "multitext" + }, + { + "name": "author", + "value": "[[{{author}}]]", + "type": "multitext" + }, + { + "name": "source", + "value": "{{url}}", + "type": "text" + }, + { + "name": "via", + "value": "", + "type": "text" + }, + { + "name": "published", + "value": "{{published}}", + "type": "datetime" + }, + { + "name": "created", + "value": "{{date}}", + "type": "datetime" + }, + { + "name": "topics", + "value": "", + "type": "multitext" + }, + { + "name": "description", + "value": "{{description}}", + "type": "text" + } + ], + "triggers": [], + "noteNameFormat": "{{title}}", + "path": "Clippings/" +} diff --git a/skills/obsidian-clipper-template-creator/assets/recipe-template.json b/skills/obsidian-clipper-template-creator/assets/recipe-template.json new file mode 100644 index 00000000..61138b60 --- /dev/null +++ b/skills/obsidian-clipper-template-creator/assets/recipe-template.json @@ -0,0 +1,48 @@ +{ + "schemaVersion": "0.1.0", + "name": "Recipe", + "behavior": "create", + "noteContentFormat": "![{{schema:Recipe:image|first}}]\n\n## Description\n{{schema:Recipe:description}}\n\n## Ingredients\n{{schema:Recipe:recipeIngredient|list}}\n\n## Instructions\n{{schema:Recipe:recipeInstructions|map:step =>> step.text|list}}\n\n## Nutrition\n- Calories: {{schema:Recipe:nutrition.calories}}", + "properties": [ + { + "name": "categories", + "value": "[[Recipes]]", + "type": "multitext" + }, + { + "name": "author", + "value": "[[{{schema:Recipe:author.name}}]]", + "type": "text" + }, + { + "name": "source", + "value": "{{url}}", + "type": "text" + }, + { + "name": "ingredients", + "value": "{{schema:Recipe:recipeIngredient}}", + "type": "multitext" + }, + { + "name": "cuisine", + "value": "{{schema:Recipe:recipeCuisine}}", + "type": "text" + }, + { + "name": "rating", + "value": "", + "type": "number" + }, + { + "name": "type", + "value": "Recipe", + "type": "text" + } + ], + "triggers": [ + "schema:Recipe" + ], + "noteNameFormat": "{{schema:Recipe:name}}", + "path": "Recipes/" +} diff --git a/skills/obsidian-clipper-template-creator/references/analysis-workflow.md b/skills/obsidian-clipper-template-creator/references/analysis-workflow.md new file mode 100644 index 00000000..175f5a12 --- /dev/null +++ b/skills/obsidian-clipper-template-creator/references/analysis-workflow.md @@ -0,0 +1,67 @@ +# Analysis Workflow: Validating Variables + +To ensure your template works correctly, you must validate that the target page actually contains the data you want to extract. + +## 1. Fetch the Page +Use the `WebFetch` tool to retrieve the content of a representative URL provided by the user. + +``` +WebFetch(url="https://example.com/recipe/chocolate-cake") +``` + +## 2. Analyze the Output + +### Check for Schema.org (Recommended) +Look for `