diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..88a6d4e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.go] +indent_style = tab + +[*.py] +indent_size = 4 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index da99294..af07e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -39,10 +39,22 @@ __pycache__/ /Archived/ /.claude/ /obsidian/ +NS_0327 +/projects/production/gwx/ +/projects/production/claude_code_telegram_bot/ .zshrc-wrap scripts/login-agents.sh .session-wrap-trigger.json +# Nested project metadata / local agent state +.git/ +.agents/ +.claude/ +.codex/ +.coverage +.venv/ +.pytest_cache/ + # Database & cache files *.rdb dump.db diff --git a/.zshrc-workspace b/.zshrc-workspace index ad7e450..1ee3467 100644 --- a/.zshrc-workspace +++ b/.zshrc-workspace @@ -1,7 +1,10 @@ # YD 2026 Workspace Shortcuts # Source this from ~/.zshrc with: source ~/YD\ 2026/.zshrc-workspace -export WORKSPACE_ROOT="$HOME/YD 2026" +export WORKSPACE_ROOT="${YD_WORKSPACE:-/Users/dex/YD 2026}" + +# 載入 session-wrap aliases(agent tools, viz, wrap) +[ -f "$WORKSPACE_ROOT/.zshrc-wrap" ] && source "$WORKSPACE_ROOT/.zshrc-wrap" # 快速進入項目 alias p1="cd '$WORKSPACE_ROOT/projects/production/gwx'" @@ -10,9 +13,7 @@ alias p3="cd '$WORKSPACE_ROOT/projects/experimental/NS_0327'" alias pw="cd '$WORKSPACE_ROOT'" alias pj="cd '$WORKSPACE_ROOT/projects'" -# 知識庫 -alias kb="code '$WORKSPACE_ROOT/obsidian'" -alias mem="cat '$HOME/.claude/projects/-Users-dex-YD-2026/memory/MEMORY.md'" +# 知識庫 (kb, mem 由 .zshrc-wrap 統一定義) yd-info() { sed -n '1,220p' "$WORKSPACE_ROOT/PROJECTS_INFO.md" @@ -44,9 +45,9 @@ yd-status() { } # Skill 飛輪部署 -alias skill-deploy="bash '$WORKSPACE_ROOT/scripts/skill-deploy.sh'" -alias skill-list="bash '$WORKSPACE_ROOT/scripts/skill-deploy.sh' --list" -alias skill-status="bash '$WORKSPACE_ROOT/scripts/skill-deploy.sh' --status" +alias skill-deploy="bash '$WORKSPACE_ROOT/scripts/deploy/skill-deploy.sh'" +alias skill-list="bash '$WORKSPACE_ROOT/scripts/deploy/skill-deploy.sh' --list" +alias skill-status="bash '$WORKSPACE_ROOT/scripts/deploy/skill-deploy.sh' --status" # 新專案快速建立 skill-new() { diff --git a/.zshrc-wrap b/.zshrc-wrap index 9754ab2..cf3fc64 100644 --- a/.zshrc-wrap +++ b/.zshrc-wrap @@ -3,9 +3,9 @@ # YD 2026 — Session Wrap & Auto-sync Aliases # Source this in ~/.zshrc: source ~/YD\ 2026/.zshrc-wrap -export YD_WORKSPACE="/Users/dex/YD 2026" -export YD_MEMORY="/Users/dex/.claude/projects/-Users-dex-YD-2026/memory" -export YD_OBSIDIAN="$YD_WORKSPACE/obsidian" +export YD_WORKSPACE="${YD_WORKSPACE:-/Users/dex/YD 2026}" +export YD_MEMORY="${YD_MEMORY:-/Users/dex/.claude/projects/-Users-dex-YD-2026/memory}" +export YD_OBSIDIAN="${YD_OBSIDIAN:-$YD_WORKSPACE/obsidian}" # Session Wrap — Save context at session end function wrap() { @@ -25,19 +25,19 @@ alias sync-kb='bash "$YD_WORKSPACE/scripts/obsidian-sync.sh"' alias sync-all='wrap && sync-kb' # Agent tools (v3.4.0) -alias agent-context='bash "$YD_WORKSPACE/scripts/agent-context.sh"' -alias agent-share='bash "$YD_WORKSPACE/scripts/agent-share.sh"' -alias agent-decision='bash "$YD_WORKSPACE/scripts/agent-decision.sh"' -alias agent-checkpoint='bash "$YD_WORKSPACE/scripts/agent-checkpoint.sh"' -alias agent-knowledge='bash "$YD_WORKSPACE/scripts/agent-knowledge.sh"' -alias agent-optimize='bash "$YD_WORKSPACE/scripts/agent-optimize.sh"' -alias agent-tasks='bash "$YD_WORKSPACE/scripts/agent-tasks.sh"' +alias agent-context='bash "$YD_WORKSPACE/scripts/agent/agent-context.sh"' +alias agent-share='bash "$YD_WORKSPACE/scripts/agent/agent-share.sh"' +alias agent-decision='bash "$YD_WORKSPACE/scripts/agent/agent-decision.sh"' +alias agent-checkpoint='bash "$YD_WORKSPACE/scripts/agent/agent-checkpoint.sh"' +alias agent-knowledge='bash "$YD_WORKSPACE/scripts/agent/agent-knowledge.sh"' +alias agent-optimize='bash "$YD_WORKSPACE/scripts/agent/agent-optimize.sh"' +alias agent-tasks='bash "$YD_WORKSPACE/scripts/agent/agent-tasks.sh"' # Visualization tools (v3.4.0) -alias visualize-tasks='bash "$YD_WORKSPACE/scripts/visualize-tasks.sh"' -alias analyze-decisions='bash "$YD_WORKSPACE/scripts/analyze-decisions.sh"' -alias memory-report='bash "$YD_WORKSPACE/scripts/memory-report.sh"' -alias timeline='bash "$YD_WORKSPACE/scripts/timeline.sh"' +alias visualize-tasks='bash "$YD_WORKSPACE/scripts/viz/visualize-tasks.sh"' +alias analyze-decisions='bash "$YD_WORKSPACE/scripts/viz/analyze-decisions.sh"' +alias memory-report='bash "$YD_WORKSPACE/scripts/viz/memory-report.sh"' +alias timeline='bash "$YD_WORKSPACE/scripts/viz/timeline.sh"' # Memory shortcuts alias mem='cat "$YD_MEMORY/MEMORY.md" | head -50' @@ -47,9 +47,8 @@ alias mem-edit='code "$YD_MEMORY"' # Status checks alias yd-km-status='echo "KB: $(find "$YD_OBSIDIAN" -name "*.md" | wc -l) files" && echo "Memory: $(ls -1 "$YD_MEMORY"/*.md 2>/dev/null | wc -l) files"' -# Quick nav +# Quick nav (pw 由 .zshrc-workspace 定義) alias kb='code "$YD_OBSIDIAN"' -alias pw='cd "$YD_WORKSPACE" && pwd' # Session workflow function yd-start-session() { diff --git a/CLAUDE.md b/CLAUDE.md index 9d4c6be..bb2eddf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -46,5 +46,4 @@ YD 2026/ ``` ## 注意 -- `dexapi`、`test-ydapi`、`watermark-0324` 不再是主項目入口。 -- README 中 session-wrap 產品文檔統一放在 `docs/`。 +- session-wrap 產品文檔已歸檔至 `docs/archive/session-wrap/`。 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 7efc6ad..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,440 +0,0 @@ -# Contributing to YD 2026 - -感謝您對 YD 2026 工作區的貢獻!本文檔說明如何有效地為此項目做出貢獻。 - ---- - -## 在開始之前 - -### 了解項目 - -1. 讀 [README.md](README.md) 了解工作區概述 -2. 讀 [CLAUDE.md](CLAUDE.md) 了解項目規則 -3. 讀 [PROJECTS.md](PROJECTS.md) 了解項目結構 -4. 讀 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) 了解開發流程 - -### 設置環境 - -```bash -# 激活別名系統 -source ~/.zshrc-workspace - -# 驗證環境 -p1 && git status -``` - ---- - -## 貢獻流程 - -### 1. 創建 Issue(如適用) - -對於大型變更或新功能,先創建 Issue 討論設計: - -``` -Title: [Feature/Bug] Brief description - -Description: -- What: 你要做什麼 -- Why: 為什麼需要這個變更 -- How: 建議的實現方式 -``` - -### 2. 創建特性分支 - -```bash -# 進入項目 -p1 # 或 p2, p3, 等 - -# 更新 develop 分支 -git checkout develop -git pull origin develop - -# 創建特性分支 -git checkout -b feature/your-feature-name develop -# 或修復分支 -git checkout -b bugfix/issue-name develop -``` - -**分支命名約定:** -- `feature/feature-name` - 新功能 -- `bugfix/bug-name` - Bug 修復 -- `refactor/refactor-name` - 代碼重構 -- `docs/doc-topic` - 文檔更新 -- `chore/task-name` - 維護任務 - -### 3. 進行變更 - -```bash -# 編輯代碼 -# ... 做出你的變更 ... - -# 運行測試 -npm test # 或相應的測試命令 - -# 查看變更 -git diff -git status -``` - -### 4. 提交變更 - -```bash -# 暫存文件 -git add . - -# 提交(遵循提交消息格式) -git commit -m "type(scope): brief description - -Optional detailed explanation of the change." -``` - -**提交消息格式:** - -``` -(): - - - -