nanocoai/nanoclaw / .claude/skills/add-ollama-tool
add-ollama-tool
VerifiedAdd Ollama MCP server so the container agent can call local models and optionally manage the Ollama model library.
| File | Kind | Size |
|---|---|---|
| REMOVE.md | markdown | 1.7 KB |
| SKILL.md | skill md | 11.8 KB |
| ollama-env.ts | script | 958 B |
| ollama-mcp-stdio.ts | script | 13.7 KB |
| ollama-registration.test.ts | script | 2.2 KB |
| ollama-wiring.test.ts | script | 2.1 KB |
ollama-wiring.test.ts
View on GitHub/**
* Wiring test for the host-side env-forwarding integration point (host/vitest tree).
*
* The env helper is behavior-tested in isolation, but that does not prove
* composeSessionSpec actually uses it — a direct unit test stays green even if
* the reach-in is deleted. composeSessionSpec is entangled with the gateway
* provider and not cheaply invocable here, so we assert the integration
* structurally: inside composeSessionSpec there is a `...ollamaEnv()`
* spread. Delete the reach-in and this goes red.
*/
import fs from 'fs';
import path from 'path';
import { describe, it, expect } from 'vitest';
import ts from 'typescript';
function sourceFile(): ts.SourceFile {
const p = path.resolve(process.cwd(), 'src/container-runner.ts');
return ts.createSourceFile(p, fs.readFileSync(p, 'utf8'), ts.ScriptTarget.Latest, true);
}
function findFunction(sf: ts.SourceFile, name: string): ts.FunctionDeclaration | undefined {
let found: ts.FunctionDeclaration | undefined;
const visit = (node: ts.Node) => {
if (ts.isFunctionDeclaration(node) && node.name?.text === name) found = node;
if (!found) ts.forEachChild(node, visit);
};
visit(sf);
return found;
}
/** Is this node a `...ollamaEnv()` spread (object or array position)? */
function isEnvSpread(node: ts.Node): boolean {
const spreadExpression = ts.isSpreadAssignment(node) || ts.isSpreadElement(node) ? node.expression : undefined;
return (
spreadExpression !== undefined &&
ts.isCallExpression(spreadExpression) &&
ts.isIdentifier(spreadExpression.expression) &&
spreadExpression.expression.text === 'ollamaEnv'
);
}
describe('container-runner.ts wires in ollamaEnv', () => {
const sf = sourceFile();
const fn = findFunction(sf, 'composeSessionSpec');
it('finds composeSessionSpec', () => {
expect(fn).toBeDefined();
});
it('spreads ...ollamaEnv() inside composeSessionSpec', () => {
let wired = false;
const visit = (node: ts.Node) => {
if (isEnvSpread(node)) wired = true;
if (!wired) ts.forEachChild(node, visit);
};
if (fn?.body) visit(fn.body);
expect(wired).toBe(true);
});
});
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: 472k | 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: 323k | 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: 323k | Updated | Claude CodeCodex | Verified | Install |
| 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 available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |