setup-dev-env
npx machina-cli add skill yu-iskw/skill-inspector/setup-dev-env --openclawSetup Development Environment
This skill automates the process of setting up the development environment to ensure all tools and dependencies are correctly installed and configured.
Workflow Checklist
- Step 1: Environment Validation
- Check Node.js version against
.node-version - Check for
pnpminstallation
- Check Node.js version against
- Step 2: Dependency Installation
- Run
pnpm install(this also installs thetrunklauncher)
- Run
- Step 3: Tooling Setup
- Run
pnpm trunk installto fetch managed linters and formatters
- Run
Detailed Instructions
1. Environment Validation
Node.js Version
Read the .node-version file in the workspace root. Ensure the current Node.js environment matches this version. If there's a mismatch, inform the user to switch Node versions (e.g., using nvm or fnm).
Trunk CLI
Trunk is managed via pnpm in this project using @trunkio/launcher. This ensures it works in cloud environments like Claude Code Cloud without manual installation.
The trunk launcher is installed automatically during pnpm install. You can then run Trunk commands using pnpm trunk.
For local macOS users who prefer a global installation:
brew install trunk-io
For other platforms, refer to the Trunk installation documentation.
2. Dependency Installation
Run the following command at the workspace root to install all project dependencies, including the Trunk launcher. Refer to ../common-references/pnpm-commands.md for more pnpm commands.
pnpm install
3. Tooling Setup
Trunk manages linters and formatters hermetically. Run the following command to ensure all required tools are downloaded and ready.
pnpm trunk install
Refer to ../common-references/trunk-commands.md for more Trunk commands.
Success Criteria
- All
pnpmdependencies are installed successfully. trunkis installed and all managed tools are initialized.- The Node.js version matches the requirement in
.node-version.
Post-Setup Verification
To ensure the environment is fully operational:
- Invoke Verifier: Run the
verifiersubagent (../../agents/verifier.md). This confirms that the freshly installed dependencies allow for a successful build, pass lint checks, and satisfy all unit tests. - Handle Failure: If the
verifierfails, follow its reporting to resolve environment-specific issues.
Source
git clone https://github.com/yu-iskw/skill-inspector/blob/main/.claude/skills/setup-dev-env/SKILL.mdView on GitHub Overview
This skill automates the development environment setup to ensure all tools and dependencies are correctly installed and configured. It validates the Node version, installs dependencies with pnpm (including the trunk launcher), and initializes tooling to keep the workspace in sync.
How This Skill Works
It reads the .node-version to verify the Node.js version, checks for a pnpm installation, runs pnpm install to install all dependencies (which also installs the trunk launcher), and finally runs pnpm trunk install to fetch managed linters and formatters. The trunk launcher is managed via @trunkio/launcher to work in cloud environments as well.
When to Use It
- Starting work on the project
- Dependencies are out of sync or missing
- Environment setup failures occur
- Switching Node.js versions to match the .node-version
- Setting up dev environments in cloud/CI where trunk tooling is required
Quick Start
- Step 1: Read the .node-version and ensure the local Node.js matches it
- Step 2: Run pnpm install at the workspace root to install dependencies and the trunk launcher
- Step 3: Run pnpm trunk install to fetch managed linters/formatters
Best Practices
- Validate the current Node.js version against the .node-version file before proceeding
- Ensure pnpm is installed and accessible in the PATH
- Run pnpm install at the workspace root to install all dependencies (including the trunk launcher)
- Run pnpm trunk install to fetch and initialize managed linters and formatters
- After setup, run the verifier subagent to confirm a successful build, lint, and tests
Example Use Cases
- Fresh clone: validate environment, install dependencies with pnpm, then initialize trunk tools
- After pulling updates that change dependencies or trunk configuration
- Node version drift detected; switch to the version specified in .node-version
- macOS user installs trunk globally via brew for convenience, then runs setup
- CI/cloud environment provisioning that relies on trunk for tooling and validation