setup-chalk
Original:🇺🇸 English
Translated
Initialize .chalk folder — analyze a repo and capture its architecture, coding style, tech stack, design assets, and project identity into chalk.json and structured docs
2installs
Added on
NPX Install
npx skill4agent add generaljerel/chalk-skills setup-chalkTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Initialize a folder for any repository. Produces a machine-readable (the single source of truth for skills) and human-readable PROFILE docs covering product, engineering, design, and AI orientation.
.chalk/chalk.jsonWhat This Skill Produces
.chalk/
chalk.json # Machine-readable project identity (skills read this first)
docs/
product/
PROFILE.md # What the product is, who it's for, core JTBD
engineering/
PROFILE.md # Architecture + tech stack + data flow (single source)
coding-style.md # Naming, file structure, component patterns, conventions
ai/
PROFILE.md # Agent-facing orientation, gotchas, quick reference
design/
PROFILE.md # Design system: colors, typography, spacing, tokens
assets/ # Copied logos, icons, favicons, brand marksWorkflow
Phase 1 — Discover
- Locate the repo root — Use if provided, otherwise use the current working directory.
$ARGUMENTS - Check for existing — If it already exists, warn the user and ask whether to merge or overwrite. If merging, skip files that already exist and only fill gaps.
.chalk/ - Scan the repo — Read these files to understand the project:
- (or
README.md)readme.md - /
package.json/Cargo.toml/pyproject.toml/go.mod/Gemfile(dependency manifest)pom.xml - /
tsconfig.jsontsconfig.*.json - Build configs: ,
vite.config.*,next.config.*,webpack.config.*,electron.vite.config.*,turbo.jsonangular.json - Styling: ,
tailwind.config.*, anypostcss.config.*files in*.csssrc/ - ,
.eslintrc*,.prettierrc*(linter/formatter config)biome.json - ,
Dockerfiledocker-compose.yml - (CI/CD)
.github/workflows/*.yml - Existing ,
AGENTS.md, or.cursorrulesCLAUDE.md
Phase 2 — Analyze
-
Detect framework and project type — Identify from dependencies:
Dependency Framework Type Default Port nextNext.js web 3000 +vite@vitejs/plugin-reactVite + React web 5173 react-scriptsCRA web 3000 nuxtNuxt web 3000 @angular/coreAngular web 4200 /svelte@sveltejs/kitSvelteKit web 5173 /electronelectron-viteElectron desktop varies vueVue web 5173 /express/fastifykoaNode API api 3000 /django/flaskfastapiPython web web/api 8000 -
Detect routes — Scan based on detected framework:
- File-based routing (Next.js, Nuxt, SvelteKit): glob or
app/**/page.{tsx,jsx,ts,js}pages/**/*.{tsx,jsx,vue} - React Router: grep for ,
<Route, orcreateBrowserRouterinpath:src/ - Vue Router: grep for in router config files
path: - Angular: grep for in routing modules
{ path: - Query-param routing (Electron): grep for or
searchParams.get?page= - Express/API: grep for ,
app.get(,router.get(@app.route - Fallback: scan for page components in ,
src/pages/,src/views/,src/app/src/routes/
- File-based routing (Next.js, Nuxt, SvelteKit): glob
-
Map source layout — Identify key directories:
- Source root (,
src/,app/)lib/ - Entry points (main files, renderers, workers)
- Components, pages/views, styles, and tests directories
- Source root (
-
Map the architecture — Identify:
- Process model (monolith, Electron multi-process, SPA, SSR, etc.)
- Directory structure patterns (feature folders, atomic design, domain-driven)
- Entry points and boot sequence
- Data flow (state management, IPC, API calls, database)
- Key abstractions (hooks, services, stores, controllers)
-
Extract coding style — Analyze 3-5 representative files from different layers:
- Naming conventions, export patterns, component patterns
- State management, error handling, comment style
- Import ordering, TypeScript strictness
-
Catalog the tech stack — For every dependency: name, version, layer, purpose, category.
-
Extract design tokens — CSS custom properties, Tailwind theme extensions, recurring color/typography/spacing values.
-
Find brand assets — Glob for icons, logos, favicons under resources/, public/, assets/.
Phase 3 — Generate
- Create — The machine-readable project identity. This is the most important file — skills read it first.
.chalk/chalk.json
json
{
"version": "1.0",
"project": {
"name": "<from package.json or directory name>",
"description": "<from package.json description or README>",
"language": "<typescript|javascript|python|go|rust|java>",
"framework": "<next|vite|electron|django|express|etc>",
"type": "<web|desktop|api|library|cli|monorepo>"
},
"dev": {
"command": "<npm run dev|yarn dev|make dev|etc>",
"port": 3000,
"url": "http://localhost:3000"
},
"test": {
"command": "<npm test|pytest|go test ./...>",
"framework": "<jest|vitest|pytest|node:test>"
},
"build": {
"command": "<npm run build>",
"output": "dist/"
},
"routes": [
{ "path": "/", "name": "Home", "src": "src/pages/index.tsx" }
],
"sourceLayout": {
"root": "src/",
"entrypoints": { "main": "src/main.tsx" },
"components": "src/components/",
"pages": "src/pages/",
"styles": "src/styles/",
"tests": "tests/"
},
"createdAt": "<ISO timestamp>",
"updatedAt": "<ISO timestamp>"
}Schema reference: in the chalk-skills repo defines all valid fields.
docs/chalk.schema.jsonImportant: Fill every field you can detect. Omit fields you can't determine — don't guess. Skills handle missing fields gracefully.
- Create
.chalk/docs/product/PROFILE.md
Summarize:
- Product name, one-liner, primary users, core value prop
- Problem: what pain this solves
- Target Users: table (Persona, Job, How This Helps)
- Core Jobs To Be Done: numbered list, each starts with a verb
- Current Status: feature table (Feature, Status, Notes)
- Create — Single comprehensive engineering doc covering architecture + tech stack + data flow:
.chalk/docs/engineering/PROFILE.md
Include:
- Architecture diagram (ASCII or Mermaid)
- Execution contexts table (entry point, lifecycle, access)
- Boot sequence (numbered steps)
- Directory structure (annotated tree with purpose per directory)
- Data flow (state management, API/IPC boundaries, storage)
- Tech stack table (Package, Version, Category, Purpose) grouped by runtime vs dev/build
- Key patterns (design patterns, error handling, testing approach)
- Create
.chalk/docs/engineering/coding-style.md
Include:
- File & folder naming conventions with examples
- Component/module structure with real code example from the codebase
- Naming conventions (variables, functions, types, files)
- Import ordering with real example
- Export patterns (default vs named)
- TypeScript patterns (strict mode, type vs interface)
- Styling patterns (Tailwind, CSS approach)
- Error handling patterns
- Create — Agent-facing quick reference:
.chalk/docs/ai/PROFILE.md
Include:
- Project Identity: 1 paragraph
- Where Things Live: table (What, Where, Notes)
- Conventions to Follow: top 5-10 rules
- Gotchas: numbered list of agent-surprising things
- How to Add a Feature: step-by-step guide
- Create
.chalk/docs/design/PROFILE.md
Include:
- Brand identity (name, visual tone)
- Color palette: Primary, Neutral, Semantic tables (Name, Hex, Tailwind, Usage)
- Typography (font families, size/weight scales)
- Spacing & layout (common values, breakpoints)
- Borders & shadows
- Icons (library, usage patterns)
- Component patterns (buttons, cards, common UI)
- Copy brand assets to (files < 500KB, prefer SVG).
.chalk/docs/design/assets/
Phase 4 — Verify
- Validate — Check that required fields are present and values make sense. Print warnings for missing optional fields.
chalk.json - List created files — Print a tree of everything created under .
.chalk/ - Summarize — Tell the user what was captured, what has gaps, and suggest running to enrich stubs with deeper analysis.
/setup-docs
Doc Format Rules
- No YAML frontmatter in docs (plain markdown)
- First is the document title
# Heading - immediately after the title
Last updated: YYYY-MM-DD (<brief note>) - Use for sections
## Heading - GFM features: tables, code blocks, checkboxes, Mermaid diagrams
- Use real code examples from the repo, not generic placeholders
- Be specific and concrete — hex codes not "brand green", actual file paths not "components folder"
Migration from v1
If the project has the old docs structure (numbered files like , , ):
0_PRODUCT_PROFILE.md1_architecture.md3_techstack.md- Merge +
0_ENGINEERING_PROFILE.md+1_architecture.md→3_techstack.mdengineering/PROFILE.md - Rename →
0_PRODUCT_PROFILE.mdproduct/PROFILE.md - Rename →
0_AI_PROFILE.mdai/PROFILE.md - Rename →
0_design-system.mddesign/PROFILE.md - Rename →
2_coding-style.mdengineering/coding-style.md - Keep any extra docs as additional files in their vertical
- Expand with new fields (project, dev, test, build, routes, sourceLayout)
chalk.json - Delete old numbered files after confirming the merge
Ask the user before performing migration.
Style Transfer Focus
The goal is fidelity. An AI agent reading these docs should be able to:
- Write new code that looks like it belongs in the codebase (coding style)
- Place files in the right directories following the right patterns (architecture)
- Use the correct libraries and APIs (tech stack)
- Match the visual design exactly — right colors, right spacing, right typography (design system)
- Use the brand assets correctly (design assets)
Prioritize concrete examples over abstract rules.