chore: sync AGENTS.md with CLAUDE.md (full update)
AGENTS.md was severely outdated. Now fully synchronized with CLAUDE.md: - Added disaster recovery section - Added all missing rules (safe-area, noopener, accent hardcode, etc.) - Added complete project list (22 apps) - Added Access Guide step to new app checklist - Updated deploy-server.sh instructions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cab06ec681
commit
9629c35c89
110
AGENTS.md
110
AGENTS.md
|
|
@ -1,15 +1,74 @@
|
||||||
# Posimai Project — AI Instructions
|
# Posimai Project — AI Instructions
|
||||||
|
|
||||||
|
> **このファイルについて**: `AGENTS.md` は Claude Code 以外の AI ツール(Antigravity, Gemini, ChatGPT 等)向けの規約ファイルです。内容は `CLAUDE.md`(Claude Code 用)と完全同期しています。変更する場合は **必ず両ファイルを同時に更新**してください。
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 新しい AI への引き継ぎチェックリスト(必読)
|
## 新しい AI への引き継ぎチェックリスト(必読)
|
||||||
|
|
||||||
別の AI エージェント(Antigravity 等)やセッションを新たに始めるときは、**必ず最初にこのセクションを読ませること。**
|
別の AI エージェント(Antigravity 等)やセッションを新たに始めるときは、**必ず最初にこのセクションを読ませること。**
|
||||||
|
|
||||||
### 作業前に AI が確認すべき事項
|
### 作業前に AI が確認すべき事項
|
||||||
|
|
||||||
1. **CLAUDE.md を全文読む**(このファイル)— デザインルール・デプロイ方法・禁止事項がすべてここにある
|
1. **AGENTS.md を全文読む**(このファイル)— デザインルール・デプロイ方法・禁止事項がすべてここにある
|
||||||
2. **memory/ ディレクトリを確認する** — `C:\Users\maita\.claude\projects\c--Users-maita-posimai-project\memory\MEMORY.md` にプロジェクト固有の記憶がある
|
2. **memory/ ディレクトリを確認する** — `C:\Users\maita\.claude\projects\c--Users-maita-posimai-project\memory\MEMORY.md` にプロジェクト固有の記憶がある
|
||||||
3. **`posimai-dashboard/src/data/projects.json` を確認する** — 全アプリの一覧・ステータス・技術スタックがここにある
|
3. **`posimai-dashboard/src/data/projects.json` を確認する** — 全アプリの一覧・ステータス・技術スタックがここにある
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ディザスタリカバリ(PC 完全消失時の復元手順)
|
||||||
|
|
||||||
|
### バックアップリポジトリ
|
||||||
|
|
||||||
|
| リポジトリ | Gitea(ローカル) | GitHub(クラウド) | 内容 |
|
||||||
|
|-----------|-----------------|-----------------|------|
|
||||||
|
| `posimai-root` | `http://100.76.7.3:3000/mai/posimai-root` | `https://github.com/posimai/posimai-root` (private) | CLAUDE.md / AGENTS.md / _template / server.js / scripts / deploy-server.sh / claude-settings.json |
|
||||||
|
| `claude-memory` | `http://100.76.7.3:3000/mai/claude-memory` | `https://github.com/posimai/claude-memory` (private) | ~/.claude/memory 以下の全記憶ファイル |
|
||||||
|
|
||||||
|
### 新マシンでの復元手順
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1. GitHub CLI 認証
|
||||||
|
gh auth login
|
||||||
|
|
||||||
|
# 2. posimai-root を clone(CLAUDE.md・設定類を復元)
|
||||||
|
git clone https://github.com/posimai/posimai-root.git "C:/Users/maita/posimai-project"
|
||||||
|
cd "C:/Users/maita/posimai-project"
|
||||||
|
git remote add gitea http://100.76.7.3:3000/mai/posimai-root.git
|
||||||
|
|
||||||
|
# 3. Claude Code settings を復元
|
||||||
|
cp "C:/Users/maita/posimai-project/claude-settings.json" "C:/Users/maita/.claude/settings.json"
|
||||||
|
|
||||||
|
# 4. claude-memory を clone(AI 記憶を復元)
|
||||||
|
git clone https://github.com/posimai/claude-memory.git "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
cd "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
git remote add gitea http://100.76.7.3:3000/mai/claude-memory.git
|
||||||
|
|
||||||
|
# 5. 各アプリを必要に応じて clone
|
||||||
|
# git clone https://github.com/posimai/[app-name].git "C:/Users/maita/posimai-project/[app-name]"
|
||||||
|
# cd [app-name] && git remote add gitea http://100.76.7.3:3000/mai/[app-name].git
|
||||||
|
```
|
||||||
|
|
||||||
|
### posimai-root の更新方法(CLAUDE.md・AGENTS.md・server.js 等を変更した後)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd C:/Users/maita/posimai-project
|
||||||
|
git add CLAUDE.md AGENTS.md claude-settings.json _template/ deploy-server.sh scripts/ server.js
|
||||||
|
git commit -m "chore: update ..."
|
||||||
|
git push gitea main && git push github main
|
||||||
|
```
|
||||||
|
|
||||||
|
### claude-memory の更新方法(AI が記憶を更新した後)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd "C:/Users/maita/.claude/projects/c--Users-maita-posimai-project/memory"
|
||||||
|
git add .
|
||||||
|
git commit -m "chore: update memory"
|
||||||
|
git push gitea main && git push github main
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
### AI が絶対に守るべきルール(違反時は即修正)
|
### AI が絶対に守るべきルール(違反時は即修正)
|
||||||
|
|
||||||
| 禁止事項 | 理由 |
|
| 禁止事項 | 理由 |
|
||||||
|
|
@ -22,6 +81,13 @@
|
||||||
| デザインシステム外の色の使用 | アクセントは `--accent` 1色のみ |
|
| デザインシステム外の色の使用 | アクセントは `--accent` 1色のみ |
|
||||||
| manifest.json / sw.js のないアプリを作る | 全アプリ PWA 必須 |
|
| manifest.json / sw.js のないアプリを作る | 全アプリ PWA 必須 |
|
||||||
| `theme-color` メタタグをメディアクエリなしで書く | ライトモード時に黒い問題が発生する |
|
| `theme-color` メタタグをメディアクエリなしで書く | ライトモード時に黒い問題が発生する |
|
||||||
|
| **新アプリ作成後に Dashboard 更新を省略する** | アプリがエコシステムから孤立する。ユーザーに言われなくても必ずやる |
|
||||||
|
| SW でクロスオリジン GET リクエストをキャッシュする | Brain API 等の外部 API が古いデータを返す・データ消失に見える(Habit バグ事例あり) |
|
||||||
|
| `lucide.createIcons()` を早期 return の後にしか呼ばない | 早期 return のコードパスでアイコンが空になる(Habit バグ事例あり) |
|
||||||
|
| CSS でアクセントカラーをハードコード(`#6EE7B7` 直書き等) | ダーク/ライトテーマ切り替えが壊れる。必ず `var(--accent)` を使う |
|
||||||
|
| 底面固定要素に `env(safe-area-inset-bottom)` を付けない | iPhone のホームインジケーター領域にコンテンツが被る |
|
||||||
|
| 外部リンクに `rel="noopener"` を付けない | Tabnabbing 攻撃の温床。`target="_blank"` には必ずセットで付ける |
|
||||||
|
| **新アプリ作成前にアクセントカラーを宣言しない** | 実装後に変更コストが大きい。カテゴリ確認→AGENTS.md テーブル追記→実装の順を守る |
|
||||||
|
|
||||||
### 作業完了時の必須チェック
|
### 作業完了時の必須チェック
|
||||||
|
|
||||||
|
|
@ -29,6 +95,7 @@
|
||||||
- [ ] `@latest` が増えていないか (`grep -r "@latest" --include="*.html"`)
|
- [ ] `@latest` が増えていないか (`grep -r "@latest" --include="*.html"`)
|
||||||
- [ ] `npm run deploy` でデプロイしたか(`git push gitea main && git push github main`)
|
- [ ] `npm run deploy` でデプロイしたか(`git push gitea main && git push github main`)
|
||||||
- [ ] 大きな変更なら Dashboard Timeline に追記したか
|
- [ ] 大きな変更なら Dashboard Timeline に追記したか
|
||||||
|
- [ ] **新アプリなら Dashboard カード・Ecosystem・Timeline・Access Guide を更新してデプロイしたか**(ユーザーに言われる前に完了させる)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
@ -74,12 +141,24 @@ npm run deploy
|
||||||
| posimai-digest | `posimai-digest/` | テキスト要約(静的) |
|
| posimai-digest | `posimai-digest/` | テキスト要約(静的) |
|
||||||
| posimai-ambient | `posimai-ambient/` | 常時表示アンビエント PWA(静的) |
|
| posimai-ambient | `posimai-ambient/` | 常時表示アンビエント PWA(静的) |
|
||||||
| posimai-widget | `posimai_widget/` | Android ホーム画面ウィジェット(Flutter) |
|
| posimai-widget | `posimai_widget/` | Android ホーム画面ウィジェット(Flutter) |
|
||||||
|
| posimai-timer | `posimai-timer/` | ストップウォッチ+カウントダウン(静的) |
|
||||||
|
| posimai-habit | `posimai-habit/` | 習慣チェックリスト・ヒートマップ(静的) |
|
||||||
|
| posimai-pulse | `posimai-pulse/` | 気分・エネルギー記録(静的) |
|
||||||
|
| posimai-lens | `posimai-lens/` | 写真 EXIF メタデータ表示(静的) |
|
||||||
|
| posimai-diff | `posimai-diff/` | テキスト差分ビューア(静的) |
|
||||||
|
| posimai-clean | `posimai-clean/` | テキストクリーナー(静的) |
|
||||||
|
| posimai-tech-events | `posimai-tech-events/` | IT イベント情報(Doorkeeper/connpass RSS) |
|
||||||
|
| posimai-think | `posimai-think/` | AI 思考整理アシスタント(Gemini 直接呼び出し) |
|
||||||
|
|
||||||
## Synology バックエンド(server.js)
|
## Synology バックエンド(server.js)
|
||||||
- ファイル: `server.js`(ルートに配置、git 管理外)
|
- ファイル: `server.js`(ルートに配置、git 管理外)
|
||||||
- デプロイ: File Station でアップロード → `docker cp` → `docker restart posimai_api`
|
- **デプロイ方法(必須)**: `bash deploy-server.sh` を実行する(SSH → docker cp → docker restart まで自動)
|
||||||
|
- SSHパスワード → sudoパスワードの順に2回入力を求められる
|
||||||
|
- スクリプト内の処理: `ssh` でファイル転送 → `docker cp` → `docker restart posimai_api` → ログ確認
|
||||||
|
- ⚠️ `vercel --prod` や File Station での手動アップロードは使わない
|
||||||
- API base: `https://posimai-lab.tail72e846.ts.net/brain/api`
|
- API base: `https://posimai-lab.tail72e846.ts.net/brain/api`
|
||||||
- 主なテーブル: `users`, `articles`, `journal_posts`, `site_config`, `reading_history`
|
- 主なテーブル: `users`, `articles`, `journal_posts`, `site_config`, `reading_history`
|
||||||
|
- 主なエンドポイント: `/health`, `/auth-test`, `/articles`, `/article`, `/feeds`, `/events/rss`, `/tts/*`, `/journal/*`
|
||||||
|
|
||||||
## デザインシステム(projects.json designRules が正)
|
## デザインシステム(projects.json designRules が正)
|
||||||
```
|
```
|
||||||
|
|
@ -98,6 +177,17 @@ npm run deploy
|
||||||
- ヘッダー: 高さ 52px、glassmorphism、アクセントドット + アプリ名
|
- ヘッダー: 高さ 52px、glassmorphism、アクセントドット + アプリ名
|
||||||
- 絵文字: **禁止**
|
- 絵文字: **禁止**
|
||||||
- 全アプリ: manifest.json + sw.js + PWA メタタグ必須
|
- 全アプリ: manifest.json + sw.js + PWA メタタグ必須
|
||||||
|
- トランジション: `0.12s〜0.3s` の範囲、標準イージング `cubic-bezier(0.2, 0.9, 0.2, 1)`
|
||||||
|
- 空状態 (Empty State): 必ずアイコン + 説明テキストを実装する(空コンテナ禁止)
|
||||||
|
- 外部リンク: `target="_blank" rel="noopener"` を必ずセットで付ける
|
||||||
|
- 底面固定要素: `padding-bottom: max(Xpx, env(safe-area-inset-bottom))` で safe area 対応
|
||||||
|
- SW キャッシュ: クロスオリジン GET は必ずネットワーク経由(キャッシュ禁止)
|
||||||
|
```js
|
||||||
|
const ORIGIN = self.location.origin;
|
||||||
|
self.addEventListener('fetch', e => {
|
||||||
|
if (!e.request.url.startsWith(ORIGIN)) return; // APIはスルー
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### アプリ別アクセントカラー(デフォルトから意図的に変える場合のみ記載)
|
### アプリ別アクセントカラー(デフォルトから意図的に変える場合のみ記載)
|
||||||
|
|
||||||
|
|
@ -106,6 +196,7 @@ npm run deploy
|
||||||
| 全般(デフォルト) | `#6EE7B7` Teal | `#059669` | Posimai ブランドカラー |
|
| 全般(デフォルト) | `#6EE7B7` Teal | `#059669` | Posimai ブランドカラー |
|
||||||
| posimai-journal | `#80CAEE` Sky-Blue | `#0284C7` | CMS 系・静かで知的な印象 |
|
| posimai-journal | `#80CAEE` Sky-Blue | `#0284C7` | CMS 系・静かで知的な印象 |
|
||||||
| posimai-site | `#80CAEE` Sky-Blue | `#0284C7` | journal と同系統の公開サイト |
|
| posimai-site | `#80CAEE` Sky-Blue | `#0284C7` | journal と同系統の公開サイト |
|
||||||
|
| ponshu-room | `#D4A574` 琥珀(Amber) | `#D4A574` | **Posimai デザインシステム適用外**。独立プロダクト。Washi テーマ(和紙×墨×琥珀)を使用。詳細は `ponshu-room/ROADMAP.md` を参照。 |
|
||||||
|
|
||||||
**新アプリ作成時のルール:**
|
**新アプリ作成時のルール:**
|
||||||
1. デフォルト Teal を使うなら何も記載不要
|
1. デフォルト Teal を使うなら何も記載不要
|
||||||
|
|
@ -125,6 +216,11 @@ npm run deploy
|
||||||
|
|
||||||
新しいアプリを作ったら、**コード実装の完了直後に必ずこの順番で実行する**こと:
|
新しいアプリを作ったら、**コード実装の完了直後に必ずこの順番で実行する**こと:
|
||||||
|
|
||||||
|
0. **【実装前】アクセントカラーを宣言する**
|
||||||
|
- このアプリのカテゴリを確認(インプット/作成・編集/ツール/共有/インフラ)
|
||||||
|
- デフォルト Teal で問題なければ何もしない
|
||||||
|
- Sky Blue 等に変える場合は AGENTS.md の「アプリ別アクセントカラー」テーブルに**先に追記**してから実装を開始する
|
||||||
|
|
||||||
1. **Dashboard カード追加**
|
1. **Dashboard カード追加**
|
||||||
- `posimai-dashboard/src/data/projects.json` の `projects` 配列にエントリを追加
|
- `posimai-dashboard/src/data/projects.json` の `projects` 配列にエントリを追加
|
||||||
- 適切な `category` を設定(`posimai-pwa` / `active` / `flagship` / `micro` / `infra` など)
|
- 適切な `category` を設定(`posimai-pwa` / `active` / `flagship` / `micro` / `infra` など)
|
||||||
|
|
@ -137,15 +233,19 @@ npm run deploy
|
||||||
- `posimai-dashboard/src/app/timeline/page.tsx` の `EVENTS` 配列に今日の日付でエントリを追加
|
- `posimai-dashboard/src/app/timeline/page.tsx` の `EVENTS` 配列に今日の日付でエントリを追加
|
||||||
- type: `launch`(新規公開)/ `feature`(機能追加)/ `fix`(修正)/ `infra`(インフラ)
|
- type: `launch`(新規公開)/ `feature`(機能追加)/ `fix`(修正)/ `infra`(インフラ)
|
||||||
|
|
||||||
4. **Dashboard をデプロイ**
|
4. **Access Guide に追記**
|
||||||
|
- `posimai-dashboard/src/app/access/page.tsx` の `APPS` 配列にエントリを追加
|
||||||
|
- `accessLevel` / `codevAccess` / `authDetail` / `codevNote` を正確に記入する
|
||||||
|
|
||||||
|
5. **Dashboard をデプロイ**
|
||||||
```bash
|
```bash
|
||||||
cd posimai-dashboard
|
cd posimai-dashboard
|
||||||
git add src/data/projects.json src/app/ecosystem/page.tsx src/app/timeline/page.tsx
|
git add src/data/projects.json src/app/ecosystem/page.tsx src/app/timeline/page.tsx src/app/access/page.tsx
|
||||||
git commit -m "feat: add [app-name] to dashboard"
|
git commit -m "feat: add [app-name] to dashboard"
|
||||||
npm run deploy
|
npm run deploy
|
||||||
```
|
```
|
||||||
|
|
||||||
5. **プロジェクト構成テーブルを CLAUDE.md に追記**(このファイル)
|
6. **プロジェクト構成テーブルを AGENTS.md に追記**(このファイル)
|
||||||
|
|
||||||
> ⚠️ ダッシュボード更新(カード・Ecosystem・Timeline)を忘れると、アプリが孤立してエコシステムから見えなくなる。
|
> ⚠️ ダッシュボード更新(カード・Ecosystem・Timeline)を忘れると、アプリが孤立してエコシステムから見えなくなる。
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue