From lore
Walk the user through connecting the Lore plugin to the current project — credentials, namespace schema addendum, and optional seeding from recent GitHub PRs. Invoke this when the user has just installed the Lore plugin, when they explicitly ask to (re)configure Lore for this project, when a SessionStart hook flags that the project is unconfigured, or when a teammate has cloned a repo that already has `.lore.env` committed and needs to add their own API key.
How this skill is triggered — by the user, by Claude, or both
Slash command
/lore:lore-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Lore configuration is **per-project**. Every repo that wants Lore memory has its own:
Lore configuration is per-project. Every repo that wants Lore memory has its own:
.lore.env — committed to git, shared with the team, contains LORE_APP and LORE_NAMESPACE..lore.env.local — gitignored, per-developer, contains LORE_API_KEY.There is no global config. Each teammate runs /lore-setup in the repo to add their own API key; the app/namespace wiring is inherited from what's already committed.
Walk the user through three phases:
At each step, confirm with the user before writing anything. If they want to skip a step, skip it and move on — do not re-prompt.
Run this to find the project root (git top-level):
git rev-parse --show-toplevel 2>/dev/null || pwd
Call this $PROJECT_ROOT in your head. Now detect which scenario you're in by checking which files exist:
$PROJECT_ROOT/.lore.env | $PROJECT_ROOT/.lore.env.local | Scenario |
|---|---|---|
| missing | missing | A — Fresh project |
| present | missing | B — Teammate onboarding |
| present | present | C — Reconfigure existing project |
Tell the user in one sentence which scenario they're in so they know what to expect. Then proceed to 1b.
Scenario A (Fresh project) — ask for all three:
lore_sk_. From the Lore dashboard under the app's "Keys" tab. Secret: never log it, never echo it back in full, never paste it into git-tracked files.personal, work, research). Shown on the dashboard next to the app name.default, books, projects). If the user only has one namespace, use that.Scenario B (Teammate onboarding) — read the existing values and ask only for the API key:
bash -c 'source "$PROJECT_ROOT/.lore.env" && echo "app=$LORE_APP namespace=$LORE_NAMESPACE"'
Show the user what's already committed (This project is wired to <app>/<namespace>) and ask for just their API key. They do not pick the app or namespace — those are the team's.
Scenario C (Reconfigure) — read existing values, show them, and ask what the user wants to change:
bash -c 'source "$PROJECT_ROOT/.lore.env" && echo "app=$LORE_APP namespace=$LORE_NAMESPACE"'
Ask: "Currently wired to <app>/<namespace>. What do you want to change — the API key, the app/namespace, or both?" Collect only the values they're changing; keep the rest.
Once you have the values, invoke setup.sh via Bash, passing them as environment variables so they never appear in shell history:
Scenario A:
LORE_API_KEY='<key>' LORE_APP='<app>' LORE_NAMESPACE='<namespace>' \
bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh"
Scenario B (only API key — setup.sh reads app/namespace from the existing .lore.env):
LORE_API_KEY='<key>' bash "${CLAUDE_PLUGIN_ROOT}/scripts/setup.sh"
Scenario C: pass whichever subset of LORE_API_KEY, LORE_APP, LORE_NAMESPACE the user is changing. Unspecified values are inherited from the existing .lore.env.
What setup.sh does:
.lore.env found by walk-up). Refuses to write at $HOME..lore.env.local is already git-ignored at the project root. If not, it appends .lore.env.local to $PROJECT_ROOT/.gitignore (creating the file if needed) before writing the secret file. Tell the user if this happened — they may want to commit the .gitignore change..lore.env (mode 644) with LORE_APP + LORE_NAMESPACE (+ optional LORE_API_BASE if non-default). Only re-writes when values actually changed..lore.env.local (mode 600) with just LORE_API_KEY.GET /v1/apps/<app>/namespaces/<namespace>/index. Prints OK — connected... or an error.On failure: show the exact error. Common issues:
API key rejected (HTTP 401/403) — the key is wrong or scoped to a different app. Re-ask for the key and re-run.app or namespace not found (HTTP 404) — the app slug or namespace slug is wrong, or the namespace hasn't been created yet. Ask the user to double-check on the Lore dashboard.could not reach... — network problem. Not the user's config; tell them and stop.Do not proceed to phase 2 until verification succeeds.
On success: briefly confirm (Connected to Lore as <app>/<namespace>. Config written to <project-root>/.lore.env + .lore.env.local.) and continue to phase 2. If setup.sh created or modified .gitignore, mention that the user should git add .gitignore and probably also git add .lore.env (but not .lore.env.local).
The schema addendum is a short markdown document that tells the Lore worker how to organize this namespace's wiki. It's per-namespace, not per-project — so if multiple projects share a namespace, the addendum is shared too.
Scenario B note: when onboarding a teammate to an existing project, the schema addendum is probably already set by whoever ran setup first. Still run 2a to check, and only replace it if the user explicitly asks to.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/set-schema.sh" get
Ask an open-ended question, tuned to their likely use case:
Let them answer in whatever form is natural — a list, a paragraph, a few keywords. Do not force a template.
Turn their answer into a concise markdown document. Keep it under ~30 lines. It should:
Example skeleton (adapt to the user's actual answer — do not paste this verbatim):
# Namespace: <app>/<namespace>
This namespace holds long-term context about <short summary of user's intent>.
## Entity kinds
- **Projects** — one file per active or recently-finished project, with status, goals, key decisions, and related people.
- **People** — one file per collaborator or contact, with their role, preferences, and ongoing threads.
- **Decisions** — durable decisions and their rationale, cross-linked to the projects they affect.
- **Preferences** — the user's preferences about tools, workflows, and style.
## Conventions
- Use `[[wikilinks]]` to cross-reference files by key.
- Prefer one concept per file; split long files when they cover multiple topics.
## Do not keep
- API keys, passwords, access tokens, or other secrets.
- Transient troubleshooting output.
- Anything the user asks to forget or mark private.
Show the drafted addendum to the user in a fenced code block and ask: "Here's what I'll save as the schema addendum for <app>/<namespace>. Want me to write this, tweak it, or skip?"
On approval, pipe it into the setter:
cat <<'LORE_ADDENDUM' | bash "${CLAUDE_PLUGIN_ROOT}/scripts/set-schema.sh" put
<the approved markdown>
LORE_ADDENDUM
Use a unique heredoc marker (LORE_ADDENDUM, not EOF) to avoid collisions with any EOF tokens in the addendum body. The script will print OK — schema addendum updated… on success. Report that briefly, then move on.
If the user wants to tweak it, incorporate their changes and re-show it before writing.
If this workspace is a GitHub repo, offer to pre-populate the wiki with the repo's recent PR history. This gives Claude immediate context on what has been built, by whom, and why — without waiting for the user to organically re-ingest it.
Scenario B note: on teammate onboarding, the PRs have probably already been seeded by an earlier run. Ask the user whether to re-seed — default to no.
Check, in order:
git rev-parse --is-inside-work-tree — if it errors, skip phase 3 entirely.origin remote? Run git remote get-url origin and check the URL matches github.com. If not, skip.gh installed and authenticated? Run gh auth status. If not, mention to the user that you could seed from GitHub PRs if they install/auth gh, then skip.If all three pass, proceed to 3b.
Tell the user what you'd do, concretely:
"This workspace is a GitHub repo (
owner/repo). I can seed your Lore namespace with up to the last 500 PRs — each one gets ingested as a single markdown record with its title, author, description, state, and labels. The Lore worker will integrate them into your wiki over the next minute or two. This runs locally viagh, nothing else gets sent anywhere besides your own Lore namespace. Want me to go ahead? If you prefer a smaller number, say how many."
Wait for explicit consent. If the user says no or doesn't answer clearly, skip this phase.
With consent, invoke the seeding script. Pass the limit the user chose (or the default 500):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/ingest-github-prs.sh" <limit>
The script streams per-PR progress to stderr ([ 1/250] ok #123 Title…) so you can show the user roughly where it is. It fails gracefully on individual PRs and prints a final summary line like Done. Ingested 247 PRs. Failures: 3.
Report the final counts in one sentence. Do not re-print the full progress log.
Tell the user setup is complete and summarize what just got wired up:
<project-root>/.lore.env (committed) and <project-root>/.lore.env.local (gitignored, your API key only).lore-memory skill — Claude can now read from and write to this project's Lore namespace._index will be pre-loaded into context automatically.If setup.sh touched .gitignore, remind the user to commit it: git add .gitignore .lore.env && git commit -m "Add Lore plugin project config".
Also mention: to change any of this later, they can re-run /lore-setup in the same project.
lore_sk_****..lore.env.local. The setup script enforces a strict .gitignore gate, but double-check: git check-ignore .lore.env.local at the project root should succeed.$HOME. setup.sh refuses this explicitly. If the user runs /lore-setup from their home directory (no project context), tell them to cd into a specific project first.Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub pielabsai/lore-plugin --plugin lore