atomico

Guides building, auditing, and validating Atomico.js web components with TypeScript.

1.3k|44|Updated Aug 25, 2018
One-click install
npx skills add https://github.com/atomicojs/atomico --skill atomico
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: atomico
Source: https://github.com/atomicojs/atomico/tree/main/.agents/skills/atomico
Command: npx skills add https://github.com/atomicojs/atomico --skill atomico

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing Atomico.js web components correctly requires knowing framework-specific rules for props, state hooks, events, JSX typing, and Shadow DOM behavior, and mistakes like void callbacks or extracted handlers silently break type inference and event propagation.

Core Features & Use Cases

  • Coding Standards & API Reference: Provides cheat sheets for c(), useProp, useState, useObjectState, event(), callback(), useFormProps, useSuspense, and other Atomico hooks with correct and forbidden patterns.
  • Validation Pipeline: Enforces a two-phase audit (semantic lint checks plus tsc --noEmit compiler verification) with a mandatory validation report before any generated code is accepted.
  • Use Case: Ask the agent to build a form-associated custom input component; it generates the component with proper props factories, reflect rules, and inline handlers, then runs the TypeScript compiler check and reports the validation results.

Quick Start

Create an Atomico counter component with a reflected size prop and validate it against the project rules.

Frequently Asked Questions about atomico

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

FAQPage Schema
How do I create a web component with Atomico?

Define the component with c(render, config) where the render function returns a <host> root element and config declares props and styles. Export the constructor from the component file and register it with customElements.define only in a central index file.

How do I declare props with default values in Atomico?

Use the shorthand form like label: String for simple read-only props, and a config object with a factory callback like { type: Number, value: () => 0 } when a default or reflect is needed. Static values in the value field are forbidden.

When should I use event() versus callback() in Atomico props?

Use event<Detail>() for fire-and-forget notifications dispatched as CustomEvents, and callback<Fn>() only when the child awaits a return value from the parent. Callbacks must never return void, and neither should be prefixed with 'on'.

Why does my change event not reach the parent in Atomico Shadow DOM?

Native events like change and submit have composed: false, so they cannot cross the Shadow DOM boundary. Declare a custom event with { bubbles: true, composed: true } in props and dispatch it explicitly from the internal native handler.

Should I use useState or useObjectState in Atomico components?

Use useState only for a single isolated private value like a boolean toggle. Use useObjectState whenever managing two or more related values, since it supports partial updates and avoids redundant render cycles from multiple useState calls.

Does Atomico support TypeScript type inference in JSX?

Yes, Atomico infers prop types from the props config block and infers event target types for inline JSX handlers. Extracting handlers to standalone constants breaks this inference, and Array or Object props need explicit factory return-type annotations.