cli icon indicating copy to clipboard operation
cli copied to clipboard

Introduce `AGENTS.md` file support in `shopify theme init`

Open karreiro opened this issue 1 month ago β€’ 8 comments

WHY are these changes introduced?

This pull request updates the shopify theme init to consistently use AGENTS.md files. For consistency and compatibility, we are keeping symlinks with each editor standard.

image

Additionally, this pull request introduces a new "All" option to create symlinks for all editors:

image

WHAT is this pull request doing?

This pull request:

  • Updates the init theme service to handle the feature mentioned above
  • Updates cli-kit to expose the symlink creation API

How to test your changes?

  • Run shopify theme init

Post-release steps

None

Measuring impact

How do we know this change was effective? Please choose one:

  • [ ] n/a - this doesn't need measurement, e.g., a linting rule or a bug-fix
  • [x] Existing analytics will cater for this addition
  • [ ] PR includes analytics changes to measure impact

Checklist

  • [x] I've considered possible cross-platform impacts (Mac, Linux, Windows).
  • [x] I've considered possible documentation changes.

karreiro avatar Nov 14 '25 16:11 karreiro

We detected some changes at packages/*/src and there are no updates in the .changeset. If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

[!CAUTION] DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

github-actions[bot] avatar Nov 14 '25 16:11 github-actions[bot]

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🟑 Statements
79.14% (-0.08% πŸ”»)
13817/17458
🟑 Branches
73.08% (-0.03% πŸ”»)
6739/9221
🟑 Functions
79.31% (-0.06% πŸ”»)
3546/4471
🟑 Lines
79.51% (-0.07% πŸ”»)
13058/16423
Show new covered files 🐣
St.:grey_question:
File Statements Branches Functions Lines
🟒
... / admin-as-app.ts
100% 100% 100% 100%
🟒
... / bulk-operation-run-mutation.ts
100% 100% 100% 100%
🟒
... / bulk-operation-run-query.ts
100% 100% 100% 100%
🟒
... / get-bulk-operation-by-id.ts
100% 100% 100% 100%
🟒
... / staged-uploads-create.ts
100% 100% 100% 100%
πŸ”΄
... / status.ts
0% 100% 0% 0%
πŸ”΄
... / pull.ts
0% 100% 0% 0%
πŸ”΄
... / pull.ts
0% 0% 0% 0%
🟒
... / bulk-operation-status.ts
96% 85.71% 100% 100%
🟒
... / download-bulk-operation-results.ts
100% 100% 100% 100%
🟒
... / execute-bulk-operation.ts
90.91% 80.56% 100% 92.31%
🟒
... / format-bulk-operation-status.ts
100% 100% 100% 100%
🟒
... / run-mutation.ts
100% 100% 100% 100%
🟒
... / run-query.ts
100% 100% 100% 100%
🟑
... / stage-file.ts
72.73% 62.5% 83.33% 71.88%
🟒
... / watch-bulk-operation.ts
100% 100% 100% 100%
πŸ”΄
... / promiseWithResolvers.ts
33.33% 50% 50% 33.33%
Show files with reduced coverage πŸ”»
St.:grey_question:
File Statements Branches Functions Lines
πŸ”΄
... / execute.ts
0%
0% (-100% πŸ”»)
0% 0%
🟒
... / extension-instance.ts
84.8% (+0.23% πŸ”Ό)
77.6% (-0.91% πŸ”»)
92.06% (+0.13% πŸ”Ό)
85.11% (+0.24% πŸ”Ό)
🟑
... / specification.ts
69.09%
75.61% (+2.44% πŸ”Ό)
76.47% (-1.31% πŸ”»)
68.75%
🟒
... / ui_extension.ts
85.38% (-9.44% πŸ”»)
72.34% (-8.91% πŸ”»)
84% (-16% πŸ”»)
88% (-8.46% πŸ”»)
🟒
... / developer-platform-client.ts
84.62% (-1.5% πŸ”»)
73.68% (+3.1% πŸ”Ό)
81.82% (+1.82% πŸ”Ό)
90.63% (-2.71% πŸ”»)
🟒
... / api.ts
87.07% (-0.43% πŸ”»)
76.71% (-0.1% πŸ”»)
100%
86.49% (-0.43% πŸ”»)
🟒
... / ConcurrentOutput.tsx
98.36% (-1.64% πŸ”»)
92% (-4% πŸ”»)
100%
98.33% (-1.67% πŸ”»)
πŸ”΄
... / ui.tsx
50.82% (-0.79% πŸ”»)
42.86% (-5.53% πŸ”»)
54.55% (+1.42% πŸ”Ό)
50% (-0.82% πŸ”»)
🟒
... / console.ts
81.82% (+15.15% πŸ”Ό)
75% (-25% πŸ”»)
100% (+33.33% πŸ”Ό)
81.82% (+15.15% πŸ”Ό)
πŸ”΄
... / dev.ts
14.29% (+0.95% πŸ”Ό)
3.13% (+0.18% πŸ”Ό)
50% (-7.14% πŸ”»)
14.29% (+0.95% πŸ”Ό)
🟒
... / init.ts
88% (-0.89% πŸ”»)
71.43% (+4.76% πŸ”Ό)
86.67% (+4.85% πŸ”Ό)
88% (-0.89% πŸ”»)
🟑
... / theme-polling.ts
67.12% (-0.93% πŸ”»)
68.75% 78.57%
66.67% (-0.98% πŸ”»)

Test suite run success

3442 tests passing in 1395 suites.

Report generated by πŸ§ͺjest coverage report action from 313b9bfdb55cd9834a577a5814d7c1e3775661b5

github-actions[bot] avatar Nov 14 '25 16:11 github-actions[bot]

/snapit

aswamy avatar Nov 14 '25 18:11 aswamy

🫰✨ Thanks @aswamy! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]

[!CAUTION] After installing, validate the version by running just shopify in your terminal. If the versions don't match, you might have multiple global instances installed. Use which shopify to find out which one you are running and uninstall it.

github-actions[bot] avatar Nov 14 '25 18:11 github-actions[bot]

/snapit

karreiro avatar Nov 21 '25 11:11 karreiro

🫰✨ Thanks @karreiro! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

npm i -g --@shopify:registry=https://registry.npmjs.org @shopify/[email protected]

[!CAUTION] After installing, validate the version by running just shopify in your terminal. If the versions don't match, you might have multiple global instances installed. Use which shopify to find out which one you are running and uninstall it.

github-actions[bot] avatar Nov 21 '25 11:11 github-actions[bot]

Thanks a lot for the review, @aswamy!

Windows require some specific permissions to create symbolic links, that's the reason we faced some errors. Now, we've update this PR to fallback to file creation (with a warning) when symbolic links can't be created:

Screenshot 2025-11-21 at 13 02 55

This PR is ready for re-review. Thanks again for the review!

karreiro avatar Nov 21 '25 12:11 karreiro

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/node/fs.d.ts
@@ -126,6 +126,13 @@ export declare function removeFile(path: string): Promise<void>;
  * @param to - New path for the file.
  */
 export declare function renameFile(from: string, to: string): Promise<void>;
+/**
+ * Creates a symbolic link.
+ *
+ * @param target - Path that the symlink points to.
+ * @param path - Path where the symlink will be created.
+ */
+export declare function symlink(target: string, path: string): Promise<void>;
 /**
  * Synchronously removes a file at the given path.
  *

github-actions[bot] avatar Dec 02 '25 12:12 github-actions[bot]

πŸ‘‹ @Shopify/app-inner-loop could you please take a look when you have a moment?

karreiro avatar Dec 02 '25 12:12 karreiro