Skip to content

Commit aab6750

Browse files
authored
docs: some updates to agents files (#149)
1 parent 1a2b384 commit aab6750

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

AGENTS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
React Native app for WMBR radio streaming (live + archives), schedules, and playlists.
44

5+
## Genereal Guidelines
6+
7+
- Prefer code legibility over succinctness or robustness. A human will be
8+
evaluating what you write, so write with that in mind.
9+
- Err on the side of over-commenting. Again, a human will be reading your code,
10+
and inline comments can help them to understand it.
11+
- Always explain edits before you attempt to make them, so I can understand what
12+
you're doing.
13+
- When looking for files, please note:
14+
- Imports are using aliases. Check tsconfig.json to see what they are.
15+
- Imports commonly exclude the file extension. If an import refers to, for
16+
instance, `@app/Page`, the actual file may be `src/app/Page.{ts,tsx}` or
17+
`src/app/Page/index.{ts,tsx}`.
18+
- Don't use the global `React` to access hooks or types; always import them
19+
explicitly from 'react' (e.g. `import React, { useState } from 'react'`).
20+
- Use variable names that are easy to understand. Avoid abbreviations, like `s`
21+
for `state` or `p` for `progress`.
22+
523
## Project Structure
624

725
- **App Shell & Tabs**: `src/app/index.tsx` (Bottom tab navigator + custom bar)

__tests__/AGENTS.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Render stacks/containers for navigation-dependent components. Example: prefer `r
4141
## Async & Query Strategy
4242

4343
- Prefer `await screen.findBy*()` queries for async/network-driven elements; avoid manual `waitFor` for simple appearance checks.
44-
- Use `userEvent` for interactions rather than `fireEvent`.
44+
- Use `userEvent` for interactions rather than `fireEvent`, and import
45+
`userEvent` from `@testing-library/react-native`, not from
46+
`@testing-library/user-event`.
4547
- Query preference: `getByRole``getByLabelText``getByText``getByTestId` (last).
4648

4749
## Mocks
@@ -117,8 +119,9 @@ if (urlStr.includes('alexandersimoes.com/get_playlist')) {
117119
118120
Run tests from the repository root using npx (avoid npm argument forwarding). For machine-readable output (best for an LLM), run one test file and produce a JSON result. For example, to test `RecentlyPlayed.test.tsx`:
119121
120-
````bash
122+
```bash
121123
npx jest __tests__/RecentlyPlayed.test.tsx --runInBand --json --testLocationInResults
124+
```
122125
123126
---
124127
Resources:

0 commit comments

Comments
 (0)