feat: add checkly config example to AI rules template#1113
feat: add checkly config example to AI rules template#1113stefanjudis wants to merge 1 commit intomainfrom
Conversation
Added CHECKLY_CONFIG to compile-rules.ts and corresponding template placeholder in checkly.rules.template.md to include configuration examples in the AI rules. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a configuration example to the AI rules template by including a checkly.config.ts example in the generated rules documentation. The change enables the AI rules to provide concrete configuration examples when setting up new projects.
- Added CHECKLY_CONFIG entry to the compile-rules.ts configuration mapping
- Added corresponding template placeholder in the checkly.rules.template.md file
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/cli/src/rules/checkly.rules.template.md | Added TypeScript code block with placeholder for checkly config example |
| packages/cli/scripts/compile-rules.ts | Added CHECKLY_CONFIG mapping to include boilerplate project config example |
| CHECKLY_CONFIG: { | ||
| templateString: '// INSERT CHECKLY CONFIG EXAMPLE HERE //', | ||
| exampleConfigPath: | ||
| '../../../examples/boilerplate-project/checkly.config.ts', |
There was a problem hiding this comment.
The relative path '../../../examples/boilerplate-project/checkly.config.ts' creates a fragile dependency that reaches outside the package scope. Consider moving the example config into the cli package or using a more robust path resolution method.
| '../../../examples/boilerplate-project/checkly.config.ts', | |
| 'resources/example-configs/checkly.config.ts', |
There was a problem hiding this comment.
Yes, I know. I'm waiting for feedback first. Of course, we could follow the suggestion but then we have another example checkly.config file in the code base.
tnolet
left a comment
There was a problem hiding this comment.
@stefanjudis preferably we would have this code example also generated by the import feature, as are the code examples. Not sure if possible. @sorccu is this possible or should we have an exemption here?
|
@tnolet Jep, and that's right. I've looked at what's currently done and am lacking knowledge/access to understand what's possible. :) Happy to follow whatever flow. |
Added CHECKLY_CONFIG to compile-rules.ts and corresponding template placeholder in checkly.rules.template.md to include configuration examples in the AI rules.
🤖 Generated with Claude Code
Affected Components
Notes for the Reviewer
To improve the AI rules when setting up a new project, I wanted to add a
checkly.config.tsexample to the generatedcheckly.rulesfile. Now, this solution isn't very pretty because:clipackage scope intoexamplesto read acheckly.config.checkly.configexample file will make it into our AI rules.So, I don't think this solution is ideal, but I couldn't think of anything better. Looking forward to opinions and feedback, and happy to try something else.