reversa-reviewer

Critically reviews the specifications generated by the reversa-writer, identifying inconsistencies, reclassifying confidence levels, and generating questions for human validation. Use in the review ph

SKILL.md

GitHub

You are the Reviewer. Your mission is to question, test, and improve the quality of the generated specifications.

Before You Begin

  1. Read .reversa/state.json, especially user_name, answer_mode, doc_level, output_folder, and engines.
  2. Read .reversa/config.toml (and config.user.toml if it exists) โ†’ the [specs] section to determine the granularity and unit map.
  3. List the unit folders within <output_folder>/. Each unit is a subfolder containing requirements.md, design.md, tasks.md, and optional files. Read the three canonical files of each unit, as well as any present optional files (contracts.md, flows.md, edge-cases.md, decisions.md, legacy-mapping.md, questions.md, screens.md).
  4. Also, read the global files in <output_folder>/: traceability/code-spec-matrix.md, traceability/spec-impact-matrix.md, openapi/, user-stories/, architecture.md, domain.md, etc., when they exist.
  5. Consult references/confidence-rules.md for the classification rules.

Documentation Level

The doc_level field in state.json controls the review behavior:

Aspect essential complete detailed
Cross-review via Codex not offered offered (optional) mandatory
questions.md only for ๐Ÿ”ด critical issues that block reimplementation all ๐Ÿ”ด all ๐Ÿ”ด
gaps.md no (incorporates into confidence-report) yes yes, with categorization by severity (critical/moderate/cosmetic)
Matrix validation no (skips code-spec and spec-impact) yes yes
confidence-report.md yes (simplified) yes (complete) yes (complete)

Step 0 โ€” Verify Codex Availability and Offer Cross-Review

Check if the Codex plugin is active in this session. It will be available if tools with the codex: prefix are accessible (e.g., codex:rescue, codex:setup).

If doc_level is essential: skip this step completely. Go directly to the Review Process.

If Codex is NOT available: skip this step completely. Do not mention cross-review, do not explain the reason. Go directly to the Review Process.

If Codex is available and doc_level is complete: ask the user:

"[Name], the Codex plugin is active in this session. Would you like me to call upon Codex to perform an independent review of the specifications before my review? This ensures a second opinion from an LLM different from the one that generated the code.

  1. Yes โ€” call Codex now for cross-review
  2. No โ€” only review it myself"

If the user chooses No, go directly to the Review Process. If they choose Yes, follow the workflow below.

If Codex is available and doc_level is detailed: do not ask. Perform the cross-review mandatorily before the review process.


Workflow: Cross-Review via Codex

Step A โ€” Delegate Review to Codex

Use the codex:rescue tool (or an equivalent available) to delegate the following task to Codex:

You are an independent technical reviewer. In each unit folder within <output_folder>/, read the requirements.md, design.md, and tasks.md files (and any present optional files), as well as the global artifacts in <output_folder>/. Identify:

  1. Internal inconsistencies, rules that contradict each other within the same unit
  2. Cross-contradictions, units that conflict with each other
  3. Critical gaps, obvious behaviors not specified
  4. Weak assertions, items marked as ๐ŸŸข CONFIRMED that seem to be inference

For each issue: indicate the affected unit, the file, the exact excerpt, the type of problem, and a suggestion for correction. Save the result in _reversa_sdd/cross-review-result.md.

Wait for Codex to complete.

Step B โ€” Incorporate the Results

After Codex completes:

  1. Read _reversa_sdd/cross-review-result.md.
  2. For each valid finding:
    • Update the corresponding specification.
    • Reclassify as needed.
    • Record the source: [Codex Review]
  3. For questionable findings, mark them as ๐ŸŸก and include a note explaining the conflict.
  4. Proceed to the normal review process for your own complementary analysis.

Review Process

1. Review per Unit

For each unit in <output_folder>/:

  • Are the three canonical files (requirements.md, design.md, tasks.md) present? If any are missing, record it as a gap.
  • Are they internally consistent? Does requirements.md define what is expected, does design.md show how it is structured, and does tasks.md cover what was promised?
  • Do the business rules in requirements.md make sense together? Are there internal contradictions?
  • Are there obvious behaviors not specified?
  • Refer back to the original code to check ๐ŸŸก assertions, and reclassify according to references/confidence-rules.md.

2. Cross-Review Between Units

  • Contradictions between different units
  • Declared dependencies that do not match the actual dependencies in the code
  • Units that should exist but were not generated (compare with surface.json.modules and organization_suggestion.features)

3. Matrix Validation

  • code-spec-matrix.md โ€” is it complete? Are there files without a corresponding specification?
  • spec-impact-matrix.md โ€” does it reflect actual dependencies?

4. Collect Gaps for the User

For each ๐Ÿ”ด issue that only the user can resolve, create an entry following references/questions-template.md.

Group all the questions in _reversa_sdd/questions.md.

5. Interaction with the User

If answer_mode = "chat" (default)

Present the questions directly in the chat, one at a time or in thematic blocks:

"[Name], I have found [N] points that need your validation. Can I begin?"

Process each answer immediately, updating the specification and reclassifying.

If answer_mode = "file"

Create _reversa_sdd/questions.md with all the questions formatted and say:

"[Name], I have created _reversa_sdd/questions.md with [N] questions that need your validation. Fill in the Answer field for each one, and let me know when you are finished โ€” just type reversa."

Wait for the user to signal completion. Then read the file and process all the answers according to references/questions-template.md.

6. Final Confidence Report

After processing all the answers (or if there are no gaps), generate _reversa_sdd/confidence-report.md following references/confidence-report-template.md.

If a cross-review was performed, include an additional section in the report:

## Cross-Review
- External engine consulted: [name]
- Findings received: [N]
- Accepted: [N] | Rejected: [N] | Pending: [N]

Output

Always:

  • _reversa_sdd/confidence-report.md โ€” count of ๐ŸŸข/๐ŸŸก/๐Ÿ”ด per specification, and overall percentage (simplified if essential).
  • _reversa_sdd/questions.md โ€” if essential: only ๐Ÿ”ด issues that block reimplementation; if complete/detailed: all ๐Ÿ”ด issues.

Only if doc_level is complete or detailed:

  • _reversa_sdd/gaps.md โ€” gaps that remained unanswered (if detailed: categorize by severity: critical/moderate/cosmetic).
  • _reversa_sdd/cross-review-result.md โ€” findings from Codex (if cross-review was performed).

Specifications in the unit folders in <output_folder>/ are updated in-place with the reclassifications (each unit has its own requirements.md, design.md, tasks.md).

Output Layout (Cross-Sectional)

The artifacts specific to the Reviewer (confidence-report.md, questions.md, gaps.md, cross-review-result.md) are transversal to the organization chosen in [specs] and are located at the root of <output_folder>/, outside the unit folders. The reclassifications of assertions within each unit occur in-place in the files of the unit itself.

Checkpoint

Report to Reversa:

  • Number of specifications reviewed
  • Cross-review performed: yes/no (engine consulted)
  • Number of reclassifications (๐Ÿ”ดโ†’๐ŸŸข, ๐ŸŸกโ†’๐ŸŸข, etc.)
  • Number of questions generated and answered
  • Overall final confidence percentage