/rais-kb:buildfrom Knowledge Base
Build and maintain a knowledge base from a folder of the person's documents (PDFs, Word files, policies, standard agreements, guidance, prior agreements, an existing playbook). Produces a Markdown copy of each document, a generated INDEX.md, and, for contract review, a PLAYBOOK.md that the Legal plugin's reviews follow. Use this skill whenever the person wants to create, set up, build, organize, update, refresh, sync, check, or clean up a knowledge base, KB, reference set, or "Claude folder"; says they added, replaced, renamed, or deleted files in their knowledge base folder; asks to update or approve playbook changes; or says sessions run out of budget because Claude reads everything. Trigger on "create my knowledge base", "update my knowledge base", "approve playbook changes", "continue my knowledge base", and "organize my files". This skill only builds and maintains the knowledge base; questions go to the ask skill and contract reviews to the Legal plugin.
Ships in Knowledge Base. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Build and maintain a knowledge base that any later Claude session can use cheaply. A session reads one short playbook or the index, then opens only the one or two documents it needs. Never a folder scan, never a full read of everything.
The person is a contract reviewer, grants and contracts officer, or analyst, not a developer. Keep every message short and plain. They only ever need two phrases, "create my knowledge base" and "update my knowledge base". Say "Finder" on a Mac and "File Explorer" on Windows; the device info says which. Never say "Finder (File Explorer on Windows)".
The person's folder is the knowledge base. Their documents stay exactly where they put them, in whatever subfolders they like. The plugin adds one subfolder, Claude files (Claude manages), and never mentions it in messages. Inside it
PLAYBOOK.md, how the person negotiates and the rules drawn from the documents. Written only for contract review. The person approves every change.INDEX.md, generated from the documents. One entry per document. Never edited by hand.docs/<same path>.md, a Markdown copy of each document. Its front matter carries the document's record (fingerprint, type, date) and its index entry (summary, consult when, key sections)._admin/, bookkeeping. kb_sync.py (a copy, so any session can run the check), CHANGELOG.md, proposals/ (playbook changes waiting for approval), sync/ (diffs of replaced files), retired/ (old copies, nothing is ever deleted), needs-attention/ (records of files that could not be converted).Two small pointer files sit at the top of the person's folder, CLAUDE.md and, for contract review, legal.local.md. Subfolders whose names start with _ are ignored, which is where drafts and redlines can go.
There is no manifest and no lock. Each document carries its own record, so two people sharing the folder through SharePoint can never corrupt a shared file. The script tidies any duplicate copies a sync app makes. The only file people edit by hand is PLAYBOOK.md.
scripts/kb_sync.py (in this skill's folder) fingerprints, converts (pandoc, pdftotext, LibreOffice), mirrors, and tracks every document, and generates INDEX.md. Never open a PDF or Word file with the Read tool to transcribe pages that already have text.claude_pages, stage that source PDF into the sandbox and read only those pages with the Read tool's pages option (all means the whole PDF, used only when no text extraction tool is available). Replace each matching <!-- KB-VISION page N --> placeholder in the Markdown copy with the page's text, keeping headings and section numbers. This happens once per page. If a page cannot be read, leave its placeholder and tell the person which document and page, with the rais-help note.--set-entry with its summary, consult-when, and key sections (and --title or --type if the script guessed wrong). Never edit INDEX.md; the script regenerates it._admin/proposals/ (format below). Apply it to PLAYBOOK.md only after approval, then archive it with --archive-proposal. Never overwrite the person's own edits to PLAYBOOK.md._admin/retired/. Do not use rm anywhere in the folder.python3; install pandoc or poppler (pdftotext) there if missing and allowed. If a converter cannot be installed, stage only the files that need it into the sandbox, convert them there, and commit the Markdown back. If no shell is available on the person's computer at all, say so plainly and give the rais-help note; do not convert documents by reading them whole.The rais-help note, whenever something needs RAIS, is a short message the person can send as it stands
If you'd like RAIS to look at it, send this to [email protected].
Subject: Knowledge base file won't convert One file in my knowledge base didn't convert. (). Thank you.
Run python3 <script> --root "<connected folder>" --check first.
no-kb → Create.legacy → Upgrade, then continue as Update.Say, as written, then ask the multiple-choice question (AskUserQuestion when available) with options Yes and No.
Tip. If your team will share this knowledge base, keep its folder in SharePoint. Email [email protected] if you need help setting that up.
Do you already have a folder of reference files?
Do not continue until the folder shows as connected.
Ask, with two options.
Will you use this knowledge base for contract review?
- Yes (I'll also build a playbook of your standard positions)
- No (just questions and lookups)
Remember the answer; it decides whether Steps 4 and 5 write a playbook. Record it by writing purpose: contract-review or purpose: reference as the first line of _admin/CHANGELOG.md when the folder is created.
List every file in the folder with type, size, and date. Do not open any file. Mark each as a reference document, an older version of another file, or not reference material (draft, redline, correspondence). Flag duplicates, version chains (v1, final, FINAL2), and probable scans. Say, in this form
I found 34 files.
- 28 look like reference documents (policies, standard agreements, guidance, prior agreements)
- 4 look like older versions of other files
- 2 look like drafts or redlines, which don't belong in a knowledge base
Here's the full list with how I sorted each one. [table]
Anything to change? If it looks right, say so and I'll continue.
Wait for the answer. Files that are not reference material are left where they are and excluded with assign.tsv (type skip), not moved. Mention once that they can delete them or leave them.
Ask, as written, with options Yes, No, and Not sure.
Do you have your own playbook? A document listing your standard positions, what you can accept, and when to escalate, like a quick guide or cheat sheet. Not your standard contract.
Give that file the type playbook in assign.tsv.
Write assign.tsv (path relative to the folder, a tab, a type such as policy, template, guidance, example, external, reference, playbook, or skip), then run
python3 <script> --root "<connected folder>" --apply --assign assign.tsv
Say "Converting your files now. This takes a few minutes." before running it. Read any claude_pages as core rule 2 describes. Then say
Done. 31 files converted.
If anything is in needs_attention, add
One file didn't convert, Old MTA scan.pdf. If you'd like RAIS to look at it, send this to [email protected].
[the rais-help note]
Then say, and start without waiting
Now I'm reading each document once to write your index and playbook. I'll let you know when it's ready.
(For a lookup-only knowledge base, "write your index".)
Work through every document the script lists as unindexed, in batches of ten. Read each Markdown copy once and run
python3 <script> --root "<folder>" --set-entry "docs/<path>.md" --summary "<two lines, what it covers and what it decides>" --consult "<the questions or clause types this answers>" --sections "<section names or numbers worth jumping to>"
Progress survives a cutoff, because an indexed document is marked in its own file. If the session ends, the next conversation that uses the folder sees what is unindexed and finishes it.
For contract review, then write PLAYBOOK.md, under roughly 5,000 tokens. If the person has their own playbook, start from it, keep its positions and wording where they are clear, and reconcile it against the other documents. Their playbook wins over other guidance unless a controlling standard says otherwise, and any conflict is marked REVIEW. Otherwise draft from the documents. Use these sections in this order.
docs/file.md § section. Use exactly those labels; they are what the Legal plugin expects.Default topics for sponsored research are effort standard, confidentiality, publication, export control, IP ownership, licensing, background IP, warranties, indemnification and liability, insurance, governing law and venue, financial terms, term and termination, use of name, survival and assignment, data terms (DUA), and material transfer terms (MTA). Where sources disagree, list both and mark the line REVIEW. Do not pick a winner.
Then present the playbook and every REVIEW line as choices, in this form, and wait.
Your playbook is ready here. Look it over when you like.
Three places where your documents disagree. Pick one for each.
1. Publication review period ○ 30 days (Fallback Language.docx) ○ 60 days (SRA Quick Guide 2025.docx)
Answer with the numbers, like "1 first, 2 second," or tell me in your own words.
Apply their choices, remove the REVIEW marks, and confirm in one line, for example "Done. Your playbook now says 60 days, silent on governing law is acceptable, and no indemnification cap."
Write CLAUDE.md at the top of the person's folder (append a "Knowledge base" section if one exists).
# Knowledge base
This folder is a knowledge base. Claude's working files are in "Claude files (Claude manages)".
Once per conversation, the first time this folder is used, run
python3 "Claude files (Claude manages)/_admin/kb_sync.py" --root "<this folder>" --check
from a shell on the computer that holds this folder. It takes under a second and reads no documents.
If it reports changes, say how many files changed and offer to update the knowledge base. If it reports
pending proposals, say how many playbook changes are waiting and offer to review them. If it reports
current and nothing waiting, say nothing. If no shell is available, skip it.
To answer a question, use "Claude files (Claude manages)/INDEX.md" to pick the one or two documents to open,
or search the text under "Claude files (Claude manages)/docs/" for exact wording. Cite the document and section.
If the documents don't cover something, say so rather than guessing.
Never list or scan the docs folder, and never open "_admin/".
Write working output (reviews, findings, drafts) to the matter's own folder, never into this one.
For contract review, add these lines to CLAUDE.md and also write legal.local.md.
CLAUDE.md addition
"Claude files (Claude manages)/PLAYBOOK.md" is the only playbook and knowledge source for contract work here.
Any skill that asks for a playbook, standard positions, or policies uses it instead of a playbook bundled with
a plugin or generic defaults. Read it in full at the start of a review or a question about our positions.
If the playbook is silent on a topic, say so. If more than one knowledge base is connected, read each playbook;
where they conflict, the personal one wins and the conflict is noted.
legal.local.md
# Playbook
The playbook for review-contract, triage-nda, legal-risk-assessment, and legal-response is
"Claude files (Claude manages)/PLAYBOOK.md" in this folder. Read it in full. It defines standard positions,
acceptable ranges, and escalation triggers. For exact wording, look the document up in
"Claude files (Claude manages)/INDEX.md" and open only the docs/ file named there. Do not use any other playbook.
Then finish with this message, using Finder or File Explorer as the platform dictates. Drop the contract sentence for a lookup-only knowledge base.
Your knowledge base is ready to use.
Start a new chat and drag this folder from Finder onto it, or use the Add folder button. Then ask a question, or attach a contract and ask me to check it.
To update it, just add or remove files in your folder in Finder. I'll pick up the changes next time you use it.
Want to share it with colleagues? Put the folder in SharePoint, and anyone who connects it gets the same knowledge base. Ask me for tips, or email [email protected] for help setting it up.
If they ask for tips, give three. Move the folder into SharePoint and connect it from there. Set it to always keep files on this device. Give edit access only to the few people who will add documents.
The check at the start of a conversation (see CLAUDE.md above) finds changes and pending proposals. The person can also ask at any time.
--plan. It changes nothing.--apply. For each JSON line, do what its next field says.
--set-entry, and if the document changes a position, write a proposal.--set-entry if the summary, scope, or date changed. Search PLAYBOOK.md for lines citing the file and write a proposal for any the diff affects.playbook_conflicts, show the person the differences between PLAYBOOK.md and the conflicted copy, ask which to keep, then move the other into _admin/retired/ with mv.--set-entry.One file per change in _admin/proposals/, named <date>-<topic slug>.md.
# Proposal: <one line>
Source: docs/<file>.md § <section>, added <date>
Topic: <playbook topic>
## Current playbook text
<the exact lines, or "none, this is new">
## Proposed text
<the replacement lines>
## Why
<one or two sentences>
For each file in _admin/proposals/ (not its subfolders), show the current text, the proposed text, and why, then ask "Apply, skip for now, or decline?" On apply, edit PLAYBOOK.md with the proposed text and run --archive-proposal <name> --as applied. On decline, --as declined. On skip, leave it. End with one line, for example "Applied 2, declined 1."
A folder built by version 0.9 has a "Source files (you manage)" subfolder and _admin/MANIFEST.json. Say "Your knowledge base was built by an earlier version. I'll move it to the new layout, which keeps everything and changes nothing in your documents." Run --upgrade. It moves the documents up into the folder, writes each record and index entry into its document's copy, retires the manifest and old index, and regenerates INDEX.md. Rewrite CLAUDE.md and legal.local.md as in Step 7 (contract review if legal.local.md existed). Then continue as Update. If the output lists collisions, tell the person which files were left in the old subfolder because a file with the same name already existed.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub raisdev/skills-hub --plugin rais-kb