frontend-ui
Skill329 starsChanged 7 days agoMIT-0View on GitHub
Use for React, TypeScript and Cloudscape changes in src/ui: components, shared hooks, and loading, empty and error states.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- fossasia/eventyaytheir own version, first seen Oct 8, 2026
- unreadlogs/AutarkChattheir own version, first seen Aug 1, 2026
- pyaephyo11979/rent4Utheir own version, first seen Jun 24, 2026
- instantX-research/skillstheir own version, first seen Apr 2, 2026
- WomenDefiningAI/claude-code-skillstheir own version, first seen Nov 1, 2025
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- fossasia/eventyay★ 1.7ksame name
- instantX-research/skills★ 11same name
- WomenDefiningAI/claude-code-skills★ 10same name
- pyaephyo11979/rent4U★ 4same name
- unreadlogs/AutarkChat★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository42 other files it gives its agents.
- .claude/rules/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-modelSkill
- agent-capability-reviewSkill
- api-rbac-testSkill
- backend-lambdaSkill
- code-reviewSkill
- create-hf-dataset-prSkill
- curate-security-resultsSkill
- cut-release-changelogSkill
- dependabot-prsSkill
- documentationSkill
- extraction-pipelineSkill
- fix-single-issueSkill
- full-test-batterySkill
- infrastructureSkill
- live-auth-checksSkill
- live-eval-and-costSkill
- prepare-changelogSkill
- prep-develop-for-releaseSkill
- product-demoSkill
- pr-review-ciSkill
- pr-reviewSkill
- releaseSkill
- release-validationSkill
- remove-classification-flat-keysSkill
- repo-quality-reviewSkill
- run-benchmarksSkill
- run-stack-testsSkill
- srt-security-scanSkill
- sync-pii-anonymizerSkill
- testing-qaSkill
- test-upgradeSkill
- transform-deploy-testSkill
- ui-i18nSkill
- update-solution-profileSkill
- ux-test-ciSkill
- ux-testSkill
- ux-test-stories-ciSkill
- ux-test-storiesSkill
- work-the-backlog-hazardsSkill
- work-the-backlogSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
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
- Distinctive: line 124
Use Amplify's ConsoleLogger per component:
- Very specific: line 147
Do not import generateClient from aws-amplify/api — no GraphQL endpoint is configured in Amplify, so it throws.
- Very specific: line 154
Use the useGraphqlApi hook (hooks/use-graphql-api.ts) for document queries/mutations.
- Very specific: line 203
Import Cloudscape global styles: import '@cloudscape-design/global-styles/index.css'
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frontend UI Development — GenAI IDP Accelerator
Stack
- Framework: React 18.3 + TypeScript 5.9 (strict mode)
- UI Library: Cloudscape Design System v3 (
@cloudscape-design/components) - Bundler: Vite 7.3 with
@vitejs/plugin-react(automatic JSX) - Auth: AWS Amplify v6 + Cognito (
@aws-amplify/ui-react) - API: API Gateway REST API —
POST /op/<field>behind a Cognito User Pools authorizer — reached through a GraphQL-shaped client shim (src/api/client-shim.ts→src/api/rest-client.ts). Operation documents and TypeScript types are still generated fromschema.graphqlviacodegen.config.mjs. AppSync has been removed. - Router: react-router-dom v6 (HashRouter)
- State: React Context +
immer(NO Redux) - Node:
>=26.0.0, npm>=10.0.0 - Module: ESM (
"type": "module") - Test: Vitest + jsdom
Path Alias
@/ → ./src/ (configured in both tsconfig.json and vite.config.js)
import { useAppContext } from '@/contexts/app';Component Pattern (MUST follow)
Arrow function components are ENFORCED by ESLint:
import React, { useState, useEffect, useMemo } from 'react';
import { Table, Pagination, TextFilter, Box, SpaceBetween } from '@cloudscape-design/components';
import { useCollection } from '@cloudscape-design/collection-hooks';
import { ConsoleLogger } from 'aws-amplify/utils';
const logger = new ConsoleLogger('MyComponent');
const MyComponent = (): React.JSX.Element => {
// 1. Hooks (context, state, refs, navigation)
const { user } = useAppContext();
const [data, setData] = useState<MyType[]>([]);
const navigate = useNavigate();
// 2. Effects
useEffect(() => {
// ...
}, []);
// 3. Memos / derived state
const filtered = useMemo(() => data.filter(...), [data]);
// 4. Handlers
const handleClick = () => { ... };
// 5. Render
return (
<SpaceBetween size="l">
<Table items={filtered} ... />
</SpaceBetween>
);
};
export default MyComponent;Directory Structure
src/ui/src/
├── App.tsx # Root: ThemeProvider > Authenticator.Provider > AppContent
├── index.tsx # Entry point
├── components/ # 27 feature directories + common/
│ ├── common/ # Shared (tables, modals, labels, download helpers)
│ ├── agent-chat/
│ ├── document-list/
│ ├── document-details/
│ ├── configuration-layout/
│ ├── json-schema-builder/
│ ├── test-studio/
│ └── ...
├── contexts/ # React Context providers
│ ├── app.ts # AppContext (auth, config, navigation)
│ ├── agentChat.tsx
│ ├── analytics.tsx
│ ├── documents.ts
│ └── settings.ts
├── api/ # Transport: rest-client.ts, client-shim.ts (GraphQL-shaped
│ # facade), stream-client.ts (chat SSE), auth-session.ts
├── hooks/ # 35 custom hooks (use-kebab-case.ts for new ones)
├── routes/ # Route definitions (AuthRoutes, UnauthRoutes, etc.)
├── graphql/ # Operation documents + generated types — DO NOT EDIT
│ # generated/ manually; run `make codegen`
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── constants/ # App constants
└── data/ # Static data (e.g., standard-classes.json)Context Pattern
// Definition (contexts/app.ts)
export interface AppContextValue {
authState: string;
awsConfig: Record<string, unknown> | undefined;
user: AuthUser | undefined;
}
export const AppContext = createContext<AppContextValue | null>(null);
const useAppContext = (): AppContextValue => {
const ctx = useContext(AppContext);
if (!ctx) throw new Error('useAppContext must be used within AppContext.Provider');
return ctx;
};
export default useAppContext;Auth Pattern
import { useAuthenticator } from '@aws-amplify/ui-react';
import { fetchAuthSession } from 'aws-amplify/auth';
const { user, signOut } = useAuthenticator();
const session = await fetchAuthSession();
const credentials = session.credentials;Logging Pattern
Use Amplify's ConsoleLogger per component:
import { ConsoleLogger } from 'aws-amplify/utils';
const logger = new ConsoleLogger('ComponentName');
logger.debug('message');
logger.error('error', error);API transport (GraphQL-shaped, REST underneath)
AWS AppSync has been removed; zero AWS::AppSync resources exist in any
template. The UI calls a single route — POST /op/{field} on an API Gateway
REST API (logical id HttpApi in nested/api-resolvers/template.yaml) behind
the HttpApiAuthorizer Cognito User Pools authorizer — which is served by the
dispatcher Lambda HttpApiDispatcherFunction. The dispatcher looks the field up
in a field→function map and either invokes the resolver Lambda or answers
in-process from DynamoDB. See docs/migration-appsync-to-rest.md.
- The call shape is carried over from the Amplify/AppSync client and deliberately
left unchanged:
import { generateClient } from '@/api/client-shim', thenawait client.graphql({ query, variables }). The shim parses the field name out of the query document and POSTs to${VITE_API_BASE_URL}/op/<field>. Do not importgenerateClientfromaws-amplify/api— no GraphQL endpoint is configured in Amplify, so it throws. Amplify is used for Cognito token retrieval only. - Types and operation documents are auto-generated via
make codegen(usescodegen.config.mjs) fromnested/api-resolvers/src/api/schema.graphql. Generated files live insrc/graphql/generated/— NEVER edit manually.make codegen-checkgates drift and runs frommake lint. - Use the
useGraphqlApihook (hooks/use-graphql-api.ts) for document queries/mutations. The name and the GraphQL-shaped operations are retained for continuity; the transport is REST. - There are no subscriptions. Status updates come from polling: the
usePollinghook (hooks/use-polling.ts) runs a callback on an interval and pauses while the browser tab is hidden, firing immediately when it becomes visible again. Document list ~5 s, open document ~4 s until terminal status, circuit breaker ~15 s. When you add a live-updating view, add a poll — do not look for a subscription to hook into. - Chat tokens do stream, but not through the REST API: the browser reads a
Lambda Function URL (
ChatStreamProcessorUrl,InvokeMode=RESPONSE_STREAM,AuthType=AWS_IAM) directly, SigV4-signing with the Cognito Identity Pool credentials. Seesrc/api/stream-client.ts. - Authorization is not enforced at the API edge. The Cognito authorizer only
authenticates; each resolver re-checks the caller's Cognito groups. A UI change
that exposes a new operation still needs the server-side group check and an
entry in the RBAC baseline — see
.claude/skills/api-rbac-test/SKILL.md.
Key Dependencies
| Package | Purpose |
@cloudscape-design/components v3 | UI components |
@cloudscape-design/collection-hooks | Table/collection utilities |
@cloudscape-design/chat-components | Chat UI |
@monaco-editor/react | Code editor |
chart.js + react-chartjs-2 | Charts |
recharts | Alternative charts |
react-markdown + remark-gfm | Markdown rendering |
@dnd-kit/core + @dnd-kit/sortable | Drag and drop |
pdfjs-dist | PDF rendering |
dompurify | HTML sanitization |
immer | Immutable state updates |
ESLint / Prettier Config
- Flat config (
eslint.config.js) - Prettier:
printWidth: 140,singleQuote: true,trailingComma: 'all' - Max line length: 140 (ignoring URLs, templates, comments, strings)
- Components: Arrow functions enforced (
react/function-component-definition) - Unused vars: Warn (ignore
_prefixed) - No explicit any: Warn
- react-hooks/exhaustive-deps: OFF (intentionally disabled)
- Linebreak: Unix only
Hook File Naming
- NEW hooks: kebab-case (
use-my-hook.ts) - Legacy hooks: camelCase (
useMyHook.ts) — don't rename existing ones
CSS
- CSS Modules with
camelCaseconvention - Import Cloudscape global styles:
import '@cloudscape-design/global-styles/index.css'
Commands
make ui-lint # Lint + typecheck (checksum-cached; a cache hit prints
# "⏭️ UI lint SKIPPED" and runs neither eslint nor tsc.
# FORCE=1 runs them. `make lint-cicd` sets
# UI_LINT_NO_SKIP=1, so that target never skips)
make ui-build # Production build
make ui-start STACK_NAME=<name> # Dev server on port 3000
make codegen # Regenerate GraphQL types
make codegen-check # Verify generated types are up to date
cd src/ui && npm run lint -- --fix # Direct ESLint fix
cd src/ui && npm run typecheck # Direct TypeScript checkDoes 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
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.

