agentleFS
PAIR-codePAIR-code/deliberate-lab/frontend/AGENTS.md

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.

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

    Use SASS variables and mixins — do not hardcode colors, spacing, or font values

    line 115

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 tests

For 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.html

Component architecture

src/components/ — Feature components

Organized into 17 subdirectories by feature area:

DirectoryPurpose
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 .css and .scss for styles. button, icon, icon_button, textarea, textarea_template, and tooltip use plain .css; menu and info_popup use .scss. Follow the existing pattern when modifying a primitive.

Service layer

MobX-based services in src/services/:

ServiceRole
service.tsAbstract Service base class (all services extend this)
initialization.service.tsOrchestrates app startup (initializes analytics, Firebase, routing)
firebase.service.tsFirebase connection (Firestore, Auth)
auth.service.tsAuthentication and login state
experiment.manager.tsExperiment data management (largest service)
experiment.editor.tsExperiment editing state
experiment.service.tsCurrent experiment subscription
participant.service.tsParticipant state and stage progress
participant.answer.tsParticipant answer management
cohort.service.tsCohort management
router.service.tsApp routing and page definitions
home.service.tsHome page experiment list
settings.service.tsApp settings
admin.service.tsAdmin operations
analytics.service.tsGoogle Analytics
presence.service.tsParticipant 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:

PatternPurpose
<stage_type>_config.tsExperimenter-facing configuration editor
<stage_type>_preview.tsParticipant-facing stage view
<stage_type>_answer.tsAnswer/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

FileRole
src/app.tsRoot app component and page rendering
src/index.tsApp entry point
src/service_provider.tsMobX service dependency injection
src/shared/callables.tsTyped 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

  1. Hardcoding colors or spacing — use SASS variables and mixins from src/sass/. Do not hardcode hex colors, pixel sizes, or font values.
  2. Mixing CSS formats in pair-components — check the existing style file format (.css vs .scss) before editing a primitive's styles.
  3. Forgetting to register a new service — new services must be instantiated in src/service_provider.ts and extend the Service base class.

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.