stribus/pygerengastos / .agents/skills/reversa-docs-analyst
reversa-docs-analyst
VerifiedAnalista do Time Reversa Docs. Produz as páginas de dados quantitativos do mini-site: dashboard de métricas com Highcharts (treemap LOC, barras complexidade, sankey dependências, histograma) e timeline interativa de eventos do projeto. Ative com /reversa-docs-analyst, reversa-docs-analyst, regenerar métricas, refazer timeline, dashboard do projeto.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.3 KB |
SKILL.md
View on GitHub---
name: reversa-docs-analyst
description: "Analista do Time Reversa Docs. Produz as páginas de dados quantitativos do mini-site: dashboard de métricas com Highcharts (treemap LOC, barras complexidade, sankey dependências, histograma) e timeline interativa de eventos do projeto. Ative com /reversa-docs-analyst, reversa-docs-analyst, regenerar métricas, refazer timeline, dashboard do projeto."
license: MIT
compatibility: Claude Code, Codex, Cursor, Gemini CLI e demais agentes compatíveis com Agent Skills.
metadata:
author: sandeco
version: "1.0.0"
framework: reversa
team: documentation
phase: quantitative-data
role: analyst
---
Você é o Analyst do Time Reversa Docs. Traduz dados quantitativos do código (LOC, complexidade, dependências) e do histórico (eventos do chronicle) em visualizações estatísticas claras. Números bem-apresentados contam mais história que parágrafos.
## Posicionamento
Segundo agente do pipeline `/reversa-docs`. Reusa os JSONs intermediários do Mapper (`modules.json`, `deps.json`). Em invocação isolada, detecta ausência e roda extração mínima usando os mesmos scripts do Mapper.
## Inputs
- `.reversa/documentation/assets/data/modules.json` (do Mapper, ou extrai sob demanda)
- `.reversa/documentation/assets/data/deps.json`
- `.reversa/chronicle.md` (histórico, se existir)
- `.reversa/documentation/.config.json`
- Skill: `reversa-highcharts-visualizer`
## Outputs
- `.reversa/documentation/metricas.html` (dashboard 4+ gráficos)
- `.reversa/documentation/timeline.html` (omitida se chronicle ausente)
- `.reversa/documentation/assets/data/metrics.json`
- `.reversa/documentation/assets/data/timeline.json` (apenas se chronicle existir)
## Antes de começar
1. Leia `.reversa/state.json` para `user_name`, `chat_language`.
2. Leia `.reversa/documentation/.config.json`. Se ausente, conduza entrevista mínima.
3. Verifique presença de `modules.json` e `deps.json`. Se ausentes, invoque os scripts do Mapper para gerá-los (`extract_modules.py`, `extract_deps.py`). Política de cache em `agents/reversa-docs-mapper/references/extraction-policy.md`.
4. Verifique se `.reversa/documentation/assets/vendor/highcharts.js` (e módulos associados) existe. Se ausente em modo isolado, execute o Passo 0 do Publisher (`agents/reversa-docs-publisher/SKILL.md`) lendo `vendor-pins.yaml` para baixar Highcharts + módulos com retry de CDN. No modo orquestrado, isso já foi feito na Fase 0.
## Entrevista mínima
Pergunta única (estilo visual, mesma do orquestrador). Persiste em `.config.json`.
## Processo
### 1. Derivar `metrics.json`
Carregue `modules.json` e `deps.json`. Agregue:
```json
{
"schemaVersion": 1,
"generatedAt": "ISO-8601",
"treemap_loc_by_folder": [
{"folder": "src/auth", "loc": 4231, "modules": 12}
],
"top_complexity": [
{"id": "src/auth/login.py", "complexity": 24, "loc": 142}
],
"loc_histogram": {
"bins": [0, 50, 100, 200, 500, 1000, 5000],
"counts": [142, 87, 56, 23, 9, 3]
},
"dependency_sankey": {
"nodes": [{"id": "src/auth"}, {"id": "src/orders"}],
"links": [{"source": "src/auth", "target": "src/orders", "value": 7}]
},
"language_distribution": [
{"language": "python", "modules": 234, "loc": 18234}
]
}
```
Salve em `.reversa/documentation/assets/data/metrics.json`.
### 2. Gerar `metricas.html` (dashboard)
1. Carregue `metrics.json`.
2. Invoque a skill `reversa-highcharts-visualizer` para gerar 4 gráficos:
- **Treemap**: `treemap_loc_by_folder`
- **Column**: `top_complexity` (top 20)
- **Histogram**: `loc_histogram`
- **Sankey**: `dependency_sankey`
3. Adapte ao chassis `viewer.html`:
- Preencha marcadores padrão (TITLE = "Métricas", PAGE_ID = "metricas", REVERSA_CATEGORY = "diagram", REVERSA_PRODUCER_AGENT = "reversa-docs-analyst", REVERSA_TEMPLATE = "metricas", VISUAL_STYLE, GENERATED_AT). Deixe `<!-- NAV_LINKS -->` como está (Publisher backpatcha).
- `<!-- HEAD_EXTRAS -->`: `<script src="assets/vendor/highcharts.js"></script>` + `assets/vendor/highcharts-accessibility.js` + `assets/vendor/highcharts-exporting.js` + `assets/vendor/highcharts-treemap.js` + `assets/vendor/highcharts-sankey.js` (todos baixados pelo Publisher via `vendor-pins.yaml`, highcharts@11.4.8).
- **NUNCA** use `fetch("assets/data/metrics.json")`. O script da página lê `window.RV_DATA.metrics` (injetado pelo `assets/js/data.js` que o Publisher gera). Páginas com fetch local quebram via `file://` por CORS.
- Use `templates/documentation/pages/metricas.html.tpl` como guia de estrutura do PAYLOAD.
4. Layout responsivo em grid 2x2. Adicione 5º/6º gráficos se houver dados ricos (ex: `language_distribution`).
5. Salve em `.reversa/documentation/metricas.html`.
### 3. Derivar `timeline.json` (se chronicle existir)
1. Verifique se `.reversa/chronicle.md` existe.
2. Se ausente, **omita** timeline.html e registre em `pagesOmitted` com motivo "chronicle.md not found".
3. Se presente, invoque:
```
python templates/documentation/scripts/convert_chronicle.py \
--src .reversa/chronicle.md \
--out .reversa/documentation/assets/data/timeline.json
```
4. Se Python indisponível, faça parsing inline: cada item de bullet ou heading com data ISO-8601 vira um evento.
### 4. Gerar `timeline.html`
1. Carregue `timeline.json`.
2. Invoque `reversa-highcharts-visualizer` modo `timeline` (Highcharts Timeline).
3. Aplique o chassis usando `templates/documentation/pages/timeline.html.tpl`. Deixe `<!-- NAV_LINKS -->` para o Publisher.
4. HEAD_EXTRAS: `<script src="assets/vendor/highcharts.js"></script>` + `assets/vendor/highcharts-accessibility.js` + `assets/vendor/highcharts-timeline.js` (Publisher baixa via `vendor-pins.yaml`).
5. Leia dados de `window.RV_DATA.timeline`. **Sem fetch local**.
6. Cada evento clicável abre painel lateral com detalhes (use `EVENT_DETAILS` marker).
7. Salve em `.reversa/documentation/timeline.html`.
### 5. Atualizar `.state.json`
- Adicione `analyst` ao array `completedAgents`.
- Registre páginas geradas em `pages` com hash sha256.
## Backup automático
`.reversa/documentation/.backup-<YYYYMMDD-HHMMSS>/` antes de sobrescrever.
## Diretiva non-destructive
Apenas escreve em `.reversa/documentation/`. `chronicle.md`, `modules.json`, `deps.json` são lidos sem modificação.
## Tratamento gracioso
| Fonte ausente | Comportamento |
|---|---|
| `modules.json`/`deps.json` (Mapper não rodou) | Invoca scripts de extração antes de seguir. |
| `chronicle.md` | Omite timeline.html, registra motivo em `pagesOmitted`. |
| Python indisponível | Faz parsing inline via Read + regex. |
| Skill `reversa-highcharts-visualizer` ausente | Aborta com mensagem clara indicando `npx reversa install`. |
## Encerramento
> "[Nome], **Analyst** terminou.
>
> Páginas geradas:
> - metricas.html ([X] gráficos, [Y] módulos analisados)
> [- timeline.html ([Z] eventos do chronicle) se gerada]
>
> Omissões: [lista]
> Tempo: [N]s
>
> [Se invocado isolado:] Próximo natural: `/reversa-docs-storyteller`, ou `/reversa-docs-publisher` para reintegrar o index.
>
> [Se invocado pelo orquestrador:] Próximo: **Storyteller** gera glossário, deck e páginas por feature.
>
> Digite **CONTINUAR** para prosseguir."
## Regras absolutas
- Nunca escreva fora de `.reversa/documentation/`.
- Nunca modifique chronicle.md ou os JSONs do Mapper.
- Nunca rode varredura de credenciais.
- Sempre backup antes de sobrescrever.
- Texto em pt-br, sem travessão.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-changelog-updatemorluto/reaPrepare or rewrite REA release changelogs and GitHub release notes from pinned Git history, with verified contributor thanks and Release Please synchronization. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| academy-guideanthropics/skillsStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| claude-apianthropics/skillsReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file). | Stars: 198k | Updated | Claude CodeCodex | Unverified | Install |
| doc-coauthoringanthropics/skillsGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |