@metricinsights/qa-ai-rules
v1.2.1
Published
Shared QA rules for AI coding tools (Cursor, Claude Code) across MI repositories
Readme
@metricinsights/qa-ai-rules
Shared QA/testing rules for AI coding tools, distributed as an npm package. Install once, get consistent test-case rules across all your repositories.
Currently supports Cursor IDE and Claude Code.
Installation
npx @metricinsights/qa-ai-rulesThis runs the interactive setup and adds the package to your devDependencies automatically.
Setup
The init command walks you through tool selection, updates .gitignore, and installs rule files:
npx qa-ai-rules # interactive setup (default)
npx qa-ai-rules init # same as aboveOr skip prompts with flags:
npx qa-ai-rules init --cursor
npx qa-ai-rules init --cursor --claudeThis creates qa-ai-rules.config.json at your repo root — commit this file:
{
"tools": {
"cursor": true,
"claude": false
}
}CLI commands
| Command | Description |
| ------------------------- | ----------------------------------------------------------- |
| npx qa-ai-rules | Interactive setup (default) |
| npx qa-ai-rules init | Select tools, update .gitignore, install rule files |
| npx qa-ai-rules install | Silent reinstall from existing config (used by postinstall) |
| npx qa-ai-rules status | Show config, installed files, and .gitignore health |
Where files are installed
| Tool | Destination |
| ----------- | ---------------------------------- |
| Cursor IDE | .cursor/rules/qa-ai-rules--*.mdc |
| Claude Code | .claude/rules/qa-ai-rules/*.md |
Generated files are gitignored automatically. Only qa-ai-rules.config.json is committed.
Note: Cursor does not load
.mdcfiles from subdirectories of.cursor/rules/, so rules are installed flat with aqa-ai-rules--filename prefix. Claude Code supports subdirectories natively.
Included rules
| File | Description |
| --------------------- | ------------------------------------------------------------------ |
| test-case-rules | Structure, formatting, and content rules for generating test cases |
| test-suite-template | Starter template for a page-level test suite |
Updating
postinstall automatically reinstalls rule files whenever you run npm install. To pick up new rules after a version bump, just update the package:
npm update @metricinsights/qa-ai-rulesUse Dependabot to auto-update minor and patch bumps.
Publishing
Releases use the shared workflows from mi-examples-workflows (release flow). The caller is .github/workflows/release.yml.
- Betas. Every push to
developwith releasable commits publishesX.Y.Z-beta.Nto npm under thebetadist-tag, with a GitHub prerelease. Install one withnpm install @metricinsights/qa-ai-rules@beta. - Production releases.
- Run Actions → Release → Run workflow. It opens a release pull request
release/vX.Y.Z → mainwith the version bump and the newCHANGELOG.mdentry. - Review and edit the entry in the pull request, then merge it.
- Merging publishes to npm under
latestand creates the tag and the GitHub release. It also opens the back-merge pull request intodevelop.
- Run Actions → Release → Run workflow. It opens a release pull request
- Versions come from Conventional Commits:
feat→ minor;fix,perfandrevert→ patch;!or aBREAKING CHANGE:footer → major;- other types don't release.
- Publishing uses npm Trusted Publishing (OIDC) from
release.ymlin thenpm-publishenvironment. No npm token is needed or stored.- Don't rename
release.yml: the trusted publisher is registered for that filename. - Setup and troubleshooting are in npm-publishing.md.
- Don't rename
License
MIT
