/codex-writing
Nhờ Codex CLI viết bài blog mới từ outline/mockup file HOẶC từ 1 dòng prompt mô tả, theo voice guide + audience.
Cài command này
Chạy trong terminal, sau đó restart Claude Code.
curl -fsSL https://raw.githubusercontent.com/kaiitc/helloai-kit/main/install.sh | bash -s -- command codex-writing Paste prompt dưới vào Claude Code / Codex CLI chat, AI sẽ chạy cài giúp.
Cài giúp mình command "codex-writing" từ HelloAI Kit nhé. Chạy trong terminal:
curl -fsSL https://raw.githubusercontent.com/kaiitc/helloai-kit/main/install.sh | bash -s -- command codex-writing
Xong check file ~/.claude/commands/codex-writing.md có chưa rồi báo lại. Nhiệm vụ
Nhờ Codex CLI viết 1 bài blog hoàn chỉnh dựa trên input:
$ARGUMENTS
Input có thể là:
- Đường dẫn file outline/mockup (vd:
plans/coolify-outline.mdhoặc55-writing/personal-blog/drafts/xxx-outline.md). - 1 dòng prompt mô tả ngắn (vd:
chia sẻ trải nghiệm dùng Claude Code tự động hoá công việc admin agency).
Cách chạy
-
Nếu
$ARGUMENTStrống, hỏi user muốn viết bài gì trước khi tiếp tục. -
Detect input type:
- Chạy
test -f "$ARGUMENTS"để check có phải file path không. - Nếu là file: đọc nội dung bằng
Readđể verify đúng outline. Nếu không phải markdown/outline hợp lệ, hỏi user confirm. - Nếu không phải file: coi là prompt text.
- Chạy
-
Xác định output path và slug:
- Slug: kebab-case rút từ input (vd:
claude-code-agency-automation). - Path:
/Users/vanngo/www/my-vault/55-writing/personal-blog/drafts/<slug>.md. - Nếu file đã tồn tại, thêm
-v2,-v3… vào slug.
- Slug: kebab-case rút từ input (vd:
-
Gọi Codex CLI viết bài:
codex exec --skip-git-repo-check -s workspace-write "Viết 1 bài blog cá nhân bằng tiếng Việt cho Văn (bút danh Vincent). Đọc BẮT BUỘC 3 file foundation trước khi viết:
(1) Voice guide: /Users/vanngo/www/my-vault/55-writing/personal-blog/voice-style-guide.md - tuân thủ nghiêm anti-patterns, word choices, sentence patterns. Chọn narrative mode hoặc explainer mode tuỳ nội dung.
(2) Audience: /Users/vanngo/www/my-vault/55-writing/foundation/audience.md - viết cho ai, tránh viết cho ai.
(3) Me: /Users/vanngo/www/my-vault/55-writing/foundation/me.md - vị trí người viết, giọng thật.
Input từ user (outline HOẶC prompt): <INPUT_CONTENT>
Yêu cầu:
- Length: 1200-1500 từ.
- Frontmatter theo schema: title, description, slug (để trống), publishedAt: 2026-07-15, draft: true, tags (list), audience: '[[audience]]', voice_check (list các dấu ✓).
- Title dạng '<Chủ đề> - <mô tả rõ ràng>', không marketing hook.
- Opening hook thật, tránh 'Trong bối cảnh...', tránh 'Ngày nay...'.
- Có concrete numbers, tên tool cụ thể nếu input đề cập.
- Placeholder screenshot dạng *[screenshot ...]* nếu bài cần minh hoạ.
- Closing observation nhẹ, không thuyết giáo.
- KHÔNG em-dash, KHÔNG emoji, KHÔNG hashtag.
Ghi file vào: <OUTPUT_PATH>
Sau khi ghi xong, in đúng 3 dòng: title, mode giọng (narrative/explainer), số từ." < /dev/null
Trong đó thay:
<INPUT_CONTENT>: content của file (nếu là file) hoặc prompt text (nếu là plain text). Escape quotes cẩn thận khi truyền vào bash.<OUTPUT_PATH>: path đã tính ở bước 3.
- Sau khi codex chạy xong, verify file được tạo bằng
ls -la <OUTPUT_PATH>vàwc -w <OUTPUT_PATH>. - In cho user: path file, title, mode, word count. Hỏi user có muốn đọc qua rồi chỉnh không.
Nguyên tắc
- KHÔNG sửa các file khác. Chỉ tạo file mới.
- KHÔNG overwrite file cũ - luôn thêm suffix
-v2,-v3nếu trùng slug. - Nếu input là outline có sẵn cấu trúc section, codex phải theo cấu trúc đó (không đảo section).
- Nếu input chỉ là 1 câu prompt, codex tự chọn cấu trúc phù hợp voice guide.
- Nếu codex trả về output không match voice guide (dùng em-dash, thuyết giáo, corporate tone), báo user và đề xuất chạy lại.