1 # Applying the Fix
2
3 ## Fix rules
4
5 - **Root cause, not symptom.** Change the line(s) identified in validation. A null-guard that hides wrong data is not a fix.
6 - **Minimal diff.** No refactors, renames, reformatting, or unrelated cleanups. Match the surrounding code style.
7 - **Keep public API stable.** If the fix requires a breaking change to an exported type or method, stop and emit `needs-info` explaining the trade-off; don't ship it.
8 - **No new comments** unless the fixed line would look deletable or wrong to a reader without one (max 3 lines).
9 - **Related bugs found nearby:** don't fix them; list them in `pr-body.md` under Additional Context.
10
11 ## Changesets
12
13 Every published package whose source changed needs a changeset. Write the file directly:
14
15 ```md
16 ---
17 "@medusajs/<package>": patch
18 ---
19
20 fix(<package-short-name>): <what was fixed, user-facing wording>
21 ```
22
23 - Path: `.changeset/<kebab-case-description>.md`
24 - Always `patch` for bug fixes. Never `major`. `minor` only for breaking changes (which this skill should not ship).
25 - Package name comes from the changed package's `package.json` `name`.
26 - Test-only changes don't need a changeset.
27 - Keep the description to one short line (under 80 characters), like a commit subject.
28
29 ## Generated files
30
31 | You changed | Run |
32 | --- | --- |
33 | A data model in `packages/modules/<module>/src/models` | `cd packages/modules/<module> && yarn migration:create` (never hand-write or edit migrations) |
34 | Keys in `packages/admin/dashboard/src/i18n/translations/en.json` | `cd packages/admin/dashboard && yarn i18n:schema` |
35
36 ## Store routes
37
38 If the fix touches a store API route's fields, keep its `allowed` list in `query-config.ts` explicit (see repo `CLAUDE.md`). Never widen it to fix a bug.
39
40 ## Before moving on
41
42 - [ ] `git status` shows only the fix, tests, changeset, and generated files
43 - [ ] No throwaway repro files remain
44 - [ ] Tests re-run per `writing-tests.md` → "After the fix"