From eae318510af0000c0255cd46a14631b40ce15d40 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Tue, 17 Mar 2026 22:11:42 +0700 Subject: [PATCH] fix(skills): target only content/post files in mt-add-tags proactive commit check --- .claude/skills/mt-add-tags/SKILL.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.claude/skills/mt-add-tags/SKILL.md b/.claude/skills/mt-add-tags/SKILL.md index 3b32c00..ec6139b 100644 --- a/.claude/skills/mt-add-tags/SKILL.md +++ b/.claude/skills/mt-add-tags/SKILL.md @@ -99,7 +99,19 @@ Replace the entire existing `tags:` line. Preserve all other frontmatter fields ## Proactive behavior (before commit) -When the user is about to commit (`/commit`, `mt:commit-push-pr`, or similar), check the most recently modified post file. If its tags look minimal (only 1-2 tags, or only `AI-Assisted`/`Newsletter`), say: +When the user is about to commit (`/commit`, `mt:commit-push-pr`, or similar), find the most recently modified `content/post/*/index.md` file: + +```bash +git diff --name-only HEAD | grep "^content/post/" | head -1 +``` + +If that returns nothing, check unstaged changes: + +```bash +git status --short | grep "content/post/" | awk '{print $2}' | head -1 +``` + +If a post file is found and its tags look minimal (only 1-2 tags, or only `AI-Assisted`/`Newsletter`), say: > "Post `content/post/.../index.md` chỉ có tags: [...]. Bạn có muốn thêm tags trước khi commit không? [Y/n]"