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/constants.mjs

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

export const TOOL_VERSION = '1.0.0';
export const REPORT_SCHEMA_VERSION = '1.1.0';

export const EXIT_CODES = {
  SUCCESS: 0,
  SUCCESS_NO_BLOCKERS: 0,
  TOOL_ERROR: 1,
  POLICY_BLOCKERS: 2,
  INVALID_ARGUMENTS: 3,
  INCOMPLETE_EXECUTION: 4,
};

export const VALID_CATEGORIES = [
  'discovery',
  'env',
  'build_test',
  'security',
  'api',
  'database',
  'deployment',
  'accessibility',
  'performance',
];

export const VALID_STATUSES = [
  'PASS',
  'FAIL',
  'WARNING',
  'INFORMATIONAL',
  'NOT_RUN',
  'MANUAL_REVIEW',
  'NOT_APPLICABLE',
  'ERROR',
];

/**
 * Granular verification states distinguishing dependency declaration from actual execution.
 */
export const TEST_VERIFICATION_STATES = {
  FRAMEWORK_DECLARED: 'FRAMEWORK_DECLARED',
  RUNNER_AVAILABLE: 'RUNNER_AVAILABLE',
  TEST_FILES_FOUND: 'TEST_FILES_FOUND',
  TEST_EXECUTED: 'TEST_EXECUTED',
  TESTS_PASSED: 'TESTS_PASSED',
  TESTS_FAILED: 'TESTS_FAILED',
  NOT_RUN: 'NOT_RUN',
  MANUAL_REVIEW: 'MANUAL_REVIEW',
};

export const VALID_FORMATS = ['json', 'markdown', 'both'];

export const IGNORED_DIRECTORIES = new Set([
  'node_modules',
  '.git',
  '.svn',
  '.hg',
  'dist',
  'build',
  'out',
  '.next',
  '.turbo',
  '.nuxt',
  '.output',
  'coverage',
  '.nyc_output',
  'vendor',
  '.venv',
  'venv',
  '__pycache__',
]);

/**
 * Strips ANSI terminal escape codes from output strings.
 */
export function stripAnsi(str) {
  if (typeof str !== 'string') return '';
  // eslint-disable-next-line no-control-regex
  return str.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, '');
}

/**
 * Sanitizes command output and error messages to prevent accidental secret leakage.
 * Redacts tokens, passwords, database URLs, and private keys.
 */
export function sanitizeOutput(str) {
  if (typeof str !== 'string') return '';
  let cleaned = stripAnsi(str);
  // Redact specific known key prefixes first
  cleaned = cleaned.replace(/(Bearer\s+)[A-Za-z0-9\-._~+/]+=*/gi, '$1[REDACTED]');
  cleaned = cleaned.replace(/(ghp_[A-Za-z0-9_]{20,})/gi, '[REDACTED_GH_TOKEN]');
  cleaned = cleaned.replace(/(sk_live_[A-Za-z0-9_]{16,})/gi, '[REDACTED_STRIPE_KEY]');
  cleaned = cleaned.replace(/(AKIA[0-9A-Z]{16})/gi, '[REDACTED_AWS_KEY]');
  cleaned = cleaned.replace(/(xox[baprs]-[A-Za-z0-9-]{10,})/gi, '[REDACTED_SLACK_TOKEN]');
  cleaned = cleaned.replace(/(postgres|postgresql|mysql|mongodb(?:\+srv)?):\/\/[^:\s@]+:[^@\s]+@/gi, '$1://[REDACTED_CREDS]@');
  // Redact generic key=value pairs, ignoring already redacted values
  cleaned = cleaned.replace(/((?:password|secret|token|api_key|auth)\s*[:=]\s*['"]?)(?!\[REDACTED)[^'"\s,]+/gi, '$1[REDACTED]');
  return cleaned;
}

/**
 * Escapes markdown-sensitive characters in strings to avoid formatting corruption.
 */
export function escapeMarkdown(str) {
  if (typeof str !== 'string') return '';
  return str
    .replace(/\\/g, '\\\\')
    .replace(/\|/g, '\\|')
    .replace(/`/g, '\\`')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;');
}

/**
 * Validates and normalizes project directory path.
 * Rejects traversal and null byte injections.
 */
export function assertSafeProjectDir(targetDir) {
  if (!targetDir || typeof targetDir !== 'string') {
    throw new Error('Project path must be a non-empty string.');
  }
  if (targetDir.includes('\0')) {
    throw new Error('Invalid project path: contains null byte.');
  }

  const resolved = path.resolve(targetDir);
  if (!fs.existsSync(resolved)) {
    throw new Error(`Project directory does not exist: "${targetDir}"`);
  }

  const stat = fs.statSync(resolved);
  if (!stat.isDirectory()) {
    throw new Error(`Project path is not a directory: "${targetDir}"`);
  }

  try {
    const real = fs.realpathSync.native(resolved);
    return real;
  } catch {
    return resolved;
  }
}

/**
 * Validates that an output directory is safe to write reports into.
 */
export function assertSafeOutputDir(outputDir) {
  if (!outputDir || typeof outputDir !== 'string') {
    throw new Error('Output directory path must be a non-empty string.');
  }
  if (outputDir.includes('\0')) {
    throw new Error('Invalid output directory: contains null byte.');
  }

  const resolved = path.resolve(outputDir);
  const root = path.parse(resolved).root;
  if (resolved === root || resolved === path.join(root, 'Windows') || resolved === '/etc') {
    throw new Error(`Refusing to write assessment reports to system directory: "${resolved}"`);
  }

  return resolved;
}

/**
 * Recursively scans directory collecting relative paths up to a bounded depth and count.
 */
export function collectProjectFiles(projectDir, { maxFiles = 2000, maxDepth = 8 } = {}) {
  const files = [];

  function walk(currentDir, currentDepth) {
    if (currentDepth > maxDepth || files.length >= maxFiles) return;

    let entries;
    try {
      entries = fs.readdirSync(currentDir, { withFileTypes: true });
    } catch {
      return;
    }

    for (const entry of entries) {
      if (files.length >= maxFiles) break;

      const name = entry.name;
      if (IGNORED_DIRECTORIES.has(name)) continue;

      const fullPath = path.join(currentDir, name);
      const relPath = path.relative(projectDir, fullPath).replace(/\\/g, '/');

      if (entry.isDirectory()) {
        walk(fullPath, currentDepth + 1);
      } else if (entry.isFile()) {
        files.push(relPath);
      }
    }
  }

  walk(projectDir, 0);
  return files;
}

/**
 * Safe fallback parser for YAML OpenAPI specifications without external dependencies.
 */
export function parseYamlFallback(raw) {
  const lines = raw.split('\n');
  const result = {};

  for (const rawLine of lines) {
    const line = rawLine.trim();
    if (!line || line.startsWith('#')) continue;

    const kvMatch = line.match(/^([a-zA-Z0-9_-]+)\s*:\s*(.*)$/);
    if (kvMatch) {
      const key = kvMatch[1];
      let val = kvMatch[2].trim();
      if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'"))) {
        val = val.slice(1, -1);
      }
      result[key] = val || {};
    }
  }

  return result;
}
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: 197kUpdated Claude CodeCodexVerifiedInstall