deliberate-lab / frontend
AGENTS.md97 starsChanged 57 days agoApache-2.0View on GitHub
Lit Element + MobX single-page application built with Webpack. See also frontend/README.md for additional context on routing, Firebase setup, and experiment configuration. See also: root AGENTS.md for monorepo-wide conventions. From the repository root: For local dev, copy config files first (or use run_locally.sh which handles this automatically): Organized into 17 subdirectories by feature area: Standalone UI primitives: button, icon, icon_button, textarea, textarea_template, tooltip, menu, info_popup. Also contains types.ts (shared primitive types) and utils.ts (helper functions). These are general-purpose and not…
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 31,774 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- functions/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- utils/AGENTS.mdAGENTS.md
- eval-prSkill
- ghSkill
- pr-test-planSkill
- retrospectiveSkill
- workspace-overviewSkill
- workspace-syncSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 115
Use SASS variables and mixins — do not hardcode colors, spacing, or font values
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md — frontend
Lit Element + MobX single-page application built with Webpack.
See also frontend/README.md for additional context on routing,
Firebase setup, and experiment configuration.
See also: root AGENTS.md for monorepo-wide conventions.
Build & test
From the repository root:
npm run start -w frontend # Build + serve (dev, localhost:4201)
npm run build -w frontend # Dev build only
npm run build:prod -w frontend # Production build
npm test -w frontend # Run Jest testsFor local dev, copy config files first (or use run_locally.sh which
handles this automatically):
cp frontend/firebase_config.example.ts frontend/firebase_config.ts
cp frontend/index.example.html frontend/index.htmlComponent architecture
src/components/ — Feature components
Organized into 17 subdirectories by feature area:
| Directory | Purpose |
stages/ | Stage config, preview, and answer components (largest subdirectory) |
experiment_builder/ | Experiment creation/editing UI |
experiment_dashboard/ | Experiment monitoring dashboard |
experimenter/ | Experimenter-facing views |
participant_view/ | Participant-facing experiment UI |
chat/ | Chat interface components |
header/ | App header (includes routing logic) |
sidenav/ | Side navigation (includes routing logic) |
login/ | Authentication UI |
settings/ | App settings |
gallery/ | Experiment gallery/templates |
progress/ | Progress indicators |
popup/ | Modal/popup components |
participant_profile/ | Participant profile display |
avatar_picker/ | Avatar selection UI |
admin/ | Admin panel |
shared/ | Shared component utilities |
src/pair-components/ — Reusable primitives
Standalone UI primitives: button, icon, icon_button, textarea,
textarea_template, tooltip, menu, info_popup. Also contains
types.ts (shared primitive types) and utils.ts (helper functions).
These are general-purpose and not tied to project state.
shared.css in this directory provides base styles used across primitives.
[!NOTE] Primitives use a mix of
.cssand.scssfor styles.button,icon,icon_button,textarea,textarea_template, andtooltipuse plain.css;menuandinfo_popupuse.scss. Follow the existing pattern when modifying a primitive.
Service layer
MobX-based services in src/services/:
| Service | Role |
service.ts | Abstract Service base class (all services extend this) |
initialization.service.ts | Orchestrates app startup (initializes analytics, Firebase, routing) |
firebase.service.ts | Firebase connection (Firestore, Auth) |
auth.service.ts | Authentication and login state |
experiment.manager.ts | Experiment data management (largest service) |
experiment.editor.ts | Experiment editing state |
experiment.service.ts | Current experiment subscription |
participant.service.ts | Participant state and stage progress |
participant.answer.ts | Participant answer management |
cohort.service.ts | Cohort management |
router.service.ts | App routing and page definitions |
home.service.ts | Home page experiment list |
settings.service.ts | App settings |
admin.service.ts | Admin operations |
analytics.service.ts | Google Analytics |
presence.service.ts | Participant online/offline presence |
Services are wired together via src/service_provider.ts, which
creates all service instances and injects dependencies. Components access
services through the service provider — see existing components for the
pattern.
Stage components
Stage UI components live in src/components/stages/. Each stage type
typically has three components:
| Pattern | Purpose |
<stage_type>_config.ts | Experimenter-facing configuration editor |
<stage_type>_preview.ts | Participant-facing stage view |
<stage_type>_answer.ts | Answer/response display component |
Styling
- Material 3 Design via SASS variables in
src/sass/:_colors.scss— color palettes and theme tokens_common.scss— shared mixins and layout utilities_typescale.scss— typography scale definitions
src/pair-components/shared.css— base styles for primitives- Use SASS variables and mixins — do not hardcode colors, spacing, or font values
Key files
| File | Role |
src/app.ts | Root app component and page rendering |
src/index.ts | App entry point |
src/service_provider.ts | MobX service dependency injection |
src/shared/callables.ts | Typed wrappers for all Cloud Function calls — every new callable endpoint in functions needs a corresponding wrapper here or it is unreachable from the UI |
src/shared/ | Shared config, constants, and utilities |
Common pitfalls
- Hardcoding colors or spacing — use SASS variables and mixins from
src/sass/. Do not hardcode hex colors, pixel sizes, or font values. - Mixing CSS formats in pair-components — check the existing style file
format (
.cssvs.scss) before editing a primitive's styles. - Forgetting to register a new service — new services must be
instantiated in
src/service_provider.tsand extend theServicebase class.
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.

