Skip to content

x402agent/SolanaOS / skills/openclaw-claude-code-skill-main

claude-code-skill

Verified

Control Claude Code via MCP protocol. Trigger with "plan" to write a precise execution plan then feed it to Claude Code. Also supports direct commands, persistent sessions, agent teams, and advanced tool control.

FileKindSize
.gitignoreother277 B
LICENSEother1.0 KB
README.mdmarkdown13.9 KB
SKILL.mdskill md16.0 KB
examples/basic-mcp.tsscript1.4 KB
examples/chat-store.tsscript3.6 KB
mcp_config.example.jsonconfig648 B
package-lock.jsonmanifest20.9 KB
package.jsonmanifest679 B
src/index.tsscript35.3 KB
src/mcp/actions.tsscript9.4 KB
src/mcp/client.tsscript1.4 KB
src/mcp/index.tsscript189 B
src/mcp/logger.tsscript1.2 KB
src/mcp/types.tsscript3.2 KB
src/mcp/utils.tsscript477 B
src/store/index.tsscript148 B
src/store/indexeddb-storage.tsscript1.6 KB
src/store/persist.tsscript2.2 KB
src/store/sync.tsscript3.1 KB
tsconfig.jsonconfig399 B

src/store/persist.ts

View on GitHub
/**
 * Persistent Store Factory - Creates Zustand stores with persistence
 */

import { create } from "zustand";
import { combine, persist, createJSONStorage, StateStorage } from "zustand/middleware";

type SecondParam<T> = T extends (
  _f: infer _F,
  _s: infer S,
  ...args: infer _U
) => any
  ? S
  : never;

type MakeUpdater<T> = {
  lastUpdateTime: number;
  _hasHydrated: boolean;

  markUpdate: () => void;
  update: (updater: (state: T) => void) => void;
  setHasHydrated: (state: boolean) => void;
};

type SetStoreState<T> = (
  partial: T | Partial<T> | ((state: T) => T | Partial<T>),
  replace?: boolean | undefined,
) => void;

/**
 * Deep clone utility
 */
function deepClone<T>(obj: T): T {
  return JSON.parse(JSON.stringify(obj));
}

/**
 * Create a persistent store with automatic hydration tracking
 */
export function createPersistStore<T extends object, M>(
  state: T,
  methods: (
    set: SetStoreState<T & MakeUpdater<T>>,
    get: () => T & MakeUpdater<T>,
  ) => M,
  persistOptions: SecondParam<typeof persist<T & M & MakeUpdater<T>>>,
  storage?: StateStorage,
) {
  if (storage) {
    persistOptions.storage = createJSONStorage(() => storage);
  }

  const oldOnRehydrateStorage = persistOptions?.onRehydrateStorage;
  persistOptions.onRehydrateStorage = (state) => {
    oldOnRehydrateStorage?.(state);
    return () => state.setHasHydrated(true);
  };

  return create(
    persist(
      combine(
        {
          ...state,
          lastUpdateTime: 0,
          _hasHydrated: false,
        },
        (set, get) => {
          return {
            ...methods(set, get as any),

            markUpdate() {
              set({ lastUpdateTime: Date.now() } as Partial<
                T & M & MakeUpdater<T>
              >);
            },
            update(updater: (state: T) => void) {
              const state = deepClone(get());
              updater(state);
              set({
                ...state,
                lastUpdateTime: Date.now(),
              });
            },
            setHasHydrated: (state: boolean) => {
              set({ _hasHydrated: state } as Partial<T & M & MakeUpdater<T>>);
            },
          } as M & MakeUpdater<T>;
        },
      ),
      persistOptions as any,
    ),
  );
}
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