From fe65ed62ee865cb66dd62ce5d3f27b1a5ab48128 Mon Sep 17 00:00:00 2001 From: emahiro Date: Wed, 18 Jun 2025 00:41:05 +0900 Subject: [PATCH 1/3] add: CLAUDE.md file with repository guidance for future Claude Code instances MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Multi-application repository structure documentation - Common commands for each project type (Next.js, FastMCP, Mastra) - Code style guidelines from Cursor rules - Biome formatting configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b72e36a --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,68 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Repository Overview + +This is a Japanese LLM development practice repository (LLM の開発の練習用リポジトリ) containing multiple experimental applications and tools. + +## Project Structure + +The repository contains several independent applications: + +### Root Level +- Root package.json provides common formatting/linting with Biome +- Makefile for environment setup (.env → .envrc conversion) +- Uses tab indentation (configured in biome.json) + +### Sub-Applications + +1. **pomodoro-timer-by-copilot-claude4/** - Next.js Pomodoro timer with SQLite + - Commands: `npm run dev`, `npm run build`, `npm run lint` + - Uses better-sqlite3 for session history storage + - TailwindCSS styling, TypeScript + +2. **pomodoro-timer-by-jules/** - Alternative Pomodoro implementation + - Similar structure but different implementation approach + +3. **my-fastmcp-app/** - FastMCP application + - Command: `npm start` (runs `npx fastmcp dev src/index.ts`) + - Uses Google GenAI integration + +4. **my-mastra-app/** - Mastra framework application + - Command: `npm run dev` (runs `mastra dev`) + - Uses @mastra/core and Google AI SDK + +5. **claude-code-test/** - Basic JavaScript test files + +## Common Commands + +### Root Level +- `npm run format` - Format code with Biome +- `npm run lint` - Lint and auto-fix with Biome +- `npm run check` - Run full Biome check +- `make setup-env` - Convert .env to .envrc for direnv +- `make clean` - Remove temporary files + +### Next.js Projects (pomodoro-timer-*) +- `npm run dev` - Start development server (port 3000) +- `npm run build` - Build for production +- `npm run lint` - ESLint checking + +### MCP/Mastra Projects +- Use respective start/dev commands as defined in their package.json + +## Code Style Guidelines + +Based on .cursor/rules/common-rules.mdc: +- Execute exactly what is requested - no additional features +- Implement precisely specified requirements without creative extensions +- Use the simplest solution that fulfills all requirements +- Minimize lines of code while completing the task + +## Formatting Configuration + +- Biome is used for formatting and linting +- Tab indentation (width: 2) +- Double quotes for JavaScript +- Recommended linting rules enabled \ No newline at end of file From 05ce14338df819a400ee5f922d6b2ebef84bf6a0 Mon Sep 17 00:00:00 2001 From: emahiro Date: Wed, 18 Jun 2025 00:43:18 +0900 Subject: [PATCH 2/3] Translate to Japanese --- CLAUDE.md | 94 +++++++++++++++++++++++++++---------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index b72e36a..7194349 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,68 +1,68 @@ # CLAUDE.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +このファイルは、このリポジトリでコードを操作する際にClaude Code (claude.ai/code) にガイダンスを提供します。 -## Repository Overview +## リポジトリ概要 -This is a Japanese LLM development practice repository (LLM の開発の練習用リポジトリ) containing multiple experimental applications and tools. +これは複数の実験的なアプリケーションとツールを含むLLMの開発練習用リポジトリです。 -## Project Structure +## プロジェクト構造 -The repository contains several independent applications: +このリポジトリには複数の独立したアプリケーションが含まれています: -### Root Level -- Root package.json provides common formatting/linting with Biome -- Makefile for environment setup (.env → .envrc conversion) -- Uses tab indentation (configured in biome.json) +### ルートレベル +- ルートのpackage.jsonはBiomeによる共通フォーマット/リントを提供 +- 環境設定用のMakefile(.env → .envrc変換) +- タブインデントを使用(biome.jsonで設定) -### Sub-Applications +### サブアプリケーション -1. **pomodoro-timer-by-copilot-claude4/** - Next.js Pomodoro timer with SQLite - - Commands: `npm run dev`, `npm run build`, `npm run lint` - - Uses better-sqlite3 for session history storage - - TailwindCSS styling, TypeScript +1. **pomodoro-timer-by-copilot-claude4/** - SQLiteを使ったNext.jsポモドーロタイマー + - コマンド: `npm run dev`, `npm run build`, `npm run lint` + - セッション履歴保存にbetter-sqlite3を使用 + - TailwindCSSスタイリング、TypeScript -2. **pomodoro-timer-by-jules/** - Alternative Pomodoro implementation - - Similar structure but different implementation approach +2. **pomodoro-timer-by-jules/** - 代替ポモドーロ実装 + - 同様の構造だが実装アプローチが異なる -3. **my-fastmcp-app/** - FastMCP application - - Command: `npm start` (runs `npx fastmcp dev src/index.ts`) - - Uses Google GenAI integration +3. **my-fastmcp-app/** - FastMCPアプリケーション + - コマンド: `npm start` (`npx fastmcp dev src/index.ts`を実行) + - Google GenAI統合を使用 -4. **my-mastra-app/** - Mastra framework application - - Command: `npm run dev` (runs `mastra dev`) - - Uses @mastra/core and Google AI SDK +4. **my-mastra-app/** - Mastraフレームワークアプリケーション + - コマンド: `npm run dev` (`mastra dev`を実行) + - @mastra/coreとGoogle AI SDKを使用 -5. **claude-code-test/** - Basic JavaScript test files +5. **claude-code-test/** - 基本的なJavaScriptテストファイル -## Common Commands +## 共通コマンド -### Root Level -- `npm run format` - Format code with Biome -- `npm run lint` - Lint and auto-fix with Biome -- `npm run check` - Run full Biome check -- `make setup-env` - Convert .env to .envrc for direnv -- `make clean` - Remove temporary files +### ルートレベル +- `npm run format` - Biomeでコードをフォーマット +- `npm run lint` - Biomeでリント・自動修正 +- `npm run check` - Biomeの完全チェックを実行 +- `make setup-env` - direnv用に.envを.envrcに変換 +- `make clean` - 一時ファイルを削除 -### Next.js Projects (pomodoro-timer-*) -- `npm run dev` - Start development server (port 3000) -- `npm run build` - Build for production -- `npm run lint` - ESLint checking +### Next.jsプロジェクト (pomodoro-timer-*) +- `npm run dev` - 開発サーバーを起動(ポート3000) +- `npm run build` - 本番用ビルド +- `npm run lint` - ESLintチェック -### MCP/Mastra Projects -- Use respective start/dev commands as defined in their package.json +### MCP/Mastraプロジェクト +- 各package.jsonで定義されたstart/devコマンドを使用 -## Code Style Guidelines +## コードスタイルガイドライン -Based on .cursor/rules/common-rules.mdc: -- Execute exactly what is requested - no additional features -- Implement precisely specified requirements without creative extensions -- Use the simplest solution that fulfills all requirements -- Minimize lines of code while completing the task +.cursor/rules/common-rules.mdcに基づく: +- 要求された内容を正確に実行 - 追加機能なし +- 創意的な拡張なしに指定された要件を正確に実装 +- すべての要件を満たす最もシンプルなソリューションを使用 +- タスクを完了しながらコード行数を最小化 -## Formatting Configuration +## フォーマット設定 -- Biome is used for formatting and linting -- Tab indentation (width: 2) -- Double quotes for JavaScript -- Recommended linting rules enabled \ No newline at end of file +- フォーマットとリントにBiomeを使用 +- タブインデント(幅:2) +- JavaScriptにはダブルクォート +- 推奨リントルールを有効化 \ No newline at end of file From 151676ccbc0b5c65dfa01cd33f2c52ef97e5ccad Mon Sep 17 00:00:00 2001 From: emahiro Date: Wed, 18 Jun 2025 00:52:09 +0900 Subject: [PATCH 3/3] add: design directory with application design docs and update CLAUDE.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create ./design directory structure - Add design documents for all sub-applications: - pomodoro-timer-by-copilot-claude4.md - pomodoro-timer-by-jules.md - my-fastmcp-app.md - my-mastra-app.md - claude-code-test.md - Update CLAUDE.md with Design Directory rules and operational guidelines - Establish requirement to reference design docs before development 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- CLAUDE.md | 32 ++++++++++- design/claude-code-test.md | 48 +++++++++++++++++ design/my-fastmcp-app.md | 47 ++++++++++++++++ design/my-mastra-app.md | 60 +++++++++++++++++++++ design/pomodoro-timer-by-copilot-claude4.md | 46 ++++++++++++++++ design/pomodoro-timer-by-jules.md | 47 ++++++++++++++++ 6 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 design/claude-code-test.md create mode 100644 design/my-fastmcp-app.md create mode 100644 design/my-mastra-app.md create mode 100644 design/pomodoro-timer-by-copilot-claude4.md create mode 100644 design/pomodoro-timer-by-jules.md diff --git a/CLAUDE.md b/CLAUDE.md index 7194349..982a9cc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -65,4 +65,34 @@ - フォーマットとリントにBiomeを使用 - タブインデント(幅:2) - JavaScriptにはダブルクォート -- 推奨リントルールを有効化 \ No newline at end of file +- 推奨リントルールを有効化 + +## Design Directory ルール + +### 概要 +llmlab 内でのアプリケーション開発・変更時は、必ず `./design` ディレクトリ配下の設計ドキュメントを参照すること。 + +### ディレクトリ構造 +``` +./design/ +├── pomodoro-timer-by-copilot-claude4.md +├── pomodoro-timer-by-jules.md +├── my-fastmcp-app.md +├── my-mastra-app.md +└── claude-code-test.md +``` + +### 運用ルール +1. **開発前の確認**: アプリケーションの開発・変更を行う前に、該当する design ドキュメントを必ず読む +2. **設計ドキュメントの更新**: アプリケーションに変更を加えた場合は、対応する design ドキュメントも同時に更新する +3. **新規アプリケーション**: 新しいアプリケーションを作成する場合は、`./design/{application_name}.md` 形式で設計ドキュメントを作成する +4. **アーキテクチャの一貫性**: design ドキュメントに記載されたアーキテクチャ・技術スタック・開発ガイドラインに従う + +### 設計ドキュメントの内容 +各設計ドキュメントには以下の情報を含める: +- 概要とアーキテクチャ +- 技術仕様(フレームワーク、言語、依存関係) +- 機能要件 +- 開発コマンド +- セットアップ手順 +- 開発ガイドライン \ No newline at end of file diff --git a/design/claude-code-test.md b/design/claude-code-test.md new file mode 100644 index 0000000..aeae5d6 --- /dev/null +++ b/design/claude-code-test.md @@ -0,0 +1,48 @@ +# Claude Code Test + +## 概要 +Claude Code の機能テスト用の基本的な JavaScript テストファイル群 + +## アーキテクチャ +- **言語**: JavaScript (ES5/ES6) +- **実行環境**: Node.js +- **テストフレームワーク**: 独自実装(シンプルなアサーション) + +## 技術仕様 +### ファイル構成 +- `test.js` - メインテストファイル + +### 実行コマンド +- `node claude-code-test/test.js` - テスト実行 + +## 機能要件 +### テスト対象関数 +- `add(a, b)` - 数値の加算 +- `multiply(a, b)` - 数値の乗算 + +### テスト関数 +- `testAdd()` - 加算関数のテスト (2 + 3 = 5) +- `testMultiply()` - 乗算関数のテスト (3 × 4 = 12) +- `runTests()` - 全テストの実行とレポート + +## 実装仕様 +### テスト結果表示 +- 成功時: `✓ [function] test passed` +- 失敗時: `✗ [function] test failed` +- 開始・終了メッセージの表示 + +### テストパターン +- 基本的な数値演算のテスト +- 期待値との厳密等価比較 +- コンソール出力によるフィードバック + +## 開発ガイドライン +- シンプルで理解しやすいテストコード +- Node.js 標準機能のみを使用 +- 外部依存関係なし +- 即座に実行可能な設計 + +## 使用目的 +- Claude Code の基本機能確認 +- JavaScript 実行環境のテスト +- 簡単なデバッグ・検証作業 \ No newline at end of file diff --git a/design/my-fastmcp-app.md b/design/my-fastmcp-app.md new file mode 100644 index 0000000..36eba25 --- /dev/null +++ b/design/my-fastmcp-app.md @@ -0,0 +1,47 @@ +# FastMCP Application + +## 概要 +FastMCP フレームワークを使用したテストアプリケーション + +## アーキテクチャ +- **フレームワーク**: FastMCP v1.21.0 +- **言語**: TypeScript +- **モジュールシステム**: ES Modules +- **AI統合**: Google GenAI v0.7.0 +- **バリデーション**: Zod v3.24.2 + +## 技術仕様 +### エントリーポイント +- **メインファイル**: `src/index.ts` +- **パッケージタイプ**: ES Module + +### 開発コマンド +- `npm start` - FastMCP 開発サーバー起動 (`npx fastmcp dev src/index.ts`) + +### 依存関係 +#### 本番依存関係 +- `fastmcp` (^1.21.0) - コアフレームワーク +- `zod` (^3.24.2) - スキーマバリデーション +- `@google/genai` (^0.7.0) - Google AI 統合 +- `@types/dotenv` (^8.2.3) - 環境変数型定義 +- `@types/node` (^22.14.0) - Node.js 型定義 + +## 機能要件 +- FastMCP プロトコルによる MCP サーバー実装 +- Google GenAI との統合 +- TypeScript による型安全な開発環境 + +## 開発ガイドライン +- ES Modules を使用 +- TypeScript による厳密な型チェック +- Zod によるランタイムバリデーション +- FastMCP のベストプラクティスに従う + +## セットアップ手順 +1. プロジェクトディレクトリに移動: `cd my-fastmcp-app` +2. 依存関係をインストール: `npm install` +3. 開発サーバーを起動: `npm start` + +## 設定 +- 環境変数は .env ファイルで管理 +- Google AI API キーの設定が必要 \ No newline at end of file diff --git a/design/my-mastra-app.md b/design/my-mastra-app.md new file mode 100644 index 0000000..9112604 --- /dev/null +++ b/design/my-mastra-app.md @@ -0,0 +1,60 @@ +# Mastra Framework Application + +## 概要 +Mastra フレームワークを使用したアプリケーション + +## アーキテクチャ +- **フレームワーク**: Mastra v0.4.4 +- **コアライブラリ**: @mastra/core v0.7.0 +- **言語**: TypeScript v5.8.3 +- **モジュールシステム**: ES Modules +- **AI統合**: Google AI SDK v1.2.8 +- **MCP統合**: @mastra/mcp v0.3.6 + +## 技術仕様 +### 開発環境 +- **ランタイム**: tsx v4.19.3 +- **型定義**: @types/node v22.14.0 +- **バリデーション**: Zod v3.24.2 + +### 開発コマンド +- `npm run dev` - Mastra 開発サーバー起動 (`mastra dev`) +- `npm test` - テスト実行 (未実装) + +### プロジェクト構造 +- **エントリーポイント**: `index.js` +- **設定ファイル**: `tsconfig.json` + +## 機能要件 +- Mastra フレームワークによるエージェント・ツール管理 +- Google AI SDK との統合 +- MCP (Model Context Protocol) サポート +- TypeScript による型安全な開発 + +## 依存関係 +### 本番依存関係 +- `@ai-sdk/google` (^1.2.8) - Google AI SDK +- `@mastra/core` (^0.7.0) - Mastra コアライブラリ +- `@mastra/mcp` (^0.3.6) - MCP 統合 +- `mastra` (^0.4.4) - Mastra CLI/フレームワーク +- `zod` (^3.24.2) - スキーマバリデーション + +### 開発依存関係 +- `@types/node` (^22.14.0) - Node.js 型定義 +- `tsx` (^4.19.3) - TypeScript 実行環境 +- `typescript` (^5.8.3) - TypeScript コンパイラ + +## 開発ガイドライン +- ES Modules を使用 +- TypeScript による厳密な型チェック +- Mastra のエージェント・ツールパターンに従う +- Google AI SDK の非同期パターンを活用 + +## セットアップ手順 +1. プロジェクトディレクトリに移動: `cd my-mastra-app` +2. 依存関係をインストール: `npm install` +3. 開発サーバーを起動: `npm run dev` + +## 設定 +- Google AI API キーの設定が必要 +- Mastra 設定ファイルによるエージェント・ツール定義 \ No newline at end of file diff --git a/design/pomodoro-timer-by-copilot-claude4.md b/design/pomodoro-timer-by-copilot-claude4.md new file mode 100644 index 0000000..52e0729 --- /dev/null +++ b/design/pomodoro-timer-by-copilot-claude4.md @@ -0,0 +1,46 @@ +# ポモドーロタイマーアプリ (Copilot Claude4版) + +## 概要 +**試験的なアプリケーション**として開発されたポモドーロタイマーアプリケーション + +## アーキテクチャ +- **フレームワーク**: Next.js (最新版) +- **言語**: TypeScript +- **スタイリング**: TailwindCSS +- **データベース**: SQLite (better-sqlite3) +- **UI ライブラリ**: React + +## 機能要件 +- ポモドーロタイマーの基本機能 +- フロントエンドのみで完結する実装 +- localhost での起動 +- SQLite を使用したセッション履歴の永続化 + +## UI/UX設計 +### メイン画面 +- 中央にタイマー表示 +- スタートボタンとストップボタン +- 一般的なタイマーアプリのUI + +### サイドバー +- ポモドーロタイマーの利用履歴を表示 +- セッション完了時に自動更新 + +## 技術仕様 +### 開発コマンド +- `npm run dev` - 開発サーバー起動 +- `npm run build` - 本番ビルド +- `npm run lint` - ESLint チェック + +### データベーススキーマ +- SQLite でセッション履歴を管理 +- better-sqlite3 ライブラリを使用 + +### デプロイメント +- localhost:3000 で起動 +- 開発環境のみを想定 + +## 開発ガイドライン +- Next.js の一般的なプラクティスに従う +- TailwindCSS は無料範囲内で利用 +- TypeScript による型安全性の確保 \ No newline at end of file diff --git a/design/pomodoro-timer-by-jules.md b/design/pomodoro-timer-by-jules.md new file mode 100644 index 0000000..ffdb3e3 --- /dev/null +++ b/design/pomodoro-timer-by-jules.md @@ -0,0 +1,47 @@ +# Pomodoro Timer by Jules + +## 概要 +Jules (AI アシスタント) によって作成された実験的なポモドーロタイマーアプリケーション + +## アーキテクチャ +- **フレームワーク**: Next.js (App Router, TypeScript) +- **言語**: TypeScript +- **スタイリング**: Tailwind CSS +- **データベース**: SQLite (ローカルデータストレージ) +- **UI ライブラリ**: React + +## 機能要件 +### ポモドーロタイマー +- 標準的な25分作業セッションと5分休憩セッション +- MM:SS 形式のタイマー表示 +- Start、Stop、Reset コントロール +- 作業と休憩セッション間の自動切り替え +- 現在のセッションタイプ(Work/Break)のテキスト通知 + +### セッション履歴 +- 完了したポモドーロセッション(作業・休憩両方)のローカル保存 +- サイドバーでの履歴表示 + - セッションタイプ(Work/Break) + - 開始時間 + - 継続時間 +- 新しいセッション完了時の履歴サイドバー自動更新 + +## 技術仕様 +### 開発コマンド +- `npm run dev` - 開発サーバー起動 (http://localhost:3000) +- `npm install` - 依存関係インストール + +### データベース +- SQLite データベースファイル (`pomodoro.db`) がプロジェクトルートに作成 +- 初回データベースアクセス時または履歴ページ読み込み時に自動作成 + +## セットアップ手順 +1. プロジェクトディレクトリに移動 +2. `npm install` で依存関係をインストール +3. `npm run dev` で開発サーバーを起動 +4. http://localhost:3000 でアプリケーションにアクセス + +## 開発ガイドライン +- Next.js App Router パターンを使用 +- TypeScript による型安全性の確保 +- Tailwind CSS によるレスポンシブデザイン \ No newline at end of file