feat(lfx-review-guard): add self-review skill for common reviewer blockers#16
feat(lfx-review-guard): add self-review skill for common reviewer blockers#16manishdixitlfx wants to merge 2 commits intomainfrom
Conversation
…ckers LFXV2-1312 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Manish Dixit <mdixit@linuxfoundation.org>
There was a problem hiding this comment.
Pull request overview
Adds a new /lfx-review-guard skill to run a report-only self-review checklist targeting common reviewer blockers, and documents it in the repository README alongside the existing skill workflow/architecture.
Changes:
- Add new skill definition at
lfx-review-guard/SKILL.mdimplementing the 9-check review checklist and report format. - Update
README.mdto include/lfx-review-guardin the skill list, architecture diagram, skill table, usage flows, and project structure.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| lfx-review-guard/SKILL.md | Introduces the new review-guard skill instructions, checks, and reporting format. |
| README.md | Documents the new skill across the skills overview, architecture diagram, workflow snippets, and structure listing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lfx-review-guard/SKILL.md
Outdated
| - **`effect()` writing to forms** — any `effect()` that calls `patchValue()`, `setValue()`, or `reset()` on a form needs `allowSignalWrites: true` in the effect options. | ||
| - **Signals not initialized inline** — per `component-organization.md`, simple `WritableSignal`s must be initialized directly (e.g., `loading = signal(false)`), not in the constructor. | ||
|
|
||
| **Severity:** BLOCKER for BehaviorSubject misuse and missing `allowSignalWrites`. DISCUSS for ChangeDetectorRef (may be legacy code being modified). |
There was a problem hiding this comment.
The guidance that an effect() calling form.patchValue()/setValue()/reset() “needs allowSignalWrites: true” appears incorrect: allowSignalWrites is relevant when an effect writes to signals, not when it performs imperative form updates. As written, this will create false “blocker” reports; please narrow the rule to actual signal writes (e.g., someSignal.set(...)) or remove the allowSignalWrites requirement for form operations.
| - **`effect()` writing to forms** — any `effect()` that calls `patchValue()`, `setValue()`, or `reset()` on a form needs `allowSignalWrites: true` in the effect options. | |
| - **Signals not initialized inline** — per `component-organization.md`, simple `WritableSignal`s must be initialized directly (e.g., `loading = signal(false)`), not in the constructor. | |
| **Severity:** BLOCKER for BehaviorSubject misuse and missing `allowSignalWrites`. DISCUSS for ChangeDetectorRef (may be legacy code being modified). | |
| - **`effect()` writing to signals** — any `effect()` that calls `someSignal.set(...)`, `update(...)`, or otherwise writes to signals needs `allowSignalWrites: true` in the effect options. Imperative form updates like `form.patchValue()/setValue()/reset()` do **not** require `allowSignalWrites`. | |
| - **Signals not initialized inline** — per `component-organization.md`, simple `WritableSignal`s must be initialized directly (e.g., `loading = signal(false)`), not in the constructor. | |
| **Severity:** BLOCKER for BehaviorSubject misuse and missing `allowSignalWrites` when an effect writes to signals. DISCUSS for ChangeDetectorRef (may be legacy code being modified). |
|
|
||
| ### Self-review for reviewer blockers | ||
| ``` | ||
| /lfx-review-guard → scans changed files → reports blockers, discussion items, and passes → fix or proceed |
There was a problem hiding this comment.
This workflow line suggests /lfx-review-guard can “fix or proceed”, but the skill is documented as read-only/report-only (no Write/Edit). Please reword to indicate the user (or another skill) fixes blockers before proceeding.
| /lfx-review-guard → scans changed files → reports blockers, discussion items, and passes → fix or proceed | |
| /lfx-review-guard → scans changed files → reports blockers, discussion items, and passes → you or another skill fix any blockers before proceeding |
| Flag if the diff contains any of these without corresponding mention in commit messages: | ||
|
|
There was a problem hiding this comment.
This section is about PR description completeness, but it says to flag changes missing from commit messages. Commit messages and PR descriptions are different artifacts; this check should compare against (or instruct updates to) the PR description instead of commit messages.
| > "Review guard complete. Would you like me to fix the blockers, or would you prefer to address them yourself?" | ||
|
|
||
| If all checks pass: | ||
|
|
||
| > "Your code looks good — no common reviewer blockers found. Run `/preflight` next to validate formatting, linting, and build." |
There was a problem hiding this comment.
The prompt asks whether the assistant should “fix the blockers”, but this skill is configured without Write/Edit tools and is described as report-only. As-is, the skill can’t actually apply fixes; either remove this prompt or add the necessary tools and update the mode/description accordingly.
|
|
||
| - Auto-fix issues (reports only — contributor decides) | ||
| - Run formatting, linting, or build (use `/preflight` for that) | ||
| - Generate new code (use `/develop` or `/lfx-ui-builder`) |
There was a problem hiding this comment.
/develop is referenced as a way to “generate new code”, but this repo’s documented commands are the /lfx-* skills (and /develop isn’t listed in README). Consider pointing users to /lfx-coordinator and/or /lfx-ui-builder instead, to avoid suggesting a command that isn’t part of this skill set.
| - Generate new code (use `/develop` or `/lfx-ui-builder`) | |
| - Generate new code (use `/lfx-coordinator` or `/lfx-ui-builder`) |
| │ /lfx-review-guard (self-review) │ /lfx-preflight (valid) │ | ||
| ├──────────────────────────────────┴────────────────────────┤ | ||
| │ /lfx-setup (env) │ | ||
| ├───────────────────────────────┴─────────────────────────┤ |
There was a problem hiding this comment.
The ASCII architecture diagram looks misaligned: the /lfx-setup (env) row is a single full-width cell, but the separator below it uses a split junction (┴) as if there were two columns. Also, /lfx-preflight (valid) is an unclear abbreviation compared to “validation” used elsewhere. Consider adjusting the box-drawing characters and label so the diagram renders consistently in a monospace block.
| │ /lfx-review-guard (self-review) │ /lfx-preflight (valid) │ | |
| ├──────────────────────────────────┴────────────────────────┤ | |
| │ /lfx-setup (env) │ | |
| ├───────────────────────────────┴─────────────────────────┤ | |
| │ /lfx-review-guard (self-review) │ /lfx-preflight (validation) │ | |
| ├──────────────────────────────────┴────────────────────────┤ | |
| │ /lfx-setup (env) │ | |
| ├─────────────────────────────────────────────────────────┤ |
lfx-review-guard/SKILL.md
Outdated
| - Scan changed files for the 9 most common reviewer blocker patterns | ||
| - Report findings with file locations and fix suggestions | ||
| - Offer to fix blockers if the contributor wants |
There was a problem hiding this comment.
Under “This skill DOES”, it says it will “Offer to fix blockers”, but the skill’s allowed tools don’t include Write/Edit. Please align capabilities and wording (either remove fix-offer language, or add write/edit capability and clarify that fixes are opt-in).
|
|
||
| # Review Guard — Self-Review for Reviewer Blockers | ||
|
|
||
| You are running a self-review checklist that catches the patterns most commonly flagged by reviewers before a PR is submitted. This skill runs **after development** and **before `/preflight`**. |
There was a problem hiding this comment.
The skill refers to running before/using /preflight, but the documented/installed command in this repo is /lfx-preflight. Using a different command name here will confuse users; please update these references to /lfx-preflight for consistency with README and the skill directory name.
| You are running a self-review checklist that catches the patterns most commonly flagged by reviewers before a PR is submitted. This skill runs **after development** and **before `/preflight`**. | |
| You are running a self-review checklist that catches the patterns most commonly flagged by reviewers before a PR is submitted. This skill runs **after development** and **before `/lfx-preflight`**. |
|
|
||
| - **Unused providers** — `providers: [...]` entries in component metadata where the service is never injected via `inject()` or constructor | ||
| - **Unused imports** — imported symbols not referenced in the file body | ||
| - **Unused methods** — private methods not called anywhere in the file; public methods in services not called from any changed file |
There was a problem hiding this comment.
The dead-code check suggests flagging "public methods in services not called from any changed file" as unused. That’s not a reliable signal (unchanged files can still call the method), and it can lead to incorrect “dead code” findings. Consider limiting this to private methods within the file, or require a repo-wide reference search before reporting a public service method as unused.
| - **Unused methods** — private methods not called anywhere in the file; public methods in services not called from any changed file | |
| - **Unused methods** — private methods not called anywhere in the same file; public methods in services only if a repo‑wide reference search shows they are never called |
…9 review findings Add 6 new checks discovered from reviewer comments across 8 PRs: - Accessibility (a11y): aria-pressed, nested interactives, overlay focus - Design token compliance: hardcoded Tailwind colors vs LFX tokens - N+1 API patterns: per-item fetches when batch endpoints exist - Template/config completeness: missing switch cases, partial wiring - Stale data during navigation: one-time init, stuck loading states - Visitor/permission gating: content flashing during role resolution Expand existing checks: - Dead code: unbound component outputs - Loading states: loading not reset on re-fetch - Type safety: falsy || vs nullish ?? - Error handling: duplicate/layered catchError - Signal patterns: model() misuse for internal state LFXV2-1312 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Manish Dixit <mdixit@linuxfoundation.org>
|
@manishdixitlfx After thinking through the architecture, I'd like us to fold these checks into /lfx-preflight instead of creating a separate skill. Here's the reasoning:
Preflight already detects Angular vs Go repos. These 15 checks would become new Angular-specific sections:
Bugs to fix regardless of direction
Could you close this PR and open a new one that adds these checks as new sections in lfx-preflight/SKILL.md? The check definitions you've written are great — they just need a different home. |
|
Closing per Nirav's feedback — folding these checks into /lfx-preflight instead of a separate skill. See new PR coming. |
Fold review-guard checks into /lfx-preflight per reviewer feedback on PR #16. Single workflow instead of a separate skill — contributors run one command. Adds Check 6 (Code Review Guard) with 15 sub-checks split into: - Auto-fix (4): raw HTML wrappers, dead imports, type safety, signal patterns - Advisory (11): component size, loading states, error handling, API alignment, PR description, accessibility, design tokens, N+1 patterns, template completeness, stale data, visitor gating All checks are Angular-only, gated behind repo-type detection. Skipped for Go repos. Bug fixes from PR #16 review: - Removed incorrect allowSignalWrites rule for form patchValue/setValue - Fixed naming: uses /lfx-preflight and /lfx-coordinator consistently LFXV2-1312 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Manish Dixit <mdixit@linuxfoundation.org>
Summary
/lfx-review-guardskill — a self-review checklist that catches the 9 most common reviewer blocker patterns/developand before/preflight, or on PRs already submitted9 Checks
lfx-input-text,lfx-select,lfx-textarea,<p-skeleton>)0during load, missing loading guards!non-null assertions in templatescatchErrorwithout loggingBehaviorSubjectfor simple state, nocdr.detectChanges()JIRA
LFXV2-1312
Test plan
./install.shand verifylfx-review-guardappears in installed skills list/review-guardto confirm the skill loads🤖 Generated with Claude Code