Skip to content

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

add-clidash

Unverified

Add clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.

FileKindSize
REMOVE.mdmarkdown544 B
SKILL.mdskill md6.3 KB
add/tools/clidash/README.mdmarkdown4.0 KB
add/tools/clidash/activity.jsscript3.5 KB
add/tools/clidash/clidash.config.example.jsonconfig3.3 KB
add/tools/clidash/docs.jsscript3.7 KB
add/tools/clidash/logs.jsscript667 B
add/tools/clidash/package.jsonmanifest347 B
add/tools/clidash/parsers.jsscript3.3 KB
add/tools/clidash/public/app.jsscript32.6 KB
add/tools/clidash/public/apple-touch-icon.pngbinary5.3 KB
add/tools/clidash/public/favicon.icobinary547 B
add/tools/clidash/public/favicon.svgother570 B
add/tools/clidash/public/icon-192.pngbinary6.5 KB
add/tools/clidash/public/icon-512.pngbinary18.5 KB
add/tools/clidash/public/index.htmlother1.9 KB
add/tools/clidash/public/md.jsscript2.7 KB
add/tools/clidash/public/site.webmanifestother298 B
add/tools/clidash/public/style.cssother18.0 KB
add/tools/clidash/server.jsscript17.2 KB
add/tools/clidash/test/activity-server.test.jsscript2.3 KB
add/tools/clidash/test/activity.test.jsscript3.8 KB
add/tools/clidash/test/cmd.test.jsscript3.4 KB
add/tools/clidash/test/css.test.jsscript991 B
add/tools/clidash/test/docs-server.test.jsscript4.0 KB
add/tools/clidash/test/docs.test.jsscript4.4 KB
add/tools/clidash/test/fixtures/ncl-help.txtmarkdown4.1 KB
add/tools/clidash/test/fixtures/stub-cli.jsscript1.8 KB
add/tools/clidash/test/help.test.jsscript2.2 KB
add/tools/clidash/test/logs.test.jsscript2.9 KB
add/tools/clidash/test/md.test.jsscript2.9 KB
add/tools/clidash/test/ncl-overview.test.jsscript3.5 KB
add/tools/clidash/test/parsers.test.jsscript4.0 KB
add/tools/clidash/test/server.test.jsscript8.9 KB
add/tools/clidash/test/smoke.shexecutablescript747 B
add/tools/clidash/views/ncl-overview.jsscript1.9 KB

add/tools/clidash/test/parsers.test.js

View on GitHub
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { discoveryParsers, parseOutput, unwrapPath } from '../parsers.js';

const fixture = readFileSync(
  fileURLToPath(new URL('./fixtures/ncl-help.txt', import.meta.url)),
  'utf8',
);

// ---------------------------------------------------------------- ncl-help

test('ncl-help: parses all listable resources from real captured output', () => {
  const resources = discoveryParsers['ncl-help'](fixture);
  assert.deepEqual(
    resources.map((r) => r.name),
    [
      'approvals', 'destinations', 'dropped-messages', 'groups', 'members',
      'messaging-groups', 'roles', 'sessions', 'user-dms', 'users', 'wirings',
    ],
  );
});

test('ncl-help: every parsed resource has a non-empty description and a list verb', () => {
  const resources = discoveryParsers['ncl-help'](fixture);
  for (const r of resources) {
    assert.ok(r.description.length > 0, `${r.name} has empty description`);
    assert.ok(r.verbs.includes('list'), `${r.name} missing list verb`);
  }
});

test('ncl-help: parses verbs correctly, including multi-word verbs', () => {
  const resources = discoveryParsers['ncl-help'](fixture);
  const groups = resources.find((r) => r.name === 'groups');
  assert.deepEqual(groups.verbs, [
    'list', 'get', 'create', 'update', 'delete', 'restart',
    'config get', 'config update', 'config add-mcp-server',
    'config remove-mcp-server', 'config add-package', 'config remove-package',
  ]);
});

test('ncl-help: excludes resources without a list verb', () => {
  const input = [
    'Resources:',
    '  alpha                Has list.',
    '                       verbs: list, get',
    '  beta                 No list here.',
    '                       verbs: grant, revoke',
    '',
  ].join('\n');
  const resources = discoveryParsers['ncl-help'](input);
  assert.deepEqual(resources.map((r) => r.name), ['alpha']);
});

test('ncl-help: ignores the Commands section (help is not a resource)', () => {
  const resources = discoveryParsers['ncl-help'](fixture);
  assert.ok(!resources.some((r) => r.name === 'help'));
});

test('ncl-help: throws loudly on unrecognized format', () => {
  assert.throws(() => discoveryParsers['ncl-help']('totally not help output'), /Resources/);
  assert.throws(() => discoveryParsers['ncl-help'](''), /Resources/);
});

// ------------------------------------------------------------- parseOutput

test('parseOutput json: parses a single document', () => {
  assert.deepEqual(parseOutput('{"a": 1}', 'json'), { a: 1 });
});

test('parseOutput json: throws on malformed input with raw output preserved', () => {
  assert.throws(() => parseOutput('not json', 'json'), (err) => {
    assert.match(err.message, /JSON/i);
    assert.equal(err.raw, 'not json');
    return true;
  });
});

test('parseOutput jsonlines: one object per line, blank lines skipped', () => {
  const text = '{"id":1}\n\n{"id":2}\n{"id":3}\n';
  assert.deepEqual(parseOutput(text, 'jsonlines'), [{ id: 1 }, { id: 2 }, { id: 3 }]);
});

test('parseOutput jsonlines: throws on a malformed line', () => {
  assert.throws(() => parseOutput('{"ok":1}\ngarbage\n', 'jsonlines'), /line 2/i);
});

test('parseOutput: rejects unknown format', () => {
  assert.throws(() => parseOutput('{}', 'xml'), /format/i);
});

// -------------------------------------------------------------- unwrapPath

test('unwrapPath: extracts the ncl {id, ok, data} envelope', () => {
  const doc = { id: 'x', ok: true, data: [{ id: 'sess-1' }] };
  assert.deepEqual(unwrapPath(doc, 'data'), [{ id: 'sess-1' }]);
});

test('unwrapPath: supports nested dot paths', () => {
  assert.deepEqual(unwrapPath({ a: { b: [1, 2] } }, 'a.b'), [1, 2]);
});

test('unwrapPath: throws when the path is missing', () => {
  assert.throws(() => unwrapPath({ ok: true }, 'data'), /data/);
});

test('unwrapPath: no path returns the value unchanged', () => {
  const rows = [{ id: 1 }];
  assert.equal(unwrapPath(rows, undefined), rows);
});
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