OpenParable
Skip to content
← Back to skills

Keybase Unused Source Files

Development
keybase-unused-source-files

Keybase Unused Source Files is an Agent Skill for development published in the keybase/client repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Use when finding orphaned or unused .tsx source files in the Keybase client codebase that are no longer imported anywhere.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/keybase/client/blob/HEAD/skill/keybase-unused-source-files/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/keybase-unused-source-files, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Keybase Unused Source Files

Find .tsx files that are no longer imported or required anywhere in shared/.

Finding Orphaned Files

.claude/skills/keybase-unused-source-files/find-unused-tsx.sh

Run from the repo root. Outputs a list of candidates to review.

What the Script Detects

The script collects all import paths from every .ts, .tsx, .js, and .mts file, then checks each .tsx file against that list.

Handled automatically:

  • Static imports: from './foo'
  • Dynamic imports: React.lazy(async () => import('./foo'))
  • Side-effect imports: import './foo'
  • Platform-specific files: foo.native.tsx matches both import './foo' (bundler-resolved) and import './foo.native' (explicit)
  • Index files: chat/index.tsx matches import '../chat' and import '../chat/index'

Not detected:

  • Imports constructed at runtime from variables
  • Webpack entry points (excluded by name: node.desktop.tsx, preload.desktop.tsx, local-debug.tsx)
  • Files referenced only from config objects not using string literals

Workflow

  1. Run the script and review each listed file
  2. Open the file and check its exports — if they're unused the file is dead
  3. Delete confirmed orphans and run yarn lint && yarn tsc to verify

Adding New Webpack Entry Points

If the script flags a file that's a Webpack entry, add its basename to ENTRY_POINTS in find-unused-tsx.sh.