cairn-work 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,17 @@ export async function setupClaudeCode(workspacePath) {
32
32
  // Write skill to workspace
33
33
  writeFileSync(skillDest, skillContent);
34
34
  console.log(chalk.green('✓'), 'Cairn skill added to Claude Code workspace');
35
+
36
+ // Read planning template and replace placeholders
37
+ const planningTemplate = join(__dirname, '../../skills/agent-planning.template.md');
38
+ let planningContent = readFileSync(planningTemplate, 'utf-8');
39
+ planningContent = planningContent
40
+ .replace(/\{\{WORKSPACE_PATH\}\}/g, workspacePath)
41
+ .replace(/\{\{WORKSPACE_ROOT\}\}/g, workspaceRoot);
42
+
43
+ const planningDest = join(contextDir, 'cairn-planning.md');
44
+ writeFileSync(planningDest, planningContent);
45
+ console.log(chalk.green('✓'), 'Cairn planning guide added to Claude Code workspace');
35
46
 
36
47
  // Create instructions file
37
48
  const instructionsPath = join(contextDir, 'cairn-instructions.md');
@@ -41,7 +52,11 @@ This workspace uses Cairn for project management.
41
52
 
42
53
  **Workspace:** ${workspacePath}
43
54
 
44
- **Skill documentation:** Read \`cairn-skill.md\` in this directory for the complete workflow.
55
+ ## Agent Documentation
56
+
57
+ Read BOTH files in this directory:
58
+ - **cairn-skill.md** — Operations: status transitions, autonomy levels, blocker workflow, file format
59
+ - **cairn-planning.md** — Planning: how to create projects, break down tasks, write real content, examples
45
60
 
46
61
  **Key points:**
47
62
  - All project files are in markdown format at ${workspacePath}
@@ -49,8 +64,9 @@ This workspace uses Cairn for project management.
49
64
  - Follow the project → task hierarchy
50
65
  - Always update status before asking blocking questions
51
66
  - Log all work in the Work Log section
67
+ - When creating projects, fill in ALL sections with real content (never leave placeholder text)
52
68
 
53
- Refer to cairn-skill.md for detailed instructions on working with Cairn files.
69
+ Read both skill files before working with Cairn.
54
70
  `;
55
71
 
56
72
  writeFileSync(instructionsPath, instructions);
@@ -35,6 +35,17 @@ export async function setupClawdbot(workspacePath) {
35
35
  // Write skill file
36
36
  writeFileSync(skillDest, skillContent);
37
37
  console.log(chalk.green('✓'), 'Cairn skill added to Clawdbot');
38
+
39
+ // Read planning template and replace placeholders
40
+ const planningTemplate = join(__dirname, '../../skills/agent-planning.template.md');
41
+ let planningContent = readFileSync(planningTemplate, 'utf-8');
42
+ planningContent = planningContent
43
+ .replace(/\{\{WORKSPACE_PATH\}\}/g, workspacePath)
44
+ .replace(/\{\{WORKSPACE_ROOT\}\}/g, workspaceRoot);
45
+
46
+ const planningDest = join(clawdbotSkillsDir, 'PLANNING.md');
47
+ writeFileSync(planningDest, planningContent);
48
+ console.log(chalk.green('✓'), 'Cairn planning guide added to Clawdbot');
38
49
 
39
50
  // Create a config file with workspace path
40
51
  const configPath = join(clawdbotSkillsDir, 'config.json');
@@ -32,7 +32,7 @@ When working with project management tasks:
32
32
  3. Update status before asking for blocking information
33
33
  4. Log all work with timestamps
34
34
 
35
- See .cursor/cairn-skill.md for complete workflow documentation.
35
+ See .cursor/cairn-skill.md for workflow documentation and .cursor/cairn-planning.md for project planning guidance.
36
36
  `;
37
37
 
38
38
  if (!existing.includes('Cairn Project Management')) {
@@ -60,6 +60,17 @@ See .cursor/cairn-skill.md for complete workflow documentation.
60
60
  const skillDest = join(cursorDir, 'cairn-skill.md');
61
61
  writeFileSync(skillDest, skillContent);
62
62
  console.log(chalk.green('✓'), 'Cairn skill added to .cursor/');
63
+
64
+ // Read planning template and replace placeholders
65
+ const planningTemplate = join(__dirname, '../../skills/agent-planning.template.md');
66
+ let planningContent = readFileSync(planningTemplate, 'utf-8');
67
+ planningContent = planningContent
68
+ .replace(/\{\{WORKSPACE_PATH\}\}/g, workspacePath)
69
+ .replace(/\{\{WORKSPACE_ROOT\}\}/g, workspaceRoot);
70
+
71
+ const planningDest = join(cursorDir, 'cairn-planning.md');
72
+ writeFileSync(planningDest, planningContent);
73
+ console.log(chalk.green('✓'), 'Cairn planning guide added to .cursor/');
63
74
 
64
75
  // Create config
65
76
  const configPath = join(cursorDir, 'cairn-config.json');
@@ -20,7 +20,8 @@ export async function setupGeneric(workspacePath) {
20
20
  */
21
21
  export function getGenericInstructions(workspacePath) {
22
22
  const skillPath = join(dirname(__dirname), '../skills/agent-skill.template.md');
23
-
23
+ const planningPath = join(dirname(__dirname), '../skills/agent-planning.template.md');
24
+
24
25
  let output = '\n';
25
26
  output += chalk.bold('Manual Setup Required') + '\n\n';
26
27
  output += 'Your Cairn workspace: ' + chalk.cyan(workspacePath) + '\n\n';
@@ -29,12 +30,13 @@ export function getGenericInstructions(workspacePath) {
29
30
  output += ' ' + chalk.dim('─────────────────────────────────────') + '\n';
30
31
  output += ' ' + chalk.yellow('I\'m using Cairn for project management.') + '\n';
31
32
  output += ' ' + chalk.yellow('My workspace is at: ' + workspacePath) + '\n';
32
- output += ' ' + chalk.yellow('Please read the agent skill documentation at:') + '\n';
33
- output += ' ' + chalk.yellow(skillPath) + '\n';
33
+ output += ' ' + chalk.yellow('Please read the agent documentation at:') + '\n';
34
+ output += ' ' + chalk.yellow(' Skill: ' + skillPath) + '\n';
35
+ output += ' ' + chalk.yellow(' Planning: ' + planningPath) + '\n';
34
36
  output += ' ' + chalk.dim('─────────────────────────────────────') + '\n\n';
35
- output += '2. ' + chalk.bold('Or copy the skill to your agent\'s context:') + '\n';
36
- output += ' - For AI coding assistants: Add ' + chalk.cyan(skillPath) + ' to your workspace\n';
37
- output += ' - For chat agents: Share the skill content in your first message\n\n';
37
+ output += '2. ' + chalk.bold('Or copy both files to your agent\'s context:') + '\n';
38
+ output += ' - ' + chalk.cyan(skillPath) + ' (operations & workflow)\n';
39
+ output += ' - ' + chalk.cyan(planningPath) + ' (project planning & examples)\n\n';
38
40
  output += '3. ' + chalk.bold('Test it:') + '\n';
39
41
  output += ' Ask your agent:\n';
40
42
  output += ' ' + chalk.yellow('"Help me create a project called Launch My App"') + '\n\n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cairn-work",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "AI-native project management - work with AI agents using markdown files",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,661 @@
1
+ # Cairn: Project Planning Guide
2
+
3
+ This document teaches you how to plan and flesh out projects. The companion skill file (`agent-skill.template.md`) covers day-to-day operations. This file covers how to CREATE meaningful work from a simple user request.
4
+
5
+ ## Core Principle
6
+
7
+ When a user says "Create a project called X", they expect you to act as a project manager. Don't create skeleton files with placeholder text. Think through what the project actually requires, break it into concrete tasks, and fill in real content throughout.
8
+
9
+ ## Project Creation Workflow
10
+
11
+ When a user asks you to create a project:
12
+
13
+ ### 1. Understand the Scope
14
+
15
+ Before running any `cairn create` commands, think about:
16
+ - What does this project actually involve?
17
+ - What are the major phases or workstreams?
18
+ - What are the dependencies between pieces of work?
19
+ - What does "done" look like?
20
+
21
+ If the request is ambiguous, ask clarifying questions BEFORE creating anything. Examples:
22
+ - "What's the target audience for this website?"
23
+ - "Do you need authentication/user accounts?"
24
+ - "Any specific tech stack preference?"
25
+ - "What's the timeline?"
26
+
27
+ ### 2. Create the Project
28
+
29
+ ```bash
30
+ cairn create project "Project Name" \
31
+ --description "One-line summary of what we're building and why" \
32
+ --due YYYY-MM-DD
33
+ ```
34
+
35
+ ### 3. Flesh Out the Charter
36
+
37
+ After the CLI creates `charter.md`, edit it to replace ALL placeholder text:
38
+
39
+ **"Why This Matters"** — Write 2-4 sentences explaining the business or personal motivation. What problem does this solve? Why now?
40
+
41
+ **"Success Criteria"** — Write 3-6 specific, measurable outcomes. Each should be a checkbox item that can be objectively verified as done or not done. Avoid vague criteria.
42
+
43
+ Bad:
44
+ ```markdown
45
+ - [ ] Website looks good
46
+ - [ ] Everything works
47
+ ```
48
+
49
+ Good:
50
+ ```markdown
51
+ - [ ] Homepage loads in under 2 seconds on mobile
52
+ - [ ] Contact form submissions deliver to owner's email within 1 minute
53
+ - [ ] Site scores 90+ on Lighthouse accessibility audit
54
+ - [ ] All pages are responsive from 320px to 1440px viewport width
55
+ ```
56
+
57
+ **"Context"** — Add relevant constraints, technical decisions, dependencies on external systems, or anything the agent working on tasks will need to know.
58
+
59
+ ### 4. Break Down into Tasks
60
+
61
+ Create 3-8 tasks per project. Each task should be:
62
+ - **Atomic**: Completable in one work session
63
+ - **Specific**: Clear what "done" means without reading other tasks
64
+ - **Ordered**: Set the first task to `status: active`, the rest to `pending`
65
+
66
+ Think in phases:
67
+ 1. **Setup/Foundation** — Environment, tooling, project scaffolding
68
+ 2. **Core Features** — The main deliverables
69
+ 3. **Polish/Integration** — Testing, refinement, deployment
70
+
71
+ ```bash
72
+ cairn create task "Task Name" \
73
+ --project project-slug \
74
+ --description "What this accomplishes in one sentence" \
75
+ --status active \
76
+ --due YYYY-MM-DD
77
+ ```
78
+
79
+ Then edit each task file to fill in the `## Objective` section with 2-4 sentences describing what needs to happen and any relevant details.
80
+
81
+ ### 5. Review the Full Plan
82
+
83
+ After creating everything, summarize what you created for the user:
84
+ - Project name and description
85
+ - Number of tasks and their sequence
86
+ - Key decisions you made
87
+ - Anything you need input on
88
+
89
+ ---
90
+
91
+ ## Writing Good Content
92
+
93
+ ### Charter: "Why This Matters"
94
+
95
+ This section answers: Why should someone spend time on this?
96
+
97
+ Template pattern:
98
+ ```
99
+ [Who] needs [what] because [why]. Currently [current state/problem].
100
+ This project will [outcome], enabling [benefit].
101
+ ```
102
+
103
+ Example:
104
+ ```markdown
105
+ ## Why This Matters
106
+
107
+ Our current landing page is a static HTML file from 2023 that doesn't reflect
108
+ our updated brand or product offerings. Potential customers are bouncing within
109
+ 3 seconds because the page loads slowly and isn't mobile-friendly.
110
+
111
+ This project rebuilds the marketing site with modern tooling, responsive design,
112
+ and a contact form so we can actually capture leads. The site needs to feel
113
+ professional and load fast on any device.
114
+ ```
115
+
116
+ ### Charter: "Success Criteria"
117
+
118
+ Each criterion should pass the "someone else could verify this" test. Use numbers, specific behaviors, or concrete deliverables.
119
+
120
+ Example:
121
+ ```markdown
122
+ ## Success Criteria
123
+
124
+ - [ ] Site is deployed and accessible at the production domain
125
+ - [ ] Homepage, About, and Contact pages are complete with real content
126
+ - [ ] Contact form validates input and sends submissions to team inbox
127
+ - [ ] Page load time is under 2s on 3G mobile (measured by Lighthouse)
128
+ - [ ] Design matches approved mockups within reasonable fidelity
129
+ - [ ] Site renders correctly on Chrome, Safari, and Firefox (latest versions)
130
+ ```
131
+
132
+ ### Charter: "Context"
133
+
134
+ Include anything a task executor needs to know that isn't in the tasks themselves:
135
+ - Tech stack decisions and rationale
136
+ - External dependencies (APIs, services, accounts needed)
137
+ - Design references or brand guidelines
138
+ - Constraints (budget, timeline, compliance requirements)
139
+ - Links to related resources
140
+
141
+ Example:
142
+ ```markdown
143
+ ## Context
144
+
145
+ Tech stack: Next.js 14 with App Router, Tailwind CSS, deployed on Vercel.
146
+ Chosen because the team already has Vercel infrastructure and Next.js experience.
147
+
148
+ Design: No formal mockups. Use clean, minimal aesthetic. Brand colors are
149
+ #1a1a2e (dark navy) and #e94560 (accent red). Logo SVG is in the shared
150
+ Google Drive under /Brand Assets.
151
+
152
+ External: Contact form will use Resend for transactional email. API key
153
+ is in the team's 1Password vault under "Resend Production".
154
+
155
+ Constraint: Must be live before the March 15 trade show.
156
+ ```
157
+
158
+ ### Task: "Objective"
159
+
160
+ Each task's objective should answer: What exactly needs to happen, and what does done look like?
161
+
162
+ Bad:
163
+ ```markdown
164
+ ## Objective
165
+
166
+ Set up the project.
167
+ ```
168
+
169
+ Good:
170
+ ```markdown
171
+ ## Objective
172
+
173
+ Initialize a new Next.js 14 project with TypeScript and Tailwind CSS.
174
+ Configure the project structure with app router, set up ESLint and Prettier,
175
+ and create the base layout component with the site header and footer.
176
+ The dev server should start without errors and the base layout should
177
+ render on all routes.
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Task Sequencing and Dependencies
183
+
184
+ When breaking down a project, think about what blocks what:
185
+
186
+ 1. **Foundation tasks come first** — These set up the project, install tools, create the base structure. Set the first one to `status: active`.
187
+
188
+ 2. **Core tasks depend on foundation** — These build the actual features. Set to `status: pending` until foundation tasks are done.
189
+
190
+ 3. **Integration/polish tasks come last** — Testing, deployment, final review. These depend on core work being complete.
191
+
192
+ You don't need to encode dependencies in the files (Cairn doesn't have a dependency field). Instead, use task ordering and the `## Objective` section to note prerequisites:
193
+
194
+ ```markdown
195
+ ## Objective
196
+
197
+ Configure Vercel deployment with automatic deploys from the main branch.
198
+ Set up preview deployments for pull requests. Requires the Next.js project
199
+ to be initialized and pushed to GitHub (see: set-up-nextjs-project task).
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Scoping Projects by Size
205
+
206
+ ### Small Project (2-4 tasks)
207
+ Single-feature work. Example: "Add a blog to the website"
208
+ - Set up blog content structure (MDX/markdown)
209
+ - Build blog listing page and post template
210
+ - Add RSS feed and SEO metadata
211
+
212
+ ### Medium Project (4-7 tasks)
213
+ Multi-feature or full build. Example: "Build a marketing website"
214
+ - Initialize project and configure tooling
215
+ - Build homepage with hero, features, and CTA sections
216
+ - Build about page
217
+ - Build contact page with form and validation
218
+ - Set up deployment pipeline
219
+ - Cross-browser testing and performance optimization
220
+
221
+ ### Large Project (7-12 tasks)
222
+ Complex system with multiple workstreams. Example: "Build a SaaS dashboard"
223
+ - Initialize project with auth framework
224
+ - Build authentication flow (signup, login, password reset)
225
+ - Design and build dashboard layout and navigation
226
+ - Build data visualization components
227
+ - Build settings and profile management
228
+ - Implement API integration layer
229
+ - Build notification system
230
+ - Set up CI/CD pipeline
231
+ - Write integration tests for critical paths
232
+ - Performance audit and optimization
233
+ - Pre-launch security review
234
+
235
+ If a project needs more than 12 tasks, consider splitting it into multiple projects.
236
+
237
+ ---
238
+
239
+ ## Handling Ambiguity
240
+
241
+ When the user's request is vague, you have two options:
242
+
243
+ ### Option A: Ask First
244
+ If the ambiguity would fundamentally change the project scope, ask:
245
+ ```
246
+ Before I create this project, a few questions:
247
+ 1. Do you need user authentication, or is this a static site?
248
+ 2. Any specific pages beyond a homepage?
249
+ 3. Do you have a design or should I plan for a minimal/clean approach?
250
+ ```
251
+
252
+ ### Option B: Make Reasonable Defaults, State Your Assumptions
253
+ If the ambiguity is about implementation details, make sensible choices and document them in the charter's Context section:
254
+ ```markdown
255
+ ## Context
256
+
257
+ Assumptions (let me know if any of these should change):
258
+ - Static marketing site, no auth or database needed
259
+ - Three pages: Home, About, Contact
260
+ - Modern stack: Next.js + Tailwind, deployed on Vercel
261
+ - Mobile-first responsive design
262
+ - Contact form sends to owner's email via Resend or similar
263
+ ```
264
+
265
+ Prefer Option B for experienced users who gave you a brief prompt intentionally. Prefer Option A when the scope is genuinely unclear or the cost of getting it wrong is high.
266
+
267
+ ---
268
+
269
+ ## Complete Example: "Build a Marketing Website"
270
+
271
+ Here's what a fully fleshed-out project looks like after an agent processes "Create a project for building our marketing website":
272
+
273
+ ### charter.md
274
+ ```yaml
275
+ ---
276
+ title: Build Marketing Website
277
+ description: Design and develop a responsive marketing website with homepage, about, contact, and blog
278
+ status: active
279
+ priority: 2
280
+ created: 2026-01-30
281
+ due: 2026-03-01
282
+ owner: you
283
+ default_autonomy: draft
284
+ budget: 100
285
+ spent: 0
286
+ ---
287
+ ```
288
+ ```markdown
289
+ ## Why This Matters
290
+
291
+ We need a professional web presence to support upcoming product launches and
292
+ capture leads from potential customers. The current site is outdated and doesn't
293
+ reflect our brand or product capabilities. A modern, fast, mobile-friendly site
294
+ is table stakes for credibility.
295
+
296
+ ## Success Criteria
297
+
298
+ - [ ] Site is deployed and live at production domain
299
+ - [ ] Homepage clearly communicates value proposition with hero, features, and CTA
300
+ - [ ] About page tells our story with team/company information
301
+ - [ ] Contact form captures leads and delivers to team inbox within 1 minute
302
+ - [ ] Blog supports markdown-authored posts with proper SEO metadata
303
+ - [ ] All pages score 90+ on Lighthouse performance and accessibility
304
+ - [ ] Fully responsive from 320px to 1440px viewport width
305
+
306
+ ## Context
307
+
308
+ Tech stack: Next.js 14 (App Router), TypeScript, Tailwind CSS, deployed on Vercel.
309
+
310
+ Assumptions:
311
+ - Static site with no authentication or database
312
+ - Contact form uses a transactional email service (Resend or similar)
313
+ - Blog content authored in MDX files within the repo
314
+ - Clean, minimal design — no existing mockups or brand guide provided
315
+
316
+ ## Work Log
317
+
318
+ ### 2026-01-30 - Created
319
+ [agent] Project created with 6 tasks covering setup through deployment.
320
+ ```
321
+
322
+ ### tasks/initialize-project.md
323
+ ```yaml
324
+ ---
325
+ title: Initialize project and tooling
326
+ description: Scaffold Next.js project with TypeScript, Tailwind, and dev tooling
327
+ assignee: you
328
+ status: active
329
+ created: 2026-01-30
330
+ due: 2026-02-03
331
+ autonomy: draft
332
+ spend: 0
333
+ artifacts: []
334
+ ---
335
+ ```
336
+ ```markdown
337
+ ## Objective
338
+
339
+ Create a new Next.js 14 project using the App Router with TypeScript enabled.
340
+ Install and configure Tailwind CSS for styling. Set up ESLint and Prettier with
341
+ sensible defaults. Create the base layout component with a responsive site
342
+ header (logo + nav links) and footer. Initialize a git repo and push to GitHub.
343
+ The dev server should start cleanly and the base layout should render on all routes.
344
+
345
+ ## Work Log
346
+
347
+ ### 2026-01-30 - Created
348
+ [agent] Task created via Cairn CLI.
349
+ ```
350
+
351
+ ### tasks/build-homepage.md
352
+ ```yaml
353
+ ---
354
+ title: Build homepage
355
+ description: Create responsive homepage with hero section, features grid, and call-to-action
356
+ assignee: you
357
+ status: pending
358
+ created: 2026-01-30
359
+ due: 2026-02-08
360
+ autonomy: draft
361
+ spend: 0
362
+ artifacts: []
363
+ ---
364
+ ```
365
+ ```markdown
366
+ ## Objective
367
+
368
+ Build the homepage with three sections: (1) A hero section with headline,
369
+ subheadline, and primary CTA button. (2) A features grid showcasing 3-4 key
370
+ value propositions with icons and short descriptions. (3) A bottom CTA section
371
+ encouraging visitors to get in touch. All sections should be responsive and
372
+ use consistent spacing and typography from the Tailwind config.
373
+
374
+ ## Work Log
375
+
376
+ ### 2026-01-30 - Created
377
+ [agent] Task created via Cairn CLI.
378
+ ```
379
+
380
+ ### tasks/build-about-page.md
381
+ ```yaml
382
+ ---
383
+ title: Build about page
384
+ description: Create about page with company story and team information
385
+ assignee: you
386
+ status: pending
387
+ created: 2026-01-30
388
+ due: 2026-02-10
389
+ autonomy: draft
390
+ spend: 0
391
+ artifacts: []
392
+ ---
393
+ ```
394
+ ```markdown
395
+ ## Objective
396
+
397
+ Create an About page with company background, mission statement, and team
398
+ section. The team section should support displaying name, role, photo, and
399
+ short bio for each team member. Content will be placeholder until the owner
400
+ provides real copy, but the layout and components should be production-ready.
401
+
402
+ ## Work Log
403
+
404
+ ### 2026-01-30 - Created
405
+ [agent] Task created via Cairn CLI.
406
+ ```
407
+
408
+ ### tasks/build-contact-page.md
409
+ ```yaml
410
+ ---
411
+ title: Build contact page with form
412
+ description: Create contact page with validated form that sends submissions via email
413
+ assignee: you
414
+ status: pending
415
+ created: 2026-01-30
416
+ due: 2026-02-13
417
+ autonomy: draft
418
+ spend: 0
419
+ artifacts: []
420
+ ---
421
+ ```
422
+ ```markdown
423
+ ## Objective
424
+
425
+ Build a contact page with a form collecting name, email, and message. Add
426
+ client-side validation (required fields, email format). Implement a server
427
+ action or API route to process submissions and send them to the team's
428
+ email via Resend (or similar transactional email service). Show success/error
429
+ states after submission. Include a rate limiter or honeypot field to reduce spam.
430
+
431
+ ## Work Log
432
+
433
+ ### 2026-01-30 - Created
434
+ [agent] Task created via Cairn CLI.
435
+ ```
436
+
437
+ ### tasks/add-blog.md
438
+ ```yaml
439
+ ---
440
+ title: Add blog with MDX support
441
+ description: Set up blog with MDX content, listing page, and individual post pages
442
+ assignee: you
443
+ status: pending
444
+ created: 2026-01-30
445
+ due: 2026-02-17
446
+ autonomy: draft
447
+ spend: 0
448
+ artifacts: []
449
+ ---
450
+ ```
451
+ ```markdown
452
+ ## Objective
453
+
454
+ Add blog functionality using MDX files stored in the repo. Create a blog
455
+ listing page showing posts sorted by date with title, excerpt, and publish
456
+ date. Create a blog post template page with proper typography, code syntax
457
+ highlighting, and SEO metadata (Open Graph tags, meta description). Add at
458
+ least one sample post to verify the pipeline works end-to-end. Set up an
459
+ RSS feed at /feed.xml.
460
+
461
+ ## Work Log
462
+
463
+ ### 2026-01-30 - Created
464
+ [agent] Task created via Cairn CLI.
465
+ ```
466
+
467
+ ### tasks/deploy-and-optimize.md
468
+ ```yaml
469
+ ---
470
+ title: Deploy and optimize performance
471
+ description: Configure Vercel deployment and optimize for Lighthouse scores
472
+ assignee: you
473
+ status: pending
474
+ created: 2026-01-30
475
+ due: 2026-02-21
476
+ autonomy: draft
477
+ spend: 0
478
+ artifacts: []
479
+ ---
480
+ ```
481
+ ```markdown
482
+ ## Objective
483
+
484
+ Connect the GitHub repo to Vercel for automatic deployments on push to main.
485
+ Configure preview deployments for pull requests. Run Lighthouse audits on all
486
+ pages and optimize until performance and accessibility scores are 90+.
487
+ Address any issues: image optimization, font loading, bundle size, semantic
488
+ HTML, ARIA labels, color contrast. Verify the site renders correctly on
489
+ Chrome, Safari, and Firefox latest versions.
490
+
491
+ ## Work Log
492
+
493
+ ### 2026-01-30 - Created
494
+ [agent] Task created via Cairn CLI.
495
+ ```
496
+
497
+ ---
498
+
499
+ ## Complete Example: Small Project — "Add Dark Mode"
500
+
501
+ ### charter.md
502
+ ```yaml
503
+ ---
504
+ title: Add Dark Mode
505
+ description: Implement system-aware dark mode with manual toggle across the site
506
+ status: active
507
+ priority: 2
508
+ created: 2026-01-30
509
+ due: 2026-02-10
510
+ owner: you
511
+ default_autonomy: draft
512
+ budget: 50
513
+ spent: 0
514
+ ---
515
+ ```
516
+ ```markdown
517
+ ## Why This Matters
518
+
519
+ Users have requested dark mode support, and the site currently forces a bright
520
+ white theme that's uncomfortable for nighttime browsing. Supporting dark mode
521
+ also signals that we care about user preferences and accessibility.
522
+
523
+ ## Success Criteria
524
+
525
+ - [ ] Site respects system color scheme preference by default
526
+ - [ ] Manual toggle persists choice across sessions (localStorage)
527
+ - [ ] All pages and components render correctly in both themes
528
+ - [ ] No flash of wrong theme on page load
529
+ - [ ] Toggle is accessible via keyboard and screen readers
530
+
531
+ ## Context
532
+
533
+ The site uses Tailwind CSS, which has built-in dark mode support via the
534
+ `dark:` variant. Use the `class` strategy (not `media`) so we can support
535
+ both system preference and manual override. Store preference in localStorage.
536
+ Use `next-themes` or a lightweight custom hook.
537
+
538
+ ## Work Log
539
+
540
+ ### 2026-01-30 - Created
541
+ [agent] Project created with 3 tasks.
542
+ ```
543
+
544
+ ### tasks/implement-theme-system.md
545
+ ```yaml
546
+ ---
547
+ title: Implement theme system
548
+ description: Add dark mode infrastructure with Tailwind class strategy and theme provider
549
+ assignee: you
550
+ status: active
551
+ created: 2026-01-30
552
+ due: 2026-02-04
553
+ autonomy: draft
554
+ spend: 0
555
+ artifacts: []
556
+ ---
557
+ ```
558
+ ```markdown
559
+ ## Objective
560
+
561
+ Configure Tailwind for class-based dark mode. Create or install a theme
562
+ provider component that handles system preference detection, manual toggle
563
+ state, and localStorage persistence. Ensure no flash of unstyled/wrong
564
+ theme on initial page load (use a blocking script or cookie approach).
565
+ Add a theme toggle button component to the site header.
566
+
567
+ ## Work Log
568
+
569
+ ### 2026-01-30 - Created
570
+ [agent] Task created via Cairn CLI.
571
+ ```
572
+
573
+ ### tasks/update-all-components.md
574
+ ```yaml
575
+ ---
576
+ title: Update components for dark mode
577
+ description: Add dark variants to all existing components and pages
578
+ assignee: you
579
+ status: pending
580
+ created: 2026-01-30
581
+ due: 2026-02-07
582
+ autonomy: draft
583
+ spend: 0
584
+ artifacts: []
585
+ ---
586
+ ```
587
+ ```markdown
588
+ ## Objective
589
+
590
+ Audit every component and page for dark mode support. Add `dark:` Tailwind
591
+ variants for backgrounds, text colors, borders, and shadows. Define a
592
+ consistent dark palette (not just inverting colors — choose intentional
593
+ dark surfaces and muted accents). Test each page visually in both modes.
594
+ Pay special attention to images, code blocks, and form inputs which
595
+ often need specific dark mode treatment.
596
+
597
+ ## Work Log
598
+
599
+ ### 2026-01-30 - Created
600
+ [agent] Task created via Cairn CLI.
601
+ ```
602
+
603
+ ### tasks/test-and-polish.md
604
+ ```yaml
605
+ ---
606
+ title: Test and polish dark mode
607
+ description: Cross-browser testing, transition animations, and edge case fixes
608
+ assignee: you
609
+ status: pending
610
+ created: 2026-01-30
611
+ due: 2026-02-10
612
+ autonomy: draft
613
+ spend: 0
614
+ artifacts: []
615
+ ---
616
+ ```
617
+ ```markdown
618
+ ## Objective
619
+
620
+ Test dark mode across Chrome, Safari, and Firefox. Verify the toggle works
621
+ with keyboard navigation and screen readers. Add a smooth CSS transition
622
+ when switching themes (opacity or color transition, ~200ms). Fix any edge
623
+ cases: embedded content, third-party widgets, images with transparency
624
+ that look wrong on dark backgrounds. Run Lighthouse accessibility audit
625
+ in both modes.
626
+
627
+ ## Work Log
628
+
629
+ ### 2026-01-30 - Created
630
+ [agent] Task created via Cairn CLI.
631
+ ```
632
+
633
+ ---
634
+
635
+ ## Quick Reference: What to Fill In
636
+
637
+ | Section | What to Write | Never Write |
638
+ |---------|--------------|-------------|
639
+ | Charter: Why This Matters | Real motivation, problem statement, expected outcome | `[Describe why this project is important]` |
640
+ | Charter: Success Criteria | Specific, measurable, verifiable checkboxes | Vague criteria like "works well" or "looks good" |
641
+ | Charter: Context | Tech decisions, constraints, external deps, assumptions | Empty section or `[Add relevant background]` |
642
+ | Task: Objective | Concrete description of what to build/do and what done looks like | `[Describe what needs to be accomplished]` |
643
+ | Work Log | Timestamped entries with agent name | Empty or skipped |
644
+
645
+ ---
646
+
647
+ ## Anti-Patterns
648
+
649
+ 1. **Placeholder projects** — Creating a project with `[Your goals]` still in the charter. Always fill in real content.
650
+
651
+ 2. **Too many tasks** — More than 12 tasks means the project should be split. More than 8 is usually a sign of over-decomposition.
652
+
653
+ 3. **Too few tasks** — A single task for "build the whole thing" defeats the purpose. Minimum 2-3 tasks for any real project.
654
+
655
+ 4. **Vague tasks** — "Work on the frontend" is not a task. "Build the homepage with hero section, features grid, and CTA" is a task.
656
+
657
+ 5. **No sequencing** — All tasks set to `active` at once. Set only the first task (or first parallel set) to `active`, rest to `pending`.
658
+
659
+ 6. **Ignoring the charter** — Jumping straight to tasks without filling in Why, Success Criteria, and Context. The charter is how the human verifies you understood their intent.
660
+
661
+ 7. **Not stating assumptions** — If you made decisions (tech stack, scope, approach), document them in Context so the human can course-correct before you build the wrong thing.