Skip to content

feat(lfx-review-guard): add self-review skill for common reviewer blockers#16

Closed
manishdixitlfx wants to merge 2 commits intomainfrom
feat/LFXV2-1312
Closed

feat(lfx-review-guard): add self-review skill for common reviewer blockers#16
manishdixitlfx wants to merge 2 commits intomainfrom
feat/LFXV2-1312

Conversation

@manishdixitlfx
Copy link

Summary

  • Add new /lfx-review-guard skill — a self-review checklist that catches the 9 most common reviewer blocker patterns
  • Can be run after /develop and before /preflight, or on PRs already submitted
  • Based on patterns consistently flagged by reviewers MRashad26 and asithade across 15+ PRs
  • Update README with skill overview, details, architecture diagram, workflow, and project structure entries

9 Checks

  1. Raw HTML elements — must use LFX wrappers (lfx-input-text, lfx-select, lfx-textarea, <p-skeleton>)
  2. Dead code — unused providers, imports, methods, signals
  3. Component responsibility — 4+ service injections flagged for discussion
  4. Loading states — stats showing 0 during load, missing loading guards
  5. Type safety in templates — no ! non-null assertions in templates
  6. Error handling — no silent catchError without logging
  7. Signal patterns — no BehaviorSubject for simple state, no cdr.detectChanges()
  8. Upstream API alignment — parameter names match upstream contracts
  9. PR description completeness — behavioral changes documented

JIRA

LFXV2-1312

Test plan

  • Run ./install.sh and verify lfx-review-guard appears in installed skills list
  • Open an LFX repo and run /review-guard to confirm the skill loads
  • Verify tool-mapping comment is present in SKILL.md (vendor-neutral)
  • Verify README additions render correctly on GitHub

🤖 Generated with Claude Code

…ckers

LFXV2-1312

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Manish Dixit <mdixit@linuxfoundation.org>
Copilot AI review requested due to automatic review settings March 21, 2026 21:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.md implementing the 9-check review checklist and report format.
  • Update README.md to include /lfx-review-guard in 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.

Comment on lines +140 to +143
- **`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).
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
- **`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).

Copilot uses AI. Check for mistakes.

### Self-review for reviewer blockers
```
/lfx-review-guard → scans changed files → reports blockers, discussion items, and passes → fix or proceed
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
/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

Copilot uses AI. Check for mistakes.
Comment on lines +173 to +174
Flag if the diff contains any of these without corresponding mention in commit messages:

Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +238 to +242
> "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."
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.

- 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`)
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

/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.

Suggested change
- Generate new code (use `/develop` or `/lfx-ui-builder`)
- Generate new code (use `/lfx-coordinator` or `/lfx-ui-builder`)

Copilot uses AI. Check for mistakes.
Comment on lines +118 to 121
│ /lfx-review-guard (self-review) │ /lfx-preflight (valid) │
├──────────────────────────────────┴────────────────────────┤
│ /lfx-setup (env) │
├───────────────────────────────┴─────────────────────────┤
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
│ /lfx-review-guard (self-review) │ /lfx-preflight (valid) │
├──────────────────────────────────┴────────────────────────┤
│ /lfx-setup (env) │
├────────────────────────────────────────────────────────┤
│ /lfx-review-guard (self-review) │ /lfx-preflight (validation) │
├──────────────────────────────────┴────────────────────────┤
│ /lfx-setup (env) │
├────────────────────────────────────────────────────────┤

Copilot uses AI. Check for mistakes.
Comment on lines +248 to +250
- 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
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.

# 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`**.
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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`**.

Copilot uses AI. Check for mistakes.

- **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
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
- **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

Copilot uses AI. Check for mistakes.
…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>
@niravpatel27
Copy link
Collaborator

@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:

  1. Single workflow — contributors already know code → /lfx-preflight → PR. Adding /lfx-review-guard as a separate step means another command to remember and another place where pre-PR checks live.
  2. Auto-fix capability — preflight already has Write/Edit tools. Mechanical checks like raw HTML wrappers and dead imports can be auto-fixed, just like formatting and license headers. The current
    PR has a contradiction where the skill says "report only" but then offers to fix blockers — merging into preflight resolves this naturally.
  3. No overlap confusion — two pre-PR skills creates a "which one do I run?" problem. One gate, one answer.

Preflight already detects Angular vs Go repos. These 15 checks would become new Angular-specific sections:

Bugs to fix regardless of direction

  • Check 7 (allowSignalWrites) — the rule about effect() + patchValue()/setValue()/reset() needing allowSignalWrites: true is incorrect. That flag is for writing to signals, not imperative form
    updates. This would generate false blocker reports.
  • Naming — references /preflight and /develop instead of /lfx-preflight and /lfx-coordinator (or /lfx-ui-builder)
  • Count mismatch — PR description says "9 checks" but SKILL.md has 15

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.

@manishdixitlfx
Copy link
Author

Closing per Nirav's feedback — folding these checks into /lfx-preflight instead of a separate skill. See new PR coming.

@manishdixitlfx manishdixitlfx deleted the feat/LFXV2-1312 branch March 23, 2026 22:46
manishdixitlfx added a commit that referenced this pull request Mar 23, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants