Files
Daniel DimitrovandGitHub d9accc56a1 chore: split AGENTS.md across the monorepo to fix size warning (#7785)
* chore: split AGENTS.md across the monorepo to fix size warning

Root AGENTS.md was 41.7k chars, exceeding Claude Code's 40k performance
threshold. Per the agents.md spec for monorepos, split into nested files
that agents auto-load from each subtree:

- apps/web/AGENTS.md (new): feature architecture, Storybook, web testing,
  web-specific pitfalls, debugging tips
- apps/mobile/AGENTS.md (new): Expo + Tamagui guidance
- packages/AGENTS.md (new): shared-package conventions, dual env vars
- apps/web/docs/code-style.md: appended Code Complexity Guidelines
- apps/mobile/docs/code-style.md: cross-reference to complexity rules
- root AGENTS.md: trimmed to cross-cutting rules + Nested guidance index

Root drops 41.7k -> 23.8k chars (no warning, ~16k headroom). All content
preserved in the new layout; existing nested files (cypress, .storybook)
unchanged. README, CLAUDE.md, PR template, and specs/** still reference
the (still-existing) root file.

* chore: gitignore docs/brainstorms/ like docs/plans/

Brainstorms are local working artifacts, same as plans. Remove the
accidentally-committed brainstorm file and prevent future leaks.
2026-04-30 14:35:12 +02:00

1.5 KiB
Raw Permalink Blame History

Shared Packages AI Contributor Guidelines

Guidance for shared libraries under packages/ consumed by both apps/web/ and apps/mobile/. For monorepo-wide rules, see the root AGENTS.md.

Shared Packages

  • Cross-Platform Code – Shared logic goes in packages/ directory. Consider both web and mobile when making changes.
  • Environment Handling – Use dual environment variable patterns (NEXT_PUBLIC_* || EXPO_PUBLIC_*) in shared packages. Web apps use NEXT_PUBLIC_*; mobile apps use EXPO_PUBLIC_*. Check for both prefixes in package code.
  • Store Management – The Redux store in packages/store/ is shared between web and mobile. State changes must work for both platforms.
  • Theme Package – packages/theme/ is the single source of truth for design tokens. See the root AGENTS.md "Unified Theme System" section for usage and modification guidance.

Auto-generated files

Never manually edit:

  • packages/utils/src/types/contracts/ — generated from contract ABIs.
  • packages/store/src/gateway/AUTO_GENERATED/ — generated from schema.json. Run yarn workspace @safe-global/store build:dev to regenerate.

CI will fail if AUTO_GENERATED files don't match the schema.

Testing across platforms

When changing shared code, run tests for both consumers:

yarn workspace @safe-global/web test
yarn workspace @safe-global/mobile test

Ensure shared package tests work in both web and mobile environments — test files should not assume DOM globals or React Native primitives.