Files
AutoGPT/autogpt_platform/frontend/AGENTS.md
Nicholas Tindle 88589764b5 dx(platform): normalize agent instructions for Claude and Codex (#12592)
### Why / What / How

Why: repo guidance was split between Claude-specific `CLAUDE.md` files
and Codex-specific `AGENTS.md` files, which duplicated instruction
content and made the same repository behave differently across agents.
The repo also had Claude skills under `.claude/skills` but no
Codex-visible repo skill path.

What: this PR bridges the repo's Claude skills into Codex and normalizes
shared instruction files so `AGENTS.md` becomes the canonical source
while each `CLAUDE.md` imports its sibling `AGENTS.md`.

How: add a repo-local `.agents/skills` symlink pointing to
`../.claude/skills`; move nested `CLAUDE.md` content into sibling
`AGENTS.md` files; replace each repo `CLAUDE.md` with a one-line
`@AGENTS.md` shim so Claude and Codex read the same scoped guidance
without duplicating text. The root `CLAUDE.md` now imports the root
`AGENTS.md` rather than symlinking to it.

Note: the instruction-file normalization commit was created with
`--no-verify` because the repo's frontend pre-commit `tsc` hook
currently fails on unrelated existing errors, largely missing
`autogpt_platform/frontend/src/app/api/__generated__/*` modules.

### Changes 🏗️

- Add `.agents/skills` as a repo-local symlink to `../.claude/skills` so
Codex discovers the existing Claude repo skills.
- Add a real root `CLAUDE.md` shim that imports the canonical root
`AGENTS.md`.
- Promote nested scoped instruction content into sibling `AGENTS.md`
files under `autogpt_platform/`, `autogpt_platform/backend/`,
`autogpt_platform/frontend/`, `autogpt_platform/frontend/src/tests/`,
and `docs/`.
- Replace the corresponding nested `CLAUDE.md` files with one-line
`@AGENTS.md` shims.
- Preserve the existing scoped instruction hierarchy while making the
shared content cross-compatible between Claude and Codex.

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
  - [x] Verified `.agents/skills` resolves to `../.claude/skills`
  - [x] Verified each repo `CLAUDE.md` now contains only `@AGENTS.md`
- [x] Verified the expected `AGENTS.md` files exist at the root and
nested scoped directories
- [x] Verified the branch contains only the intended agent-guidance
commits relative to `dev` and the working tree is clean

#### For configuration changes:

- [x] `.env.default` is updated or already compatible with my changes
- [x] `docker-compose.yml` is updated or already compatible with my
changes
- [x] I have included a list of my configuration changes in the PR
description (under **Changes**)

No runtime configuration changes are included in this PR.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: documentation/instruction-file reshuffle plus an
`.agents/skills` pointer; no runtime code paths are modified.
> 
> **Overview**
> Unifies agent guidance so **`AGENTS.md` becomes canonical** and all
corresponding `CLAUDE.md` files become 1-line shims (`@AGENTS.md`) at
the repo root, `autogpt_platform/`, backend, frontend, frontend tests,
and `docs/`.
> 
> Adds `.agents/skills` pointing to `../.claude/skills` so non-Claude
agents discover the same shared skills/instructions, eliminating
duplicated/agent-specific guidance content.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
839483c3b6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-04-01 09:08:51 +00:00

4.1 KiB

Frontend

This file provides guidance to coding agents when working with the frontend.

Essential Commands

# Install dependencies
pnpm i

# Generate API client from OpenAPI spec
pnpm generate:api

# Start development server
pnpm dev

# Run E2E tests
pnpm test

# Run Storybook for component development
pnpm storybook

# Build production
pnpm build

# Format and lint
pnpm format

# Type checking
pnpm types

Pre-completion Checks (MANDATORY)

After making any code changes in the frontend, you MUST run the following commands in order before reporting work as done, creating commits, or opening PRs:

  1. pnpm format — auto-fix formatting issues
  2. pnpm lint — check for lint errors; fix any that appear
  3. pnpm types — check for type errors; fix any that appear

Do NOT skip these steps. If any command reports errors, fix them and re-run until clean. Only then may you consider the task complete. If typing keeps failing, stop and ask the user.

Code Style

  • Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
  • Use function declarations (not arrow functions) for components/handlers
  • No dark: Tailwind classes — the design system handles dark mode
  • Use Next.js <Link> for internal navigation — never raw <a> tags
  • No any types unless the value genuinely can be anything
  • No linter suppressors (// @ts-ignore, // eslint-disable) — fix the actual issue
  • File length — keep files under ~200 lines; extract sub-components or hooks into their own files when a file grows beyond this
  • Function/component length — keep render functions and hooks under ~50 lines; extract named helpers or sub-components when they grow longer

Architecture

  • Framework: Next.js 15 App Router (client-first approach)
  • Data Fetching: Type-safe generated API hooks via Orval + React Query
  • State Management: React Query for server state, co-located UI state in components/hooks
  • Component Structure: Separate render logic (.tsx) from business logic (use*.ts hooks)
  • Workflow Builder: Visual graph editor using @xyflow/react
  • UI Components: shadcn/ui (Radix UI primitives) with Tailwind CSS styling
  • Icons: Phosphor Icons only
  • Feature Flags: LaunchDarkly integration
  • Error Handling: ErrorCard for render errors, toast for mutations, Sentry for exceptions
  • Testing: Playwright for E2E, Storybook for component development

Environment Configuration

.env.default (defaults) → .env (user overrides)

Feature Development

See @CONTRIBUTING.md for complete patterns. Quick reference:

  1. Pages: Create in src/app/(platform)/feature-name/page.tsx
    • Extract component logic into custom hooks grouped by concern, not by component. Each hook should represent a cohesive domain of functionality (e.g., useSearch, useFilters, usePagination) rather than bundling all state into one useComponentState hook.
      • Put each hook in its own .ts file
    • Put sub-components in local components/ folder
    • Component props should be type Props = { ... } (not exported) unless it needs to be used outside the component
  2. Components: Structure as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts
    • Use design system components from src/components/ (atoms, molecules, organisms)
    • Never use src/components/__legacy__/*
  3. Data fetching: Use generated API hooks from @/app/api/__generated__/endpoints/
    • Regenerate with pnpm generate:api
    • Pattern: use{Method}{Version}{OperationName}
  4. Styling: Tailwind CSS only, use design tokens, Phosphor Icons only
  5. Testing: Add Storybook stories for new components, Playwright for E2E. When fixing a bug, write a failing Playwright test first (use .fixme annotation), implement the fix, then remove the annotation.
  6. Code conventions:
    • Use function declarations (not arrow functions) for components/handlers
    • Do not use useCallback or useMemo unless asked to optimise a given function
    • Do not type hook returns, let Typescript infer as much as possible
    • Never type with any unless a variable/attribute can ACTUALLY be of any type
    • avoid index and barrel files