stacks-auto-imports

Configure Stacks auto-imports for browser and server manifests and runtime injection.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-auto-imports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-auto-imports
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-auto-imports
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-auto-imports

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable developers to access Stacks utilities (functions, models, composables, and globals) without explicit imports, reducing boilerplate and improving consistency across browser and server contexts.

Core Features & Use Cases

  • Global exposure of auto-imported functions, models, and utilities in browser and server contexts.
  • Manifests generation and type declarations for IDE support.
  • Runtime injection of globals to simplify code and reduce imports.

Quick Start

Run buddy generate to refresh auto-imports and then review the generated browser and server manifests.

Frequently Asked Questions about stacks-auto-imports

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up auto-imports for global utility functions in a Stacks project?

To configure auto-imports, run the buddy generate command to refresh manifests and type declarations. This process exposes functions, models, and globals automatically across browser templates and server routes without manual imports.

What are auto-imports and how do they work in browser and server contexts?

Auto-imports inject functions and globals at runtime, eliminating explicit import statements. The system generates separate browser and server manifests to ensure consistent utility exposure across both environments.

Do I need specific manifest files to enable type generation for auto-imports?

Yes, enabling type generation requires access to resources in storage/framework/auto-imports and the generated browser/server manifest files. These files provide the declarations for IDE support and runtime injection.

Can I use auto-imports for server routes, actions, and jobs without manual imports?

Yes, auto-imports apply to server routes, actions, and jobs. The system handles manifest generation and runtime global injection, allowing you to access required utilities seamlessly across these server contexts.

Why are my auto-imported functions not recognized in the IDE after updating globals?

IDE recognition fails when manifests or type declarations are outdated. Running buddy generate refreshes the auto-imports configuration and updates the generated type declarations to restore IDE support.