Skip to content

SIDDARTHA577/envguard-node / .agents/skills/envguard-mobile-readiness

envguard-mobile-readiness

Verified

Guides comprehensive, evidence-based mobile application readiness assessments for React Native, Expo, Flutter, Native Android (Kotlin/Java), and Native iOS (Swift) aligned with OWASP MASVS v2.0 standards.

FileKindSize
SKILL.mdskill md8.8 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/policies/release-policy.mjs

View on GitHub
/**
 * Release Readiness Policy Framework for EnvGuard.
 * Evaluates assessment findings against explicit, reproducible release gates.
 */
export const POLICY_OUTCOMES = {
  READY_FOR_REVIEW: 'READY FOR HUMAN RELEASE REVIEW',
  BLOCKED: 'BLOCKED',
  INCOMPLETE_ASSESSMENT: 'INCOMPLETE ASSESSMENT',
  MANUAL_REVIEW_REQUIRED: 'MANUAL REVIEW REQUIRED',
};

export const DEFAULT_MANDATORY_CHECKS = [
  'ENV-001', // Environment variable documentation
  'SEC-001', // Secrets and sensitive keys scanning
];

export const DEFAULT_BLOCKING_CATEGORIES = [
  'security',
  'build_test',
];

export const DEFAULT_BLOCKING_SEVERITIES = [
  'critical',
  'high',
];

/**
 * Validates whether an active, unexpired waiver applies to a finding.
 *
 * @param {object} finding
 * @param {Array<object>} waivers
 * @param {Date} [now=new Date()]
 * @returns {{ waived: boolean, waiver?: object, isExpired?: boolean }}
 */
export function checkWaiver(finding, waivers = [], now = new Date()) {
  if (!Array.isArray(waivers) || waivers.length === 0) {
    return { waived: false };
  }

  for (const w of waivers) {
    if (!w || !w.checkId) continue;
    if (w.checkId === finding.id || w.checkId === `${finding.id}::${finding.targetPath || '.'}`) {
      if (w.expiresAt) {
        const expDate = new Date(w.expiresAt);
        if (!isNaN(expDate.getTime()) && expDate.getTime() <= now.getTime()) {
          return { waived: false, waiver: w, isExpired: true };
        }
      }
      return { waived: true, waiver: w, isExpired: false };
    }
  }

  return { waived: false };
}

/**
 * Evaluates assessment findings and determines policy outcome based on explicit,
 * auditable release gates. Never calculates misleading arithmetic percentage scores,
 * and never promotes scanner ERROR, incomplete coverage, or unexecuted tests to READY_FOR_REVIEW.
 *
 * @param {Array<object>} findings
 * @param {object} [summary={}]
 * @param {object} [context={}]
 * @param {string[]} [context.mandatoryChecks]
 * @param {string[]} [context.blockingSeverities]
 * @param {boolean} [context.requireDynamicVerification=false]
 * @param {Array<object>} [context.waivers]
 * @param {boolean} [context.allowExec=false]
 * @param {boolean} [context.incompleteCoverage=false]
 * @param {boolean} [context.verifyMandatoryCheckPresence=false]
 * @returns {{ outcome: string, reasons: string[], gates: object, blockerCount: number, warningCount: number, waiverRecords: Array<object> }}
 */
export function evaluateReleasePolicy(findings = [], summary = {}, context = {}) {
  const reasons = [];
  const waiverRecords = [];
  const blockers = [];
  const now = new Date();

  const mandatoryChecks = new Set(context.mandatoryChecks || DEFAULT_MANDATORY_CHECKS);
  const hasExplicitMandatory = Array.isArray(context.mandatoryChecks) && context.mandatoryChecks.length > 0;
  const blockingSeverities = new Set(context.blockingSeverities || DEFAULT_BLOCKING_SEVERITIES);
  const blockingCategories = new Set(DEFAULT_BLOCKING_CATEGORIES);
  const requireDynamicVerification = Boolean(context.requireDynamicVerification);
  const allowExec = Boolean(context.allowExec);
  const incompleteCoverage = Boolean(context.incompleteCoverage);
  const waivers = Array.isArray(context.waivers) ? context.waivers : [];

  let securityFailures = 0;
  let mandatoryFailures = 0;
  let scannerErrors = 0;

  // 1. Evaluate FAIL and ERROR Findings
  for (const f of findings) {
    if (f.status === 'ERROR') {
      scannerErrors++;
      blockers.push(f);
      reasons.push(`[${f.id}] ${f.title || 'Check Execution Error'} (SCANNER ERROR): ${f.explanation || 'Tool or adapter failed during check execution.'}`);
      continue;
    }

    if (f.status === 'FAIL') {
      const { waived, waiver, isExpired } = checkWaiver(f, waivers, now);

      if (waived) {
        waiverRecords.push({
          checkId: f.id,
          title: f.title,
          category: f.category,
          severity: f.severity,
          reason: waiver.reason || 'Approved technical waiver',
          approver: waiver.approver || 'release-engineer',
          expiresAt: waiver.expiresAt || 'none',
          status: 'ACTIVE_WAIVER',
        });
        continue;
      }

      if (isExpired) {
        waiverRecords.push({
          checkId: f.id,
          title: f.title,
          category: f.category,
          severity: f.severity,
          reason: waiver.reason,
          approver: waiver.approver,
          expiresAt: waiver.expiresAt,
          status: 'EXPIRED_WAIVER',
        });
      }

      const isBlockingSeverity = blockingSeverities.has(f.severity);
      const isBlockingCategory = blockingCategories.has(f.category);
      const isMandatoryCheck = mandatoryChecks.has(f.id);

      if (f.category === 'security') {
        securityFailures++;
      }
      if (isMandatoryCheck) {
        mandatoryFailures++;
      }

      if (isBlockingSeverity || isBlockingCategory || isMandatoryCheck) {
        blockers.push(f);
        const tagParts = [];
        if (f.severity) {
          tagParts.push(`${f.severity.toUpperCase()} BLOCKER`);
        } else {
          tagParts.push('BLOCKER');
        }
        if (isMandatoryCheck) {
          tagParts.push('MANDATORY CHECK');
        }
        const blockerTag = tagParts.join(' / ');
        reasons.push(`[${f.id}] ${f.title} (${blockerTag}): ${f.explanation || 'Check failed'}`);
      }
    }
  }

  // 2. Check Mandatory Checks that are NOT_RUN (or missing when caller specifies explicit mandatory list)
  for (const checkId of mandatoryChecks) {
    const matchingFindings = findings.filter((f) => f.id === checkId);
    if (matchingFindings.length === 0 && hasExplicitMandatory && context.verifyMandatoryCheckPresence) {
      mandatoryFailures++;
      blockers.push({ id: checkId, status: 'NOT_RUN', title: `Missing Mandatory Check (${checkId})` });
      reasons.push(`[${checkId}] Mandatory check "${checkId}" did not run or produced no evidence in report.`);
      continue;
    }

    for (const f of matchingFindings) {
      if (f.status === 'NOT_RUN') {
        blockers.push(f);
        mandatoryFailures++;
        reasons.push(`[${f.id}] Mandatory check "${f.title}" was NOT_RUN and cannot be verified.`);
      }
    }
  }

  // If blockers or scanner errors exist -> BLOCKED
  if (blockers.length > 0) {
    return {
      outcome: POLICY_OUTCOMES.BLOCKED,
      reasons,
      gates: {
        zeroBlockers: false,
        zeroSecurityFailures: securityFailures === 0,
        zeroScannerErrors: scannerErrors === 0,
        mandatoryChecksPassed: mandatoryFailures === 0,
        testExecutionComplete: (summary.fail ?? 0) === 0 && scannerErrors === 0 && (!requireDynamicVerification || allowExec),
        manualReviewsIdentified: (summary.manualReview ?? 0) > 0,
        completeCoverage: !incompleteCoverage,
      },
      blockerCount: blockers.length,
      warningCount: summary.warning ?? 0,
      waiverRecords,
    };
  }

  // 3. Check for Incomplete Assessment (Critical dynamic checks NOT_RUN or incomplete project coverage)
  const dynamicChecksNotRun = findings.filter(
    (f) => f.status === 'NOT_RUN' && (f.id.startsWith('BUILD-') || f.id === 'API-006')
  );

  if (incompleteCoverage || dynamicChecksNotRun.length > 0 || (requireDynamicVerification && !allowExec)) {
    if (incompleteCoverage) {
      reasons.push(
        'Project coverage was incomplete (e.g. empty directory, unrecognized stack, or scanner error). Cannot grant readiness approval.'
      );
    }
    if (dynamicChecksNotRun.length > 0 || (requireDynamicVerification && !allowExec)) {
      reasons.push(
        !allowExec
          ? 'Assessment ran in read-only mode without script execution authorization (--allow-exec). Dynamic build and test execution results could not be verified.'
          : 'One or more build/test verification checks were NOT_RUN (e.g. blocked by containment policy or missing test suite).'
      );
    }
    return {
      outcome: POLICY_OUTCOMES.INCOMPLETE_ASSESSMENT,
      reasons,
      gates: {
        zeroBlockers: true,
        zeroSecurityFailures: true,
        zeroScannerErrors: true,
        mandatoryChecksPassed: true,
        testExecutionComplete: dynamicChecksNotRun.length === 0 && (!requireDynamicVerification || allowExec),
        manualReviewsIdentified: (summary.manualReview ?? 0) > 0,
        completeCoverage: !incompleteCoverage,
      },
      blockerCount: 0,
      warningCount: summary.warning ?? 0,
      waiverRecords,
    };
  }

  // 4. Check for Manual Review Items
  const manualReviews = findings.filter((f) => f.status === 'MANUAL_REVIEW');
  if (manualReviews.length > 0) {
    for (const m of manualReviews) {
      reasons.push(`[${m.id}] ${m.title} requires human engineering sign-off.`);
    }
    return {
      outcome: POLICY_OUTCOMES.MANUAL_REVIEW_REQUIRED,
      reasons,
      gates: {
        zeroBlockers: true,
        zeroSecurityFailures: true,
        zeroScannerErrors: true,
        mandatoryChecksPassed: true,
        testExecutionComplete: true,
        manualReviewsIdentified: true,
        completeCoverage: true,
      },
      blockerCount: 0,
      warningCount: summary.warning ?? 0,
      waiverRecords,
    };
  }

  // 5. All Gates Passed Cleanly
  reasons.push('All applicable automated checks passed with zero blockers.');
  return {
    outcome: POLICY_OUTCOMES.READY_FOR_REVIEW,
    reasons,
    gates: {
      zeroBlockers: true,
      zeroSecurityFailures: true,
      zeroScannerErrors: true,
      mandatoryChecksPassed: true,
      testExecutionComplete: true,
      manualReviewsIdentified: false,
      completeCoverage: true,
    },
    blockerCount: 0,
    warningCount: summary.warning ?? 0,
    waiverRecords,
  };
}
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall