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.
- AGENTS.mdAGENTS.md
- agent-sphere/AGENTS.mdAGENTS.md
- agent-sphere-chrome-extension/AGENTS.mdAGENTS.md
- agent-sphere-copilot-widget/AGENTS.mdAGENTS.md
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
- Distinctive: line 35
No raw status strings or polling numbers in pages/components.
- Very specific: line 46
Never compare raw 'RUNNING'/'FAILED'/'ACTIVE' in page code.
- Distinctive: line 48
Do not import Java constants.
- Distinctive: line 57
Prefer small, focused components over files with many unrelated helpers.
- Very specific: line 69
Default locale zh-CN; add new copy to both src/locales/zh-CN and src/locales/en-US.
- Distinctive: line 74
No third-party site brand/domain in code, comments, tests, or locale files.
- Very specific: line 75
Keep the /stream dev proxy headers (Accept-Encoding / Cache-Control: no-transform).
≈ “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.
Files
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 --coverageValidation 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 bymax 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 ignoressrc/servicesandmock; keep that client clean manually.
Biome
- Single quotes, space indentation,
jsxRuntime: reactClassic. noExplicitAnyanduseExhaustiveDependenciesare disabled..npmrcmust keeplegacy-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; useSTATUSor 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
- pure logic →
- Prefer small, focused components over files with many unrelated helpers.
Testing
- Jest + jsdom; TypeScript/TSX transformed by
jest.transform.js(esbuild). jest.config.jsmaps@/,@@/,@root/; CSS usestest/styleStub.js.test/mocks/umijs-max.jsprovidesuseIntl,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 testgreen.
i18n
- Default locale
zh-CN; add new copy to bothsrc/locales/zh-CNandsrc/locales/en-US. momentis rewritten todayjsviamoment2dayjs.
Hard rules
- No third-party site brand/domain in code, comments, tests, or locale files.
- Keep the
/streamdev proxy headers (Accept-Encoding/Cache-Control: no-transform); removing them breaks SSE.
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
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.

