add-portal-screen

Creates new screens and components for the Authgear portal React frontend.

2.0k|126|Updated Jun 16, 2020
One-click install
npx skills add https://github.com/authgear/authgear-server --skill add-portal-screen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-portal-screen
Source: https://github.com/authgear/authgear-server/tree/main/.claude/skills/add-portal-screen
Command: npx skills add https://github.com/authgear/authgear-server --skill add-portal-screen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adding a new page or UI component to the Authgear portal requires following many project-specific conventions—file structure, form state patterns, GraphQL code generation, CSS modules, and route registration—that are easy to get wrong without deep familiarity with the codebase.

Core Features & Use Cases

  • Screen scaffolding guidance: Defines where screens and components live, naming conventions (kebab-case directories, PascalCase files), and the standard outer/inner component anatomy with form state helpers.
  • GraphQL integration: Explains the two separate GraphQL APIs (Admin API and Portal API), how to write .graphql query files, and how to run npm run gentype to generate typed Apollo hooks.
  • Styling and quality checks: Enforces Tailwind-based CSS module conventions and requires running npm run typecheck and npm run eslint before finishing.
  • Use Case: When asked to add a new fraud-protection settings tab to the portal, the Skill walks through reading an existing reference screen, creating the screen files, registering the lazy route in AppRoot, writing the GraphQL query, and passing all lint and type checks.

Quick Start

Add a new portal screen for managing webhook settings with a configuration form and register it in the app routes.

Frequently Asked Questions about add-portal-screen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new screen to the Authgear portal?

Create a kebab-case directory under portal/src/screens/ containing a PascalCase screen file and its .module.css file, following the outer data-shell and inner content component pattern. Then register it as a lazy-loaded route in portal/src/AppRoot.tsx.

How do I write a GraphQL query in the Authgear portal?

Create a .graphql file in portal/src/graphql/adminapi/query/ or portal/src/graphql/portal/query/ depending on the data scope, then run npm run gentype from the portal directory. Import the generated typed hook from the .generated.ts file rather than writing inline gql documents.

What is the difference between the Admin API and Portal API in Authgear?

The Admin API serves app-level data such as users, audit logs, and fraud protection stats, with queries typically taking an appID variable. The Portal API serves portal-level data like subscriptions, feature flags, and the app list.

When should I extract a component into portal/src/components?

Extract a component when it grows large, such as a tab with its own state, a repeated card pattern, or a self-contained panel. Pass specific values and typed callbacks instead of the raw form object, and keep state close to its consumer.

Why does eslint fail with no-unnecessary-condition after adding a portal screen?

This error occurs when a condition is provably always true or false at the call site, such as passing isActive={selectedKey === "overview"} inside a branch where that condition is already guaranteed. Remove the redundant check or prop to resolve it.