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

View on GitHub
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { escapeHtml, mdToHtml } from '../public/md.js';

// ---- escaping -------------------------------------------------------------

test('escapeHtml: neutralizes all HTML metacharacters', () => {
  assert.equal(escapeHtml(`<script>"&'`), '&lt;script&gt;&quot;&amp;&#39;');
});

test('mdToHtml: raw HTML in source is escaped, never passed through', () => {
  const html = mdToHtml('a <script>alert(1)</script> b');
  assert.ok(!html.includes('<script>'));
  assert.ok(html.includes('&lt;script&gt;'));
});

// ---- the security-sensitive part: links -----------------------------------

test('mdToHtml: link href comes from the URL, label from the text', () => {
  const html = mdToHtml('see [the docs](https://example.com/x)');
  assert.match(html, /<a href="https:\/\/example\.com\/x" target="_blank" rel="noopener noreferrer">the docs<\/a>/);
});

test('mdToHtml: javascript: smuggled in link TEXT stays inert (never an href)', () => {
  const html = mdToHtml('[javascript:alert(1)](https://safe.com)');
  // href is the safe URL; the js string is only visible label text
  assert.match(html, /href="https:\/\/safe\.com"/);
  assert.ok(!/href="javascript:/i.test(html));
});

test('mdToHtml: a non-http(s) URL is not turned into a link', () => {
  // javascript:/data: never match the (https?:...) capture, so the literal
  // (escaped) markdown is left as-is — no anchor, no executable href.
  const html = mdToHtml('[click](javascript:alert(1))');
  assert.ok(!/<a /.test(html));
  assert.ok(!/href="javascript:/i.test(html));
});

test('mdToHtml: an attribute-breakout attempt in the URL cannot escape the href', () => {
  // The double-quote is escaped to &quot; before the regex runs, so it can never
  // close an attribute. (Here the URL also has a space, so no anchor even forms.)
  // The security property: no REAL attribute (with a literal quote) is injected.
  const html = mdToHtml('[x](https://a" onmouseover="alert(1))');
  assert.ok(!/<a/.test(html), 'malformed link must not produce an anchor');
  assert.ok(!/onmouseover="/.test(html), 'no real (unescaped-quote) attribute injected');
});

test('mdToHtml: an escaped quote inside a matched URL stays inside the href, inert', () => {
  // Even when a URL matches, any " in it is already &quot; (an entity), which
  // does not terminate an HTML attribute value — so no breakout.
  const html = mdToHtml('[x](https://a"onmouseover=alert)');
  assert.ok(!/onmouseover="/.test(html));
  if (/<a/.test(html)) assert.match(html, /href="https:\/\/a&quot;onmouseover=alert"/);
});

// ---- basic rendering sanity ----------------------------------------------

test('mdToHtml: headings, code fences, lists render', () => {
  const html = mdToHtml('# Title\n\n```\ncode\n```\n\n- a\n- b');
  assert.match(html, /<h1>Title<\/h1>/);
  assert.match(html, /<pre class="code"><code>code<\/code><\/pre>/);
  assert.match(html, /<ul><li>a<\/li><li>b<\/li><\/ul>/);
});
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