note-snippet
Skill1 starsChanged 9 months agoMITView on GitHub
Save a code snippet to a SlashNote sticky note with context
In this repository10 other files it gives its agents.
- note-bugSkill
- note-contextSkill
- note-decideSkill
- note-findSkill
- note-loopSkill
- note-meetingSkill
- noteSkill
- note-standupSkill
- note-todoSkill
- note-wrapupSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Read the file at the given path using the Read tool
- Distinctive: line 34
If no lines specified, save entire file (up to 50 lines.
- Distinctive: line 44
No file reading needed
- Very specific: line 52
If input contains -- (double dash with spaces), everything after it is an annotation explaining why the snippet was saved.
- Distinctive: line 111
If formatting unclear, save as-is — never break working code
- Distinctive: line 120
Do NOT modify code from files — save exactly as-is
- Distinctive: line 123
If file not found → tell user, do not create note
- Distinctive: line 148
When no file extension available, detect from syntax:
- Distinctive: line 209
Keep it fast — no searching, no questions
- Distinctive: line 211
If input is ambiguous between modes, prefer Mode 2 (inline)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/note-snippet — Code Snippet
Save a code snippet to a purple SlashNote sticky note with optional annotation.
Usage
/note-snippet <file_path:lines> # Extract from file
/note-snippet <file_path:lines> -- <why> # Extract with annotation
/note-snippet <inline code> # Save code directly
/note-snippet <inline code> -- <why> # Inline with annotationTwo Modes
Mode 1: File reference
/note-snippet src/auth.swift:10-25
/note-snippet src/utils.ts:42
/note-snippet Services/AI/AIServiceManager.swift
/note-snippet Core/NoteManager.swift:15-30 -- CRUD pattern to reuse in new module- Read the file at the given path using the
Readtool - Extract the specified line range (or single line ± 5 lines of context)
- If no lines specified, save entire file (up to 50 lines; truncate if longer)
- Detect language from file extension
Mode 2: Inline code
/note-snippet func validate(token: String) -> Bool { return token.count > 0 }
/note-snippet const debounce = (fn, ms) => { ... } -- useful utility- User provides code directly in the input
- Detect language from syntax patterns
- No file reading needed
How to tell which mode:
- Contains path-like patterns (
/,.swift,.ts,.py,:with numbers) → Mode 1 - Everything else → Mode 2
Annotation (-- separator)
If input contains -- (double dash with spaces), everything after it is an annotation explaining why the snippet was saved. This adds context for future reference.
| Input | Code Part | Annotation |
/note-snippet auth.swift:10-25 -- JWT validation pattern | auth.swift:10-25 | "JWT validation pattern" |
/note-snippet const x = 1 -- example | const x = 1 | "example" |
/note-snippet auth.swift:10-25 | auth.swift:10-25 | (none) |
Annotation appears as italic text below the code block.
Output Format
With annotation:
# <descriptive title>
*<annotation>*
```<language>
<code><file_path>:<lines> · Feb 19, 2026
### Without annotation:
```markdown
# <descriptive title>
```<language>
<code><file_path>:<lines> · Feb 19, 2026
### Title Generation
Generate a descriptive title (max 6 words) by analyzing the code:
| Code Pattern | Title Strategy | Example |
|--------------|---------------|---------|
| Function/method | Function name + purpose | "Debounce utility function" |
| Class/struct | Class name | "NoteManager CRUD operations" |
| Config/constants | What it configures | "Redis connection config" |
| Algorithm/logic | What it does | "Binary search implementation" |
| Type/interface | Type name + domain | "User auth types" |
| Can't determine | Use annotation if present, else "Code snippet" | |
### Footer Format
- Source + date on one line, separated by ` · `
- Source line only for Mode 1 (file reference). For inline code, just date.
- Omit source path for inline code — it has no file origin
## Code Formatting
For **inline mode** only — if the code is clearly a one-liner that was compressed:
- Detect if it contains `{ ... }` or `=> { ... }` patterns
- Attempt basic formatting (one statement per line, proper indentation)
- If formatting unclear, save as-is — never break working code
For **file mode** — always save exactly as-is from the file. Never modify.
## Rules
- Always **purple** color
- Auto-detect language from extension or syntax
- Max ~50 lines per snippet — truncate with `// ... (truncated, N more lines)` if longer
- Do NOT modify code from files — save exactly as-is
- One-liner inline code may be formatted for readability
- One tool call for inline, two for file (Read + create_note)
- If file not found → tell user, do not create note
## Language Detection
| Extension | Language |
|-----------|----------|
| .swift | swift |
| .ts/.tsx | typescript |
| .js/.jsx | javascript |
| .py | python |
| .sh/.bash | bash |
| .rs | rust |
| .go | go |
| .rb | ruby |
| .json | json |
| .yaml/.yml | yaml |
| .md | markdown |
| .css/.scss | css |
| .html | html |
| .sql | sql |
| .dockerfile/Dockerfile | dockerfile |
| Other | (no language tag) |
### Syntax-Based Detection (Mode 2)
When no file extension available, detect from syntax:
| Pattern | Language |
|---------|----------|
| `func `, `guard `, `let `, `var ` (Swift style) | swift |
| `const `, `=>`, `async `, `Promise` | typescript/javascript |
| `def `, `import `, `class ` (Python style) | python |
| `fn `, `impl `, `pub `, `mut ` | rust |
| `func ` (Go style with no `->`) | go |
## Examples
**Input:** `/note-snippet Core/NoteManager.swift:15-30`
**Result:**
```markdown
# NoteManager CRUD operations
```swift
func createNote(preset: NotePreset) -> Note {
// ... extracted code
}Core/NoteManager.swift:15-30 · Feb 19, 2026
**Input:** `/note-snippet const debounce = (fn, ms) => { let timer; return (...args) => { clearTimeout(timer); timer = setTimeout(() => fn(...args), ms); }; }`
**Result:**
```markdown
# Debounce utility
```javascript
const debounce = (fn, ms) => {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), ms);
};
};Feb 19, 2026
**Input:** `/note-snippet auth.swift:42-60 -- JWT validation pattern to reuse in API module`
**Result:**
```markdown
# JWT token validation
*JWT validation pattern to reuse in API module*
```swift
func validateToken(_ token: String) -> Bool {
// ... extracted code
}auth.swift:42-60 · Feb 19, 2026
## Important
- Keep it fast — no searching, no questions
- Purple color always — this is the code color
- If input is ambiguous between modes, prefer Mode 2 (inline)
- Annotation is optional — never ask for it
- Title generation is smart — analyze the code, don't just use "Snippet"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
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.

