Skip to content

SIDDARTHA577/envguard-node / .agents/skills/envguard-load-test

envguard-load-test

Verified

Guides capacity planning, workload profile design, local performance benchmarking, and threshold validation without fabricating production metrics or executing unauthorized traffic.

FileKindSize
SKILL.mdskill md7.7 KB
scripts/readiness-auditor.mjsscript27.1 KB
scripts/readiness/adapters/android-adapter.mjsscript30.0 KB
scripts/readiness/adapters/base-adapter.mjsscript4.6 KB
scripts/readiness/adapters/flutter-adapter.mjsscript28.9 KB
scripts/readiness/adapters/generic-adapter.mjsscript15.9 KB
scripts/readiness/adapters/index.mjsscript661 B
scripts/readiness/adapters/ios-adapter.mjsscript21.0 KB
scripts/readiness/adapters/java-spring-adapter.mjsscript39.9 KB
scripts/readiness/adapters/nextjs-react-adapter.mjsscript30.5 KB
scripts/readiness/adapters/node-typescript-adapter.mjsscript115.8 KB
scripts/readiness/adapters/python-adapter.mjsscript44.0 KB
scripts/readiness/adapters/react-native-adapter.mjsscript34.6 KB
scripts/readiness/adapters/registry.mjsscript3.7 KB
scripts/readiness/architecture/applicability.mjsscript21.8 KB
scripts/readiness/architecture/architecture-inventory.mjsscript16.9 KB
scripts/readiness/architecture/architecture-reporter.mjsscript9.4 KB
scripts/readiness/architecture/capacity-model.mjsscript16.9 KB
scripts/readiness/architecture/design-decisions.mjsscript42.0 KB
scripts/readiness/architecture/failure-modes.mjsscript13.3 KB
scripts/readiness/architecture/index.mjsscript895 B
scripts/readiness/architecture/requirements.mjsscript22.0 KB
scripts/readiness/architecture/tradeoffs.mjsscript4.5 KB
scripts/readiness/capacity/benchmark-runner.mjsscript13.4 KB
scripts/readiness/constants.mjsscript6.0 KB
scripts/readiness/deployment/cicd-gate-validator.mjsscript6.1 KB
scripts/readiness/deployment/container-validator.mjsscript10.1 KB
scripts/readiness/deployment/deployment-gate.mjsscript4.8 KB
scripts/readiness/deployment/index.mjsscript411 B
scripts/readiness/deployment/k8s-validator.mjsscript8.8 KB
scripts/readiness/deployment/reliability-validator.mjsscript9.4 KB
scripts/readiness/engine/discovery.mjsscript15.4 KB
scripts/readiness/engine/index.mjsscript341 B
scripts/readiness/engine/orchestrator.mjsscript21.0 KB
scripts/readiness/engine/planner.mjsscript4.2 KB
scripts/readiness/engine/sarif.mjsscript12.7 KB
scripts/readiness/engine/skills-selector.mjsscript10.0 KB
scripts/readiness/execution/git.mjsscript2.3 KB
scripts/readiness/execution/runner.mjsscript11.9 KB
scripts/readiness/index.mjsscript516 B
scripts/readiness/orchestration/engineering-workflow.mjsscript18.5 KB
scripts/readiness/orchestration/index.mjsscript170 B
scripts/readiness/policies/index.mjsscript189 B
scripts/readiness/policies/release-policy.mjsscript9.5 KB
scripts/readiness/remediation/checkpoint-manager.mjsscript34.0 KB
scripts/readiness/remediation/diff-viewer.mjsscript2.5 KB
scripts/readiness/remediation/index.mjsscript778 B
scripts/readiness/remediation/patch-generator.mjsscript17.5 KB
scripts/readiness/remediation/remediation-runner.mjsscript9.9 KB
scripts/readiness/reporters/comparator.mjsscript20.7 KB
scripts/readiness/reporters/index.mjsscript293 B
scripts/readiness/reporters/json-reporter.mjsscript193 B
scripts/readiness/reporters/markdown-reporter.mjsscript18.8 KB
scripts/readiness/validation/evidence-matrix.mjsscript21.5 KB
scripts/readiness/validation/independent-app-runner.mjsscript26.2 KB
scripts/readiness/validation/index.mjsscript328 B

scripts/readiness/deployment/cicd-gate-validator.mjs

View on GitHub
import fs from 'node:fs';
import path from 'node:path';

/**
 * Validates CI/CD deployment pipelines for safe release gates, environment protection,
 * secret isolation, and pre-deployment verification dependencies.
 *
 * @param {string} projectDir - Root project directory
 * @param {string[]} [files=[]] - Relative project files list
 * @returns {object[]} Array of CI/CD deployment findings
 */
export function validateCicdDeploymentGates(projectDir, files = []) {
  const findings = [];

  const workflowFiles = files.filter((f) => {
    const lower = f.toLowerCase().replace(/\\/g, '/');
    return (
      lower.startsWith('.github/workflows/') ||
      lower === '.gitlab-ci.yml' ||
      lower.endsWith('jenkinsfile') ||
      lower === '.circleci/config.yml' ||
      lower === 'bitbucket-pipelines.yml'
    );
  });

  if (workflowFiles.length === 0) {
    findings.push({
      id: 'DEP-CICD-000',
      category: 'deployment',
      status: 'WARNING',
      severity: 'medium',
      title: 'Missing Continuous Integration & Deployment Pipeline',
      explanation: 'No CI/CD pipeline definitions (.github/workflows, .gitlab-ci.yml) detected in repository.',
      evidence: { file: null },
      checkMethod: 'static_analysis',
      recommendation: 'Configure an automated CI workflow to enforce testing, linting, and security audits before releases.',
      manualVerificationRequired: false,
      confidence: 'verified_fact',
    });
    return findings;
  }

  let hasDeploymentJob = false;
  let hasEnvironmentGate = false;
  let hasTestDependency = false;

  for (const relPath of workflowFiles) {
    const fullPath = path.join(projectDir, relPath);
    let content;
    try {
      content = fs.readFileSync(fullPath, 'utf8');
    } catch {
      continue;
    }

    const lines = content.split('\n');

    // 1. Check for Deployment Job & Environment Protection (DEP-CICD-001)
    const isDeployWorkflow =
      content.includes('deploy') ||
      content.includes('release') ||
      content.includes('publish') ||
      content.includes('kubectl') ||
      content.includes('helm');

    if (isDeployWorkflow) {
      hasDeploymentJob = true;
      if (content.includes('environment:') || content.includes('rules: manual') || content.includes('when: manual')) {
        hasEnvironmentGate = true;
      }
      if (content.includes('needs:') && (content.includes('test') || content.includes('build') || content.includes('lint'))) {
        hasTestDependency = true;
      }
    }

    // 2. Secret Hygiene in Workflows (DEP-CICD-002)
    const rawSecretPattern = /(?:api[_-]?key|secret|token|password)\s*[:=]\s*["']([^"${}]{8,})["']/i;
    for (let i = 0; i < lines.length; i++) {
      const match = lines[i].match(rawSecretPattern);
      if (match && !match[1].startsWith('$') && !match[1].includes('placeholder')) {
        findings.push({
          id: 'DEP-CICD-002',
          category: 'security',
          status: 'FAIL',
          severity: 'critical',
          title: `Hardcoded Credential in CI Workflow "${relPath}"`,
          explanation: `Line ${i + 1} appears to contain a literal token or credential. Workflow files are accessible to collaborators and may leak credentials in logs.`,
          evidence: { file: relPath, line: i + 1 },
          checkMethod: 'static_analysis',
          recommendation: 'Store credentials in repository secrets and reference via ${{ secrets.NAME }}.',
          manualVerificationRequired: false,
          confidence: 'verified_fact',
        });
      }
    }
  }

  if (hasDeploymentJob) {
    if (hasEnvironmentGate) {
      findings.push({
        id: 'DEP-CICD-001',
        category: 'deployment',
        status: 'PASS',
        severity: 'info',
        title: 'CI/CD Deployment Job Guarded by Protected Environment Gate',
        explanation: 'Deployment steps configure explicit environment boundaries or manual approval checkpoints.',
        evidence: { workflowCount: workflowFiles.length },
        checkMethod: 'static_analysis',
        recommendation: 'Maintain required reviewer approvals on production environment targets.',
        manualVerificationRequired: false,
        confidence: 'verified_fact',
      });
    } else {
      findings.push({
        id: 'DEP-CICD-001',
        category: 'deployment',
        status: 'WARNING',
        severity: 'high',
        title: 'Unguarded Continuous Deployment Workflow',
        explanation: 'Deployment jobs detected without explicit environment protection gates or approval requirements. Changes pushed to the branch may deploy to production automatically without review.',
        evidence: { workflowCount: workflowFiles.length },
        checkMethod: 'static_analysis',
        recommendation: 'Add "environment: production" with required review gates in GitHub repository settings.',
        manualVerificationRequired: false,
        confidence: 'verified_fact',
      });
    }

    if (hasTestDependency) {
      findings.push({
        id: 'DEP-CICD-003',
        category: 'deployment',
        status: 'PASS',
        severity: 'info',
        title: 'CI/CD Deployment Dependent on Successful Test Pipeline',
        explanation: 'Deployment jobs require successful completion of test/build stages ("needs: [test]").',
        evidence: { workflowCount: workflowFiles.length },
        checkMethod: 'static_analysis',
        recommendation: 'Ensure all required CI checks are marked mandatory in branch protection rules.',
        manualVerificationRequired: false,
        confidence: 'verified_fact',
      });
    } else {
      findings.push({
        id: 'DEP-CICD-003',
        category: 'deployment',
        status: 'WARNING',
        severity: 'high',
        title: 'Deployment Job Does Not Explicitly Depend on Test Completion',
        explanation: 'Deployment job does not declare "needs: [test]". Defective builds or failed test runs might not block deployment.',
        evidence: { workflowCount: workflowFiles.length },
        checkMethod: 'static_analysis',
        recommendation: 'Add "needs: [test, build]" to deployment jobs.',
        manualVerificationRequired: false,
        confidence: 'verified_fact',
      });
    }
  }

  return findings;
}
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall