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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,13 @@ release/
.env.*

package-lock.json

# AI Kit (ai-kit onboard)
openspec/changes/archive/
.engine
.run
.ai-kit
.fastembed_cache
openspec
.agent
.cursor
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ moicle install
# Commands
moicle install --global # Symlinks to ~/.claude/
moicle install --project # Copies to ./.claude/
moicle install --target cursor --global # Cursor rules, commands, skills → ~/.cursor/
moicle install --target cursor --project # Cursor assets → ./.cursor/
moicle list # List installed
moicle status # Show enabled/disabled
moicle enable <item> # Enable agent/command/skill
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ A toolkit to bootstrap and accelerate project development with Claude Code throu
- [x] Claude
- [x] Codex CLI
- [x] Antigravity
- [ ] Cursor
- [x] Cursor
- [ ] Windsurf

Older MoiCle versions merged agents into `~/.cursor/AGENTS.md`. Re-run `moicle install --target cursor` for native `.cursor/rules/*.mdc` layout; you may delete legacy `AGENTS.md` manually.

## Installation

```bash
Expand All @@ -46,6 +48,10 @@ moicle install --target codex --global
# Install for Antigravity
moicle install --target antigravity --global

# Install for Cursor (rules, commands, skills, architecture)
moicle install --target cursor --global
moicle install --target cursor --project

# Choose:
# 1. Pick Claude Code, Codex CLI, or Antigravity
# 2. Pick global or project scope
Expand All @@ -60,7 +66,9 @@ moicle install --target antigravity --global
| `moicle install --project` | Install to ./.claude/ (copies) |
| `moicle install --target codex --global` | Install Codex skills + architecture to ~/.codex/ |
| `moicle install --target codex --project` | Install Codex skills + architecture to ./.codex/ |
| `moicle list` | List all installed items |
| `moicle install --target cursor --global` | Install Cursor rules, commands, skills to ~/.cursor/ |
| `moicle install --target cursor --project` | Install Cursor assets to ./.cursor/ |
| `moicle list --target cursor` | List Cursor rules, commands, and skills |
| `moicle status` | Show enabled/disabled status |
| `moicle enable <item>` | Enable an agent/command/skill |
| `moicle disable <item>` | Disable an agent/command/skill |
Expand Down
6 changes: 4 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ program
.description('List installed agents, commands, and skills')
.option('-g, --global', 'List global installations')
.option('-p, --project', 'List project installations')
.option('-t, --target <editor>', 'Target editor (claude, codex, antigravity)')
.option('-t, --target <editor>', 'Target editor (claude, codex, cursor, antigravity)')
.action(listCommand);

program
Expand All @@ -60,6 +60,7 @@ program
.option('-g, --global', 'Enable in global ~/.claude/')
.option('-p, --project', 'Enable in current project ./.claude/')
.option('-a, --all', 'Enable all disabled items')
.option('-t, --target <editor>', 'Target editor (claude, codex, cursor, antigravity)')
.action(enableCommand);

program
Expand All @@ -68,14 +69,15 @@ program
.option('-g, --global', 'Disable in global ~/.claude/')
.option('-p, --project', 'Disable in current project ./.claude/')
.option('-a, --all', 'Disable all enabled items')
.option('-t, --target <editor>', 'Target editor (claude, codex, cursor, antigravity)')
.action(disableCommand);

program
.command('status')
.description('Show enabled/disabled status of all items')
.option('-g, --global', 'Show global status')
.option('-p, --project', 'Show project status')
.option('-t, --target <editor>', 'Target editor (claude, codex, antigravity)')
.option('-t, --target <editor>', 'Target editor (claude, codex, cursor, antigravity)')
.action(statusCommand);

program
Expand Down
47 changes: 47 additions & 0 deletions docs/system/basic_design/cursor-editor-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
doc_tier: basic_design
fragment: cursor-editor-support
status: draft
change: moicle-cursor-support
---

# Basic Design: Cursor Editor Support (MoiCle)

## Purpose

Extend the MoiCle npm CLI so Cursor IDE users receive the same packaged agents, commands, skills, and architecture references currently available to Claude Code, Codex CLI, and Antigravity users.

## Supported Editors (after change)

| Editor | Install target | Layout |
|--------|----------------|--------|
| Claude Code | `~/.claude/` or `./.claude/` | Native agents/commands/skills |
| Codex CLI | `~/.codex/` | Flat skills folder |
| Antigravity | `~/.gemini/` | Flat skills folder |
| **Cursor** | `~/.cursor/` or `./.cursor/` | **rules + skills + commands** |
| Windsurf | — | Out of scope |

## User Workflow

1. `npm install -g moicle`
2. `moicle install --target cursor --global` (or `--project` for repo-local)
3. Open project in Cursor; use rules, skills, and slash commands from `.cursor/`

## Capability Map

| Capability | User value |
|------------|------------|
| cursor-native-install | Full asset tree in Cursor-native paths |
| cursor-path-transform | Docs reference `~/.cursor/` not `~/.claude/` |
| cursor-scoped-install | Global vs project choice |
| cursor-cli-parity | list/status/enable/disable/uninstall |
| cursor-docs | README and help text updated |

## Documentation Sync Targets

When this change is merged, update:

- `README.md` — Current Support `[x] Cursor`, install examples
- `CLAUDE.md` — `--target cursor` in install section
- `AGENTS.md` — Editor matrix if present
- `src/commands/postinstall.ts` — Post-install hints
107 changes: 107 additions & 0 deletions docs/system/detail_design/cli/cursor-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
doc_tier: detail_design
area: cli
feature: cursor-install
status: draft
change: moicle-cursor-support
sync_targets:
- README.md
- CLAUDE.md
- AGENTS.md
---

# Detail Design: Cursor Install Pipeline (MoiCle CLI)

## Overview

MoiCle installs packaged assets from `assets/` into editor-specific directories. This document describes the Cursor install pipeline introduced by change `moicle-cursor-support`.

## Directory Layout After Install

### Global (`~/.cursor/`)

```
~/.cursor/
├── rules/ # 16 agent personas (*.mdc)
├── skills/ # 21 skills (<flat-name>/SKILL.md)
├── commands/ # 4 slash commands (*.md)
└── architecture/ # 11 architecture reference docs (*.md)
```

### Project (`./.cursor/`)

Same subtree relative to `process.cwd()`.

## Module Responsibilities

| Module | Layer | Role |
|--------|-------|------|
| `cursor-transform.ts` | Functional core | `buildCursorRuleMdc`, `sanitizeDescription`, path rewrite |
| `transform.ts` | Functional core | `rewriteCursorPaths`, `extractFrontmatter` |
| `cursor-editor.ts` | Imperative shell | Orchestrates install per scope |
| `install/index.ts` | Imperative shell | Registers `cursor` in `ScopedTarget` |
| `symlink.ts` | Imperative shell | `EDITOR_CONFIGS.cursor`, directory helpers |
| `editor-constants.ts` | Shared | `DISABLED_SUFFIX`, `CURSOR_RULE_EXT`, `DESCRIPTION_MAX_LENGTH` |

## Agent → Rule Transform

Source: `assets/agents/{developers,utilities}/<name>.md`

Output: `.cursor/rules/<name>.mdc`

```yaml
---
description: <sanitized single-line from source frontmatter>
alwaysApply: false
---

<body with rewriteCursorPaths applied>
```

Agents are opt-in rules; they MUST NOT use `alwaysApply: true`.

## Skills and Commands

| Source | Output | Transform |
|--------|--------|-------------|
| `assets/skills/**/SKILL.md` | `.cursor/skills/<flat-name>/SKILL.md` | `listSkillsNested` + `rewriteCursorPaths` |
| `assets/commands/*.md` | `.cursor/commands/<name>.md` | `rewriteCursorPaths` only |
| `assets/architecture/*.md` | `.cursor/architecture/<file>.md` | `rewriteCursorPaths` |

## Path Rewrite Table

| Find | Replace |
|------|---------|
| `~/.claude/` | `~/.cursor/` |
| `.claude/` | `.cursor/` |
| `Claude Code` | `Cursor` |

## Enable / Disable Conventions

| Type | Enabled | Disabled |
|------|---------|----------|
| Rule (agent) | `rules/<name>.mdc` | `rules/<name>.mdc.disabled` |
| Command | `commands/<name>.md` | `commands/<name>.md.disabled` |
| Skill | `skills/<name>/` | `skills/<name>.disabled/` |

Config keys in `moicle-config.json` remain `agents`, `commands`, `skills`; `--target cursor` selects filesystem paths.

## CLI Entry Points

```bash
moicle install --target cursor [--global|--project|--all]
moicle list --target cursor [--global|--project]
moicle status --target cursor [--global|--project]
moicle enable|disable <item> --target cursor [--global|--project]
moicle uninstall --target cursor [--global|--project]
```

## Legacy Behavior

Prior MoiCle versions called `mergeAgentsToFile` → `~/.cursor/AGENTS.md`. That path is **removed**. Users may manually delete legacy `AGENTS.md` after reinstall.

## Non-Goals

- `mcp.json` injection
- Windsurf support
- Symlink install on Windows
46 changes: 46 additions & 0 deletions docs/system/srs/cursor-install-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
doc_tier: srs
fragment: cursor-install-requirements
status: draft
change: moicle-cursor-support
---

# SRS Fragment: Cursor Install Requirements

## Functional Requirements

### FR-1 Native install layout

The MoiCle CLI SHALL install Cursor assets using per-file layout under `.cursor/rules/`, `.cursor/skills/`, `.cursor/commands/`, and `.cursor/architecture/` as specified in `specs/cursor-native-install/spec.md`.

### FR-2 Path transformation

The MoiCle CLI SHALL rewrite Claude-centric paths to Cursor paths in all generated files as specified in `specs/cursor-path-transform/spec.md`.

### FR-3 Scoped installation

The MoiCle CLI SHALL support global and project installation scopes for Cursor as specified in `specs/cursor-scoped-install/spec.md`.

### FR-4 CLI parity

The MoiCle CLI commands `list`, `status`, `enable`, `disable`, and `uninstall` SHALL accept `--target cursor` as specified in `specs/cursor-cli-parity/spec.md`.

### FR-5 User documentation

Published package documentation SHALL list Cursor as a supported editor with install examples as specified in `specs/cursor-docs/spec.md`.

## Non-Functional Requirements

### NFR-1 Idempotency

Re-running install without asset changes SHOULD not rewrite unchanged files (byte-identical skip).

### NFR-2 Windows compatibility

Install on Windows SHALL use file copy, not symlinks.

## Out of Scope

- MCP server configuration for Cursor
- Windsurf editor
- Automatic removal of legacy `AGENTS.md`
Loading
Loading