build-and-lint-verification
Verify code quality by running build and lint commands for both .NET and React projects
What this skill does
# Build and Lint Verification Skill
Use this skill to ensure code compiles and passes quality checks before deployment or testing.
## When to Use
- After writing new code
- Before committing to git
- Before running tests
- After fixing bugs
- During QA validation
## What This Skill Does
### 1. .NET Build Verification
Ensures backend code compiles:
- Run `dotnet build`
- Check for errors
- Check for warnings
- Verify project references
### 2. React Build Verification
Ensures frontend code compiles:
- Run `npm run build`
- Check for TypeScript errors
- Check for build warnings
- Verify bundle size
### 3. Linting
Enforces code quality standards:
- Run `npm run lint` for React
- Fix auto-fixable issues
- Report remaining violations
### 4. Type Checking
Validates TypeScript types:
- Run `npm run type-check` (if available)
- Ensure strict mode compliance
- No `any` types without justification
## Testing Workflow
### For .NET Projects
```bash
cd {context}/{context}-api
# Build
dotnet build
# Check output:
# ✓ Build succeeded. 0 Warning(s). 0 Error(s)
# ✗ Build FAILED. X Error(s)
# If errors, review and fix
# Run tests
dotnet test
# Check output:
# ✓ Passed! - Total: X, Passed: X, Failed: 0
# ✗ Failed! - Failed: Y
```
### For React Projects
```bash
cd {context}/{context}-ui
# Install dependencies (if needed)
npm install
# Lint
npm run lint
# Check output:
# ✓ No linting errors
# ✗ X problems (Y errors, Z warnings)
# Fix auto-fixable
npm run lint -- --fix
# Type check (if available)
npm run type-check
# Build
npm run build
# Check output:
# ✓ built in Xs
# ✗ error TS2xxx: ...
```
## Expected Inputs
- Project directory path
- Project type (.NET or React)
## Deliverables
- Build status (success/failure)
- Error count
- Warning count
- List of issues (if any)
- Recommendations for fixes
## Quality Standards
### .NET Quality Standards
- **0 Errors**: Code must compile
- **0 Warnings**: All warnings fixed
- **All tests pass**: 100% pass rate
- **No vulnerable packages**: Run `dotnet list package --vulnerable`
### React Quality Standards
- **0 Linting errors**: All ESLint rules pass
- **0 Type errors**: TypeScript strict mode compliant
- **Build succeeds**: Production build completes
- **Bundle size acceptable**: < 200KB gzipped for microfrontends
## Automated Fix Attempts
### ESLint Auto-fix
```bash
npm run lint -- --fix
```
Fixes:
- Missing semicolons
- Spacing/indentation
- Import order
- Unused imports
### Manual Fix Required
- TypeScript type errors
- Logical errors
- Security vulnerabilities
- Performance issues
## Validation Checklist
### .NET Validation
- [ ] `dotnet build` succeeds
- [ ] 0 compilation errors
- [ ] 0 compilation warnings
- [ ] `dotnet test` all pass
- [ ] No vulnerable packages
- [ ] Code follows Clean Architecture
### React Validation
- [ ] `npm run lint` passes
- [ ] `npm run type-check` passes (if available)
- [ ] `npm run build` succeeds
- [ ] 0 TypeScript errors
- [ ] 0 ESLint errors
- [ ] Bundle size acceptable
- [ ] No console warnings in build
## Example: Full Verification Flow
### Backend Verification
```bash
#!/bin/bash
PROJECT_DIR="scheduling/scheduling-api"
echo "Verifying $PROJECT_DIR..."
cd $PROJECT_DIR
# Build
echo "Building..."
if dotnet build --no-incremental > build.log 2>&1; then
echo "✓ Build succeeded"
else
echo "✗ Build failed"
cat build.log
exit 1
fi
# Test
echo "Testing..."
if dotnet test > test.log 2>&1; then
echo "✓ Tests passed"
else
echo "✗ Tests failed"
cat test.log
exit 1
fi
# Check vulnerabilities
echo "Checking for vulnerabilities..."
dotnet list package --vulnerable
echo "✓ All checks passed!"
```
### Frontend Verification
```bash
#!/bin/bash
PROJECT_DIR="scheduling/scheduling-ui"
echo "Verifying $PROJECT_DIR..."
cd $PROJECT_DIR
# Lint
echo "Linting..."
if npm run lint > lint.log 2>&1; then
echo "✓ Lint passed"
else
echo "⚠ Lint failed, attempting auto-fix..."
npm run lint -- --fix
if npm run lint > lint-fixed.log 2>&1; then
echo "✓ Lint passed after auto-fix"
else
echo "✗ Lint failed after auto-fix"
cat lint-fixed.log
exit 1
fi
fi
# Type check
if command -v npm run type-check &> /dev/null; then
echo "Type checking..."
if npm run type-check > typecheck.log 2>&1; then
echo "✓ Type check passed"
else
echo "✗ Type check failed"
cat typecheck.log
exit 1
fi
fi
# Build
echo "Building..."
if npm run build > build.log 2>&1; then
echo "✓ Build succeeded"
# Check bundle size
BUNDLE_SIZE=$(du -sh dist | cut -f1)
echo "Bundle size: $BUNDLE_SIZE"
else
echo "✗ Build failed"
cat build.log
exit 1
fi
echo "✓ All checks passed!"
```
## Integration with QA Agents
### Before QA Frontend Testing
```
MUST run build and lint verification first:
1. npm run lint (must pass)
2. npm run build (must succeed)
3. Then proceed to Playwright testing
```
### Before QA Backend Testing
```
MUST run build verification first:
1. dotnet build (must succeed)
2. dotnet test (must pass)
3. Then proceed to API testing
```
## Common Issues and Fixes
### Issue: ESLint errors
**Common errors**:
- Unused variables
- Missing dependencies in useEffect
- Missing return types
**Fix**: Run `npm run lint -- --fix` first
### Issue: TypeScript errors
**Common errors**:
- Type 'any' not allowed
- Property doesn't exist on type
- Missing null checks
**Fix**: Add proper types, null checks
### Issue: Build warnings
**Common warnings**:
- Large bundle size
- Deprecated dependencies
- Peer dependency issues
**Fix**: Update dependencies, optimize imports
### Issue: .NET warnings
**Common warnings**:
- Unused variables
- Nullable reference issues
- Obsolete API usage
**Fix**: Clean up code, enable nullable reference types
This skill ensures code quality and prevents broken code from reaching testing or deployment.
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.