agentleFS
nullpointexception-inullpointexception-i/agent-sphere/agent-sphere-ui/AGENTS.md

agent-sphere / agent-sphere-ui

AGENTS.md78 starsChanged 18 days agoMITView on GitHub

React 19 / UmiJS Max / Ant Design Pro. Node >= 20. Independent npm project; run commands in this directory. Validation order: npm run biome → npm run lint → npm test. No raw status strings or polling numbers in pages/components. Use shared constants:

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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. Distinctive:

    No raw status strings or polling numbers in pages/components.

    line 35
  2. Very specific:

    Never compare raw 'RUNNING'/'FAILED'/'ACTIVE' in page code.

    line 46
  3. Distinctive:

    Do not import Java constants.

    line 48
  4. Distinctive:

    Prefer small, focused components over files with many unrelated helpers.

    line 57
  5. Very specific:

    Default locale zh-CN; add new copy to both src/locales/zh-CN and src/locales/en-US.

    line 69
  6. Distinctive:

    No third-party site brand/domain in code, comments, tests, or locale files.

    line 74
  7. Very specific:

    Keep the /stream dev proxy headers (Accept-Encoding / Cache-Control: no-transform).

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
AGENTS.md

AgentSphere Admin UI (agent-sphere-ui)

React 19 / UmiJS Max / Ant Design Pro. Node >= 20. Independent npm project; run commands in this directory.

Commands

npm run dev            # :8000, MOCK=none, /api proxied to :8080
npm run build
npm run biome          # biome check --write (auto-fix)
npm run lint           # biome lint + tsc (check only)
npm run tsc            # tsc --noEmit
npm test               # jest
npm run test:coverage  # jest --coverage

Validation order: npm run biome → npm run lint → npm test.

Routing and structure

  • Routes are configuration-based: config/routes.ts.
  • Page directories map to backend domains: chat, instances, model-providers, capabilities/*, tasks, artifacts, admin, account, user.
  • src/.umi/** is generated by max dev / max setup; never edit by hand.
  • Aliases: @/* → src, @@/* → src/.umi, @root/* → repo root.
  • Service client: src/services/agentSphere/api.ts (hand-written, BASE = '/api/v1'). Biome ignores src/services and mock; keep that client clean manually.

Biome

  • Single quotes, space indentation, jsxRuntime: reactClassic.
  • noExplicitAny and useExhaustiveDependencies are disabled.
  • .npmrc must keep legacy-peer-deps=true.

Magic values and constants

No raw status strings or polling numbers in pages/components. Use shared constants:

  • src/constants/status.ts — STATUS (RUN, WORK_ITEM, TASK, CLEANUP, SKILL_SYNC, ACTIVE, DISABLED, ENABLED), status metadata maps, terminal/active sets.
  • src/constants/timeline.ts — TIMELINE_STATE, TODO_STATUS, COMPLETED_TIMELINE_STATES.
  • src/constants/timing.ts — TIMING (polling, SSE, clocks, copy reset, etc.).
  • src/constants/api.ts / endpoints.ts — API_BASE, API_PATHS.
  • src/constants/permissions.ts — PERM.
  • src/constants/pagination.ts — DEFAULT_PAGE_SIZE, LARGE_PAGE_SIZE.

Rules:

  • Never compare raw 'RUNNING'/'FAILED'/'ACTIVE' in page code; use STATUS or domain-specific maps.
  • Domain-specific states stay separate; do not create one universal status map.
  • Do not import Java constants; keep values in sync manually.

Layering and file size

  • Flow: pages → components → hooks → services → constants.
  • Large pages should extract:
    • pure logic → *Model.ts
    • presentational rows/cards → rows/ or dedicated components
    • data/streaming logic → hooks
  • Prefer small, focused components over files with many unrelated helpers.

Testing

  • Jest + jsdom; TypeScript/TSX transformed by jest.transform.js (esbuild).
  • jest.config.js maps @/, @@/, @root/; CSS uses test/styleStub.js.
  • test/mocks/umijs-max.js provides useIntl, getLocale, history, etc.
  • Current suites cover timeline model, workspace conversation model, tool renderers, agent stream store, status/timing constants.
  • Current baseline: about 69 tests. Keep npm test green.

i18n

  • Default locale zh-CN; add new copy to both src/locales/zh-CN and src/locales/en-US.
  • moment is rewritten to dayjs via moment2dayjs.

Hard rules

  • No third-party site brand/domain in code, comments, tests, or locale files.
  • Keep the /stream dev proxy headers (Accept-Encoding / Cache-Control: no-transform); removing them breaks SSE.

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.