Open History to see the last commit
1# Agent Instructions
2β
3Before analyzing or changing this repository, read and follow
4[`CONTRIBUTING.md`](./CONTRIBUTING.md), [`AI_POLICY.md`](./AI_POLICY.md), and the
5[pull request template](./.github/pull_request_template.md). Their requirements
6apply to AI-assisted contributions. The contributor must understand and verify
7every submitted change and communicate in their own voice.
8β
9## Establish the problem
10β
11- Describe the application sequence and the observable failure before fixing a
12 bug. Use a user report, a reproduction, or a realistic application flow.
13 An unusual internal state alone does not justify more code.
14- Check whether the behavior is supported, already fixed, or addressed by an
15 existing issue or pull request. Follow the contribution guide before proposing
16 a new feature.
17- Keep each change focused on one topic. Assess unrelated findings separately.
18β
19## Choose the smallest correct change
20β
21- Trace the failure to its cause. Check existing state and behavior before adding
22 fields, helpers, wrappers, overloads, or dependencies.
23- Keep framework-specific corrections in the affected adapter when possible.
24 Do not broaden core types or runtime behavior to accommodate one adapter.
25 Explain why a core change is necessary when a local correction cannot work.
26- Read relevant tests and previous fixes before changing behavior. Preserve
27 intentional behavior and compatibility. Identify breaking behavior changes
28 even when the public signatures stay the same.
29- Add compatibility code only for a demonstrated requirement within the
30 supported environments. Do not add fallbacks for hypothetical callers.
31- Verify automated review findings against the code and the application path.
32 Determine whether each finding is a regression, a pre-existing limitation, or
33 a separate feature request before expanding the change.
34β
35## Prove bug fixes
36β
37- Include a regression test for each claimed fix. The same test must fail on
38 current upstream `main` because of the defect and pass with the fix.
39- Test observable behavior. For type fixes, test the public type behavior with
40 the repository's type-test tools.
41- Control the conditions that trigger the defect. Confirm that the selected
42 tests actually execute. A setup failure, an invalid import, or an unrelated
43 timeout is not regression evidence.
44- Keep the baseline test independent of the fix. Transfer only the regression
45 test and necessary test fixtures, without production changes.
46- Use the commands and checks in the contribution guide. Record any missing
47 verification instead of claiming that the fix is verified.
48β
49## Assess bundle cost
50β
51- Consider runtime work, dependencies, and bundle growth against the demonstrated
52 benefit. Minimize the cost for applications that do not use the affected
53 feature. Check imports and tree shaking when changing shared code.
54- Report the available Size limit comparison from the current PR's Preview CI.
55 Include byte and percentage changes for each measured entry when available,
56 even when the check passes. Identify the compression mode when reported.
57- State when a measurement is pending or unavailable. Do not treat a missing
58 measurement as zero or apply one adapter's measurement to other adapters.
59 A passing size limit does not by itself justify the increase.
60β
61## Check related adapters
62β
63- Trace shared behavior through the adapters that exist in the checkout.
64 Inspect React and Preact together when either adapter changes.
65- Check corresponding behavior, public types, JSDoc, and tests in the affected
66 adapters. Preserve differences justified by each framework's model. Do not
67 copy implementations solely to make the files match.
68β
69## Document and report the result
70β
71- Update source JSDoc for changed public APIs and behavior. Cover defaults,
72 return values, restrictions, and relevant framework differences.
73- Follow the contribution guide for guide pages, generated reference pages,
74 changesets, and required checks. Keep those requirements in their existing
75 documents rather than duplicating them here.
76- Report what changed, why it changed, and what was verified. Distinguish checks
77 for the current code from older results. State pending, failed, or unavailable
78 checks explicitly.