name: f2s-kb-rm description: Remove the knowledge topics and index mappings associated with a stock-docs document; triggers: 删除项目上下文、f2s-kb-rm、remove project context、delete knowledge context
Execution scope: only maintain
.Knowledge; do not modify the configuration-rootrules/skills.
Orchestration (main / sub-agent)
- The meaning of
subAgent/switchAgentVerificationuses the unified entry as the only source of truth: Cursor/Claude read the configuration-rootrules/f2s-flow2spec-unified-entry.*; Codex reads.codex/topics/f2s-flow2spec-unified-entry.md(same source, mirrored byflow2spec init). Do not repeat those definitions here. - By default, the main agent completes the full workflow (single-point deletion has low benefit from sub-agent splitting).
- Split threshold: only when
subAgent=trueand one batch deletes >= 5 topics may deletion and reference cleanup be delegated to sub-agents. - Main agent must control scope confirmation and
fallbackTopicreassignment. - Write-authority hard rule:
manifest-routing.jsonand.Knowledge/index.mdare always written by the main agent. - Verification: by default, the writing side verifies its own work; this SKILL does not bind cross-agent verification.
Delete the Project Context Associated with a Document
Input
- One argument: a
.Knowledge/stock-docs/<filename>.mdpath, or a filename fragment that can match one.
Procedure
- Read
.Knowledge/index.mdand match topics associated with the target document. - Delete the corresponding
.Knowledge/topics/<topic>.mdfiles. - Remove the matching entries from
.Knowledge/index.mdand write it back. - Update the routing manifest:
.Knowledge/manifest-routing.json: remove invalidtopicPaths,taskToTopicRules,topicDependencies, andtopicMetadatareferences.- The corresponding
matchers/<matcherId>.json: remove invalid rules orincludeAnyterms aligned with the deletedtask/matcherId. - If the deleted topic was
fallbackTopic, a new fallback topic must be specified. - Authoring-side guideline: this step adjusts
topicDependencies(deleted depended-on topics or orphan edges), so first Read the fullrules/f2s-topic-authoring.*(Cursor/Claude:rules/f2s-topic-authoring.mdc; Codex:.codex/topics/f2s-topic-authoring.md) and verify DAG and minimization constraints before writing.
Output Summary (Required)
- List of deleted topic files.
- Entries removed from
.Knowledge/index.md. - Fields adjusted in the routing manifest.
- Items not executed, if any.
Complex Scenario Example
The user provides the filename fragment "回调", and it matches 2 topic documents.
- First list the two candidates and ask the user to confirm the deletion scope to avoid accidental deletion.
- After deletion, clean up invalid routing-manifest references; if the deleted topic was
fallbackTopic, specify a new fallback topic before writing. - In the final summary, state which topics were deleted, which topics were kept, and why.
Constraints
- Ask the user to confirm when the match is ambiguous.
- Delete only matched topics; do not affect other topics.
manifest-routing.jsonand.Knowledge/index.mdare always written by the main agent (write-authority hard rule); scope confirmation andfallbackTopicreassignment must not be delegated to sub-agents.
Completion Self-Check
- The deleted topic is no longer referenced by
manifest(must be false). indexno longer contains invalid topic paths (must be false).topicMetadatano longer references deleted topics (must be false).fallbackTopicis still valid.- No sub-agent split was forced below the threshold (< 5 topics); manifest / index were written by the main agent only.