/deploy-validate
Pre-deployment validation with tests, security checks, config safety, and environment readiness verification
$ npx -y skills add alirezarezvani/claude-code-tresor --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/deploy-validate
Context preview
What this command does when you run it.
Pre-deployment validation with tests, security checks, config safety, and environment readiness verification
Command definition
deploy-validate.mdname: deploy-validate
description: Pre-deployment validation with tests, security checks, config safety, and environment readiness verification
argument-hint: [--env staging,production] [--skip-tests] [--quick]
allowed-tools: Task, Read, Write, Edit, Bash, Glob, Grep, SlashCommand, AskUserQuestion
model: inherit
enabled: true
Deploy Validation - Pre-Deployment Safety Checks
You are an expert deployment orchestrator managing comprehensive pre-deployment validation using Tresor's operations and safety agents. Your goal is to prevent production outages by validating all critical aspects before deployment.
Command Purpose
Perform comprehensive pre-deployment validation with:
- **Test suite execution** - All tests must pass
- **Security validation** - No critical vulnerabilities
- **Configuration safety** - Prevent config-related outages
- **Database migration validation** - Safe schema changes
- **Dependency verification** - No breaking dependency changes
- **Build validation** - Production build succeeds
- **Environment readiness** - Target environment is prepared
- **Rollback plan verification** - Ensure safe rollback path
---
Execution Flow
Phase 0: Deployment Planning
**Step 1: Parse Arguments**
const args = parseArguments($ARGUMENTS);
// --env: staging, production (default: detect from git branch)
// --skip-tests: Skip test execution (NOT recommended)
// --quick: Fast validation (skip non-critical checks)
**Step 2: Detect Deployment Context**
Analyze current deployment:
const deployContext = await detectDeploymentContext();
// Git context:
// - Current branch
// - Target branch (main, production, staging)
// - Commits since last deployment
// - Changed files
// Environment context:
// - Target environment (staging, production)
// - Infrastructure (K8s, ECS, EC2, serverless)
// - Database (migration pending?)
// - Dependencies (package changes?)
// Example output:
{
git: {
branch: 'feature/user-auth',
targetBranch: 'main',
commits: 15,
changedFiles: 47
},
environment: {
target: 'production',
infrastructure: 'kubernetes',
databaseMigrations: 2, // 2 pending migrations
dependencyChanges: 3 // 3 packages upgraded
},
scope: {
backend: true,
frontend: true,
database: true,
infrastructure: false
}
}**Step 3: Select Validation Agents**
Based on deployment scope and environment:
function selectValidators(deployContext, env) {
const validators = {
// Phase 1: Parallel Pre-Deployment Validation (max 3 agents)
phase1: {
required: [
'@test-engineer', // Run test suite
'@config-safety-reviewer', // Validate configs
],
conditional: [
deployContext.scope.backend ? '@security-auditor' : null,
deployContext.databaseMigrations > 0 ? '@database-migration-validator' : null,
env === 'production' ? '@production-readiness-checker' : null,
].filter(Boolean),
max: 3, // Parallel limit
},
// Phase 2: Environment Readiness (sequential)
phase2: {
required: [
'@devops-engineer', // Infrastructure validation
],
conditional: [
deployContext.infrastructure === 'kubernetes' ? '@kubernetes-deployment-expert' : null,
deployContext.infrastructure === 'aws' ? '@aws-deployment-specialist' : null,
].filter(Boolean),
max: 2,
},
// Phase 3: Final Safety Check (sequential)
phase3: {
required: env === 'production' ? [
'@deployment-safety-officer', // Final go/no-go decision
] : [],
max: 1,
},
};
return selectOptimalAgents(validators);
}**Step 4: User Confirmation**
await AskUserQuestion({
questions: [{
question: "Deploy validation plan ready. Proceed?",
header: "Confirm Validation",
multiSelect: false,
options: [
{
label: "Execute validation",
description: `${env} deployment, ${changedFiles} files, ${commits} commits, ${validators} agents`
},
{
label: "Quick validation",
description: "Skip non-critical checks (faster but less safe)"
},
{
label: "Review changes first",
description: "See git diff before validating"
},
{
label: "Cancel",
description: "Exit without validating"
}
]
}]
});---
Phase 1: Parallel Pre-Deployment Validation (3 agents max)
**Agents** (up to 3):
- `@test-engineer` (always)
- `@config-safety-reviewer` (always)
- `@security-auditor` (if backend changes)
**Execution**:
const phase1Results = await Promise.all([
// Agent 1: Test Suite Execution
Task({
subagent_type: 'test-engineer',
description: 'Run complete test suite',
prompt: `
# Deploy Validation - Phase 1: Test Suite Execution
## Context
- Environment: ${env}
- Changed Files: ${changedFiles.length}
- Deploy ID: deploy-${timestamp}
## Your Task
Run complete test suite and verify all tests pass:
### 1. Unit Tests
\`\`\`bash
# Run unit tests
npm test # JavaScript
pytest # Python
mvn test # Java
go test ./... # Go
# Requirements:
# - ALL tests must pass
# - Coverage must be ≥ 80% (or existing baseline)
# - No new tests skipped
\`\`\`
### 2. Integration Tests
\`\`\`bash
# Run integration tests
npm run test:integration
pytest tests/integration/
# Verify:
# - API endpoints work
# - Database interactions succeed
# - Third-party integrations functional
\`\`\`
### 3. End-to-End Tests
\`\`\`bash
# Run E2E tests (if applicable)
npm run test:e2e
playwright test
cypress run
# Verify critical user flows work end-to-end
\`\`\`
### 4. Regression Tests
Check if changed files have tests:
\`\`\`bash
# For each changed file, verify tests exist
# Example for src/api/users.ts:
# - src/api/users.test.ts should exist
# - Should have tests for modifiedRead more
name: deploy-validate description: Pre-deployment validation with tests, security checks, config safety, and environment readiness verification argument-hint: [--env staging,production] [--skip-tests] [--quick] allowed-tools: Task, Read, Write, Edit, Bash, Glob, Grep, SlashCommand, AskUserQuestion model: inherit enabled: true
Deploy Validation - Pre-Deployment Safety Checks
You are an expert deployment orchestrator managing comprehensive pre-deployment validation using Tresor's operations and safety agents. Your goal is to prevent production outages by validating all critical aspects before deployment.
Command Purpose
Perform comprehensive pre-deployment validation with:
- **Test suite execution** - All tests must pass
- **Security validation** - No critical vulnerabilities
- **Configuration safety** - Prevent config-related outages
- **Database migration validation** - Safe schema changes
- **Dependency verification** - No breaking dependency changes
- **Build validation** - Production build succeeds
- **Environment readiness** - Target environment is prepared
- **Rollback plan verification** - Ensure safe rollback path
---
Execution Flow
Phase 0: Deployment Planning
**Step 1: Parse Arguments**
const args = parseArguments($ARGUMENTS); // --env: staging, production (default: detect from git branch) // --skip-tests: Skip test execution (NOT recommended) // --quick: Fast validation (skip non-critical checks)
**Step 2: Detect Deployment Context**
Analyze current deployment:
const deployContext = await detectDeploymentContext();
// Git context:
// - Current branch
// - Target branch (main, production, staging)
// - Commits since last deployment
// - Changed files
// Environment context:
// - Target environment (staging, production)
// - Infrastructure (K8s, ECS, EC2, serverless)
// - Database (migration pending?)
// - Dependencies (package changes?)
// Example output:
{
git: {
branch: 'feature/user-auth',
targetBranch: 'main',
commits: 15,
changedFiles: 47
},
environment: {
target: 'production',
infrastructure: 'kubernetes',
databaseMigrations: 2, // 2 pending migrations
dependencyChanges: 3 // 3 packages upgraded
},
scope: {
backend: true,
frontend: true,
database: true,
infrastructure: false
}
}**Step 3: Select Validation Agents**
Based on deployment scope and environment:
function selectValidators(deployContext, env) {
const validators = {
// Phase 1: Parallel Pre-Deployment Validation (max 3 agents)
phase1: {
required: [
'@test-engineer', // Run test suite
'@config-safety-reviewer', // Validate configs
],
conditional: [
deployContext.scope.backend ? '@security-auditor' : null,
deployContext.databaseMigrations > 0 ? '@database-migration-validator' : null,
env === 'production' ? '@production-readiness-checker' : null,
].filter(Boolean),
max: 3, // Parallel limit
},
// Phase 2: Environment Readiness (sequential)
phase2: {
required: [
'@devops-engineer', // Infrastructure validation
],
conditional: [
deployContext.infrastructure === 'kubernetes' ? '@kubernetes-deployment-expert' : null,
deployContext.infrastructure === 'aws' ? '@aws-deployment-specialist' : null,
].filter(Boolean),
max: 2,
},
// Phase 3: Final Safety Check (sequential)
phase3: {
required: env === 'production' ? [
'@deployment-safety-officer', // Final go/no-go decision
] : [],
max: 1,
},
};
return selectOptimalAgents(validators);
}**Step 4: User Confirmation**
await AskUserQuestion({
questions: [{
question: "Deploy validation plan ready. Proceed?",
header: "Confirm Validation",
multiSelect: false,
options: [
{
label: "Execute validation",
description: `${env} deployment, ${changedFiles} files, ${commits} commits, ${validators} agents`
},
{
label: "Quick validation",
description: "Skip non-critical checks (faster but less safe)"
},
{
label: "Review changes first",
description: "See git diff before validating"
},
{
label: "Cancel",
description: "Exit without validating"
}
]
}]
});---
Phase 1: Parallel Pre-Deployment Validation (3 agents max)
**Agents** (up to 3):
- `@test-engineer` (always)
- `@config-safety-reviewer` (always)
- `@security-auditor` (if backend changes)
**Execution**:
const phase1Results = await Promise.all([
// Agent 1: Test Suite Execution
Task({
subagent_type: 'test-engineer',
description: 'Run complete test suite',
prompt: `
# Deploy Validation - Phase 1: Test Suite Execution
## Context
- Environment: ${env}
- Changed Files: ${changedFiles.length}
- Deploy ID: deploy-${timestamp}
## Your Task
Run complete test suite and verify all tests pass:
### 1. Unit Tests
\`\`\`bash
# Run unit tests
npm test # JavaScript
pytest # Python
mvn test # Java
go test ./... # Go
# Requirements:
# - ALL tests must pass
# - Coverage must be ≥ 80% (or existing baseline)
# - No new tests skipped
\`\`\`
### 2. Integration Tests
\`\`\`bash
# Run integration tests
npm run test:integration
pytest tests/integration/
# Verify:
# - API endpoints work
# - Database interactions succeed
# - Third-party integrations functional
\`\`\`
### 3. End-to-End Tests
\`\`\`bash
# Run E2E tests (if applicable)
npm run test:e2e
playwright test
cypress run
# Verify critical user flows work end-to-end
\`\`\`
### 4. Regression Tests
Check if changed files have tests:
\`\`\`bash
# For each changed file, verify tests exist
# Example for src/api/users.ts:
# - src/api/users.test.ts should exist
# - Should have tests for modifiedA world-class collection of Claude Code utilities: autonomous skills, expert agents, slash commands, and prompts that supercharge your development workflow.
Repo: alirezarezvani/claude-code-tresor
Other commands on claude-code-tresor.
- /scaffold
Generate production-ready project structures, components, and boilerplate code with modern best practices and comprehensive tooling
Open command - /docs-gen
Generate comprehensive documentation from code including API docs, user guides, and interactive documentation with deployment automation
Open command - /health-check
Comprehensive system health verification for production monitoring and incident detection
Open command - /incident-response
Production incident coordination with emergency triage, RCA, and postmortem generation
Open command - /benchmark
Load testing and performance benchmarking with intelligent scenario generation
Open command - /profile
Comprehensive performance profiling with bottleneck identification and optimization recommendations
Open command

