feat(review): generate repo-specific Claude Code / Codex skill files - #3174
Merged
Conversation
Extends the repo-doc generation roadmap with a conditionally-generated skill file: a blocking gate check, a strict linked-issue rule, and multi-stage CI are each a named signal, and two or more firing triggers a generated .claude/skills/<name>/SKILL.md following this repo's own frontmatter + procedural-body convention. The skill rides along in the SAME commit/PR as AGENTS.md/CLAUDE.md via a new "skills" scope value -- no parallel delivery path -- and reuses refreshGeneratedDoc unchanged with its own marker pair, so a skill-only content change can still open a PR when AGENTS.md itself is unchanged, and a skill-file conflict only excludes the skill from that run rather than blocking the AGENTS.md refresh it rode in with. Closes #3001. Part of #2993.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3174 +/- ##
=======================================
Coverage 94.72% 94.73%
=======================================
Files 269 270 +1
Lines 29619 29666 +47
Branches 10806 10824 +18
=======================================
+ Hits 28056 28103 +47
Misses 917 917
Partials 646 646
🚀 New features to boost your workflow:
|
Contributor
|
Important 🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪 🔍 Gittensory is reviewing…AI analysis is in progress. This comment will update when the review is complete. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/review/repo-skill-render.ts:shouldGenerateRepoSkill(profile), a trigger predicate built entirely fromRepoProfile's existingcontributionWorkflowfields (no new signal derivation, keeping feat(review): extract a codebase-grounded repo profile from RAG + signals #2999's extraction primitive generation-agnostic) -- a blocking gate check (gatePublishesCheck), a strict linked-issue rule (requireLinkedIssue && linkedIssuePolicy !== "optional"), and multi-stage CI (ciWorkflowFiles.length >= 2) are each a named, independently-testable sub-check (mirroringsrc/signals/slop.ts's style); two or more firing is the trigger.renderRepoSkillContent(profile)renders a.claude/skills/contributing-to-<repo>/SKILL.md-shaped file -- frontmatter (name/description) plus a procedural body (why it was generated, build/test/lint commands, linked-issue policy) -- following THIS repo's own.claude/skills/contributing-to-gittensory/SKILL.mdconvention exactly. Returnsnullwhen the profile is absent or the trigger doesn't fire, matchingrenderRepoDocContent's "no partial/placeholder file" discipline.openRepoDocPullRequest(src/github/repo-doc-pr.ts) already uses for AGENTS.md/CLAUDE.md -- no parallel delivery mechanism. A new"skills"scope value (alongside the existing"agents"value from feat(config): add .gittensory.yml surface to enable/scope repo-doc generation #3002) gates whether the skill file is even considered; when it is, the skill gets its OWN marker pair and its OWNrefreshGeneratedDoccall (reused unchanged, per that module's stated design intent from fix(review): make repo-doc refresh diff-aware and preserve manual edits #3004), so:allowOverwriteExisting(feat(config): add .gittensory.yml surface to enable/scope repo-doc generation #3002) is set, in which case it's discarded in favor of a fresh generate, same as AGENTS.md's own behavior.buildRepoDocTreenow accepts an optionalextraEntriesarray (the skill file, when included) added to both the symlink-attempt and copy-fallback tree builds;fetchExistingAgentsMdContentis generalized tofetchExistingFileContent(path)and reused for both files.Part of #2993 (repo-doc generation roadmap). Closes #3001.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint(not run -- no workflow files touched)npm run typechecknpm run test:coverage-- scoped to the two changed source files: 100% statements/branches/functions/lines onsrc/review/repo-skill-render.tsandsrc/github/repo-doc-pr.ts. Full unshardedtest:coverageleft to CI per this repo's own "don't duplicate CI locally" convention; rannpm run test:changedagainstorigin/main(50 tests across the 2 changed files) plus the broader affected suite directly (406 tests across 8 files, includingtest/unit/focus-manifest.test.tsandtest/unit/no-direct-octokit.test.tsas regression checks) -- all green.npm run test:workers(not run -- no Cloudflare-Workers-pool-specific code touched)npm run build:mcp/npm run test:mcp-pack(not run -- no MCP package changes)npm run ui:openapi:check/npm run ui:lint/npm run ui:typecheck/npm run ui:build(not run -- noapps/gittensory-uichanges, no API/OpenAPI surface changed)npm audit --audit-level=moderate(not run locally -- no dependency changes; CI's dependency-review job covers this)If any required check was skipped, explain why:
validatejob runs them as a backstop.Safety
UI Evidencesection below with screenshots. (N/A -- no visible UI changes.)Notes
src/review/repo-profile.ts(feat(review): extract a codebase-grounded repo profile from RAG + signals #2999) to add a new "auto-close" signal distinct from "has a check" -- the existing fields are sufficient for a reasonable trigger today, and feat(review): extract a codebase-grounded repo profile from RAG + signals #2999's own design explicitly keeps the extraction primitive free of generation-specific concerns.openRepoDocPullRequeststill has no automatic trigger wired to it, matching how feat(review): generate CLAUDE.md/AGENT.md from the repo profile, delivered as a PR #3000 itself shipped.