Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extraKnownMarketplaces": {
"nx-claude-plugins": {
"source": {
"source": "github",
"repo": "nrwl/nx-ai-agents-config"
}
}
},
"enabledPlugins": {
"nx@nx-claude-plugins": true
}
}
40 changes: 40 additions & 0 deletions .claude/tasks/nx-ai-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# nx-ai-plugin.md

## Purpose

The `nx-ai` plugin should provide an Nx-native way to analyze a workspace project with an LLM.

It should help developers inspect a project, collect the most relevant local context automatically, and ask Claude for focused feedback such as architecture, typing, maintainability, or refactoring suggestions.

The main goal is to avoid manually gathering and pasting files while keeping context bounded and cost controlled.

## V1 scope

Implement a Nx plugin in `packages/nx-ai` with:

- an `init` generator for workspace setup
- an `analyze` executor for project-level AI analysis

The `analyze` executor should:

- work on a specific Nx project
- collect prioritized files from that project
- optionally include a limited number of internal project dependencies
- build a focused prompt for Claude
- limit context size using options like `maxFiles` and avoid sending entire projects
- output analysis which should:
- be structured and readable in terminal
- group suggestions by category (architecture, typing, etc.)
- include concrete actionable recommendations

The plugin structure should align with existing packages under `packages/`, especially other Nx plugins.

The plugin should be published as `@cdwr/nx-ai`.

## Non-goals

- automatic code editing
- CI integration
- whole-repo analysis by default
- inferred tasks in v1
- agentic multi-step workflows
49 changes: 49 additions & 0 deletions .github/agents/ci-monitor-subagent.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
description: CI helper for /monitor-ci. Fetches CI status, retrieves fix details, or updates self-healing fixes. Executes one MCP tool call and returns the result.
---

# CI Monitor Subagent

You are a CI helper. You call ONE MCP tool per invocation and return the result. Do not loop, poll, or sleep.

## Commands

The main agent tells you which command to run:

### FETCH_STATUS

Call `ci_information` with the provided branch and select fields. Return a JSON object with ONLY these fields:
`{ cipeStatus, selfHealingStatus, verificationStatus, selfHealingEnabled, selfHealingSkippedReason, failureClassification, failedTaskIds, verifiedTaskIds, couldAutoApplyTasks, autoApplySkipped, autoApplySkipReason, userAction, cipeUrl, commitSha, shortLink }`

### FETCH_HEAVY

Call `ci_information` with heavy select fields. Summarize the heavy content and return:

```json
{
"shortLink": "...",
"failedTaskIds": ["..."],
"verifiedTaskIds": ["..."],
"suggestedFixDescription": "...",
"suggestedFixSummary": "...",
"selfHealingSkipMessage": "...",
"taskFailureSummaries": [{ "taskId": "...", "summary": "..." }]
}
```

Do NOT return raw suggestedFix diffs or raw taskOutputSummary — summarize them.
The main agent uses these summaries to understand what failed and attempt local fixes.

### UPDATE_FIX

Call `update_self_healing_fix` with the provided shortLink and action (APPLY/REJECT/RERUN_ENVIRONMENT_STATE). Return the result message (success/failure string).

### FETCH_THROTTLE_INFO

Call `ci_information` with the provided URL. Return ONLY: `{ shortLink, cipeUrl }`

## Important

- Execute ONE command and return immediately
- Do NOT poll, loop, sleep, or make decisions
- Extract and return ONLY the fields specified for each command — do NOT dump the full MCP response
301 changes: 301 additions & 0 deletions .github/prompts/monitor-ci.prompt.md

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions .github/skills/link-workspace-packages/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
name: link-workspace-packages
description: 'Link workspace packages in monorepos (npm, yarn, pnpm, bun). USE WHEN: (1) you just created or generated new packages and need to wire up their dependencies, (2) user imports from a sibling package and needs to add it as a dependency, (3) you get resolution errors for workspace packages (@org/*) like "cannot find module", "failed to resolve import", "TS2307", or "cannot resolve". DO NOT patch around with tsconfig paths or manual package.json edits - use the package manager''s workspace commands to fix actual linking.'
---

# Link Workspace Packages

Add dependencies between packages in a monorepo. All package managers support workspaces but with different syntax.

## Detect Package Manager

Check whether there's a `packageManager` field in the root-level `package.json`.

Alternatively check lockfile in repo root:

- `pnpm-lock.yaml` → pnpm
- `yarn.lock` → yarn
- `bun.lock` / `bun.lockb` → bun
- `package-lock.json` → npm

## Workflow

1. Identify consumer package (the one importing)
2. Identify provider package(s) (being imported)
3. Add dependency using package manager's workspace syntax
4. Verify symlinks created in consumer's `node_modules/`

---

## pnpm

Uses `workspace:` protocol - symlinks only created when explicitly declared.

```bash
# From consumer directory
pnpm add @org/ui --workspace

# Or with --filter from anywhere
pnpm add @org/ui --filter @org/app --workspace
```

Result in `package.json`:

```json
{ "dependencies": { "@org/ui": "workspace:*" } }
```

---

## yarn (v2+/berry)

Also uses `workspace:` protocol.

```bash
yarn workspace @org/app add @org/ui
```

Result in `package.json`:

```json
{ "dependencies": { "@org/ui": "workspace:^" } }
```

---

## npm

No `workspace:` protocol. npm auto-symlinks workspace packages.

```bash
npm install @org/ui --workspace @org/app
```

Result in `package.json`:

```json
{ "dependencies": { "@org/ui": "*" } }
```

npm resolves to local workspace automatically during install.

---

## bun

Supports `workspace:` protocol (pnpm-compatible).

```bash
cd packages/app && bun add @org/ui
```

Result in `package.json`:

```json
{ "dependencies": { "@org/ui": "workspace:*" } }
```

---

## Examples

**Example 1: pnpm - link ui lib to app**

```bash
pnpm add @org/ui --filter @org/app --workspace
```

**Example 2: npm - link multiple packages**

```bash
npm install @org/data-access @org/ui --workspace @org/dashboard
```

**Example 3: Debug "Cannot find module"**

1. Check if dependency is declared in consumer's `package.json`
2. If not, add it using appropriate command above
3. Run install (`pnpm install`, `npm install`, etc.)

## Notes

- Symlinks appear in `<consumer>/node_modules/@org/<package>`
- **Hoisting differs by manager:**
- npm/bun: hoist shared deps to root `node_modules`
- pnpm: no hoisting (strict isolation, prevents phantom deps)
- yarn berry: uses Plug'n'Play by default (no `node_modules`)
- Root `package.json` should have `"private": true` to prevent accidental publish
Loading
Loading