Agent skill
lint-running
Run lint and format checks in the Commons monorepo. Use when validating code style, checking for linting errors, before commits, or when the user mentions linting or formatting code.
Install this agent skill to your Project
npx add-skill https://github.com/jakewaldrip/.dotfiles/tree/main/misc/commons/.opencode/skills/lint-running
SKILL.md
Run Lint and Format Checks
Targets
| Target | Purpose |
|---|---|
lint:check |
ESLint code quality check |
format:check |
Prettier formatting check |
lint:fix |
ESLint auto-fix |
format:write |
Prettier auto-fix |
Two Modes
1. Context-based (specific files)
When files are provided, lint their projects:
- Use @nx-project-mapping to determine the Nx project for each file
- Collect unique project names
- Run lint on those projects:
npx nx run-many --targets "lint:check,format:check" -p <project1>,<project2>
To auto-fix:
npx nx run-many --targets "lint:fix,format:write" -p <project>
2. Git-based (changed files)
When no files specified, lint affected projects:
npx nx affected --base=$(gt parent) --targets "lint:check,format:check"
Uses Graphite's gt parent for correct base (works with stacked PRs).
Full CI Lint Pipeline
To run lint on the entire codebase:
# Step 1: Generate builder slugs (required)
npx nx codegen @cityblock/builder
# Step 2: Run all lint checks
npx nx run-many --targets "lint:check,format:check"
Examples
| File Path | Project | Command |
|---|---|---|
commons-packages/backend/services/member.ts |
@commons/backend |
npx nx run-many --targets "lint:check,format:check" -p @commons/backend |
commons/app/shared/components/button.tsx |
commons |
npx nx run-many --targets "lint:check,format:check" -p commons |
| Multiple projects | a,b,c |
npx nx run-many --targets "lint:check,format:check" -p @commons/backend,commons |
Note: For packages, read the name field from package.json—directory names don't always match project names.
Troubleshooting
| Issue | Solution |
|---|---|
| EPERM errors | Run with sandbox disabled |
| Project not found | Use @nx-project-mapping; for packages, check package.json name field |
| Long execution | Normal for large monorepos (10+ minutes) |
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?