feat: run reusable skill checks and prepare repair patches #290
MergedLadyBluenotes(GitHub profile, opens in a new tab)merged 19 commits into
feat/validate-code-blocks fromfeat/reusable-check-workflowmerged by LadyBluenotes(GitHub profile, opens in a new tab) - .github/workflows/check-skills.yml lines 120 to 123OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +103,21 @@103+ else104+ intent stale --github-review "${LABEL[@]}"105+ fi106+107+ - name: Open or update review PR108+ if: steps.stale.outputs.has_review == 'true'109+ env:110+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}111+ VERSION: ${{ github.event.release.tag_name || 'manual' }}112+ BASE_BRANCH: ${{ github.event.repository.default_branch }}113+ run: |114+ BRANCH="skills/review-${VERSION}"115+116+ git config user.name "github-actions[bot]"117+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"118+119+ git fetch origin "$BRANCH" || true120+ if git show-ref --verify --quiet "refs/remotes/origin/$BRANCH"; then121+ git checkout -B "$BRANCH" "origin/$BRANCH"122+ else123+ git checkout -b "$BRANCH"packages/intent/src/commands/maintainer.ts lines 489 to 497OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -460,8 +464,16 @@464+ if (options.json) console.log(JSON.stringify(status, null, 2))465+ else {466+ console.log(headline)467+ for (const line of lines) console.log(` ${line}`)460468 }461469 if (action === 'check') {462470 // Validate each skills root once instead of once per skill directory.463- for (const dir of new Set(464- plan.skills.map((path) => dirname(dirname(path))),465- ))466- await runValidateCommand(dir)467- if (plan.problems.length || plan.changes.length || review.items.length)471+ let validation: unknown472+ try {473+ for (const dir of new Set(474+ plan.skills.map((path) => dirname(dirname(path))),475+ ))476+ await runValidateCommand(dir, { githubSummary: options.githubSummary })477+ } catch (err) {478+ validation = err479+ }
- .github/workflows/check-skills.yml lines 92 to 112Resolvedby LadyBluenotes(GitHub profile, opens in a new tab)@@ -0,0 +60,21 @@60+ cache: ${{ steps.manager.outputs.cache }}61+62+ - name: Install intent63+ env:64+ INTENT_VERSION: ${{ inputs.intent-version }}65+ MANAGER: ${{ steps.manager.outputs.cache }}66+ COREPACK_ENABLE_DOWNLOAD_PROMPT: '0'67+ run: |68+ if [ -n "$INTENT_VERSION" ]; then69+ npm install -g "@tanstack/intent@${INTENT_VERSION}"70+ exit 071+ fi72+ case "$MANAGER" in73+ pnpm) pnpm install --frozen-lockfile --ignore-scripts ;;74+ yarn)75+ if yarn --version | grep -q '^1\.'; then76+ yarn install --frozen-lockfile --ignore-scripts77+ else78+ yarn install --immutable --mode=skip-build79+ fi ;;80+ npm) npm ci --ignore-scripts ;;packages/intent/meta/templates/workflows/check-skills.yml line 14OutdatedResolvedby LadyBluenotes(GitHub profile, opens in a new tab)@@ -1,10 +1,14 @@1-# check-skills.yml — Drop this into your library repo's .github/workflows/1+# check-skills.yml — copied by `intent maintainer setup` into .github/workflows/22 #3-# Validates intent skills and recorded source reviews on PRs. After a release or manual run, opens or4-# updates one review PR when existing skills, artifact coverage, or workspace5-# package coverage need review.3+# Validates intent skills and recorded source reviews on pull requests. After a4+# release or manual run, opens or updates one review PR when skills, artifact5+# coverage, or workspace package coverage need review.66 #7-# Triggers: pull requests, new release published, or8-# manual workflow_dispatch.7+# The steps live in TanStack/intent's reusable workflows, pinned below to the8+# commit of the Intent release that copied this file. Dependabot and Renovate9+# bump the pin like any other action reference; a `github-actions` entry in10+# .github/dependabot.yml is enough. Each job grants only the permissions its11+# workflow needs, and Intent runs from this repository's own lockfile-pinned12+# copy of @tanstack/intent.913 #10-# intent-workflow-version: 514+# intent-workflow-version: 4
- packages/intent/src/commands/validate.ts lines 505 to 506OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -490,3 +502,5 @@490502 library: string | undefined491503 }> = []492504 for (const filePath of skillFiles) {505+ if (validatedFiles.has(filePath)) continue506+ validatedFiles.add(filePath)packages/intent/src/setup/project-setup.ts line 477OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -408,3 +469,9 @@408469409470 const srcDir = join(metaDir, 'templates', 'workflows')410471 const destDir = join(workspaceRoot, '.github', 'workflows')472+ // Resolving the reference contacts GitHub, so only a template that pins473+ // one and will actually be copied asks for it. Existing workflows stay offline.474+ if (templatesUse(srcDir, destDir, '{{INTENT_WORKFLOW_REF}}'))475+ vars.INTENT_WORKFLOW_REF =476+ process.env.INTENT_WORKFLOW_REF ||477+ resolveIntentWorkflowRef(join(metaDir, '..'))
LadyBluenotes(GitHub profile, opens in a new tab) changed the title
schiller-manuel(GitHub profile, opens in a new tab) approved these changes
Sign in to join this conversation.
Warning
Review limit reached#
Next included review available in 25 minutes.
Check out review usage here.
View limit details
Limit details: You’ve used all 2 included reviews currently available.
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
ee357b09-ee82-4d49-b2c2-8b1c6f76cd77📥 Commits
Reviewing files that changed from the base of the PR and between 017c79fd361ba52947f4cdb926f996e54e631da9 and 13ba6277f197abb63a7b7672b04dd4bb10f17d09.
📒 Files selected for processing (22)
.changeset/reusable-check-workflow.md.github/workflows/check-skills.yml.github/workflows/publish-skill-review.yml.github/workflows/review-skills.ymlnx.jsonpackages/intent/meta/generate-skill/references/maintainer-commands.mdpackages/intent/meta/generate-skill/references/review-signals.mdpackages/intent/meta/generate-skill/references/workflow-security.mdpackages/intent/meta/templates/workflows/check-skills.ymlpackages/intent/src/commands/maintainer.tspackages/intent/src/commands/validate.tspackages/intent/src/setup/project-setup.tspackages/intent/src/shared/write-path.tspackages/intent/tests/cli.test.tspackages/intent/tests/hooks-install.test.tspackages/intent/tests/integration/packed-release.test.tspackages/intent/tests/maintainer.test.tspackages/intent/tests/reusable-workflows.test.tspackages/intent/tests/setup.test.tspackages/intent/tests/workflow-review.test.tspackages/intent/tsdown.config.tspackages/intent/vitest.config.ts📝 Walkthrough
Walkthrough#
The change replaces embedded workflow logic with reusable, commit-pinned workflows. It adds lockfile-based Intent installation, multi-root validation, GitHub step-summary reporting, automatic skill setup, bulk review recording, code-example checks, and related tests and benchmarks.
Changes#
Skill check workflow
packages/intent/meta/templates/workflows/check-skills.yml,packages/intent/src/setup/project-setup.ts,packages/intent/src/commands/support.ts,.changeset/reusable-check-workflow.md.github/workflows/check-skills.yml,.github/workflows/review-skills.ymlpackages/intent/src/commands/maintainer.ts,packages/intent/src/cli.ts,packages/intent/src/review/review.ts,packages/intent/src/maintainer/*GITHUB_STEP_SUMMARY.packages/intent/src/validate/blocks.ts,packages/intent/src/commands/validate.tspackages/intent/tests/*,.changeset/*,benchmarks/intent/*,package.jsonPriority: ⬇️ Low
Estimated code review effort: 4 (Complex) | ~60 minutes
Change: Feature
Suggested reviewers:
alemtuzlakSequence Diagram(s)#
Merge Risk: 🟡 Moderate · up to
017c7Generated workflows may execute a later retargeted upstream workflow with repository write permissions. Immutable pinning should be ensured before merge.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 24.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 20 files. (7 skipped: 7 unsupported.)
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share