agentleFS
ccbudccbud/CCBuddy/.agents/skills/dep-refs/SKILL.md

dep-refs

Skill8 starsChanged 32 days agoApache-2.0View on GitHub

Use when the agent needs to inspect TypeScript export references in the ccbuddy workspace, list exports from a file, verify whether an export is unused before deletion, investigate who imports a symbol during refactors, or combine pnpm knip unused-export results with pnpm dep:refs symbol-level reference tracing.

4 other projects use a version of this, 4 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

9 rules. 2 are common, 0 are distinctive, and 7 are very specific to this project.

  • 2

    Common

    Most of the 4 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the repository's pnpm dep:refs CLI to answer symbol-level questions before changing or deleting TypeScript exports.

    line 9
  2. Common:

    Start broad when deleting code:

    line 13
  3. Very specific:

    Use knip to find likely unused exports, then inspect any risky or unclear export with dep:refs:

    line 19
  4. Common:

    Use scoped scans for fast exploration only when the scope is intentionally limited:

    line 31
  5. Very specific:

    Before claiming an export is safe to delete, prefer an unscoped dep:refs run so cross-package callers are not missed.

    line 37
  6. Very specific:

    Use silent pnpm mode for machine-readable output, because normal pnpm output includes extra banner lines:

    line 41
  7. Very specific:

    Use JSON when summarizing many symbols, feeding results to jq, or comparing references and reExports counts programmatically.

    line 47
  8. Very specific:

    Treat References (0) and Re-exports (0) as "no static references found", not as proof that no dynamic usage exists.

    line 51
  9. Very specific:

    If a symbol only appears under Re-exports, trace the outward barrel path before deleting.

    line 53

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dep Refs

Use the repository's pnpm dep:refs CLI to answer symbol-level questions before changing or deleting TypeScript exports. Run commands from the ccbuddy repository root.

Workflow

Start broad when deleting code:

pnpm knip

Use knip to find likely unused exports, then inspect any risky or unclear export with dep:refs:

pnpm dep:refs packages/services/src/bots/botsService.ts:createBotsService

List all exports in a file when the exact symbol name is unknown:

pnpm dep:refs --list-exports packages/services/src/bots/botsService.ts

Use scoped scans for fast exploration only when the scope is intentionally limited:

pnpm dep:refs --scope packages/services packages/services/src/bots/botsService.ts:createBotsService

Before claiming an export is safe to delete, prefer an unscoped dep:refs run so cross-package callers are not missed.

JSON Mode

Use silent pnpm mode for machine-readable output, because normal pnpm output includes extra banner lines:

pnpm -s dep:refs packages/services/src/bots/botsService.ts:createBotsService --json | jq .

Use JSON when summarizing many symbols, feeding results to jq, or comparing references and reExports counts programmatically.

Interpreting Results

Treat References (0) and Re-exports (0) as "no static references found", not as proof that no dynamic usage exists. The script does not detect dynamic import() paths or string-based references.

If a symbol only appears under Re-exports, trace the outward barrel path before deleting. A re-export can still be part of the public surface even when there are no direct internal imports.

For refactors, report concrete callers with file and line from the CLI output, then decide whether to update callers, preserve the export, or delete it.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.