Self-Healing CI Configuration
This file provides project-specific instructions to the Nx Cloud Self-Healing CI agent for the agent-skills monorepo.
Project Context
This is a TypeScript monorepo managed by Nx, containing:
- CLI package (
@tech-leads-club/agent-skills) - Node.js CLI for installing AI agent skills
- Core library (
@tech-leads-club/core) - Shared utilities and types
- Skill plugin - Nx generator for creating new skills
- Skills collection - Pre-built skills for AI agents (Claude, Cursor, Copilot, etc.)
See AGENTS.md for comprehensive architectural context.
Confidence Rules
High confidence required for:
- Changes to
packages/cli/src/index.ts (entry point)
- Changes to skill generators in
tools/skill-plugin/
- Any modifications to published package versions
- Changes to CI/CD workflows (
.github/workflows/)
- Failures in
*build* or *e2e* tasks
Medium confidence acceptable for:
- ESLint rule updates
- Test file modifications (
*.spec.ts)
- Documentation updates (README, CHANGELOG)
- Type definition improvements
- Failures in
*test* tasks
Low confidence acceptable for:
- Formatting fixes (Prettier, ESLint auto-fix)
- Whitespace normalization
- Import organization
- Failures in
*format* or *lint* tasks
Classify as environment_state:
- Failures in dependency installation
- CI-specific environment variable issues
- Permission or authentication errors
Off-Limits Areas
/tmp/ - Temporary build outputs, do not modify
CHANGELOG.md - Managed by semantic-release, do not manually edit
package-lock.json - Only update via npm install, never manually
/node_modules/ - Dependencies, never modify directly
Fix Preferences
Linting and Formatting
- Always prefer running
nx format over manual formatting fixes
- Always prefer updating ESLint configuration over adding
eslint-disable comments
- For TypeScript errors, prefer explicit types over
any or @ts-ignore
- Use
// @ts-expect-error with explanation only when absolutely necessary
Testing
- When test failures occur in
*.spec.ts files:
- First check if the test itself is outdated
- Then verify if implementation changed the expected behavior
- Only then suggest code fixes to make tests pass
- Prefer updating test snapshots (
nx test --updateSnapshot) when UI/output changes are intentional
Code Quality
- Maintain existing code patterns (e.g., use of
@clack/prompts for CLI interactions)
- Follow kebab-case for file/directory names in
skills/ directory
- Ensure all new skills have valid frontmatter in
SKILL.md
- Respect the monorepo structure - keep packages independent
Build Failures
- For TypeScript compilation errors, check
tsconfig.json configuration first
- For module resolution issues, verify entries in
tsconfig.base.json paths
- Build failures in CI often indicate dependency installation issues - check
package.json and lockfile
Predefined Fixes
Deterministic Nx Commands
For these specific failures, always run the corresponding fix command:
- Formatting failures (
nx format:check): Run nx format to auto-fix
- Sync check failures (
nx sync:check): Run nx sync to synchronize workspace
- Lint failures: Try
nx affected -t lint --fix before proposing code changes
- Test snapshots: For intentional changes, run
nx affected -t test --updateSnapshot
Skill Validation Failures
If validate-skills job fails:
- Check for missing
SKILL.md files in skill directories
- Verify frontmatter starts with
--- in SKILL.md
- Ensure skills are properly listed in
skills/categories.json
- Validate against
skills/categories.schema.json
Conventional Commit Issues
If commit message validation fails:
- Ensure commits follow format:
type(scope): description
- Valid types:
feat, fix, docs, chore, test, refactor, ci
- Breaking changes require
! or BREAKING CHANGE: in footer
TypeScript Errors
For import path errors:
- Check
tsconfig.base.json for correct path mappings
- Verify package exports in
package.json files
- Use workspace-relative imports via path aliases (e.g.,
@tech-leads-club/core)
Auto-Apply Criteria
The following task patterns are safe to auto-apply when the agent has high confidence:
*format* - Code formatting via Prettier/ESLint
*lint* - Linting fixes that don't change logic
- Test updates when implementation intentionally changed behavior
Never auto-apply fixes to:
*build* tasks when they might affect published packages
*e2e* or integration tests
- Version bumps or changelog generation
Context
See AGENTS.md for complete project architecture, monorepo structure, and development guidelines.
Key configuration files:
nx.json - Nx workspace configuration and task runner settings
tsconfig.base.json - TypeScript path mappings for monorepo
skills/categories.json - Skill taxonomy and categorization
.github/workflows/ci.yml - CI pipeline definition
Project-Specific Notes
Skill Creation
New skills must:
- Be created via
nx g @tech-leads-club/skill-plugin:skill <name>
- Have kebab-case directory names
- Include frontmatter in SKILL.md with
name and description
- Follow the template structure (see
tools/skill-plugin/src/generators/skill/files/)
CLI Development
When modifying packages/cli/:
- Ensure changes maintain backward compatibility
- Update tests in
__tests__/ directory
- Verify against all supported agents (Claude, Cursor, Copilot, Antigravity, OpenCode)
- Test with both
--local and --global installation modes
Testing Strategy
- Use
NODE_OPTIONS: '--experimental-vm-modules' for Jest (ESM support)
- Run affected tests via
nx affected -t test
- Coverage reports are in
coverage/ (gitignored)
Failure Classification
When analyzing failures, classify them as:
- code_quality: Linting, formatting, type errors
- test_failure: Unit/integration test failures
- build_failure: Compilation, bundling errors
- dependency_issue: Missing or incompatible dependencies
- configuration_error: Incorrect nx.json, tsconfig, or package.json settings
- environment_state: CI-specific issues (permissions, env vars)
This helps determine the appropriate fix strategy and confidence level.
1---2name: self-healing-ci-configuration3description: This file provides project-specific instructions to the Nx Cloud Self-Healing CI agent for the agent-skills monorepo.4---5# Self-Healing CI Configuration67This file provides project-specific instructions to the Nx Cloud Self-Healing CI agent for the `agent-skills` monorepo.89## Project Context1011This is a TypeScript monorepo managed by Nx, containing:1213- **CLI package** (`@tech-leads-club/agent-skills`) - Node.js CLI for installing AI agent skills14- **Core library** (`@tech-leads-club/core`) - Shared utilities and types15- **Skill plugin** - Nx generator for creating new skills16- **Skills collection** - Pre-built skills for AI agents (Claude, Cursor, Copilot, etc.)1718See [AGENTS.md](../AGENTS.md) for comprehensive architectural context.1920## Confidence Rules2122- **High confidence required** for:23 - Changes to `packages/cli/src/index.ts` (entry point)24 - Changes to skill generators in `tools/skill-plugin/`25 - Any modifications to published package versions26 - Changes to CI/CD workflows (`.github/workflows/`)27 - Failures in `*build*` or `*e2e*` tasks2829- **Medium confidence acceptable** for:30 - ESLint rule updates31 - Test file modifications (`*.spec.ts`)32 - Documentation updates (README, CHANGELOG)33 - Type definition improvements34 - Failures in `*test*` tasks3536- **Low confidence acceptable** for:37 - Formatting fixes (Prettier, ESLint auto-fix)38 - Whitespace normalization39 - Import organization40 - Failures in `*format*` or `*lint*` tasks4142- **Classify as environment_state**:43 - Failures in dependency installation44 - CI-specific environment variable issues45 - Permission or authentication errors4647## Off-Limits Areas4849- `/tmp/` - Temporary build outputs, do not modify50- `CHANGELOG.md` - Managed by semantic-release, do not manually edit51- `package-lock.json` - Only update via `npm install`, never manually52- `/node_modules/` - Dependencies, never modify directly5354## Fix Preferences5556### Linting and Formatting5758- **Always prefer** running `nx format` over manual formatting fixes59- **Always prefer** updating ESLint configuration over adding `eslint-disable` comments60- For TypeScript errors, prefer explicit types over `any` or `@ts-ignore`61- Use `// @ts-expect-error with explanation` only when absolutely necessary6263### Testing6465- When test failures occur in `*.spec.ts` files:66 1. First check if the test itself is outdated67 2. Then verify if implementation changed the expected behavior68 3. Only then suggest code fixes to make tests pass69- Prefer updating test snapshots (`nx test --updateSnapshot`) when UI/output changes are intentional7071### Code Quality7273- Maintain existing code patterns (e.g., use of `@clack/prompts` for CLI interactions)74- Follow kebab-case for file/directory names in `skills/` directory75- Ensure all new skills have valid frontmatter in `SKILL.md`76- Respect the monorepo structure - keep packages independent7778### Build Failures7980- For TypeScript compilation errors, check `tsconfig.json` configuration first81- For module resolution issues, verify entries in `tsconfig.base.json` paths82- Build failures in CI often indicate dependency installation issues - check `package.json` and lockfile8384## Predefined Fixes8586### Deterministic Nx Commands8788For these specific failures, always run the corresponding fix command:8990- **Formatting failures** (`nx format:check`): Run `nx format` to auto-fix91- **Sync check failures** (`nx sync:check`): Run `nx sync` to synchronize workspace92- **Lint failures**: Try `nx affected -t lint --fix` before proposing code changes93- **Test snapshots**: For intentional changes, run `nx affected -t test --updateSnapshot`9495### Skill Validation Failures9697If `validate-skills` job fails:98991. Check for missing `SKILL.md` files in skill directories1002. Verify frontmatter starts with `---` in SKILL.md1013. Ensure skills are properly listed in `skills/categories.json`1024. Validate against `skills/categories.schema.json`103104### Conventional Commit Issues105106If commit message validation fails:107108- Ensure commits follow format: `type(scope): description`109- Valid types: `feat`, `fix`, `docs`, `chore`, `test`, `refactor`, `ci`110- Breaking changes require `!` or `BREAKING CHANGE:` in footer111112### TypeScript Errors113114For import path errors:115116- Check `tsconfig.base.json` for correct path mappings117- Verify package exports in `package.json` files118- Use workspace-relative imports via path aliases (e.g., `@tech-leads-club/core`)119120## Auto-Apply Criteria121122The following task patterns are safe to auto-apply when the agent has **high confidence**:123124- `*format*` - Code formatting via Prettier/ESLint125- `*lint*` - Linting fixes that don't change logic126- Test updates when implementation intentionally changed behavior127128**Never auto-apply** fixes to:129130- `*build*` tasks when they might affect published packages131- `*e2e*` or integration tests132- Version bumps or changelog generation133134## Context135136See [AGENTS.md](../AGENTS.md) for complete project architecture, monorepo structure, and development guidelines.137138Key configuration files:139140- `nx.json` - Nx workspace configuration and task runner settings141- `tsconfig.base.json` - TypeScript path mappings for monorepo142- `skills/categories.json` - Skill taxonomy and categorization143- `.github/workflows/ci.yml` - CI pipeline definition144145## Project-Specific Notes146147### Skill Creation148149New skills must:1501511. Be created via `nx g @tech-leads-club/skill-plugin:skill <name>`1522. Have kebab-case directory names1533. Include frontmatter in SKILL.md with `name` and `description`1544. Follow the template structure (see `tools/skill-plugin/src/generators/skill/files/`)155156### CLI Development157158When modifying `packages/cli/`:159160- Ensure changes maintain backward compatibility161- Update tests in `__tests__/` directory162- Verify against all supported agents (Claude, Cursor, Copilot, Antigravity, OpenCode)163- Test with both `--local` and `--global` installation modes164165### Testing Strategy166167- Use `NODE_OPTIONS: '--experimental-vm-modules'` for Jest (ESM support)168- Run affected tests via `nx affected -t test`169- Coverage reports are in `coverage/` (gitignored)170171## Failure Classification172173When analyzing failures, classify them as:174175- **code_quality**: Linting, formatting, type errors176- **test_failure**: Unit/integration test failures177- **build_failure**: Compilation, bundling errors178- **dependency_issue**: Missing or incompatible dependencies179- **configuration_error**: Incorrect nx.json, tsconfig, or package.json settings180- **environment_state**: CI-specific issues (permissions, env vars)181182This helps determine the appropriate fix strategy and confidence level.