| name | dev-workflow |
| description | Common development commands and workflows — linting, testing, building, Docker management, and troubleshooting. |
Dev Workflow Skill
Common development commands and workflows for the Site Scanning Engine.
Quick Reference
Linting and Formatting
npm run lint
npm run format
Run these before committing code.
Testing
npm run test:unit
npm run tdd
npm run test:cov
npm run test:e2e
Note: Test files use .spec.ts extension.
Development Servers
npm run start:all
npm run start:api
npm run start:scan-engine
npm run start:dev
Testing Scans
npm run scan:dev
npm run scan:dap
For custom site:
npx nest start cli -- scan-site --url yourdomain.gov
Building
npm run build:all
npm run build:api
npm run build:scan-engine
npm run build:cli
Docker Management
Start Infrastructure
docker-compose up --build -d
Starts:
- PostgreSQL (port 5432)
- Redis (port 6379)
- Minio (port 9000, 9001)
Rebuild Containers (wipes data)
docker-compose up --build -d
Warning: This deletes all database and Redis data.
Stop and Remove Containers
docker-compose down
View Container Logs
docker-compose logs -f
docker-compose logs -f postgres
Build Docker Image
docker build -f apps/scan-engine/Dockerfile .
Note: Docker is only for local dev - not used in production Cloud Foundry environment.
Adding New Components
New Application
nest g app <app_name>
Creates new app in apps/ directory.
New Library
nest g library <library_name>
Creates new library in libs/ directory.
Module Path Aliases
Configured in tsconfig.json and package.json:
import { DatabaseModule } from '@app/database';
import { CoreScannerService } from '@app/core-scanner';
import { MessageQueueModule } from '@app/message-queue';
Development Tips
Watch Mode Best Practices
- Use
npm run start:dev for rapid iteration
- Use
npm run tdd for test-driven development
- Use
npm run scan:dev for testing scan logic
Before Committing
- Run linter:
npm run lint
- Run formatter:
npm run format
- Run tests:
npm run test:unit
- Verify no TypeScript errors:
npm run build:all
Pre-commit Hooks
Configured in .pre-commit-config.yaml - automatically runs on git commit:
- Linting
- Formatting
- Basic validation
To skip hooks (not recommended):
git commit --no-verify
API Development
Swagger Documentation
Auto-generated API docs available at:
Updates automatically when you add/modify endpoints.
Database Migrations
In local development:
- TypeORM handles migrations automatically via entity decorators
- Migrations run when API starts
- No manual migration commands needed
Troubleshooting
Port Already in Use
Kill process using port:
lsof -ti:3000 | xargs kill -9
lsof -ti:6379 | xargs kill -9
Node Version Issues
Ensure correct Node.js version:
nvm use
Puppeteer Issues
Rebuild Puppeteer:
npm rebuild puppeteer
Clean Slate
Full reset:
docker-compose down
rm -rf node_modules dist
npm i
npm run build:all
docker-compose up --build -d
npm run start:all