| name | review-component-pr |
| description | Comprehensive code review checklist for component pull requests ensuring quality, accessibility, and adherence to project conventions |
Review Component PR
This skill provides a systematic checklist for reviewing pull requests that add or modify web components in the project.
Example Usage
- "Review the new tooltip component PR"
- "Check if the badge component changes follow our conventions"
- "Perform a code review on PR #123"
Related Skills
When to Use
- Reviewing a PR that adds a new component
- Reviewing changes to an existing component
- Pre-merge quality gate check
- Onboarding new contributors
Review Checklist
1. Project Structure & Files
2. TypeScript Quality
Good:
@property({ reflect: true })
public variant: StyleVariant = 'primary';
private _internalState: string = '';
Bad:
@property()
public variant: any;
#privateField = '';
3. Component Class Structure
Template:
export default class IgcComponentComponent extends LitElement {
public static readonly tagName = 'igc-component';
public static override styles = [styles, shared];
public static register(): void {
registerComponent(IgcComponentComponent);
}
private _internalState = '';
@property({ reflect: true })
public variant = 'primary';
constructor() {
super();
addThemingController(this, all);
}
protected override render() {
return html`<div part="base"><slot></slot></div>`;
}
private _handleChange(): void {
}
}
declare global {
interface HTMLElementTagNameMap {
'igc-component': IgcComponentComponent;
}
}
4. Properties & Attributes
Good:
@property({ reflect: true })
public variant: StyleVariant = 'primary';
@property({ attribute: false })
public config: Config = {};
Bad:
@property({ reflect: true })
public config: Config = {};
5. Lifecycle & Reactivity
Good:
protected override update(changedProperties: PropertyValues<this>): void {
if (changedProperties.has('disabled')) {
this._internals.setARIA({ ariaDisabled: `${this.disabled}` });
}
super.update(changedProperties);
}
6. Shadow DOM & Styling
Good:
protected override render() {
return html`<div part="base"><slot></slot></div>`;
}
7. Accessibility (Critical)
Check:
it('passes the a11y audit', async () => {
const el = await fixture<IgcComponentComponent>(
html`<igc-component></igc-component>`
);
await expect(el).shadowDom.to.be.accessible();
await expect(el).to.be.accessible();
});
8. Events
Good:
export interface IgcComponentEventMap {
igcChange: CustomEvent<string>;
}
export default class IgcComponentComponent extends EventEmitterMixin<
IgcComponentEventMap,
Constructor<LitElement>
>(LitElement) {
this.emitEvent('igcChange', { detail: newValue });
}
9. Tests
Minimum Required:
describe('Component', () => {
before(() => {
defineComponents(IgcComponentComponent);
});
it('passes the a11y audit', async () => {
});
it('should initialize with default values', async () => {
});
it('can change properties', async () => {
});
});
10. Storybook Stories
11. Documentation
Complete Example:
12. Form Integration (if applicable)
13. Build & Compilation
14. Code Quality
15. Project Conventions
Common Issues to Watch For
Issue: Missing Theming Controller
Problem: Component doesn't respond to theme changes
Fix: Add addThemingController(this, all) in constructor
Issue: Wrong Import Extensions
Problem: Using .ts instead of .js in imports
Fix: All TypeScript imports must use .js extension
Issue: Exposing Complex Types as Attributes
Problem: Trying to reflect objects/arrays to HTML attributes
Fix: Use attribute: false for non-primitive types
Issue: Missing Accessibility Tests
Problem: No a11y test in spec file
Fix: Always include accessibility audit test
Issue: Forgot to Export Component
Problem: Component not available when importing from package
Fix: Add export to src/index.ts in alphabetical order
Issue: Using @watch Decorator
Problem: Using deprecated pattern for property changes
Fix: Use update() or willUpdate() lifecycle hooks
Issue: Native Private Fields
Problem: Using #privateField syntax
Fix: Use _privateField or TypeScript private keyword
Review Process
- Start with structure - Verify all required files exist
- Check TypeScript - Ensure strict typing and no
any
- Review accessibility - This is critical, don't skip
- Test locally - Run build and tests
- Check Storybook - Verify visual behavior
- Review code quality - Look for patterns and conventions
- Provide constructive feedback - Be specific and helpful
Quick Pass/Fail Criteria
Immediate Reject if:
- No accessibility tests
- Using
any types extensively
- Native private fields (
#)
- No tests at all
- TypeScript compilation errors
Request Changes if:
- Missing documentation
- Incomplete test coverage
- Accessibility issues
- Not following project conventions
- Missing theme files
Approve if:
- All checkboxes checked
- Tests pass
- Accessibility verified
- Code quality good
- Follows project patterns
Resources