* 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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user