Skip to content

nanocoai/nanoclaw / .claude/skills/add-atomic-chat-tool

add-atomic-chat-tool

Verified

Add Atomic Chat MCP server so the container agent can call local models served by the Atomic Chat desktop app via its OpenAI-compatible API.

FileKindSize
REMOVE.mdmarkdown1.6 KB
SKILL.mdskill md10.2 KB
atomic-chat-env.tsscript1.0 KB
atomic-chat-mcp-stdio.tsscript6.8 KB
atomic-chat-registration.test.tsscript2.3 KB
atomic-chat-wiring.test.tsscript2.1 KB

atomic-chat-registration.test.ts

View on GitHub
/**
 * Wiring test for the MCP-server registration integration point (container/Bun tree).
 *
 * The handlers are behavior-tested in atomic-chat-mcp-stdio.test.ts, but that does not
 * prove the server is registered — delete the index.ts entry and the tool simply never
 * appears, yet the handler test stays green. index.ts is the container boot entry and is
 * not cheaply invocable, so we assert the registration structurally: the `mcpServers`
 * object literal has an `atomic_chat` property whose command runs `atomic-chat-mcp-stdio.ts`.
 */
import fs from 'fs';
import path from 'path';

import { describe, it, expect } from 'bun:test';
import ts from 'typescript';

function sourceFile(): ts.SourceFile {
  const p = path.join(import.meta.dir, 'index.ts');
  return ts.createSourceFile(p, fs.readFileSync(p, 'utf8'), ts.ScriptTarget.Latest, true);
}

/** Find the object literal assigned to `const mcpServers = { ... }`. */
function mcpServersLiteral(sf: ts.SourceFile): ts.ObjectLiteralExpression | undefined {
  let found: ts.ObjectLiteralExpression | undefined;
  const visit = (node: ts.Node) => {
    if (
      ts.isVariableDeclaration(node) &&
      ts.isIdentifier(node.name) &&
      node.name.text === 'mcpServers' &&
      node.initializer &&
      ts.isObjectLiteralExpression(node.initializer)
    ) {
      found = node.initializer;
    }
    if (!found) ts.forEachChild(node, visit);
  };
  visit(sf);
  return found;
}

function property(obj: ts.ObjectLiteralExpression, name: string): ts.PropertyAssignment | undefined {
  return obj.properties.find(
    (p): p is ts.PropertyAssignment =>
      ts.isPropertyAssignment(p) &&
      ((ts.isIdentifier(p.name) && p.name.text === name) ||
        (ts.isStringLiteral(p.name) && p.name.text === name)),
  );
}

describe('index.ts registers the atomic_chat MCP server', () => {
  const obj = mcpServersLiteral(sourceFile());

  it('finds the mcpServers object literal', () => {
    expect(obj).toBeDefined();
  });

  it('has an atomic_chat entry', () => {
    expect(obj && property(obj, 'atomic_chat')).toBeDefined();
  });

  it('points atomic_chat at atomic-chat-mcp-stdio.ts', () => {
    const entry = obj && property(obj, 'atomic_chat');
    const text = entry ? entry.getText() : '';
    expect(text).toContain('atomic-chat-mcp-stdio.ts');
  });
});
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: 472kUpdated 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