Files
our-claude-skills/custom-skills/31-notion-organizer/desktop/examples/examples.md
Andrew Yim b69e4b6f3a refactor: Reorganize skill numbering and update documentation
Skill Numbering Changes:
- 01-03: OurDigital core (was 30-32)
- 31-32: Notion tools (was 01-02)
- 99_archive: Renamed from _archive for sorting

New Files:
- AGENTS.md: Claude Code agent routing guide
- requirements.txt for 00-claude-code-setting, 32-notion-writer, 43-jamie-youtube-manager

Documentation Updates:
- CLAUDE.md: Updated skill inventory (23 skills)
- AUDIT_REPORT.md: Current completion status (91%)
- Archived REFACTORING_PLAN.md (most tasks complete)

Removed:
- ga-agent-skills/ (moved to separate repo ~/Project/dintel-ga4-agent)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 18:42:39 +07:00

5.9 KiB

Notion Organizer Examples

Quick Reference: Common Tasks

1. Database Audit

Request:

Audit my "Client Projects" database and recommend optimizations

Expected Actions:

  1. Fetch database schema using MCP
  2. Analyze properties: types, naming, usage
  3. Report findings in Korean
  4. Recommend specific improvements

Sample Output:

## Database Audit: Client Projects

### 현재 구조 (Current Structure)
- Properties: 15개
- 페이지 수: 234개

### 발견된 문제점 (Issues Found)

1. **중복 속성**: "담당자"와 "Assignee" 동일한 용도
2. **미사용 속성**: "Legacy ID" - 모든 값이 비어있음
3. **명명 불일치**: "due_date" vs "Due Date" vs "마감일"

### 권장 조치 (Recommendations)

1. "담당자"와 "Assignee" 통합 → "담당자"로 유지
2. "Legacy ID" 속성 삭제
3. 명명 규칙 통일: Title Case 권장

2. Bulk Status Update

Request:

Change all pages with status "Pending Review" to "In Review"
in the Tasks database

Tier 1 Approach (MCP):

# Claude uses MCP tools:
1. mcp__notion__query-database with filter:
   {"property": "Status", "select": {"equals": "Pending Review"}}

2. For each page, mcp__notion__update-page:
   {"Status": {"select": {"name": "In Review"}}}

Tier 3 Approach (Python - for 50+ pages):

python scripts/async_organizer.py \
    --database-id abc123 \
    --operation status-update \
    --old-status "Pending Review" \
    --new-status "In Review" \
    --dry-run  # Test first!

3. Schema Migration

Request:

Migrate data from "Old Projects" to "New Projects" database.
Map Status→Stage, Due Date→Deadline, Tags→Categories

Step 1: Generate Mapping Template

python scripts/schema_migrator.py \
    --source-db old_projects_id \
    --target-db new_projects_id \
    --generate-mapping \
    --output my_mapping.json

Step 2: Customize Mapping Edit my_mapping.json:

{
  "Status": {
    "target": "Stage",
    "value_mapping": {
      "Todo": "Backlog",
      "Doing": "In Progress",
      "Done": "Complete"
    }
  }
}

Step 3: Execute Migration

# Dry run first
python scripts/schema_migrator.py \
    --source-db old_projects_id \
    --target-db new_projects_id \
    --mapping my_mapping.json \
    --dry-run

# Execute
python scripts/schema_migrator.py \
    --source-db old_projects_id \
    --target-db new_projects_id \
    --mapping my_mapping.json

4. Property Cleanup

Request:

Standardize all property names in "Marketing Campaigns"
to Title Case with spaces

Before:

- campaign_name → Campaign Name
- startDate → Start Date
- end-date → End Date
- STATUS → Status
- assigned_to → Assigned To

MCP Approach:

Use mcp__notion__update-database to rename properties:
{
  "properties": {
    "campaign_name": { "name": "Campaign Name" },
    "startDate": { "name": "Start Date" },
    "end-date": { "name": "End Date" },
    "STATUS": { "name": "Status" }
  }
}

5. Duplicate Detection

Request:

Find duplicate entries in "Contacts" database based on email

Python Script Approach:

# Pseudocode for duplicate detection
pages = fetch_all_pages(database_id)

# Group by email
email_groups = {}
for page in pages:
    email = get_property(page, "Email")
    if email:
        email_groups.setdefault(email, []).append(page)

# Find duplicates
duplicates = {
    email: pages
    for email, pages in email_groups.items()
    if len(pages) > 1
}

# Report
for email, dup_pages in duplicates.items():
    print(f"Duplicate: {email}")
    for p in dup_pages:
        print(f"  - {get_title(p)} (created: {p['created_time']})")

6. Archive Old Content

Request:

Move all tasks completed more than 90 days ago to Archive database

Filter:

{
  "and": [
    {
      "property": "Status",
      "status": { "equals": "Complete" }
    },
    {
      "property": "Completed Date",
      "date": {
        "before": "2025-09-07"
      }
    }
  ]
}

Process:

  1. Query with filter
  2. For each page:
    • Create copy in Archive database
    • Update original with "Archived" status or delete
  3. Report summary

7. Relation Audit

Request:

Find all pages in "Tasks" that have broken relations to "Projects"

Approach:

  1. Fetch all Tasks pages
  2. For each task, check Project relation
  3. Verify referenced Project page exists
  4. Report broken relations

Sample Output:

## Relation Audit: Tasks → Projects

총 작업: 150개
정상 연결: 142개
끊어진 연결: 8개

### 끊어진 연결 목록:
1. "Website Redesign Phase 2" → Project not found
2. "Q3 Marketing Review" → Project deleted
...

### 권장 조치:
- 삭제된 프로젝트 복원 또는
- 해당 작업들을 다른 프로젝트에 재할당

Environment Setup

Quick Start

# Navigate to scripts directory
cd ~/.claude/skills/notion-organizer/scripts

# Create virtual environment
python -m venv venv
source venv/bin/activate  # macOS/Linux

# Install dependencies
pip install -r requirements.txt

# Set environment variable
export NOTION_TOKEN="your_token_here"
# Or create .env file with NOTION_TOKEN=your_token

Verify Setup

# Test with audit (read-only)
python async_organizer.py --database-id YOUR_DB_ID --operation audit

Troubleshooting

Rate Limit Errors (429)

  • Scripts automatically retry with exponential backoff
  • If persistent, reduce MAX_CONCURRENT_REQUESTS to 2

Permission Errors (404)

  • Ensure database is shared with your integration
  • Check integration has correct capabilities

Property Type Mismatch

  • Use --generate-mapping to see current types
  • Some conversions require manual handling (e.g., people → text)

Large Databases (1000+ pages)

  • Always use Python scripts, not MCP
  • Consider running in batches with checkpoints
  • Monitor API usage in Notion settings