Skip to content

feat: create review-context skill and scaffold asset - #303

Merged
yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:feat/review-context-skill
Jun 29, 2026
Merged

yvonnedevlinrh merged 2 commits into
unbound-force:mainfrom
yvonnedevlinrh:feat/review-context-skill

Conversation

@yvonnedevlinrh

@yvonnedevlinrh yvonnedevlinrh commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #294
Split from #176

Summary

Create the review-context skill that standardizes how review commands discover and load context before reviewing. This is a decomposition for composability — the four protocols currently exist only in /review-pr (Steps 6–8). Extracting them into a skill enables /review-council (#296) to gain context discovery capabilities it currently lacks, and provides /address-feedback with a standardized discovery mechanism.

Originally proposed as a convention pack (#176), triage analysis determined a skill is the correct artifact type — the content is procedural (discovery protocols, validation flows), not declarative rules. This is consistent with the pre-flight skill extraction precedent and the convention pack pattern across both unbound-force and complytime orgs.

What's included

Skill file (.opencode/skills/review-context/SKILL.md)

Four protocols consumed as a cohesive unit:

Protocol What it does
Spec artifact discovery Branch name mapping, PR description parsing, changed-file detection
Issue linking Regex parsing, digits-only validation, same-repo URL scoping, 5-issue fetch limit, 2000-char body truncation, graceful error handling on 404/403/timeout
Path-based focus heuristics 7-category file classification table (test-quality, cli-ux, security, documentation, ci-cd, dependencies, standard)
Walkthrough generation Per-file change summary (< 30 files) or directory-level summary (>= 30 files)

Scaffold integration

Change File
Scaffold asset (embedded copy) internal/scaffold/assets/opencode/skills/review-context/SKILL.md
isDivisorAsset updated for --divisor deployment internal/scaffold/scaffold.go
expectedAssetPaths manifest updated (2 → 3 skills) internal/scaffold/scaffold_test.go
TestIsDivisorAsset test case added internal/scaffold/scaffold_test.go
TestRunInit_FreshDir file count (40 → 41) cmd/unbound-force/main_test.go

Test verification

TestAssetPaths_MatchExpected PASS
TestEmbeddedAssets_MatchSource PASS (drift detection)
TestIsDivisorAsset PASS
TestRunInit_FreshDir PASS (41 files)
go vet ./... clean
golangci-lint run 0 issues

Design decisions

  • Skill, not pack: Convention packs are declarative rule catalogs (CS-001 [MUST] ...). This content is procedural — discovery protocols and validation flows. See Create review-context convention pack for shared review discovery logic #176 triage comment for full evidence from both orgs.
  • Cohesive unit: All four protocols are always consumed together. No consumer needs spec discovery without path classification.
  • General-purpose protocol: Written as a protocol any review command can follow, not a verbatim copy of /review-pr Steps 6–8.
  • Divisor subset: Included in isDivisorAsset for uf init --divisor deployment since the skill supports Divisor review commands.

CRAP baseline update

The additional if-branch in isDivisorAsset increases its CRAP score from 4 to 5. The baseline is updated to reflect this. The CRAPload threshold is 15, so the function remains well below the limit. Refactoring to keep the score at 4 (e.g., a lookup map) would reduce readability and potentially violate Go pack CS-007 (no mutable package-level variables). The straightforward sequential if-return pattern is the right trade-off here.

Next steps

Add shared review context discovery skill that standardizes
how review commands discover spec artifacts, linked issues,
path classifications, and walkthrough format.

Four protocols defined as a cohesive unit:
- Spec artifact discovery (branch mapping, PR parsing)
- Issue linking (validation, sanitization, criteria extraction)
- Path-based focus heuristics (7-category classification)
- Walkthrough generation (per-file and directory-level)

Scaffold integration:
- Embedded asset for uf init distribution
- isDivisorAsset updated for --divisor deployment
- expectedAssetPaths manifest updated (40 -> 41)
- TestRunInit_FreshDir file count updated

Closes unbound-force#294

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin <[email protected]>
The additional if-branch for review-context skill increases
cyclomatic complexity by 1. Function remains well below the
CRAPload threshold of 15 with 100% test coverage.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Yvonne Devlin <[email protected]>

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, well-scoped skill extraction. All 10 acceptance criteria from #294 satisfied. CI green, local tools (vet, build, test) pass. The four protocols faithfully extract /review-pr Steps 6-8 into a general-purpose form. Scaffold integration follows the pre-flight skill precedent. No findings at any severity level.

This review was generated by /review-pr (AI-assisted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done ✔️

Development

Successfully merging this pull request may close these issues.

feat: create review-context skill and scaffold asset

2 participants