chore(#771): convert agent color: hex/magenta values to documented named colors (#823)

* chore(#771): convert agent color: hex/magenta values to documented named colors

Claude Code's sub-agent `color:` field documents only 8 named colors
(red, blue, green, yellow, purple, orange, pink, cyan). Twelve agent
files used hex values and two used the undocumented `magenta`; convert
each to the nearest documented named color so the intended per-agent
TUI color differentiation is spec-compliant.

- agents/*.md: 14 color values hex/magenta -> nearest named color
- scripts/research-profiles.cjs: update the 3 generated research-agent
  profiles (source of truth) so gen-research-agents stays in sync
- docs/AGENTS.md: update documented colors; add missing Color rows for
  gsd-nyquist-auditor, gsd-project-researcher, gsd-phase-researcher
- tests/agent-frontmatter.test.cjs: add regression guard asserting every
  agent color: is in the documented named-color set

Closes #771

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(#771): add changeset

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-06-07 18:50:50 -04:00
committed by GitHub
parent 1373f9bfb4
commit 3aed02822d
18 changed files with 61 additions and 30 deletions

View File

@@ -232,6 +232,29 @@ describe('AGENT: required frontmatter fields', () => {
}
});
// ─── Color Value Validation ──────────────────────────────────────────────────
const VALID_AGENT_COLORS = new Set(['red', 'blue', 'green', 'yellow', 'purple', 'orange', 'pink', 'cyan']);
describe('COLOR: color frontmatter must be a documented named color', () => {
for (const agent of ALL_AGENTS) {
test(`${agent} color: is a documented named color`, () => {
const content = fs.readFileSync(path.join(AGENTS_DIR, agent + '.md'), 'utf-8');
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
const frontmatter = fmMatch ? fmMatch[1] : '';
const colorMatch = frontmatter.match(/^color:\s*(.+)$/m);
assert.ok(colorMatch, `${agent} missing color: field in frontmatter`);
const rawValue = colorMatch[1].trim();
// Strip surrounding quotes (single or double) before validating
const colorValue = rawValue.replace(/^["']|["']$/g, '');
assert.ok(
VALID_AGENT_COLORS.has(colorValue),
`${agent} has invalid color: "${colorValue}" — must be one of: ${[...VALID_AGENT_COLORS].join(', ')}`
);
});
}
});
// ─── CLAUDE.md Compliance ───────────────────────────────────────────────────
describe('CLAUDEMD: CLAUDE.md compliance enforcement', () => {