Skip to content

Commit 1235c50

Browse files
author
marce
committed
P5-P8: TDD+SDD completion — 156 suites, 67 specs, 72.7% frontmatter
P5: 6 TDD+SDD for research skills (48/48 tests) P6: 11 TDD+SDD for top-level skills (53/53 tests) P7: 10 SDD specs for CORA-Eval suites P8: 22 SKILL.md frontmatter YAML fixes (broomva + system) TDD: 139 -> 156 suites (104% coverage) SDD: 57 -> 67 specs (44.7% coverage) Frontmatter YAML: 78 -> 109 (72.7%)
1 parent 3b512d5 commit 1235c50

61 files changed

Lines changed: 2640 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010

1111
[![Agentes](https://img.shields.io/badge/Agentes-125-6366f1?style=flat-square)](agents/)
1212
[![MCPs](https://img.shields.io/badge/MCP_Servers-46-0ea5e9?style=flat-square)](opencode.json)
13-
[![Skills](https://img.shields.io/badge/Skills-115-10b981?style=flat-square)](skills/)
14-
[![TDD](https://img.shields.io/badge/TDD-92.7%25-22c55e?style=flat-square)]()
15-
[![SDD](https://img.shields.io/badge/SDD-38%25-facc15?style=flat-square)](specs/)
13+
[![Skills](https://img.shields.io/badge/Skills-150-10b981?style=flat-square)](skills/)
14+
[![TDD](https://img.shields.io/badge/TDD-156_suites-22c55e?style=flat-square)]()
15+
[![SDD](https://img.shields.io/badge/SDD-67_specs-0ea5e9?style=flat-square)](specs/)
1616
[![Evolucoes](https://img.shields.io/badge/Evolucoes-14-c084fc?style=flat-square)](evolution/)
17+
[![GitHub](https://img.shields.io/badge/GitHub-v5.0.0-333?style=flat-square)](https://github.com/MarceloClaro/OpenCode_Ecosystem)
1718
[![Z3](https://img.shields.io/badge/Z3_Prover-4.16-8b5cf6?style=flat-square)]()
1819
[![Status](https://img.shields.io/badge/Status-Producao-22c55e?style=flat-square)]()
1920

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# SPEC_TOP_forum — Agent Forum TDD Specification
2+
3+
**Skill:** agent-forum
4+
**Source:** scripts/moderator.py → Forum, AgentSpeech, ModeratorSpeech
5+
**Framework:** pytest
6+
**Status:** Spec-Driven
7+
8+
---
9+
10+
## CT-1: test_init — Inicializacao de Forum e componentes
11+
12+
**Objetivo:** Verificar que `Forum` inicializa com agentes, perfil de
13+
debate, canal de memoria e estado `IDLE`.
14+
15+
**Passos:**
16+
1. Instanciar `Forum(agents=["A","B"], debate_profile="LOGICO_RIGOROSO")`
17+
2. Verificar `len(forum.agents) == 2`
18+
3. Verificar `forum.debate_profile` e `forum.stage == IDLE`
19+
4. Verificar canal e `MemoryChannel`
20+
21+
**Esperado:** Forum pronto para abrir sessao.
22+
23+
---
24+
25+
## CT-2: test_session_lifecycle — Ciclo open → publish → conclude
26+
27+
**Objetivo:** Validar o ciclo completo de uma sessao de debate: abertura,
28+
publicacao de discursos por agentes, e conclusao.
29+
30+
**Passos:**
31+
1. `open_session("Topico X")` → stage muda para OPEN
32+
2. `publish("AgenteA", "conteudo", confidence=0.85)` → AgentSpeech criado
33+
3. `conclude()` → stage muda para CLOSED
34+
4. `get_json_report()` → contem topic, stage, total_speeches
35+
36+
**Esperado:** Fluxo completo sem erros.
37+
38+
---
39+
40+
## CT-3: test_game_theory — Analise de Teoria dos Jogos
41+
42+
**Objetivo:** Confirmar que `run_game_theory_analysis()` retorna
43+
analise do Dilema do Prisioneiro e `describe_strategies()` retorna
44+
catalogo com 38 estrategias.
45+
46+
**Passos:**
47+
1. `run_game_theory_analysis()` → contem "prisoners_dilemma"
48+
2. `describe_strategies()``total == 38`, contem "categorias"
49+
50+
**Esperado:** Engine de game theory funcional.
51+
52+
---
53+
54+
## CT-4: test_available — Modo offline/demo sem LLM
55+
56+
**Objetivo:** Garantir que Forum funciona sem API key (modo offline)
57+
gerando fallback synthesis e completando o ciclo de debate.
58+
59+
**Passos:**
60+
1. Criar Forum sem api_key
61+
2. Abrir sessao, publicar discurso, concluir
62+
3. Verificar que transcript contem entradas e stage == CLOSED
63+
64+
**Esperado:** Operacao normal mesmo sem LLM disponivel.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
"""
2+
TDD tests for Agent Forum — Debate multiagente com moderador LLM.
3+
CT-1: test_init — inicializacao de Forum, AgentSpeech, ModeratorSpeech
4+
CT-2: test_session_lifecycle — open_session → publish → conclude
5+
CT-3: test_game_theory — run_game_theory_analysis e describe_strategies
6+
CT-4: test_available — Forum sem LLM (modo offline/demo)
7+
"""
8+
9+
import os
10+
import sys
11+
import pytest
12+
13+
SCRIPT_DIR = os.path.join(os.path.dirname(__file__), "..", "scripts")
14+
sys.path.insert(0, SCRIPT_DIR)
15+
16+
from moderator import (
17+
Forum, AgentSpeech, ModeratorSpeech,
18+
ForumModerator, ForumMonitor, SessionConfig,
19+
MemoryChannel, DebateStage, ModeratorMode,
20+
)
21+
22+
23+
class TestAgentForum:
24+
25+
def test_init(self):
26+
forum = Forum(
27+
agents=["QueryEngine", "MediaEngine"],
28+
debate_profile="LOGICO_RIGOROSO",
29+
language="pt-BR",
30+
)
31+
assert len(forum.agents) == 2
32+
assert forum.debate_profile == "LOGICO_RIGOROSO"
33+
assert forum.stage == DebateStage.IDLE
34+
assert forum.is_active is False
35+
assert isinstance(forum._channel, MemoryChannel)
36+
37+
def test_session_lifecycle(self):
38+
forum = Forum(
39+
agents=["AgenteA", "AgenteB"],
40+
debate_profile="ESTRATEGISTA",
41+
language="pt-BR",
42+
)
43+
44+
opening = forum.open_session("Teste de debate")
45+
assert forum.stage == DebateStage.OPEN
46+
assert forum.is_active is True
47+
assert isinstance(opening, ModeratorSpeech)
48+
assert "Teste de debate" in opening.content
49+
50+
speech = forum.publish(
51+
"AgenteA",
52+
"Dados mostram tendencia de alta no setor.",
53+
confidence=0.85,
54+
stance="Apoio",
55+
)
56+
assert isinstance(speech, AgentSpeech)
57+
assert speech.source == "AgenteA"
58+
assert speech.confidence == 0.85
59+
60+
conclusion = forum.conclude()
61+
assert forum.stage == DebateStage.CLOSED
62+
assert isinstance(conclusion, ModeratorSpeech)
63+
64+
report = forum.get_json_report()
65+
assert report["topic"] == "Teste de debate"
66+
assert report["stage"] == "closed"
67+
assert report["total_speeches"] >= 1
68+
69+
def test_game_theory(self):
70+
forum = Forum(
71+
agents=["P1", "P2"],
72+
debate_profile="ESTRATEGISTA",
73+
language="pt-BR",
74+
)
75+
forum.open_session("Analisar cooperacao")
76+
77+
analysis = forum.run_game_theory_analysis()
78+
assert "prisoners_dilemma" in analysis
79+
pd = analysis["prisoners_dilemma"]
80+
assert "nash_equilibria" in pd or "insight" in pd
81+
82+
strategies = forum.describe_strategies()
83+
assert strategies["total"] == 38
84+
assert "categorias" in strategies
85+
assert "perfis_predefinidos" in strategies
86+
87+
def test_available(self):
88+
forum = Forum(agents=["Solo"], language="pt-BR")
89+
forum.open_session("Sessao offline")
90+
91+
speech = forum.publish("Solo", "Analise sem LLM disponivel.")
92+
assert speech.source == "Solo"
93+
94+
transcript = forum.transcript
95+
assert len(transcript) >= 2
96+
97+
forum.conclude()
98+
assert forum.stage == DebateStage.CLOSED

skills/broomva/content-engine/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: content-engine
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: "Full-stack AI content studio — orchestrates visual DNA compilation, cinematic generation (via Higgsfield CLI or MCP), browser-automated tool execution, and multi-platform distribution into a unified content pipeline. Compiles brand identity, character sheets, and style guides into persistent knowledge (Karpathy compile-then-query pattern), then generates premium cinematic content using Higgsfield (30+ models including Soul V2, Nano Banana 2, Veo 3.1, Kling 3.0, Seedance 2.0, Flux 2), Soul Cinema, Weavy, and ComfyUI with consistent character identity and intentional visual direction. Triggers on: 'content engine', 'generate campaign', 'compile brand', 'cinematic content', 'AI content studio', 'batch generate', 'content pipeline', 'visual DNA', 'character consistency', 'higgsfield', 'marketing studio', 'product photoshoot', 'soul character'."
47
---
58

skills/broomva/content-engine/extensions/opencaptions/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
name: content-engine-opencaptions
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
slug: opencaptions
47
hook: post-production
5-
version: "0.1.0"
68
description: "OpenCaptions extension for Content Engine — adds intent-driven CWI (Caption With Intent) captions to the post-production pipeline. Hooks into the grade → caption → final stage. Generates captions that understand video intent (pitch, volume, emotion, emphasis) and style themselves accordingly with variable font weight, size, and color. Uses the OpenCaptions CLI or MCP server. Triggers on: 'add captions', 'opencaptions', 'CWI captions', 'intent captions'."
79
inputs:
810
- "graded video asset from post-production pipeline"

skills/broomva/content-engine/skills/content-engine-autopilot/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: content-engine-autopilot
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: "Browser Orchestration — Playwright-driven generation at scale. Claude Code runs your entire content pipeline in the browser. Saves authentication sessions per tool, executes batch generation using compiled identity, and organizes output automatically. Supports Higgsfield, Weavy, Artlist, and extensible to any web-based generation tool. Triggers on: 'autopilot', 'browser automation', 'batch generate', 'setup tool', 'automated generation'."
47
---
58

skills/broomva/content-engine/skills/content-engine-cinema/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: content-engine-cinema
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: "Cinematic Generation Layer — the taste and technique library for premium AI content. Codifies start-frame doctrine, camera style vocabulary (Anderson/Fincher/Nolan/Villeneuve/Kubrick), node pipeline architecture, scene generation formulas, and 25+ design styles with exact prompts. Tier-1 generation via Higgsfield CLI (30+ models — Soul V2, Nano Banana 2, Veo 3.1, Kling 3.0, Seedance 2.0, Flux 2, Marketing Studio). Triggers on: 'generate content', 'cinematic', 'create scene', 'start frame', 'style library', 'generate campaign', 'AI filmmaking', 'higgsfield generate', 'soul cinema', 'marketing studio'."
47
---
58

skills/broomva/content-engine/skills/content-engine-dna/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
name: content-engine-dna
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: "Visual DNA Compiler -- compiles raw brand assets, character references, and style inspiration into persistent, structured identity files. Uses Gemini multimodal analysis to extract color palettes, composition rules, lighting patterns, and texture preferences. Generates tool-specific prompt fragments for Nano Banana Pro, Soul Cinema, Weavy, and ComfyUI. Inspired by Karpathy's LLM Wiki (compile-then-query) and MemPalace spatial hierarchy. Triggers on: 'compile brand', 'extract DNA', 'character sheet', 'style guide', 'compile identity', 'brand analysis'."
4-
version: 1.0.0
57
author: broomva
68
tags:
79
- visual-identity

skills/broomva/content-engine/skills/content-engine-loop/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: content-engine-loop
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: "Content Loop + Distribution — compounds existing broomva skills into a unified content lifecycle. Orchestrates /blog-post, /content-creation, /social-intelligence, /brainrot-for-good, and /brand-icons for multi-platform distribution. Adds performance tracking, feedback-driven identity refinement, content calendar, and campaign management. Triggers on: 'distribute content', 'content loop', 'publish campaign', 'content calendar', 'track performance'."
47
---
58

skills/broomva/decision-log/SKILL.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
name: decision-log
3+
category: broomva
4+
version: "1.0.0"
5+
kind: python
36
description: >
47
Captures a decision with context, alternatives considered, and rationale, then links
58
it to the relevant project doc in the vault. Creates a searchable decision record.

0 commit comments

Comments
 (0)