← ClaudeAtlas

month-log-summarylisted

为 month-log 月工作日志生成/覆盖「AI月总结」章节:阅读月总结数据、月计划与任务记录,生成先数据后结论的主观叙述总结,写回文档末尾(已存在则整体覆盖,不询问)。支持三种目标指定方式:显式文件路径 / 只给月份(当月、上个月、2026-07 等)/ 什么都不给(默认今天所在周的归属月,与 month-log init 一致)。用户要求生成或更新月总结汇报、述职月报、AI 月总结时触发。
fongzhizhi/claude-skill-lab · ★ 1 · AI & Automation · score 77
Install: claude install-skill fongzhizhi/claude-skill-lab
# month-log-summary 为 month-log 格式的月工作日志(`logs/YYYY/YYYY-MM.md`)补写一个「AI月总结」章节,把月文档扩展为"人工 + 脚本 + AI"三合一:人工填记录、脚本算数据、AI 组织叙述,直接可作公司月总结汇报。 ## 确定目标文档(按优先级,三选一) ### 方式 A:用户显式给了文件路径 直接用该路径(绝对/相对均可)。进入「校验」。 ### 方式 B:用户只说了月份("上个月"、"7 月"、"2026-07") 先定位仓库,再解析月份 → `logs/<年份>/<YYYY-MM>.md`。 月份解析规则(基于"归属月",见方式 C): - "当月 / 这月" → 归属月 - "上个月 / 上月" → 归属月的上一个月 - "X 月" / "YYYY-MM" / 年份+月份 → 直接解析 ### 方式 C:什么都没说 默认月 = **今天所在周的归属月**(与 month-log `init` 的跨月周归属一致:周一~周日按各月占用天数判定,平分归周一所在月)。Windows / Git Bash 下运行: ```bash node -e 'const d=new Date();const day=(d.getDay()+6)%7;const mon=new Date(d);mon.setDate(d.getDate()-day);let y=mon.getFullYear(),m=mon.getMonth()+1,days=0;const end=new Date(mon);end.setDate(mon.getDate()+6);while(mon<=end){if(mon.getMonth()+1===m)days++;mon.setDate(mon.getDate()+1)};const r=days>=4?String(y)+"-"+String(m).padStart(2,"0"):String(end.getFullYear())+"-"+String(end.getMonth()+1).padStart(2,"0");console.log(r)' ``` (示例:2026-08-31 是周一,该周 8 月仅占 1 天 → 归属月为 2026-09。) ### 定位仓库(方式 B/C 需要) month-log 仓库通常已通过 `npm run link` 注册为全局命令 `month-log`。通过全局安装位置反查仓库真实路径(npm link 的全局模块是指向仓库的链接,realpath 解析): ```bash node -e 'const{realpathSync}=require("fs"),p=require("path");try{const g=require("child_process").execSync("npm root -g",{encoding:"utf8"}).trim();console.log(realpathSync(p.join(g,"month-log")))}catch(e){process.exit(1)}' ``` - 输出为仓库根目录(如 `D:\MyWorking\github\month-log`),目标文档 = `<仓库根>/logs/<年份>/<YYYY-MM>.md`。 - 命令失败(未 link 或路径异常):直接询问用户文档地址,并可提示先 `npm run link` 注册