Skip to content

refactor: remove dead code, dedupe helpers, and split shared utils - #358

Merged
LadyBluenotes merged 12 commits into
mainfrom
chore/source-cleanup
Nov 22, 2026
Merged

LadyBluenotes merged 12 commits into
mainfrom
chore/source-cleanup

Conversation

@LadyBluenotes

Copy link
Copy Markdown
Member

🎯 Changes

  • Removes internal code that nothing in the package uses, such as sourceIdentityKey, sourceIdentityEquals, isSkillSourcesParseError, hasPackageManagerInternalPath, the unreachable git variant of SkillSource, src/discovery/index.ts, and the three src/hooks/agents/*.ts files that only tests imported. The tests that covered only that code go with it.
  • Replaces duplicate helpers with one shared copy each: isRecord (five copies), isWithinOrEqual (four), and getPackageShortName. The package.json reader in validate/blocks.ts is gone too; validate now reads through the file cache it already builds.
  • Drops parameters that every caller passed the same way, optional chains on values that are always set, and section-banner and narrating comments.
  • Moves setup/workspace-patterns.ts to core/workspace-patterns.ts, because core and discovery import it. Splits shared/utils.ts into guards, paths, fs-identity, skill-files, node-modules, and frontmatter. Neither move changes logic.
  • Shortens wording in docs/, README.md, and the bundled skills in meta/. The instructions in the skills do not change.
  • Adds the missing opening quote on two sponsor image attributes in README.md.
  • Public exports, the published type declarations, command output, and exit codes do not change. The build goes from 61 files and 730.40 kB to 64 files and 722.96 kB.
  • Adds two patch changesets.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr (run pnpm build:all first).

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Delete helpers and exports that nothing calls, share one copy of
isRecord, errorMessage, stringArray, and isWithinOrEqual, and drop
comments that restate the code. Command output, exit codes, and the
public API stay as they are.

Tests of the deleted exports go with them. One test is new: validate
reads a tracked type entry of a workspace package that is its own git
repository.
Share the permission prompt fixture and the global package fixture,
use vi.stubEnv and vi.restoreAllMocks in place of manual save and
restore, and merge cases that differ by one argument into it.each.
Drop one load --path test that repeated the test before it.
Remove repeated caveats and filler words from the CLI reference,
concept pages, and quick starts, and fix a stray list marker in the
README badge row.
Remove filler words and restated context from the skills that ship in
meta/. Every instruction, rule, step, and table row stays.
Check tracked type entries per workspace package again in place of the
batched git call, substitute template variables with the original
replace chain, read _artifacts behind the existence check, and read the
message of any thrown object in the install catches. Restore the JSDoc
on findSkillFiles so the published types match.
Bring back the first-run permission rules and example, the outcome
table, the setup and registry notes, the policy mode bullets, and the
other statements that no longer appeared anywhere in docs/. The edits
that only shorten wording stay.
Reuse getPackageShortName, errorMessage, and isRecord where local
copies remained, and read manifests for example checks through the
shared filesystem cache. Drop three pass-through exports, parameters
that every caller gave one value, and a notice set that never removed
a duplicate. Output does not change.
core and discovery import this module, so it belongs in the layer they
share. The file moves unchanged except for its own import path.
shared/utils.ts becomes guards, paths, fs-identity, skill-files,
node-modules, and frontmatter. The code moves unchanged; only import
paths differ. The shared exports now come first in src/index.ts so the
published type declarations keep their order.
setup stopped with an error on a workspace package whose package.json
is not an object. The cleanup read such a file as empty and carried on.
Read it as before so setup output does not change.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 115 files, which is 15 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7e8c437-a968-444d-886a-c5d94d2666a9
Commits

Reviewing files that changed from the base of the PR and between 755b9b8 and 63fc7e4.

Files selected for processing: 115

  • .changeset/remove-unused-internal-code.md
  • .changeset/shorten-meta-skill-wording.md
  • README.md
  • docs/cli/intent-maintainer.md
  • docs/cli/intent-review.md
  • docs/cli/intent-stale.md
  • docs/concepts/trust-model.md
  • docs/getting-started/quick-start-consumers.md
  • docs/getting-started/quick-start-maintainers.md
  • docs/overview.md
  • docs/registry.md
  • packages/intent/meta/domain-discovery/SKILL.md
  • packages/intent/meta/generate-skill/SKILL.md
  • packages/intent/meta/generate-skill/references/distribution.md
  • packages/intent/meta/generate-skill/references/maintainer-commands.md
  • packages/intent/meta/generate-skill/references/planning-records.md
  • packages/intent/meta/generate-skill/references/review-signals.md
  • packages/intent/meta/generate-skill/references/skill-format.md
  • packages/intent/meta/generate-skill/references/source-review.md
  • packages/intent/meta/generate-skill/references/task-quality.md
  • packages/intent/meta/skill-staleness-check/SKILL.md
  • packages/intent/meta/tree-generator/SKILL.md
  • packages/intent/meta/tree-generator/references/update-skills.md
  • packages/intent/src/cli.ts
  • packages/intent/src/commands/exclude.ts
  • packages/intent/src/commands/install/command.ts
  • packages/intent/src/commands/install/guidance.ts
  • packages/intent/src/commands/install/permission-prompts.ts
  • packages/intent/src/commands/install/permissions.ts
  • packages/intent/src/commands/list.ts
  • packages/intent/src/commands/load.ts
  • packages/intent/src/commands/maintainer.ts
  • packages/intent/src/commands/meta.ts
  • packages/intent/src/commands/repair.ts
  • packages/intent/src/commands/review.ts
  • packages/intent/src/commands/stale.ts
  • packages/intent/src/commands/support.ts
  • packages/intent/src/commands/validate.ts
  • packages/intent/src/core/excludes.ts
  • packages/intent/src/core/intent-core.ts
  • packages/intent/src/core/load-resolution.ts
  • packages/intent/src/core/markdown.ts
  • packages/intent/src/core/package-json.ts
  • packages/intent/src/core/project-context.ts
  • packages/intent/src/core/skill-sources.ts
  • packages/intent/src/core/source-policy.ts
  • packages/intent/src/core/types.ts
  • packages/intent/src/core/workspace-patterns.ts
  • packages/intent/src/discovery/fs-cache.ts
  • packages/intent/src/discovery/index.ts
  • packages/intent/src/discovery/package-manager.ts
  • packages/intent/src/discovery/register.ts
  • packages/intent/src/discovery/scanner.ts
  • packages/intent/src/discovery/walk.ts
  • packages/intent/src/hooks/agents/claude.ts
  • packages/intent/src/hooks/agents/codex.ts
  • packages/intent/src/hooks/agents/copilot.ts
  • packages/intent/src/hooks/install.ts
  • packages/intent/src/hooks/policy.ts
  • packages/intent/src/hooks/types.ts
  • packages/intent/src/index.ts
  • packages/intent/src/maintainer/add.ts
  • packages/intent/src/maintainer/distribution.ts
  • packages/intent/src/maintainer/existing.ts
  • packages/intent/src/maintainer/project.ts
  • packages/intent/src/maintainer/sync.ts
  • packages/intent/src/review/review.ts
  • packages/intent/src/setup/project-setup.ts
  • packages/intent/src/shared/cli-output.ts
  • packages/intent/src/shared/command-runner.ts
  • packages/intent/src/shared/display.ts
  • packages/intent/src/shared/frontmatter.ts
  • packages/intent/src/shared/fs-identity.ts
  • packages/intent/src/shared/guards.ts
  • packages/intent/src/shared/node-modules.ts
  • packages/intent/src/shared/paths.ts
  • packages/intent/src/shared/skill-files.ts
  • packages/intent/src/shared/types.ts
  • packages/intent/src/shared/utils.ts
  • packages/intent/src/skills/paths.ts
  • packages/intent/src/skills/resolver.ts
  • packages/intent/src/skills/use.ts
  • packages/intent/src/staleness/artifact-coverage.ts
  • packages/intent/src/staleness/check.ts
  • packages/intent/src/validate/blocks.ts
  • packages/intent/src/validate/repairs.ts
  • packages/intent/tests/cli.test.ts
  • packages/intent/tests/core-types.test.ts
  • packages/intent/tests/core.test.ts
  • packages/intent/tests/discovery-safety.test.ts
  • packages/intent/tests/fixtures/permissions.ts
  • packages/intent/tests/hooks.test.ts
  • packages/intent/tests/install-writer.test.ts
  • packages/intent/tests/integration/distribution-installers.test.ts
  • packages/intent/tests/integration/load-integration.test.ts
  • packages/intent/tests/integration/packed-release.test.ts
  • packages/intent/tests/integration/pnp-berry-corepack.test.ts
  • packages/intent/tests/integration/scaffold.ts
  • packages/intent/tests/integration/scanner-integration.test.ts
  • packages/intent/tests/parse-frontmatter.test.ts
  • packages/intent/tests/permissions.test.ts
  • packages/intent/tests/read-scalar-field.test.ts
  • packages/intent/tests/repeated-work.test.ts
  • packages/intent/tests/resolve-dep-dir.test.ts
  • packages/intent/tests/scanner.test.ts
  • packages/intent/tests/setup.test.ts
  • packages/intent/tests/skill-paths.test.ts
  • packages/intent/tests/skill-sources.test.ts
  • packages/intent/tests/skills.test.ts
  • packages/intent/tests/source-policy.test.ts
  • packages/intent/tests/stale-command.test.ts
  • packages/intent/tests/staleness.test.ts
  • packages/intent/tests/support.test.ts
  • packages/intent/tests/validate-blocks.test.ts
  • packages/intent/tests/workspace-patterns.test.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@changeset-bot

changeset-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 63fc7e4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tanstack/intent Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud

nx-cloud Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 63fc7e4

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 1m 3s View ↗
nx run-many --targets=build ✅ Succeeded 2s View ↗

💡 With Ultracache enabled, Nx Cloud learns each task's file inputs in CI and uses them on later runs. Turn on Ultracache in workspace settings ↗ · Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-11-22 19:40:54 UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@tanstack/intent@358

commit: 63fc7e4

@LadyBluenotes
LadyBluenotes merged commit 3d01b9f into main Nov 22, 2026
9 checks passed
@LadyBluenotes
LadyBluenotes deleted the chore/source-cleanup branch November 22, 2026 19:42
@github-actions github-actions Bot mentioned this pull request Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant