|
2 | 2 |
|
3 | 3 | This file provides guidance to agents when working with code in this repository. |
4 | 4 |
|
5 | | -- Settings View Pattern: When working on `SettingsView`, inputs must bind to the local `cachedState`, NOT the live `useExtensionState()`. The `cachedState` acts as a buffer for user edits, isolating them from the `ContextProxy` source-of-truth until the user explicitly clicks "Save". Wiring inputs directly to the live state causes race conditions. |
| 5 | +## Settings View Pattern |
6 | 6 |
|
7 | | -## LLM-Assisted Contribution Guidance |
| 7 | +- When working on `SettingsView`, inputs must bind to the local `cachedState`, NOT the live `useExtensionState()`. The `cachedState` acts as a buffer for user edits, isolating them from the `ContextProxy` source-of-truth until the user explicitly clicks "Save". Wiring inputs directly to the live state causes race conditions. |
8 | 8 |
|
9 | | -Before implementing a non-trivial change, decompose it into the smallest independently reviewable slices you can. |
| 9 | +## PR Decomposition Guidance |
10 | 10 |
|
11 | | -- One independently reviewable unit per PR. A PR should be understandable, testable, and mergeable on its own without the next PR. |
12 | | -- Prefer stacked draft PRs over one large PR when a change naturally builds in layers. Link dependent PRs and keep them small. |
| 11 | +Small PRs reduce review latency and keep each change understandable, testable, and mergeable on its own. |
| 12 | + |
| 13 | +- Before coding a non-trivial change, decide whether it should be one PR, stacked PRs, or a smaller first slice. |
| 14 | +- Put one independently reviewable unit in each PR. |
| 15 | +- Use stacked draft PRs when a change builds in layers. Link dependent PRs and keep each PR small. |
13 | 16 | - Separate refactors from behavior changes. If a change both restructures code and adds or fixes user-visible behavior, land the preparatory refactor first. |
14 | 17 | - "Tightly coupled" is not enough reason to bundle everything together. Shared files or runtime coupling do not automatically mean the work belongs in one PR. |
15 | | -- Use this test when deciding whether work must stay together: if PR A can merge without leaving the repository broken or degraded while PR B waits, they should usually be separate PRs. |
| 18 | +- If merging PR A without PR B would leave the repository broken or degraded, keep them together; otherwise split them. |
16 | 19 | - When the decomposition is unclear, pause before coding and propose the split in the issue or in a draft PR. |
17 | 20 |
|
18 | 21 | ## Test Placement Guidance |
|
0 commit comments