Skip to content
Back to search

agent-skills

112 reusable Agent Skills for AI coding assistants. Each skill provides specialized knowledge and workflows that extend agent capabilities.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jwynia-agent-skills/badge.svg)](/listings/jwynia-agent-skills)

HTML

<a href="/listings/jwynia-agent-skills"><img src="/api/listings/jwynia-agent-skills/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Use `npx skills add` to install skills:

Browse by Category

Skills are organized into three top-level categories for easy filtering:

# Creative/narrative skills (~57 skills)
npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/creative

# Technical/development skills (~26 skills)
npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/tech

# General utilities (~29 skills)
npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/general

Install a Single Skill

npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/general/meta/skill-builder

Browse All Skills

npx skills add https://github.com/jwynia/agent-skills/tree/main/skills

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 283 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # Agent Skills Collection
  2. **112 reusable [Agent Skills](https://agentskills.io)** for AI coding assistants. Each skill provides specialized knowledge and workflows that extend agent capabilities.
  3. ## Installing Skills
  4. Use `npx skills add` to install skills:
  5. ### Browse by Category
  6. Skills are organized into three top-level categories for easy filtering:
  7. ```bash
  8. # Creative/narrative skills (~57 skills)
  9. npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/creative
  10. # Technical/development skills (~26 skills)
  11. npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/tech
  12. # General utilities (~29 skills)
  13. npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/general
  14. ```
  15. ### Install a Single Skill
  16. ```bash
  17. npx skills add https://github.com/jwynia/agent-skills/tree/main/skills/general/meta/skill-builder
  18. ```
  19. ### Browse All Skills
  20. ```bash
  21. npx skills add https://github.com/jwynia/agent-skills/tree/main/skills
  22. ```
  23. ## Available Skills (112 total)
  24. ### Creative (57 skills)
  25. Story/narrative focused skills for fiction writing, worldbuilding, and creative work.
  26. #### Fiction - Core & Craft (10)
  27. Core diagnostics, writing partnerships, and sentence-level craft:
  28. - **story-sense** - Diagnose what any story needs regardless of current state
  29. - **story-coach** - Assistive writing guidance (guides but never writes)
  30. - **story-collaborator** - Active writing partnership (contributes prose alongside writer)
  31. - **story-analysis** - Systematically evaluate completed stories or chapters
  32. - **story-idea-generator** - Genre-first story concept generation
  33. - **prose-style** - Sentence-level craft diagnostics
  34. - **revision** - Edit pass guidance when revision feels overwhelming
  35. - **drafting** - First draft execution and block-breaking
  36. - **cliche-transcendence** - Transform predictable story elements into fresh versions
  37. - **genre-conventions** - Genre diagnostics and genre-specific element generation
  38. #### Fiction - Character (6)
  39. Character development, dialogue, and distinctive character creation:
  40. - **character-arc** - Character transformation arc design and troubleshooting
  41. - **character-naming** - Break LLM name defaults with external entropy
  42. - **dialogue** - Dialogue diagnostics for flat or same-voice characters
  43. - **memetic-depth** - Create perception of cultural depth through juxtaposition
  44. - **statistical-distance** - Transform clichéd elements by pushing toward statistical edges
  45. - **underdog-unit** - Stories about institutional outcasts given impossible mandates
  46. #### Fiction - Structure (12)
  47. Pacing, scene structure, outlines, and multi-level story management:
  48. - **scene-sequencing** - Pacing and scene-sequel rhythm
  49. - **endings** - Resolution diagnostics for weak or rushed endings
  50. - **key-moments** - Structure stories around essential emotional moments
  51. - **story-zoom** - Multi-level story synchronization across abstraction levels
  52. - **outline-coach** - Assistive outline coaching through questions
  53. - **outline-collaborator** - Active outline partnership
  54. - **reverse-outliner** - Reverse-engineer published books into structured outlines
  55. - **novel-revision** - Multi-level novel revision without cascade problems
  56. - **identity-denial** - Stories about protagonists refusing self-transformation
  57. - **moral-parallax** - Stories about systemic exploitation and moral distance
  58. - **perspectival-constellation** - Multi-POV stories through catalyst environments
  59. - **positional-revelation** - Stories about ordinary people becoming crucial through position
  60. #### Fiction - Worldbuilding (11)
  61. World-level systems, cultures, languages, and shared continuity:
  62. - **worldbuilding** - World-level story diagnostics
  63. - **systemic-worldbuilding** - Cascading consequences from speculative changes
  64. - **oblique-worldbuilding** - Worldbuilding quotes and epigraphs via documentary perspectives
  65. - **belief-systems** - Religious and belief system design
  66. - **economic-systems** - Currencies, trade networks, and resource economies
  67. - **governance-systems** - Political entities and governance structures
  68. - **settlement-design** - Cities, towns, and settlement design
  69. - **conlang** - Phonologically consistent constructed languages
  70. - **language-evolution** - Evolving language systems and linguistic history
  71. - **metabolic-cultures** - Cultures for closed-loop life support systems
  72. - **world-fates** - Long-term fate and fortune across shared worlds
  73. #### Fiction - Application (14)
  74. Specialized generators, adaptation tools, and applied storytelling:
  75. - **adaptation-synthesis** - Synthesize new works from extracted functional DNA
  76. - **dna-extraction** - Extract functional DNA from existing works (TV, film, books)
  77. - **media-adaptation** - Analyze existing media for transferable elements
  78. - **book-marketing** - Marketing copy diagnostics and platform-optimized blurbs
  79. - **chapter-drafter** - Autonomous chapter drafting with multi-skill editorial passes
  80. - **flash-fiction** - Flash fiction and micro fiction diagnostics
  81. - **interactive-fiction** - Branching narrative diagnostics
  82. - **game-facilitator** - Narrative RPG game master for collaborative storytelling
  83. - **table-tone** - Tonal delivery calibration for tabletop RPG sessions
  84. - **list-builder** - Comprehensive randomization lists for creative entropy
  85. - **multi-order-evolution** - Multi-generational societal evolution for sci-fi
  86. - **paradox-fables** - Fables embodying paradoxical wisdom
  87. - **sensitivity-check** - Representation evaluation and harm flagging
  88. - **shared-world** - Wiki-style world bible for collaborative fiction
  89. - **sleep-story** - Stories designed to help listeners fall asleep
  90. #### Humor (1)
  91. - **joke-engineering** - Humor diagnostics and improvement
  92. #### Music (2)
  93. - **lyric-diagnostic** - Song lyric analysis and improvement
  94. - **musical-dna** - Extract musical characteristics from artists
  95. ---
  96. ### Tech (26 skills)
  97. Technical and development focused skills.
  98. #### AI (1)
  99. - **mastra-hono** - Mastra AI framework with Hono integration
  100. #### Development (14)
  101. - **agile-coordinator** - Multi-agent task orchestration (git-only, platform-agnostic)
  102. - **agile-workflow** - Agile development workflow (git-only, platform-agnostic)
  103. - **architecture-decision** - ADR creation and trade-off analysis
  104. - **code-review** - Structured code review guidance
  105. - **devcontainer** - Development container configuration
  106. - **electron-best-practices** - Electron + React desktop app development best practices
  107. - **gitea-coordinator** - Multi-agent task orchestration for Gitea
  108. - **gitea-workflow** - Agile workflow for Gitea with tea CLI
  109. - **github-agile** - GitHub-driven agile workflows
  110. - **product-analysis** - Competitive product analysis and market evaluation
  111. - **requirements-analysis** - Requirements discovery and documentation
  112. - **system-design** - Software architecture and design
  113. - **task-decomposition** - Break down development tasks
  114. - **typescript-best-practices** - TypeScript patterns and practices
  115. #### Frontend (4)
  116. - **frontend-design** - UI/UX design patterns
  117. - **pwa-development** - PWA implementation (React/Svelte)
  118. - **react-pwa** - Progressive Web Apps with React
  119. - **shadcn-layouts** - Tailwind/shadcn layout patterns
  120. #### Game Development (3)
  121. - **abstract-strategy** - Board game design
  122. - **godot-asset-generator** - AI asset generation for Godot
  123. - **godot-best-practices** - Godot engine best practices
  124. #### Security (4)
  125. - **config-scan** - Configuration security scanning
  126. - **dependency-scan** - Dependency vulnerability scanning
  127. - **secrets-scan** - Secrets detection
  128. - **security-scan** - General security scanning
  129. ---
  130. ### General (29 skills)
  131. Universal utility skills for research, documents, and productivity.
  132. #### Analysis (1)
  133. - **technology-impact** - McLuhan's Tetrad analysis for technology impacts
  134. #### Communication (2)
  135. - **presentation-design** - Design effective presentations and slides
  136. - **speech-adaptation** - Transform written content for spoken delivery
  137. #### Document Processing (7)
  138. - **docx-generator** - Word document generation
  139. - **document-to-narration** - Convert documents to narrated video scripts with TTS audio
  140. - **ebook-analysis** - Parse ebooks and extract concepts
  141. - **pdf-generator** - PDF document generation
  142. - **pptx-generator** - PowerPoint presentation generation
  143. - **revealjs-presenter** - RevealJS presentation generation
  144. - **xlsx-generator** - Excel spreadsheet generation
  145. #### Education (2)
  146. - **competency** - Competency framework development
  147. - **gentle-teaching** - AI-assisted learning guidance
  148. #### Ideation (2)
  149. - **brainstorming** - Idea expansion and divergent thinking
  150. - **naming** - Brand, product, and character naming
  151. #### Meta (3)
  152. - **context-network** - Build and maintain context networks
  153. - **context-retrospective** - Analyze agent interactions for improvements
  154. - **skill-builder** - Create new agent skills
  155. #### Productivity (1)
  156. - **task-breakdown** - Neurodivergent-friendly task decomposition
  157. #### Research (7)
  158. - **claim-investigation** - Investigate social media claims
  159. - **fact-check** - Verify claims against sources
  160. - **media-meta-analysis** - Media analysis methodology
  161. - **research** - Research quality diagnostics
  162. - **research-workflow** - Structured research methodology
  163. - **web-search** - Built-in web search (no API key required)
  164. - **web-search-tavily** - Advanced Tavily search with filtering and scoring
  165. #### Writing (4)
  166. - **blind-spot-detective** - Identify gaps in non-fiction writing
  167. - **non-fiction-revision** - Non-fiction book revision
  168. - **summarization** - Effective summarization techniques
  169. - **voice-analysis** - Extract and document writing voice
  170. ## Project Structure
  171. ```
  172. skills/ # 112 skills in main tree
  173. ├── creative/ # 57 skills - Story/narrative focus
  174. │ ├── fiction/ # 54 skills
  175. │ │ ├── application/
  176. │ │ ├── character/
  177. │ │ ├── core/
  178. │ │ ├── craft/
  179. │ │ ├── orchestrators/
  180. │ │ ├── structure/
  181. │ │ └── worldbuilding/
  182. │ ├── humor/
  183. │ └── music/
  184. │
  185. ├── tech/ # 25 skills - Technical/development
  186. │ ├── ai/
  187. │ ├── development/
  188. │ │ ├── architecture/
  189. │ │ ├── quality/
  190. │ │ ├── tooling/
  191. │ │ └── workflow/
  192. │ ├── frontend/
  193. │ │ ├── design/
  194. │ │ └── pwa/
  195. │ ├── game-development/
  196. │ │ ├── design/
  197. │ │ └── godot/
  198. │ └── security/
  199. │
  200. ├── general/ # 28 skills - Universal utilities
  201. │ ├── analysis/
  202. │ ├── communication/
  203. │ ├── document-processing/
  204. │ │ ├── analysis/
  205. │ │ ├── pdf/
  206. │ │ ├── presentation/
  207. │ │ ├── spreadsheet/
  208. │ │ └── word/
  209. │ ├── education/
  210. │ ├── ideation/
  211. │ ├── meta/
  212. │ ├── productivity/
  213. │ ├── research/
  214. │ │ ├── methodology/
  215. │ │ ├── tools/
  216. │ │ └── verification/
  217. │ └── writing/
  218. │ ├── analysis/
  219. │ └── revision/
  220. │
  221. ├── development/ # 1 skill - Standalone development
  222. │ └── architecture/
  223. │
  224. └── education/ # 1 skill - Standalone education
  225. reference/ # agentskills.io spec and validation tools
  226. context-network/ # Planning and coordination docs
  227. ```
  228. ## Contributing
  229. See `context-network/processes/creation.md` for the skill creation workflow.
  230. Quick start:
  231. 1. Plan in `context-network/elements/skills/`
  232. 2. Create skill in `skills/[creative|tech|general]/[domain]/[skill-name]/`
  233. 3. Validate with `skills-ref validate ./skills/path/to/skill`
  234. ## References
  235. - [Agent Skills Specification](https://agentskills.io)
  236. - [skills-ref Validation Tool](reference/agentskills/skills-ref/)
skills/tech/development/tooling/devcontainer/scripts/scan-image.ts · Bundled script · 342 lines · 2 findings marked
  1. #!/usr/bin/env -S deno run --allow-run --allow-net
  2. /**
  3. * Container Image Security Scanner
  4. *
  5. * Wraps Trivy for vulnerability scanning of container images.
  6. * Provides human-readable output with remediation suggestions.
  7. *
  8. * Usage:
  9. * deno run --allow-run --allow-net scripts/scan-image.ts <image-name>
  10. *
  11. * Examples:
  12. * deno run --allow-run --allow-net scripts/scan-image.ts node:20-slim
  13. * deno run --allow-run --allow-net scripts/scan-image.ts mcr.microsoft.com/devcontainers/base:ubuntu
  14. *
  15. * Requires Trivy to be installed:
  16. * brew install trivy
  17. * # or
  18. * curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 19 on GitHub
  19. */
  20. interface Vulnerability {
  21. VulnerabilityID: string;
  22. PkgName: string;
  23. InstalledVersion: string;
  24. FixedVersion?: string;
  25. Severity: string;
  26. Title?: string;
  27. Description?: string;
  28. PrimaryURL?: string;
  29. }
  30. interface ScanResult {
  31. Target: string;
  32. Type: string;
  33. Vulnerabilities?: Vulnerability[];
  34. }
  35. interface TrivyOutput {
  36. Results?: ScanResult[];
  37. }
  38. const SEVERITY_ORDER = ["CRITICAL", "HIGH", "MEDIUM", "LOW", "UNKNOWN"];
  39. const SEVERITY_EMOJI: Record<string, string> = {
  40. CRITICAL: "🔴",
  41. HIGH: "🟠",
  42. MEDIUM: "🟡",
  43. LOW: "🔵",
  44. UNKNOWN: "⚪",
  45. };
  46. async function checkTrivyInstalled(): Promise<boolean> {
  47. try {
  48. const command = new Deno.Command("trivy", {
  49. args: ["--version"],
  50. stdout: "null",
  51. stderr: "null",
  52. });
  53. const { code } = await command.output();
  54. return code === 0;
  55. } catch {
  56. return false;
  57. }
  58. }
  59. async function scanImage(imageName: string): Promise<TrivyOutput | null> {
  60. console.log(`\n🔍 Scanning image: ${imageName}\n`);
  61. console.log("This may take a moment for first scan (downloading vulnerability database)...\n");
  62. try {
  63. const command = new Deno.Command("trivy", {
  64. args: [
  65. "image",
  66. "--format", "json",
  67. "--severity", "CRITICAL,HIGH,MEDIUM,LOW",
  68. imageName,
  69. ],
  70. stdout: "piped",
  71. stderr: "piped",
  72. });
  73. const { code, stdout, stderr } = await command.output();
  74. if (code !== 0) {
  75. const errorText = new TextDecoder().decode(stderr);
  76. console.error(`❌ Trivy scan failed:\n${errorText}`);
  77. return null;
  78. }
  79. const outputText = new TextDecoder().decode(stdout);
  80. return JSON.parse(outputText);
  81. } catch (error) {
  82. console.error(`❌ Error running Trivy: ${error}`);
  83. return null;
  84. }
  85. }
  86. function summarizeVulnerabilities(results: ScanResult[]): Map<string, Vulnerability[]> {
  87. const bySeverity = new Map<string, Vulnerability[]>();
  88. for (const severity of SEVERITY_ORDER) {
  89. bySeverity.set(severity, []);
  90. }
  91. for (const result of results) {
  92. if (!result.Vulnerabilities) continue;
  93. for (const vuln of result.Vulnerabilities) {
  94. const list = bySeverity.get(vuln.Severity) || [];
  95. list.push(vuln);
  96. bySeverity.set(vuln.Severity, list);
  97. }
  98. }
  99. return bySeverity;
  100. }
  101. function printSummary(bySeverity: Map<string, Vulnerability[]>): void {
  102. console.log("─".repeat(60));
  103. console.log("\n📊 VULNERABILITY SUMMARY\n");
  104. let total = 0;
  105. let fixable = 0;
  106. for (const severity of SEVERITY_ORDER) {
  107. const vulns = bySeverity.get(severity) || [];
  108. if (vulns.length === 0) continue;
  109. const fixableCount = vulns.filter(v => v.FixedVersion).length;
  110. total += vulns.length;
  111. fixable += fixableCount;
  112. console.log(
  113. `${SEVERITY_EMOJI[severity]} ${severity.padEnd(10)} ${vulns.length.toString().padStart(4)} vulnerabilities (${fixableCount} fixable)`
  114. );
  115. }
  116. console.log("─".repeat(40));
  117. console.log(` TOTAL: ${total} vulnerabilities`);
  118. console.log(` FIXABLE: ${fixable} have patches available`);
  119. }
  120. function printDetails(bySeverity: Map<string, Vulnerability[]>, showAll: boolean): void {
  121. console.log("\n📋 VULNERABILITY DETAILS\n");
  122. // Show CRITICAL and HIGH by default, all if requested
  123. const severitiesToShow = showAll
  124. ? SEVERITY_ORDER
  125. : ["CRITICAL", "HIGH"];
  126. for (const severity of severitiesToShow) {
  127. const vulns = bySeverity.get(severity) || [];
  128. if (vulns.length === 0) continue;
  129. console.log(`\n${SEVERITY_EMOJI[severity]} ${severity} (${vulns.length})\n`);
  130. console.log("─".repeat(60));
  131. // Group by package
  132. const byPackage = new Map<string, Vulnerability[]>();
  133. for (const vuln of vulns) {
  134. const list = byPackage.get(vuln.PkgName) || [];
  135. list.push(vuln);
  136. byPackage.set(vuln.PkgName, list);
  137. }
  138. for (const [pkg, pkgVulns] of byPackage) {
  139. const firstVuln = pkgVulns[0];
  140. console.log(`\n 📦 ${pkg} (${firstVuln.InstalledVersion})`);
  141. if (firstVuln.FixedVersion) {
  142. console.log(` 💡 Fix: Upgrade to ${firstVuln.FixedVersion}`);
  143. }
  144. for (const vuln of pkgVulns.slice(0, 3)) { // Show max 3 per package
  145. console.log(` • ${vuln.VulnerabilityID}`);
  146. if (vuln.Title) {
  147. const title = vuln.Title.length > 60
  148. ? vuln.Title.substring(0, 60) + "..."
  149. : vuln.Title;
  150. console.log(` ${title}`);
  151. }
  152. }
  153. if (pkgVulns.length > 3) {
  154. console.log(` ... and ${pkgVulns.length - 3} more`);
  155. }
  156. }
  157. }
  158. if (!showAll) {
  159. const mediumLow = (bySeverity.get("MEDIUM")?.length || 0) +
  160. (bySeverity.get("LOW")?.length || 0);
  161. if (mediumLow > 0) {
  162. console.log(`\n📝 ${mediumLow} MEDIUM/LOW vulnerabilities not shown. Use --all to see all.`);
  163. }
  164. }
  165. }
  166. function printRecommendations(bySeverity: Map<string, Vulnerability[]>): void {
  167. console.log("\n💡 RECOMMENDATIONS\n");
  168. console.log("─".repeat(60));
  169. const critical = bySeverity.get("CRITICAL") || [];
  170. const high = bySeverity.get("HIGH") || [];
  171. if (critical.length > 0) {
  172. console.log("\n🔴 CRITICAL ISSUES - Address immediately:\n");
  173. // Find packages with critical vulns that have fixes
  174. const fixableCritical = critical.filter(v => v.FixedVersion);
  175. const uniquePackages = [...new Set(fixableCritical.map(v => v.PkgName))];
  176. if (uniquePackages.length > 0) {
  177. console.log(" Update these packages:");
  178. for (const pkg of uniquePackages.slice(0, 5)) {
  179. const vuln = fixableCritical.find(v => v.PkgName === pkg);
  180. if (vuln) {
  181. console.log(` • ${pkg}: ${vuln.InstalledVersion} → ${vuln.FixedVersion}`);
  182. }
  183. }
  184. if (uniquePackages.length > 5) {
  185. console.log(` ... and ${uniquePackages.length - 5} more`);
  186. }
  187. }
  188. const unfixableCritical = critical.filter(v => !v.FixedVersion);
  189. if (unfixableCritical.length > 0) {
  190. console.log(`\n ⚠️ ${unfixableCritical.length} critical vulnerabilities have no fix yet.`);
  191. console.log(" Consider using a different base image or monitoring for patches.");
  192. }
  193. }
  194. if (high.length > 0 && critical.length === 0) {
  195. console.log("\n🟠 HIGH PRIORITY - Plan to address soon:\n");
  196. const fixableHigh = high.filter(v => v.FixedVersion);
  197. console.log(` ${fixableHigh.length} of ${high.length} have available fixes.`);
  198. }
  199. // General recommendations
  200. console.log("\n📝 GENERAL RECOMMENDATIONS:\n");
  201. console.log(" 1. Update base image regularly");
  202. console.log(" Use specific version tags and update periodically");
  203. console.log("");
  204. console.log(" 2. Use minimal base images");
  205. console.log(" Consider: -slim, -alpine, or distroless variants");
  206. console.log("");
  207. console.log(" 3. Multi-stage builds");
  208. console.log(" Don't include build tools in final image");
  209. console.log("");
  210. console.log(" 4. Regular scanning");
  211. console.log(" Integrate trivy into CI/CD pipeline");
  212. }
  213. async function main() {
  214. const args = Deno.args;
  215. const showAll = args.includes("--all");
  216. const imageName = args.filter(a => !a.startsWith("--"))[0];
  217. if (!imageName) {
  218. console.log(`
  219. 🔍 Container Image Security Scanner
  220. Usage:
  221. deno run --allow-run --allow-net scan-image.ts <image-name> [--all]
  222. Examples:
  223. scan-image.ts node:20-slim
  224. scan-image.ts mcr.microsoft.com/devcontainers/base:ubuntu
  225. scan-image.ts my-app:latest --all
  226. Options:
  227. --all Show all vulnerabilities (default shows only CRITICAL and HIGH)
  228. Requires Trivy: brew install trivy
  229. `);
  230. Deno.exit(1);
  231. }
  232. // Check if Trivy is installed
  233. const trivyInstalled = await checkTrivyInstalled();
  234. if (!trivyInstalled) {
  235. console.error(`
  236. ❌ Trivy not found
  237. Install Trivy to use this scanner:
  238. macOS: brew install trivy
  239. Linux: curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 289 on GitHub
  240. Docker: docker run aquasec/trivy image ${imageName}
  241. More info: https://github.com/aquasecurity/trivy
  242. `);
  243. Deno.exit(1);
  244. }
  245. // Run scan
  246. const output = await scanImage(imageName);
  247. if (!output) {
  248. Deno.exit(1);
  249. }
  250. if (!output.Results || output.Results.length === 0) {
  251. console.log("✅ No vulnerabilities found!");
  252. Deno.exit(0);
  253. }
  254. // Process results
  255. const bySeverity = summarizeVulnerabilities(output.Results);
  256. // Check if any vulnerabilities
  257. let totalVulns = 0;
  258. for (const vulns of bySeverity.values()) {
  259. totalVulns += vulns.length;
  260. }
  261. if (totalVulns === 0) {
  262. console.log("✅ No vulnerabilities found!");
  263. Deno.exit(0);
  264. }
  265. // Print results
  266. printSummary(bySeverity);
  267. printDetails(bySeverity, showAll);
  268. printRecommendations(bySeverity);
  269. // Exit code based on severity
  270. const critical = bySeverity.get("CRITICAL") || [];
  271. const high = bySeverity.get("HIGH") || [];
  272. if (critical.length > 0) {
  273. console.log("\n🔴 CRITICAL vulnerabilities found - exit code 2");
  274. Deno.exit(2);
  275. } else if (high.length > 0) {
  276. console.log("\n🟠 HIGH vulnerabilities found - exit code 1");
  277. Deno.exit(1);
  278. }
  279. console.log("\n✅ No CRITICAL or HIGH vulnerabilities");
  280. }
  281. main();

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.