From Foldspace: Add to Your App
Write the code so the agent can perform one defined action in the user's app. Use when the user wants to implement an action, build a handler, connect an approved action to their frontend, or make the agent actually do something in the product.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foldspace-codebase-plugin:foldspace-build-actionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`foldspace-get-started` -> `foldspace-setup-agent` -> `foldspace-discover-actions` -> `foldspace-plan-action` -> `foldspace-build-action` -> `foldspace-verify-actions`.
foldspace-get-started -> foldspace-setup-agent -> foldspace-discover-actions -> foldspace-plan-action -> foldspace-build-action -> foldspace-verify-actions.
You are here: step 4 — build the action (write the handler code).
Prerequisites: The agent is set up, users are connected, and an approved Foldspace action schema or spec exists.
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:
If action metadata or schema is missing and the action has been defined through
the Foldspace web app, ask to fetch it from MCP. If it is a brand-new action with
no spec, route to foldspace-plan-action before coding.
Guide the user through implementing Foldspace SDK actions that match their Foldspace action schemas and local application architecture.
Foldspace is a low-code LLM platform for B2B SaaS. The key invariant is that the return value of any Foldspace action goes directly back to the LLM agent. Return concise, safe data that helps the agent decide what to say or do next.
If this is the first time mentioning these implementation modes in the conversation, briefly say: "(If you are not familiar with what a Chatterblock, Text-Only action, or Shared State is, let me know and I can explain better!)"
For product objects referenced internally by stable IDs, preserve the approved resolver-first design: reusable resolver actions should accept human-friendly references and return stable IDs, while primary actions should accept those IDs. Do not merge reusable lookup and primary execution into one handler just because it is faster to code.
Always read error-handling.md before writing or reviewing any action handler.
Error handling is part of the required workflow, not optional reference material.
Always read action-design.md before planning or implementing handler
behavior. The handler should preserve the approved product outcome, modality,
exit criteria, and loop-safety assumptions.
Read other references only when needed:
action-design.md.action-modalities.md.shared-state.md.Follow these steps in order. Pause where instructed.
Discover action metadata.
foldspace_overview, list_agents, and list_actions.get_action_schema for each
selected actioncreate_action before coding.update_action after the user approves the change.Scan the host codebase.
Plan the product behavior.
action-design.md.Verify Foldspace SDK initialization.
foldspace.js and includes a product
key such as EU-$productId-1-1.foldspace.agent('agentName').show()
inside a foldspace('when', 'ready', ...) callback.foldspace-setup-agent and pause.Implement the handlers.
error-handling.md before editing code.execute in try/catch.awaitUserInput: true, render accessible UI,
call callback with safe data, and wire cancellation.Review the wiring.
error-handling.md before reviewing the final handler behavior.addActionHandlers.error-handling.md.Offer Shared State.
Recommended next-step routing: After implementation, recommend
foldspace-verify-actions for a focused action wiring audit, or
another foldspace-build-action pass for the next approved action.
Always end with:
Summary:
- Completed: <what was done or learned>
- Concepts: <Foldspace terms introduced, e.g. action handler, return value goes to the agent>
- If you did this yourself: match the handler's action ID to the Foldspace action exactly, validate inputs, and return only small, safe data.
- Next step: <one recommended `foldspace-*` skill with concrete inputs>
- Blockers: <missing schema, MCP access, approval, or None>
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub eucera/mcp-plugins --plugin foldspace-codebase-plugin