Agent skill
ncps
Developing, running, and testing ncps
Install this agent skill to your Project
npx add-skill https://github.com/kalbasit/ncps/tree/main/.agent/skills/ncps
SKILL.md
NCPS Developer Skill
This skill documents the standard workflows for developing, building, running, and testing the ncps project.
🔴🟢🔵 Development Protocol: TDD ONLY
[!IMPORTANT] TEST FIRST. CODE SECOND. You MUST follow Test Driven Development (TDD) for ALL Go code changes, including FEATURES and BUGS.
The Cycle:
- Red: Write a failing test case that reproduces the bug or defines the new feature.
- Green: Write the minimal amount of code necessary to make the test pass.
- Refactor: Clean up the code while ensuring tests remain green.
Do not write implementation code without a failing test.
Environment Setup
The project uses Nix to manage dependencies. Ensure you have Nix installed.
-
Start Services: Before running the application or tests that require backing services (Postgres, MySQL, Redis, MinIO), start them using:
bashnix run .#depsThis command starts a process manager (process-compose) that runs all necessary services in the foreground. Keep this running in a separate terminal.
-
Run DevShell Tools: When using Claude Code, run any devShell tool (go, golangci-lint, sqlc, dbmate, sqlfluff) with
nix develop --command:bashnix develop --command go test ./... nix develop --command golangci-lint run --fix nix develop --command sqlc generateThis works consistently in both the main working tree and in worktrees. For interactive use, you can also use
nix developordirenv allowif you havedirenvinstalled. -
Enable Service Connectivity: To export the environment variables required to connect to the backing services (especially for running
go test), you must source the configuration:basheval "$(enable-integration-tests)"You can also enable specific services individually (e.g.,
eval "$(enable-postgres-tests)").
Running the Application
The primary way to run ncps locally during development is via dev-scripts/run.py.
Basic Usage
./dev-scripts/run.py [flags]
Common Flags
--mode:single(default) orha(High Availability).--db:sqlite(default),postgres, ormysql.--storage:local(default) ors3.--locker:local(default) orredis.--instances: Number of instances for HA mode (default: 3).
Examples
Run single instance with SQLite (default):
./dev-scripts/run.py
Run HA cluster with Postgres and S3:
./dev-scripts/run.py --mode ha --db postgres --storage s3 --locker redis
[!NOTE] The script automatically handles database migrations using
dbmatebefore starting the application.
Testing
Unit Tests
Run standard Go tests:
go test ./...
Database Tests
The project has extensive database tests in pkg/database. These require the backing services to be running (see "Environment Setup").
Kubernetes Deployment Tests
To test Kubernetes deployments (requires a cluster):
./dev-scripts/test-deployments.py --config dev-scripts/test-deployments-config.yaml
Database Management
Migrations are managed via dbmate. See the dbmate skill for general usage, but note that dev-scripts/run.py handles applying migrations automatically for development.
To create a new migration for all supported engines, use the workflow:
/migrate-new "migration_name"
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
openspec-propose
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
openspec-archive-change
Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.
openspec-explore
Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.
openspec-ff-change
Fast-forward through OpenSpec artifact creation. Use when the user wants to quickly create all artifacts needed for implementation without stepping through each one individually.
openspec-continue-change
Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
Didn't find tool you were looking for?