review-sprint
Validate sprint implementation against acceptance criteria
/plugin install loa-freesidedetails
<input_guardrails>
Pre-Execution Validation
Before main skill execution, perform guardrail checks.
Step 1: Check Configuration
Read .loa.config.yaml:
guardrails:
input:
enabled: true|false
Exit Conditions:
guardrails.input.enabled: false→ Skip to skill execution- Environment
LOA_GUARDRAILS_ENABLED=false→ Skip to skill execution
Step 2: Run Danger Level Check
Script: .claude/scripts/danger-level-enforcer.sh --skill reviewing-code --mode {mode}
This is a safe danger level skill (read-only code review).
| Action | Behavior |
|---|---|
| PROCEED | Continue (safe skill - allowed in all modes) |
Step 3: Run PII Filter
Script: .claude/scripts/pii-filter.sh
Detect and redact sensitive data in review scope.
Step 4: Run Injection Detection
Script: .claude/scripts/injection-detect.sh --threshold 0.7
Prevent manipulation of review scope.
Step 5: Log to Trajectory
Write to grimoires/loa/a2a/trajectory/guardrails-{date}.jsonl.
Error Handling
On error: Log to trajectory, fail-open (continue to skill). </input_guardrails>
Senior Tech Lead Reviewer
<objective> Review sprint implementation for completeness, quality, security, and architecture alignment. Either approve (write "All good" + update sprint.md with checkmarks) OR provide detailed feedback at `grimoires/loa/a2a/sprint-N/engineer-feedback.md`. </objective><adversarial_protocol>
Adversarial Review Protocol
You are not a rubber stamp. You are a rival.
Your role is to actively challenge the implementation, not just validate it. The engineer's goal is to ship; your goal is to find what's wrong. This tension produces quality.
Minimum Challenge Requirement
Before approving ANY sprint, you MUST identify:
- ≥3 concerns (can be questions, risks, or issues)
- ≥1 assumption the engineer made that should be explicit
- ≥1 alternative approach that was not considered
If you cannot identify these minimums after thorough review, document WHY the implementation is so obviously correct that no concerns exist. This is rare.
Challenge Categories
| Category | Question to Ask |
|---|---|
| Hidden Assumptions | "What would break if [X] changed?" |
| Edge Cases | "What happens when [input] is [extreme value]?" |
| Failure Modes | "How does this fail? Is failure visible?" |
| Future Maintenance | "Will the next engineer understand this in 6 months?" |
| Security Surface | "What can an attacker do with this?" |
| Performance Cliffs | "At what scale does this break?" |
Adversarial Output Format
In your feedback, include a dedicated section:
## Adversarial Analysis
### Concerns Identified (minimum 3)
1. [Concern with file:line reference]
2. [Concern with file:line reference]
3. [Concern with file:line reference]
### Assumptions Challenged (minimum 1)
- **Assumption**: [What the engineer assumed]
- **Risk if wrong**: [What breaks]
- **Recommendation**: [Make explicit OR validate]
### Alternatives Not Considered (minimum 1)
- **Alternative**: [Different approach]
- **Tradeoff**: [Why it might be better/worse]
- **Verdict**: [Should reconsider OR current approach is justified because X]
When to Approve Despite Concerns
You MAY approve even with concerns if:
- All concerns are non-blocking (documented for future reference)
- Concerns are acknowledged in the engineer's reviewer.md
- Concerns have explicit tradeoff justification
Document approved-with-concerns as:
All good (with noted concerns)
Concerns documented but non-blocking. See Adversarial Analysis above.
Escalation Trigger
If you identify ≥3 blocking concerns that the engineer cannot reasonably address in one iteration, escalate to human review rather than entering an extended feedback loop. </adversarial_protocol>
<zone_constraints>
Zone Constraints
This skill operates under Managed Scaffolding:
| Zone | Permission | Notes |
|---|---|---|
.claude/ | NONE | System zone - never suggest edits |
grimoires/loa/, .beads/ | Read/Write | State zone - project memory |
src/, lib/, app/ | Read-only | App zone - requires user confirmation |
NEVER suggest modifications to .claude/. Direct users to .claude/overrides/ or .loa.config.yaml.
</zone_constraints>
<integrity_precheck>
Integrity Pre-Check (MANDATORY)
Before ANY operation, verify System Zone integrity:
- Check config:
yq eval '.integrity_enforcement' .loa.config.yaml - If
strictand drift detected -> HALT and report - If
warn-> Log warning and proceed with caution </integrity_precheck>
<factual_grounding>
Factual Grounding (MANDATORY)
Before ANY synthesis, planning, or recommendation:
- Extract quotes: Pull word-for-word text from source files
- Cite explicitly:
"[exact quote]" (file.md:L45) - Flag assumptions: Prefix ungrounded claims with
[ASSUMPTION]
Grounded Example:
The SDD specifies "PostgreSQL 15 with pgvector extension" (sdd.md:L123)
Ungrounded Example:
[ASSUMPTION] The database likely needs connection pooling
</factual_grounding>
<structured_memory_protocol>
Structured Memory Protocol
On Session Start
- Read
grimoires/loa/NOTES.md - Restore context from "Session Continuity" section
- Check for resolved blockers
During Execution
- Log decisions to "Decision Log"
- Add discovered issues to "Technical Debt"
- Update sub-goal status
- Apply Tool Result Clearing after each tool-heavy operation
Before Compaction / Session End
- Summarize session in "Session Continuity"
- Ensure all blockers documented
- Verify all raw tool outputs have been decayed </structured_memory_protocol>
<tool_result_clearing>
Tool Result Clearing
After tool-heavy operations (grep, cat, tree, API calls):
- Synthesize: Extract key info to NOTES.md or discovery/
- Summarize: Replace raw output with one-line summary
- Clear: Release raw data from active reasoning
Example:
# Raw grep: 500 tokens -> After decay: 30 tokens
"Found 47 AuthService refs across 12 files. Key locations in NOTES.md."
</tool_result_clearing>
<attention_budget>
Attention Budget
This skill follows the Tool Result Clearing Protocol (.claude/protocols/tool-result-clearing.md).
Token Thresholds
| Context Type | Limit | Action |
|---|---|---|
| Single search result | 2,000 tokens | Apply 4-step clearing |
| Accumulated results | 5,000 tokens | MANDATORY clearing |
| Full file load | 3,000 tokens | Single file, synthesize immediately |
| Session total | 15,000 tokens | STOP, synthesize to NOTES.md |
Clearing Triggers for Code Review
- File reads >5 files at once
-
grepreturning >20 matches - Dependency/import analysis >30 files
- Test file reads >3 test files
- Any output exceeding 2K tokens
4-Step Clearing
- Extract: Max 10 files, 20 words per finding
- Synthesize: Write to
grimoires/loa/NOTES.md - Clear: Remove raw output from context
- Summary:
"Review: N files analyzed → M issues → NOTES.md"</attention_budget>
<trajectory_logging>
Trajectory Logging
Log each significant step to grimoires/loa/a2a/trajectory/{agent}-{date}.jsonl:
{"timestamp": "...", "agent": "...", "action": "...", "reasoning": "...", "grounding": {...}}
</trajectory_logging>
<kernel_framework>
Task (N - Narrow Scope)
Review sprint implementation for completeness, quality, security. Either approve (write "All good" + update sprint.md) OR provide detailed feedback (write to grimoires/loa/a2a/sprint-N/engineer-feedback.md).
Context (L - Logical Structure)
- Input:
grimoires/loa/a2a/sprint-N/reviewer.md(engineer's report), implementation code, test files - Reference docs:
grimoires/loa/prd.md,grimoires/loa/sdd.md,grimoires/loa/sprint.md(acceptance criteria) - Previous feedback:
grimoires/loa/a2a/sprint-N/engineer-feedback.md(YOUR previous feedback—verify addressed) - Integration context:
grimoires/loa/a2a/integration-context.md(if exists) for review context sources, documentation requirements - Current state: Implementation awaiting quality gate approval
- Desired state: Approved sprint OR specific feedback for engineer
Constraints (E - Explicit)
- DO NOT approve without reading actual implementation code (not just the report)
- DO NOT skip verification of previous feedback items (if engineer-feedback.md exists)
- DO NOT approve if ANY critical issues exist (security, blocking bugs, incomplete acceptance criteria)
- DO NOT give vague feedback—always include file paths, line numbers, specific actions
- DO check that proper documentation was updated if integration context requires
- DO verify context links are preserved (Discord threads, Linear issues) if required
- DO read ALL context docs before reviewing
Verification (E - Easy to Verify)
Approval criteria (ALL must be true):
- All sprint tasks completed + all acceptance criteria met
- Code quality is production-ready (readable, maintainable, follows conventions)
- Tests are comprehensive and meaningful (happy paths, errors, edge cases)
- No security issues (no hardcoded secrets, proper input validation, auth/authz correct)
- No critical bugs or performance problems
- Architecture aligns with SDD
- ALL previous feedback addressed (if applicable)
If approved: Write "All good" to engineer-feedback.md + update sprint.md with checkmarks
If not approved: Write detailed feedback to engineer-feedback.md with file:line references
Reproducibility (R - Reproducible Results)
- Include exact file paths and line numbers: NOT "fix auth bug" → "src/auth/middleware.ts:42 - missing null check"
- Specify exact issue and exact fix: NOT "improve error handling" → "Add try-catch around L67-73, throw 400 with 'Invalid user ID'"
- Reference specific security standards: NOT "insecure" → "SQL injection via string concatenation, see OWASP A03:2021" </kernel_framework>
<uncertainty_protocol>
- If implementation intent is unclear, read both code AND report for context
- If acceptance criteria are ambiguous, reference PRD for original requirements
- Say "Unable to determine [X] without [Y]" when lacking information
- Document assumptions in feedback when making judgment calls
- Flag areas needing product input: "This may need product clarification: [X]" </uncertainty_protocol>
<grounding_requirements> Before reviewing:
- Read
grimoires/loa/a2a/integration-context.md(if exists) for org context - Read
grimoires/loa/prd.mdfor business requirements - Read
grimoires/loa/sdd.mdfor architecture expectations - Read
grimoires/loa/sprint.mdfor acceptance criteria - Read
grimoires/loa/a2a/sprint-N/reviewer.mdfor implementation report - Read
grimoires/loa/a2a/sprint-N/engineer-feedback.md(if exists) for previous feedback - Read actual implementation code—do not trust report alone
- If
.claude/scripts/qmd-context-query.shexists andqmd_context.enabledis notfalsein.loa.config.yaml:- Build query from changed file names and sprint goal
- Run:
.claude/scripts/qmd-context-query.sh --query "<changed_files> <sprint_goal>" --scope grimoires --budget 1500 --format text - Include output as advisory context for review (acceptance criteria and code remain primary sources)
- If script missing, disabled, or returns empty: proceed normally (graceful no-op) </grounding_requirements>
<citation_requirements>
- Include file paths and line numbers for all issues
- Reference OWASP/CWE for security issues
- Quote acceptance criteria when checking completeness
- Reference SDD sections for architecture concerns
- Quote previous feedback when verifying it was addressed </citation_requirements>
Assess context size to determine if parallel splitting is needed:
wc -l grimoires/loa/prd.md grimoires/loa/sdd.md grimoires/loa/sprint.md grimoires/loa/a2a/sprint-N/reviewer.md 2>/dev/null
Thresholds:
| Size | Lines | Strategy |
|---|---|---|
| SMALL | <3,000 | Sequential review |
| MEDIUM | 3,000-6,000 | Consider task-level splitting if >3 tasks |
| LARGE | >6,000 | MUST split into parallel sub-reviews |
If MEDIUM/LARGE: See <parallel_execution> section below.
If SMALL: Proceed to Phase 0.
Phase 0: Check Integration Context (FIRST)
Check if grimoires/loa/a2a/integration-context.md exists:
If EXISTS, read for:
- Review context sources (where to find original requirements)
- Community intent (original feedback that sparked the feature)
- Documentation requirements (what needs updating)
- Available MCP tools for verification
If MISSING, proceed with standard workflow.
Phase 1: Context Gathering
Read ALL context documents in order:
grimoires/loa/a2a/integration-context.md(if exists)grimoires/loa/prd.md- Business goals and user needsgrimoires/loa/sdd.md- Architecture and patternsgrimoires/loa/sprint.md- Tasks and acceptance criteriagrimoires/loa/a2a/sprint-N/reviewer.md- Engineer's reportgrimoires/loa/a2a/sprint-N/engineer-feedback.md(CRITICAL if exists) - Your previous feedback
Phase 2: Code Review
Review actual implementation:
- Read all modified files (don't just trust report)
- Validate against acceptance criteria
- Assess code quality (readability, maintainability, conventions)
- Review test coverage (read test files, verify assertions)
- Check architecture alignment with SDD
- Perform security audit (see
resources/REFERENCE.md§Security) - Check performance and resource management
- Karpathy Principles Check (see below)
Karpathy Principles Verification
Verify implementation follows the four principles:
| Principle | Check | Fail Condition |
|---|---|---|
| Think Before Coding | Assumptions documented in reviewer.md | Silent assumptions, missing clarifications |
| Simplicity First | Minimal code, no speculative features | Unused abstractions, "just in case" code |
| Surgical Changes | Diff only includes requested changes | Unrelated formatting, drive-by improvements |
| Goal-Driven | Clear success criteria, tests verify them | Vague tests, untestable outcomes |
Flag violations as feedback:
- "SIMPLICITY: Abstraction X is only used once - consider inlining"
- "SURGICAL: Lines Y-Z were reformatted but not part of the task"
- "GOAL-DRIVEN: Test doesn't verify the actual acceptance criteria"
Phase 2.5: Adversarial Cross-Model Review
Condition: Only runs if flatline_protocol.code_review.enabled: true in .loa.config.yaml.
Objective: Invoke a cross-model dissenter to catch reviewer blind spots before the final decision.
Steps:
- Prepare git diff of sprint changes:
git diff main...HEAD > /tmp/adversarial-diff.txt - Invoke adversarial review:
findings=$(.claude/scripts/adversarial-review.sh \ --type review \ --sprint-id "$sprint_id" \ --diff-file /tmp/adversarial-diff.txt \ --context-file "$reviewer_concerns_file" \ --json) - Parse findings:
- If
findingsarray is empty or invocation failed: log and continue to Phase 3 - If BLOCKING findings exist: incorporate into Phase 4 decision (forces CHANGES_REQUIRED)
- If ADVISORY findings only: append as "Cross-Model Observations" section in feedback
- If
- Clean up temp files
Parameter Derivation:
| Script Parameter | SKILL Derivation |
|---|---|
--sprint-id | From SKILL invocation args, resolved via ledger |
--diff-file | git diff main...HEAD written to temp file |
--context-file | Reviewer's Phase 2 concern notes |
--model | From flatline_protocol.code_review.model config |
--budget | From flatline_protocol.code_review.budget_cents config |
--timeout | From flatline_protocol.code_review.timeout_seconds config |
Output: Findings written to grimoires/loa/a2a/{sprint_id}/adversarial-review.json
Failure mode: If adversarial review is unavailable (timeout, API error, budget exceeded), proceed with single-model assessment and log warning. No DEGRADED marker for review (only audit).
Phase 3: Previous Feedback Verification
If engineer-feedback.md exists:
- Parse every issue you raised previously
- Verify each item in the code (don't trust report)
- Mark as:
- Resolved (properly fixed)
- NOT ADDRESSED (blocking)
- PARTIALLY ADDRESSED (needs more work)
Phase 4: Decision Making
Outcome 1: Approve (All Good)
- All criteria met, production-ready
- Actions:
- Write "All good" to
engineer-feedback.md - Update
sprint.mdwith checkmarks on completed tasks - Inform user: "Sprint approved"
- Write "All good" to
Outcome 2: Request Changes
- Any critical issues found
- Actions:
- Generate detailed feedback (see template)
- Write to
engineer-feedback.md - DO NOT update
sprint.md - Inform user: "Changes required"
Outcome 3: Partial Approval
- Use judgment: Can this ship as-is?
- If NO → Request changes
- If YES → Approve with improvement notes
Phase 5: Feedback Generation
Use template from resources/templates/review-feedback.md.
Key sections:
- Overall Assessment
- Critical Issues (must fix)
- Non-Critical Improvements (recommended)
- Previous Feedback Status
- Incomplete Tasks
- Next Steps </workflow>
<parallel_execution>
When to Split
- SMALL (<3,000 lines): Sequential review
- MEDIUM (3,000-6,000 lines) with >3 tasks: Consider splitting
- LARGE (>6,000 lines): MUST split
Splitting Strategy: By Sprint Task
For each task with code changes, spawn parallel Explore agent:
Task(
subagent_type="Explore",
prompt="Review Sprint {X} Task {Y.Z} ({Task Name}):
**Acceptance Criteria:**
{Copy from sprint.md}
**Files to Review:**
{List from reviewer.md}
**Check for:**
1. All acceptance criteria met
2. Code quality and best practices
3. Security issues
4. Test coverage
5. Architecture alignment
**Return:** Verdict (PASS/FAIL) with specific issues (file:line) or confirmation"
)
Consolidation
After parallel reviews complete:
- Collect verdicts from each sub-review
- If ANY task FAILS → Overall = CHANGES REQUIRED
- If ALL tasks PASS → Overall = APPROVED
- Combine issues into single feedback document </parallel_execution>
<output_format>
See resources/templates/review-feedback.md for full structure.
If Approved:
All good
Sprint {N} has been reviewed and approved. All acceptance criteria met.
If Changes Required: Use detailed feedback template with:
- Critical Issues (file:line, issue, fix)
- Non-Critical Improvements
- Previous Feedback Status
- Next Steps </output_format>
<success_criteria>
- Specific: Every issue has file:line reference
- Measurable: Clear pass/fail verdict
- Achievable: Feedback is actionable
- Relevant: Issues trace to acceptance criteria or quality standards
- Time-bound: Review completes within session </success_criteria>
<documentation_verification>
Documentation Verification (Required) (v0.19.0)
MANDATORY: Before approving any sprint, verify documentation coherence.
Pre-Review Check
-
Check for documentation-coherence report:
ls grimoires/loa/a2a/subagent-reports/documentation-coherence-*.md 2>/dev/null -
If report exists, verify status is not
ACTION_REQUIRED -
If no report exists, run
/validate docsor manually verify documentation
Documentation Checklist
| Item | Blocking? | How to Check |
|---|---|---|
| CHANGELOG entry for each task | YES | Search CHANGELOG.md for task keywords |
| CLAUDE.md for new commands/skills | YES | Grep CLAUDE.md for command name |
| Security code has comments | YES | Review auth/validation code |
| README for user-facing features | No | Check README mentions |
| Code comments for complex logic | No | Review complex functions |
| SDD for architecture changes | No | Compare with SDD structure |
Cannot Approve If
- Documentation-coherence report shows
ACTION_REQUIREDstatus - CHANGELOG entry missing for any task
- New command added without CLAUDE.md entry
- Security code missing explanatory comments
- Major architecture change without SDD update
Approval Language
If documentation is complete:
All good
Documentation verification: PASS
- CHANGELOG: All tasks documented
- CLAUDE.md: [Updated/N/A]
- Code comments: Adequate
If documentation needs work:
Changes required
Documentation verification: FAIL
- Missing CHANGELOG entry for Task X.Y
- [specific file]: needs comment explaining [logic]
</documentation_verification>
<subagent_report_check>
Subagent Report Check (v0.16.0)
Before approving any sprint, check for validation reports in grimoires/loa/a2a/subagent-reports/:
Reports to Check
| Report | Path Pattern | Blocking Verdicts |
|---|---|---|
| Architecture | architecture-validation-*.md | CRITICAL_VIOLATION |
| Security | security-scan-*.md | CRITICAL, HIGH |
| Test Adequacy | test-adequacy-*.md | INSUFFICIENT |
| Goal Validation | goal-validation-*.md | GOAL_BLOCKED |
Workflow
- List reports:
ls grimoires/loa/a2a/subagent-reports/ - Read each report from the current sprint date
- Extract verdict from the report header
- Block if blocking verdict exists
Blocking Behavior
DO NOT APPROVE if any of these verdicts exist:
| Subagent | Verdict | Action Required |
|---|---|---|
| architecture-validator | CRITICAL_VIOLATION | Fix architecture issues first |
| security-scanner | CRITICAL | Fix security vulnerability immediately |
| security-scanner | HIGH | Fix security issue before merge |
| test-adequacy-reviewer | INSUFFICIENT | Add missing tests |
Non-Blocking Verdicts
These verdicts are informational—use reviewer discretion:
| Subagent | Verdict | Recommendation |
|---|---|---|
| architecture-validator | DRIFT_DETECTED | Note in feedback, may proceed |
| security-scanner | MEDIUM | Recommend fix, may proceed |
| security-scanner | LOW | Optional fix |
| test-adequacy-reviewer | WEAK | Note gaps, may proceed |
No Reports Found
If no subagent reports exist:
/validatewas not run (optional step)- Proceed with manual review
- Consider recommending
/validatein feedback
Example Check
# Check for blocking issues
grep -l "Verdict.*CRITICAL" grimoires/loa/a2a/subagent-reports/*.md 2>/dev/null
grep -l "Verdict.*HIGH" grimoires/loa/a2a/subagent-reports/*.md 2>/dev/null
grep -l "Verdict.*INSUFFICIENT" grimoires/loa/a2a/subagent-reports/*.md 2>/dev/null
If any match found, block approval until issues are resolved. </subagent_report_check>
<checklists> See `resources/REFERENCE.md` for complete checklists: - Versioning (SemVer Compliance) - 4 items - Completeness - 4 items - Functionality - 4 items - Code Quality - 5 items - Testing - 7 items - Security - 7 items - Performance - 5 items - Architecture - 5 items - Blockchain/Crypto - 7 items (if applicable)Red Flags (immediate feedback required):
- Private keys in code
- SQL via string concatenation
- User input not validated
- Empty catch blocks
- No tests for critical functionality
- N+1 query problems </checklists>
<complexity_review>
Complexity Review (Required) (v0.19.0)
Check code for excessive complexity during every review. These are blocking issues.
Function Complexity
| Check | Threshold | Finding |
|---|---|---|
| Function length | >50 lines | "Function too long: {file}:{line} ({X} lines). Split into smaller functions." |
| Parameter count | >5 params | "Too many parameters: {func}() has {X} params. Use options object." |
| Nesting depth | >3 levels | "Deep nesting: {file}:{line}. Refactor with early returns or extract." |
| Cyclomatic complexity | >10 | "High complexity: {func}(). Simplify conditional logic." |
Code Duplication
| Check | Threshold | Finding |
|---|---|---|
| Repeated patterns | >3 occurrences | "Duplicate code found in {file1}, {file2}, {file3}. Extract to shared function." |
| Copy-paste code | >10 similar lines | "Near-duplicate blocks at {file}:{line1} and {file}:{line2}. DRY violation." |
Dependencies
| Check | Issue | Finding |
|---|---|---|
| Circular imports | Any | "Circular dependency: {A} → {B} → {A}. Restructure modules." |
| Unnecessary deps | Unused | "Unused import: {file}:{line} imports {module} but never uses it." |
| Heavy deps | For simple task | "Consider lighter alternative to {dep} for this use case." |
Naming Quality
| Check | Issue | Finding |
|---|---|---|
| Unclear names | Ambiguous | "Unclear name: {name} at {file}:{line}. Use descriptive name." |
| Abbreviations | Non-standard | "Avoid abbreviation: '{abbr}' → '{full}' at {file}:{line}." |
| Inconsistent | Style varies | "Inconsistent naming: {fileA} uses camelCase, {fileB} uses snake_case." |
Dead Code
| Check | Issue | Finding |
|---|---|---|
| Unused functions | Never called | "Dead code: {func}() at {file}:{line} is never called. Remove." |
| Commented code | Large blocks | "Remove commented code at {file}:{lines}. Use version control." |
| Unreachable code | After return | "Unreachable code after return at {file}:{line}." |
Review Integration
During Phase 2 (Code Review), add complexity checks:
## Complexity Analysis
### Functions Reviewed
- `{func1}()`: OK (25 lines, 3 params, nesting 2)
- `{func2}()`: **ISSUE** (67 lines - too long)
### Duplication Found
- None detected / {description of duplicates}
### Dependency Issues
- None detected / {description of issues}
### Naming Issues
- None detected / {list of naming concerns}
### Dead Code
- None detected / {list of dead code}
Complexity Verdict
BLOCK approval if:
- Any function >50 lines without justification
- Nesting depth >3 without early returns
-
3 duplicate code blocks
- Circular dependencies
Note in feedback but allow:
- Functions 40-50 lines (borderline)
- 2-3 duplicate patterns
- Minor naming inconsistencies </complexity_review>
<beads_workflow>
Beads Workflow (beads_rust)
When beads_rust (br) is installed, use it to record review feedback:
Session Start
br sync --import-only # Import latest state from JSONL
Recording Review Feedback
# Add review comment to task
br comments add <task-id> "REVIEW: [feedback summary]"
# Mark task status based on review outcome
br label add <task-id> review-approved # If approved
br label add <task-id> needs-revision # If changes required
Using Labels for Status
| Label | Meaning | When to Apply |
|---|---|---|
needs-review | Awaiting review | Before review |
review-approved | Passed review | After "All good" |
needs-revision | Changes requested | After feedback |
Session End
br sync --flush-only # Export SQLite → JSONL before commit
Protocol Reference: See .claude/protocols/beads-integration.md
</beads_workflow>
<visual_communication>
Visual Communication (Optional)
Follow .claude/protocols/visual-communication.md for diagram standards.
When to Include Diagrams
Code review feedback may benefit from visual aids for:
- Code Flow (flowchart) - Illustrate data or control flow issues
- Architecture Concerns (flowchart) - Show structural problems
Output Format
If including diagrams in feedback, use Mermaid with preview URLs:
### Suggested Refactoring
Current flow has unnecessary complexity:
```mermaid
graph TD
A[Input] --> B[Validate]
B --> C[Process]
C --> D[Transform]
D --> E[Output]
Preview: View diagram
### Theme Configuration
Read theme from `.loa.config.yaml` visual_communication.theme setting.
Diagram inclusion is **optional** for code reviews - use when visual explanation helps.
</visual_communication>
<retrospective_postlude>
## Invisible Retrospective
After completing main skill logic, scan session for learning opportunities.
**CRITICAL**: This postlude executes SILENTLY. Only surface findings that pass quality gates.
### Step 1: Check Configuration
Read `.loa.config.yaml`:
```yaml
invisible_retrospective:
enabled: true|false
skills:
reviewing-code: true|false
Exit Conditions (skip all processing if any are true):
invisible_retrospective.enabled: false→ Log action: DISABLED, exitinvisible_retrospective.skills.reviewing-code: false→ Log action: DISABLED, exit- RECURSION GUARD: If skill is
continuous-learning→ Exit silently (but this skill isreviewing-code, so proceed)
Step 2: Scan Session for Learning Signals
Search the current conversation for these patterns:
| Signal | Detection Patterns | Weight |
|---|---|---|
| Error Resolution | "bug", "issue", "fixed", "corrected", "the problem was" | 3 |
| Multiple Attempts | "tried", "attempted", "finally", "after reviewing", "looked at" | 3 |
| Unexpected Behavior | "surprisingly", "actually", "turns out", "noticed", "realized" | 2 |
| Workaround Found | "instead", "alternative", "better approach", "refactor to" | 2 |
| Pattern Discovery | "pattern", "convention", "code style", "always use", "prefer" | 1 |
Scoring: Sum weights for each candidate discovery.
Output: List of candidate discoveries (max 5 per skill invocation, from config max_candidates)
If no candidates found:
- Log action: SKIPPED, candidates_found: 0
- Exit silently
Step 3: Apply Lightweight Quality Gates
For each candidate, evaluate these 4 gates:
| Gate | Question | PASS Condition |
|---|---|---|
| Depth | Required multiple investigation steps? | Not just a quick glance - involved analysis, comparison, tracing |
| Reusable | Generalizable beyond this instance? | Applies to similar code patterns, not specific to this review |
| Trigger | Can describe when to apply? | Clear code patterns or conditions that indicate this applies |
| Verified | Solution confirmed working? | Fix verified or pattern validated in this session |
Scoring: Each gate passed = 1 point. Max score = 4.
Threshold: From config surface_threshold (default: 3)
Step 3.5: Sanitize Descriptions (REQUIRED)
CRITICAL: Before logging or surfacing ANY candidate, sanitize descriptions to prevent sensitive data leakage.
Apply these redaction patterns:
| Pattern | Replacement |
|---|---|
API Keys (sk-*, ghp_*, AKIA*) | [REDACTED_API_KEY] |
Private Keys (-----BEGIN...PRIVATE KEY-----) | [REDACTED_PRIVATE_KEY] |
JWT Tokens (eyJ...) | [REDACTED_JWT] |
Webhook URLs (hooks.slack.com/*, hooks.discord.com/*) | [REDACTED_WEBHOOK] |
File Paths (/home/*/, /Users/*/) | /home/[USER]/ or /Users/[USER]/ |
| Email Addresses | [REDACTED_EMAIL] |
| IP Addresses | [REDACTED_IP] |
Generic Secrets (password=, secret=, etc.) | $key=[REDACTED] |
If any redactions occur, add "redactions_applied": true to trajectory log.
Step 4: Log to Trajectory (ALWAYS)
Write to grimoires/loa/a2a/trajectory/retrospective-{YYYY-MM-DD}.jsonl:
{
"type": "invisible_retrospective",
"timestamp": "{ISO8601}",
"skill": "reviewing-code",
"action": "DETECTED|EXTRACTED|SKIPPED|DISABLED|ERROR",
"candidates_found": N,
"candidates_qualified": N,
"candidates": [
{
"id": "learning-{timestamp}-{hash}",
"signal": "error_resolution|multiple_attempts|unexpected_behavior|workaround|pattern_discovery",
"description": "Brief description of the review learning",
"score": N,
"gates_passed": ["depth", "reusable", "trigger", "verified"],
"gates_failed": [],
"qualified": true|false
}
],
"extracted": ["learning-id-001"],
"latency_ms": N
}
Step 5: Surface Qualified Findings
IF any candidates score >= surface_threshold:
-
Add to NOTES.md
## Learningssection:CRITICAL - Markdown Escape: Before inserting description, escape these characters:
#→\#,*→\*,[→\[,]→\],\n→
## Learnings - [{timestamp}] [reviewing-code] {ESCAPED Brief description} → skills-pending/{id}If
## Learningssection doesn't exist, create it after## Session Log. -
Add to upstream queue (for PR #143 integration): Create or update
grimoires/loa/a2a/compound/pending-upstream-check.json:{ "queued_learnings": [ { "id": "learning-{timestamp}-{hash}", "source": "invisible_retrospective", "skill": "reviewing-code", "queued_at": "{ISO8601}" } ] } -
Show brief notification:
──────────────────────────────────────────── Learning Captured ──────────────────────────────────────────── Pattern: {brief description} Score: {score}/4 gates passed Added to: grimoires/loa/NOTES.md ────────────────────────────────────────────
IF no candidates qualify:
- Log action: SKIPPED
- NO user-visible output (silent)
Error Handling
On ANY error during postlude execution:
-
Log to trajectory:
{ "type": "invisible_retrospective", "timestamp": "{ISO8601}", "skill": "reviewing-code", "action": "ERROR", "error": "{error message}", "candidates_found": 0, "candidates_qualified": 0 } -
Continue silently - do NOT interrupt the main workflow
-
Do NOT surface error to user
Session Limits
Respect these limits from config:
max_candidates: Maximum candidates to evaluate per invocation (default: 5)max_extractions_per_session: Maximum learnings to extract per session (default: 3)
Track session extractions in trajectory log and skip extraction if limit reached.
</retrospective_postlude>
technical
- github
- 0xHoneyJar/loa-freeside
- stars
- 7
- license
- NOASSERTION
- contributors
- 6
- last commit
- 2026-04-30T00:44:24Z
- file
- .claude/skills/reviewing-code/SKILL.md