Aller au contenu
Skillpedia
Programmation générale7.6k · #13130

adding-a-feature

Ce qu’il fait

Cette compétence est une liste de contrôle pour ajouter une fonctionnalité à une application Agent-Native. Elle s'assure que l'écran, l'action, les instructions de l'agent et l'état partagé de l'application sont tous mis à jour. Elle s'adresse aux développeurs qui veulent que l'agent et l'interface concordent.

Quand l’utiliser

  • ✓Quand vous ajoutez une fonctionnalité qui apporte des données ou une nouvelle capacité à une application.
  • ✓Quand une nouvelle fonctionnalité apparaît dans les écrans mais que l'agent ne peut pas l'utiliser.
  • ✓Quand vous voulez vérifier qu'une modification ne touche que les zones qu'elle concerne.

Lien du skill

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/adding-a-feature/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/adding-a-feature/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Peux-tu ajouter une fonctionnalité de suivi des tâches à cette application, en veillant à ce que l'agent puisse aussi créer et lister les tâches ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent parcourt quatre zones dans l'ordre : l'interface utilisateur, l'action, les instructions de l'agent et l'état partagé. Il ignore toute zone que la modification ne touche pas.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

Adding a Feature — The Four-Area Checklist

Rule

Every new feature MUST update all four areas. Skipping any one breaks the agent-native contract — the agent and UI must always be equal partners.

Scope check first: this is the checklist for a feature that adds app data or a new capability. A restyle, a copy change, or a screen with no new data model and no new agent-visible operation only needs the areas it actually touches — do not manufacture actions, state keys, or a skill for it.

Why

Agent-Native apps are defined by parity: everything the UI can do, the agent can do, and vice versa. A feature that only has UI is invisible to the agent. A feature that only has scripts is invisible to the user. A feature without app-state sync means the agent is blind to what the user is doing.

The Checklist

When you add a new feature, work through these four areas in order:

1. UI Component

Build the user-facing interface — a page, component, dialog, or route. Use useActionQuery and useActionMutation from @agent-native/core/client/hooks to call actions for data fetching and mutations. Do not create a custom REST endpoint just so React can call action-backed data; the action endpoint already exists.

Agent edits must refresh the UI without a background poll. Local chat-run tool completions invalidate action queries and source counters after each side-effecting tool and again at run end. There are two query paths:

  • useActionQuery / useActionMutation — local action mutations invalidate ['action'] observers, and chat-run tool completions invalidate them for agent writes. No background sync opt-in is needed for the current user's agent run. Prefer this path.
  • Raw useQuery with custom keys — fold useChangeVersions([<source>, "action"]) from @agent-native/core/client/hooks into the queryKey and set placeholderData: (prev) => prev. Local chat-run side effects bump those counters too. Remote changes require the page's explicit useDbSync({ realtime: { reason } }) opt-in only when data changes without the current user acting and must appear before refresh.

Never opt in public, anonymous, marketing, docs, or SSR routes, settings, forms, or read-mostly lists. Refetch those on focus or navigation. Shared Slides editing and the Mail inbox are the current first-party examples that need remote updates. Each opted-in open tab adds a shared background transport and one poll per idle interval; hidden tabs pause, and idle polling backs off to 1, 2, then 5 minutes. See real-time-sync for the decision rule and examples.

import { useChangeVersions } from "@agent-native/core/client/hooks";
import { useQuery } from "@tanstack/react-query";

const v = useChangeVersions(["dashboards", "action"]);
useQuery({
  queryKey: ["dashboard", id, v],
  queryFn: () => fetchDashboard(id),
  placeholderData: (prev) => prev, // no flicker on refetch
});

See the real-time-sync skill for the full pattern and source catalog.

2. Action

Create an action in actions/ using defineAction. This serves double duty: the agent calls it as a tool, and the UI calls it through useActionQuery / useActionMutation while the framework owns the HTTP transport. Set http: { method: "GET" } for read actions, leave default for writes, or set http: false for agent-only actions like navigate and view-screen.

Before adding a new route or endpoint, inspect the existing actions. Reuse an action if it already covers the business operation, extend it if the shared contract is incomplete, or create a new defineAction if the agent and UI both need the capability. Do not add pass-through /api/* routes that re-export actions. If client code needs a new framework/app route, expose a named helper or hook first and use that helper from components and docs.

For provider-backed analysis/query/reporting integrations, do not turn every provider endpoint or filter into a rigid action. Prefer the shared provider-api-catalog / provider-api-docs / provider-api-request pattern from @agent-native/core/provider-api, then add narrow convenience actions only for workflows that truly deserve a first-class shortcut. Treat this as a capability requirement, not a nice-to-have: convenience actions must not become the ceiling of what the agent can ask the provider to do. Pair broad provider access with staging or sandboxed code execution when responses may be too large for chat context. If p

Questions fréquentes

Les petites modifications visuelles ont-elles besoin des quatre zones ?

Non. Un changement de style ou de texte ne nécessite que les zones réellement touchées.

Pourquoi l'agent et l'interface doivent-ils concorder ?

La compétence explique qu'une fonctionnalité visible seulement dans l'interface ne peut pas être utilisée par l'agent, et inversement.

L'agent voit-il ce que fait l'utilisateur ?

La compétence couvre la synchronisation de l'état de l'application pour que l'agent puisse voir l'écran courant.

Détails

Description originale de l’auteur

The four-area checklist every new feature must complete. Use when adding any feature, integration, or capability to ensure the agent and UI stay in parity.

repo: BuilderIO/agent-native

Popularité

Étoiles GitHub
7.6k
Position au classement
#13130
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires