teqo-backup/tests/unit/graficosDadosSkill.unit.spec.ts
Francisco Solla 39933fc004 feat(C237-C239): colunas emparelhadas e motion determinístico no gerador de gráficos
- C237 (CENA 02F): --paired desenha duas colunas zero-based por categoria
  (inicial cinza, recente vermelha, valência positiva compartilhada), com
  legenda de períodos, valor sobre cada barra e rótulo sob o par; até 4
  categorias; design DEGRADED com sign-off humano de 2026-09-29.
- C238/C239 (CENAS 02G/02H): --motion gera MP4 H.264 local (6s @ 30fps,
  frames determinísticos por seek + ffmpeg do repo) para o par emparelhado,
  a coluna de 2 períodos e o número-âncora; C238 com sign-off humano de
  2026-09-30 e C239 aguardando gate.
- Superfície: CLI, SKILL.md, hi-fi e specs novos (chartMotion/
  chartMotionRender; SCRIPTS_SPEC_PINNED sincronizado).

Design tier: DEGRADED (inline, tier 4 — frontier sem quota).
2026-09-29 22:37:02 -03:00

96 lines
3.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { existsSync, readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, expect, it } from 'vitest'
// C191: the skill and the command are prompt text, so the product contract
// lives in the SKILL.md prose. This guard fails the build if the flow, the
// guardrails, the gitignored artifacts or the CLI contract are dropped.
const repoRoot = process.cwd()
const read = (path: string): string => readFileSync(resolve(repoRoot, path), 'utf8')
const skill = read('.agents/skills/graficos-dados/SKILL.md')
const command = read('.opencode/commands/graficos-dados.md')
describe('skill /graficos-dados documents the flow', () => {
it('declares when to use it and the canonical builder CLI', () => {
expect(skill).toContain('## Quando usar')
expect(skill).toContain('node scripts/build-chart-from-data.mjs')
expect(skill).toContain('--inspect')
expect(skill).toContain('--spec=')
})
it('pins the launch command and the gitignored artifacts', () => {
expect(skill).toContain('/graficos-dados')
expect(skill).toContain('data/graficos-instagram/')
expect(skill).toContain('docs/research/graficos-instagram/')
expect(skill).toContain('gitignored')
})
it('pins the three output sizes', () => {
expect(skill).toContain('1080×1350')
expect(skill).toContain('1080×1080')
expect(skill).toContain('1080×1920')
})
it('pins the fail-closed guardrails', () => {
expect(skill).toMatch(/partem do zero/i)
expect(skill).toMatch(/7 pontos/)
expect(skill).toMatch(/pizza/i)
expect(skill).toMatch(/pergunta, nunca completa/i)
expect(skill).toContain('--source')
expect(skill).toMatch(/fail-closed/i)
})
it('pins the official kit 1313 brand and palette (C203)', () => {
expect(skill).toContain('jorge-solla-positivo.png')
expect(skill).toContain('#e4102f')
expect(skill).toContain('#184e92')
expect(skill).not.toContain('#c51414')
})
it('pins the three-series extension and its triad (C205)', () => {
expect(skill).toMatch(/três séries/)
expect(skill).toContain('--neutral=')
expect(skill).toContain('--neutral-dark=')
expect(skill).toContain('↗ cresce')
expect(skill).toContain('↘ diminui')
expect(skill).toMatch(/só no feed/)
})
it('pins the larger brand mark of the shared footer (C206)', () => {
expect(skill).toContain('251×144')
expect(skill).toContain('192×110')
expect(skill).toContain('279×160')
})
it('pins the paired columns of the C237 degraded revision', () => {
expect(skill).toContain('--paired')
expect(skill).toMatch(/colunas emparelhadas/i)
expect(skill).toMatch(/DEGRADED/)
expect(skill).toContain('4 categorias')
})
it('pins the C238/C239 motion of the paired columns, the column and the anchor', () => {
expect(skill).toContain('--motion')
expect(skill).toMatch(/MP4/)
expect(skill).toMatch(/6s @ 30fps/)
expect(skill).toMatch(/frames determin/)
expect(skill).toContain('C237')
expect(skill).toContain('C238')
expect(skill).toContain('C239')
expect(skill).toMatch(/2 períodos/)
expect(skill).toMatch(/número-âncora/)
})
})
describe('command /graficos-dados couples to the skill', () => {
it('references the canonical skill file and passes arguments', () => {
expect(existsSync(resolve(repoRoot, '.opencode/commands/graficos-dados.md'))).toBe(true)
expect(command).toContain('`graficos-dados`')
expect(command).toContain('$ARGUMENTS')
expect(command).toContain('.agents/skills/graficos-dados/SKILL.md')
expect(command).toContain('kit 1313')
})
})