Coding with agents
Provide API source, declarations, examples, and validation commands to coding agents.
Coding agents need the Onset API definitions to generate valid imports, props, and component compositions. Provide source code or installed declarations and run project checks after changes.
Reference sources
| Source | Contents |
|---|---|
| Onset source | Implementation behavior and exported types |
| Documentation | Component references, usage, and examples |
dist/index.d.ts | Installed prop types and declaration comments |
Source access
An Onset license includes source code. Place the source in a location the agent can read and include that path in project instructions.
## Onset UI
This project uses @solarius/onset.
Read the relevant API before editing:
- Source: ./vendor/onset/src
- Installed declarations: node_modules/@solarius/onset/dist/index.d.ts
- Documentation: https://<your-docs-host>
Use exported props and documented component compositions.
Use theme tokens for styles that should follow theme changes.
Import @solarius/onset/styles.css once at the application root.
Place themed content inside ThemeProvider.
The built component entry declares a use client boundary.
Run pnpm typecheck after changes.Documentation access
Provide documentation access when source code is unavailable. Component pages contain prop references, composition requirements, examples, and limitations.
Installed declarations
The published package includes dist/index.d.ts. Include its installed path in
agent instructions. Declarations define exported names and types. Source or
reference documentation may be needed to establish runtime behavior.
Validation
Run the project's type check to detect invalid imports, unknown props, and incompatible values:
pnpm typecheckRun the project's relevant tests and build. Type checking alone does not verify runtime behavior, accessibility, or rendering.
Implementation guidance
Component selection
Specify component names and required behavior. Use the component index to find available components.
Examples and composition
Use a documented example to establish prop names, data shapes, and valid children.
For example, place ModalHeader, ModalBody, and ModalFooter inside Modal.
Place ToastProvider above components that call useToast.
See Building components for custom compositions.
Styling
State which visual changes are required. Use theme tokens when custom styles must respond to theme configuration.