### Install a Single Skill Source: https://context7.com/midudev/autoskills/llms.txt Spawns a child process to install a specific skill using npx. ```javascript import { installSkill } from "autoskills/installer.mjs"; // Install a single skill const result = await installSkill("vercel-labs/agent-skills/vercel-react-best-practices", ["cursor", "claude-code"]); if (result.success) { console.log("Skill installed successfully"); } else { console.error("Installation failed:", result.output); } // Install from a URL const urlResult = await installSkill("https://bun.sh/docs", ["universal"]); ``` -------------------------------- ### autoskills CLI Options Source: https://github.com/midudev/autoskills/blob/main/README.md Available command-line flags for modifying the installation behavior. ```text -y, --yes Skip confirmation prompt --dry-run Show what would be installed without installing -h, --help Show help message ``` -------------------------------- ### installAll(skills, agents) Source: https://context7.com/midudev/autoskills/llms.txt Parallel installer for multiple skills with animated status updates. ```APIDOC ## installAll(skills, agents) ### Description Parallel installer with animated spinners and live status updates. ### Parameters #### Arguments - **skills** (Array) - Required - List of skill objects containing skill path and sources. - **agents** (Array) - Required - List of target agents. ### Response - **Object** - Returns an object containing installed (number), failed (number), and errors (Array). ``` -------------------------------- ### Install Multiple Skills in Parallel Source: https://context7.com/midudev/autoskills/llms.txt Installs multiple skills concurrently with progress tracking and status reporting. ```javascript import { installAll } from "autoskills/installer.mjs"; const skills = [ { skill: "vercel-labs/agent-skills/vercel-react-best-practices", sources: ["React"] }, { skill: "vercel-labs/next-skills/next-best-practices", sources: ["Next.js"] }, { skill: "shadcn/ui/shadcn", sources: ["shadcn/ui"] } ]; const agents = ["universal", "cursor", "claude-code"]; // Installs in parallel (3 concurrent) with progress animation const { installed, failed, errors } = await installAll(skills, agents); console.log(`Installed: ${installed}, Failed: ${failed}`); if (errors.length > 0) { errors.forEach(({ name, output }) => { console.error(`${name}: ${output}`); }); } ``` -------------------------------- ### installSkill(skillPath, agents) Source: https://context7.com/midudev/autoskills/llms.txt Spawns a child process to install a single skill via npx skills add. ```APIDOC ## installSkill(skillPath, agents) ### Description Spawns a child process to install a single skill via npx skills add. ### Parameters #### Arguments - **skillPath** (string) - Required - The path or URL of the skill. - **agents** (Array) - Required - List of target agents. ### Response - **Object** - Returns an object with success (boolean) and output (string) properties. ``` -------------------------------- ### Build Installation Arguments Source: https://context7.com/midudev/autoskills/llms.txt Generates the argument array required for executing npx skills add commands. ```javascript import { buildInstallArgs } from "autoskills/installer.mjs"; // Build args for a skill with namespace const args1 = buildInstallArgs("owner/repo/skill-name", ["cursor"]); // ["-y", "skills", "add", "owner/repo", "--skill", "skill-name", "-y", "-a", "cursor"] // Build args without agent specification const args2 = buildInstallArgs("owner/repo/skill-name"); // ["-y", "skills", "add", "owner/repo", "--skill", "skill-name", "-y"] // Build args for repo-only path const args3 = buildInstallArgs("owner/repo", ["cursor", "claude-code"]); // ["-y", "skills", "add", "owner/repo", "-y", "-a", "cursor", "claude-code"] ``` -------------------------------- ### Run autoskills CLI Source: https://github.com/midudev/autoskills/blob/main/README.md Execute the tool in the project root to initiate automatic stack detection and skill installation. ```bash npx autoskills ``` -------------------------------- ### Preview detected skills Source: https://github.com/midudev/autoskills/blob/main/packages/autoskills/README.md Display detected skills without performing any installations. ```bash npx autoskills --dry-run ``` -------------------------------- ### Skip confirmation prompt Source: https://github.com/midudev/autoskills/blob/main/packages/autoskills/README.md Automatically install all detected skills without manual confirmation. ```bash npx autoskills -y ``` -------------------------------- ### detectAgents(home) Source: https://context7.com/midudev/autoskills/llms.txt Detects installed AI coding agents by checking for skills directories in known agent folders. ```APIDOC ## detectAgents(home) ### Description Detects installed AI coding agents by checking for skills directories in known agent folders. ### Parameters #### Arguments - **home** (string) - Optional - Custom home directory path for testing. ### Response - **Array** - A list of detected agent names, always including 'universal'. ``` -------------------------------- ### Detect AI Coding Agents Source: https://context7.com/midudev/autoskills/llms.txt Detects installed AI coding agents by checking for skills directories in known agent folders. ```javascript import { detectAgents } from "autoskills/lib.mjs"; import { homedir } from "node:os"; // Auto-detect installed agents const agents = detectAgents(); // Always includes "universal", plus detected agents // ["universal", "claude-code", "cursor"] // Or specify a custom home directory (for testing) const customAgents = detectAgents("/custom/home"); console.log(`Installing for agents: ${agents.join(", ")}`); ``` -------------------------------- ### View autoskills CLI options Source: https://context7.com/midudev/autoskills/llms.txt Display the help message and available command-line flags for the autoskills tool. ```bash # Full options reference npx autoskills --help # Options: # -y, --yes Skip confirmation prompt, install all detected skills # --dry-run Show detected skills without installing anything # -v, --verbose Show error details if any installation fails # -a, --agent Install for specific IDEs only (e.g. cursor, claude-code) # -h, --help Show help message ``` -------------------------------- ### buildInstallArgs(skillPath, agents) Source: https://context7.com/midudev/autoskills/llms.txt Constructs the argument array for npx skills add commands. ```APIDOC ## buildInstallArgs(skillPath, agents) ### Description Constructs the argument array for npx skills add commands. ### Parameters #### Arguments - **skillPath** (string) - Required - The skill path. - **agents** (Array) - Optional - List of target agents. ### Response - **Array** - The constructed argument array for the CLI command. ``` -------------------------------- ### Check for Web Frontend Files Source: https://context7.com/midudev/autoskills/llms.txt Recursively checks for common web frontend file extensions within a project directory. ```javascript import { hasWebFrontendFiles } from "autoskills/lib.mjs"; // Check if project contains frontend files const isFrontend = hasWebFrontendFiles("/path/to/project"); // true if any .html, .css, .scss, .vue, .svelte, .jsx, .tsx, etc. found // With custom depth limit (default is 3) const shallowCheck = hasWebFrontendFiles("/path/to/project", 1); if (isFrontend) { console.log("Frontend files detected - will add accessibility and SEO skills"); } ``` -------------------------------- ### resolveWorkspaces(projectDir) Source: https://context7.com/midudev/autoskills/llms.txt Discovers workspace directories in a monorepo from pnpm-workspace.yaml or package.json. ```APIDOC ## resolveWorkspaces(projectDir) ### Description Discovers workspace directories in a monorepo from pnpm-workspace.yaml or package.json workspaces field. ### Parameters #### Arguments - **projectDir** (string) - Required - The root directory of the monorepo. ### Response - **Array** - A list of absolute paths to workspace directories. ``` -------------------------------- ### detectTechnologies(projectDir) Source: https://context7.com/midudev/autoskills/llms.txt Scans a project directory and all workspace subdirectories for known technologies by checking packages, config files, and file content patterns. ```APIDOC ## detectTechnologies(projectDir) ### Description Scans a project directory and all workspace subdirectories for known technologies by checking packages, config files, and file content patterns. ### Parameters #### Path Parameters - **projectDir** (string) - Required - The absolute or relative path to the project root directory. ### Response - **detected** (array) - List of detected technologies with their associated skills. - **isFrontend** (boolean) - Indicates if the project is identified as a frontend project. - **combos** (array) - List of detected technology combinations (e.g., Next.js + Supabase). ``` -------------------------------- ### hasWebFrontendFiles(projectDir, maxDepth) Source: https://context7.com/midudev/autoskills/llms.txt Recursively checks for web frontend file extensions in a project directory. ```APIDOC ## hasWebFrontendFiles(projectDir, maxDepth) ### Description Recursively checks for web frontend file extensions (.html, .css, .vue, .jsx, etc.). ### Parameters #### Arguments - **projectDir** (string) - Required - The directory to scan. - **maxDepth** (number) - Optional - Depth limit for recursion (default is 3). ### Response - **boolean** - Returns true if frontend files are detected. ``` -------------------------------- ### readPackageJson(dir) and getAllPackageNames(pkg) Source: https://context7.com/midudev/autoskills/llms.txt Utility functions for reading and parsing package.json files to extract dependency information. ```APIDOC ## readPackageJson(dir) ### Description Reads and parses the package.json file from a specified directory. ### Parameters - **dir** (string) - The directory path containing the package.json file. ### Response - **pkg** (object|null) - The parsed package.json object or null if the file does not exist or is malformed. ## getAllPackageNames(pkg) ### Description Extracts all dependency names (dependencies and devDependencies) from a parsed package.json object. ### Parameters - **pkg** (object) - The parsed package.json object. ### Response - **packages** (array) - A list of strings representing the names of all dependencies. ``` -------------------------------- ### Detect project technologies Source: https://context7.com/midudev/autoskills/llms.txt Use detectTechnologies to scan a directory for project technologies, frontend frameworks, and stack combinations. ```javascript import { detectTechnologies } from "autoskills/lib.mjs"; // Scan a project directory const projectDir = "/path/to/my-project"; const { detected, isFrontend, combos } = detectTechnologies(projectDir); // Example output: // detected: [ // { id: "react", name: "React", skills: ["vercel-labs/agent-skills/vercel-react-best-practices", ...] }, // { id: "nextjs", name: "Next.js", skills: ["vercel-labs/next-skills/next-best-practices", ...] }, // { id: "typescript", name: "TypeScript", skills: ["wshobson/agents/typescript-advanced-types"] } // ] // isFrontend: true (detected React as frontend framework) // combos: [{ id: "nextjs-supabase", name: "Next.js + Supabase", skills: [...] }] console.log(`Found ${detected.length} technologies`); console.log(`Frontend project: ${isFrontend}`); console.log(`Technology combos: ${combos.map(c => c.name).join(", ")}`); ``` -------------------------------- ### Run autoskills CLI commands Source: https://context7.com/midudev/autoskills/llms.txt Execute various operations using the autoskills CLI, including interactive detection, dry runs, and specific agent targeting. ```bash # Run interactive skill detection and installation npx autoskills # Skip confirmation prompt and install all detected skills npx autoskills -y # Preview what would be installed without making changes npx autoskills --dry-run # Install for specific AI agents only npx autoskills -a cursor claude-code # Show verbose error details on failure npx autoskills -v ``` -------------------------------- ### Resolve Monorepo Workspaces Source: https://context7.com/midudev/autoskills/llms.txt Discovers workspace directories in a monorepo using pnpm-workspace.yaml or package.json configurations. ```javascript import { resolveWorkspaces } from "autoskills/lib.mjs"; // Detect workspace directories in a monorepo const workspaceDirs = resolveWorkspaces("/path/to/monorepo"); // ["/path/to/monorepo/packages/web", "/path/to/monorepo/packages/api", ...] // Works with: // - pnpm-workspace.yaml: packages: ["packages/*", "apps/*"] // - package.json workspaces: ["packages/*"] or { packages: ["packages/*"] } workspaceDirs.forEach(dir => { console.log(`Found workspace: ${dir}`); }); ``` -------------------------------- ### UI Components Source: https://context7.com/midudev/autoskills/llms.txt Utilities for terminal output, including banners, interactive selection, and time formatting. ```APIDOC ## UI Components ### printBanner(version) Prints a styled ASCII banner with the provided version number. ### multiSelect(items, options) Displays an interactive multi-select component. Returns a Promise resolving to the selected items. - **items** (array) - List of items to select from - **options** (object) - Configuration including labelFn, hintFn, and groupFn ### formatTime(ms) Formats a duration in milliseconds into a human-readable string (e.g., '3.2s', '2m 15s'). ``` -------------------------------- ### Map Agent Folders Source: https://context7.com/midudev/autoskills/llms.txt Retrieve the mapping of agent home directory folders to their respective CLI identifiers. ```javascript import { AGENT_FOLDER_MAP } from "autoskills/skills-map.mjs"; // Check which agents are supported console.log(AGENT_FOLDER_MAP); // { // ".claude": "claude-code", // ".cursor": "cursor", // ".cline": "cline", // ".codex": "codex", // ".copilot": "github-copilot", // ".gemini": "gemini-cli", // ".amp": "amp", // ".continue": "continue", // ... // } ``` -------------------------------- ### Manage Technology Combinations Source: https://context7.com/midudev/autoskills/llms.txt Access technology combinations that unlock specialized skills when multiple technologies are detected. ```javascript import { COMBO_SKILLS_MAP } from "autoskills/skills-map.mjs"; // Combo entries with requirements const expoTailwindCombo = COMBO_SKILLS_MAP.find(c => c.id === "expo-tailwind"); // { // id: "expo-tailwind", // name: "Expo + Tailwind CSS", // requires: ["expo", "tailwind"], // skills: ["expo/skills/expo-tailwind-setup"] // } // Available combos: // - expo-tailwind: Expo + Tailwind CSS // - nextjs-supabase: Next.js + Supabase // - react-native-expo: React Native + Expo // - nextjs-vercel-ai: Next.js + Vercel AI SDK // - nextjs-playwright: Next.js + Playwright // - react-shadcn: React + shadcn/ui // - tailwind-shadcn: Tailwind CSS + shadcn/ui // - gsap-react: GSAP + React // - cloudflare-vite: Cloudflare + Vite // - node-express: Node.js + Express ``` -------------------------------- ### Access Technology Detection Rules Source: https://context7.com/midudev/autoskills/llms.txt Retrieve detection rules and associated skills for specific technologies from the SKILLS_MAP. ```javascript import { SKILLS_MAP } from "autoskills/skills-map.mjs"; // Each entry defines detection rules and skills const reactEntry = SKILLS_MAP.find(t => t.id === "react"); // { // id: "react", // name: "React", // detect: { // packages: ["react", "react-dom"] // }, // skills: [ // "vercel-labs/agent-skills/vercel-react-best-practices", // "vercel-labs/agent-skills/vercel-composition-patterns" // ] // } // Detection methods: // - packages: Check dependencies/devDependencies in package.json // - packagePatterns: Regex patterns for scoped packages (e.g., /^@azure\//) // - configFiles: Check for specific files (e.g., "next.config.js") // - configFileContent: Check file contents for patterns (e.g., Gradle plugins) // Example with config file content detection (Kotlin Multiplatform) const kmpEntry = SKILLS_MAP.find(t => t.id === "kotlin-multiplatform"); // { // id: "kotlin-multiplatform", // detect: { // configFileContent: { // scanGradleLayout: true, // patterns: ['kotlin("multiplatform")', "org.jetbrains.kotlin.multiplatform", ...] // } // }, // skills: [...] // } ``` -------------------------------- ### Parse package.json files Source: https://context7.com/midudev/autoskills/llms.txt Read and extract dependency names from package.json files using utility functions. ```javascript import { readPackageJson, getAllPackageNames } from "autoskills/lib.mjs"; // Read and parse package.json from a directory const pkg = readPackageJson("/path/to/project"); // Returns null if file doesn't exist or is malformed if (pkg) { // Extract all dependency names (both dependencies and devDependencies) const packages = getAllPackageNames(pkg); // ["react", "next", "typescript", "@playwright/test", ...] console.log(`Found ${packages.length} packages`); } ``` -------------------------------- ### collectSkills(detected, isFrontend, combos) Source: https://context7.com/midudev/autoskills/llms.txt Aggregates and deduplicates skills from detected technologies, combo matches, and frontend bonus skills. ```APIDOC ## collectSkills(detected, isFrontend, combos) ### Description Aggregates and deduplicates skills from detected technologies, combo matches, and frontend bonus skills. ### Parameters - **detected** (array) - The output from detectTechnologies. - **isFrontend** (boolean) - The output from detectTechnologies. - **combos** (array) - The output from detectTechnologies. ### Response - **skills** (array) - A list of unique skill objects, each containing the skill identifier and the source technologies that triggered it. ``` -------------------------------- ### Print Styled Banner Source: https://context7.com/midudev/autoskills/llms.txt Display the autoskills ASCII banner with a specified version number. ```javascript import { printBanner } from "autoskills/ui.mjs"; printBanner("0.2.2"); // Outputs: // ╔═══════════════════════════════════════╗ // ║ autoskills v0.2.2║ // ║ Auto-install the best AI skills ║ // ║ for your project ║ // ╚═══════════════════════════════════════╝ ``` -------------------------------- ### detectCombos(detectedIds) Source: https://context7.com/midudev/autoskills/llms.txt Finds technology combos whose requirements are satisfied by the detected technology IDs. ```APIDOC ## detectCombos(detectedIds) ### Description Finds technology combos whose requirements are satisfied by the detected technology IDs. ### Parameters #### Arguments - **detectedIds** (Array) - Required - List of detected technology IDs. ### Response - **Array** - A list of matching combo objects containing id, name, requires, and skills. ``` -------------------------------- ### Technology Detection (SKILLS_MAP) Source: https://context7.com/midudev/autoskills/llms.txt Access the mapping of technologies to their detection rules and associated skills. ```APIDOC ## SKILLS_MAP ### Description Provides a complete mapping of technologies to their detection rules and associated skills. Detection methods include package checks, regex patterns, and config file analysis. ### Data Structure - **id** (string) - Unique identifier for the technology - **name** (string) - Human-readable name - **detect** (object) - Rules for detection (packages, packagePatterns, configFiles, configFileContent) - **skills** (array) - List of associated skill identifiers ``` -------------------------------- ### Detect Technology Combos Source: https://context7.com/midudev/autoskills/llms.txt Identifies technology combinations based on a list of detected IDs. ```javascript import { detectCombos } from "autoskills/lib.mjs"; // Check which combos match your detected technologies const detectedIds = ["nextjs", "supabase", "playwright", "react"]; const combos = detectCombos(detectedIds); // Example output: // [ // { id: "nextjs-supabase", name: "Next.js + Supabase", requires: ["nextjs", "supabase"], skills: [...] }, // { id: "nextjs-playwright", name: "Next.js + Playwright", requires: ["nextjs", "playwright"], skills: [...] }, // { id: "react-shadcn", ... } // Only if "shadcn" was also detected // ] combos.forEach(combo => { console.log(`Detected combo: ${combo.name}`); }); ``` -------------------------------- ### Technology Combinations (COMBO_SKILLS_MAP) Source: https://context7.com/midudev/autoskills/llms.txt Access technology combinations that unlock specialized skills when multiple technologies are detected. ```APIDOC ## COMBO_SKILLS_MAP ### Description Defines technology combinations that unlock specialized skills when multiple technologies are detected together in a project. ### Data Structure - **id** (string) - Unique identifier for the combo - **name** (string) - Human-readable name - **requires** (array) - List of technology IDs required to unlock the combo - **skills** (array) - List of skills unlocked by this combination ``` -------------------------------- ### Interactive Multi-Select Component Source: https://context7.com/midudev/autoskills/llms.txt Render an interactive multi-select list with keyboard navigation and grouping support. ```javascript import { multiSelect } from "autoskills/ui.mjs"; const skills = [ { skill: "react-skill", sources: ["React"] }, { skill: "next-skill", sources: ["Next.js"] }, { skill: "vue-skill", sources: ["Vue"] } ]; // Interactive selection (returns Promise) const selected = await multiSelect(skills, { labelFn: (s) => s.skill, // Display label for each item hintFn: (s) => s.sources.join(", "), // Hint text shown after label groupFn: (s) => s.sources[0] // Group items by first source }); // Keyboard controls: // ↑/↓ or j/k: Move cursor // Space: Toggle selection // a: Toggle all // Enter: Confirm selection // Ctrl+C: Exit ``` -------------------------------- ### Color Utilities Source: https://context7.com/midudev/autoskills/llms.txt ANSI color functions for terminal output that respect environment variables like NO_COLOR. ```APIDOC ## Color Utilities ### Description Provides functions for styling terminal text (bold, dim, green, yellow, cyan, red, magenta, gray, white, pink). These functions automatically respect the NO_COLOR environment variable and TTY detection. ``` -------------------------------- ### Collect AI skills Source: https://context7.com/midudev/autoskills/llms.txt Aggregate and deduplicate skills based on detected technologies and project context using collectSkills. ```javascript import { detectTechnologies, collectSkills } from "autoskills/lib.mjs"; const { detected, isFrontend, combos } = detectTechnologies("/path/to/project"); // Collect all unique skills with their source technologies const skills = collectSkills(detected, isFrontend, combos); // Example output: // [ // { skill: "vercel-labs/agent-skills/vercel-react-best-practices", sources: ["React"] }, // { skill: "vercel-labs/next-skills/next-best-practices", sources: ["Next.js"] }, // { skill: "supabase/agent-skills/supabase-postgres-best-practices", sources: ["Supabase", "Next.js + Supabase"] }, // { skill: "anthropics/skills/frontend-design", sources: ["Frontend"] } // ] skills.forEach(({ skill, sources }) => { console.log(`${skill} ← ${sources.join(", ")}`); }); ``` -------------------------------- ### Format Time Duration Source: https://context7.com/midudev/autoskills/llms.txt Convert a duration in milliseconds into a human-readable string. ```javascript import { formatTime } from "autoskills/ui.mjs"; formatTime(42); // "42ms" formatTime(3200); // "3.2s" formatTime(135000); // "2m 15s" ``` -------------------------------- ### Terminal Color Utilities Source: https://context7.com/midudev/autoskills/llms.txt Apply ANSI colors to terminal output, respecting NO_COLOR and FORCE_COLOR environment variables. ```javascript import { bold, dim, green, yellow, cyan, red, magenta, gray, white, pink } from "autoskills/colors.mjs"; // Style text for terminal output console.log(bold("Important message")); console.log(green("✔ Success")); console.log(red("✘ Error")); console.log(dim("Subtle hint")); console.log(cyan("◆ ") + bold("Section header")); // Colors are automatically disabled when: // - NO_COLOR environment variable is set // - stdout is not a TTY (piped output) // Force colors with FORCE_COLOR=1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.