Skip to content

nanocoai/nanoclaw / .claude/skills/add-cursor

add-cursor

Flagged

Use Cursor (local Agent SDK) as a full agent provider — planning, tool orchestration, MCP tools, session resume — alongside or instead of Claude. Cursor-account sign-in or API key, held by the credential gateway. Per-group via `ncl groups config update --provider cursor`. Distinct from using Cursor as a cloud agent (those run on Cursor VMs and are not this provider).

payload/src/providers/cursor.ts

View on GitHub
/**
 * Host-side container config for the `cursor` provider.
 *
 * On a contract core every agent-facing surface — the composed AGENTS.md, the
 * `.cursor-shared` state volume at ~/.cursor, and the Cursor-native skill
 * directories — is declared in src/provider-contracts/cursor.ts and realized by
 * core, which tells this adapter so through `coreOwnsProviderSurfaces`. What
 * remains here is the one thing a contract cannot declare: the environment.
 *
 * The long-lived credential stays in the vault. The container receives
 * `CURSOR_API_KEY=cursor_placeholder_nanoclaw` so `@cursor/sdk` emits an
 * Authorization header that the credential gateway rewrites on the user-key
 * exchange and model-discovery routes. Whether the vaulted value came from
 * Cursor-account sign-in or a pasted dashboard key is invisible inside the
 * container.
 */
import fs from 'fs';
import path from 'path';

import { DATA_DIR } from '../config.js';
import { registerProviderContainerConfig } from './provider-container-registry.js';

/** Sentinel so the SDK always sends Authorization for the gateway to overwrite. */
export const CURSOR_API_KEY_PLACEHOLDER = 'cursor_placeholder_nanoclaw';

registerProviderContainerConfig(
  'cursor',
  (ctx) => {
    const coreOwnsProviderSurfaces = (ctx as typeof ctx & { coreOwnsProviderSurfaces?: true }).coreOwnsProviderSurfaces;
    const env = { CURSOR_API_KEY: CURSOR_API_KEY_PLACEHOLDER };
    if (coreOwnsProviderSurfaces) return { env };

    // Pre-contract core only: the per-group state directory the SDK's local
    // agent store lives in, mounted at ~/.cursor. The project document and
    // skill directories are contract surfaces and are not composed here.
    const cursorDir = path.join(DATA_DIR, 'v2-sessions', ctx.agentGroupId, '.cursor-shared');
    fs.mkdirSync(cursorDir, { recursive: true });
    return {
      mounts: [{ hostPath: cursorDir, containerPath: '/home/node/.cursor', readonly: false }],
      env,
    };
  },
  { providesAgentSurfaces: true },
);
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall