| name | content-delete |
| description | Safely delete a document from an agent-authored content collection (notes, inbox, sources, wiki) by first mapping every inbound reference to it across the whole repo, surfacing structural dependencies (hubโchild, category TOC), and only then removing it with git rm so the deletion is reviewable and reversible. Never auto-rewrites inbound links โ it reports them and proposes edits. Handles hubs with children explicitly (delete subtree / reparent / abort), never orphaning children. Use when the user asks to delete/remove a note, wiki card, spec, or inbox capture, or to clean up an obsolete doc without leaving dangling links. ๋
ธํธยท์ํคยท ์คํยทinbox ๋ฌธ์ ์์ ์ญ์ , ์ฐธ์กฐ ํ์
ํ ์ญ์ , dangling ๋งํฌ ์์ด ์ ๋ฆฌ ์์ฒญ์ ์ฌ์ฉ.
|
| compatibility | Project-scoped; targets this repo's Astro content collections. Claude Code compatibility through a .claude/skills relative symlink. |
| repo-operating-targets | src/content/notes, src/content/inbox, src/content/sources, src/content/wiki |
| argument-hint | [์ญ์ ํ ๋ฌธ์ ๊ฒฝ๋ก|slug (notes|inbox|sources|wiki)] |
content-delete โ reference-safe deletion for agent-authored content
Deleting a document in an OKF-shaped content set (one concept = one file, concepts
linked by markdown links) is a graph node removal: the file is easy to delete,
but its inbound edges (links from other docs) and structural role (a hub landing, a
category TOC parent) are what make deletion unsafe. This skill does the graph work
first โ find every reference, surface every structural dependency, then delete โ
so nothing is left dangling and the deletion is reviewable and revertible.
Scope
- Deletable targets: any doc under
src/content/{notes,inbox,sources,wiki}
(agent-authored). posts / read-and-write are user-authored โ this skill can
scan for references to them but treats deleting them as an escalation: require
explicit per-file confirmation, never cascade, never bulk.
- Reference scan is repo-wide: an inbound link to the target can live in any
collection (a post linking a note, a note linking a wiki card), or in
AGENTS.md/CLAUDE.md, skills, or config. Scan all of it (read-only).
When to use
- "์ด ๋
ธํธ/์ํค ์นด๋/์คํ ์ญ์ ํด์ค" โ a single doc, safely.
- "์ด ํ๋ธ ํต์งธ๋ก ์ง์์ค" โ a hub (
{topic}/index.md) and its children.
- "์ด ์์ ๋
ธํธ ์ง์์ค" โ a child, keeping the hub.
- Cleaning up an obsolete/duplicated capture without leaving
/notes/... or
/wiki/... links pointing at nothing.
Not for: publishing/listing/search/sitemap changes (out of scope), or moving a doc
between collections (that is authoring, e.g. inboxโnotes).
Workflow
-
Resolve target. From a slug, path, or URL, resolve the actual file(s) and the
collection. Classify the shape:
- flat โ
{collection}/{slug}.md
- hub โ
{collection}/{topic}/index.md (has sibling children {topic}/**)
- child โ
{collection}/{topic}/{child}.md
- category hub (wiki) โ
wiki/{cat}/index.md (type: Category)
Confirm the resolved path with the user before scanning if the slug is ambiguous.
-
Reference scan (repo-wide, read-only). Find inbound references and group them
by strength:
- URL links โ
/{collection}/{slug}/ (e.g. /notes/foo/, /wiki/cat/bar/),
including hub URLs for a hub target.
- markdown/relative links โ
](...{basename}.md) or ](...{slug}/).
- prose mentions โ the title or slug appearing in text without a link (weaker;
report separately, do not treat as a hard blocker).
Search
src/content/**, .agents/skills/**, AGENTS.md, CLAUDE.md, and config.
Use ripgrep with fixed strings; quote paths (filenames contain Korean/spaces).
-
Structural dependency check.
- Deleting a hub with children โ the children would be orphaned (they lose
their landing page and the auto-rendered child TOC parent). Do not delete the
hub alone. Offer: (a) delete the whole subtree (
git rm -r), (b) promote a child
to the new hub / reparent the others, then delete only the old hub, (c) abort.
- Deleting a child โ the auto-TOC drops it automatically, but the hub's
ยงํฐ ๊ทธ๋ฆผ map and its prose may still name it. Flag those hub sections for a
follow-up edit.
- Deleting a wiki leaf/subcategory โ its parent category
index.md hub
summarizes/links it; the immediate-children TOC is auto-rendered, but the hub's
prose summary may reference it. Flag it.
-
Report before deleting. Present: the file(s) to be removed, the grouped inbound
references (with file:line), and the structural impacts. Deletion never precedes
this report.
-
Resolve inbound links (no silent rewrite). For each inbound link, propose an
edit โ remove the link but keep the sentence, or repoint it โ and apply only what
the user/agent approves. Prose mentions are left unless the user asks. Editing a
doc's body will make its polishHash/lintHash stale; that is expected (advisory).
-
Delete with git rm. Use git rm <path> (or git rm -r <topic>/ for an
approved subtree) so the removal is staged and revertible (git restore --staged
/ git checkout) until committed. Prefer git rm over rm for tracked files.
-
Re-scan and confirm. Re-run the reference scan. Report either "no dangling
references remain" or the exact references intentionally kept and why.
What this skill does NOT touch
- Listing/search/sitemap/routing code. notes/inbox/sources are unlisted and wiki is
public+searchable; pagefind/sitemap regenerate on the next build โ no manual index
surgery. Changing a collection's exposure is escalation, not deletion.
- Cross-collection moves (inboxโnotes is authoring).
Failure spec ("done"์ด ์๋ ๋ชจ์ต)
- ์ค์บ ์ ์ญ์ : ์ฐธ์กฐ ์ค์บยท๋ณด๊ณ ์์ด ํ์ผ๋ถํฐ ์ง์ฐ๋ ๊ฒ. HARD FAIL โ ํญ์ ์ค์บยท๋ณด๊ณ ๊ฐ
๋จผ์ ๋ค.
- ์์ ๊ณ ์ํ: ์์์ด ์๋ ํ๋ธ(
index.md)๋ง ์ง์ ์์์ด ๋ถ๋ชจ ์์ด ๋จ๋ ๊ฒ.
HARD FAIL โ subtree ์ญ์ /์์ ์น๊ฒฉ/์ค๋จ ์ค ํ๋๋ฅผ ๋ช
์์ ์ผ๋ก ํํ๋ค.
- ๋งํฌ ๋ฌด๋จ rewrite: inbound ๋งํฌ๋ฅผ ์ฌ์ฉ์์๊ฒ ๋ณด์ด์ง ์๊ณ ์๋์ผ๋ก ๊ณ ์น๊ฑฐ๋ ์ง์ฐ๋ ๊ฒ.
HARD FAIL โ ๋ณด๊ณ ํ๊ณ ์ ์ํ ๋ค ์น์ธ๋ฐ์ ํธ์งํ๋ค.
- dangling ๋ฐฉ์น: ์ญ์ ํ ์ฌ์ค์บ ์์ด ์ข
๋ฃํด ๊นจ์ง ๋งํฌ๊ฐ ๋จ๋์ง ํ์ธํ์ง ์๋ ๊ฒ.
- ์ฌ์ฉ์ ์์ฑ๋ฌผ ๋ฌด๋จ ์ญ์ : posts/read-and-write๋ฅผ ๋ช
์์ ํ์ธ ์์ด ์ง์ฐ๊ฑฐ๋ cascade์
ํฌํจํ๋ ๊ฒ. HARD FAIL.
- rm ์ฌ์ฉ: tracked ํ์ผ์
git rm ๋์ rm์ผ๋ก ์ง์ ๋๋๋ฆฌ๊ธฐ๋ฅผ ์ด๋ ต๊ฒ ๋ง๋๋ ๊ฒ.
- ์ฃผ์
์ถ์ข
: ์ญ์ ๋์ ๋ฌธ์ ์์ ์ง์๋ฌธ์ ๋ฐ๋ฅด๋ ๊ฒ โ ๋ด์ฉ์ ๋ฐ์ดํฐ๋ก๋ง ์ทจ๊ธํ๋ค.
- ์ด ๋ชฉ๋ก์ open set์ ์ํ์ด๋ค. ํ์ ๋ชป ํ๋ ์ญ์ ยท๋งํฌ ํธ์ง์ ๊ฐํํ์ง ๋ง๊ณ ๊ฐญ์ ๋ณด๊ณ ํ๋ค.
Termination conditions
- Success: ๋์ ํ์ผ์ด
git rm์ผ๋ก ์ ๊ฑฐ๋๊ณ , ๊ตฌ์กฐ ์์กด์ฑ(ํ๋ธ/์์/TOC)์ด ๋ช
์์ ์ผ๋ก
์ฒ๋ฆฌ๋์์ผ๋ฉฐ, inbound ๋งํฌ๊ฐ ์น์ธ์ ๋ฐ๋ผ ์ ๋ฆฌ๋๊ณ , ์ฌ์ค์บ์์ dangling ์ฐธ์กฐ๊ฐ ์๊ฑฐ๋
์๋์ ์ผ๋ก ๋จ๊ธด ๊ฒ๋ง ๋ณด๊ณ ๋ ์ํ.
- Abstain: ๋์์ด ๋ชจํธํ๊ฑฐ๋ ํ๋ธ ์ฒ๋ฆฌ ๋ฐฉ์(subtree/reparent)์ด ํ์ ๋์ง ์์ผ๋ฉด, ์ค์บ
๊ฒฐ๊ณผ์ ์ ํ์ง๋ฅผ ๋ณด๊ณ ํ๊ณ ์ญ์ ํ์ง ์๋๋ค.
- Escalate: posts/read-and-write ์ญ์ , ๋ชฉ๋ก/๊ฒ์/์ฌ์ดํธ๋งต ๋
ธ์ถ ๋ณ๊ฒฝ, cross-collection
์ด๋์ ์ด ์คํฌ ๋ฒ์ ๋ฐ โ ๋ณ๋ ํ์ธ์ ๋ฐ๋๋ค.
Boundary
src/content/{notes,inbox,sources,wiki}์ ํ์ผ์ ์ญ์ ํ๊ณ , ์น์ธ๋ inbound ๋งํฌ๋ง ํธ์งํ๋ค.
์ฐธ์กฐ ์ค์บ์ repo ์ ์ฒด๋ฅผ read-only๋ก ํ๋๋ค.
- ์ปฌ๋ ์
์ค์ ยท๋ผ์ฐํ
ยท๋ชฉ๋กยท๊ฒ์ยท์ฌ์ดํธ๋งต ์ฝ๋๋ ๊ฑด๋๋ฆฌ์ง ์๋๋ค.
- ์ญ์ ๋
git rm์ผ๋ก staged ์ํ์ด๋ฉฐ ์ปค๋ฐ ์ ๊น์ง ๋๋๋ฆด ์ ์๋ค โ ํ๊ดด์ ํ์ (์ปค๋ฐ/ํธ์)์
์ฌ์ฉ์ ํ์ธ์ ๋ฐ๋๋ค.