@joshski/dust 0.1.3 → 0.1.5

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.
package/dist/dust.js CHANGED
@@ -284,20 +284,50 @@ var DEFAULT_GOAL = `# Project Goal
284
284
 
285
285
  Describe the high-level mission of this project.
286
286
  `;
287
+ function detectPackageRunner(cwd, fs) {
288
+ if (process.versions.bun) {
289
+ return "bunx";
290
+ }
291
+ if (fs.exists(`${cwd}/bun.lockb`)) {
292
+ return "bunx";
293
+ }
294
+ if (fs.exists(`${cwd}/pnpm-lock.yaml`)) {
295
+ return "pnpx";
296
+ }
297
+ return "npx";
298
+ }
287
299
  async function init(ctx, fs, _args) {
288
300
  const dustPath = `${ctx.cwd}/.dust`;
301
+ const runner = detectPackageRunner(ctx.cwd, fs);
302
+ const agentInstruction = `Always immediately run \`${runner} dust agent\` when you start working in this repository.`;
289
303
  if (fs.exists(dustPath)) {
290
- ctx.stderr("Error: .dust directory already exists");
291
- return { exitCode: 1 };
292
- }
293
- await fs.mkdir(dustPath, { recursive: true });
294
- for (const dir of DUST_DIRECTORIES) {
295
- await fs.mkdir(`${dustPath}/${dir}`, { recursive: true });
304
+ ctx.stdout("Note: .dust directory already exists, skipping creation");
305
+ } else {
306
+ await fs.mkdir(dustPath, { recursive: true });
307
+ for (const dir of DUST_DIRECTORIES) {
308
+ await fs.mkdir(`${dustPath}/${dir}`, { recursive: true });
309
+ }
310
+ await fs.writeFile(`${dustPath}/goals/project-goal.md`, DEFAULT_GOAL);
311
+ ctx.stdout("Initialized Dust repository in .dust/");
312
+ ctx.stdout(`Created directories: ${DUST_DIRECTORIES.join(", ")}`);
313
+ ctx.stdout("Created initial goal: .dust/goals/project-goal.md");
314
+ }
315
+ const claudeMdPath = `${ctx.cwd}/CLAUDE.md`;
316
+ if (fs.exists(claudeMdPath)) {
317
+ ctx.stdout(`Warning: CLAUDE.md already exists. Consider adding: "${agentInstruction}"`);
318
+ } else {
319
+ const claudeContent = loadTemplate("claude-md", { runner });
320
+ await fs.writeFile(claudeMdPath, claudeContent);
321
+ ctx.stdout("Created CLAUDE.md with agent instructions");
322
+ }
323
+ const agentsMdPath = `${ctx.cwd}/AGENTS.md`;
324
+ if (fs.exists(agentsMdPath)) {
325
+ ctx.stdout(`Warning: AGENTS.md already exists. Consider adding: "${agentInstruction}"`);
326
+ } else {
327
+ const agentsContent = loadTemplate("agents-md", { runner });
328
+ await fs.writeFile(agentsMdPath, agentsContent);
329
+ ctx.stdout("Created AGENTS.md with agent instructions");
296
330
  }
297
- await fs.writeFile(`${dustPath}/goals/project-goal.md`, DEFAULT_GOAL);
298
- ctx.stdout("Initialized Dust repository in .dust/");
299
- ctx.stdout(`Created directories: ${DUST_DIRECTORIES.join(", ")}`);
300
- ctx.stdout("Created initial goal: .dust/goals/project-goal.md");
301
331
  return { exitCode: 0 };
302
332
  }
303
333
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "A lightweight planning system for human-AI collaboration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
- "bin"
11
+ "bin",
12
+ "templates"
12
13
  ],
13
14
  "repository": {
14
15
  "type": "git",
@@ -23,7 +24,7 @@
23
24
  "author": "joshski",
24
25
  "license": "MIT",
25
26
  "scripts": {
26
- "build": "bun build lib/cli/entry.ts --target node --outfile dist/dust.js && printf '%s\\n%s' '#!/usr/bin/env node' \"$(cat dist/dust.js)\" > dist/dust.js",
27
+ "build": "bun build lib/cli/entry.ts --target node --outfile dist/dust.js && printf '%s\\n%s' '#!/usr/bin/env node' \"$(cat dist/dust.js)\" > dist/dust.js && cp -r lib/templates templates",
27
28
  "test": "vitest run",
28
29
  "test:coverage": "vitest run --coverage"
29
30
  },
@@ -0,0 +1,9 @@
1
+ ## Understanding Goals
2
+
3
+ **List goals:** `{{bin}} list goals`
4
+
5
+ Goals live in `.dust/goals/` as markdown files. They define the project's guiding principles and priorities.
6
+
7
+ Goals are linked from tasks to show which principles each task supports. When working on a task, you can read its linked goals for context on why the work matters.
8
+
9
+ Goals are stable—they rarely change. Tasks come and go, but goals persist.
@@ -0,0 +1,11 @@
1
+ Hello Claude, welcome to dust!
2
+
3
+ Your goal today is to make ONE SMALL CHANGE and then commit and push your changes.
4
+
5
+ Based on what the user asked you to do, run the appropriate command:
6
+
7
+ - If the user mentioned "work" → run `{{bin}} agent work`
8
+ - If the user mentioned "task" or "tasks" → run `{{bin}} agent tasks`
9
+ - If the user mentioned "goal" or "goals" → run `{{bin}} agent goals`
10
+ - If the user mentioned "idea" or "ideas" → run `{{bin}} agent ideas`
11
+ - For anything else → run `{{bin}} agent help`
@@ -0,0 +1,23 @@
1
+ ## Dust Agent Guide
2
+
3
+ Dust is a lightweight planning system. The `.dust/` directory contains:
4
+
5
+ - **goals/** - Guiding principles (stable, rarely change)
6
+ - **ideas/** - Vague proposals (convert to tasks when ready)
7
+ - **tasks/** - Actionable work with definitions of done
8
+ - **facts/** - Documentation of current system state
9
+ - **hooks/** - Quality gate scripts
10
+
11
+ **Key commands:**
12
+ - `{{bin}} check` - Run quality gates (do this before and after work)
13
+ - `{{bin}} next` - Show tasks ready to work on
14
+ - `{{bin}} list [type]` - List artifacts (tasks, ideas, goals, facts)
15
+ - `{{bin}} validate` - Check .dust/ files for errors
16
+
17
+ **Workflow:** Pick a task, implement it, delete the task file, commit atomically.
18
+
19
+ For focused guidance, run:
20
+ - `{{bin}} agent work` - Work on the next task
21
+ - `{{bin}} agent tasks` - Task management
22
+ - `{{bin}} agent goals` - Understanding goals
23
+ - `{{bin}} agent ideas` - Working with ideas
@@ -0,0 +1,13 @@
1
+ ## Working with Ideas
2
+
3
+ **List ideas:** `{{bin}} list ideas`
4
+
5
+ Ideas live in `.dust/ideas/` as markdown files. They are intentionally vague proposals for future work.
6
+
7
+ **Converting an idea to tasks:**
8
+ 1. Read the idea file to understand the proposal
9
+ 2. Break it down into concrete, actionable tasks
10
+ 3. Create task files in `.dust/tasks/` with clear definitions of done
11
+ 4. Delete the idea file once it's fully captured in tasks
12
+
13
+ Ideas are cheap to create and easy to discard. Not every idea becomes a task.
@@ -0,0 +1,15 @@
1
+ ## Task Management
2
+
3
+ **List tasks:** `{{bin}} list tasks`
4
+ **Find ready tasks:** `{{bin}} next`
5
+
6
+ Tasks live in `.dust/tasks/` as markdown files. Each task has:
7
+ - `## Goals` - Links to goals this task supports
8
+ - `## Blocked by` - Tasks that must complete first
9
+ - `## Definition of done` - Checklist of completion criteria
10
+
11
+ A task is ready when "Blocked by" is empty or says "(none)".
12
+
13
+ **Creating tasks:** Write a new markdown file in `.dust/tasks/` following the format above.
14
+
15
+ **Completing tasks:** Delete the task file in your commit after implementation.
@@ -0,0 +1,16 @@
1
+ ## Work on the Next Task
2
+
3
+ Follow these steps:
4
+
5
+ 1. Run `{{bin}} check` to verify the project is in a good state
6
+ 2. Run `{{bin}} next` to see available tasks
7
+ 3. Pick ONE task and read its file to understand the requirements
8
+ 4. Implement the task, checking off items in "Definition of done"
9
+ 5. Run `{{bin}} check` before committing
10
+ 6. Create a single atomic commit that includes:
11
+ - All implementation changes
12
+ - Deletion of the completed task file
13
+ - Updates to any facts that changed
14
+ - Deletion of any ideas that were fully realized
15
+
16
+ Keep your change small and focused. One task, one commit.
@@ -0,0 +1,5 @@
1
+ # Agent Instructions
2
+
3
+ This project uses [dust](https://github.com/joshski/dust) for planning and documentation.
4
+
5
+ Always immediately run `{{runner}} dust agent` when you start working in this repository.
@@ -0,0 +1,5 @@
1
+ # Claude Code Instructions
2
+
3
+ This project uses [dust](https://github.com/joshski/dust) for planning and documentation.
4
+
5
+ Always immediately run `{{runner}} dust agent` when you start working in this repository.
@@ -0,0 +1,82 @@
1
+ dust - A lightweight planning system for human-AI collaboration
2
+
3
+ Usage: {{bin}} <command> [options]
4
+
5
+ Commands:
6
+ init Initialize a new Dust repository
7
+ prompt <name> Output a prompt by name (e.g., {{bin}} prompt work)
8
+ validate Run validation checks on .dust/ files
9
+ list [type] List items (tasks, ideas, goals, facts)
10
+ next Show tasks ready to work on (not blocked)
11
+ check Run project-defined quality gate hook
12
+ agent [cmd] Agent-specific guidance (work, tasks, goals, ideas, help)
13
+ help Show this help message
14
+
15
+ Examples:
16
+ {{bin}} init
17
+ {{bin}} prompt work
18
+ {{bin}} validate
19
+ {{bin}} list tasks
20
+ {{bin}} list
21
+ {{bin}} next
22
+ {{bin}} check
23
+ {{bin}} agent work
24
+
25
+ ---
26
+
27
+ ## Agent Guide
28
+
29
+ This section provides comprehensive guidance for AI agents working with dust.
30
+
31
+ ### Directory Structure
32
+
33
+ The `.dust/` directory contains all planning artifacts:
34
+
35
+ - **`.dust/goals/`** - Mission statements and guiding principles
36
+ - **`.dust/ideas/`** - Future feature notes and proposals (intentionally vague)
37
+ - **`.dust/tasks/`** - Detailed work plans with dependencies and definitions of done
38
+ - **`.dust/facts/`** - Documentation of current system state and architecture
39
+ - **`.dust/hooks/`** - Executable scripts for quality gates (e.g., `check` hook)
40
+
41
+ All files are markdown with slug-style names (lowercase, hyphens, no spaces).
42
+
43
+ ### Working on Tasks
44
+
45
+ **Run `{{bin}} check` before starting work** to verify the project is in a good state before making changes.
46
+
47
+ Run `{{bin}} next` to find tasks ready to work on. Each task file contains:
48
+
49
+ - `## Goals` - Links to goals this task supports
50
+ - `## Blocked by` - Tasks that must complete first (empty or "(none)" means ready)
51
+ - `## Definition of done` - Criteria for completion
52
+
53
+ A task is **unblocked** when its "Blocked by" section is empty, says "(none)", or all referenced task files have been deleted.
54
+
55
+ ### Completing a Task
56
+
57
+ **Run `{{bin}} check` before committing** to ensure all quality gates pass.
58
+
59
+ When finishing a task, create a single atomic commit that includes:
60
+
61
+ 1. All implementation changes
62
+ 2. Deletion of the completed task file
63
+ 3. Updates to any facts that changed
64
+ 4. Deletion of any ideas that were fully realized
65
+ 5. Updates to any tasks that referenced this one in their "Blocked by" sections
66
+
67
+ ### Common Workflows
68
+
69
+ - **"Work on the next task"** - Run `{{bin}} next`, pick a task, implement it
70
+ - **"Work on task X"** - Implement `.dust/tasks/X.md` directly
71
+ - **"Convert idea Y to tasks"** - Break down `.dust/ideas/Y.md` into tasks
72
+ - **"Validate facts"** - Check `.dust/facts/` for accuracy against the codebase
73
+
74
+ ### Configuring Agent Files
75
+
76
+ Projects using dust should add a minimal pointer to their agent configuration files (CLAUDE.md, AGENTS.md, etc.):
77
+
78
+ ```markdown
79
+ This project uses [dust](https://github.com/joshski/dust) for planning and documentation.\nAlways run `dust help` when you start working in this repository.
80
+ ```
81
+
82
+ This approach keeps agent instructions minimal, ensures agents get current documentation, and reduces maintenance burden.