agentleFS
dream-horizon-orgdream-horizon-org/pulse/CLAUDE.md

pulse

CLAUDE.md44 starsChanged 5 months agoApache-2.0View on GitHub

Guidance for Claude Code in this repo. This is the map; per-area conventions live in .agents/rules/*.mdc (auto-loaded by file type; also reachable as .cursor/rules/ and .claude/rules/ via symlinks). Real-time mobile + web observability platform on OpenTelemetry. Mobile/web SDKs send OTLP signals → Collector → ClickHouse. A React dashboard lets teams drill into crashes, sessions, network, interactions, and web vitals. Auxiliary: backend/db/ (MySQL migrations), backend/spark/ (batch jobs), backend/{heatmap-screenshot,session-capture,session-replay}-*/ (specialty ingestion), pulse-mcp/, pulse-mobile-benchmarks/, vector/, docs/, scripts/, product/ (PRDs + web panel). DB…

  • Reads credentials

The file

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

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Always use materialized columns over map access:

    line 71
  2. Very specific:

    Every query must include: Timestamp range, LIMIT, ProjectId filter.

    line 81
  3. Very specific:

    Never commit .env — use .env.example.

    line 135
  4. Distinctive:

    Never force-push to main.

    line 136
  5. Very specific:

    Never run reset-databases.sh without explicit user confirmation.

    line 137

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

CLAUDE.md

Guidance for Claude Code in this repo. This is the map; per-area conventions live in .agents/rules/*.mdc (auto-loaded by file type; also reachable as .cursor/rules/ and .claude/rules/ via symlinks).

What Pulse Is

Real-time mobile + web observability platform on OpenTelemetry. Mobile/web SDKs send OTLP signals → Collector → ClickHouse. A React dashboard lets teams drill into crashes, sessions, network, interactions, and web vitals.

Monorepo Layout

DirectoryServiceTechPort
backend/server/REST APIJava 17, Vert.x 4.5, Guice, Maven8080
backend/pulse-alerts-cron/Alert cronJava/Vert.x4000
backend/ingestion/OTEL Collector configs + ClickHouse schemaYAML/SQL—
pulse-ui/DashboardReact 18, TS, Mantine v73000
pulse_ai/AI agentPython, Google ADK + Gemini8000
pulse-android-otel/Android SDKKotlin, OTel—
pulse-ios-otel/iOS SDKSwift—
pulse-react-native-otel/RN SDKTypeScript—
pulse-web-otel/Web SDK (alpha)TypeScript, OTLP—
deploy/Docker Compose, scripts——

Auxiliary: backend/db/ (MySQL migrations), backend/spark/ (batch jobs), backend/{heatmap-screenshot,session-capture,session-replay}-*/ (specialty ingestion), pulse-mcp/, pulse-mobile-benchmarks/, vector/, docs/, scripts/, product/ (PRDs + web panel).

Data Flow

Mobile/Web SDKs → OTEL Collector (4317/4318) → ClickHouse (otel DB)
Custom Events   → Vector (14317/14318) → S3 (Parquet) → Athena

Build & Dev Commands

# Backend
cd backend/server && mvn verify        # build + checkstyle + JaCoCo
mvn -Dtest=MyClass#myMethod test       # single test

# Frontend
cd pulse-ui && yarn install && yarn start    # :3000
yarn build && yarn lint && yarn test
yarn test --testPathPattern=ComponentName

# Web SDK (pulse-web-otel)
cd pulse-web-otel && yarn install
cd pulse-web-otel && yarn build
cd pulse-web-otel && yarn test
cd pulse-web-otel && yarn workspace ecommerce-demo dev   # React demo :3002
cd pulse-web-otel && yarn demo:docs                      # vanilla demo :3003

# AI Agent
cd pulse_ai && ./setup.sh              # :8000

# Full stack
cd deploy && ./scripts/quickstart.sh   # build + start all
./scripts/start.sh -d                  # detached
./scripts/logs.sh [service]            # server/ui/ai/cron/otel-collector
./scripts/stop.sh [-v]                 # -v removes volumes

Auth

  • Prod: Google OAuth 2.0 → JWT (access 24h, refresh 30d).
  • Dev (GOOGLE_OAUTH_ENABLED=false): mock users mock-user-1 / mock-user-2, project default-project, key default-project_devkey01.

ClickHouse Essentials

DB otel. Key tables: otel_traces, otel_logs, otel_metrics_gauge, stack_trace_events, interaction_heatmaps_daily.

Always use materialized columns over map access:

ColumnSource attribute
ProjectIdResourceAttributes['project.id']
PulseTypeSpanAttributes / LogAttributes['pulse.type']
PlatformResourceAttributes['os.name']
AppVersionTraces: ResourceAttributes['app.version']. Logs: ResourceAttributes['app.build_name']. stack_trace_events: use column AppVersion.
SessionIdSpanAttributes / LogAttributes['session.id']

Every query must include: Timestamp range, LIMIT, ProjectId filter. Use tenant credentials — never admin. Multi-tenant isolation via row policies per project. Detail: clickhouse-sql.mdc.

Architecture Pointers

Per-area conventions live in .agents/rules/*.mdc (the same files appear under .cursor/rules/ and .claude/rules/ via symlinks). Highlights only:

  • Backend (backend/server/, backend/pulse-alerts-cron/) — Layer order: Controller (resources/<domain>/) → Service (service/<domain>/, RxJava3) → DAO (dao/<domain>/ with Queries.java) → SQL. Guice DI, Lombok, MapStruct, ServiceError-coded errors. Primary CRUD store: MySQL (vertx-mysql-client); ClickHouse is OTEL/analytics only. Multi-tenancy: tenant/TenantContext + TenantFilter resolve projectId/user from JWT. Authorization: OpenFGA (config/OpenFgaConfig.java). JaCoCo: 80% on changed files. Detail: java-backend.mdc, alerts-cron.mdc, java-testing.mdc.
  • Frontend (pulse-ui/) — Folder-per-screen/component (Name.tsx + Name.module.css + index.ts). State: TanStack Query (server) + Zustand (client). Routing config in routes/routes.tsx; URL constants in constants/Constants.ts. API: always makeRequest<T>() from helpers/makeRequest/ — never raw fetch. Detail: react-frontend.mdc, react-testing.mdc.
  • Android SDK (pulse-android-otel/) — Kotlin, Gradle multi-module. Two package roots that must never mix: io.opentelemetry.android.* (upstream) and com.pulse.* (Pulse). Detail: android-sdk.mdc.
  • iOS SDK (pulse-ios-otel/) — Swift, SwiftPM/CocoaPods.
  • RN SDK (pulse-react-native-otel/) — TS strict. Single Pulse facade in index.tsx. Detail: react-native-sdk.mdc.
  • Web SDK (pulse-web-otel/) — Package @dreamhorizon/pulse-web (alpha). All signals carry platform = 'web'. Skills: web-sdk-instrument, web-sdk-e2e-matrix, web-sdk-ship. Sub-agents: pulse-web-sdk, web-otel-spec-audit-orchestrator. Detail: pulse-web-otel-contract.mdc, pulse-web-otel-conventions.mdc, web-sdk.mdc.

Web SDK

Data contract — every signal must carry platform = 'web'. Key pulse.type values (non-exhaustive): session.start, session.end, device.crash, non_fatal, network.<HTTP status> on outbound fetch/XHR client spans (e.g. network.200, network.0), app.click, web_vital, screen_load, screen_session. Web does not emit a separate screen_interactive span; time-to-interactive is attached to screen_load when Navigation Timing allows (pulse-web-otel/docs/instrumentations/screen-signals/SPEC.md).

Package manual (commands, test gates, doc index): pulse-web-otel/CLAUDE.md. SDK-core spec hub: pulse-web-otel/docs/sdk-core/SPEC.md. Host integration entry: pulse-web-otel/docs/instrumentations/integration/SPEC.md.

Non-trivial pulse-web-otel/ work: use web-sdk-ship (.agents/skills/web-sdk-ship/SKILL.md) for the merge-ready checklist (tests, diff audit, doc sync).

Common Tasks

Map task → skill → relevant rule(s). Run the skill rather than freelancing.

TaskSkillKey rule(s)
New REST endpointadd-api-endpointjava-backend.mdc, java-testing.mdc
New UI screenadd-ui-screenreact-frontend.mdc, react-testing.mdc
New shared UI componentadd-ui-componentreact-frontend.mdc, react-testing.mdc
New AI sub-agent / tooladd-ai-sub-agentpython-ai-agent.mdc
Alert metric (cross-cutting)add-alert-metricalerts-cron.mdc, clickhouse-sql.mdc, java-backend.mdc
ClickHouse schema changeclickhouse-migrationclickhouse-sql.mdc
Web SDK implementation / verificationweb-sdk-instrument, web-sdk-e2e-matrix, web-sdk-shippulse-web-otel-contract.mdc, pulse-web-otel-conventions.mdc, web-sdk.mdc
Integrate pulse-web SDK into a host app (vanilla / React / Next)integrate-pulse-web-sdkpulse-web-otel/docs/instrumentations/integration/SPEC.md
Build/run a service locallydeploy-servicedocker-deploy.mdc
PR reviewpr-reviewpr-workflow.mdc, commit-conventions.mdc

Workflows, Skills, Agents, Commands

.cursor/{skills,agents,commands,rules}/ and .claude/{skills,agents,commands,rules}/ symlink to .agents/ — single canonical copy for both tools.

  • Skills (.cursor/skills/) — prefer these over freelancing: add-api-endpoint, add-ui-screen, add-ui-component, add-ai-sub-agent, add-alert-metric, clickhouse-migration, deploy-service, pr-review, web-sdk-instrument, web-sdk-e2e-matrix, web-sdk-ship, integrate-pulse-web-sdk, pulse-prd-author, pulse-prd-review.
  • Sub-agents (.cursor/agents/) — delegate by area: backend-engineer, frontend-engineer, ai-agent-engineer, mobile-sdk-engineer, pulse-web-sdk, web-otel-spec-audit-orchestrator, devops-engineer, data-analyst, debugger, pr-reviewer, unit-test-author, backend-test-runner, mock-server-maintainer.
  • Slash commands (.cursor/commands/) — quickstart, start/stop/check-services, view-logs, build-{backend,ui,ai}, run-{backend,ui}-tests, lint-ui, query-clickhouse, create-pr, review-my-changes, find-existing, onboard, etc.

Commits & PRs

<type>(<scope>): <description> — max 72 chars, imperative. Types: feat fix refactor docs test chore ci perf build. Scopes: backend ui ai android-sdk ios-sdk rn-sdk web-sdk deploy alerts-cron ingestion. Branches: feat/* · fix/* · release/v*. PR template: Summary → Context → What Changed → Screenshots. Detail: commit-conventions.mdc, pr-workflow.mdc.

Safety

  • Never commit .env — use .env.example.
  • Never force-push to main.
  • Never run reset-databases.sh without explicit user confirmation.

Session Defaults

.claude/CLAUDE.md adds session defaults (e.g. caveman terse-reply mode); auto-loaded alongside this file.

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.