Skip to content

feat: add checkly config example to AI rules template #1113

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 1 commit into
base: main
Choose a base branch
from

Conversation

stefanjudis
Copy link
Collaborator

@stefanjudis stefanjudis commented Jul 17, 2025

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

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

To improve the AI rules when setting up a new project, I wanted to add a checkly.config.ts example to the generated checkly.rules file. Now, this solution isn't very pretty because:

  • The generation script reaches out of the cli package scope into examples to read a checkly.config.
  • It's not very clear that a template checkly.config example 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.

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 <[email protected]>
@stefanjudis stefanjudis requested review from Copilot, tnolet and sorccu July 17, 2025 14:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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',
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
'../../../examples/boilerplate-project/checkly.config.ts',
'resources/example-configs/checkly.config.ts',

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

@stefanjudis stefanjudis Jul 17, 2025

Choose a reason for hiding this comment

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

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.

Copy link
Member

@tnolet tnolet left a comment

Choose a reason for hiding this comment

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

@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?

@stefanjudis
Copy link
Collaborator Author

@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.

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.

2 participants