Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
084dc8c
docs: /diary-notion 설계 — 연도별 페이지 + 단일 DB + 작업 단위 분리
solzip May 26, 2026
b64c300
docs: Branch 컬럼 추가 + 'branch 경계 = task 경계' 분리 룰 보완
solzip May 26, 2026
f4d1138
feat: Notion hierarchical exporter + ID cache (Phase 1)
solzip May 26, 2026
9c07222
feat: notion-push CLI + Notion blocks formatter (Phase 2)
solzip May 26, 2026
90e4f22
feat: notion init 대화형 셋업 명령 (Phase 3)
solzip May 26, 2026
38c6139
feat: /diary-notion 슬래시 커맨드 install 통합 (Phase 4)
solzip May 26, 2026
b48b6ea
docs: README + CHANGELOG에 /diary-notion 5분 셋업 가이드 추가 (Phase 5)
solzip May 26, 2026
120e019
docs: Status / Task Group / Depends On 컬럼 결정 추가 (Phase 6a)
solzip May 27, 2026
01737ae
feat: Notion DB 스키마에 Status/Task Group + self-relation Depends On 추가 …
solzip May 27, 2026
e13971a
feat: 2-pass push (status/task_group/depends_on) + 슬래시 instructions 갱…
solzip May 27, 2026
e70cb96
fix: 기존 DB에도 Status/Task Group/Depends On 자동 추가 (Phase 6c hotfix)
solzip May 27, 2026
b1cba8f
chore: .gitignore에 .diary-notion-*.json 추가 + 잘못 들어간 임시 파일 제거
solzip May 27, 2026
a1e6cb4
feat: add codex notion task hierarchy
solzip Jun 1, 2026
9e6d0fb
docs: add working diary os vision
solzip Jun 1, 2026
0fea9d8
docs: add notion core views design
solzip Jun 2, 2026
7f384c2
docs: clarify notion subtasks fallback
solzip Jun 2, 2026
4252a97
docs: refine notion ensure design
solzip Jun 2, 2026
e028c06
docs: define notion ensure cli scope
solzip Jun 2, 2026
c38d9f9
feat: add diary notion core view ensure
solzip Jun 2, 2026
371d4cf
fix: fallback diary notion project to cwd
solzip Jun 2, 2026
5c0e228
docs: align readme with diary notion phase 2
solzip Jun 2, 2026
15310d5
feat: compact diary notion page body
solzip Jun 2, 2026
42f6c1f
feat: add diary notion operating model
solzip Jun 2, 2026
e881628
docs: reflect current diary-notion implementation in readme
solzip Jun 2, 2026
475bfb5
fix: guard against self-referential parent task in notion push
solzip Jun 2, 2026
5a1a79b
fix: decode git subprocess output as utf-8
solzip Jun 2, 2026
a34582f
feat: re-sync stale parent/sub-item links during ensure
solzip Jun 2, 2026
b0cd4b3
feat: wire task hierarchy into Notion's native sub-item relation
solzip Jun 4, 2026
7d8d9b3
docs: document native sub-item enablement and detection
solzip Jun 4, 2026
cf8e514
docs: add diary-notion troubleshooting guide to readme
solzip Jun 4, 2026
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
36 changes: 36 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "working-diary",
"version": "4.2.0",
"description": "Record AI coding sessions as Markdown diaries or task-based Notion entries.",
"author": {
"name": "solzip",
"url": "https://github.com/solzip"
},
"homepage": "https://github.com/solzip/claude-code-hooks-diary",
"repository": "https://github.com/solzip/claude-code-hooks-diary",
"license": "MIT",
"keywords": [
"diary",
"productivity",
"work-log",
"notion",
"codex",
"claude-code"
],
"skills": "./skills/",
"interface": {
"displayName": "Working Diary",
"shortDescription": "Record Codex work sessions to Markdown or Notion.",
"longDescription": "Working Diary adds Codex skills for writing manual Markdown diary entries and pushing task-sized session records to a hierarchical Notion database. It keeps project, purpose, task group, branch, status, categories, files, commands, commits, and dependencies available as filterable Notion columns.",
"developerName": "solzip",
"category": "Productivity",
"capabilities": [
"Interactive",
"Write"
],
"defaultPrompt": [
"Use $diary to record this session.",
"Use $diary-notion to push this session to Notion."
]
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ Thumbs.db

# Original archive (source already extracted)
claude-code-working-diary.tar.gz

# /diary-notion 임시 JSON (Claude가 cwd에 작성 → CLI가 자동 삭제 / 부분 실패 시 보존)
.diary-notion-*.json
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added
- **`/diary-notion` 슬래시 커맨드**: 현재 세션을 작업 단위로 분리해 Notion 업무일지 DB에 push
- 계층 구조: 루트 페이지 → 연도 페이지 → 단일 Entries DB (자동 생성)
- 작업 분리: branch 경계 → 의미 단위 (semantic-first)
- LLM은 슬래시 커맨드 안의 Claude가 처리 — 별도 Anthropic API 키 불필요
- 멱등성: Session ID + Task Index 컬럼으로 skip, `--force` 시 archive&recreate
- 에러 분기: 401/403 fail fast, 400 skip, 429/5xx retry, 404 자동 재생성
- **`claude-diary diary-notion init`**: 대화형 셋업 (token + 페이지 URL/ID + 권한 검증)
- **`claude-diary diary-notion push --input <file>` `--force`**: 임시 JSON 파일 받아 Notion에 push
- **Codex 표준 지원**: `$diary`, `$diary-notion` skills + `.codex-plugin/plugin.json`
- **중립 CLI alias**: `working-diary` 명령을 `claude-diary`와 동일하게 제공
- **DB 자동 생성 스키마**: Name, Date, Work Period, Project, Purpose, Branch, Status, Task Group, Parent Task, Sub-items, Depends On, Priority, Next Action, Blocked, Block Reason, Carryover, Review Status, Last Reviewed, Categories, Files, Commits, Lines, Session ID, Task Index
- **Notion native 하위항목 연결**: push가 부모-자식을 Notion **native sub-item 관계**(UI에서 1회 활성화, locale 이름 예 `상위 항목`/`하위 항목`)에 기록해 실제 접기/펼치기 nesting을 구동. 코드가 native 관계를 이름 하드코딩 없이 자동 탐지(소거법 + locale 토큰). `ensure`가 `작업 계층` view를 native 관계로 연결하고 기존 `Parent Task` 데이터를 native로 이전(멱등). native 미활성 시 작업 기록은 진행하고 활성화 안내 출력. 기존 영문 `Parent Task`/`Sub-items` 관계는 legacy로 유지·숨김, `Depends On`은 선행 관계로 유지
- **접힌 근거 중심 Notion 본문**: page body를 핵심 callout 1개, 결과 체크리스트, 작업 한눈에 표, 영향 bullet, 검증 checklist, 리스크/다음 액션, 접힌 부록 구조로 압축
- **Working Diary OS 비전 문서**: Structure → Views → Operations → Intelligence → Multi-project OS로 확장하는 최고모델 설계, 최소 명령 원칙, 전날 todo 기반 `today-plan`, schema/view conflict drift 관리 방향 추가
- **2차 View 설계 문서**: `working-diary diary-notion ensure`, `--year`, `--dry-run`과 Core Views 5개, operating views 5개, `Work Period`와 `Sub-items` 기반 schema v7 방향, 하위 항목 데이터 구조, sub-item UI best-effort/fallback, partial failure/exit code 정책 정리
- **`working-diary diary-notion ensure` 구현**: schema v7 `Work Period`, native sub-item relation, Priority/Blocked/Review 운영 컬럼 보장, Core Views 5개와 Operating Views 5개 생성/검증/update, `--year`, `--dry-run`, required setting repair 지원
- **`claude-diary write --input <file>`**: Codex skill이 생성한 JSON으로 수동 Markdown 일지 작성
- **`lib/notion_cache.py`**: 연도 페이지/DB/행 ID 캐시 (root_page_id 변경 시 자동 무효화)
- **`lib/git_info.py` 확장**: `get_branch_for_commit`, `get_head_branch`, `get_commit_info`, `get_diff_stat_for_commits`
- **테스트 보강**: Notion Purpose, Codex plugin/skills, Codex JSON input 경로 검증 (전체 583 통과)

### Changed
- `cli/setup.py` 일반화: `SLASH_COMMANDS` dict로 다중 슬래시 커맨드 관리
- `formatter.py`: Notion API blocks 빌더 (`build_notion_blocks`) 추가 및 compact executive body 렌더링 보강
- 설계 문서: [`docs/02-design/features/diary-notion-hierarchical.design.md`](docs/02-design/features/diary-notion-hierarchical.design.md)

## [4.1.0] - 2026-03-17 (Phase D)

### Added
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ include CHANGELOG.md
include SECURITY.md
include README.md
include README.en.md
recursive-include .codex-plugin *.json
recursive-include skills *.md *.yaml
29 changes: 29 additions & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,37 @@ For when you want to record an entry mid-session without waiting for the Stop Ho

**Usage:**
- Inside a Claude Code session: type `/diary` — reads the current cwd's transcript and writes the entry
- Inside a Codex session: type `$diary` — writes the current conversation/tool context through the same manual diary path
- Or from the terminal: `claude-diary write`

`claude-diary install` installs `~/.claude/commands/diary.md` so `/diary` works in every project. Re-run it once if you installed before this feature shipped (it's idempotent). `claude-diary uninstall` removes it (preserves user-modified files).
Codex skills can be installed from the Codex plugin in this repo or with `claude-diary install --codex`.

## Notion Work Diary — `/diary-notion` / `$diary-notion`

Push the current session to a hierarchical Notion database as task-sized rows. Use `/diary-notion` in Claude Code and `$diary-notion` in Codex.

```
[Notion root page: "Working Diary"]
└── 2026 (auto-created)
└── Entries (inline DB, auto-created)
├── "Decide Notion DB schema" | Project: claude-diary | Purpose: Planning
├── "Refactor git_info.py" | Project: claude-diary | Purpose: Refactor
└── ...
```

Rows include filterable/groupable/relational/operating columns for `Project`, `Purpose`, `Task Group`, `Parent Task`, `Sub-items`, `Depends On`, `Branch`, `Status`, `Work Period`, `Priority`, `Blocked`, `Next Action`, `Review Status`, and `Categories`. `Project` is the command cwd folder name; if a task JSON omits it or writes `unknown`, the CLI falls back to the cwd folder. Run `working-diary diary-notion ensure` to create or verify schema v7, native sub-items, 5 core views, and 5 operating views.
Hierarchy nests through Notion's **native sub-item relation**, which can only be enabled in the Notion UI (locale-named, e.g. `Parent item`/`Sub-item` or `상위 항목`/`하위 항목`): open the year's `Entries` DB → ⋯ menu → Sub-items, once. push then writes each child's parent link into that native relation (auto-detected without hardcoded names), `ensure` points the 작업 계층 view at it and migrates legacy `Parent Task` links over. Until it is enabled, rows are still recorded and push prints a hint; the legacy `Parent Task`/`Sub-items` relation never drove native nesting and is kept hidden. `Depends On` is limited to prerequisite links between large top-level tasks. Do not connect subtasks with dependency relations. `working-diary diary-notion ensure` repairs required core/operating view settings, while `--dry-run` reports update plans without writing. Operating views cover today priority, previous unfinished work, blocked work, review-needed work, and task groups. Each Notion page body stays compact with one top summary callout, checked result items, a work-at-a-glance table, impact bullets, checked verification items, risks/next actions, and appendix toggles. Developer evidence such as code changes, files, commands, Git, and original prompts is hidden in the appendix. Code changes are high-signal summaries, not full diffs; include only behavior, schema, CLI, user workflow, or verification-scope changes.
Titles and narrative body content are written in Korean. File paths, commands, branches, commit hashes, code identifiers, and `Purpose`/`Status` enum values remain literal or English.

```bash
claude-diary diary-notion init
working-diary diary-notion ensure
/diary-notion # Claude Code
$diary-notion # Codex
```

Purpose values use stable English labels: `Feature`, `Bugfix`, `Refactor`, `Docs`, `Test`, `Infra`, `Planning`, `Research`, `Review`, `Release`, `Support`, `Maintenance`, `General`.

## Diary Example

Expand Down Expand Up @@ -177,6 +205,7 @@ export CLAUDE_DIARY_TZ_OFFSET="-5" # EST (UTC-5)

```bash
claude-diary write # Write current session diary on demand (also via `/diary` slash command)
working-diary write # Neutral alias for the same CLI
claude-diary search "keyword" # Keyword search
claude-diary filter --project my-app # Filter by project
claude-diary trace src/main.py # File change history
Expand Down
Loading
Loading