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
2 changes: 1 addition & 1 deletion .claude/skills/add-sparkle-component/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Before installing components, ensure the project has:
1. **Registry Configuration** - `components.json` with Sparkle Design registry
2. **Sparkle Config** - `sparkle.config.json` (optional but recommended)
3. **Package Manager** - npm, pnpm, yarn, or bun installed
4. **Node.js** - Version 18.0.0 or higher
4. **Node.js** - Version 18.0.0 or higher for consumer projects (sparkle-design itself is developed on 22.14.0; see `.tool-versions`)

### Validate Configuration

Expand Down
6 changes: 3 additions & 3 deletions .claude/skills/change-sparkle-config/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >
書き換えて `sparkle-design-cli generate` まで実行するスキル。選択肢は Theme Settings
Figma プラグインが扱える範囲(primary 7 色 / radius 8 段階 / fonts 11 種)に揃えて
おり、Figma と CLI の見た目がずれません。**未導入プロジェクトの初期セットアップは
`setup-sparkle-design` を使うこと。**
`setup-sparkle-design`(internal 環境では `install-sparkle-design`)を使うこと。**
「雰囲気を変えたい」「もっとポップに」「ビジネスライクに」「高級感を出したい」
「primary を変えたい」「角丸をもっと丸く」「フォントを変えたい」「テーマを提案して」
で発動。English: "change the vibe", "make it more playful",
Expand All @@ -21,7 +21,7 @@ user-invocable: true

**前提**:

- プロジェクトに既に `sparkle-design` / `sparkle-design-cli` が導入済み(未導入の場合は `setup-sparkle-design` スキルを先に使うよう案内する
- プロジェクトに既に `sparkle-design` / `sparkle-design-cli` が導入済み(未導入の場合は `setup-sparkle-design` スキル — internal 環境なら `install-sparkle-design` スキル — を先に使うよう案内する
- 書き換え可能な項目は **Sparkle Design Theme Settings Figma プラグインが扱える範囲と同一**(後述の reference 参照)

---
Expand All @@ -33,7 +33,7 @@ user-invocable: true
### 実行方針

1. **前提チェック**
- カレントディレクトリに `sparkle.config.json` があるか確認。無ければ **未導入状態**。その場合は「**新規導入 + カスタムテーマ**は `setup-sparkle-design` スキルが担当する(setup 実行時に `sparkle.config.json` を編集しておけば同じテーマで導入できる)」と案内し、setup にバトンパスして中断する。
- カレントディレクトリに `sparkle.config.json` があるか確認。無ければ **未導入状態**。その場合は「**新規導入 + カスタムテーマ**は `setup-sparkle-design` スキル(internal 環境では `install-sparkle-design` スキル)が担当する(setup 実行時に `sparkle.config.json` を編集しておけば同じテーマで導入できる)」と案内し、setup にバトンパスして中断する。
- `package.json` の `dependencies` / `devDependencies` に `sparkle-design` が含まれるか確認(pnpm workspace 等で hoist されているケースに備え、`node_modules` のパスチェックは避ける)。未導入なら setup を案内して中断。
2. **現在値を読み取り(元ファイルをスナップショット保存)**
- `sparkle.config.json` の元バイト列をそのままメモリに保持(後の rollback 用)。
Expand Down
7 changes: 7 additions & 0 deletions .cursor/rules/context.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ pnpm format # Prettier formatting
pnpm test # Component tests
```

### Git Safety Rules
- **Never amend + force-push**: address review feedback and mistakes with new commits
- **No direct push to `main`**: always go through a PR (admin merge required)
- **PR merges use normal merge (`--merge`)**: never squash-merge (squashing loses commits)
- **Update the lockfile whenever `package.json` changes**: CI runs `pnpm install --frozen-lockfile` and will fail otherwise
- **Use the pinned toolchain**: Node.js 22.14.0 / pnpm 10.12.4 (see `.tool-versions`; newer pnpm majors can rewrite the lockfile)

## AI Assistance Guidelines
- Refer to specific instruction files for detailed guidance:
- `docs/ai-instructions/testing.md` for testing
Expand Down
28 changes: 28 additions & 0 deletions .cursor/rules/new-component.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
description: Component creation process for Sparkle Design
globs: **
alwaysApply: false
---

# 新規コンポーネントの作成

新規コンポーネントは以下の手順で作成してください。

1. ターミナルで`./scripts/setup.sh <コンポーネント名>`を実行します。
- `<コンポーネント名>`は、作成するコンポーネントの名前に置き換えてください。
- 例: `./scripts/setup.sh my-new-component`
- このスクリプトは、必要なファイルとディレクトリを自動的に生成し、`src/index.ts` への export 追加も自動で行います。
- ただし、使えるコンポーネント名は shadcn/ui に存在するもののみになります。
2. 生成されたディレクトリに移動します。
- 例: `cd src/components/ui/my-new-component`
3. コンポーネントの説明を入力します。
4. コンポーネントフォルダの `README.md` を更新します。
- `item.json` の description を記載する
- `"use client"` の有無に応じて Client Component / Server Component 互換の記述を更新する
- Client Component の場合は個別 import パス(`sparkle-design/<component-name>`)を記載する
- 実装完了後に `node scripts/generate-readmes.mjs` で再生成することもできます
5. ルートの `README.md` の「コンポーネント公開状況」を最新の状態に更新します。

# 生成のルール

コメントに関するルールは `docs/ai-instructions/comment-style.md` を参照してください。
7 changes: 7 additions & 0 deletions .github/instructions/ai-context.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ pnpm format # Prettier formatting
pnpm test # Component tests
```

### Git Safety Rules
- **Never amend + force-push**: address review feedback and mistakes with new commits
- **No direct push to `main`**: always go through a PR (admin merge required)
- **PR merges use normal merge (`--merge`)**: never squash-merge (squashing loses commits)
- **Update the lockfile whenever `package.json` changes**: CI runs `pnpm install --frozen-lockfile` and will fail otherwise
- **Use the pinned toolchain**: Node.js 22.14.0 / pnpm 10.12.4 (see `.tool-versions`; newer pnpm majors can rewrite the lockfile)

## AI Assistance Guidelines
- Refer to specific instruction files for detailed guidance:
- `docs/ai-instructions/testing.md` for testing
Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ pnpm format # Prettier formatting
pnpm test # Component tests
```

### Git Safety Rules
- **Never amend + force-push**: address review feedback and mistakes with new commits
- **No direct push to `main`**: always go through a PR (admin merge required)
- **PR merges use normal merge (`--merge`)**: never squash-merge (squashing loses commits)
- **Update the lockfile whenever `package.json` changes**: CI runs `pnpm install --frozen-lockfile` and will fail otherwise
- **Use the pinned toolchain**: Node.js 22.14.0 / pnpm 10.12.4 (see `.tool-versions`; newer pnpm majors can rewrite the lockfile)

## AI Assistance Guidelines
- Refer to specific instruction files for detailed guidance:
- `docs/ai-instructions/testing.md` for testing
Expand Down
1 change: 0 additions & 1 deletion docs/ai-instructions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ docs/ai-instructions/
|--------|-------------|------|
| OpenAI Codex | `AGENTS.md` | ルートレベルの指示ファイル |
| Claude Code | `CLAUDE.md` | AGENTS.mdへのシンボリックリンク |
| GitHub Copilot | `.github/copilot-instructions.md` | メイン指示ファイル |
| GitHub Copilot | `.github/instructions/*.instructions.md` | スコープ付き指示ファイル |
| Cursor | `.cursor/rules/*.mdc` | スコープ付きルールファイル |
| Cursor | `.cursorrules` | レガシー形式(互換性用) |
Expand Down
7 changes: 7 additions & 0 deletions docs/ai-instructions/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ pnpm format # Prettier formatting
pnpm test # Component tests
```

### Git Safety Rules
- **Never amend + force-push**: address review feedback and mistakes with new commits
- **No direct push to `main`**: always go through a PR (admin merge required)
- **PR merges use normal merge (`--merge`)**: never squash-merge (squashing loses commits)
- **Update the lockfile whenever `package.json` changes**: CI runs `pnpm install --frozen-lockfile` and will fail otherwise
- **Use the pinned toolchain**: Node.js 22.14.0 / pnpm 10.12.4 (see `.tool-versions`; newer pnpm majors can rewrite the lockfile)

## AI Assistance Guidelines
- Refer to specific instruction files for detailed guidance:
- `docs/ai-instructions/testing.md` for testing
Expand Down
4 changes: 4 additions & 0 deletions scripts/sync-ai-instructions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ if [ -f "$SOURCE_DIR/comment-style.md" ]; then
generate_cursor "$SOURCE_DIR/comment-style.md" "comment-style" "Code comment style guidelines" "**/*.tsx,**/*.ts" "false"
fi

if [ -f "$SOURCE_DIR/new-component.md" ]; then
generate_cursor "$SOURCE_DIR/new-component.md" "new-component" "Component creation process for Sparkle Design" "**" "false"
fi

# OpenAI Codex / Claude Code用ファイル生成
generate_agents_md

Expand Down
Loading