Keybase Unused Source Files
Developmentkeybase-unused-source-filesKeybase 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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
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.tsxmatches bothimport './foo'(bundler-resolved) andimport './foo.native'(explicit) - Index files:
chat/index.tsxmatchesimport '../chat'andimport '../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
- Run the script and review each listed file
- Open the file and check its exports — if they're unused the file is dead
- Delete confirmed orphans and run
yarn lint && yarn tscto 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.