Repurpose

Repurpose the KB for a different topic — cleans content, rewrites schema, updates tooling and viz

ThibautBaissac 23 updated 2mo ago
Claude CodeGeneric
View source ↗
---
description: Repurpose the KB for a different topic — cleans content, rewrites schema, updates tooling and viz
argument-hint: "<topic>"
allowed-tools: Read, Write, Edit, Glob, Grep, Bash
effort: high
---

Repurpose this knowledge base for a new topic. The new topic is: $ARGUMENTS

This command transforms the entire project — schema, commands, skills, visualization, and documentation — from the current domain to the new one. Follow these steps exactly in order. Do NOT skip any step.

## Step 1: Design the new KB structure

Based on the topic, design the full KB structure. Consider what makes sense for this specific domain.

### Wiki categories

The current categories are `theories/`, `concepts/`, `people/`, `experiments/`, `open-questions/`. Decide whether to keep them or replace them with domain-appropriate alternatives. Examples:

- **Science domains** (biology, chemistry): theories, concepts, people, experiments, open-questions (keep as-is)
- **History / archeology**: periods, concepts, people, sites, open-questions
- **Law**: doctrines, concepts, people, case-law, open-questions
- **Web development**: frameworks, concepts, people, tools, open-questions
- **Music**: genres, concepts, people, works, open-questions

Aim for 4–6 categories. Each category needs a corresponding page type and index file.

### Raw source categories

The current categories are `articles/`, `papers/`, `books/`, `talks/`. These work for most academic/journalism domains. Consider alternatives only if the domain has clearly different source types (e.g., `filings/`, `datasets/`, `transcripts/`).

### Tag vocabulary

Design 10–20 tags that cover the major sub-areas of the topic. Each tag should have a short description of what it covers. Use kebab-case. Examples:

- **Archeology**: `prehistory`, `classical-antiquity`, `medieval`, `dating-methods`, `excavation-techniques`, `ceramics`, `lithics`, `funerary-practices`, `settlement-patterns`, `maritime-archaeology`, `digital-methods`, `conservation`, `cultural-heritage`
- **Web development**: `frontend`, `backend`, `databases`, `devops`, `security`, `performance`, `accessibility`, `testing`, `api-design`, `architecture`, `css`, `javascript`, `typescript`, `react`, `node`

### Evidence tiers

The default tiers (`primary`, `secondary`, `community`) work for most domains. Only customize if the domain has a clearly different trust hierarchy. For example:

- **Law**: `statute` (legislation), `case-law` (judicial decisions), `commentary` (legal scholarship)
- **Most other domains**: keep `primary`, `secondary`, `community`

### Page types

Map each wiki category to a page type. Keep `summary`, `overview`, `principle` as universal types. The category-specific types replace the current `concept`, `theory`, `person`, `experiment`, `open-question`.

### Present the proposal

Print the full proposal in a structured format:

Proposed KB Structure for:

Wiki Categories

Directory Page Type Purpose
/

Raw Source Categories

  • / —

Tag Vocabulary

Tag Covers

Evidence Tiers

Tier Meaning Example

Page Types

Type Purpose Location
/

**Ask the user to confirm or adjust before proceeding.** Do not continue until the user approves.

## Step 2: Create a safety commit

Before making any destructive changes, commit the current state so changes can be reverted:

```bash
git add -A && git commit -m "pre-repurpose snapshot (auto)"

Step 3: Clean all content

Delete all compiled wiki pages, raw sources, and viz artifacts. Keep directory structure intact.

# Delete compiled wiki pages (current category dirs)
rm -f kb/theories/* kb/concepts/* kb/people/* kb/experiments/* kb/open-questions/*

# Delete raw sources (keep directories)
rm -f kb/raw/articles/* kb/raw/papers/* kb/raw/books/* kb/raw/talks/*

# Delete viz artifacts and chat history
rm -f viz/artifacts/*.json viz/chats/*.json

# Delete generated graph data
rm -f viz/src/data/kb-graph.json

Step 4: Restructure directories

If the wiki categories changed from the defaults (theories, concepts, people, experiments, open-questions):

  1. Create new wiki directories under kb/
  2. Remove old wiki directories that are no longer needed
  3. Create new index files (kb/index-<category>.md) for each new category
  4. Remove old index files for removed categories

If the raw source categories changed from the defaults (articles, papers, books, talks):

  1. Create new directories under kb/raw/
  2. Remove old directories that are no longer needed

Step 5: Rewrite kb/CLAUDE.md

Rewrite the entire file, preserving the overall structure but replacing all domain-specific content. Use the approved proposal from Step 1. The file must include:

  • Domain intro (line 1–3)
  • Updated directory tree matching the new categories
  • Raw source descriptions for the new source categories
  • Evidence tier table with domain-appropriate examples
  • Page type table matching the new categories
  • Person/people page threshold (adapt the criterion to the domain — e.g., "3+ source appearances or foundational contribution")
  • Linking conventions (unchanged)
  • Tag vocabulary table with all approved tags and descriptions
  • Operations section (ingest, fetch, query, lint, compile — update category references)
  • Index and log format (update category references)

Read the current kb/CLAUDE.md first to preserve the full structure, then rewrite it completely.

Step 6: Update commands and skills

.claude/commands/kb/ingest.md

Read the file and replace:

  • All references to "physics concepts", "physics theory", "physics" with the new domain
  • All references to wiki categories (theories/, concepts/, people/, experiments/, open-questions/

Maintain Repurpose?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Repurpose on getagentictools](https://getagentictools.com/loops/thibautbaissac-delete-compiled-wiki-pages-current-category-dirs?ref=badge)