Skip to content

Commit 8833f25

Browse files
committed
.
1 parent 97dffca commit 8833f25

File tree

6 files changed

+134
-99
lines changed

6 files changed

+134
-99
lines changed

.agents/skills/skill-creator/SKILL.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ scripts/package_skill.py <path/to/skill-folder> ./dist
335335
The packaging script will:
336336

337337
1. **Validate** the skill automatically, checking:
338-
339338
- YAML frontmatter format and required fields
340339
- Skill naming conventions and directory structure
341340
- Description completeness and quality

.agents/skills/skill-creator/references/output-patterns.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ ALWAYS use this exact template structure:
1616
# [Analysis Title]
1717

1818
## Executive summary
19+
1920
[One-paragraph overview of key findings]
2021

2122
## Key findings
23+
2224
- Finding 1 with supporting data
2325
- Finding 2 with supporting data
2426
- Finding 3 with supporting data
2527

2628
## Recommendations
29+
2730
1. Specific actionable recommendation
2831
2. Specific actionable recommendation
2932
```
@@ -38,12 +41,15 @@ Here is a sensible default format, but use your best judgment:
3841
# [Analysis Title]
3942

4043
## Executive summary
44+
4145
[Overview]
4246

4347
## Key findings
48+
4449
[Adapt sections based on what you discover]
4550

4651
## Recommendations
52+
4753
[Tailor to the specific context]
4854

4955
Adjust sections as needed for the specific analysis type.
@@ -62,18 +68,22 @@ Generate commit messages following these examples:
6268
Input: Added user authentication with JWT tokens
6369
Output:
6470
```
71+
6572
feat(auth): implement JWT-based authentication
6673

6774
Add login endpoint and token validation middleware
75+
6876
```
6977
7078
**Example 2:**
7179
Input: Fixed bug where dates displayed incorrectly in reports
7280
Output:
7381
```
82+
7483
fix(reports): correct date formatting in timezone conversion
7584

7685
Use UTC timestamps consistently across report generation
86+
7787
```
7888
7989
Follow this style: type(scope): brief description, then detailed explanation.

.agents/skills/skill-creator/references/workflows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ For tasks with branching logic, guide Claude through decision points:
2525

2626
2. Creation workflow: [steps]
2727
3. Editing workflow: [steps]
28-
```
28+
```
Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jest.useFakeTimers(); // recommended when using userEvent
2121

2222
test('description', async () => {
2323
const user = userEvent.setup();
24-
render(<Component />); // sync in v13 (React 18)
24+
render(<Component />); // sync in v13 (React 18)
2525

2626
const button = screen.getByRole('button', { name: 'Submit' });
2727
await user.press(button);
@@ -36,57 +36,58 @@ Use in this order: `getByRole` > `getByLabelText` > `getByPlaceholderText` > `ge
3636

3737
## Query Variants
3838

39-
| Variant | Use case | Returns | Async |
40-
|-------------|---------------------------|---------------------------------|-------|
41-
| `getBy*` | Element must exist | `ReactTestInstance` (throws) | No |
42-
| `getAllBy*` | Multiple must exist | `ReactTestInstance[]` (throws) | No |
43-
| `queryBy*` | Check non-existence ONLY | `ReactTestInstance \| null` | No |
44-
| `queryAllBy*`| Count elements | `ReactTestInstance[]` | No |
45-
| `findBy*` | Wait for element | `Promise<ReactTestInstance>` | Yes |
46-
| `findAllBy*` | Wait for multiple | `Promise<ReactTestInstance[]>` | Yes |
39+
| Variant | Use case | Returns | Async |
40+
| ------------- | ------------------------ | ------------------------------ | ----- |
41+
| `getBy*` | Element must exist | `ReactTestInstance` (throws) | No |
42+
| `getAllBy*` | Multiple must exist | `ReactTestInstance[]` (throws) | No |
43+
| `queryBy*` | Check non-existence ONLY | `ReactTestInstance \| null` | No |
44+
| `queryAllBy*` | Count elements | `ReactTestInstance[]` | No |
45+
| `findBy*` | Wait for element | `Promise<ReactTestInstance>` | Yes |
46+
| `findAllBy*` | Wait for multiple | `Promise<ReactTestInstance[]>` | Yes |
4747

4848
## Interactions
4949

5050
Prefer `userEvent` over `fireEvent`. userEvent is always async.
5151

5252
```tsx
5353
const user = userEvent.setup();
54-
await user.press(element); // full press sequence
55-
await user.longPress(element, { duration: 800 }); // long press
56-
await user.type(textInput, 'Hello'); // char-by-char typing
57-
await user.clear(textInput); // clear TextInput
58-
await user.paste(textInput, 'pasted text'); // paste into TextInput
59-
await user.scrollTo(scrollView, { y: 100 }); // scroll
54+
await user.press(element); // full press sequence
55+
await user.longPress(element, { duration: 800 }); // long press
56+
await user.type(textInput, 'Hello'); // char-by-char typing
57+
await user.clear(textInput); // clear TextInput
58+
await user.paste(textInput, 'pasted text'); // paste into TextInput
59+
await user.scrollTo(scrollView, { y: 100 }); // scroll
6060
```
6161

6262
Use `fireEvent` only when `userEvent` doesn't support the event:
63+
6364
```tsx
64-
fireEvent.press(element); // sync, onPress only
65-
fireEvent.changeText(textInput, 'new text'); // sync, onChangeText only
66-
fireEvent(element, 'blur'); // any event by name
65+
fireEvent.press(element); // sync, onPress only
66+
fireEvent.changeText(textInput, 'new text'); // sync, onChangeText only
67+
fireEvent(element, 'blur'); // any event by name
6768
```
6869

6970
## Assertions (Jest Matchers)
7071

7172
Available automatically with any `@testing-library/react-native` import.
7273

73-
| Matcher | Use for |
74-
|---------------------------------|----------------------------------------------|
75-
| `toBeOnTheScreen()` | Element exists in tree |
76-
| `toBeVisible()` | Element visible (not hidden/display:none) |
77-
| `toBeEnabled()` / `toBeDisabled()` | Disabled state via `aria-disabled` |
78-
| `toBeChecked()` / `toBePartiallyChecked()` | Checked state |
79-
| `toBeSelected()` | Selected state |
80-
| `toBeExpanded()` / `toBeCollapsed()` | Expanded state |
81-
| `toBeBusy()` | Busy state |
82-
| `toHaveTextContent(text)` | Text content match |
83-
| `toHaveDisplayValue(value)` | TextInput display value |
84-
| `toHaveAccessibleName(name)` | Accessible name |
85-
| `toHaveAccessibilityValue(val)` | Accessibility value |
86-
| `toHaveStyle(style)` | Style match |
87-
| `toHaveProp(name, value?)` | Prop check (last resort) |
88-
| `toContainElement(el)` | Contains child element |
89-
| `toBeEmptyElement()` | No children |
74+
| Matcher | Use for |
75+
| ------------------------------------------ | ----------------------------------------- |
76+
| `toBeOnTheScreen()` | Element exists in tree |
77+
| `toBeVisible()` | Element visible (not hidden/display:none) |
78+
| `toBeEnabled()` / `toBeDisabled()` | Disabled state via `aria-disabled` |
79+
| `toBeChecked()` / `toBePartiallyChecked()` | Checked state |
80+
| `toBeSelected()` | Selected state |
81+
| `toBeExpanded()` / `toBeCollapsed()` | Expanded state |
82+
| `toBeBusy()` | Busy state |
83+
| `toHaveTextContent(text)` | Text content match |
84+
| `toHaveDisplayValue(value)` | TextInput display value |
85+
| `toHaveAccessibleName(name)` | Accessible name |
86+
| `toHaveAccessibilityValue(val)` | Accessibility value |
87+
| `toHaveStyle(style)` | Style match |
88+
| `toHaveProp(name, value?)` | Prop check (last resort) |
89+
| `toContainElement(el)` | Contains child element |
90+
| `toBeEmptyElement()` | No children |
9091

9192
## Rules
9293

@@ -125,6 +126,7 @@ Common roles: `button`, `text`, `heading` (alias: `header`), `searchbox`, `switc
125126
`getByRole` options: `{ name, disabled, selected, checked, busy, expanded, value: { min, max, now, text } }`.
126127

127128
For `*ByRole` to match, the element must be an accessibility element:
129+
128130
- `Text`, `TextInput`, `Switch` are by default
129131
- `View` needs `accessible={true}` (or use `Pressable`/`TouchableOpacity`)
130132

@@ -175,7 +177,9 @@ Wrap providers using `wrapper` option:
175177
function renderWithProviders(ui: React.ReactElement) {
176178
return render(ui, {
177179
wrapper: ({ children }) => (
178-
<ThemeProvider><AuthProvider>{children}</AuthProvider></ThemeProvider>
180+
<ThemeProvider>
181+
<AuthProvider>{children}</AuthProvider>
182+
</ThemeProvider>
179183
),
180184
});
181185
}

skills/rntl-v13/references/anti-patterns.md renamed to skills/react-native-testing/references/anti-patterns.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# RNTL v13 Anti-Patterns
22

33
## Table of Contents
4+
45
- [Wrong query variant](#wrong-query-variant)
5-
- [Not using *ByRole](#not-using-byrole)
6+
- [Not using \*ByRole](#not-using-byrole)
67
- [Wrong assertions](#wrong-assertions)
78
- [waitFor misuse](#waitfor-misuse)
89
- [Unnecessary act()](#unnecessary-act)
@@ -38,13 +39,13 @@ await waitFor(() => {
3839
expect(await screen.findByText('Loaded')).toBeOnTheScreen();
3940
```
4041

41-
## Not using *ByRole
42+
## Not using \*ByRole
4243

4344
```tsx
4445
// BAD: testID when accessible query works
4546
<Pressable testID="submit-btn" role="button">
4647
<Text>Submit</Text>
47-
</Pressable>
48+
</Pressable>;
4849
screen.getByTestId('submit-btn');
4950

5051
// GOOD: query by role and accessible name
@@ -173,7 +174,7 @@ screen.getByText('Hello');
173174
```tsx
174175
// BAD: traversing the tree manually
175176
const { UNSAFE_root } = render(<Component />);
176-
const el = UNSAFE_root.findAll(node => node.props.testID === 'foo')[0];
177+
const el = UNSAFE_root.findAll((node) => node.props.testID === 'foo')[0];
177178

178179
// GOOD: use proper queries
179180
render(<Component />);

0 commit comments

Comments
 (0)