Skip to content

feat: support granular context file setting #7284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

sean-roberts
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Docs has been refactored to provide granular context data: https://github.com/netlify/docs/pull/4352 - this needs to be deployed before this CLI version goes out.

This update to the recipe for ai context introduces a few changes:

  • dynamic lookup of the available consumers/clients, docs will tell us what clients we allow explicit path installation for.
  • context files will be created in a granular fashion instead of a massive netlify-development.mdc file, it will put all of the context files assigned to the given tool into specific files. So if the consumer (e.g. windsurf) is assigned 5 different context files on the docs, we will add all five
  • it moves the file naming, file truncation, and file download URLs to the configuration from docs
  • we prefix all local files now with netlify-... given this, we've removed the explicit confirmation about overriding existing, non-netlify files.

All that to say, going forward, if we want to add a new consumer tool (like Sourcegraph's Amp) we just update the docs with the new consumer, assign the context files it will need, the path to put it in, etc. and this recipe will automatically pick it up without needing an update. The goal is that as we find more nuances to the consumer tools, their needs for files, etc. we can update those on the context hosting (docs) and we can move more quickly.


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@sean-roberts sean-roberts self-assigned this May 10, 2025
@sean-roberts sean-roberts requested a review from a team as a code owner May 10, 2025 02:37
Copy link

github-actions bot commented May 10, 2025

📊 Benchmark results

Comparing with 84920cd

  • Dependency count: 1,148 (no change)
  • Package size: 271 MB (no change)
  • Number of ts-expect-error directives: 397 ⬆️ 1.76% increase vs. 84920cd

@sean-roberts sean-roberts force-pushed the sr/support-granular-context-files branch from d8480e8 to 5ebfa8f Compare May 10, 2025 02:38
Copy link
Member

@eduardoboucas eduardoboucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add some tests here?

command: string
consumerKey: string | null
}> => {
const { stdout } = await execa('ps', ['-p', String(pid), '-o', 'ppid=,comm='])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, @smnh will need to verify. Currently, this work is all wrapped in try/catch and will skip if any errors are thrown and, if it simply doesn't work, then it will also continue as it does without this logic.

@sean-roberts
Copy link
Contributor Author

Do we want to add some tests here?

yes, working on those right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants