code-setup-project
Set up a project development environment with wrapper scripts and/or a Nix flake.
Parameters
- location: Desired location for setup artifacts.
- "machine-local": Inside
.my/(ignored by git, good for personal tools). - "project-local": Root level (e.g.,
bin/,flake.nix).
- "machine-local": Inside
- setup_types: What to set up ("wrapper", "flake", or "both").
If these parameters are not explicitly provided in the request, infer them from context or ask the user for clarification before proceeding.
Process
For each setup type selected:
Wrapper Scripts
-
Determine paths based on location:
- Machine-local:
.my/bin/withmy-prefix - Project-local:
bin/, ask about naming:- Generic:
test,lint,fmt,build,dev - Prefixed (default):
<project-name>-test, etc.
- Generic:
- Machine-local:
-
Invoke the
code-analyze-projectskill to:- Detect project type
- Recommend wrappers (test, lint, fmt, build, dev commands)
-
Present recommended wrappers and ask which to create
-
Create wrapper directory if needed
-
If machine-local: Create
.my/.gitignorewith content* -
Create wrapper scripts with template:
#!/usr/bin/env bash
set -euo pipefail
<command>
- Make executable:
chmod +x <dir>/*
Nix Flake
-
Determine path based on location:
- Machine-local:
.my/flake.nix - Project-local:
flake.nix
- Machine-local:
-
Check for existing flake at the determined path
-
Detect project type and required packages:
- Node.js: package.json → nodejs, npm/pnpm/yarn
- Python: pyproject.toml, setup.py → python3, pip/poetry/uv
- Go: go.mod → go, gopls
- Rust: Cargo.toml → cargo, rustc
- Ruby: Gemfile → ruby, bundler
- Other: check for Makefile, CMakeLists.txt, etc.
-
Generate flake using the template in templates/flake.nix
- Use
buildInputs(notpackages) for dependencies - No shellHook unless absolutely necessary
- Keep it simple and minimal
- If updating existing flake, preserve custom inputs/outputs but simplify structure
- Use
-
If machine-local: Create
.my/.gitignorewith content*if not exists -
Verify the flake:
nix flake check path:.
- If verification fails, fix issues and re-verify
Output
- Project type detected
- Wrapper/flake location created
- Scripts/flake created (with descriptions)
- How to use
More from sirn/dotfiles
code-commit
Commit current changes using jj. Analyzes changes, suggests commit messages following repository conventions, proposes splits if needed, and creates commits. Use ONLY when user explicitly asks to commit changes or create commits.
18gemini-reference
Reference for calling the Gemini CLI agent from other agents. ALWAYS read BEFORE invoking Gemini to ensure correct JSON protocol, session management, and subtask delegation patterns.
18code-quality
Run comprehensive quality checks by orchestrating review, verification, testing, and linting. Use when user asks to check code quality, run full checks, or verify code health.
18context7
Retrieve up-to-date documentation context for libraries using the Context7 API. Use when needing current library documentation (React, Python stdlib, Rust, etc.) BEFORE implementing or writing code.
17code-debug
Debug issues by researching errors and proposing minimal fixes. Use when user asks to troubleshoot or debug a failure.
17code-generate-document
Generate documentation, docstrings, or ADRs. Use when asked to document code or create decision records.
17