Procedure
- •
Parse arguments from
$ARGUMENTS:- •If the first word matches one of
errors,patterns,decisions,tips,context— use it as the category and the rest as content - •Otherwise, auto-detect category from content:
- •Contains "error", "fix", "bug", "issue", "broke", "failed" →
errors - •Contains "pattern", "convention", "structure", "always", "never" →
patterns - •Contains "decided", "chose", "why", "tradeoff", "because" →
decisions - •Contains "tip", "shortcut", "trick", "fast", "quick", "useful" →
tips - •Default →
context
- •Contains "error", "fix", "bug", "issue", "broke", "failed" →
- •If the first word matches one of
- •
Generate filename:
- •Extract key topic words from the content (max 5 words)
- •Convert to kebab-case with
.mdextension - •Example: "drizzle relation loading fix" →
drizzle-relation-loading.md
- •
Check for existing similar note:
- •Use Grep to search
agents-notes/<category>/for key terms from the content - •If a closely related note exists, read it and append an update section:
markdown
## Update (YYYY-MM-DD) <new content>
- •If no related note exists, create a new file
- •Use Grep to search
- •
Create new note using this template:
markdown# <Title> **Category:** <category> **Date:** <today's date YYYY-MM-DD> **Tags:** <3-5 relevant tags> ## Summary <1-3 sentence summary> ## Details <Full explanation with code snippets if helpful> ## Related - <relevant file paths, commands, or other note references>
- •
Keep notes under 30 lines. Be concise — focus on what someone needs to know to avoid repeating the same mistake or rediscovering the same solution.
- •
Confirm to the user: Report the file path created/updated and a one-line summary.