From Foldspace: Browser Extension
Build the extension code for one agent action after the workflow is understood and approved. Use when the user wants to implement a remote action, write extension handler code, or connect a planned action to APIs observed on the live site.
How this skill is triggered — by the user, by Claude, or both
Slash command
/foldspace-remote-plugin:foldspace-build-actionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Remote extension path: `foldspace-get-started` -> `foldspace-create-extension` -> `foldspace-observe-flow-in-site` -> `foldspace-build-action` -> `foldspace-add-navigation` when needed -> `foldspace-verify-actions`.
Remote extension path: foldspace-get-started -> foldspace-create-extension -> foldspace-observe-flow-in-site -> foldspace-build-action -> foldspace-add-navigation when needed -> foldspace-verify-actions.
You are here: step 3 — build one remote action.
Prerequisites: Approved implementation plan, action schema, and live-site DevTools evidence for one action.
Skipped a step? Ask what is already complete and route the user to the earliest incomplete prerequisite.
If API evidence or user approval is missing, stop and route to foldspace-observe-flow-in-site before editing code.
Use this skill for one action at a time after foldspace-observe-flow-in-site has captured enough browser evidence and the user has approved an implementation plan.
As you build, explain these to the user in plain language so they understand the code and could extend it themselves:
Even if the user wants one main action, the implementation may need supporting resolver actions. For most product objects referenced internally by stable IDs, prefer a reusable resolver action that accepts a human-friendly reference and returns the stable ID plus lightweight match metadata. Then build primary actions around stable IDs.
Do not collapse a reusable lookup and the main execution into one action just because it is easier to code. Foldspace agents can call multiple actions in sequence, and small resolver actions keep future schemas cleaner.
foldspace-observe-flow-in-site handoff: agreed goal, exact user flow, API endpoints, request sequence, auth source, route needs, and missing evidence.foldspace_overview.list_agents to find the target agent.list_actions for that agent to see whether each resolver or primary action already exists.snake_case action keys with lowercase letters, numbers, and underscores only.update_action after the implementation plan is approved.create_action after the implementation plan is approved. Do not assume newly created actions are enabled or live.enable_action, launch_action_version, or toggle_action_enabled as appropriate after creation/update.list_actions, get_action, and get_action_schema.get_action as the final source of truth for action state.snake_case key in MCP, the local action registry, and any
docs or test prompts.isEnabled: true only when the user wants the action active.launchedVersion is present before treating the action as published/live.get_action_schema matches handler params.taskKey, Agent Studio instructions summary, input data, output schema, cache policy, streaming policy, and fallback behavior.runTask() until the user confirms the Function exists and provides the taskKey.awaitUserInput: true and implement render(data, host, header, callback, cancel).shareState(key, state, handler, stateDescription) and clearState(key) on cleanup.execute small and delegate API calls to api.ts.execute; do not register bare async functions.const actions = {
action_key: {
execute: async (params) => {
return {
success: true,
message: "Done",
};
},
},
};
(window as any).__FOLDSPACE_REMOTE_ACTIONS__ = actions;
const action_key = {
execute: async (params) => params,
awaitUserInput: true,
render: async (params, host, header, callback, cancel) => {
// Render UI, then call callback with safe data or cancel when dismissed.
},
};
agent/api/ or a reusable module instead of duplicating it.styles.ts, views/, or a common helper module.agent/api/, agent/utils.ts, agent/constants.ts, or shared UI/style files.agent.runTask() in a small helper and keep task input/output mapping explicit.AbortController or a shared timeout helper for network calls.{ success, message, data? } on success.{ success: false, error, message? } on failure.access_token, token, or value.For each action, report:
taskKey, input shape, output schema, cache policy, streaming policy, and fallback behavior.Use remote-action-reference.md for handler, modality, return-shape, and verification rules. Use task-agent-patterns.md only when the action needs Task Agent processing.
Recommended next-step routing: After implementation, recommend foldspace-add-navigation if the action needs routes, or foldspace-verify-actions if it is ready to verify.
Every implementation response must include these end-to-end local testing steps:
npm run dev
Then:
chrome://extensions.executed and finished for each expected action.401.After each implementation pass, explain what changed and recommend exactly one next step.
End every response with:
Summary:
- Completed: <one action plan approved and/or handler implemented>
- Concepts: <Foldspace terms introduced, e.g. handler-from-evidence, modality, Task Agent, plan approval gate>
- Evidence: <MCP schema, DevTools requests, API endpoints, files changed, and browser test result>
- Decisions: <modality, resolver split, auth source, timeout, return shape, confirmation behavior, Task Agent choices, reuse choices>
- Next step: <usually `foldspace-build-action` for the next action, `foldspace-add-navigation`, or `foldspace-verify-actions` with exact inputs>
- Blockers: <missing schema, API evidence, credentials, seed data, Task Agent Function in web app, implementation-plan approval, or user approval; use "None" if clear>
npx claudepluginhub eucera/mcp-plugins --plugin foldspace-remote-pluginCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.