From 1cb565161c0ec3bf360a1420f540d1d412ea0ff4 Mon Sep 17 00:00:00 2001 From: Kaxi <1042864399@qq.com> Date: Sat, 16 May 2026 18:59:32 +0800 Subject: [PATCH] feat: add tmp/ directory for temp files and cookie, add .gitignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tmp/ 用于存放临时文件(文档缓存、cookie等),已加入 .gitignore - 文档中所有临时文件和 cookie 路径统一指向 tmp/ - SKILL.md 架构图增加 tmp/ 说明 Co-Authored-By: Claude Opus 4.6 --- .gitignore | 2 ++ SKILL.md | 5 +++++ sources/tencent-doc/v1/usage.md | 8 ++++---- storage/quark/v1/install.md | 4 ++-- storage/quark/v1/usage.md | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d932c8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# 临时文件 / 配置文件,不纳入版本管理 +tmp/ diff --git a/SKILL.md b/SKILL.md index 989c736..909043e 100644 --- a/SKILL.md +++ b/SKILL.md @@ -28,6 +28,11 @@ media-center/ │ └── quark/ │ └── v1/{install,usage,maintain}.md │ +├── tmp/ # 临时文件 / cookie(已 gitignore) +│ ├── cookie_quark.txt # 夸克 Cookie +│ ├── doc_raw.json # 文档结构缓存 +│ └── doc_content.txt # 提取的全文缓存 +│ └── ref/ # 参考归档 ├── tencent-docs/ ├── tx-doc-large-reader/ diff --git a/sources/tencent-doc/v1/usage.md b/sources/tencent-doc/v1/usage.md index 07082d9..3a51c37 100644 --- a/sources/tencent-doc/v1/usage.md +++ b/sources/tencent-doc/v1/usage.md @@ -42,12 +42,12 @@ mcporter call tencent-docs smartcanvas.read file_id= size=10 ```bash # 获取完整文档结构 -mcporter call tencent-docs doc.resolve_document_structure file_id= > doc_raw.json +mcporter call tencent-docs doc.resolve_document_structure file_id= > tmp/doc_raw.json # 提取纯文本 python -X utf8 -c " import json -with open('doc_raw.json','r',encoding='utf-8') as f: +with open('tmp/doc_raw.json','r',encoding='utf-8') as f: data=json.load(f) texts=[] for n in data.get('nodes',[]): @@ -55,13 +55,13 @@ for n in data.get('nodes',[]): hl=n.get('heading_level',0) if p: texts.append(('#'*hl+' '+p) if hl>0 else p) -with open('doc_content.txt','w',encoding='utf-8') as f: +with open('tmp/doc_content.txt','w',encoding='utf-8') as f: f.write('\n'.join(texts)) print(f'Done: {len(texts)} paragraphs') " # 清理中间文件 -rm doc_raw.json +rm tmp/doc_raw.json ``` ### 第二步 B:smartcanvas 类型(支持分页) diff --git a/storage/quark/v1/install.md b/storage/quark/v1/install.md index acf69ac..20adedb 100644 --- a/storage/quark/v1/install.md +++ b/storage/quark/v1/install.md @@ -30,8 +30,8 @@ mcporter config add netdisk \ --env "NETDISK_QUARK_COOKIE=粘贴你的完整Cookie" ``` -> Cookie 是敏感信息,建议保存在单独的文件(如 `项目根目录/cookie/quark.txt`)中, -> 使用时 `COOKIE=$(cat cookie/quark.txt)`,避免在命令行历史中泄露。 +> Cookie 是敏感信息,保存在 `tmp/cookie_quark.txt`(已加入 `.gitignore`), +> 使用时 `COOKIE=$(cat tmp/cookie_quark.txt)`,避免在命令行历史中泄露。 ### 3. 验证 diff --git a/storage/quark/v1/usage.md b/storage/quark/v1/usage.md index 19ca6db..a54ee60 100644 --- a/storage/quark/v1/usage.md +++ b/storage/quark/v1/usage.md @@ -69,7 +69,7 @@ mcporter call 'netdisk.list(cloud: "quark", path: "/目标目录")' ```bash # 从文件读取避免泄露(推荐) -COOKIE=$(cat cookie/quark.txt) +COOKIE=$(cat tmp/cookie_quark.txt) # 或直接写入(注意命令行历史) # COOKIE="你的夸克Cookie"