genskills 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugin.json +13 -6
  4. package/skills/code-quality/accessibility-audit/SKILL.md +62 -31
  5. package/skills/code-quality/code-review/SKILL.md +35 -13
  6. package/skills/code-quality/dependency-audit/SKILL.md +49 -22
  7. package/skills/code-quality/error-boundary/SKILL.md +47 -15
  8. package/skills/code-quality/lint-fix/SKILL.md +46 -11
  9. package/skills/code-quality/refactor/SKILL.md +51 -14
  10. package/skills/code-quality/security-audit/SKILL.md +67 -32
  11. package/skills/code-quality/test-generator/SKILL.md +39 -15
  12. package/skills/code-quality/type-check/SKILL.md +60 -15
  13. package/skills/development/db-migrate/SKILL.md +76 -13
  14. package/skills/development/debug/SKILL.md +70 -30
  15. package/skills/development/env-setup/SKILL.md +52 -22
  16. package/skills/development/i18n/SKILL.md +63 -22
  17. package/skills/development/migrate/SKILL.md +83 -27
  18. package/skills/development/perf-optimize/SKILL.md +72 -26
  19. package/skills/development/scaffold/SKILL.md +63 -17
  20. package/skills/documentation/api-docs/SKILL.md +72 -21
  21. package/skills/documentation/doc-gen/SKILL.md +63 -20
  22. package/skills/documentation/readme-gen/SKILL.md +58 -22
  23. package/skills/project-management/changelog-gen/SKILL.md +37 -12
  24. package/skills/project-management/release-notes/SKILL.md +50 -18
  25. package/skills/project-management/task-tracker/SKILL.md +52 -13
  26. package/skills/workflow/branch-manager/SKILL.md +37 -16
  27. package/skills/workflow/ci-fix/SKILL.md +56 -18
  28. package/skills/workflow/deploy/SKILL.md +67 -22
  29. package/skills/workflow/git-commit/SKILL.md +39 -12
  30. package/skills/workflow/monorepo/SKILL.md +45 -22
  31. package/skills/workflow/pr-create/SKILL.md +38 -15
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/genskills.svg)](https://www.npmjs.com/package/genskills)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/genskills.svg)](https://www.npmjs.com/package/genskills)
5
- [![license](https://img.shields.io/npm/l/genskills.svg)]
5
+ ![license](https://img.shields.io/npm/l/genskills.svg)
6
6
  [![node](https://img.shields.io/node/v/genskills.svg)](https://nodejs.org)
7
7
  [![website](https://img.shields.io/badge/website-genskills.dev-blue)](https://genskills.dev)
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genskills",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "A comprehensive Claude Code skills library — install once, get 28 AI-powered skills",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "genskills",
3
- "version": "1.0.0",
4
- "description": "GenSkills Libs — A comprehensive Claude Code skills library with 20+ skills for code quality, workflow, project management, documentation, and development",
3
+ "version": "1.1.0",
4
+ "description": "GenSkills Libs — A comprehensive Claude Code skills library with 28 AI-powered skills for code quality, workflow, project management, documentation, and development",
5
5
  "author": {
6
6
  "name": "GenSkills"
7
7
  },
@@ -11,12 +11,12 @@
11
11
  {
12
12
  "id": "code-quality",
13
13
  "label": "Code Quality",
14
- "description": "Review, refactor, audit, test, lint, type-check"
14
+ "description": "Review, refactor, audit, test, lint, type-check, dependencies, error boundaries, accessibility"
15
15
  },
16
16
  {
17
17
  "id": "workflow",
18
18
  "label": "Workflow",
19
- "description": "Git, PRs, deploys, CI, branches"
19
+ "description": "Git, PRs, deploys, CI, branches, monorepo"
20
20
  },
21
21
  {
22
22
  "id": "project-management",
@@ -31,7 +31,7 @@
31
31
  {
32
32
  "id": "development",
33
33
  "label": "Development",
34
- "description": "Scaffold, migrate, debug, optimize"
34
+ "description": "Scaffold, migrate, debug, optimize, env setup, db migrations, i18n"
35
35
  }
36
36
  ],
37
37
  "skills": [
@@ -41,11 +41,15 @@
41
41
  { "name": "test-generator", "category": "code-quality" },
42
42
  { "name": "lint-fix", "category": "code-quality" },
43
43
  { "name": "type-check", "category": "code-quality" },
44
+ { "name": "dependency-audit", "category": "code-quality" },
45
+ { "name": "error-boundary", "category": "code-quality" },
46
+ { "name": "accessibility-audit", "category": "code-quality" },
44
47
  { "name": "git-commit", "category": "workflow" },
45
48
  { "name": "pr-create", "category": "workflow" },
46
49
  { "name": "deploy", "category": "workflow" },
47
50
  { "name": "ci-fix", "category": "workflow" },
48
51
  { "name": "branch-manager", "category": "workflow" },
52
+ { "name": "monorepo", "category": "workflow" },
49
53
  { "name": "task-tracker", "category": "project-management" },
50
54
  { "name": "changelog-gen", "category": "project-management" },
51
55
  { "name": "release-notes", "category": "project-management" },
@@ -55,6 +59,9 @@
55
59
  { "name": "scaffold", "category": "development" },
56
60
  { "name": "migrate", "category": "development" },
57
61
  { "name": "debug", "category": "development" },
58
- { "name": "perf-optimize", "category": "development" }
62
+ { "name": "perf-optimize", "category": "development" },
63
+ { "name": "env-setup", "category": "development" },
64
+ { "name": "db-migrate", "category": "development" },
65
+ { "name": "i18n", "category": "development" }
59
66
  ]
60
67
  }
@@ -6,87 +6,118 @@ description: >
6
6
  "a11y audit", "accessibility", "wcag", "screen reader".
7
7
  user-invocable: true
8
8
  argument-hint: "[file or directory path]"
9
- allowed-tools: "Read, Grep, Glob, Bash(npx *)"
10
- genskills-version: "1.0.1"
9
+ allowed-tools: "Read, Edit, Grep, Glob, Bash(npx *), Bash(npm run*)"
10
+ genskills-version: "1.1.0"
11
11
  genskills-category: "code-quality"
12
12
  genskills-depends: []
13
13
  ---
14
14
 
15
15
  # Accessibility Audit
16
16
 
17
- Check codebase for WCAG 2.1 accessibility compliance.
17
+ Check codebase for WCAG 2.2 accessibility compliance.
18
18
 
19
19
  ## Process
20
20
 
21
+ ### Step 0: Load Project Context
22
+ - Check for `CLAUDE.md` at the project root — follow any a11y standards documented there
23
+ - Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences (see Configuration below)
24
+ - Identify the UI framework (React, Vue, Svelte, Angular, plain HTML)
25
+
21
26
  ### Step 1: Scope
22
27
  - If `$ARGUMENTS` provided, focus on that file/directory
23
- - Otherwise scan all component/page files
28
+ - Otherwise scan all component/page files (`**/*.tsx`, `**/*.jsx`, `**/*.vue`, `**/*.svelte`)
29
+ - Prioritize: pages/routes → shared components → utilities
24
30
 
25
31
  ### Step 2: Static Analysis
26
32
  Check for common a11y issues:
27
33
 
28
34
  **Images & Media**:
29
35
  - `<img>` without `alt` attribute
30
- - Decorative images without `alt=""`
36
+ - Decorative images without `alt=""` and `role="presentation"`
31
37
  - `<video>` / `<audio>` without captions/transcripts
32
- - Icon-only buttons without accessible labels
38
+ - Icon-only buttons without accessible labels (`aria-label` or visually hidden text)
39
+ - SVG icons without `aria-hidden="true"` or `role="img"` with title
33
40
 
34
41
  **Semantic HTML**:
35
- - `<div>` or `<span>` used as buttons (should be `<button>`)
42
+ - `<div>` or `<span>` used as buttons/links (should be `<button>` / `<a>`)
36
43
  - Missing heading hierarchy (h1 → h3 without h2)
44
+ - Multiple `<h1>` elements on a single page
37
45
  - Missing `<main>`, `<nav>`, `<header>`, `<footer>` landmarks
38
46
  - Tables without `<th>` or `scope` attributes
39
47
  - Lists not using `<ul>` / `<ol>` / `<li>`
48
+ - Missing `<lang>` attribute on `<html>`
40
49
 
41
50
  **Forms**:
42
- - `<input>` without associated `<label>` or `aria-label`
43
- - Missing form validation error announcements
51
+ - `<input>` without associated `<label>` or `aria-label`/`aria-labelledby`
52
+ - Missing form validation error announcements (`aria-describedby` pointing to error)
44
53
  - Missing `required` attribute or `aria-required`
45
- - Missing `autocomplete` attribute on common fields
54
+ - Missing `autocomplete` attribute on common fields (name, email, address, etc.)
55
+ - Form errors not programmatically associated with inputs
56
+ - Missing fieldset/legend for radio/checkbox groups
46
57
 
47
58
  **Keyboard Navigation**:
48
- - Click handlers on non-interactive elements without `tabIndex` and `onKeyDown`
59
+ - Click handlers on non-interactive elements without `tabIndex`, `role`, and `onKeyDown`
49
60
  - Missing focus styles (`:focus-visible` or equivalent)
50
- - Focus traps in modals/dialogs
61
+ - Focus traps in modals/dialogs (focus should be trapped inside and restored on close)
51
62
  - Skip-to-content link presence
63
+ - Custom components (dropdowns, tabs, carousels) missing keyboard support
64
+ - Positive `tabIndex` values (should be 0 or -1 only)
52
65
 
53
66
  **ARIA**:
54
- - Incorrect ARIA roles
55
- - Missing `aria-live` for dynamic content
56
- - Missing `aria-expanded` on toggles/accordions
57
- - Missing `aria-label` on icon buttons
58
- - Redundant ARIA (e.g., `role="button"` on `<button>`)
67
+ - Incorrect ARIA roles for the element type
68
+ - Missing `aria-live` for dynamic content updates (toasts, alerts, loading states)
69
+ - Missing `aria-expanded` on toggles/accordions/dropdowns
70
+ - Missing `aria-label` on icon buttons and ambiguous links ("click here", "read more")
71
+ - Redundant ARIA (e.g., `role="button"` on `<button>`, `role="link"` on `<a>`)
72
+ - `aria-hidden="true"` on focusable elements (accessibility trap)
59
73
 
60
74
  **Color & Contrast**:
61
- - Text colors that may have insufficient contrast (flag hardcoded colors)
62
- - Information conveyed by color alone without alternative indicator
75
+ - Text colors that may have insufficient contrast (flag hardcoded colors < 4.5:1 ratio)
76
+ - Information conveyed by color alone without alternative indicator (icons, underlines, patterns)
77
+ - Disabled states that are too low contrast to read
78
+
79
+ **Motion & Animation**:
80
+ - Missing `prefers-reduced-motion` media query for animations
81
+ - Auto-playing content without pause controls
63
82
 
64
83
  ### Step 3: Check for Existing a11y Tooling
65
- - Look for eslint-plugin-jsx-a11y configuration
66
- - Check for @axe-core usage in tests
67
- - Note if these tools could catch the flagged issues automatically
84
+ - Look for `eslint-plugin-jsx-a11y` configuration
85
+ - Check for `@axe-core` usage in tests
86
+ - Check for `pa11y`, `lighthouse` in CI/CD
87
+ - Note which flagged issues could be caught automatically by these tools
68
88
 
69
89
  ### Step 4: Generate Report
70
90
  ```
71
- ## Accessibility Audit Report
91
+ ## Accessibility Audit Report (WCAG 2.2)
72
92
 
73
- ### Critical (WCAG A violations)
74
- - [file:line] <img> missing alt attribute
93
+ ### Critical (WCAG Level A violations)
94
+ - [file:line] <img> missing alt attribute → add descriptive alt text
75
95
  - [file:line] <div onClick> should be <button> with keyboard handler
76
96
 
77
- ### Serious (WCAG AA violations)
78
- - [file:line] Input without associated label
79
- - [file:line] Missing skip-to-content link
97
+ ### Serious (WCAG Level AA violations)
98
+ - [file:line] Input without associated label → add <label htmlFor>
99
+ - [file:line] Missing skip-to-content link → add as first focusable element
80
100
 
81
101
  ### Moderate
82
- - [file:line] Heading hierarchy skip (h1 → h3)
102
+ - [file:line] Heading hierarchy skip (h1 → h3) → add missing h2
83
103
  - [file:line] aria-label missing on icon button
84
104
 
85
- ### Recommendations
105
+ ### Tooling Recommendations
86
106
  - Install eslint-plugin-jsx-a11y for automated catching
87
107
  - Add @axe-core/react for runtime checks in dev
108
+ - Add pa11y or lighthouse to CI for regression prevention
88
109
 
89
110
  ### Summary
90
111
  - X critical, Y serious, Z moderate issues
91
- - WCAG 2.1 Level AA estimated compliance: ...
112
+ - WCAG 2.2 Level AA estimated compliance: X%
113
+
114
+ ### Follow-up
115
+ - Run `/genskills:code-review` to verify a11y fixes don't break functionality
92
116
  ```
117
+
118
+ ## Configuration
119
+ Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences:
120
+ - `wcagLevel`: "A" | "AA" | "AAA" — target compliance level (default: "AA")
121
+ - `framework`: string — override auto-detected UI framework
122
+ - `ignorePaths`: string[] — paths to skip
123
+ - `autoFix`: boolean — automatically apply simple fixes (alt text, labels) (default: false)
@@ -5,8 +5,8 @@ description: >
5
5
  Triggers on: "review this code", "code review", "check my code", "review PR", "review changes".
6
6
  user-invocable: true
7
7
  argument-hint: "[file or directory path]"
8
- allowed-tools: "Read, Grep, Glob, WebFetch, Bash(git diff*), Bash(git log*), Bash(npm test*), Bash(npx vitest*)"
9
- genskills-version: "1.0.1"
8
+ allowed-tools: "Read, Edit, Grep, Glob, WebFetch, Bash(git diff*), Bash(git log*), Bash(git blame*), Bash(npm test*), Bash(npm run*), Bash(npx vitest*), Bash(npx jest*)"
9
+ genskills-version: "1.1.0"
10
10
  genskills-category: "code-quality"
11
11
  genskills-depends: []
12
12
  ---
@@ -17,29 +17,40 @@ Perform a thorough, multi-dimensional code review.
17
17
 
18
18
  ## Review Process
19
19
 
20
+ ### Step 0: Load Project Context
21
+ - Check for `CLAUDE.md` at the project root — it contains project conventions, patterns, and rules you MUST follow
22
+ - Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences (see Configuration below)
23
+ - Identify the tech stack from `package.json`, `pyproject.toml`, or equivalent
24
+
20
25
  ### Step 1: Gather Context
21
26
  - If `$ARGUMENTS` is provided, focus review on that file/directory
22
- - If no arguments, review staged changes: `git diff --cached` or recent changes: `git diff HEAD~1`
23
- - Read the files being reviewed to understand full context
27
+ - If `$ARGUMENTS` looks like a PR number or URL, use `gh pr diff <number>` to get the changes
28
+ - If no arguments, review staged changes: `git diff --cached`; if nothing staged, review recent changes: `git diff HEAD~1`
29
+ - Read the full files being reviewed (not just the diff) to understand surrounding context
30
+ - Run `git log --oneline -5 -- <file>` to understand recent change history
31
+ - Use `git blame` on critical sections to understand authorship and intent
24
32
 
25
33
  ### Step 2: Analyze Code Quality
26
34
  Check for:
27
- - **Correctness**: Logic errors, edge cases, off-by-one errors, null/undefined handling
28
- - **Security**: Injection vulnerabilities (SQL, XSS, command), auth issues, data exposure, OWASP Top 10
29
- - **Performance**: N+1 queries, unnecessary iterations, memory leaks, missing indexes
30
- - **Maintainability**: Code complexity, naming clarity, DRY violations, function length
31
- - **Error Handling**: Missing try/catch, unhandled promise rejections, error propagation
32
- - **Type Safety**: Type mismatches, unsafe casts, missing null checks
35
+ - **Correctness**: Logic errors, edge cases, off-by-one errors, null/undefined handling, race conditions
36
+ - **Security**: Injection vulnerabilities (SQL, XSS, command), auth issues, data exposure, OWASP Top 10, hardcoded secrets
37
+ - **Performance**: N+1 queries, unnecessary iterations, memory leaks, missing indexes, unintended synchronous blocking
38
+ - **Maintainability**: Code complexity, naming clarity, DRY violations, function length (>50 lines is a warning)
39
+ - **Error Handling**: Missing try/catch, unhandled promise rejections, error propagation, missing error boundaries
40
+ - **Type Safety**: Type mismatches, unsafe casts, `any` usage, missing null checks
41
+ - **Concurrency**: Race conditions, deadlocks, missing locks on shared state
33
42
 
34
43
  ### Step 3: Check Project Patterns
35
44
  - Read nearby files to understand existing patterns and conventions
36
- - Flag deviations from established patterns
37
- - Check for consistent import ordering, naming conventions, file structure
45
+ - Cross-reference with CLAUDE.md rules if present
46
+ - Flag deviations from established patterns (naming, imports, file structure, error handling style)
47
+ - Check for consistent import ordering, barrel exports, naming conventions
38
48
 
39
49
  ### Step 4: Verify Test Coverage
40
50
  - Check if changed code has corresponding tests
41
- - Run relevant test suites to verify they pass
51
+ - Run relevant test suites to verify they pass: `npm test`, `npx vitest run`, or `npx jest`
42
52
  - Flag changed logic that lacks test coverage
53
+ - Check for missing edge-case tests on new logic
43
54
 
44
55
  ### Step 5: Generate Report
45
56
  Structure your review as:
@@ -59,12 +70,23 @@ Structure your review as:
59
70
  ### Positive Highlights
60
71
  - What was done well
61
72
 
73
+ ### Test Coverage
74
+ - Coverage status for changed code
75
+ - Missing test scenarios
76
+
62
77
  ### Overall Assessment
63
78
  Brief summary with confidence level (approve/request changes/needs discussion)
64
79
  ```
65
80
 
81
+ ### Step 6: Offer Follow-up Actions
82
+ After the report, suggest relevant next steps:
83
+ - "Run `/genskills:test-generator` to add missing tests for uncovered code"
84
+ - "Run `/genskills:security-audit` for a deeper security analysis" (if security issues found)
85
+ - "Run `/genskills:refactor` on [file] to address complexity warnings"
86
+
66
87
  ## Configuration
67
88
  Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences:
68
89
  - `defaultMode`: "quick" | "deep" | "security-focused"
69
90
  - `languages`: string[] — focus languages
70
91
  - `ignorePaths`: string[] — paths to skip
92
+ - `autoFix`: boolean — if true, apply simple fixes directly with Edit tool
@@ -5,9 +5,9 @@ description: >
5
5
  license conflicts, and bundle size impact. Triggers on: "check dependencies",
6
6
  "audit packages", "unused deps", "dependency audit", "outdated packages".
7
7
  user-invocable: true
8
- argument-hint: "[scope: all|unused|outdated|licenses|size]"
9
- allowed-tools: "Read, Grep, Glob, Bash(npm *), Bash(npx *), Bash(pip *), Bash(yarn *), Bash(pnpm *)"
10
- genskills-version: "1.0.1"
8
+ argument-hint: "[scope: all|unused|outdated|licenses|size|security]"
9
+ allowed-tools: "Read, Grep, Glob, Bash(npm outdated*), Bash(npm audit*), Bash(npm ls*), Bash(npm uninstall*), Bash(npx *), Bash(pip list*), Bash(pip audit*), Bash(yarn outdated*), Bash(pnpm outdated*), Bash(pnpm ls*)"
10
+ genskills-version: "1.1.0"
11
11
  genskills-category: "code-quality"
12
12
  genskills-depends: []
13
13
  ---
@@ -18,9 +18,14 @@ Comprehensive dependency analysis and cleanup.
18
18
 
19
19
  ## Process
20
20
 
21
+ ### Step 0: Load Project Context
22
+ - Check for `CLAUDE.md` at the project root — follow any dependency policies documented there
23
+ - Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences (see Configuration below)
24
+
21
25
  ### Step 1: Detect Package Manager
22
- - Check for `package-lock.json` (npm), `yarn.lock` (yarn), `pnpm-lock.yaml` (pnpm), `requirements.txt` / `pyproject.toml` (Python)
26
+ - Check for `package-lock.json` (npm), `yarn.lock` (yarn), `pnpm-lock.yaml` (pnpm), `bun.lockb` (bun), `requirements.txt` / `pyproject.toml` / `poetry.lock` (Python)
23
27
  - Read the lock file metadata to understand dependency tree depth
28
+ - Check for monorepo setup (multiple package.json files)
24
29
 
25
30
  ### Step 2: Run Audits Based on Scope
26
31
  If `$ARGUMENTS` specifies a scope, focus on that. Otherwise run all checks.
@@ -28,59 +33,81 @@ If `$ARGUMENTS` specifies a scope, focus on that. Otherwise run all checks.
28
33
  **Unused Dependencies**:
29
34
  - Cross-reference `dependencies` in package.json with actual imports across codebase
30
35
  - Use Grep to find `import ... from '<pkg>'` or `require('<pkg>')` patterns
36
+ - Also check for dynamic imports: `import('<pkg>')`, `require.resolve('<pkg>')`
31
37
  - Flag packages in dependencies that have zero imports
32
- - Check for packages only used in config files (babel, eslint plugins, etc.) — these are NOT unused
38
+ - **Do NOT flag** packages only used in config files (babel plugins, eslint plugins, postcss plugins, etc.)
39
+ - **Do NOT flag** packages used as CLI tools in scripts (package.json scripts section)
40
+ - **Do NOT flag** `@types/*` packages — check if the corresponding package is used instead
33
41
 
34
42
  **Outdated Packages**:
35
43
  - Run `npm outdated` or equivalent
36
- - Categorize: patch updates, minor updates, major updates
37
- - Flag major updates that may have breaking changes
44
+ - Categorize: patch updates (safe), minor updates (usually safe), major updates (breaking changes likely)
45
+ - For major updates, note the breaking changes if identifiable
38
46
 
39
47
  **Security Vulnerabilities**:
40
48
  - Run `npm audit` / `pip audit`
41
49
  - Categorize by severity (critical, high, moderate, low)
42
- - Suggest fix commands where available
50
+ - Suggest specific fix commands where available
51
+ - Distinguish between production and dev dependency vulnerabilities
43
52
 
44
53
  **Duplicate Packages**:
45
- - Check for multiple versions of the same package in lock file
54
+ - Run `npm ls --all` and check for multiple versions of the same package
46
55
  - Identify which top-level deps pull in conflicting versions
56
+ - Suggest resolutions or overrides to deduplicate
47
57
 
48
58
  **License Compliance**:
49
59
  - Extract license field from each dependency's package.json
50
- - Flag copyleft licenses (GPL, AGPL) that may conflict with project license
51
- - Flag packages with no license specified
60
+ - Flag copyleft licenses (GPL, AGPL, SSPL) that may conflict with project license
61
+ - Flag packages with no license specified or "UNLICENSED"
62
+ - Note: devDependencies have less restrictive license requirements
52
63
 
53
64
  **Bundle Size Impact**:
54
65
  - Identify heaviest dependencies by install size
55
- - Suggest lighter alternatives where available (e.g., moment → dayjs, lodash → lodash-es)
66
+ - Suggest lighter alternatives where available:
67
+ - `moment` → `dayjs` or `date-fns`
68
+ - `lodash` → `lodash-es` or native methods
69
+ - `axios` → native `fetch`
70
+ - `uuid` → `crypto.randomUUID()`
56
71
 
57
72
  ### Step 3: Generate Report
58
73
  ```
59
74
  ## Dependency Audit Report
60
75
 
61
76
  ### Security Vulnerabilities
62
- - [severity] package@version — description
77
+ - [severity] package@version — description — fix: `npm audit fix` or specific command
63
78
 
64
79
  ### Unused Dependencies (safe to remove)
65
- - package — no imports found
80
+ - package — no imports found — `npm uninstall package`
66
81
 
67
- ### Outdated (major)
82
+ ### Outdated (major — breaking changes)
68
83
  - package: current → latest (breaking changes: ...)
69
84
 
70
- ### Outdated (minor/patch)
85
+ ### Outdated (minor/patch — safe to update)
71
86
  - package: current → latest
72
87
 
73
88
  ### Duplicates
74
- - package: v1 (via dep-a), v2 (via dep-b)
89
+ - package: v1 (via dep-a), v2 (via dep-b) — resolution strategy
75
90
 
76
91
  ### License Concerns
77
- - package — license type
92
+ - package — license type — risk level
78
93
 
79
94
  ### Bundle Size Opportunities
80
- - package (size) → suggested alternative (size)
95
+ - package (size) → suggested alternative (size) — estimated savings
81
96
 
82
- ### Recommended Actions
83
- 1. Run: npm uninstall <unused>
84
- 2. Run: npm update <safe-updates>
97
+ ### Recommended Actions (copy-paste ready)
98
+ 1. `npm uninstall <unused packages>`
99
+ 2. `npm update` (safe minor/patch updates)
85
100
  3. Review: <major-updates> for breaking changes
101
+ 4. `npm audit fix` (security fixes)
86
102
  ```
103
+
104
+ ### Step 4: Follow-up
105
+ - Suggest running `/genskills:security-audit` if critical vulnerabilities found
106
+ - Suggest running `/genskills:migrate` for major version upgrades
107
+
108
+ ## Configuration
109
+ Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences:
110
+ - `scope`: "all" | "unused" | "outdated" | "licenses" | "size" | "security" — default audit scope
111
+ - `ignorePaths`: string[] — paths to skip when checking imports
112
+ - `ignorePackages`: string[] — packages to skip in unused check
113
+ - `licenseAllowlist`: string[] — allowed license types (default: MIT, ISC, BSD, Apache-2.0)
@@ -7,8 +7,8 @@ description: >
7
7
  "error boundaries", "unhandled exceptions", "missing error handling".
8
8
  user-invocable: true
9
9
  argument-hint: "[file or directory path]"
10
- allowed-tools: "Read, Edit, Grep, Glob"
11
- genskills-version: "1.0.1"
10
+ allowed-tools: "Read, Write, Edit, Grep, Glob, Bash(npm test*), Bash(npm run*), Bash(npx *)"
11
+ genskills-version: "1.1.0"
12
12
  genskills-category: "code-quality"
13
13
  genskills-depends: []
14
14
  ---
@@ -19,45 +19,60 @@ Find and fix unhandled error surfaces across the codebase.
19
19
 
20
20
  ## Process
21
21
 
22
+ ### Step 0: Load Project Context
23
+ - Check for `CLAUDE.md` at the project root — follow any error handling conventions documented there
24
+ - Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences (see Configuration below)
25
+ - Identify the framework to know which error patterns to check (React, Next.js, Express, Remix, SvelteKit, FastAPI, etc.)
26
+
22
27
  ### Step 1: Scope the Analysis
23
28
  - If `$ARGUMENTS` provided, focus on that file/directory
24
29
  - Otherwise, scan `src/` or project root
30
+ - Prioritize: API routes → data-fetching → UI components → utilities
25
31
 
26
32
  ### Step 2: Detect Error Surfaces by Category
27
33
 
28
34
  **Unhandled Promises**:
29
- - Find `async` functions without try/catch
35
+ - Find `async` functions without try/catch wrapping their await calls
30
36
  - Find `.then()` chains without `.catch()`
31
37
  - Find `await` calls not wrapped in try/catch
32
38
  - Find Promise constructors without reject handling
39
+ - Find `Promise.all`/`Promise.allSettled` without error handling
40
+ - Check for missing `unhandledRejection` process handler in Node.js entry points
33
41
 
34
- **Missing React Error Boundaries**:
35
- - Check if any ErrorBoundary component exists
42
+ **Missing React/Framework Error Boundaries**:
43
+ - Check if any ErrorBoundary component exists in the project
36
44
  - Find route-level components without error boundary wrapping
37
45
  - Check for `useEffect` with async operations lacking error handling
38
- - Find data-fetching hooks/components without error states
46
+ - Find data-fetching hooks/components without error states (loading/error/data pattern)
47
+ - **Next.js**: Check for `error.tsx` files in app directory routes
48
+ - **Remix**: Check for `ErrorBoundary` exports in route modules
49
+ - **SvelteKit**: Check for `+error.svelte` files
39
50
 
40
51
  **API Route Handlers**:
41
- - Find Express/Next.js/FastAPI route handlers
52
+ - Find Express/Next.js/FastAPI/NestJS route handlers
42
53
  - Check each for try/catch wrapping
43
- - Verify error responses return appropriate status codes
54
+ - Verify error responses return appropriate status codes (not 200 for errors)
44
55
  - Check for unvalidated request body/params usage
56
+ - Check for missing global error middleware (Express `app.use((err, req, res, next)`)
57
+ - Check for missing input validation (zod, joi, class-validator, etc.)
45
58
 
46
59
  **Database Operations**:
47
- - Find database calls (Prisma, Sequelize, raw SQL, etc.)
48
- - Check for transaction error handling
60
+ - Find database calls (Prisma, Drizzle, Sequelize, raw SQL, etc.)
61
+ - Check for transaction error handling and rollback
49
62
  - Verify connection error handling
63
+ - Check for missing `.catch()` on query builders
50
64
 
51
65
  **File System / External Calls**:
52
66
  - Find fs operations without error handling
53
67
  - Find HTTP client calls (fetch, axios) without catch
54
68
  - Find child_process/exec calls without error handling
69
+ - Find stream operations without error event listeners
55
70
 
56
71
  ### Step 3: Classify Severity
57
- - **Critical**: Unhandled errors that would crash the process or leave broken state
58
- - **High**: Missing error handling on user-facing paths
59
- - **Medium**: Internal operations that silently fail
60
- - **Low**: Edge cases unlikely to occur
72
+ - **Critical**: Unhandled errors that would crash the process, corrupt data, or leave broken state
73
+ - **High**: Missing error handling on user-facing paths that would show raw errors
74
+ - **Medium**: Internal operations that silently fail or lose data
75
+ - **Low**: Edge cases unlikely to occur in normal operation
61
76
 
62
77
  ### Step 4: Generate Report with Fixes
63
78
  ```
@@ -70,12 +85,29 @@ Find and fix unhandled error surfaces across the codebase.
70
85
  ### High — User-Facing Error Gaps
71
86
  - [file:line] No ErrorBoundary around <Dashboard /> route
72
87
  → Add ErrorBoundary with fallback UI
88
+ - [file:line] Missing error.tsx in app/dashboard/
89
+ → Create error.tsx with user-friendly error UI
73
90
 
74
91
  ### Medium — Silent Failures
75
92
  - [file:line] fetch() in useEffect without .catch()
76
93
  → Add error state and catch handler
77
94
 
95
+ ### Low — Edge Cases
96
+ - [file:line] fs.readFile without error callback
97
+ → Add error handling
98
+
78
99
  ### Summary
79
100
  - X critical, Y high, Z medium, W low issues found
80
- - Estimated effort: ...
101
+ - Estimated effort per severity level
102
+
103
+ ### Follow-up
104
+ - Run `/genskills:test-generator` to add tests for error paths
105
+ - Run `/genskills:security-audit` to check if error messages leak sensitive info
81
106
  ```
107
+
108
+ ## Configuration
109
+ Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences:
110
+ - `framework`: string — override auto-detected framework
111
+ - `autoFix`: boolean — automatically apply fixes for critical issues (default: false)
112
+ - `ignorePaths`: string[] — paths to skip
113
+ - `minSeverity`: "low" | "medium" | "high" | "critical" — minimum severity to report
@@ -6,8 +6,8 @@ description: >
6
6
  "format code", "fix formatting", "fix style issues".
7
7
  user-invocable: true
8
8
  argument-hint: "[file or directory]"
9
- allowed-tools: "Read, Edit, Bash(npx eslint*), Bash(npx prettier*), Bash(ruff*), Bash(black*), Glob"
10
- genskills-version: "1.0.0"
9
+ allowed-tools: "Read, Edit, Grep, Glob, Bash(npx eslint*), Bash(npx prettier*), Bash(npm run*), Bash(ruff*), Bash(black*), Bash(isort*)"
10
+ genskills-version: "1.1.0"
11
11
  genskills-category: "code-quality"
12
12
  genskills-depends: []
13
13
  ---
@@ -18,27 +18,62 @@ Detect and fix linting and formatting issues.
18
18
 
19
19
  ## Process
20
20
 
21
+ ### Step 0: Load Project Context
22
+ - Check for `CLAUDE.md` at the project root — follow any linting conventions documented there
23
+ - Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences (see Configuration below)
24
+ - Check `package.json` for custom lint scripts (`lint`, `lint:fix`, `format`)
25
+
21
26
  ### Step 1: Detect Linting Tools
22
- Check the project for:
23
- - `eslint.config.*` or `.eslintrc.*` → ESLint
27
+ Check the project for (in order of priority):
28
+ - `eslint.config.*` or `.eslintrc.*` → ESLint (check version: flat config vs legacy)
24
29
  - `.prettierrc*` or `prettier` in package.json → Prettier
30
+ - `biome.json` or `biome.jsonc` → Biome
25
31
  - `ruff.toml` or `[tool.ruff]` in pyproject.toml → Ruff
26
32
  - `pyproject.toml [tool.black]` → Black
33
+ - `pyproject.toml [tool.isort]` → isort
27
34
  - `.editorconfig` → EditorConfig settings
35
+ - Custom lint scripts in `package.json` (prefer these over direct tool invocation)
28
36
 
29
37
  ### Step 2: Run Linters
30
38
  - If `$ARGUMENTS` specified, lint only that file/directory
31
- - Otherwise lint the full project
32
- - Run the detected linter with `--fix` flag
39
+ - Otherwise, lint the full project
40
+ - **Prefer project scripts first**: `npm run lint:fix` or `npm run format` if they exist
41
+ - Fall back to direct tool invocation with `--fix` flag
33
42
  - Capture and report results
43
+ - Run formatters AFTER linters (formatter output is canonical)
34
44
 
35
45
  ### Step 3: Fix Remaining Issues
36
46
  For issues that auto-fix can't resolve:
37
47
  - Read the flagged files
38
48
  - Apply manual fixes following the project's lint rules
39
- - Common fixes: unused imports, missing semicolons, incorrect spacing, naming conventions
49
+ - Common fixes: unused imports, missing semicolons, incorrect spacing, naming conventions, import ordering
50
+ - Do NOT disable lint rules with comments unless the rule is genuinely wrong for that line
51
+
52
+ ### Step 4: Re-run and Verify
53
+ - Run the linter again to confirm all issues are resolved
54
+ - If issues remain, report them clearly
55
+
56
+ ### Step 5: Report
57
+ ```
58
+ ## Lint Fix Report
59
+
60
+ ### Auto-fixed
61
+ - N issues fixed by linter auto-fix
62
+
63
+ ### Manually Fixed
64
+ - [file:line] Description of manual fix
65
+
66
+ ### Remaining (requires manual attention)
67
+ - [file:line] Rule: description (reason it can't be auto-fixed)
68
+
69
+ ### Summary
70
+ - Total issues found: N
71
+ - Fixed: N (auto: N, manual: N)
72
+ - Remaining: N
73
+ ```
40
74
 
41
- ### Step 4: Report
42
- - List all fixed issues
43
- - List any remaining issues that need manual attention
44
- - Show the total count: fixed vs remaining
75
+ ## Configuration
76
+ Check `${CLAUDE_SKILL_DIR}/_config.json` for user preferences:
77
+ - `preferScript`: boolean prefer `npm run lint:fix` over direct tool invocation (default: true)
78
+ - `ignorePaths`: string[] paths to skip
79
+ - `formatOnFix`: boolean — also run formatter after linting (default: true)