Skip to content

Commit ecf616c

Browse files
authored
Merge pull request #34 from Multiplier-Labs/feat/repo-health-workflow
Add Repository Health workflow
2 parents 4db7946 + d2d6b6b commit ecf616c

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
kind: repo-health.weekly
3+
name: Repository Health
4+
sessionPrefix: repo-health
5+
outputDir: .codekin/reports/repo-health
6+
filenameSuffix: _repo-health.md
7+
commitMessage: chore: repository health report
8+
---
9+
You are performing an automated repository health assessment. This is a comprehensive housekeeping, documentation, and git hygiene check. Please do the following:
10+
11+
## Part 1 — Maintenance & Housekeeping
12+
13+
1. **Dead Code Detection**
14+
- Find unused exports: scan for exported functions, classes, constants, and types that are never imported elsewhere in the project.
15+
- Identify unreachable functions: look for private/internal functions that have no callers.
16+
- Detect orphan files: find source files that are not imported or referenced by any other file.
17+
- For each finding, note the file path and export/function name, and recommend removal or flag for review.
18+
19+
2. **TODO/FIXME Tracker**
20+
- Scan the entire codebase for `TODO`, `FIXME`, `HACK`, `XXX`, and `WORKAROUND` comments.
21+
- For each, report: file:line, the comment text, and the author + date from `git blame`.
22+
- Flag stale items — any TODO/FIXME where the blamed commit is older than 30 days.
23+
- Summarize: total count, count by type, count of stale items.
24+
25+
3. **Config Drift Check**
26+
- Examine tsconfig.json, eslint config, and prettier config (if present).
27+
- Compare against modern best-practices defaults for the project's stack.
28+
- Flag any unusual, overly permissive, or outdated settings (e.g. missing `strict: true` in tsconfig, deprecated ESLint rules).
29+
- Note any inconsistencies between configs (e.g. conflicting target versions).
30+
31+
4. **License Compliance**
32+
- Audit dependency licenses using the lock file and package metadata.
33+
- Flag any GPL, AGPL, LGPL, or other copyleft licenses if the project itself uses a permissive license (MIT, Apache, BSD).
34+
- Flag any dependencies with unknown, missing, or non-standard licenses.
35+
- Report a summary table: license type → count of dependencies.
36+
37+
## Part 2 — Documentation
38+
39+
5. **API Docs Freshness**
40+
- Identify API endpoints, public types, and interfaces that serve as the project's API surface.
41+
- Check if corresponding documentation (README, docs/ files, JSDoc/TSDoc comments) appears stale relative to recent code changes.
42+
- Flag any endpoints or types that changed in the last 30 days but whose docs were not updated.
43+
44+
6. **README Drift**
45+
- Read the project's README.md (and any CONTRIBUTING.md or docs/).
46+
- Verify that install steps, listed scripts (e.g. `npm run dev`, `npm test`), and examples still match the actual package.json scripts and project structure.
47+
- Flag any commands, paths, or configuration references in the README that no longer exist or have changed.
48+
49+
7. **Changelog Generator**
50+
- Summarize commits from the last 7 days (or since the last tag, whichever is shorter) into a draft changelog entry.
51+
- Group by category: Features, Fixes, Refactoring, Documentation, Chores.
52+
- Use conventional commit messages where available; otherwise infer the category.
53+
54+
## Part 3 — Git & Workflow Hygiene
55+
56+
8. **Stale Branch Cleanup**
57+
- List all remote branches with no commit activity in the last 30 days.
58+
- For each, report: branch name, last commit date, last commit author, and whether it has been merged into the main branch.
59+
- Recommend deletion for branches that are both stale and already merged.
60+
61+
9. **PR Hygiene Report**
62+
- If a GitHub remote is detected, use `gh pr list` to enumerate open PRs.
63+
- For each open PR, report: number, title, author, age (days open), review status, and whether it has merge conflicts.
64+
- Flag "stuck" PRs: those open for more than 7 days with no review activity.
65+
66+
10. **Merge Conflict Forecast**
67+
- Identify active branches (commits in the last 14 days) that have diverged significantly from the main branch.
68+
- For each, report the number of commits ahead/behind main and list files modified on both the branch and main since divergence.
69+
- Flag branches with high conflict risk (overlapping file changes).
70+
71+
---
72+
73+
Produce a structured Markdown report. Your entire response will be saved as the report file, so write valid Markdown only — no conversational preamble.
74+
75+
Report structure:
76+
77+
## Summary
78+
(Overall health rating: Excellent/Good/Fair/Needs Attention. Key stats: dead code items, stale TODOs, config issues, license concerns, doc drift items, stale branches, stuck PRs.)
79+
80+
## Dead Code
81+
(Table: file, export/function, type [unused export | unreachable | orphan file], recommendation)
82+
83+
## TODO/FIXME Tracker
84+
(Table: file:line, type, comment, author, date, stale?)
85+
(Summary counts at the end)
86+
87+
## Config Drift
88+
(List of findings with config file, setting, current value, recommended value)
89+
90+
## License Compliance
91+
(Summary table: license → count. Flagged dependencies listed separately.)
92+
93+
## Documentation Freshness
94+
(List of stale docs, README drift findings, any mismatches)
95+
96+
## Draft Changelog
97+
(Grouped changelog entry for the recent period)
98+
99+
## Stale Branches
100+
(Table: branch, last commit date, author, merged?, recommendation)
101+
102+
## PR Hygiene
103+
(Table: PR#, title, author, days open, review status, conflicts?, stuck?)
104+
105+
## Merge Conflict Forecast
106+
(Table: branch, commits ahead/behind, overlapping files, risk level)
107+
108+
## Recommendations
109+
(Numbered list of 5–10 prioritised actions, ordered by impact)
110+
111+
Important: Do NOT modify any source files. This is a read-only assessment.

src/lib/workflowHelpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const WORKFLOW_KINDS = [
1313
{ value: 'dependency-health.daily', label: 'Dependency Health', category: 'assessment' as WorkflowCategory },
1414
{ value: 'security-audit.weekly', label: 'Security Audit', category: 'assessment' as WorkflowCategory },
1515
{ value: 'complexity.weekly', label: 'Complexity Report', category: 'assessment' as WorkflowCategory },
16+
{ value: 'repo-health.weekly', label: 'Repository Health', category: 'assessment' as WorkflowCategory },
1617
]
1718

1819
export const MODEL_OPTIONS = [

0 commit comments

Comments
 (0)