Initialize a .chalk/ folder for any repository. Produces a machine-readable chalk.json (the single source of truth for skills) and human-readable PROFILE docs covering product, engineering, design, and AI orientation.
What 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 marks
Workflow
Phase 1 — Discover
- Locate the repo root — Use
$ARGUMENTS if provided, otherwise use the current working directory.
- Check for existing
.chalk/ — 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.
- Scan the repo — Read these files to understand the project:
README.md (or readme.md)
package.json / Cargo.toml / pyproject.toml / go.mod / Gemfile / pom.xml (dependency manifest)
tsconfig.json / tsconfig.*.json
- Build configs:
vite.config.*, next.config.*, webpack.config.*, electron.vite.config.*, turbo.json, angular.json
- Styling:
tailwind.config.*, postcss.config.*, any *.css files in src/
.eslintrc*, .prettierrc*, biome.json (linter/formatter config)
Dockerfile, docker-compose.yml
.github/workflows/*.yml (CI/CD)
- Existing
AGENTS.md, .cursorrules, or CLAUDE.md
Phase 2 — Analyze
Detect framework and project type — Identify from dependencies:
| Dependency |
Framework |
Type |
Default Port |
next |
Next.js |
web |
3000 |
vite + @vitejs/plugin-react |
Vite + React |
web |
5173 |
react-scripts |
CRA |
web |
3000 |
nuxt |
Nuxt |
web |
3000 |
@angular/core |
Angular |
web |
4200 |
svelte / @sveltejs/kit |
SvelteKit |
web |
5173 |
electron / electron-vite |
Electron |
desktop |
varies |
vue |
Vue |
web |
5173 |
express / fastify / koa |
Node API |
api |
3000 |
django / flask / fastapi |
Python web |
web/api |
8000 |
Detect routes — Scan based on detected framework:
- File-based routing (Next.js, Nuxt, SvelteKit): glob
app/**/page.{tsx,jsx,ts,js} or pages/**/*.{tsx,jsx,vue}
- React Router: grep for
<Route, createBrowserRouter, or path: in src/
- Vue Router: grep for
path: in router config files
- Angular: grep for
{ path: in routing modules
- Query-param routing (Electron): grep for
searchParams.get or ?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/
Map source layout — Identify key directories:
- Source root (
src/, app/, lib/)
- Entry points (main files, renderers, workers)
- Components, pages/views, styles, and tests directories
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
.chalk/chalk.json — The machine-readable project identity. This is the most important file — skills read it first.
{
"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: docs/chalk.schema.json in the chalk-skills repo defines all valid fields.
Important: 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
.chalk/docs/engineering/PROFILE.md — Single comprehensive engineering doc covering architecture + tech stack + data flow:
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
.chalk/docs/ai/PROFILE.md — Agent-facing quick reference:
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
.chalk/docs/design/assets/ (files < 500KB, prefer SVG).
Phase 4 — Verify
- Validate
chalk.json — Check that required fields are present and values make sense. Print warnings for missing optional fields.
- List created files — Print a tree of everything created under
.chalk/.
- Summarize — Tell the user what was captured, what has gaps, and suggest running
/setup-docs to enrich stubs with deeper analysis.
Doc Format Rules
- No YAML frontmatter in docs (plain markdown)
- First
# Heading is the document title
Last updated: YYYY-MM-DD (<brief note>) immediately after the title
- Use
## Heading for sections
- 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.md, 1_architecture.md, 3_techstack.md):
- Merge
0_ENGINEERING_PROFILE.md + 1_architecture.md + 3_techstack.md → engineering/PROFILE.md
- Rename
0_PRODUCT_PROFILE.md → product/PROFILE.md
- Rename
0_AI_PROFILE.md → ai/PROFILE.md
- Rename
0_design-system.md → design/PROFILE.md
- Rename
2_coding-style.md → engineering/coding-style.md
- Keep any extra docs as additional files in their vertical
- Expand
chalk.json with new fields (project, dev, test, build, routes, sourceLayout)
- 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.
1---2name: setup-chalk3description: Initialize .chalk folder — analyze a repo and capture its architecture, coding style, tech stack, design assets, and project identity into chalk.json and structured docs4---5
6Initialize a `.chalk/` folder for any repository. Produces a machine-readable `chalk.json` (the single source of truth for skills) and human-readable PROFILE docs covering product, engineering, design, and AI orientation.
7
8## What This Skill Produces
9
10```
11.chalk/
12 chalk.json # Machine-readable project identity (skills read this first)
13 docs/
14 product/
15 PROFILE.md # What the product is, who it's for, core JTBD
16 engineering/
17 PROFILE.md # Architecture + tech stack + data flow (single source)
18 coding-style.md # Naming, file structure, component patterns, conventions
19 ai/
20 PROFILE.md # Agent-facing orientation, gotchas, quick reference
21 design/
22 PROFILE.md # Design system: colors, typography, spacing, tokens
23 assets/ # Copied logos, icons, favicons, brand marks
24```
25
26## Workflow
27
28### Phase 1 — Discover
29
301. **Locate the repo root** — Use `$ARGUMENTS` if provided, otherwise use the current working directory.
312. **Check for existing `.chalk/`** — 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.
323. **Scan the repo** — Read these files to understand the project:
33 - `README.md` (or `readme.md`)
34 - `package.json` / `Cargo.toml` / `pyproject.toml` / `go.mod` / `Gemfile` / `pom.xml` (dependency manifest)
35 - `tsconfig.json` / `tsconfig.*.json`
36 - Build configs: `vite.config.*`, `next.config.*`, `webpack.config.*`, `electron.vite.config.*`, `turbo.json`, `angular.json`
37 - Styling: `tailwind.config.*`, `postcss.config.*`, any `*.css` files in `src/`
38 - `.eslintrc*`, `.prettierrc*`, `biome.json` (linter/formatter config)
39 - `Dockerfile`, `docker-compose.yml`
40 - `.github/workflows/*.yml` (CI/CD)
41 - Existing `AGENTS.md`, `.cursorrules`, or `CLAUDE.md`
42
43### Phase 2 — Analyze
44
454. **Detect framework and project type** — Identify from dependencies:
46
47 | Dependency | Framework | Type | Default Port |
48 |-----------|-----------|------|-------------|
49 | `next` | Next.js | web | 3000 |
50 | `vite` + `@vitejs/plugin-react` | Vite + React | web | 5173 |
51 | `react-scripts` | CRA | web | 3000 |
52 | `nuxt` | Nuxt | web | 3000 |
53 | `@angular/core` | Angular | web | 4200 |
54 | `svelte` / `@sveltejs/kit` | SvelteKit | web | 5173 |
55 | `electron` / `electron-vite` | Electron | desktop | varies |
56 | `vue` | Vue | web | 5173 |
57 | `express` / `fastify` / `koa` | Node API | api | 3000 |
58 | `django` / `flask` / `fastapi` | Python web | web/api | 8000 |
59
605. **Detect routes** — Scan based on detected framework:
61 - **File-based routing** (Next.js, Nuxt, SvelteKit): glob `app/**/page.{tsx,jsx,ts,js}` or `pages/**/*.{tsx,jsx,vue}`
62 - **React Router**: grep for `<Route`, `createBrowserRouter`, or `path:` in `src/`
63 - **Vue Router**: grep for `path:` in router config files
64 - **Angular**: grep for `{ path:` in routing modules
65 - **Query-param routing** (Electron): grep for `searchParams.get` or `?page=`
66 - **Express/API**: grep for `app.get(`, `router.get(`, `@app.route`
67 - **Fallback**: scan for page components in `src/pages/`, `src/views/`, `src/app/`, `src/routes/`
68
696. **Map source layout** — Identify key directories:
70 - Source root (`src/`, `app/`, `lib/`)
71 - Entry points (main files, renderers, workers)
72 - Components, pages/views, styles, and tests directories
73
747. **Map the architecture** — Identify:
75 - Process model (monolith, Electron multi-process, SPA, SSR, etc.)
76 - Directory structure patterns (feature folders, atomic design, domain-driven)
77 - Entry points and boot sequence
78 - Data flow (state management, IPC, API calls, database)
79 - Key abstractions (hooks, services, stores, controllers)
80
818. **Extract coding style** — Analyze 3-5 representative files from different layers:
82 - Naming conventions, export patterns, component patterns
83 - State management, error handling, comment style
84 - Import ordering, TypeScript strictness
85
869. **Catalog the tech stack** — For every dependency: name, version, layer, purpose, category.
87
8810. **Extract design tokens** — CSS custom properties, Tailwind theme extensions, recurring color/typography/spacing values.
89
9011. **Find brand assets** — Glob for icons, logos, favicons under resources/, public/, assets/.
91
92### Phase 3 — Generate
93
9412. **Create `.chalk/chalk.json`** — The machine-readable project identity. This is the most important file — skills read it first.
95
96```json
97{
98 "version": "1.0",
99 "project": {
100 "name": "<from package.json or directory name>",
101 "description": "<from package.json description or README>",
102 "language": "<typescript|javascript|python|go|rust|java>",
103 "framework": "<next|vite|electron|django|express|etc>",
104 "type": "<web|desktop|api|library|cli|monorepo>"
105 },
106 "dev": {
107 "command": "<npm run dev|yarn dev|make dev|etc>",
108 "port": 3000,
109 "url": "http://localhost:3000"
110 },
111 "test": {
112 "command": "<npm test|pytest|go test ./...>",
113 "framework": "<jest|vitest|pytest|node:test>"
114 },
115 "build": {
116 "command": "<npm run build>",
117 "output": "dist/"
118 },
119 "routes": [
120 { "path": "/", "name": "Home", "src": "src/pages/index.tsx" }
121 ],
122 "sourceLayout": {
123 "root": "src/",
124 "entrypoints": { "main": "src/main.tsx" },
125 "components": "src/components/",
126 "pages": "src/pages/",
127 "styles": "src/styles/",
128 "tests": "tests/"
129 },
130 "createdAt": "<ISO timestamp>",
131 "updatedAt": "<ISO timestamp>"
132}
133```
134
135**Schema reference**: `docs/chalk.schema.json` in the chalk-skills repo defines all valid fields.
136
137**Important**: Fill every field you can detect. Omit fields you can't determine — don't guess. Skills handle missing fields gracefully.
138
13913. **Create `.chalk/docs/product/PROFILE.md`**
140
141Summarize:
142- Product name, one-liner, primary users, core value prop
143- Problem: what pain this solves
144- Target Users: table (Persona, Job, How This Helps)
145- Core Jobs To Be Done: numbered list, each starts with a verb
146- Current Status: feature table (Feature, Status, Notes)
147
14814. **Create `.chalk/docs/engineering/PROFILE.md`** — Single comprehensive engineering doc covering architecture + tech stack + data flow:
149
150Include:
151- Architecture diagram (ASCII or Mermaid)
152- Execution contexts table (entry point, lifecycle, access)
153- Boot sequence (numbered steps)
154- Directory structure (annotated tree with purpose per directory)
155- Data flow (state management, API/IPC boundaries, storage)
156- Tech stack table (Package, Version, Category, Purpose) grouped by runtime vs dev/build
157- Key patterns (design patterns, error handling, testing approach)
158
15915. **Create `.chalk/docs/engineering/coding-style.md`**
160
161Include:
162- File & folder naming conventions with examples
163- Component/module structure with real code example from the codebase
164- Naming conventions (variables, functions, types, files)
165- Import ordering with real example
166- Export patterns (default vs named)
167- TypeScript patterns (strict mode, type vs interface)
168- Styling patterns (Tailwind, CSS approach)
169- Error handling patterns
170
17116. **Create `.chalk/docs/ai/PROFILE.md`** — Agent-facing quick reference:
172
173Include:
174- Project Identity: 1 paragraph
175- Where Things Live: table (What, Where, Notes)
176- Conventions to Follow: top 5-10 rules
177- Gotchas: numbered list of agent-surprising things
178- How to Add a Feature: step-by-step guide
179
18017. **Create `.chalk/docs/design/PROFILE.md`**
181
182Include:
183- Brand identity (name, visual tone)
184- Color palette: Primary, Neutral, Semantic tables (Name, Hex, Tailwind, Usage)
185- Typography (font families, size/weight scales)
186- Spacing & layout (common values, breakpoints)
187- Borders & shadows
188- Icons (library, usage patterns)
189- Component patterns (buttons, cards, common UI)
190
19118. **Copy brand assets** to `.chalk/docs/design/assets/` (files < 500KB, prefer SVG).
192
193### Phase 4 — Verify
194
19519. **Validate `chalk.json`** — Check that required fields are present and values make sense. Print warnings for missing optional fields.
19620. **List created files** — Print a tree of everything created under `.chalk/`.
19721. **Summarize** — Tell the user what was captured, what has gaps, and suggest running `/setup-docs` to enrich stubs with deeper analysis.
198
199## Doc Format Rules
200
201- No YAML frontmatter in docs (plain markdown)
202- First `# Heading` is the document title
203- `Last updated: YYYY-MM-DD (<brief note>)` immediately after the title
204- Use `## Heading` for sections
205- GFM features: tables, code blocks, checkboxes, Mermaid diagrams
206- Use real code examples from the repo, not generic placeholders
207- Be specific and concrete — hex codes not "brand green", actual file paths not "components folder"
208
209## Migration from v1
210
211If the project has the old docs structure (numbered files like `0_PRODUCT_PROFILE.md`, `1_architecture.md`, `3_techstack.md`):
212
2131. Merge `0_ENGINEERING_PROFILE.md` + `1_architecture.md` + `3_techstack.md` → `engineering/PROFILE.md`
2142. Rename `0_PRODUCT_PROFILE.md` → `product/PROFILE.md`
2153. Rename `0_AI_PROFILE.md` → `ai/PROFILE.md`
2164. Rename `0_design-system.md` → `design/PROFILE.md`
2175. Rename `2_coding-style.md` → `engineering/coding-style.md`
2186. Keep any extra docs as additional files in their vertical
2197. Expand `chalk.json` with new fields (project, dev, test, build, routes, sourceLayout)
2208. Delete old numbered files after confirming the merge
221
222Ask the user before performing migration.
223
224## Style Transfer Focus
225
226The goal is **fidelity**. An AI agent reading these docs should be able to:
227
2281. Write new code that looks like it belongs in the codebase (coding style)
2292. Place files in the right directories following the right patterns (architecture)
2303. Use the correct libraries and APIs (tech stack)
2314. Match the visual design exactly — right colors, right spacing, right typography (design system)
2325. Use the brand assets correctly (design assets)
233
234Prioritize **concrete examples over abstract rules**.