scaffold
Generate production-ready project structures, components, and boilerplate code with modern best practices and comprehensive tooling
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.
/deploy-validateContext preview
What this command does when you run it.
Pre-deployment validation with tests, security checks, config safety, and environment readiness verification
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
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.
Perform comprehensive pre-deployment validation with:
---
**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"
}
]
}]
});---
**Agents** (up to 3):
**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
Generate production-ready project structures, components, and boilerplate code with modern best practices and comprehensive tooling
Generate comprehensive documentation from code including API docs, user guides, and interactive documentation with deployment automation
Comprehensive system health verification for production monitoring and incident detection
Production incident coordination with emergency triage, RCA, and postmortem generation
Load testing and performance benchmarking with intelligent scenario generation
Comprehensive performance profiling with bottleneck identification and optimization recommendations