adding-markdown-highlighted-comments
Use when adding responses to markdown documents with user-highlighted comments, encountering markup errors, or unsure about mark tag placement - ensures proper model-highlight formatting with required attributes and correct placement within markdown elements
Best use case
adding-markdown-highlighted-comments is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when adding responses to markdown documents with user-highlighted comments, encountering markup errors, or unsure about mark tag placement - ensures proper model-highlight formatting with required attributes and correct placement within markdown elements
Teams using adding-markdown-highlighted-comments should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/adding-markdown-highlighted-comments/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How adding-markdown-highlighted-comments Compares
| Feature / Agent | adding-markdown-highlighted-comments | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when adding responses to markdown documents with user-highlighted comments, encountering markup errors, or unsure about mark tag placement - ensures proper model-highlight formatting with required attributes and correct placement within markdown elements
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Adding markdown Highlighted Comments
## Overview
Add AI responses to markdown documents using standardized highlighted markup that tracks authorship, timestamps, and relationships between comments.
**Core principle:** Marks go INSIDE markdown formatting. Each line/paragraph gets separate marks. Code blocks are NEVER wrapped in marks (prevents rendering issues).
## When to Use
Use this skill when:
- User asks you to add comments/responses to an markdown document
- Document contains `<mark class="user-highlight">` tags
- You need to respond to highlighted user comments
- Working with documents that have highlighted sections
Don't use for:
- Plain markdown without highlight markup
- Chat-only responses
- Documents without existing highlight infrastructure
## Required Markup Structure
### Class and Attributes
**ALWAYS use exactly:**
```html
<mark class="model-highlight"
data-model="claude-sonnet-4-20250514"
data-created="2025-01-06T10:30:00"
data-modified="2025-01-06T10:30:00"
data-id="mark-1736163000-a1b2c3"
data-group-id="response-202501061030">
```
**Required attributes - no exceptions:**
- `class="model-highlight"` (exactly this, not claude-highlight or claude-response)
- `data-model` - your exact model ID
- `data-created` - ISO 8601 timestamp
- `data-modified` - ISO 8601 timestamp (same as created for new)
- `data-id` - unique: `mark-TIMESTAMP-RANDOM`
- `data-group-id` - group identifier: `response-YYYYMMDDHHMM`
**Do NOT invent attributes:**
- ❌ `data-in-reply-to`
- ❌ `data-user-id`
- ❌ Any other custom attributes
### Group Delimiters
**ALWAYS wrap your entire response:**
```html
<!-- group-id:response-202501061030 -->
[Your marked-up response here]
<!-- /group-id:response-202501061030 -->
```
Missing delimiters = violation.
## Mark Placement Rules
### Rule 1: Marks INSIDE Formatting
```markdown
✅ CORRECT: **<mark ...>Bold text</mark>**
❌ WRONG: <mark ...>**Bold text**</mark>
✅ CORRECT: *<mark ...>Italic text</mark>*
❌ WRONG: <mark ...>*Italic text*</mark>
✅ CORRECT: • **<mark ...>Item</mark>**<mark ...> - description</mark>
❌ WRONG: • <mark ...>**Item** - description</mark>
```
### Rule 2: Separate Marks Per Line/Paragraph
**One sentence = one mark. Multiple sentences = multiple marks.**
```markdown
✅ CORRECT:
**<mark ...>First sentence here.</mark>**
**<mark ...>Second sentence here.</mark>**
❌ WRONG - Multi-sentence paragraph:
**<mark ...>First sentence here. Second sentence here.</mark>**
❌ WRONG - Multi-paragraph:
**<mark ...>First paragraph here.
Second paragraph here.</mark>**
```
**For bullet lists, use `•` character, not markdown `-` syntax:**
```markdown
✅ CORRECT:
• **<mark ...>Item title</mark>**<mark ...> - description text</mark>
• **<mark ...>Second item</mark>**<mark ...> - more description</mark>
❌ WRONG - Using markdown dash:
<mark ...>- Item title - description text</mark>
❌ WRONG - Mark outside bullet:
<mark ...>• Item title - description</mark>
```
### Rule 3: Code Blocks - NEVER Wrap in Marks
**Code blocks must NEVER be wrapped in `<mark>` tags. This breaks markdown rendering.**
```markdown
✅ CORRECT - No marks on code blocks:
```typescript
function example() {
return true;
}
```
❌ WRONG - Wrapping code block breaks rendering:
<mark ...>```typescript
function example() {
return true;
}
```</mark>
❌ WRONG - Marks inside code block:
```typescript
<mark ...>function example() {
return true;
}</mark>
```
**Why:** Wrapping code blocks in `<mark>` tags strips the code block presentation in Obsidian and other markdown renderers, turning formatted code into plain text.
**What to do instead:** Place code blocks in your response WITHOUT any mark tags. The code block will still be part of your response within the group delimiters.
**Note about inline code:** Inline code (single backticks like `function()`) within sentences SHOULD be marked as part of the sentence: **<mark>Use the `validateEmail()` function.</mark>** This rule applies only to code blocks (triple backticks).
### Rule 4: No Spaces Between Adjacent Marks
```markdown
✅ CORRECT: </mark><mark ...>
❌ WRONG: </mark> <mark ...>
```
## Placement in Document
### Find Comment Group
1. Scan for user comments (`user-highlight` marks)
2. Group related comments:
- Comments in same list
- Comments separated by 1-2 lines
- Comments under same heading
3. Find LAST comment in group
### Insert Response
Place your response:
- ✅ AFTER the last user comment in the group
- ✅ BEFORE next unhighlighted section/heading
- ❌ NOT in the middle of user comment group
- ❌ NOT overwriting existing content
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| `class="claude-highlight"` | Use `class="model-highlight"` exactly |
| `class="claude-response"` | Use `class="model-highlight"` exactly |
| `**<mark>text</mark>**` | Put mark inside: `**<mark>text</mark>**` |
| Multi-paragraph single mark | Create separate mark per paragraph |
| Wrapping code blocks in marks | Never wrap code blocks - breaks rendering |
| Missing group delimiters | Always add `<!-- group-id:... -->` wrapping |
| Inventing attributes | Only use the 6 required attributes |
## Quick Reference
**Every response needs:**
1. ☐ Group delimiters with matching group-id
2. ☐ Each line/paragraph has separate mark tags
3. ☐ Marks INSIDE markdown formatting (bold, italic, bullets)
4. ☐ Code blocks: NEVER wrap in marks (prevents rendering issues)
5. ☐ All 6 required attributes on every mark
6. ☐ `class="model-highlight"` (not any other variation)
7. ☐ No spaces between adjacent mark tags
8. ☐ Placed after last user comment, before next approved section
## Workflow
```markdown
1. Read document to locate user comments
2. Identify comment group (all related comments)
3. Find last comment in group
4. Add group delimiter: <!-- group-id:response-YYYYMMDDHHMM -->
5. Write response with proper mark tags
6. Add closing delimiter: <!-- /group-id:response-YYYYMMDDHHMM -->
7. Verify placement (after comments, before approved content)
```
## Complete Example
**User comments:**
```markdown
**<mark class="user-highlight" data-created="..." data-modified="..." data-id="mark-1">Question 1?</mark>**
**<mark class="user-highlight" data-created="..." data-modified="..." data-id="mark-2">Question 2?</mark>**
```
**Your response:**
```markdown
<!-- group-id:response-202501061030 -->
**<mark class="model-highlight" data-model="claude-sonnet-4-20250514" data-created="2025-01-06T10:30:00" data-modified="2025-01-06T10:30:00" data-id="mark-1736163000-abc" data-group-id="response-202501061030">Answer to question 1 here.</mark>**
**<mark class="model-highlight" data-model="claude-sonnet-4-20250514" data-created="2025-01-06T10:30:05" data-modified="2025-01-06T10:30:05" data-id="mark-1736163005-def" data-group-id="response-202501061030">Answer to question 2 here.</mark>**
```typescript
function handleTokenExpiration() {
// implementation
}
```
<!-- /group-id:response-202501061030 -->
```markdown
## Red Flags - STOP and Fix
If you catch yourself:
- Using `claude-highlight` or `claude-response` class
- Putting marks outside `**bold**` or `*italic*`
- Creating one mark for multiple sentences (even in same paragraph)
- Creating one mark for multiple paragraphs
- Using markdown `-` instead of `•` bullet character
- Putting marks around entire bullet including `•`
- Wrapping code blocks in `<mark>` tags
- Putting marks inside code block content
- Skipping group delimiters "to save time"
- Inventing new attributes like `data-in-reply-to`
- Adding spaces between adjacent mark tags
- Omitting bold formatting to "save time"
**All of these mean: Wrong markup. Fix before proceeding.**
## Common Rationalizations That Mean You're Failing
| Excuse | Reality |
|--------|---------|
| "Multi-sentence is more readable" | Wrong. One sentence = one mark. No exceptions. |
| "Markdown bullets are standard" | Wrong. Use `•` character, not `-` syntax. |
| "Skipping bold saves time" | Wrong. Match user formatting exactly. |
| "I'll fix formatting later" | Wrong. Fix now or you'll forget. |
| "Close enough under pressure" | Wrong. Pressure doesn't excuse violations. |
| "The skill doesn't apply here" | Wrong. If document has highlights, skill applies. |
| "Code blocks should be highlighted too" | Wrong. Wrapping breaks rendering. Never wrap code blocks. |
| "Just this small code snippet" | Wrong. ALL code blocks stay unwrapped, regardless of size. |
| "It works in my editor" | Wrong. Breaks in Obsidian and other renderers. Never wrap. |
**All of these mean: You're rationalizing. Follow the rules.**Related Skills
adding-todos
Use this skill to capture an idea, task, or issue that surfaces during a Kata session as a structured todo for later work. This skill creates markdown todo files in the .planning/todos/pending directory with relevant metadata and content extracted from the conversation. Triggers include "add todo", "capture todo", "new todo", and "create todo".
1k-adding-chains
Guide for adding new blockchain chains to OneKey. Use when implementing new chain support, adding blockchain protocols, or understanding chain architecture. Triggers on chain, blockchain, protocol, network, coin, token, add chain, new chain.
address-github-comments
Use when you need to address review or issue comments on an open GitHub Pull Request using the gh CLI.
adding-notes
Add new notes to the Second Brain knowledge base. Use when the user provides a resource (URL, book, podcast, article, GitHub repo, Reddit thread) and asks to "add a note", "create a note", "save this", "add to my notes", "take notes on", or "capture this".
adding-api-sources
Use when implementing a new data source adapter for metapyle, before writing any source code
getting-pr-review-comments
Use when needing Claude bot review recommendations from PR - automatically waits for workflows (including Claude review) to complete, then extracts recommendations and returns concise summary without loading full review into context
adding-models
Guide for adding new LLM models to Letta Code. Use when the user wants to add support for a new model, needs to know valid model handles, or wants to update the model configuration. Covers models.json configuration, CI test matrix, and handle validation.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
large-data-with-dask
Specific optimization strategies for Python scripts working with larger-than-memory datasets via Dask.
langsmith-fetch
Debug LangChain and LangGraph agents by fetching execution traces from LangSmith Studio. Use when debugging agent behavior, investigating errors, analyzing tool calls, checking memory operations, or examining agent performance. Automatically fetches recent traces and analyzes execution patterns. Requires langsmith-fetch CLI installed.
langchain-tool-calling
How chat models call tools - includes bind_tools, tool choice strategies, parallel tool calling, and tool message handling
langchain-notes
LangChain 框架学习笔记 - 快速查找概念、代码示例和最佳实践。包含 Core components、Middleware、Advanced usage、Multi-agent patterns、RAG retrieval、Long-term memory 等主题。当用户询问 LangChain、Agent、RAG、向量存储、工具使用、记忆系统时使用此 Skill。