ionic-angular
Guides the agent through Angular-specific patterns for Ionic app development. Covers project structure, standalone vs NgModule architecture detection, Angular Router integration with Ionic navigation (tabs, side menu, modals), lazy loading, Ionic page lifecycle hooks, reactive forms with Ionic input components, Angular services for state management, route guards, performance optimization, and testing. Do not use for creating a new Ionic app from scratch, upgrading Ionic versions, general Ionic component usage unrelated to Angular, Capacitor plugin integration, or non-Angular frameworks (React, Vue).
What this skill does
# Ionic Angular
Ionic development with Angular — project structure, Angular-specific components, navigation, lazy loading, forms, and lifecycle integration.
## Prerequisites
1. **Ionic Framework 7 or 8** with `@ionic/angular`.
2. **Angular 16+** (Angular 17+ recommended for standalone architecture).
3. Node.js and npm installed.
4. Ionic CLI installed (`npm install -g @ionic/cli`).
## Agent Behavior
- **Auto-detect architecture.** Check `src/main.ts` for `bootstrapApplication` (standalone) vs. `platformBrowserDynamic().bootstrapModule` (NgModule). Adapt all code examples to the detected architecture.
- **Guide step-by-step.** Walk the user through one topic at a time.
- **Adapt imports.** For standalone components, import each Ionic component from `@ionic/angular/standalone`. For NgModule components, import `IonicModule` in the page module.
## Procedures
### Step 1: Analyze the Project
Auto-detect the following by reading project files — do **not** ask the user for information that can be inferred:
1. **Ionic version**: Read `@ionic/angular` version from `package.json`.
2. **Angular version**: Read `@angular/core` version from `package.json`.
3. **Architecture**: Check `src/main.ts` for `bootstrapApplication` (standalone) or `platformBrowserDynamic().bootstrapModule` (NgModule). If `src/app/app.module.ts` exists and imports `IonicModule`, confirm NgModule.
4. **Capacitor**: Check if `@capacitor/core` is in `package.json`. Check for `android/` and `ios/` directories.
5. **Routing**: Check for `src/app/app.routes.ts` (standalone) or `src/app/app-routing.module.ts` (NgModule).
6. **Navigation pattern**: Check `src/app/` for a `tabs/` directory (tab-based) or `ion-menu` usage in templates (side menu).
### Step 2: Understand Project Structure
Read `references/project-structure.md` for the standard Ionic Angular directory layout.
Key points:
- **Standalone projects** have `app.config.ts`, `app.routes.ts`, and standalone page components.
- **NgModule projects** have `app.module.ts`, `app-routing.module.ts`, and per-page `*.module.ts` files.
- Ionic config lives in `ionic.config.json`.
- Theme variables are in `src/theme/variables.scss`.
- Global styles and Ionic CSS imports are in `src/global.scss`.
### Step 3: Understand Architecture Differences
Read `references/standalone-vs-ngmodules.md` for detailed differences.
Summary:
| Aspect | Standalone | NgModule |
| ----------------- | ----------------------------------------------- | ------------------------------------------- |
| Bootstrap | `bootstrapApplication` in `main.ts` | `platformBrowserDynamic().bootstrapModule` |
| Ionic setup | `provideIonicAngular({})` in `app.config.ts` | `IonicModule.forRoot()` in `app.module.ts` |
| Component imports | Import each Ionic component per file | `IonicModule` provides all globally |
| Import source | `@ionic/angular/standalone` | `@ionic/angular` |
| Lazy loading | `loadComponent` in routes | `loadChildren` in routes |
| Icon registration | `addIcons()` from `ionicons` required | Automatic |
| Tree-shaking | Yes | No |
### Step 4: Set Up Navigation
Read `references/navigation.md` for full navigation patterns.
Topics covered:
- **Route configuration** — defining routes with lazy loading for both architectures.
- **Root component layout** — `<ion-app>` with `<ion-router-outlet>`.
- **Template navigation** — `routerLink` with `routerDirection` for transition animations.
- **Programmatic navigation** — `NavController` (`navigateForward`, `navigateBack`, `navigateRoot`, `back`).
- **Route parameters** — reading params via `ActivatedRoute`.
- **Tab navigation** — `<ion-tabs>` with child routes per tab.
- **Side menu** — `<ion-menu>` with `<ion-menu-toggle>` and child routes.
- **Route guards** — functional guards (Angular 15.2+) with `CanActivateFn`.
- **Modals** — `ModalController` for overlay navigation with data passing.
- **Linear vs. non-linear routing** — when to use each pattern.
### Step 5: Implement Lifecycle Hooks
Read `references/lifecycle.md` for Ionic page lifecycle hook details.
Key rules:
- `ngOnInit` fires **once** (first creation). Use for one-time setup.
- `ionViewWillEnter` fires on **every** page visit. Use for refreshing data.
- `ionViewDidEnter` fires after the transition animation. Use for heavy work that would block animations.
- `ionViewWillLeave` fires before leaving. Use for cleanup, pausing subscriptions.
- `ngOnDestroy` fires when the page is popped from the navigation stack. Use for final cleanup.
- Implement interfaces `ViewWillEnter`, `ViewDidEnter`, `ViewWillLeave`, `ViewDidLeave` from `@ionic/angular`.
### Step 6: Build Forms
Read `references/forms.md` for form patterns with Ionic components.
Topics covered:
- **Reactive forms** — `FormBuilder`, `FormGroup`, `Validators` with Ionic input components.
- **Template-driven forms** — `[(ngModel)]` with `FormsModule`.
- **Ionic form components** — `ion-input`, `ion-textarea`, `ion-select`, `ion-checkbox`, `ion-toggle`, `ion-radio-group`, `ion-range`, `ion-datetime`.
- **Validation display** — `errorText` (Ionic 7+) or manual `<ion-note>` for older versions.
- **Label placement** — `labelPlacement` attribute (`floating`, `stacked`, `fixed`).
### Step 7: Manage Services and State
Read `references/services-and-state.md` for service and state management patterns.
Topics covered:
- **Injectable services** — `@Injectable({ providedIn: 'root' })`.
- **HTTP data fetching** — `HttpClient` setup for standalone and NgModule, CRUD service pattern.
- **Reactive state** — `BehaviorSubject` for shared observable state.
- **Angular signals** — `signal()` and `computed()` for reactive state (Angular 16+).
- **Loading indicators** — `LoadingController` for async operations.
- **Error feedback** — `ToastController` for user-facing error/success messages.
- **Environment config** — `environment.ts` / `environment.prod.ts` for API URLs.
### Step 8: Optimize Performance
Read `references/performance.md` for performance optimization techniques.
Topics covered:
- **Lazy loading** — `loadComponent` (standalone) and `loadChildren` (NgModule).
- **trackBy / track** — efficient list rendering with `*ngFor` and `@for`.
- **Virtual scrolling** — Angular CDK `cdk-virtual-scroll-viewport` for large lists.
- **OnPush change detection** — reduce unnecessary re-renders.
- **Preloading strategy** — `PreloadAllModules` for instant subsequent navigation.
- **Skeleton text** — `ion-skeleton-text` for perceived performance during loading.
### Step 9: Write Tests
Read `references/testing.md` for testing patterns.
Topics covered:
- **Unit testing pages** — `TestBed` setup for standalone and NgModule pages.
- **Testing services** — basic services and HTTP services with `HttpTestingController`.
- **Mocking dependencies** — `jasmine.createSpyObj` for service and controller mocks.
- **Testing navigation** — mocking `NavController`.
- **Testing guards** — `TestBed.runInInjectionContext` for functional guards.
- **E2E testing** — Cypress and Playwright setup.
## Error Handling
- **`NullInjectorError: No provider for IonRouterOutlet`**: In standalone apps, verify `provideIonicAngular({})` is called in `app.config.ts`. In NgModule apps, verify `IonicModule.forRoot()` is imported in `app.module.ts`.
- **Ionic components not rendering**: In standalone components, verify each Ionic component is imported from `@ionic/angular/standalone` and listed in the `imports` array. In NgModule components, verify `IonicModule` is imported in the page module.
- **Icons not showing (standalone)**: Verify `addIcons()` is called with the required icons from `ionicRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.