Migrate review to skill-based architecture#64
Conversation
576653a to
a3eefc9
Compare
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> fix(review): escape suggestion blocks in prompt Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> fix(review): enforce suggestion-only replacements Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> update
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- Review methodology lives in factory-plugins core plugin (code-review skill) - CI loads shared methodology from plugin cache at runtime - Skill uses BEGIN/END_SHARED_METHODOLOGY markers to separate: - Shared: bug patterns, analysis discipline, reporting gate, priorities, format - Shallow (TUI): local context detection + local findings output - Deep (CI): pre-computed artifacts, MCP tools, posting, validator flow - CI always posts comments (deep flow); TUI skill returns locally (shallow flow) - formatSkillSection extracts only shared methodology for CI prompt injection Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
a3eefc9 to
0d493c4
Compare
07f09c6 to
7e4fc66
Compare
|
Droid finished @factory-nizar's task —— View job Droid reviewed this PR and found 3 issues (3 P1). Summary: The skill-loader integration has a genuine path-resolution bug (HOME fallback to |
There was a problem hiding this comment.
The skill-loader integration has a genuine path-resolution bug (HOME fallback to ~ doesn't expand in Node/Bun) and both prompt templates can silently lose their review methodology when skill loading fails, since the previously hardcoded guidance was removed without a fallback. Consider using os.homedir() and either failing fast on missing skills or keeping a minimal inlined methodology.
- load-skill.ts: try local plugin cache first, then fetch from GitHub - Re-wire skill loading after rebase (review-prompt.ts removed by PR #59) - Inject skill into candidates and validator prompt templates Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
7e4fc66 to
7c007f8
Compare
jonathan-factory
left a comment
There was a problem hiding this comment.
Looks good, might be good to confirm that the plugin gets properly loaded before the action runs
Possible that it only gets installed in interactive mode
The factory-plugins repo uses 'master' as its default branch, not 'main'. The GitHub fallback was always 404ing in CI. Added unit tests for the loader functions and an E2E test that verifies the skill downloads from GitHub with no local cache (simulating a CI runner). Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
i'll test on the mono-repo now that the plugin is merged! |
|
@jonathan-factory Also added some additional tests on the branch! |

Summary
Migrates the review methodology into a skill-based architecture. The canonical review skill lives in the factory-plugins core plugin (
plugins/core/skills/review/SKILL.md) and is loaded at runtime by CI.Skill:
plugins/core/skills/review/SKILL.mdHow It Works
load-skill.tstries two sources in order:~/.factory/plugins/cache/factory-plugins/core/<hash>/skills/review/SKILL.md) -- used by the Droid CLI locallyraw.githubusercontent.com/Factory-AI/factory-plugins/main/...) -- used in CI where the plugin cache does not existThe shared methodology (bug patterns, analysis discipline, reporting gate, priority levels, finding format) is extracted via
<!-- BEGIN_SHARED_METHODOLOGY -->/<!-- END_SHARED_METHODOLOGY -->markers and injected into both the candidates and validator prompt templates.Changes
New: Skill Loader (
src/utils/load-skill.ts)loadSkill(name)-- loads from local cache, falls back to GitHubformatSkillSection(content)-- extracts shared methodology and wraps in<code_review_methodology>tagsextractSharedMethodology(content)-- parses marker-delimited sectionSkill Integration
PreparedContextextended withreviewSkillContentfieldcreatePromptpassesreviewSkillContentthrough to prompt generatorsreview.ts,review-validator.ts,generate-review-prompt.tsload the skill and pass it tocreatePromptreview-candidates-prompt.tsandreview-validator-prompt.tsinject skill viaformatSkillSection()Testing