agentleFS
iblaiiblai/base/skills/agents/iblai-vibe-agent-analytics/SKILL.md

iblai-vibe-agent-analytics

Skill222 starsChanged 12 days agoMITView on GitHub

Add the agent Analytics tab (AgentAnalyticsTab, a hub of report cards for one agent that hands off to your full analytics pages) to your Next.js app. Use when the user wants an Analytics tab among the agent settings tabs, links from an agent to its usage, users, topics, transcripts, costs, or reports, or mentions AgentAnalyticsTab. For the dashboards themselves see /iblai-vibe-analytics; for the REST contract see /iblai-api-analytics.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add the agent Analytics tab (AgentAnalyticsTab) -- a launcher, not a dashboard.

    line 12
  2. Very specific:

    Look for iblai.env in the project root with PLATFORM, DOMAIN, and TOKEN.

    line 43
  3. Very specific:

    Run /iblai-vibe-ops-test before telling the user the work is ready, and give every page, control and state this skill added its own …

    line 151

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/iblai-vibe-agent-analytics

Add the agent Analytics tab (AgentAnalyticsTab) -- a launcher, not a dashboard. Scope: per agent. It shows one card per analytics report (Overview, Users, Topics, Transcripts, Memory, Costs, Audit, Data Reports); clicking a card calls your onNavigate(value) so the host routes to that report, scoped to this agent. The reports themselves are the AnalyticsLayout pages from /iblai-vibe-analytics. This is one tab in the agent-settings family indexed by /iblai-vibe-agent.

Hub -- an info box, then the cards. Here Memory and Audit are excluded because the host has no route for them (vibe-starter's case).

Image: Analytics tab -- hub

Destination -- Overview routed to vibe-starter's /admin/analytics?agent=<uuid>, the org dashboard narrowed to this agent.

Image: Analytics tab -- Overview destination

Common setup (brand, conventions, env files, verification): see docs/skill-setup.md.

Prerequisites

  • Auth set up (/iblai-vibe-auth, or vibe-starter).
  • @iblai/iblai-js@^3.1.0 (resolves @iblai/web-containers 2.1.0).
  • Analytics pages to land on: vibe-starter's /admin/analytics/*, or the agent-scoped layout in /iblai-vibe-analytics ("One agent instead of the org"), mounted at /agents/<uuid>/dashboards.
  • A real agent UUID. Ask the user; never invent one.

Step 1: Check Environment

Look for iblai.env in the project root with PLATFORM, DOMAIN, and TOKEN. If it is missing, tell the user: "You need an iblai.env with your platform configuration. Download the template and fill in your values: curl -o iblai.env https://raw.githubusercontent.com/iblai/vibe/refs/heads/main/iblai.env"

Step 2: Mount AgentAnalyticsTab

The tab fetches nothing and does not read AgentSettingsProvider; it only needs onNavigate. Map each card's value to a route you have, and exclude the ones you do not:

// app/(app)/agents/[mentorId]/analytics/page.tsx
"use client";

import { AgentAnalyticsTab } from "@iblai/iblai-js/web-containers/next";
import { useParams, useRouter } from "next/navigation";

export default function AgentAnalyticsPage() {
  const router = useRouter();
  const { mentorId } = useParams<{ mentorId: string }>();

  return (
    <div className="flex h-full flex-col bg-white">
      <AgentAnalyticsTab
        // vibe-starter has no Memory or Audit analytics routes.
        excludeTabs={["memory", "audit"]}
        onNavigate={(value) =>
          router.push(`/admin/analytics${value ? `/${value}` : ""}?agent=${mentorId}`)
        }
      />
    </div>
  );
}

With the agent-scoped layout from /iblai-vibe-analytics, route to /agents/${mentorId}/dashboards/${value} (plain …/dashboards for Overview) instead and drop excludeTabs for the reports you added. Keep the dashboards off /agents/<uuid>/analytics/: that route is this hub, and the Overview card (value "") would route back to it. Hide audit unless the viewer holds /mentors/{mentorDbId}/#view_audit_logs (/iblai-vibe-rbac), as the OS does. In a modal, close it before router.push.

Step 3: Change the cards (Optional)

There is no labels prop: the copy comes from the SDK's i18n (analyticsTabLabels.*). To change a card's text, icon, or order, pass your own tabs (start from DEFAULT_ANALYTICS_HUB_TABS):

import {
  AgentAnalyticsTab,
  DEFAULT_ANALYTICS_HUB_TABS,
} from "@iblai/iblai-js/web-containers/next";

<AgentAnalyticsTab
  tabs={DEFAULT_ANALYTICS_HUB_TABS.map((t) =>
    t.value === "financial" ? { ...t, label: "Spend" } : t,
  )}
  onNavigate={(value) => console.log("open", value)}
/>;

Step 4: Use MCP Tools for Customization

get_component_info("AgentAnalyticsTab")
get_component_info("AnalyticsLayout")

<AgentAnalyticsTab> Props

Import from @iblai/iblai-js/web-containers/next.

PropTypeRequiredDescription
onNavigate(value: string) => voidYesCalled with the card's value; the host navigates
tabsAnalyticsHubTab[] ({ value, label, description, icon? })NoReplace the cards. Defaults to the localized standard set
excludeTabsstring[]NoCard values to hide (e.g. audit without permission)

Card values (they match the AnalyticsLayout routes): "" Overview, users, topics, transcripts, memory, financial (Costs), audit, reports (Data Reports).

Related Exports

From @iblai/iblai-js/web-containers/next:

  • DEFAULT_ANALYTICS_HUB_TABS -- the English card list (value, label, description, icon).
  • AGENT_ANALYTICS_TAB_LABELS -- the English fallback copy: header (title, description), infoBox, openAria(label), and tabs (label and description per card key: overview, users, topics, transcripts, memory, financial, audit, reports).
  • AnalyticsHubTab, AnalyticsTabLabels, AgentAnalyticsTabProps -- types.

Platform data

The tab itself calls no API. The pages it opens read the analytics endpoints with mentor_unique_id set to the agent: see /iblai-vibe-analytics for the hooks and the REST twin /iblai-api-analytics.

Step 5: Verify

Run /iblai-vibe-ops-test before telling the user the work is ready, and give every page, control and state this skill added its own checkpoint — one Playwright test titled <ID> · … in e2e/journeys/, listed in e2e/coverage.json; pnpm e2e:coverage must pass:

  1. pnpm build -- must pass with zero errors.
  2. pnpm test -- vitest must pass.
  3. Touch test /agents/<uuid>/analytics in the browser as /iblai-vibe-ops-test says, signed in as an admin: the cards render; click each one -- none may 404, and each lands on a report for this agent; read the console; check the phone width.

Important Notes

  • A hub, by design: the OS renders this tab inside its edit-agent modal and leaves the dialog for full-page analytics. Embed the dashboards themselves with /iblai-vibe-analytics.
  • Every card needs a route: exclude any value your app does not serve, or the click 404s.
  • vibe-starter's tab strip drops ?agent=: its app/(app)/admin/analytics/layout.tsx routes tabs without the query, so after landing on a report, switching tabs shows the whole organization. Carry ?agent= through its onTabChange if you need the scope to stick.
  • Brand guidelines: BRAND.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.