Cursor Command — “Route link to the right doc via ToC and append it”#
Goal#
You will read the project’s ToC in _index.md, decide the single best section for the new resource (based on its title/description), create any missing file/section according to the ToC, and add the link there. Be idempotent (don’t duplicate links).
Repo assumptions#
- The ToC in
_index.mdis the source of truth. - Each top‑level or sub‑section in the ToC corresponds to a markdown file path shown in its link, e.g.
[Solar and Power](./solar-and-power)→solar-and-power.md. - Sub‑sections are anchors within that file, e.g.
[Electrical safety ...](./solar-and-power#electrical-safety...)→solar-and-power.mdwith a## Electrical safety ...heading (or deeper###if the file already uses##for top sections—stay consistent within each file). - All content pages live at repo root or under
content/burning-man/research/(if both exist, prefer the location already used by that page).
Formatting & conventions#
-
New link item format (single line, no trailing spaces):
- [Title](URL) — short description (_domain.com_)
-
Order: within a section, and keep the list grouped logically by subtopic (ie, all the ‘sink’ links close together) and then alphabetized by Title after that.
-
Dedupe: if the identical URL already exists anywhere in that section file, do nothing except report where it already lives.
-
If a link obviously belongs to two sections, choose the more specific one. Only add once.
-
Never modify the ToC structure from
_index.mdin this task.
Steps#
-
Parse
_index.md. Build an internal map of:display_name→file_path(from the./slugin the link)subsections→ expected anchor text (strip link fragments after#, keep punctuation/casing as written)
-
Classify the INPUT (title + description) to the single best ToC target (file + subsection). NOTE: If a link is just to a theme camp website or social media, it should be on the camp website and media page.
- Prefer the deepest matching subsection that is semantically relevant.
- If no good match, use the parent section’s top‐level
### Resources.
-
Open or create the target file. If it doesn’t exist, scaffold:
# <Section Title>- For each subsection listed in the ToC for this file, create empty headings in order (use
##), and make a list (comment “(none yet)” so it’s easy to find later).
-
Ensure the chosen subsection heading exists at the correct depth. If not, create it in the correct order relative to siblings as defined by the ToC.
-
Under that subsection, insert the new link logically ordered and then in the alphabetized list.
-
Dedupe: if the URL already appears anywhere in the file, don’t add; instead note the existing line number.
-
Return a short summary of: chosen file/section, whether created, where inserted, and any dedupe action.
NOTE: Feel free to use the web_search tool to get a more robust description of the link to add information to it if it is not suffiecient when supplied.
Edge cases#
- Anchor style: generate GitHub‑style anchors from headings if needed (lowercase, spaces→
-, strip punctuation), but display headings must match ToC text. - Existing heading hierarchy: if the file already uses
#for title and##for primary sections, honor that; if it already uses###for those, keep consistent. Never mix levels within a file. - If
_index.mdand the file’s headings disagree on subsection names, prefer_index.mdand rename the heading to match (only for that exact subsection). - If both
content\burning-man\research\slug.mdandslug.mdexist, use whichever is already referenced in_index.md. - If classification confidence is low, choose the nearest parent section’s
### Resourcesand report the ambiguity in the summary.
OUTPUT format#
- Start with a one‑line action summary.
- Then list:
file,anchor,created_sections,deduped,notes.
DO NOT DO SOURCE CONTROL OPERATIONS OF ANY SORT.
Examples of classification (for your internal reasoning)#
- “LiFePO₄ battery box build…” →
solar-and-power.md→ “Electrical safety …” if primarily safety; otherwise “Battery boxes & quiet power banks”. - “How to keep kids cool on playa…” →
accessibility-and-inclusion.md→ “Kids & families …”. - “Camp radio call formats…” →
communications-and-networking.md→ “Radio etiquette & incident call formats”. - “Mud year exodus lessons learned…” →
trip-reports-and-indie-archives.md→ “Exodus and logistics post-mortems”. - “Quiet 24 V light tower build…” →
lighting-and-power-distribution.md→ “Light masts and area lighting”.
Quality checklist (do before saving)#
- Correct file path from ToC link slug.
- Correct heading text & anchor matched to ToC.
- New list item alphabetized; no trailing spaces.
- No duplicate URL present.
If you understand these instructions, the input links will follow one at a time. If you understand, output just a STAR EMOJI to confirm.