@urmzd/github-insights 2.0.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 (102) hide show
  1. package/.gitattributes +28 -0
  2. package/.github/dependabot.yml +6 -0
  3. package/.github/pull_request_template.md +14 -0
  4. package/.github/workflows/ci.yml +93 -0
  5. package/.github/workflows/release.yml +59 -0
  6. package/.nvmrc +1 -0
  7. package/.pre-commit-config.yaml +5 -0
  8. package/AGENTS.md +69 -0
  9. package/CHANGELOG.md +260 -0
  10. package/CONTRIBUTING.md +87 -0
  11. package/LICENSE +190 -0
  12. package/README.md +188 -0
  13. package/action.yml +45 -0
  14. package/biome.json +40 -0
  15. package/examples/classic/README.md +9 -0
  16. package/examples/classic/index.svg +14 -0
  17. package/examples/classic/metrics-calendar.svg +14 -0
  18. package/examples/classic/metrics-complexity.svg +14 -0
  19. package/examples/classic/metrics-contributions.svg +14 -0
  20. package/examples/classic/metrics-expertise.svg +14 -0
  21. package/examples/classic/metrics-languages.svg +14 -0
  22. package/examples/classic/metrics-pulse.svg +14 -0
  23. package/examples/ecosystem/README.md +59 -0
  24. package/examples/ecosystem/index.svg +14 -0
  25. package/examples/ecosystem/metrics-calendar.svg +14 -0
  26. package/examples/ecosystem/metrics-complexity.svg +14 -0
  27. package/examples/ecosystem/metrics-contributions.svg +14 -0
  28. package/examples/ecosystem/metrics-expertise.svg +14 -0
  29. package/examples/ecosystem/metrics-languages.svg +14 -0
  30. package/examples/ecosystem/metrics-pulse.svg +14 -0
  31. package/examples/minimal/README.md +9 -0
  32. package/examples/minimal/index.svg +14 -0
  33. package/examples/minimal/metrics-calendar.svg +14 -0
  34. package/examples/minimal/metrics-complexity.svg +14 -0
  35. package/examples/minimal/metrics-contributions.svg +14 -0
  36. package/examples/minimal/metrics-expertise.svg +14 -0
  37. package/examples/minimal/metrics-languages.svg +14 -0
  38. package/examples/minimal/metrics-pulse.svg +14 -0
  39. package/examples/modern/README.md +111 -0
  40. package/examples/modern/index.svg +14 -0
  41. package/examples/modern/metrics-calendar.svg +14 -0
  42. package/examples/modern/metrics-complexity.svg +14 -0
  43. package/examples/modern/metrics-contributions.svg +14 -0
  44. package/examples/modern/metrics-expertise.svg +14 -0
  45. package/examples/modern/metrics-languages.svg +14 -0
  46. package/examples/modern/metrics-pulse.svg +14 -0
  47. package/llms.txt +24 -0
  48. package/metrics/index.svg +14 -0
  49. package/metrics/metrics-calendar.svg +14 -0
  50. package/metrics/metrics-complexity.svg +14 -0
  51. package/metrics/metrics-contributions.svg +14 -0
  52. package/metrics/metrics-domains.svg +14 -0
  53. package/metrics/metrics-expertise.svg +14 -0
  54. package/metrics/metrics-languages.svg +14 -0
  55. package/metrics/metrics-pulse.svg +14 -0
  56. package/metrics/metrics-tech-stack.svg +14 -0
  57. package/package.json +35 -0
  58. package/skills/github-insights/SKILL.md +237 -0
  59. package/sr.yaml +16 -0
  60. package/src/__fixtures__/repos.ts +84 -0
  61. package/src/api.ts +729 -0
  62. package/src/components/bar-chart.test.tsx +38 -0
  63. package/src/components/bar-chart.tsx +54 -0
  64. package/src/components/contribution-calendar.test.tsx +44 -0
  65. package/src/components/contribution-calendar.tsx +94 -0
  66. package/src/components/contribution-cards.test.tsx +36 -0
  67. package/src/components/contribution-cards.tsx +58 -0
  68. package/src/components/donut-chart.test.tsx +36 -0
  69. package/src/components/donut-chart.tsx +102 -0
  70. package/src/components/full-svg.test.tsx +54 -0
  71. package/src/components/full-svg.tsx +59 -0
  72. package/src/components/project-cards.test.tsx +46 -0
  73. package/src/components/project-cards.tsx +66 -0
  74. package/src/components/section.test.tsx +69 -0
  75. package/src/components/section.tsx +79 -0
  76. package/src/components/stat-cards.test.tsx +32 -0
  77. package/src/components/stat-cards.tsx +57 -0
  78. package/src/components/style-defs.test.tsx +26 -0
  79. package/src/components/style-defs.tsx +27 -0
  80. package/src/components/tech-highlights.test.tsx +63 -0
  81. package/src/components/tech-highlights.tsx +109 -0
  82. package/src/config.test.ts +127 -0
  83. package/src/config.ts +103 -0
  84. package/src/index.ts +363 -0
  85. package/src/jsx-factory.test.tsx +86 -0
  86. package/src/jsx-factory.ts +46 -0
  87. package/src/jsx.d.ts +6 -0
  88. package/src/metrics.test.ts +669 -0
  89. package/src/metrics.ts +365 -0
  90. package/src/parsers.test.ts +247 -0
  91. package/src/parsers.ts +146 -0
  92. package/src/readme.test.ts +189 -0
  93. package/src/readme.ts +70 -0
  94. package/src/svg-utils.test.ts +66 -0
  95. package/src/svg-utils.ts +33 -0
  96. package/src/templates.test.ts +412 -0
  97. package/src/templates.ts +296 -0
  98. package/src/theme.ts +33 -0
  99. package/src/types.ts +235 -0
  100. package/teasr.toml +14 -0
  101. package/tsconfig.json +21 -0
  102. package/vitest.config.ts +12 -0
package/.gitattributes ADDED
@@ -0,0 +1,28 @@
1
+ # Enforce LF line endings for all text files
2
+ * text=auto eol=lf
3
+
4
+ # Ensure specific files use LF
5
+ *.sh text eol=lf
6
+ *.yml text eol=lf
7
+ *.yaml text eol=lf
8
+ *.json text eol=lf
9
+ *.md text eol=lf
10
+ *.rs text eol=lf
11
+ *.toml text eol=lf
12
+ *.go text eol=lf
13
+ *.py text eol=lf
14
+ *.js text eol=lf
15
+ *.ts text eol=lf
16
+ *.tsx text eol=lf
17
+ *.jsx text eol=lf
18
+
19
+ # Binary files
20
+ *.png binary
21
+ *.jpg binary
22
+ *.jpeg binary
23
+ *.gif binary
24
+ *.ico binary
25
+ *.woff binary
26
+ *.woff2 binary
27
+ *.ttf binary
28
+ *.eot binary
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
@@ -0,0 +1,14 @@
1
+ ## Summary
2
+
3
+ <!-- Brief description of what this PR does and why -->
4
+
5
+ ## Changes
6
+
7
+ <!-- List the key changes made -->
8
+
9
+ -
10
+
11
+ ## Verification
12
+
13
+ - [ ] `npm run ci` passes (fmt, lint, typecheck, test, build)
14
+ - [ ] `npm run generate` runs locally without overwriting project README
@@ -0,0 +1,93 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+ workflow_call:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ fmt:
17
+ name: Format
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+ cache: npm
25
+ - run: npm ci
26
+ - run: npm run fmt
27
+
28
+ lint:
29
+ name: Lint
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: actions/setup-node@v4
34
+ with:
35
+ node-version: 22
36
+ cache: npm
37
+ - run: npm ci
38
+ - run: npm run lint
39
+
40
+ typecheck:
41
+ name: Typecheck
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - uses: actions/setup-node@v4
46
+ with:
47
+ node-version: 22
48
+ cache: npm
49
+ - run: npm ci
50
+ - run: npm run typecheck
51
+
52
+ test:
53
+ name: Test
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v4
57
+ - uses: actions/setup-node@v4
58
+ with:
59
+ node-version: 22
60
+ cache: npm
61
+ - run: npm ci
62
+ - run: npm test
63
+
64
+ integrate:
65
+ name: Integration
66
+ needs: [fmt, lint, typecheck, test]
67
+ runs-on: ubuntu-latest
68
+ permissions:
69
+ contents: read
70
+ models: read
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+ - uses: actions/setup-node@v4
74
+ with:
75
+ node-version: 22
76
+ cache: npm
77
+ - run: npm ci
78
+ - run: npm run build
79
+
80
+ - name: Self-test action
81
+ uses: ./
82
+ with:
83
+ github-token: ${{ secrets.GITHUB_TOKEN }}
84
+ commit-push: "false"
85
+ readme-path: "_README.md"
86
+
87
+ - name: Verify SVGs generated
88
+ run: |
89
+ if [ ! -f assets/insights/index.svg ]; then
90
+ echo "ERROR: assets/insights/index.svg was not generated"
91
+ exit 1
92
+ fi
93
+ echo "Self-test passed: assets/insights/index.svg generated"
@@ -0,0 +1,59 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+ inputs:
8
+ force:
9
+ description: "Re-release the current tag (use when a previous release partially failed)"
10
+ type: boolean
11
+ default: false
12
+
13
+ concurrency:
14
+ group: release
15
+ cancel-in-progress: false
16
+
17
+ jobs:
18
+ ci:
19
+ uses: ./.github/workflows/ci.yml
20
+ permissions:
21
+ contents: read
22
+ models: read
23
+
24
+ release:
25
+ name: Release
26
+ needs: ci
27
+ runs-on: ubuntu-latest
28
+ permissions:
29
+ contents: write
30
+ id-token: write
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ with:
34
+ fetch-depth: 0
35
+
36
+ - uses: actions/setup-node@v4
37
+ with:
38
+ node-version: 22
39
+ cache: npm
40
+ registry-url: https://registry.npmjs.org
41
+
42
+ - run: npm install -g npm@latest
43
+ - run: npm ci
44
+ - run: npm run build
45
+ - run: git add -f dist/
46
+ - run: tar -czf dist.tar.gz dist/
47
+
48
+ - name: Release
49
+ id: sr
50
+ uses: urmzd/semantic-release@v1
51
+ with:
52
+ github-token: ${{ secrets.GITHUB_TOKEN }}
53
+ force: ${{ inputs.force }}
54
+
55
+ - name: Publish to npm
56
+ if: steps.sr.outputs.released == 'true'
57
+ run: |
58
+ npm version "${{ steps.sr.outputs.version }}" --no-git-tag-version
59
+ npm publish --provenance --access public
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 22
@@ -0,0 +1,5 @@
1
+ repos:
2
+ - repo: https://github.com/urmzd/semantic-release
3
+ rev: v0.4.0
4
+ hooks:
5
+ - id: conventional-commit-msg
package/AGENTS.md ADDED
@@ -0,0 +1,69 @@
1
+ # AGENTS.md
2
+
3
+ ## Identity
4
+
5
+ You are an agent working on **github-insights** — a GitHub Action that generates beautiful SVG metrics visualizations for GitHub profile READMEs. It produces language breakdowns, AI expertise analysis, contribution pulse, social badges, and signature projects.
6
+
7
+ ## Architecture
8
+
9
+ TypeScript/Node.js GitHub Action using React JSX for SVG rendering.
10
+
11
+ | File | Role |
12
+ |------|------|
13
+ | `src/index.ts` | Main action entry point |
14
+ | `src/api.ts` | GitHub API interactions |
15
+ | `src/metrics.ts` | Metric calculation logic |
16
+ | `src/templates.ts` | SVG template generation |
17
+ | `src/config.ts` | Configuration parsing (`github-insights.yml`) |
18
+ | `src/readme.ts` | README generation |
19
+ | `src/types.ts` | Type definitions (`UserConfig`, etc.) |
20
+ | `src/components/` | 22+ component subdirectories for different metric types |
21
+ | `action.yml` | GitHub Action definition |
22
+
23
+ ## Key Dependencies
24
+
25
+ - `@actions/core`, `@actions/exec`, `@actions/github` — GitHub Action SDK
26
+ - `smol-toml` — TOML config parsing
27
+ - `@vercel/ncc` — Bundle to `dist/`
28
+ - `vitest` — Testing
29
+ - `biome` — Linting and formatting
30
+
31
+ ## Commands
32
+
33
+ | Task | Command |
34
+ |------|---------|
35
+ | Build | `npm run build` (ncc bundle to dist/) |
36
+ | Test | `npm test` (vitest) |
37
+ | Type-check | `npm run typecheck` (tsc --noEmit) |
38
+ | Lint | `npm run lint` (biome check) |
39
+ | Format check | `npm run fmt` |
40
+ | Format fix | `npm run fmt:fix` |
41
+ | Generate locally | `npm run generate` (requires `gh auth`) |
42
+ | Full CI | `npm run ci` (fmt + lint + typecheck + test + build) |
43
+
44
+ ## Code Style
45
+
46
+ - TypeScript with strict mode, ES modules (`"type": "module"`)
47
+ - Biome for formatting and linting (not ESLint/Prettier)
48
+ - Node.js 22+ (`.nvmrc`)
49
+ - Tests colocated as `*.test.ts` alongside source files
50
+ - Components are React JSX returning SVG elements
51
+
52
+ ## Output Files
53
+
54
+ | File | Description |
55
+ |------|-------------|
56
+ | `assets/insights/index.svg` | Combined visualization |
57
+ | `assets/insights/metrics-pulse.svg` | Contribution activity |
58
+ | `assets/insights/metrics-languages.svg` | Language donut chart |
59
+ | `assets/insights/metrics-expertise.svg` | AI expertise bars |
60
+ | `assets/insights/metrics-complexity.svg` | Top projects by stars |
61
+ | `assets/insights/metrics-contributions.svg` | External contributions |
62
+
63
+ ## Adding a New Component
64
+
65
+ 1. Create `src/components/<name>/` directory
66
+ 2. Add the component as a React JSX function returning SVG elements
67
+ 3. Add a corresponding `*.test.ts` file
68
+ 4. Wire it into `src/templates.ts` and `src/metrics.ts`
69
+ 5. Update `action.yml` if new inputs are needed
package/CHANGELOG.md ADDED
@@ -0,0 +1,260 @@
1
+ # Changelog
2
+
3
+ ## 1.1.0 (2026-03-15)
4
+
5
+ ### Features
6
+
7
+ - enrich project display with AI summaries, h3 headings, and complexity ranking ([93fdeed](https://github.com/urmzd/github-metrics/commit/93fdeed2c6277d29b8d65b69fb790ac8ec0eeaaf))
8
+
9
+ ### Documentation
10
+
11
+ - **skill**: comprehensive rewrite of github-metrics agent skill ([4d641fd](https://github.com/urmzd/github-metrics/commit/4d641fd664190993cb0c4408d0eca35fd7cca41e))
12
+
13
+ [Full Changelog](https://github.com/urmzd/github-metrics/compare/v1.0.1...v1.1.0)
14
+
15
+
16
+ ## 1.0.1 (2026-03-15)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **release**: use npm trusted publishing and add Apache-2.0 license field ([d181940](https://github.com/urmzd/github-metrics/commit/d181940db6debce9ffa0f4628a1c1f7db8bf48c4))
21
+
22
+ [Full Changelog](https://github.com/urmzd/github-metrics/compare/v1.0.0...v1.0.1)
23
+
24
+
25
+ ## 1.0.0 (2026-03-15)
26
+
27
+ ### Breaking Changes
28
+
29
+ - remove justfile build tool ([d126632](https://github.com/urmzd/github-metrics/commit/d126632c949d8081fc186aaa2c63ee44803b13f1))
30
+
31
+ ### Features
32
+
33
+ - **types**: add complexity fields to ProjectItem ([638df32](https://github.com/urmzd/github-metrics/commit/638df328c8d58a2c51ca26709e1f6e7453d26d1b))
34
+ - **index**: prioritize projects by technical complexity ([58ddc2a](https://github.com/urmzd/github-metrics/commit/58ddc2ac8a49bacd78e46da4a4d3356f16c5e4b0))
35
+ - **metrics**: add project complexity scoring ([1e1a729](https://github.com/urmzd/github-metrics/commit/1e1a7298cd6a457f2235d56994968bf3973f208c))
36
+
37
+ ### Bug Fixes
38
+
39
+ - **ci**: collapse varDefs chain to single line for biome compliance ([912a9d9](https://github.com/urmzd/github-metrics/commit/912a9d9290ae77d125161dbcd4bfcdb3633753ef))
40
+ - **ci**: format long lines in metrics.ts for biome compliance ([60a9ae1](https://github.com/urmzd/github-metrics/commit/60a9ae1089c69251a478771db5eea01be74c2261))
41
+
42
+ ### Documentation
43
+
44
+ - replace just commands with npm run across all documentation ([09675e5](https://github.com/urmzd/github-metrics/commit/09675e580974eb25740122da3f1797ce07cd7ba7))
45
+ - add AGENTS.md and agent skill for Claude Code ([a7d6d05](https://github.com/urmzd/github-metrics/commit/a7d6d05045017429ec20394e222f895f1682df1c))
46
+
47
+ ### Refactoring
48
+
49
+ - **api**: extract graphql client and refactor fetch functions ([62642d8](https://github.com/urmzd/github-metrics/commit/62642d81f9f5e4c0c687b59f7381df509ae49090))
50
+
51
+ ### Miscellaneous
52
+
53
+ - regenerate dist bundle and example metrics ([59d7737](https://github.com/urmzd/github-metrics/commit/59d77373779e5ca51d8200bdcff36dbb8d185666))
54
+ - **metrics**: update project sorting tests for complexity ranking ([004e14f](https://github.com/urmzd/github-metrics/commit/004e14f2b27455905801aba4967fc4860ca020cc))
55
+
56
+ [Full Changelog](https://github.com/urmzd/github-metrics/compare/v0.6.0...v1.0.0)
57
+
58
+
59
+ ## 0.6.0 (2026-03-05)
60
+
61
+ ### Features
62
+
63
+ - **examples**: generate template examples in subdirectories ([ff257e2](https://github.com/urmzd/github-metrics/commit/ff257e29045c5ae046a9d0a604b0fa91162fdca9))
64
+ - **metrics**: classify projects by commit activity ([59d11a9](https://github.com/urmzd/github-metrics/commit/59d11a91faab801ad18859443a399a2a969b8cc1))
65
+ - **api**: fetch commit contributions by repository ([42c2e2e](https://github.com/urmzd/github-metrics/commit/42c2e2ea50283305eb085d1b04ba87b115a06bee))
66
+
67
+ ### Bug Fixes
68
+
69
+ - **ci**: format long lines in metrics.test.ts for biome compliance ([d889d64](https://github.com/urmzd/github-metrics/commit/d889d64870f1a3728d006c061d6f05a86b7bd449))
70
+
71
+ ### Miscellaneous
72
+
73
+ - **metrics**: update generated metrics ([cdde265](https://github.com/urmzd/github-metrics/commit/cdde2657eb36d624fba5a96af1ba6ddb4a030dca))
74
+
75
+
76
+ ## 0.5.1 (2026-02-27)
77
+
78
+ ### Bug Fixes
79
+
80
+ - use npm trusted publishing with OIDC instead of token ([dc81e99](https://github.com/urmzd/github-metrics/commit/dc81e993cfd3e7fdf777a5282d713364936713df))
81
+
82
+ ### Miscellaneous
83
+
84
+ - **release**: v0.5.0 [skip ci] ([da30654](https://github.com/urmzd/github-metrics/commit/da306547f0a9c9ca8bb5e05ff89c973f3b4043b2))
85
+
86
+
87
+ ## 0.5.0 (2026-02-27)
88
+
89
+
90
+ ## 0.5.0 (2026-02-27)
91
+
92
+ ### Features
93
+
94
+ - publish to npm on release ([152067e](https://github.com/urmzd/github-metrics/commit/152067e5f9c01100da7d1f6ac01544e92e30c26b))
95
+
96
+
97
+ ## 0.4.6 (2026-02-27)
98
+
99
+ ### Bug Fixes
100
+
101
+ - distinguish active vs popular projects in AI preamble prompt ([b7cef11](https://github.com/urmzd/github-metrics/commit/b7cef11780f0ae93242bc2dc3cebddf16e9b122b))
102
+
103
+ ### Miscellaneous
104
+
105
+ - standardize GitHub Actions workflows ([1937089](https://github.com/urmzd/github-metrics/commit/1937089fc291b42821e0e3a8366dd17ed2ce1742))
106
+ - add sensitive paths to .gitignore ([006d95b](https://github.com/urmzd/github-metrics/commit/006d95bf711cf2a7fd0b083b86757a8546ca3533))
107
+
108
+
109
+ ## 0.4.5 (2026-02-20)
110
+
111
+ ### Bug Fixes
112
+
113
+ - increase vertical spacing between text labels and bar SVGs ([3ff1b0d](https://github.com/urmzd/github-metrics/commit/3ff1b0de497cad1c211f3e901f0e48132dacd536))
114
+
115
+
116
+ ## 0.4.4 (2026-02-19)
117
+
118
+ ### Bug Fixes
119
+
120
+ - separate labels and bars onto two lines to prevent text overlap ([f4bbe42](https://github.com/urmzd/github-metrics/commit/f4bbe42fc37015a7d0eced6ad8da55a59a5c22ca))
121
+
122
+
123
+ ## 0.4.3 (2026-02-18)
124
+
125
+ ### Bug Fixes
126
+
127
+ - use first-person AI prompts and show usernames in social badges ([f0d6afd](https://github.com/urmzd/github-metrics/commit/f0d6afdbfbc39766f53fbbac922e1b8edbfe360b))
128
+
129
+ ### Refactoring
130
+
131
+ - move template preview READMEs to examples/ directory ([35bfaf0](https://github.com/urmzd/github-metrics/commit/35bfaf0472d01da4758b4424e614931f3d9b8c42))
132
+
133
+
134
+ ## 0.4.2 (2026-02-17)
135
+
136
+ ### Bug Fixes
137
+
138
+ - use gpt-4.1 model and fix lint warning in regex ([f369763](https://github.com/urmzd/github-metrics/commit/f369763f103ab0c55175cdcce8dfefe2e6ec5ce8))
139
+ - prevent conversational filler in AI-generated preamble ([d3c6e55](https://github.com/urmzd/github-metrics/commit/d3c6e5572cb088ae56c5b33f750dc972f52f4504))
140
+
141
+
142
+ ## 0.4.1 (2026-02-14)
143
+
144
+ ### Bug Fixes
145
+
146
+ - format chained method calls to satisfy biome formatter ([55cbf8f](https://github.com/urmzd/github-metrics/commit/55cbf8f6c13ab30b3c5bb0b0e636a0c232d8adad))
147
+ - strip markdown code fences from AI-generated preamble ([35d879e](https://github.com/urmzd/github-metrics/commit/35d879edbd11bf7e6a999efbca927d4c529f4881))
148
+
149
+ ### Documentation
150
+
151
+ - sync README and CONTRIBUTING with recent code changes ([c696f13](https://github.com/urmzd/github-metrics/commit/c696f130159795f1be5510173763f7b4be56de7b))
152
+ - update badge examples in preamble generation prompt ([5548154](https://github.com/urmzd/github-metrics/commit/5548154b8b825ba2e7f10912d1393aa22fa936bf))
153
+
154
+ ### Miscellaneous
155
+
156
+ - remove dist/ from version control ([f8ed3b3](https://github.com/urmzd/github-metrics/commit/f8ed3b3bf120603b768d00b345e4888482546df9))
157
+
158
+
159
+ ## 0.4.0 (2026-02-11)
160
+
161
+ ### Features
162
+
163
+ - remove GitHub badge from preamble and add generation date to attribution ([2cfd311](https://github.com/urmzd/github-metrics/commit/2cfd3111e1c876f28c0c51e69e0fa4f8e1ef2b33))
164
+
165
+ ### Bug Fixes
166
+
167
+ - resolve biome format and lint errors in CI pipeline ([4eee052](https://github.com/urmzd/github-metrics/commit/4eee052eac7f761f3858284c5eb5c08cb7fd1e68))
168
+ - prevent text-bar overlap in expertise SVG ([22d3c45](https://github.com/urmzd/github-metrics/commit/22d3c45980934927a914509800d4b016c5b6b119))
169
+
170
+ ### Miscellaneous
171
+
172
+ - add preamble regression tests for generateReadme ([894a653](https://github.com/urmzd/github-metrics/commit/894a653e0580e56d508de5d0380f1e30a371a2e7))
173
+ - update semantic-release action to v1 ([b2331d7](https://github.com/urmzd/github-metrics/commit/b2331d77511012e9aa44cedeb57c9903560582e2))
174
+ - gitignore _README.md temp artifact ([aa9fa57](https://github.com/urmzd/github-metrics/commit/aa9fa577b840a811e94a3bc5c2cac981e00fbbaf))
175
+
176
+
177
+ ## 0.3.1 (2026-02-11)
178
+
179
+ ### Bug Fixes
180
+
181
+ - use relative SVG paths in generated README ([d280808](https://github.com/urmzd/github-metrics/commit/d280808a2851d0e836a7bc528b64a487270744a4))
182
+
183
+
184
+ ## 0.3.0 (2026-02-11)
185
+
186
+ ### Features
187
+
188
+ - replace generate-readme flag with readme-path, add project docs ([07edd44](https://github.com/urmzd/github-metrics/commit/07edd440b432c06ee4bc4f1568a8dd8e6a7516ad))
189
+ - add proficiency scores to expertise bars and disable commit-push locally ([7f5413f](https://github.com/urmzd/github-metrics/commit/7f5413f2cba99869215731acceaed0b0e07eb572))
190
+
191
+ ### Miscellaneous
192
+
193
+ - update biome schema to 2.3.14 and apply formatting fixes ([8bf1856](https://github.com/urmzd/github-metrics/commit/8bf18561e113819fa650dbf3993b038b84149307))
194
+ - update metrics ([26f3f66](https://github.com/urmzd/github-metrics/commit/26f3f6636518ba5429adb259dc9355d6520ed5db))
195
+
196
+
197
+ ## 0.2.0 (2026-02-11)
198
+
199
+ ### Features
200
+
201
+ - add force re-release support to release workflow ([46fbe6d](https://github.com/urmzd/github-metrics/commit/46fbe6d60483a818af58b70b3c80b7d8f216ca7d))
202
+
203
+ ### Refactoring
204
+
205
+ - replace ESLint + Prettier with Biome ([9a98708](https://github.com/urmzd/github-metrics/commit/9a98708596a48f527ff846d8943d0c8955712fb6))
206
+
207
+ ### Miscellaneous
208
+
209
+ - update metrics ([b98290c](https://github.com/urmzd/github-metrics/commit/b98290caa3fc4fe0dd67a682f9e7a7c6fa547c3c))
210
+
211
+
212
+ ## 0.1.2 (2026-02-10)
213
+
214
+ ### Bug Fixes
215
+
216
+ - move build steps to workflow and upload dist tarball as release artifact ([a553318](https://github.com/urmzd/github-metrics/commit/a5533186cd5da788afc460ca4e44dd08075a58de))
217
+
218
+ ### Contributors
219
+
220
+ - @urmzd
221
+
222
+
223
+ ## 0.1.1 (2026-02-10)
224
+
225
+ ### Bug Fixes
226
+
227
+ - let semantic-release handle floating major-version tags natively ([4706c57](https://github.com/urmzd/github-metrics/commit/4706c5735fc2ed4979d4c0d4b75464ae13ff7ddc))
228
+
229
+ ### Contributors
230
+
231
+ - @urmzd
232
+
233
+
234
+ ## 0.1.0 (2026-02-10)
235
+
236
+ ### Features
237
+
238
+ - replace hardcoded tech classification with AI-curated tech highlights ([ebcca06](https://github.com/urmzd/github-metrics/commit/ebcca0645e4fcd1446ff05c206d45df893c80ae9))
239
+ - initial implementation of github-metrics action ([6e99dfd](https://github.com/urmzd/github-metrics/commit/6e99dfd58ddc42ca3d936dbaecc289475af1e5de))
240
+
241
+ ### Bug Fixes
242
+
243
+ - use node24 runtime for GitHub Actions compatibility ([7bf6836](https://github.com/urmzd/github-metrics/commit/7bf683645e781feb5d0e63ce1447e572e4db209b))
244
+ - add eslint config and fix lint errors ([e134c7e](https://github.com/urmzd/github-metrics/commit/e134c7eb785dddd07994663578b210f8e295eb04))
245
+
246
+ ### Documentation
247
+
248
+ - move full dashboard SVG to end of README ([0ad66d0](https://github.com/urmzd/github-metrics/commit/0ad66d03f831c32a952be2cc286079bfbcfd96bc))
249
+ - add README, CONTRIBUTING, LICENSE and fix release workflow ([e82f406](https://github.com/urmzd/github-metrics/commit/e82f406b4568c41867930535b4da0be4663d9dfb))
250
+
251
+ ### Miscellaneous
252
+
253
+ - stop tracking dist/ and let semantic-release build it ([f4e3d9f](https://github.com/urmzd/github-metrics/commit/f4e3d9f554cc46939511f6c8059aef8998e161d4))
254
+ - rebuild dist/ to match source ([150a848](https://github.com/urmzd/github-metrics/commit/150a84882f34c3a8f361b66e8a641861b57795a4))
255
+ - fix prettier formatting in 6 source files ([6776b08](https://github.com/urmzd/github-metrics/commit/6776b083965f1aafabfd8b5caf07cc5e23e70a1d))
256
+ - apply formatter and linter fixes ([3b53ce5](https://github.com/urmzd/github-metrics/commit/3b53ce5f54ceb4bcb75fb9cde48325e8a46a5968))
257
+
258
+ ### Contributors
259
+
260
+ - @urmzd
@@ -0,0 +1,87 @@
1
+ # Contributing
2
+
3
+ ## Project Structure
4
+
5
+ ```
6
+ src/
7
+ index.ts # Entry point — orchestrates fetch, transform, render, write
8
+ api.ts # GitHub GraphQL/REST API calls + AI model calls
9
+ metrics.ts # Data aggregation and section definitions
10
+ config.ts # TOML config parsing (UserConfig)
11
+ readme.ts # Profile README generation
12
+ parsers.ts # Dependency manifest parsers
13
+ types.ts # Shared type definitions
14
+ jsx-factory.ts # Custom JSX factory for SVG rendering
15
+ jsx.d.ts # JSX type declarations
16
+ theme.ts # Theme constants (colors, fonts, spacing)
17
+ svg-utils.ts # SVG utility functions
18
+ __fixtures__/
19
+ repos.ts # Test fixture data
20
+ components/ # SVG rendering components
21
+ full-svg.tsx # Combines sections into a single SVG
22
+ section.tsx # Individual section renderer
23
+ donut-chart.tsx # Language donut chart
24
+ bar-chart.tsx # Horizontal bar chart
25
+ tech-highlights.tsx # Expertise bars
26
+ stat-cards.tsx # Contribution stat cards
27
+ project-cards.tsx # Project cards
28
+ contribution-cards.tsx # External contribution cards
29
+ style-defs.tsx # Shared SVG style definitions
30
+ ```
31
+
32
+ ## Adding a New Metric Section
33
+
34
+ 1. If your section needs a new render component, create it in `src/components/`. It should export a function that takes data + a `y` offset and returns `{ svg: string, height: number }`.
35
+
36
+ 2. Add your section to `buildSections` in `src/metrics.ts` (line ~91). Each section is a `SectionDef` (`src/types.ts:54`):
37
+
38
+ ```typescript
39
+ sections.push({
40
+ filename: "metrics-your-section.svg",
41
+ title: "Your Section",
42
+ subtitle: "Description of this section",
43
+ renderBody: (y: number) => renderYourComponent(data, y),
44
+ });
45
+ ```
46
+
47
+ 3. The section is automatically included in the combined `index.svg` and written as a standalone SVG.
48
+
49
+ ## Adding a Package Parser
50
+
51
+ Package parsers extract dependency names from manifest files so the AI expertise analysis can see what libraries you use.
52
+
53
+ 1. Create a `PackageParser` implementation (`src/types.ts:113`):
54
+
55
+ ```typescript
56
+ export const MyParser: PackageParser = {
57
+ filenames: ["my-manifest.json"],
58
+ parseDependencies(text) {
59
+ // Parse and return dependency names
60
+ return [];
61
+ },
62
+ };
63
+ ```
64
+
65
+ 2. Add it to the `PARSERS` array in `src/parsers.ts` (line ~129).
66
+
67
+ 3. Add the manifest filename to `MANIFEST_FILES` in `src/api.ts` (line ~13) so the API fetches it from repos.
68
+
69
+ ## Adding Config Fields
70
+
71
+ 1. Add the field to the `UserConfig` interface in `src/types.ts` (line ~126).
72
+
73
+ 2. Add parsing logic in `parseUserConfig` in `src/config.ts` — follow the existing pattern of type-checking and trimming.
74
+
75
+ 3. Use the new field wherever needed (e.g., in `src/index.ts`, `src/readme.ts`, or `src/metrics.ts`).
76
+
77
+ ## Testing
78
+
79
+ - Tests use [Vitest](https://vitest.dev/) with `*.test.ts` and `*.test.tsx` naming conventions
80
+ - Use `.test.tsx` for tests that exercise JSX components (e.g., `src/components/section.test.tsx`)
81
+ - Run tests: `npm test`
82
+ - Tests live alongside source files (e.g., `src/config.test.ts`, `src/components/donut-chart.test.tsx`)
83
+
84
+ ## Code Style
85
+
86
+ - Enforced by [Biome](https://biomejs.dev/) — run `npm run fmt` to check, `npm run fmt:fix` to auto-fix
87
+ - Run `npm run ci` before submitting a PR to catch formatting, lint, type, and test issues