From Foldspace: Add to Your App
Add a Foldspace AI agent to a website the user can edit and connect it to logged-in users. Use when the user wants to install Foldspace, add the agent snippet, set up Foldspace for the first time, connect auth or login data, check whether Foldspace is installed correctly, or make the agent know who is signed in.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foldspace-codebase-plugin:foldspace-setup-agentThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill gets the Foldspace agent onto a website you can edit and connects it
This skill gets the Foldspace agent onto a website you can edit and connects it to your logged-in users. It is one milestone with two parts:
foldspace-get-started -> foldspace-setup-agent -> foldspace-discover-actions -> foldspace-plan-action -> foldspace-build-action -> foldspace-verify-actions.
You are here: step 1 — set up the agent.
Skipped a step? Ask what is already complete and route the user to the earliest incomplete prerequisite.
As you work, explain these to the user in plain language so they understand what is happening and could do it themselves next time:
Before each part, tell the user in plain language: what Foldspace piece you are touching, why it matters, and what file you will change. Keep it to a sentence or two, then act. If they say "just do it," skip the narration but still fill in the "What We Did" and "If You Did This Yourself" blocks at the end.
Both parts need values from Agent Studio. If the product key or Agent API Name is missing, pause and ask the user to copy them from the setup snippet in Agent Studio before editing code (Agent Studio -> Setup, e.g. https://app.foldspace.ai/agent/{agent-id}/setup/agent-settings). Do not invent product keys or Agent API Names.
If Part A (the snippet) is not done yet, do Part A first. If the snippet is already present, you can skip straight to Part B.
When setting up Part A, ask for the full Agent Studio SDK snippet. Prefer parsing the needed values from that snippet instead of asking the user to derive them manually:
EU-EXAMPLEPRODUCT-1-1 -> product key
EU-EXAMPLEPRODUCT-1-1 and product ID EXAMPLEPRODUCT when a product ID constant
is useful locally.foldspace.agent('example-agent') or
foldspace.agent({ apiName: 'example-agent' }) -> Agent API Name
example-agent.If the snippet does not include the agent initialization call, ask for the Agent API Name from Agent Studio. Never invent product keys or Agent API Names.
Docs:
Plain-language goal: get the Foldspace agent to load and show up on the site.
Find the frontend entry points.
app/layout.tsx, root provider, or next/script.pages/_document.tsx, pages/_app.tsx, or
next/script.index.html, root app shell, or bootstrap file.Check for the SDK snippet.
foldspace.js, window.foldspace, __FOLD_SPACE__, and
foldspace('when', 'ready').foldspace command queue and loads the SDK script
with the product key. Preserve the snippet from Agent Studio unless the
app's framework requires adapting script placement.Verify agent initialization.
const AGENT_API_NAME = "agent-api-name";
foldspace("when", "ready", () => {
foldspace.agent(AGENT_API_NAME).show();
});
Review placement and visibility behavior.
show(), hide(), open(),
close(), and remove().Verify in the running app when possible.
window.foldspace exists after the script loads.Apply safety checks.
Plain-language goal: tell Foldspace who is signed in, so the agent can
personalize and Foldspace can attribute activity to the right user and account.
In code this is foldspace.identify(context).
User context requires:
user.idsubscription.idOptional attributes can include:
email, name, role, image, phone, timezone, signUpDate,
and location.Find the auth/session source.
Confirm the agent is initialized.
foldspace('when', 'ready') and
foldspace.agent(...) exist. If not, finish Part A first.Design the context mapping.
user.id to the stable app user identifier.subscription.id to the stable account, workspace, organization, or
tenant identifier.Plan lifecycle behavior.
foldspace.identify(context) inside foldspace('when', 'ready', ...)
after auth context is loaded.Implement or review.
Validate.
user.id and subscription.id are always present before identify.## Foldspace Setup Status
### Part A — Agent Snippet
- SDK snippet:
- Product key:
- Agent API name:
- Agent initialization:
- Visibility behavior:
- Runtime verification:
### Part B — Logged-In Users
- Auth/session source:
- User ID mapping:
- Subscription ID mapping:
- Optional attributes:
- Lifecycle behavior:
- Privacy/safety notes:
### Findings
- Concrete gaps, risks, or confirmed-ready areas with file paths when available.
### What We Did (and Why)
- <bullet per major step: action taken + one-line reason>
### If You Did This Yourself
- Agent Studio: copy the setup snippet and Agent API Name from Agent Studio -> Setup.
- Docs: https://foldspace.readme.io/docs/installing-the-sdk (load the agent), https://foldspace.readme.io/docs/user-context (connect logged-in users).
- Manual steps: 1) paste the snippet at your app's root, 2) initialize the agent on ready, 3) call `foldspace.identify` with `user.id` and `subscription.id` after login.
Recommended next-step routing: When the agent loads and users are connected,
recommend foldspace-discover-actions if the user does not know what to build,
or foldspace-build-action if approved action plans already exist.
Always end with:
Summary:
- Completed: <what was done or learned>
- Concepts: <new Foldspace terms the user should now understand, e.g. SDK snippet, user context, Agent API Name>
- If you did this yourself: <one sentence pointer to Agent Studio or docs>
- Next step: <one recommended `foldspace-*` skill with concrete inputs>
- Blockers: <missing product key, Agent API Name, auth source, or None>
npx claudepluginhub eucera/mcp-plugins --plugin foldspace-codebase-pluginCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.