agentleFS
spence-growsspence-grows/claude-skills/skills/setup-project-knowledge-base/SKILL.md

setup-project-knowledge-base

Skill0 starsChanged 5 months agoMITView on GitHub

Use when onboarding a new client project/engagement into a local-first knowledge corpus — standing up a searchable knowledge base so call transcripts, client docs, desk research, and cross-project material are captured and queryable. Triggers: "set up a knowledge base for <project>", "do the KB setup for this project", "ingest this client's docs/transcripts", "make this project searchable".

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't build new infrastructure per engagement.

    line 10
  2. Very specific:

    When NOT: one-off doc lookups (just query).

    line 45
  3. Very specific:

    Run everything as cd "$COP" && uv run copilot ....

    line 48
  4. Distinctive:

    No separate source needed.

    line 63
  5. Very specific:

    Transcripts (Notion): add a Select property named exactly Project to the Call Transcripts DB, with an option labeled exactly DISPLAY …

    line 74
  6. Distinctive:

    Document: add a "Knowledge system" section to the project CLAUDE.md and a project memory pointer, so future sessions know the corpus is the …

    line 94

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Setting Up a Project Knowledge Base

Overview

Don't build new infrastructure per engagement. Onboard each new project into one existing local-first knowledge corpus. The reference backend is the copilot KB tool (uv run copilot, LanceDB + an embedding model, hybrid retrieval, a multi-project registry at ~/.copilot/projects.json) — adapt the commands to your own KB if you use a different one. The pattern (four content buckets → durable searchable corpus, kept separate from session memory) is the reusable part.

Two layers, kept distinct:

  • Corpus (the KB) = the durable, searchable archive of everything — the four buckets below. System of record.
  • Claude Code memory = small distilled facts for in-session reasoning. Points at the corpus; never duplicates it.

Four buckets → KB primitives:

BucketMechanism
1. Call/meeting transcripts (e.g. a Notion DB)sync-notion + a Project property = the project's display name
2. Client docs (decks/PDF/Word/Excel, often read-only SharePoint)add-source watch-folders, vision applied
3. Desk researcha folder you own (inside the project folder), auto-ingested
4. Cross-project materiala SHARED scope, auto-included in every query -p

Requirements / adapt this

Assumes a KB CLI with add-source, sync-folders, sync-notion, vision, and query commands. Set COP to your KB repo (its .env is cwd-relative — run everything from the repo root):

COP="$HOME/path/to/copilot"

When to use

  • A new engagement starts and you want nothing to get lost / to refer back to prior calls and docs.
  • "Set this up like we did for the last client."

When NOT: one-off doc lookups (just query); editing the KB tool itself.

Conventions

Run everything as cd "$COP" && uv run copilot .... Pick a slug PID (e.g. acme-redesign) and a human DISPLAY (e.g. ACME Redesign).

Setup sequence

  1. Create the project + register client-doc folders (read-only SharePoint is fine — ingest only reads). Set --name/--desc once, on the first call only:
    cd "$COP" && uv run copilot add-source PID "/path/to/client/folderA" --name "DISPLAY" --desc "<one line: client, LOB, goal>" --no-vision
    cd "$COP" && uv run copilot add-source PID "/path/to/client/folderB" --no-vision   # NO --name on later calls
    Single files can't be folder-ingested (see Gotcha 3) — for a lone file in an otherwise-excluded folder, either register its parent subfolder (if clean) or use vision <file> (Gotcha 4).
  2. Desk-research folder — create <project folder>/working docs/desk-research/ with a README. It's inside the project watch-folder and the walk is recursive, so it auto-ingests. No separate source needed.
  3. Apply vision to the visual files (decks/PDFs). Vision is OFF by default and the content-hash skip means a later --vision run does nothing on already-text-ingested files — you must --force. Target just the visual files (cheap), don't --force the whole corpus:
    cd "$COP" && find "/path/to/client" -type f \( -iname '*.pdf' -o -iname '*.pptx' \) -print0 \
      | while IFS= read -r -d '' f; do uv run copilot vision "$f" -p PID --force; done
  4. Transcripts (Notion): add a Select property named exactly Project to the Call Transcripts DB, with an option labeled exactly DISPLAY (matched case-insensitively to the project's display_name/slug; a non-matching value silently creates a junk project). Tag calls going forward. Then:
    cd "$COP" && uv run copilot sync-notion --default-project inbox      # NEVER default to PID — see Gotcha 1
  5. Daily freshness (launchd). Copy launchd-sync.sh + launchd-sync.plist from this skill, substitute PID/paths/username, then load. The wrapper MUST cd "$COP" and set PATH (launchd has a minimal env). See the templates in this skill dir.
  6. Cleanup mis-routed transcripts (LLM routing is noisy): a reroute command sweeps inbox into projects; kb_inventory.py PID lists docs; kb_move.py inbox <doc_id…> evicts non-project calls. Both tools are in this skill dir.
  7. Consume + bridge. Self-serve: query -p PID --transcripts --answer, live -p PID. For Claude Code, clone a /PID-recall command (a thin wrapper over that query) into <project>/.claude/commands/.
  8. Document: add a "Knowledge system" section to the project CLAUDE.md and a project memory pointer, so future sessions know the corpus is the system of record.

Gotchas (the ones that bite — learned by execution, not by reading code)

GotchaReality
sync-notion --default-project PIDRe-pollutes the project: every untagged page dumps into it. Always default to inbox; let the Notion Project tag route real calls.
Vision skipped after text ingestContent-hash skip means --vision no-ops on already-ingested files. Use vision <file> --force (or sync-folders --vision --force).
add-source/sync-folders on a single fileSilently no-ops (it rglobs inside the path). Use the vision <file> command for single files.
add-source --name on later callsOverwrites the project display_name (it's per-project, not per-source). Set --name/--desc only on the first call; breaking the display_name also breaks Notion routing.
KB is single-writer (LanceDB)Never run two ingest/sync commands concurrently (incl. background passes vs. the launchd job). Serialize.
Re-tagging an existing Notion pageDedup is on the page body hash, not properties → a property-only change is "skipped (unchanged)" and does NOT re-route. Tags route NEW/changed pages; fix historical ones with reroute/kb_move.
notion_filter in projects.jsonDead config — never read. Routing keys off the page's own Project property. Don't set it.
query flagsIt's --transcripts and --answer (no --scope; default scope already = project+shared, so SHARED/cross-project is included).
First --vision runSlow (per-page model calls); content-hash cached after, so daily re-syncs are cheap.
Editing projects.json fields with no commandOnly add-source (watch_folders) and notion-writeback mutate via CLI; for display_name/etc. use the Registry API: Registry.load(); p=r.get(PID); p.x=...; r.upsert(p); r.save().

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.