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.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 { globFiles, describeFile, resolveDoc } from '../docs.js';

let root;

before(() => {
  root = mkdtempSync(join(tmpdir(), 'clidash-docs-'));
  const w = (rel, body = 'x') => {
    const abs = join(root, rel);
    mkdirSync(join(abs, '..'), { recursive: true });
    writeFileSync(abs, body);
  };
  w('groups/alpha/skills/example-skill/SKILL.md', '# example-skill\nbody');
  w('groups/alpha/skills/tagger/SKILL.md');
  w('groups/alpha/CLAUDE.md', '# Alpha');
  w('groups/alpha/CLAUDE.local.md');
  w('groups/alpha/profile.json', '{"name":"Alpha"}');
  w('groups/alpha/conversations/2026-06-01.md');
  w('groups/bravo/skills/tagger/SKILL.md');
  w('groups/bravo/profile.json');
  w('container/skills/agent-browser/SKILL.md');
  w('container/skills/welcome/SKILL.md');
  // things that must NEVER be served
  w('groups/alpha/.env', 'SECRET=1');
  w('groups/alpha/skills/example-skill/node_modules/dep/SKILL.md');
  w('groups/alpha/notion-token.txt', 'ntn_xxx');
});

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

const DENY = ['node_modules', '.env', '*token*', '*secret*', '*.pem', '*.key'];

// --------------------------------------------------------------- globFiles

test('globFiles: matches a nested *-segment pattern', () => {
  const files = globFiles(root, ['groups/*/skills/*/SKILL.md'], DENY);
  assert.deepEqual(files, [
    'groups/alpha/skills/example-skill/SKILL.md',
    'groups/alpha/skills/tagger/SKILL.md',
    'groups/bravo/skills/tagger/SKILL.md',
  ]);
});

test('globFiles: multiple patterns union, sorted', () => {
  const files = globFiles(root, ['groups/*/skills/*/SKILL.md', 'container/skills/*/SKILL.md'], DENY);
  assert.ok(files.includes('container/skills/agent-browser/SKILL.md'));
  assert.ok(files.includes('groups/alpha/skills/example-skill/SKILL.md'));
});

test('globFiles: wildcard inside a filename segment', () => {
  const files = globFiles(root, ['groups/*/CLAUDE*.md'], DENY);
  assert.deepEqual(files, ['groups/alpha/CLAUDE.local.md', 'groups/alpha/CLAUDE.md']);
});

test('globFiles: deny list excludes node_modules and secret-ish files', () => {
  const files = globFiles(root, ['groups/*/skills/*/**', 'groups/*/*'], DENY);
  assert.ok(!files.some((f) => f.includes('node_modules')));
  assert.ok(!files.some((f) => f.endsWith('.env')));
  assert.ok(!files.some((f) => f.includes('token')));
});

test('globFiles: no match returns empty array', () => {
  assert.deepEqual(globFiles(root, ['nope/*/x.md'], DENY), []);
});

// ------------------------------------------------------------- describeFile

test('describeFile: per-group skill → group + readable label', () => {
  const d = describeFile('groups/alpha/skills/tagger/SKILL.md');
  assert.equal(d.group, 'alpha');
  assert.match(d.label, /alpha/);
  assert.match(d.label, /tagger/);
});

test('describeFile: container skill → shared', () => {
  const d = describeFile('container/skills/agent-browser/SKILL.md');
  assert.equal(d.group, 'shared');
  assert.match(d.label, /agent-browser/);
});

// --------------------------------------------------------------- resolveDoc

const SKILLS = { name: 'skills', patterns: ['groups/*/skills/*/SKILL.md', 'container/skills/*/SKILL.md'] };

test('resolveDoc: returns an absolute path for an allowed file', () => {
  const abs = resolveDoc(root, SKILLS, 'groups/alpha/skills/example-skill/SKILL.md', DENY);
  assert.ok(abs.endsWith('/groups/alpha/skills/example-skill/SKILL.md'));
  assert.ok(abs.startsWith(root));
});

test('resolveDoc: rejects a path not matching the collection patterns', () => {
  assert.throws(() => resolveDoc(root, SKILLS, 'groups/alpha/profile.json', DENY), /not allowed/i);
});

test('resolveDoc: rejects path traversal', () => {
  assert.throws(() => resolveDoc(root, SKILLS, '../../etc/passwd', DENY), /not allowed/i);
  assert.throws(() => resolveDoc(root, SKILLS, 'groups/alpha/skills/../../../.env', DENY), /not allowed/i);
});

test('resolveDoc: rejects an absolute path', () => {
  assert.throws(() => resolveDoc(root, SKILLS, '/etc/passwd', DENY), /not allowed/i);
});

test('resolveDoc: a denied file is not resolvable even if pattern-shaped', () => {
  const coll = { name: 'all', patterns: ['groups/*/*'] };
  assert.throws(() => resolveDoc(root, coll, 'groups/alpha/.env', DENY), /not allowed/i);
});
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