Skip to content

feat(cli): deprecate rules command in favor of skills#1361

Open
stefanjudis wants to merge 3 commits into
mainfrom
deprecate-rules-command
Open

feat(cli): deprecate rules command in favor of skills#1361
stefanjudis wants to merge 3 commits into
mainfrom
deprecate-rules-command

Conversation

@stefanjudis

@stefanjudis stefanjudis commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Affected Components

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

Notes for the Reviewer

Deprecates the checkly rules command and removes the AI-context artifact it depended on.

Command (src/commands/rules.ts) — previously read the bundled
dist/ai-context/checkly.rules.md and wrote it into AI IDE config folders
(.cursor/rules, .windsurf/rules, .github/instructions, etc.). That
capability now lives in checkly skills, so the command is reduced to a
deprecation notice:

Rules were deprecated. Use `npx checkly skills`.
  • Keeps its readOnly/idempotent metadata and is marked
    static state = 'deprecated', so oclif also surfaces a deprecation warning.
  • Added a unit test for the message (the command had none before).

AI-context pipeline (scripts/prepare-ai-context.ts) — stops generating
checkly.rules.md and drops the now-dead heading/frontmatter helpers. Renamed
the misleading RULES_OUTPUT_DIR constant (it only feeds onboarding output now).

Release workflow (release.yml) — removes the step that attached
checkly.rules.md to GitHub Releases; the finalize-release job still marks
the release as latest. Updated CONTRIBUTING.md accordingly.

Left in place / for reviewer's call: the release job's
Save LLM rules as an artifact step (uploads the whole dist/ai-context/*
bundle as llm-rules-release) is now orphaned — its only consumer was the
finalize download. I kept it since it archives the full AI-context bundle, not
just rules, and its prerelease twin was already unconsumed. Happy to drop it if
we'd rather not keep dead archival.

New Dependency Submission

None.

The rules command read the bundled checkly.rules.md and wrote it into
AI IDE config folders. That capability now lives in `checkly skills`,
so rules is reduced to a deprecation notice pointing users there.
The rules command no longer reads checkly.rules.md, so drop its
generation from the AI-context pipeline along with the now-dead heading
helpers, and remove the step that attached it to GitHub Releases. The
finalize-release job keeps marking the release as latest.
permissions:
contents: write
steps:
- name: Download LLM rules artifact

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This part is here to make the rules accessible on the docs via a marketing site redirect. I'll clean that all up.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 deprecates the legacy checkly rules CLI command (which previously generated AI IDE “rules” files) in favor of the newer checkly skills flow, and removes the now-dead checkly.rules.md generation/release plumbing from the AI-context pipeline and release workflow.

Changes:

  • Replace checkly rules behavior with a deprecation notice and mark the command as deprecated in oclif metadata.
  • Update the AI-context build script to stop generating checkly.rules.md and simplify related helpers.
  • Remove the release-workflow step that uploaded checkly.rules.md, and update release documentation accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/cli/src/commands/rules.ts Removes rules-file generation logic and turns the command into a deprecation stub.
packages/cli/src/commands/tests/rules.spec.ts Adds a unit test asserting the deprecation message output.
packages/cli/scripts/prepare-ai-context.ts Stops generating checkly.rules.md; renames output-dir constant; keeps onboarding assets copy.
CONTRIBUTING.md Updates release instructions to reflect that rules asset is no longer attached.
.github/workflows/release.yml Removes the step that downloaded/uploaded checkly.rules.md and keeps “mark latest” logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to +12
static description =
'Generate a rules file to use with AI IDEs and Copilots.'

async run (): Promise<void> {
// Read the base rules file
const rulesContent = await this.readBaseRulesFile()
if (!rulesContent) {
this.error(`Failed to read rules file at ${BASE_RULES_FILE_PATH}`)
}

// In non-interactive mode, print rules to stdout and exit
const isNonInteractive = !process.stdin.isTTY
|| !process.stdout.isTTY
|| process.env.CI
|| process.env.CHECKLY_NON_INTERACTIVE
if (isNonInteractive) {
this.log(rulesContent)
return
}

try {
// Create options for multiselect - offer all configs from AI_IDE_CONFIGS
const choices = Object.entries(AI_IDE_CONFIGS).map(([ideName, ideConfig]) => {
return {
title: `${ideName} (${path.join(ideConfig.rulesFolder, ideConfig.rulesFileName)})`,
value: ideConfig,
selected: false,
}
})

const isNonInteractive = !process.stdin.isTTY
|| !process.stdout.isTTY
|| process.env.CI
|| process.env.CHECKLY_NON_INTERACTIVE

// Interactive mode - show multiselect
const { configs: selectedConfig } = await prompts({
type: 'select',
name: 'configs',
message: 'Select the AI IDE configurations to generate rules for:',
choices,
initial: 0,
})

if (!selectedConfig) {
this.log('Operation cancelled.')
return
}

this.log(`Generating rules`)

// Create rules directory if it doesn't exist
const rulesDir = join(process.cwd(), selectedConfig.rulesFolder)
try {
await mkdir(rulesDir, { recursive: true })
} catch {
// Directory might already exist, ignore error
}

// Determine the target file path
const rulesFilePath = join(rulesDir, selectedConfig.rulesFileName)

// Check if file already exists and ask for confirmation (only in interactive mode)
let shouldOverwrite = true
if (!isNonInteractive) {
shouldOverwrite = await this.confirmOverwrite(rulesFilePath)
}

if (!shouldOverwrite) {
this.log(`Skipped ${rulesFilePath}`)
return
}

// Save the rules file
await writeFile(rulesFilePath, rulesContent, 'utf8')

this.log(`✅ Successfully saved Checkly rules file to: ${rulesFilePath}`)
} catch (error) {
this.error(`Failed to generate rules file: ${error}`)
}
}

private async readBaseRulesFile (): Promise<string> {
try {
return await readFile(BASE_RULES_FILE_PATH, 'utf8')
} catch (error) {
throw new Error(
`Failed to read base rules file at ${BASE_RULES_FILE_PATH}: ${error}`,
{ cause: error },
)
}
}

private async confirmOverwrite (targetPath: string): Promise<boolean> {
try {
await access(targetPath, constants.F_OK)

// File exists, ask for confirmation
const { overwrite } = await prompts({
type: 'confirm',
name: 'overwrite',
message: `Rules file already exists at ${targetPath}. Do you want to overwrite it?`,
initial: false,
})
'Deprecated. Use `checkly skills` instead.'

return overwrite ?? false
} catch {
// File doesn't exist, no need to confirm
return true
}
run (): Promise<void> {
this.log('Rules were deprecated. Use `npx checkly skills`.')
Comment on lines +27 to +29
const logged = getLogged(cmd)
expect(logged.some(m => m.includes('Rules were deprecated.'))).toBe(true)
expect(logged.some(m => m.includes('npx checkly skills'))).toBe(true)
Comment thread CONTRIBUTING.md
Comment on lines +108 to 109
1. Publish a Github Release with a valid tag `#.#.#` (do **not** include a `v` prefix) and click the `Generate release notes` button to auto-generate notes following format defined [here](https://github.com/checkly/checkly-cli/blob/main/.github/release.yml). **Uncheck "Set as the latest release"** — the workflow will mark it as latest automatically.
2. When release is published the Github action is triggered. It builds and publishes `#.#.#-prerelease` prereleases (for both packages).
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