@hir4ta/memoria 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/README.ja.md +284 -0
- package/README.md +180 -93
- package/dist/public/assets/index-CDRtq90Z.css +1 -0
- package/dist/public/assets/index-CVr5GJK4.js +51 -0
- package/dist/public/index.html +2 -2
- package/dist/server.js +12 -0
- package/hooks/default-tags.json +1055 -0
- package/hooks/hooks.json +24 -2
- package/hooks/post-tool-use.sh +36 -0
- package/hooks/pre-tool-use.sh +36 -0
- package/hooks/session-end.sh +226 -773
- package/hooks/session-start.sh +159 -41
- package/hooks/stop.sh +25 -0
- package/package.json +2 -2
- package/skills/brainstorm/skill.md +397 -0
- package/skills/debug/skill.md +452 -0
- package/skills/decision/skill.md +89 -77
- package/skills/plan/skill.md +390 -0
- package/skills/report/skill.md +20 -20
- package/skills/resume/skill.md +53 -62
- package/skills/review/skill.md +216 -57
- package/skills/save/skill.md +41 -77
- package/skills/search/skill.md +88 -57
- package/skills/tdd/skill.md +371 -0
- package/skills/using-memoria/skill.md +160 -85
- package/dist/public/assets/index-CBu75zER.css +0 -1
- package/dist/public/assets/index-CT2IXdTo.js +0 -51
- package/hooks/pre-compact.sh +0 -419
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memoria",
|
|
3
|
-
"description": "Claude Code
|
|
4
|
-
"version": "0.9.
|
|
3
|
+
"description": "A plugin that provides long-term memory for Claude Code. It automatically saves context lost during auto-compact, offering features for session restoration, recording technical decisions, and learning developer patterns.",
|
|
4
|
+
"version": "0.9.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "hir4ta"
|
|
7
7
|
},
|
package/README.ja.md
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
# memoria
|
|
2
|
+
|
|
3
|
+
Claude Codeの長期記憶を実現するプラグイン
|
|
4
|
+
|
|
5
|
+
セッションのリアルタイム保存、技術的な判断の記録、Webダッシュボードでの管理を提供します。
|
|
6
|
+
|
|
7
|
+
## 機能
|
|
8
|
+
|
|
9
|
+
### コア機能
|
|
10
|
+
- **リアルタイムセッション更新**: 意味のある変化があった時にセッションJSONを自動更新
|
|
11
|
+
- **セッション再開**: `/memoria:resume` で過去のセッションを再開
|
|
12
|
+
- **技術的な判断の記録**: `/memoria:decision` で判断を記録
|
|
13
|
+
- **ルールベースレビュー**: `dev-rules.json` / `review-guidelines.json` に基づくレビュー
|
|
14
|
+
- **週次レポート**: レビュー結果を集計したMarkdownレポートを自動生成
|
|
15
|
+
- **Webダッシュボード**: セッション・判断記録の閲覧・編集
|
|
16
|
+
|
|
17
|
+
### 開発ワークフロー
|
|
18
|
+
- **ブレインストーミング**: ソクラティック質問 + 記憶参照で設計 (`/memoria:brainstorm`)
|
|
19
|
+
- **計画作成**: 2-5分単位のTDDタスク分割 (`/memoria:plan`)
|
|
20
|
+
- **TDD**: RED-GREEN-REFACTORサイクルの厳格強制 (`/memoria:tdd`)
|
|
21
|
+
- **デバッグ**: 根本原因分析 + エラーパターン参照 (`/memoria:debug`)
|
|
22
|
+
- **二段階レビュー**: 仕様準拠 + コード品質 (`/memoria:review --full`)
|
|
23
|
+
|
|
24
|
+
## 課題と解決(導入メリット)
|
|
25
|
+
|
|
26
|
+
### Claude Code 開発で起きがちな課題
|
|
27
|
+
|
|
28
|
+
- **コンテキストの消失**: セッション終了やAuto-Compactで会話の文脈が失われる
|
|
29
|
+
- **判断の不透明化**: 「なぜこの設計にしたのか」が後から追えない
|
|
30
|
+
- **知見の再利用が難しい**: 過去のやり取りや決定を検索・参照しづらい
|
|
31
|
+
|
|
32
|
+
### memoria でできること/解消できること
|
|
33
|
+
|
|
34
|
+
- **リアルタイム保存 + 再開**で、セッションを跨いだ文脈の継続が可能
|
|
35
|
+
- **判断記録**で、理由・代替案を後から追跡
|
|
36
|
+
- **検索とダッシュボード**で、過去の記録を素早く参照
|
|
37
|
+
- **レビュー機能**で、リポジトリ固有の観点に基づいて指摘
|
|
38
|
+
- **週次レポート**で、レビュー観点の改善と共有が容易
|
|
39
|
+
|
|
40
|
+
### チーム利用のメリット
|
|
41
|
+
|
|
42
|
+
- `.memoria/` のJSONは**Git管理可能**なので、判断や会話の履歴をチームで共有できる
|
|
43
|
+
- オンボーディングやレビュー時に「背景・経緯」を短時間で把握できる
|
|
44
|
+
|
|
45
|
+
## インストール
|
|
46
|
+
|
|
47
|
+
### 前提条件
|
|
48
|
+
|
|
49
|
+
- **jq**: フックでJSON処理に使用します
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# macOS
|
|
53
|
+
brew install jq
|
|
54
|
+
|
|
55
|
+
# Ubuntu/Debian
|
|
56
|
+
sudo apt-get install jq
|
|
57
|
+
|
|
58
|
+
# Windows (Chocolatey)
|
|
59
|
+
choco install jq
|
|
60
|
+
|
|
61
|
+
# Windows (Scoop)
|
|
62
|
+
scoop install jq
|
|
63
|
+
|
|
64
|
+
# Windows (winget)
|
|
65
|
+
winget install jqlang.jq
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### プラグインのインストール
|
|
69
|
+
|
|
70
|
+
Claude Code内で以下を実行
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
/plugin marketplace add hir4ta/memoria-marketplace
|
|
74
|
+
/plugin install memoria@memoria-marketplace
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Claude Codeを再起動して完了
|
|
78
|
+
|
|
79
|
+
## アップデート
|
|
80
|
+
|
|
81
|
+
Claude Code内で以下を実行
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
/plugin marketplace update memoria-marketplace
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Claude Codeを再起動
|
|
88
|
+
|
|
89
|
+
### 自動更新を有効にする(推奨)
|
|
90
|
+
|
|
91
|
+
1. `/plugin` を実行
|
|
92
|
+
2. Marketplaces タブを選択
|
|
93
|
+
3. `memoria-marketplace` を選択
|
|
94
|
+
4. "Enable auto-update" を有効化
|
|
95
|
+
|
|
96
|
+
これによりClaude Code起動時に自動でアップデートされます
|
|
97
|
+
|
|
98
|
+
## 使い方
|
|
99
|
+
|
|
100
|
+
### 自動動作
|
|
101
|
+
|
|
102
|
+
| タイミング | 動作 |
|
|
103
|
+
| ----------- | ------ |
|
|
104
|
+
| セッション開始時 | セッションJSONを初期化、関連セッションの提案 |
|
|
105
|
+
| 会話中 | 意味のある変化があった時にセッションJSONを更新 |
|
|
106
|
+
| セッション終了時 | フォールバック処理(未更新の場合)、クリーンアップ |
|
|
107
|
+
|
|
108
|
+
### コマンド
|
|
109
|
+
|
|
110
|
+
| コマンド | 説明 |
|
|
111
|
+
| --------- | ------ |
|
|
112
|
+
| `/memoria:resume [id]` | セッションを再開(ID省略で一覧表示) |
|
|
113
|
+
| `/memoria:save` | 現在のセッションを強制保存 |
|
|
114
|
+
| `/memoria:decision "タイトル"` | 技術的な判断を記録 |
|
|
115
|
+
| `/memoria:search "クエリ"` | セッション・判断記録を検索 |
|
|
116
|
+
| `/memoria:review [--staged\|--all\|--diff=branch\|--full]` | ルールに基づくレビュー(--fullで二段階) |
|
|
117
|
+
| `/memoria:report [--from YYYY-MM-DD --to YYYY-MM-DD]` | 週次レビューレポート |
|
|
118
|
+
| `/memoria:brainstorm [トピック]` | ソクラティック質問 + 記憶参照で設計 |
|
|
119
|
+
| `/memoria:plan [トピック]` | 2-5分TDDタスクに分割した計画作成 |
|
|
120
|
+
| `/memoria:tdd` | RED-GREEN-REFACTOR厳格サイクル |
|
|
121
|
+
| `/memoria:debug` | 根本原因分析 + エラーパターン参照 |
|
|
122
|
+
|
|
123
|
+
### 推奨ワークフロー
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
brainstorm → plan → tdd → review
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
1. **brainstorm**: ソクラティック質問 + 記憶参照で設計
|
|
130
|
+
2. **plan**: 2-5分TDDタスクに分割
|
|
131
|
+
3. **tdd**: RED → GREEN → REFACTOR で実装
|
|
132
|
+
4. **review**: 仕様準拠(--full)+ コード品質をレビュー
|
|
133
|
+
|
|
134
|
+
### ダッシュボード
|
|
135
|
+
|
|
136
|
+
プロジェクトディレクトリで以下を実行
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx @hir4ta/memoria --dashboard
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
ブラウザで <http://localhost:7777> を開く。
|
|
143
|
+
|
|
144
|
+
ポート変更:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx @hir4ta/memoria --dashboard --port 8080
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
#### 画面一覧
|
|
151
|
+
|
|
152
|
+
- **Sessions**: セッション一覧・詳細・編集・削除
|
|
153
|
+
- **Decisions**: 技術的な判断の一覧・作成・編集・削除
|
|
154
|
+
- **Rules**: 開発ルール・レビュー観点の閲覧・編集
|
|
155
|
+
|
|
156
|
+
## 仕組み
|
|
157
|
+
|
|
158
|
+
```mermaid
|
|
159
|
+
flowchart TB
|
|
160
|
+
subgraph realtime [リアルタイム更新]
|
|
161
|
+
A[意味のある変化] --> B[セッションJSONを更新]
|
|
162
|
+
B --> C[interactions配列]
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
subgraph manual [手動操作]
|
|
166
|
+
D["memoria:save"] --> E[セッションを強制保存]
|
|
167
|
+
F["memoria:decision"] --> G[判断を明示的に記録]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
subgraph resume [セッション再開]
|
|
171
|
+
H["memoria:resume"] --> I[一覧から選択]
|
|
172
|
+
I --> J[過去の文脈を復元]
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
subgraph search [検索]
|
|
176
|
+
K["memoria:search"] --> L[セッションと判断を検索]
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
subgraph review [レビュー]
|
|
180
|
+
P["memoria:review"] --> Q[ルールに基づく指摘]
|
|
181
|
+
Q --> R[レビュー結果を保存]
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
subgraph report [週次レポート]
|
|
185
|
+
S["memoria:report"] --> T[レビュー集計レポート]
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
subgraph dashboard [ダッシュボード]
|
|
189
|
+
M["npx @hir4ta/memoria -d"] --> N[ブラウザで表示]
|
|
190
|
+
N --> O[閲覧・編集・削除]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
B --> H
|
|
194
|
+
E --> H
|
|
195
|
+
G --> K
|
|
196
|
+
B --> R
|
|
197
|
+
R --> T
|
|
198
|
+
B --> M
|
|
199
|
+
G --> M
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## データ保存
|
|
203
|
+
|
|
204
|
+
すべてのデータは `.memoria/` ディレクトリにJSON形式で保存
|
|
205
|
+
|
|
206
|
+
```text
|
|
207
|
+
.memoria/
|
|
208
|
+
├── tags.json # タグマスターファイル(93タグ、表記揺れ防止)
|
|
209
|
+
├── sessions/ # セッション履歴 (YYYY/MM)
|
|
210
|
+
├── decisions/ # 技術的な判断 (YYYY/MM)
|
|
211
|
+
├── rules/ # 開発ルール / レビュー観点
|
|
212
|
+
├── reviews/ # レビュー結果 (YYYY/MM)
|
|
213
|
+
└── reports/ # 週次レポート (YYYY-MM)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Gitでバージョン管理可能です。`.gitignore` に追加するかはプロジェクトに応じて判断してください。
|
|
217
|
+
|
|
218
|
+
### セッションJSONスキーマ
|
|
219
|
+
|
|
220
|
+
セッションは **interactions ベース** のスキーマを使用します。各 interaction は決定サイクル(リクエスト → 思考 → 提案 → 選択 → 実装)を表します。
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"id": "2026-01-27_abc123",
|
|
225
|
+
"sessionId": "claude-code-からの-full-uuid",
|
|
226
|
+
"createdAt": "2026-01-27T10:00:00Z",
|
|
227
|
+
"context": {
|
|
228
|
+
"branch": "feature/auth",
|
|
229
|
+
"projectDir": "/path/to/project",
|
|
230
|
+
"user": { "name": "tanaka", "email": "tanaka@example.com" }
|
|
231
|
+
},
|
|
232
|
+
"title": "JWT認証機能の実装",
|
|
233
|
+
"goal": "JWTベースの認証機能を実装し、リフレッシュトークンにも対応する",
|
|
234
|
+
"tags": ["auth", "jwt", "backend"],
|
|
235
|
+
"interactions": [
|
|
236
|
+
{
|
|
237
|
+
"id": "int-001",
|
|
238
|
+
"topic": "認証方式の選択",
|
|
239
|
+
"timestamp": "2026-01-27T10:15:00Z",
|
|
240
|
+
"request": "認証機能を実装したい",
|
|
241
|
+
"thinking": "JWTとセッションCookieを比較...",
|
|
242
|
+
"webLinks": ["https://jwt.io/introduction"],
|
|
243
|
+
"proposals": [
|
|
244
|
+
{ "option": "JWT", "description": "ステートレス、スケーラブル" },
|
|
245
|
+
{ "option": "セッションCookie", "description": "シンプル" }
|
|
246
|
+
],
|
|
247
|
+
"choice": "JWT",
|
|
248
|
+
"reasoning": "マイクロサービス間の認証共有が容易",
|
|
249
|
+
"actions": [
|
|
250
|
+
{ "type": "create", "path": "src/auth/jwt.ts", "summary": "JWTモジュール" }
|
|
251
|
+
],
|
|
252
|
+
"filesModified": ["src/auth/jwt.ts"]
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 更新トリガー
|
|
259
|
+
|
|
260
|
+
Claude Code は意味のある変化があった時にセッションJSONを更新します:
|
|
261
|
+
|
|
262
|
+
| トリガー | 更新内容 |
|
|
263
|
+
|---------|---------|
|
|
264
|
+
| セッションの目的が明確になった | `title`, `goal` |
|
|
265
|
+
| ユーザーの指示に対応した | `interactions` に追加 |
|
|
266
|
+
| 技術的決定を下した | `proposals`, `choice`, `reasoning` |
|
|
267
|
+
| エラーに遭遇・解決した | `problem`, `choice`, `reasoning` |
|
|
268
|
+
| ファイルを変更した | `actions`, `filesModified` |
|
|
269
|
+
| URLを参照した | `webLinks` |
|
|
270
|
+
| 新しいキーワードが出現 | `tags`(tags.jsonを参照) |
|
|
271
|
+
|
|
272
|
+
### タグ
|
|
273
|
+
|
|
274
|
+
タグは `.memoria/tags.json` から選択され、表記揺れを防止します(例: 「フロント」→「frontend」)。マスターファイルには11カテゴリ93タグが含まれています:
|
|
275
|
+
|
|
276
|
+
- **domain**: frontend, backend, api, db, infra, mobile, cli
|
|
277
|
+
- **phase**: feature, bugfix, refactor, test, docs
|
|
278
|
+
- **ai**: llm, ai-agent, mcp, rag, vector-db, embedding
|
|
279
|
+
- **cloud**: serverless, microservices, edge, wasm
|
|
280
|
+
- その他...
|
|
281
|
+
|
|
282
|
+
## ライセンス
|
|
283
|
+
|
|
284
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
1
|
# memoria
|
|
2
2
|
|
|
3
|
-
Claude Code
|
|
3
|
+
Long-term memory plugin for Claude Code
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Provides automatic session saving, technical decision recording, and web dashboard management.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Features
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- **
|
|
9
|
+
### Core Features
|
|
10
|
+
- **Real-time Session Updates**: Session JSON is updated when meaningful changes occur
|
|
11
|
+
- **Session Resume**: Resume past sessions with `/memoria:resume`
|
|
12
|
+
- **Technical Decision Recording**: Record decisions with `/memoria:decision`
|
|
13
|
+
- **Rule-based Review**: Code review based on `dev-rules.json` / `review-guidelines.json`
|
|
14
|
+
- **Weekly Reports**: Auto-generate Markdown reports aggregating review results
|
|
15
|
+
- **Web Dashboard**: View and edit sessions, decisions, and rules
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
### Development Workflow (superpowers-style)
|
|
18
|
+
- **Brainstorming**: Socratic questioning + past memory lookup (`/memoria:brainstorm`)
|
|
19
|
+
- **Planning**: 2-5 minute task breakdown with TDD enforcement (`/memoria:plan`)
|
|
20
|
+
- **TDD**: Strict RED-GREEN-REFACTOR cycle (`/memoria:tdd`)
|
|
21
|
+
- **Debugging**: Systematic root cause analysis + error pattern lookup (`/memoria:debug`)
|
|
22
|
+
- **Two-stage Review**: Spec compliance + code quality (`/memoria:review --full`)
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
## Problems Solved
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
- **判断の不透明化**: 「なぜこの設計にしたのか」が後から追えない
|
|
22
|
-
- **知見の再利用が難しい**: 過去のやり取りや決定を検索・参照しづらい
|
|
26
|
+
### Common Issues in Claude Code Development
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
- **Context Loss**: Conversation context is lost on session end or Auto-Compact
|
|
29
|
+
- **Opaque Decisions**: "Why did we choose this design?" becomes untraceable
|
|
30
|
+
- **Hard to Reuse Knowledge**: Past interactions and decisions are hard to search and reference
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
- **判断記録(自動/手動)**で、理由・代替案を後から追跡
|
|
28
|
-
- **検索とダッシュボード**で、過去の記録を素早く参照
|
|
29
|
-
- **レビュー機能**で、リポジトリ固有の観点に基づいて指摘
|
|
30
|
-
- **週次レポート**で、レビュー観点の改善と共有が容易
|
|
32
|
+
### What memoria Enables
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
- **Auto-save + Resume** enables context continuity across sessions
|
|
35
|
+
- **Decision Recording** tracks reasoning and alternatives for later review
|
|
36
|
+
- **Search and Dashboard** for quick access to past records
|
|
37
|
+
- **Review Feature** for repository-specific code review
|
|
38
|
+
- **Weekly Reports** for improving and sharing review practices
|
|
33
39
|
|
|
34
|
-
|
|
35
|
-
- オンボーディングやレビュー時に「背景・経緯」を短時間で把握できる
|
|
40
|
+
### Team Benefits
|
|
36
41
|
|
|
37
|
-
|
|
42
|
+
- `.memoria/` JSON files are **Git-manageable**, enabling team sharing of decisions and session history
|
|
43
|
+
- Quickly understand background and context during onboarding or reviews
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
## Installation
|
|
40
46
|
|
|
41
|
-
|
|
47
|
+
### Prerequisites
|
|
48
|
+
|
|
49
|
+
- **jq**: Used for JSON processing in hooks
|
|
42
50
|
|
|
43
51
|
```bash
|
|
44
52
|
# macOS
|
|
@@ -57,141 +65,220 @@ scoop install jq
|
|
|
57
65
|
winget install jqlang.jq
|
|
58
66
|
```
|
|
59
67
|
|
|
60
|
-
###
|
|
68
|
+
### Plugin Installation
|
|
61
69
|
|
|
62
|
-
Claude Code
|
|
70
|
+
Run the following in Claude Code:
|
|
63
71
|
|
|
64
72
|
```bash
|
|
65
73
|
/plugin marketplace add hir4ta/memoria-marketplace
|
|
66
74
|
/plugin install memoria@memoria-marketplace
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
Claude Code
|
|
77
|
+
Restart Claude Code to complete installation.
|
|
70
78
|
|
|
71
|
-
##
|
|
79
|
+
## Update
|
|
72
80
|
|
|
73
|
-
Claude Code
|
|
81
|
+
Run the following in Claude Code:
|
|
74
82
|
|
|
75
83
|
```bash
|
|
76
84
|
/plugin marketplace update memoria-marketplace
|
|
77
85
|
```
|
|
78
86
|
|
|
79
|
-
Claude Code
|
|
87
|
+
Restart Claude Code.
|
|
88
|
+
|
|
89
|
+
### Enable Auto-Update (Recommended)
|
|
80
90
|
|
|
81
|
-
|
|
91
|
+
1. Run `/plugin`
|
|
92
|
+
2. Select Marketplaces tab
|
|
93
|
+
3. Select `memoria-marketplace`
|
|
94
|
+
4. Enable "Enable auto-update"
|
|
82
95
|
|
|
83
|
-
|
|
84
|
-
2. Marketplaces タブを選択
|
|
85
|
-
3. `memoria-marketplace` を選択
|
|
86
|
-
4. "Enable auto-update" を有効化
|
|
96
|
+
This will auto-update on Claude Code startup.
|
|
87
97
|
|
|
88
|
-
|
|
98
|
+
## Usage
|
|
89
99
|
|
|
90
|
-
|
|
100
|
+
### Automatic Behavior
|
|
91
101
|
|
|
92
|
-
|
|
102
|
+
| Timing | Action |
|
|
103
|
+
|--------|--------|
|
|
104
|
+
| Session Start | Suggest related sessions, initialize session JSON |
|
|
105
|
+
| During Session | Claude Code updates session JSON on meaningful changes |
|
|
106
|
+
| Session End | Fallback processing if not updated, cleanup |
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
| ----------- | ------ |
|
|
96
|
-
| セッション開始時 | 関連セッションの提案 |
|
|
97
|
-
| セッション終了時 | 会話履歴を保存、技術的な判断を自動検出 |
|
|
98
|
-
| 圧縮前 | 進行中のセッションを保存 |
|
|
108
|
+
### Commands
|
|
99
109
|
|
|
100
|
-
|
|
110
|
+
| Command | Description |
|
|
111
|
+
|---------|-------------|
|
|
112
|
+
| `/memoria:resume [id]` | Resume session (show list if ID omitted) |
|
|
113
|
+
| `/memoria:save` | Force flush current session |
|
|
114
|
+
| `/memoria:decision "title"` | Record a technical decision |
|
|
115
|
+
| `/memoria:search "query"` | Search sessions and decisions |
|
|
116
|
+
| `/memoria:review [--staged\|--all\|--diff=branch\|--full]` | Rule-based code review (--full for two-stage) |
|
|
117
|
+
| `/memoria:report [--from YYYY-MM-DD --to YYYY-MM-DD]` | Weekly review report |
|
|
118
|
+
| `/memoria:brainstorm [topic]` | Design-first Socratic questioning + memory lookup |
|
|
119
|
+
| `/memoria:plan [topic]` | Create implementation plan with 2-5 min TDD tasks |
|
|
120
|
+
| `/memoria:tdd` | Strict RED-GREEN-REFACTOR development cycle |
|
|
121
|
+
| `/memoria:debug` | Systematic debugging with error pattern lookup |
|
|
101
122
|
|
|
102
|
-
|
|
103
|
-
| --------- | ------ |
|
|
104
|
-
| `/memoria:resume [id]` | セッションを再開(ID省略で一覧表示) |
|
|
105
|
-
| `/memoria:save` | 現在のセッションを手動保存 |
|
|
106
|
-
| `/memoria:decision "タイトル"` | 技術的な判断を記録 |
|
|
107
|
-
| `/memoria:search "クエリ"` | セッション・判断記録を検索 |
|
|
108
|
-
| `/memoria:review [--staged|--all|--diff=branch]` | ルールに基づくレビュー |
|
|
109
|
-
| `/memoria:report [--from YYYY-MM-DD --to YYYY-MM-DD]` | 週次レビューレポート |
|
|
123
|
+
### Recommended Workflow
|
|
110
124
|
|
|
111
|
-
|
|
125
|
+
```
|
|
126
|
+
brainstorm → plan → tdd → review
|
|
127
|
+
```
|
|
112
128
|
|
|
113
|
-
|
|
129
|
+
1. **brainstorm**: Design with Socratic questions + past memory lookup
|
|
130
|
+
2. **plan**: Break into 2-5 minute TDD tasks
|
|
131
|
+
3. **tdd**: Implement with RED → GREEN → REFACTOR
|
|
132
|
+
4. **review**: Verify against plan (--full) and code quality
|
|
133
|
+
|
|
134
|
+
### Dashboard
|
|
135
|
+
|
|
136
|
+
Run in your project directory:
|
|
114
137
|
|
|
115
138
|
```bash
|
|
116
139
|
npx @hir4ta/memoria --dashboard
|
|
117
140
|
```
|
|
118
141
|
|
|
119
|
-
|
|
142
|
+
Open <http://localhost:7777> in your browser.
|
|
120
143
|
|
|
121
|
-
|
|
144
|
+
Change port:
|
|
122
145
|
|
|
123
146
|
```bash
|
|
124
147
|
npx @hir4ta/memoria --dashboard --port 8080
|
|
125
148
|
```
|
|
126
149
|
|
|
127
|
-
####
|
|
150
|
+
#### Screens
|
|
128
151
|
|
|
129
|
-
- **Sessions**:
|
|
130
|
-
- **Decisions**:
|
|
131
|
-
- **Rules**:
|
|
152
|
+
- **Sessions**: List, view, edit, delete sessions
|
|
153
|
+
- **Decisions**: List, create, edit, delete technical decisions
|
|
154
|
+
- **Rules**: View and edit dev rules and review guidelines
|
|
132
155
|
|
|
133
|
-
##
|
|
156
|
+
## How It Works
|
|
134
157
|
|
|
135
158
|
```mermaid
|
|
136
159
|
flowchart TB
|
|
137
|
-
subgraph
|
|
138
|
-
A[
|
|
139
|
-
|
|
160
|
+
subgraph realtime [Real-time Updates]
|
|
161
|
+
A[Meaningful Change] --> B[Update Session JSON]
|
|
162
|
+
B --> C[interactions array]
|
|
140
163
|
end
|
|
141
164
|
|
|
142
|
-
subgraph manual [
|
|
143
|
-
D["memoria:save"] --> E[
|
|
144
|
-
F["memoria:decision"] --> G[
|
|
165
|
+
subgraph manual [Manual Actions]
|
|
166
|
+
D["memoria:save"] --> E[Force flush session]
|
|
167
|
+
F["memoria:decision"] --> G[Record decision explicitly]
|
|
145
168
|
end
|
|
146
169
|
|
|
147
|
-
subgraph resume [
|
|
148
|
-
H["memoria:resume"] --> I[
|
|
149
|
-
I --> J[
|
|
170
|
+
subgraph resume [Session Resume]
|
|
171
|
+
H["memoria:resume"] --> I[Select from list]
|
|
172
|
+
I --> J[Restore past context]
|
|
150
173
|
end
|
|
151
174
|
|
|
152
|
-
subgraph search [
|
|
153
|
-
K["memoria:search"] --> L[
|
|
175
|
+
subgraph search [Search]
|
|
176
|
+
K["memoria:search"] --> L[Search sessions and decisions]
|
|
154
177
|
end
|
|
155
178
|
|
|
156
|
-
subgraph review [
|
|
157
|
-
P["memoria:review"] --> Q[
|
|
158
|
-
Q --> R[
|
|
179
|
+
subgraph review [Review]
|
|
180
|
+
P["memoria:review"] --> Q[Rule-based findings]
|
|
181
|
+
Q --> R[Save review results]
|
|
159
182
|
end
|
|
160
183
|
|
|
161
|
-
subgraph report [
|
|
162
|
-
S["memoria:report"] --> T[
|
|
184
|
+
subgraph report [Weekly Report]
|
|
185
|
+
S["memoria:report"] --> T[Review summary report]
|
|
163
186
|
end
|
|
164
187
|
|
|
165
|
-
subgraph dashboard [
|
|
166
|
-
M["npx @hir4ta/memoria -d"] --> N[
|
|
167
|
-
N --> O[
|
|
188
|
+
subgraph dashboard [Dashboard]
|
|
189
|
+
M["npx @hir4ta/memoria -d"] --> N[Open in browser]
|
|
190
|
+
N --> O[View, edit, delete]
|
|
168
191
|
end
|
|
169
192
|
|
|
170
193
|
B --> H
|
|
171
194
|
E --> H
|
|
172
|
-
C --> K
|
|
173
195
|
G --> K
|
|
174
196
|
B --> R
|
|
175
197
|
R --> T
|
|
176
198
|
B --> M
|
|
177
|
-
|
|
199
|
+
G --> M
|
|
178
200
|
```
|
|
179
201
|
|
|
180
|
-
##
|
|
202
|
+
## Data Storage
|
|
181
203
|
|
|
182
|
-
|
|
204
|
+
All data is stored in `.memoria/` directory as JSON:
|
|
183
205
|
|
|
184
206
|
```text
|
|
185
207
|
.memoria/
|
|
186
|
-
├──
|
|
187
|
-
├──
|
|
188
|
-
├──
|
|
189
|
-
├──
|
|
190
|
-
|
|
208
|
+
├── tags.json # Tag master file (93 tags, prevents notation variations)
|
|
209
|
+
├── sessions/ # Session history (YYYY/MM)
|
|
210
|
+
├── decisions/ # Technical decisions (YYYY/MM)
|
|
211
|
+
├── rules/ # Dev rules / review guidelines
|
|
212
|
+
├── reviews/ # Review results (YYYY/MM)
|
|
213
|
+
└── reports/ # Weekly reports (YYYY-MM)
|
|
191
214
|
```
|
|
192
215
|
|
|
193
|
-
Git
|
|
216
|
+
Git-manageable. Add to `.gitignore` based on your project needs.
|
|
217
|
+
|
|
218
|
+
### Session JSON Schema
|
|
219
|
+
|
|
220
|
+
Sessions use an **interactions-based** schema. Each interaction represents a decision cycle (request → thinking → proposals → choice → implementation).
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"id": "2026-01-27_abc123",
|
|
225
|
+
"sessionId": "full-uuid-from-claude-code",
|
|
226
|
+
"createdAt": "2026-01-27T10:00:00Z",
|
|
227
|
+
"context": {
|
|
228
|
+
"branch": "feature/auth",
|
|
229
|
+
"projectDir": "/path/to/project",
|
|
230
|
+
"user": { "name": "tanaka", "email": "tanaka@example.com" }
|
|
231
|
+
},
|
|
232
|
+
"title": "JWT authentication implementation",
|
|
233
|
+
"goal": "Implement JWT-based auth with refresh token support",
|
|
234
|
+
"tags": ["auth", "jwt", "backend"],
|
|
235
|
+
"interactions": [
|
|
236
|
+
{
|
|
237
|
+
"id": "int-001",
|
|
238
|
+
"topic": "Auth method selection",
|
|
239
|
+
"timestamp": "2026-01-27T10:15:00Z",
|
|
240
|
+
"request": "Implement authentication",
|
|
241
|
+
"thinking": "Comparing JWT vs session cookies...",
|
|
242
|
+
"webLinks": ["https://jwt.io/introduction"],
|
|
243
|
+
"proposals": [
|
|
244
|
+
{ "option": "JWT", "description": "Stateless, scalable" },
|
|
245
|
+
{ "option": "Session Cookie", "description": "Simple" }
|
|
246
|
+
],
|
|
247
|
+
"choice": "JWT",
|
|
248
|
+
"reasoning": "Easy auth sharing between microservices",
|
|
249
|
+
"actions": [
|
|
250
|
+
{ "type": "create", "path": "src/auth/jwt.ts", "summary": "JWT module" }
|
|
251
|
+
],
|
|
252
|
+
"filesModified": ["src/auth/jwt.ts"]
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Update Triggers
|
|
259
|
+
|
|
260
|
+
Claude Code updates session JSON when meaningful changes occur:
|
|
261
|
+
|
|
262
|
+
| Trigger | Update |
|
|
263
|
+
|---------|--------|
|
|
264
|
+
| Session purpose becomes clear | `title`, `goal` |
|
|
265
|
+
| User instruction handled | Add to `interactions` |
|
|
266
|
+
| Technical decision made | `proposals`, `choice`, `reasoning` |
|
|
267
|
+
| Error encountered/resolved | `problem`, `choice`, `reasoning` |
|
|
268
|
+
| File modified | `actions`, `filesModified` |
|
|
269
|
+
| URL referenced | `webLinks` |
|
|
270
|
+
| New keyword appears | `tags` (reference tags.json) |
|
|
271
|
+
|
|
272
|
+
### Tags
|
|
273
|
+
|
|
274
|
+
Tags are selected from `.memoria/tags.json` to prevent notation variations (e.g., "フロント" → "frontend"). The master file contains 93 tags across 11 categories:
|
|
275
|
+
|
|
276
|
+
- **domain**: frontend, backend, api, db, infra, mobile, cli
|
|
277
|
+
- **phase**: feature, bugfix, refactor, test, docs
|
|
278
|
+
- **ai**: llm, ai-agent, mcp, rag, vector-db, embedding
|
|
279
|
+
- **cloud**: serverless, microservices, edge, wasm
|
|
280
|
+
- And more...
|
|
194
281
|
|
|
195
|
-
##
|
|
282
|
+
## License
|
|
196
283
|
|
|
197
284
|
MIT
|