SIDDARTHA577/envguard-node / .agents/skills/envguard-load-test
envguard-load-test
VerifiedGuides capacity planning, workload profile design, local performance benchmarking, and threshold validation without fabricating production metrics or executing unauthorized traffic.
scripts/readiness/adapters/base-adapter.mjs
View on GitHub/**
* Versioned Base Adapter Contract for EnvGuard Multi-Platform Assessment Engine.
*/
export class BaseAdapter {
/**
* @param {object} config
* @param {string} config.id - Unique identifier for the adapter (e.g. 'generic', 'node-typescript', 'nextjs-react')
* @param {string} config.name - Human-readable name
* @param {string} config.version - Semantic version of the adapter contract
* @param {string} [config.description=''] - Summary of adapter assessment scope
* @param {string[]} [config.supportedLanguages] - List of supported languages
* @param {string[]} [config.supportedFrameworks] - List of supported frameworks
* @param {string[]} [config.requiredTools] - External tools required (e.g. ['git', 'node'])
*/
constructor({
id,
name,
version,
description = '',
supportedLanguages = [],
supportedFrameworks = [],
requiredTools = [],
}) {
if (!id || typeof id !== 'string') {
throw new Error('BaseAdapter requires a non-empty string id');
}
if (!name || typeof name !== 'string') {
throw new Error('BaseAdapter requires a non-empty string name');
}
if (!version || typeof version !== 'string') {
throw new Error('BaseAdapter requires a semantic version string');
}
this.id = id;
this.name = name;
this.version = version;
this.description = description;
this.supportedLanguages = supportedLanguages;
this.supportedFrameworks = supportedFrameworks;
this.requiredTools = requiredTools;
}
/**
* Evaluates if this adapter applies to a target application node in the inventory graph.
* @param {object} _target - Target application node from inventory graph
* @param {object} _context - { projectDir, files, inventory, config }
* @returns {{ matched: boolean, confidence: number, reason: string, metadata?: object }}
*/
detect(_target, _context) {
throw new Error(`detect() not implemented in adapter "${this.id}"`);
}
/**
* Returns list of capabilities supported by this adapter.
* @returns {string[]}
*/
getCapabilities() {
return [];
}
/**
* Returns list of check descriptors applicable to this target.
* @param {object} _target - Target application node
* @param {object} _context - Global assessment context
* @returns {Array<{ id: string, name: string, category: string, description?: string, required?: boolean }>}
*/
getApplicableChecks(_target, _context) {
return [];
}
/**
* Executes static checks for the target.
* @param {object} _target - Target application node
* @param {object} _context - Global assessment context
* @returns {Array<any>}
*/
runStaticChecks(_target, _context) {
return [];
}
/**
* Executes dynamic checks for the target (requires authorized runner).
* @param {object} _target - Target application node
* @param {object} _context - Global assessment context
* @param {Function} _execRunner - Authorized execution runner
* @returns {Array<any>}
*/
runDynamicChecks(_target, _context, _execRunner) {
return [];
}
/**
* Returns known limitations of this adapter.
* @returns {string[]}
*/
getLimitations() {
return [];
}
/**
* Helper to format a standardized finding object conforming to catalog/readiness-report.schema.json.
*
* @param {object} params
* @param {string} params.id
* @param {string} [params.checkId]
* @param {string} params.category
* @param {string} params.status
* @param {string} [params.severity='info']
* @param {string} params.title
* @param {string} [params.explanation='']
* @param {any} [params.evidence=null]
* @param {string} [params.checkMethod='static_analysis']
* @param {string} [params.recommendation='']
* @param {boolean} [params.manualVerificationRequired=false]
* @param {string} [params.confidence='verified_fact']
* @param {string} [params.targetPath='.']
* @returns {any}
*/
createFinding({
id,
checkId = undefined,
category,
status,
severity = 'info',
title,
explanation = '',
evidence = null,
checkMethod = 'static_analysis',
recommendation = '',
manualVerificationRequired = false,
confidence = 'verified_fact',
targetPath = '.',
}) {
return {
id,
checkId: checkId || id,
toolName: `envguard-adapter-${this.id}`,
toolVersion: this.version,
adapterId: this.id,
targetPath,
category,
status,
severity,
title,
explanation,
evidence,
checkMethod,
recommendation,
manualVerificationRequired,
confidence,
};
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| 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: 197k | Updated | Claude CodeCodex | Verified | Install |