Agent skill
nx-project-mapping
Maps file paths to Nx project names in the Commons monorepo. Use when you need to determine which Nx project a file belongs to for running tests, linting, or other Nx commands.
Install this agent skill to your Project
npx add-skill https://github.com/jakewaldrip/.dotfiles/tree/main/misc/commons/.opencode/skills/nx-project-mapping
SKILL.md
Nx Project Mapping
Maps file paths to Nx project names using the project graph.
Get Project Mappings
npx nx graph --file=stdout | jq '.graph.nodes | to_entries | map({name: .key, root: .value.data.root})'
If jq is not installed, parse the JSON directly—the output is { "graph": { "nodes": { "<project-name>": { "data": { "root": "<path>" } } } } }.
Example output:
[
{ "name": "commons", "root": "commons" },
{ "name": "@commons/backend", "root": "commons-packages/backend" },
{ "name": "@cityblock/api", "root": "packages/cityblock-api" },
{ "name": "process-ciox-pdf", "root": "cloud_functions/process-ciox-pdf" }
]
Match File to Project
Use longest-prefix matching: find the project whose root is the longest prefix of the file path.
| Step | Action |
|---|---|
| 1 | Normalize file path (relative to repo root) |
| 2 | Sort projects by root length (longest first) |
| 3 | Return first project whose root is a prefix of the file path |
Example: commons-packages/backend/services/member-service.ts → @commons/backend
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
react-component-writing
React component patterns and style guide for the Commons monorepo. Use when creating React components, working with GraphQL in components, or implementing internationalization with MessageFormat.
graphite-cli
Use Graphite CLI (gt) for stacked PRs and branch management. Use when creating branches, committing changes, submitting PRs, syncing with trunk, or managing stacked pull requests.
test-running
Run Jest tests in the Commons monorepo. Use when testing code changes, validating implementations, debugging test failures, or when the user mentions running tests.
document-type-adding
Add new document types to the DocuSign integration in the Commons monorepo. Use when the user wants to add a patient document, consent form, or agreement to the DocuSign workflow.
dataloader-dual-mode-migration
Migrate dataloaders to dual-mode pattern supporting both patientId and enrollmentId for Member Model 2.0. Use when converting a patient-based dataloader to support the MemberModelV2Switch.
feature-flag-create-or-remove
Create or remove feature flags in the Commons application. Use when the user wants to add a new feature flag, delete a feature flag, or asks about feature flag naming conventions.
Didn't find tool you were looking for?