This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
sadcoder-press is a bilingual (English + Chinese) static blog built with Astro 6, Tailwind CSS 4, and deployed on Vercel. It hosts long-form blog articles and short-form social media posts for sadcoderlabs.
npm run dev # Start dev server with hot reload
npm run build # Production build → dist/
npm run preview # Preview production build locallyNode.js >= 22.12.0 required.
- Framework: Astro 6 (static output, zero client-side JS by default)
- Styling: Tailwind CSS 4 via
@tailwindcss/viteplugin, with@tailwindcss/typographyfor prose - i18n: English is default (no URL prefix), Chinese uses
/zh/prefix. Configured inastro.config.mjs - Dark mode:
.darkclass on<html>, persisted in localStorage, inline script inBase.astroprevents flash
Two collections defined in src/content.config.ts with Zod validation:
- blog (
src/content/blog/): Long-form articles. Required frontmatter:title,date,description,tags,lang - posts (
src/content/posts/): Social posts. Required frontmatter:date,platform,lang,tags
Both support optional draft: true (excluded from build).
All content lives in date-prefixed directories: YYYY-MM-DD_slug/
src/content/blog/2026-03-24_my-article/
├── en.md # English version
├── zh.md # Chinese version (optional)
└── assets/ # Images (optional)
The slug is extracted by src/lib/utils.ts:getSlug() which strips the date prefix from the directory name. Example: 2026-03-19_hello-world/en → hello-world.
Pages use Astro dynamic routes with getStaticPaths():
src/pages/blog/[slug].astro→/blog/{slug}/src/pages/posts/[slug].astro→/posts/{slug}/src/pages/zh/blog/[slug].astro→/zh/blog/{slug}/src/pages/zh/posts/[slug].astro→/zh/posts/{slug}/
src/layouts/Base.astro— Main HTML wrapper, dark mode script, max-width3xlsrc/components/Nav.astro— Language-aware navigationsrc/components/ThemeToggle.astro— Light/dark togglesrc/components/LanguageSwitcher.astro— Mirrors current page to alternate language
The writing/ directory is a pre-publication workspace separate from deployed content. It integrates with AI writing skills (.agents/skills/) for article preparation, writing, and translation.
writing/articles/— Article briefs and draftswriting/posts/— Social post draftswriting/profiles/— Author voice profileswriting/ideas.md— Idea pool with status trackingwriting/writing-rules.md— Anti-AI-writing patterns to avoidwriting/social-style-guide.md— Voice rules for social posts
- No dash-connected contrasts ("not A — but B")
- No hollow opening questions ("Have you ever wondered...?")
- No filler phrases ("actually", "in fact", "interestingly")
- No summary sentences restating what a paragraph just said
- No transition filler ("Let's dive deeper", "Moving on to")
- No listicle structure when prose is more natural
- Limit em-dashes to 1-2 per article
- Every claim must come from author-sourced materials; never fabricate
- Be specific: numbers over adjectives, names over categories, stories over summaries
Push to main → Vercel auto-deploys. Fully static site, no server-side rendering.
MIT (code) + CC BY-NC-SA 4.0 (content).