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/docs-server.test.js

View on GitHub
import { test, before, after } from 'node:test';
import assert from 'node:assert/strict';
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { createApp } from '../server.js';

let root;

before(() => {
  root = mkdtempSync(join(tmpdir(), 'clidash-docsrv-'));
  const w = (rel, body) => {
    const abs = join(root, rel);
    mkdirSync(join(abs, '..'), { recursive: true });
    writeFileSync(abs, body);
  };
  w('groups/alpha/skills/tagger/SKILL.md', '# tagger\nhello');
  w('container/skills/welcome/SKILL.md', '# welcome');
  w('groups/alpha/profile.json', '{"name":"Alpha"}');
  w('groups/alpha/.env', 'SECRET=nope');
});

after(() => rmSync(root, { recursive: true, force: true }));

function docsConfig() {
  return {
    port: 0,
    bind: '127.0.0.1',
    clis: {},
    docs: {
      root,
      deny: ['node_modules', '.env', '*token*', '*secret*', '*.pem', '*.key'],
      collections: [
        { name: 'skills', label: 'Skills', lang: 'markdown', patterns: ['groups/*/skills/*/SKILL.md', 'container/skills/*/SKILL.md'] },
        { name: 'profiles', label: 'Profiles', lang: 'json', patterns: ['groups/*/profile.json'] },
      ],
    },
  };
}

async function withServer(config, fn) {
  const server = createApp(config);
  await new Promise((r) => server.listen(0, '127.0.0.1', r));
  const base = `http://127.0.0.1:${server.address().port}`;
  try {
    return await fn(base);
  } finally {
    await new Promise((r) => server.close(r));
  }
}

test('/api/docs: lists collections with their files', async () => {
  await withServer(docsConfig(), async (base) => {
    const body = await (await fetch(`${base}/api/docs`)).json();
    const skills = body.collections.find((c) => c.name === 'skills');
    assert.equal(skills.label, 'Skills');
    assert.equal(skills.lang, 'markdown');
    const paths = skills.files.map((f) => f.path);
    assert.ok(paths.includes('groups/alpha/skills/tagger/SKILL.md'));
    assert.ok(paths.includes('container/skills/welcome/SKILL.md'));
    // each file carries a readable label + group
    const f = skills.files.find((x) => x.path.includes('tagger'));
    assert.equal(f.group, 'alpha');
    assert.match(f.label, /tagger/);
  });
});

test('/api/doc: returns file content + lang', async () => {
  await withServer(docsConfig(), async (base) => {
    const url = `${base}/api/doc?c=skills&p=${encodeURIComponent('groups/alpha/skills/tagger/SKILL.md')}`;
    const body = await (await fetch(url)).json();
    assert.equal(body.ok, true);
    assert.equal(body.lang, 'markdown');
    assert.match(body.content, /# tagger/);
  });
});

test('/api/doc: a denied file is not readable even though it sits under root', async () => {
  await withServer(docsConfig(), async (base) => {
    // .env is excluded by the deny-list and not in any collection pattern
    const coll = docsConfig();
    coll.docs.collections.push({ name: 'all', label: 'All', lang: 'text', patterns: ['groups/*/*'] });
    await withServer(coll, async (base2) => {
      const res = await fetch(`${base2}/api/doc?c=all&p=${encodeURIComponent('groups/alpha/.env')}`);
      assert.equal(res.status, 404);
      assert.equal((await res.json()).ok, false);
    });
  });
});

test('/api/doc: path traversal is rejected', async () => {
  await withServer(docsConfig(), async (base) => {
    const res = await fetch(`${base}/api/doc?c=skills&p=${encodeURIComponent('../../../../etc/passwd')}`);
    assert.equal(res.status, 404);
    assert.equal((await res.json()).ok, false);
  });
});

test('/api/doc: unknown collection → 404', async () => {
  await withServer(docsConfig(), async (base) => {
    const res = await fetch(`${base}/api/doc?c=nope&p=x`);
    assert.equal(res.status, 404);
  });
});

test('/api/docs: absent docs config → empty collections, no crash', async () => {
  await withServer({ port: 0, bind: '127.0.0.1', clis: {} }, async (base) => {
    const body = await (await fetch(`${base}/api/docs`)).json();
    assert.deepEqual(body.collections, []);
  });
});
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