मुख्य सामग्री पर जाएँ
Skillpedia
वेबसाइट और UI (frontend)7.6k · #13148

context-awareness

यह क्या करती है

यह स्किल बताती है कि Agent-Native ऐप एजेंट को स्क्रीन पर दिखने वाली चीज़ों की जानकारी कैसे देता है। इसमें नेविगेशन स्टेट, दिखने वाले रिकॉर्ड के विवरण और मौजूदा चयन शामिल हैं। यह उन डेवलपर्स के लिए है जो चाहते हैं कि एजेंट वही करे जो यूज़र देख रहा है।

कब इस्तेमाल करें

  • ✓जब आप एक आइटम खुला होने पर भी एजेंट पूछता है कि आपका मतलब कौन सा है।
  • ✓जब आप चाहते हैं कि एजेंट ऐप में मौजूदा चयन पर काम करे।
  • ✓जब आप डीबग कर रहे हैं कि एजेंट मौजूदा स्क्रीन से अनजान क्यों लगता है।

Skill का लिंक

https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-awareness/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/context-awareness/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“क्या आप ऐसा कर सकते हैं कि एजेंट जाने कि मेरा कौन सा ईमेल खुला है, ताकि मैं उसका नाम लिए बिना जवाब देने को कह सकूं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

पेज बदलने पर ऐप अपनी मौजूदा स्क्रीन स्थिति एक साझा route-state hook में लिखता है। हर एजेंट टर्न में मौजूदा स्क्रीन का स्नैपशॉट शामिल होता है, ताकि एजेंट दृश्य और चुने आइटम को जाने।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Context Awareness

Rule

Apps can sync semantic navigation state when the route changes by using the shared route-state hook. When screen context is available, Core includes a <current-screen> snapshot in each agent turn, so the agent can get basic route context without first calling another tool. Apps can add concise visible-record details to that snapshot and expose selection in tab-scoped state.

Why

Without context awareness, the agent is blind. It asks "which email?" when the user is staring at one. It cannot act on the current selection, cannot provide relevant suggestions, and cannot modify what the user sees. Context awareness is what makes the agent feel like a collaborator rather than a disconnected chatbot.

The Core Patterns

1. Navigation State (navigation key)

Use the shared route-state hook to write a tab-scoped navigation key as the route changes. Include semantic screen state such as the view, open IDs, active tab, and focused object.

UI side — use useAgentRouteState in the app's route-state hook. The app can wrap it in an app-owned useNavigationState hook to map route paths to semantic views and consume the agent's navigate command.

// app/hooks/use-navigation-state.ts
import { useAgentRouteState } from "@agent-native/core/client/navigation";
import { TAB_ID } from "@/lib/tab-id";

export function useNavigationState() {
  useAgentRouteState({
    browserTabId: TAB_ID,
    requestSource: TAB_ID,
    getNavigationState: ({ pathname, searchParams }) => ({
      view:
        pathname === "/"
          ? "home"
          : pathname === "/sign-in"
            ? "sign-in"
            : pathname.replace(/^\/+/, ""),
      // Optional semantic alias. Raw query params are already exposed in
      // <current-url> and controllable with set-search-params.
      label: searchParams.get("label"),
    }),
    getCommandPath: (command: any) =>
      command.path ?? `/${command.view === "home" ? "home" : command.view}`,
  });
}

The default scaffold uses /home for home and /sign-in for authentication; / redirects according to the configured home route. Map navigation to the app's actual routes and pass an explicit path for destinations that do not follow the /<view> convention.

TAB_ID comes from the framework's getBrowserTabId() (see the scaffolded app/lib/tab-id.ts; never redefine it). The server resolves tab-scoped application_state writes and page-local WebMCP calls (X-Agent-Native-Browser-Tab) against this same id, so a hand-rolled random id silently breaks selection sync for hidden and background tabs.

Agent side — read before acting:

import { readAppState } from "@agent-native/core/application-state";

const navigation = await readAppState("navigation");
// e.g. { view: "thread", threadId: "abc123", subject: "Re: Q3 Planning" }

What to include in navigation state:

  • view — the current page/section (e.g., "inbox", "form-builder", "dashboard")
  • Item IDs — the selected/open item (e.g., threadId, formId, issueKey)
  • Semantic aliases — label names, active tabs, focused row, or stable filter names the agent should reason about
  • Focused object IDs and active tabs that are not already represented by URL state

Keep text-selection ranges and excerpts in the tab-scoped selection key, not in navigation.

Raw URL query params are already synced by the framework to __url__ and shown to the built-in agent as <current-url>. Keep shareable filters in URL state, then use view-screen to summarize important query params as activeFilters when helpful.

Keep application_state values small. Do not store pasted files, base64 images, recording chunks, screenshots, or other large blobs in navigation or app-state keys; upload them and store only a URL or storage handle.

Selection state

For app-owned per-tab selection, suffix the key with TAB_ID; requestSource labels the write origin but does not scope the key. Keep the value to stable ids and a short label or excerpt, never the full document:

import { writeClientAppState } from "@agent-native/core/client/hooks";
import { TAB_ID } from "@/lib/tab-id";

await writeClientAppState(
  `selection:${TAB_ID}`,
  { kind: "text", id: "artifact-123", text: "short excerpt" },
  { requestSource: TAB_ID },
);

A server action can read that tab's value with readAppStateForCurrentTab("selection"). A view-screen result may include the selection and a specific next a

अक्सर पूछे जाने वाले सवाल

स्नैपशॉट में क्या शामिल है?

इसमें मौजूदा दृश्य और खुले IDs, सक्रिय tab और फ़ोकस किए रिकॉर्ड जैसे विवरण शामिल हैं।

क्या स्क्रीन देखने के लिए एजेंट को tool कॉल करना होगा?

बुनियादी route संदर्भ हर टर्न में शामिल होता है, इसलिए उसके लिए अतिरिक्त tool कॉल नहीं चाहिए।

क्या एजेंट मेरा देखा हुआ बदल सकता है?

स्किल navigate actions को कवर करती है, जो एजेंट को यूज़र को किसी स्क्रीन पर ले जाने देते हैं।

जानकारी

लेखक का मूल विवरण

How the agent knows what the user is looking at. Use when exposing UI state to the agent, implementing view-screen or navigate actions, wiring navigation state, or debugging agent context issues.

repo: BuilderIO/agent-native

लोकप्रियता

GitHub स्टार
7.6k
रैंकिंग में स्थान
#13148
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

design-exploration

7.6k

यह आपके एजेंट को UI के कई डिज़ाइन विकल्प साथ-साथ दिखाने, आपकी पसंद चुनवाने और फिर चुने डिज़ाइन को सुधारने में मदद करती है।

डिज़ाइनइंटरफ़ेस (UI/UX)

visual-edit

7.6k

यह आपके एजेंट को चल रहे लोकल ऐप को विज़ुअल एडिटर में खोलने देती है, ताकि आप उसकी असली स्क्रीन एक साथ देखकर संपादित कर सकें।

डिज़ाइनइंटरफ़ेस (UI/UX)

turn-into-app

7.6k

यह किसी वर्कफ़्लो, स्प्रेडशीट या प्रोजेक्ट को भरी हुई स्क्रीन वाले विज़ुअल ऐप में बदलती है, जिसके कंट्रोल के पीछे एजेंट काम करता है।

कोडिंगसामान्य कोडिंग

visual-plan

7.6k

यह सादे टेक्स्ट वाली योजना को डायग्राम, फ़ाइल नक्शों, कोड अंश और खुले सवालों वाली इंटरैक्टिव विज़ुअल योजना में बदलती है।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

मिलती-जुलती skills