Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

test: practice, spec view and role guide suites

Corey Olson649fd9d4d8df
diff --git a/test/e2e.test.js b/test/e2e.test.js
index 6589c6e8..c1af1e60 100644
--- a/test/e2e.test.js
+++ b/test/e2e.test.js
@@ -123,6 +123,24 @@ test('init writes config, spec, agent docs and hooks once, and never clobbers [I
assert.equal(readFileSync(join(repo, 'CLAUDE.md'), 'utf8'), '@AGENTS.md\n');
assert.equal(box.git(repo, 'config', '--get', 'core.hooksPath'), '.githooks');
for (const hook of ['pre-commit', 'commit-msg', 'pre-push']) assert.ok(existsSync(join(repo, '.githooks', hook)));
+ assert.ok(readFileSync(join(repo, 'PRACTICE.md'), 'utf8').startsWith('# Practice'));
+ assert.ok(existsSync(join(repo, '.claude', 'skills', 'pullboard-decompose', 'SKILL.md')));
+ assert.match(second.out, /kept PRACTICE.md/);
+ assert.match(second.out, /kept the Claude Code skills/);
+});
+
+test('spec check lints both files; spec view writes one page into the git dir [S6, S7]', () => {
+ const box = project();
+ writeFileSync(join(box.repo, 'PRACTICE.md'), '# Practice\n\n## C · Code\n- C1 [approved, must] Functions under 60 lines.\n');
+ const check = box.run(box.repo, 'spec', 'check');
+ assert.equal(check.code, 1);
+ assert.match(check.out, /PRACTICE.md:4 C1 error: an approved must-row names its gate/);
+ assert.match(check.out, /SPEC.md: 2 rows, 0 errors/);
+ const view = box.run(box.repo, 'spec', 'view');
+ assert.equal(view.code, 0, view.err);
+ const file = join(box.repo, '.git', 'pullboard', 'spec.html');
+ assert.ok(readFileSync(file, 'utf8').includes('The page renders.'));
+ assert.match(view.out, /open: file:\/\//);
});
test('the board lives in the git common dir; every worktree sees it; nothing is committed [B1, B3]', () => {
diff --git a/test/practice.test.js b/test/practice.test.js
new file mode 100644
index 00000000..c1b90626
--- /dev/null
+++ b/test/practice.test.js
@@ -0,0 +1,59 @@
+/**
+ * The house rules (S6) and the role guides (N6): the standard PRACTICE.md is a valid spec of its own,
+ * and every role guide prints, with a repo's own override taking precedence.
+ */
+import assert from 'node:assert/strict';
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { test } from 'node:test';
+import { ROLES, installSkills, promptFor, withoutFrontMatter } from '../src/skills.js';
+import { lintSpec, parseSpec } from '../src/spec.js';
+import { practiceTemplate } from '../src/templates.js';
+
+test('the standard practice lints clean, and every approved must-row names its enforcer [S6]', () => {
+ const practice = parseSpec(practiceTemplate());
+ assert.deepEqual(lintSpec(practice), []);
+ assert.ok(practice.rows.length >= 20);
+ const approvedMusts = practice.rows.filter((row) => row.status === 'approved' && row.tier === 'must');
+ assert.ok(approvedMusts.length >= 8);
+ assert.ok(approvedMusts.every((row) => row.gate));
+});
+
+test('every role prints its guide without front matter [N6]', () => {
+ const root = mkdtempSync(join(tmpdir(), 'pullboard-prompt-'));
+ try {
+ for (const role of Object.keys(ROLES)) {
+ const text = promptFor(root, role);
+ assert.ok(text.startsWith('# '), `${role} starts with its heading`);
+ assert.ok(!text.includes('description:'), `${role} has no front matter`);
+ }
+ assert.throws(() => promptFor(root, 'nope'), /NO_ROLE/);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test("a repo's own guide overrides the shipped one [N6]", () => {
+ const root = mkdtempSync(join(tmpdir(), 'pullboard-prompt-'));
+ try {
+ mkdirSync(join(root, '.pullboard', 'prompts'), { recursive: true });
+ writeFileSync(join(root, '.pullboard', 'prompts', 'verify.md'), '# Our verify\n');
+ assert.equal(promptFor(root, 'verify'), '# Our verify\n');
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test('skills install once and are never overwritten [I2]', () => {
+ const root = mkdtempSync(join(tmpdir(), 'pullboard-skills-'));
+ try {
+ assert.match(installSkills(root)[0], /wrote Claude Code skills: pullboard-decompose/);
+ const file = join(root, '.claude', 'skills', 'pullboard-verify', 'SKILL.md');
+ writeFileSync(file, 'mine');
+ assert.deepEqual(installSkills(root), ['kept the Claude Code skills']);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+ assert.equal(withoutFrontMatter('---\nname: x\n---\n\n# Body\n'), '# Body\n');
+});
diff --git a/test/view.test.js b/test/view.test.js
new file mode 100644
index 00000000..484638b7
--- /dev/null
+++ b/test/view.test.js
@@ -0,0 +1,62 @@
+/**
+ * The spec view (S7): one offline page with the spec, open questions, sign-offs and practice, where
+ * no text from the files can inject markup.
+ */
+import assert from 'node:assert/strict';
+import { test } from 'node:test';
+import { parseSpec } from '../src/spec.js';
+import { practiceTemplate } from '../src/templates.js';
+import { esc, renderSpecView } from '../src/view.js';
+
+const SPEC = `# Bakery spec
+
+Pre-orders for four shops.
+
+## O · Orders
+- O1 [approved, must] Orders lock at 2pm the day before pickup. | gate: lock test
+- O2 [approved, must] A confirmation text names the shop. | gate: text test
+- O3 [pending] Can a customer cancel after the lock?
+- O4 [draft, aim] Show <script>alert(1)</script> nowhere. | gate: xss test
+`;
+
+/**
+ * The page for the sample spec, with O1 signed on its current text and O2 signed on older text.
+ */
+function page() {
+ const spec = { ...parseSpec(SPEC), exists: true };
+ const signoffs = [
+ { id: 'O1', by: 'CO', on: '2026-10-05', text: 'Orders lock at 2pm the day before pickup.' },
+ { id: 'O2', by: 'CO', on: '2026-10-04', text: 'A text names the shop.' },
+ ];
+ const practice = { ...parseSpec(practiceTemplate()), exists: true };
+ return renderSpecView({
+ title: spec.title,
+ spec,
+ practice,
+ signoffs,
+ generatedAt: '2026-10-05 12:00',
+ files: { spec: 'SPEC.md', practice: 'PRACTICE.md' },
+ });
+}
+
+test('one self-contained page with every tab and every row [S7]', () => {
+ const html = page();
+ assert.ok(html.startsWith('<!doctype html>'));
+ assert.ok(!/src="http|href="http/.test(html), 'nothing loads from the network');
+ for (const label of ['Spec', 'Open questions (1)', 'Sign-off', 'Practice']) assert.ok(html.includes(label));
+ for (const id of ['O1', 'O2', 'O3', 'O4', 'W1', 'G4']) assert.ok(html.includes(`>${id}<`), `${id} is on the page`);
+});
+
+test('sign-offs show as signed, stale or not signed [S5, S7]', () => {
+ const html = page();
+ assert.ok(html.includes('signed CO 2026-10-05'));
+ assert.ok(html.includes('stale: text changed since sign-off'));
+ assert.ok(html.includes('<b>1/2</b><span>approved must-rows signed</span>'));
+});
+
+test('row text is escaped, so a row cannot inject markup', () => {
+ const html = page();
+ assert.ok(!html.includes('<script>alert(1)</script>'));
+ assert.ok(html.includes('&lt;script&gt;alert(1)&lt;/script&gt;'));
+ assert.equal(esc(`a<b>"c"&'d'`), 'a&lt;b&gt;&quot;c&quot;&amp;&#39;d&#39;');
+});