Solizardking/clawd-bot / agent/skills/clawd-code-skill
clawd-code-skill
VerifiedControl Clawd Code via MCP protocol. Trigger with "plan" to write a precise execution plan then feed it to Clawd Code. Also supports direct commands, persistent sessions, agent teams, and advanced tool control.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| README.md | markdown | 13.8 KB |
| SKILL.md | skill md | 15.5 KB |
| examples/basic-mcp.ts | script | 1.4 KB |
| examples/chat-store.ts | script | 3.6 KB |
| mcp_config.example.json | config | 648 B |
| package-lock.json | manifest | 20.9 KB |
| package.json | manifest | 674 B |
| src/index.ts | script | 35.2 KB |
| src/mcp/actions.ts | script | 9.4 KB |
| src/mcp/client.ts | script | 1.4 KB |
| src/mcp/index.ts | script | 189 B |
| src/mcp/logger.ts | script | 1.2 KB |
| src/mcp/types.ts | script | 3.2 KB |
| src/mcp/utils.ts | script | 477 B |
| src/store/index.ts | script | 148 B |
| src/store/indexeddb-storage.ts | script | 1.6 KB |
| src/store/persist.ts | script | 2.2 KB |
| src/store/sync.ts | script | 3.1 KB |
| tsconfig.json | config | 399 B |
src/store/sync.ts
View on GitHub/**
* State Sync Utilities - Merge local and remote states
*/
/**
* Deep merge utility
*/
export function merge<T extends object>(target: T, source: Partial<T>): T {
for (const key of Object.keys(source) as (keyof T)[]) {
const sourceValue = source[key];
const targetValue = target[key];
if (
sourceValue !== undefined &&
typeof sourceValue === "object" &&
sourceValue !== null &&
!Array.isArray(sourceValue)
) {
if (typeof targetValue !== "object" || targetValue === null) {
(target as any)[key] = {};
}
merge(target[key] as object, sourceValue as object);
} else if (sourceValue !== undefined) {
(target as any)[key] = sourceValue;
}
}
return target;
}
/**
* Get non-function fields from an object
*/
export function getNonFunctionFields<T extends object>(obj: T) {
const ret: any = {};
Object.entries(obj).map(([k, v]) => {
if (typeof v !== "function") {
ret[k] = v;
}
});
return ret;
}
/**
* Merge state with lastUpdateTime - older state will be overridden
*/
export function mergeWithUpdate<T extends { lastUpdateTime?: number }>(
localState: T,
remoteState: T,
): T {
const localUpdateTime = localState.lastUpdateTime ?? 0;
const remoteUpdateTime = remoteState.lastUpdateTime ?? 1;
if (localUpdateTime < remoteUpdateTime) {
merge(remoteState, localState);
return { ...remoteState };
} else {
merge(localState, remoteState);
return { ...localState };
}
}
/**
* Session-like data structure for chat history
*/
export interface Session {
id: string;
messages: Array<{ id: string; date: string | Date; [key: string]: any }>;
lastUpdate: string | Date;
[key: string]: any;
}
/**
* Merge sessions - combines messages from local and remote
*/
export function mergeSessions(
localSessions: Session[],
remoteSessions: Session[],
): Session[] {
const localSessionMap: Record<string, Session> = {};
localSessions.forEach((s) => (localSessionMap[s.id] = s));
remoteSessions.forEach((remoteSession) => {
// Skip empty chats
if (remoteSession.messages.length === 0) return;
const localSession = localSessionMap[remoteSession.id];
if (!localSession) {
// Remote session is new, add it
localSessions.push(remoteSession);
} else {
// Both have same session id, merge messages
const localMessageIds = new Set(localSession.messages.map((v) => v.id));
remoteSession.messages.forEach((m) => {
if (!localMessageIds.has(m.id)) {
localSession.messages.push(m);
}
});
// Sort messages by date ascending
localSession.messages.sort(
(a, b) => new Date(a.date).getTime() - new Date(b.date).getTime(),
);
}
});
// Sort sessions by lastUpdate descending
localSessions.sort(
(a, b) =>
new Date(b.lastUpdate).getTime() - new Date(a.lastUpdate).getTime(),
);
return localSessions;
}
/**
* Merge key-value stores - remote values first, then local overrides
*/
export function mergeKeyValueStore<T extends Record<string, any>>(
localStore: T,
remoteStore: T,
): T {
return {
...remoteStore,
...localStore,
};
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 466k | Updated | Claude CodeCodex | Verified | Install |
| 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: 466k | Updated | Claude CodeCodex | Verified | Install |
| 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: 319k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |