@joshski/dust 0.1.64 → 0.1.65

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.
@@ -0,0 +1,58 @@
1
+ language js
2
+
3
+ or {
4
+ `ctx` where {
5
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'ctx'. Use 'context' instead.")
6
+ },
7
+ `deps` where {
8
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'deps'. Use 'dependencies' instead.")
9
+ },
10
+ `fs` where {
11
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'fs'. Use 'fileSystem' instead.")
12
+ },
13
+ `args` where {
14
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'args'. Use 'arguments' instead.")
15
+ },
16
+ `req` where {
17
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'req'. Use 'request' instead.")
18
+ },
19
+ `res` where {
20
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'res'. Use 'response' instead.")
21
+ },
22
+ `err` where {
23
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'err'. Use 'error' instead.")
24
+ },
25
+ `cb` where {
26
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'cb'. Use 'callback' instead.")
27
+ },
28
+ `fn` where {
29
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'fn'. Use a descriptive name instead.")
30
+ },
31
+ `opts` where {
32
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'opts'. Use 'options' instead.")
33
+ },
34
+ `params` where {
35
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'params'. Use 'parameters' instead.")
36
+ },
37
+ `obj` where {
38
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'obj'. Use a descriptive name instead.")
39
+ },
40
+ `val` where {
41
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'val'. Use 'value' instead.")
42
+ },
43
+ `idx` where {
44
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'idx'. Use 'index' instead.")
45
+ },
46
+ `len` where {
47
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'len'. Use 'length' instead.")
48
+ },
49
+ `tmp` where {
50
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'tmp'. Use a descriptive name instead.")
51
+ },
52
+ `str` where {
53
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'str'. Use 'string' or a descriptive name instead.")
54
+ },
55
+ `num` where {
56
+ register_diagnostic(span=$match, message="Avoid abbreviated name 'num'. Use 'number' or a descriptive name instead.")
57
+ }
58
+ }
package/dist/artifacts.js CHANGED
@@ -353,10 +353,6 @@ ${renderResolvedQuestions(options.resolvedQuestions)}
353
353
 
354
354
  ${openingSentence}
355
355
  ${descriptionParagraph}${resolvedSection}
356
- ## Principles
357
-
358
- (none)
359
-
360
356
  ## Blocked By
361
357
 
362
358
  (none)
@@ -418,10 +414,6 @@ Research this idea thoroughly, then create one or more narrowly-scoped task file
418
414
 
419
415
  ${description}
420
416
 
421
- ## Principles
422
-
423
- (none)
424
-
425
417
  ## Blocked By
426
418
 
427
419
  (none)
@@ -438,28 +430,22 @@ ${description}
438
430
  const taskTitle = `${CAPTURE_IDEA_PREFIX}${title}`;
439
431
  const filename = titleToFilename(taskTitle);
440
432
  const filePath = `${dustPath}/tasks/${filename}`;
441
- const ideaFilename = titleToFilename(title);
442
- const ideaPath = `.dust/ideas/${ideaFilename}`;
443
433
  const content = `# ${taskTitle}
444
434
 
445
- Research this idea thoroughly, then create an idea file at \`${ideaPath}\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. If you add open questions, use \`## Open Questions\` with \`### Question?\` headings and one or more \`#### Option\` headings beneath each question, and only add questions that are meaningful decisions worth asking. Review \`.dust/principles/\` and \`.dust/facts/\` for relevant context.
435
+ Research this idea thoroughly, then create one or more idea files in \`.dust/ideas/\`. Read the codebase for relevant context, flesh out the description, and identify any ambiguity. Where aspects are unclear or could go multiple ways, add open questions to the idea file. If you add open questions, use \`## Open Questions\` with \`### Question?\` headings and one or more \`#### Option\` headings beneath each question, and only add questions that are meaningful decisions worth asking. Review \`.dust/principles/\` and \`.dust/facts/\` for relevant context.
446
436
 
447
437
  ## Idea Description
448
438
 
449
439
  ${description}
450
440
 
451
- ## Principles
452
-
453
- (none)
454
-
455
441
  ## Blocked By
456
442
 
457
443
  (none)
458
444
 
459
445
  ## Definition of Done
460
446
 
461
- - [ ] Idea file exists at ${ideaPath}
462
- - [ ] Idea file has an H1 title matching "${title}"
447
+ - [ ] One or more idea files are created in \`.dust/ideas/\`
448
+ - [ ] Each idea file has an H1 title matching its content
463
449
  - [ ] Idea includes relevant context from codebase exploration
464
450
  - [ ] Open questions are added for any ambiguous or underspecified aspects
465
451
  - [ ] Open questions follow the required heading format and focus on high-value decisions
package/dist/audits.js CHANGED
@@ -63,11 +63,50 @@ function dedent(strings, ...values) {
63
63
  }
64
64
 
65
65
  // lib/audits/stock-audits.ts
66
+ var ideasHint = "Review existing ideas in `./.dust/ideas/` to understand what has been proposed or considered historically, then create new idea files in `./.dust/ideas/` for any issues you identify, avoiding duplication.";
67
+ function componentReuse() {
68
+ return dedent`
69
+ # Component Reuse
70
+
71
+ Find repeated patterns and code that could be extracted into reusable components.
72
+
73
+ ${ideasHint}
74
+
75
+ ## Scope
76
+
77
+ Focus on these areas:
78
+
79
+ 1. **Repeated patterns** - Similar code blocks that appear multiple times
80
+ 2. **Copy-pasted code** - Near-identical logic across different files
81
+ 3. **Parallel structures** - Code that handles similar cases with minor variations
82
+ 4. **Extraction opportunities** - Logic that could be unified without forcing unrelated concepts together
83
+
84
+ ## Principles
85
+
86
+ - [Reasonably DRY](../principles/reasonably-dry.md)
87
+ - [Decoupled Code](../principles/decoupled-code.md)
88
+ - [Maintainable Codebase](../principles/maintainable-codebase.md)
89
+
90
+ ## Blocked By
91
+
92
+ (none)
93
+
94
+ ## Definition of Done
95
+
96
+ - [ ] Searched for repeated patterns across the codebase
97
+ - [ ] Identified copy-pasted or near-duplicate code
98
+ - [ ] Evaluated each case for whether extraction would be beneficial
99
+ - [ ] Considered whether similar code serves different purposes that may evolve independently
100
+ - [ ] Proposed ideas only for extractions where duplication is truly about the same concept
101
+ `;
102
+ }
66
103
  function agentDeveloperExperience() {
67
104
  return dedent`
68
105
  # Agent Developer Experience
69
106
 
70
- Review the codebase to ensure agents have everything they need to operate effectively. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
107
+ Review the codebase to ensure agents have everything they need to operate effectively.
108
+
109
+ ${ideasHint}
71
110
 
72
111
  ## Scope
73
112
 
@@ -100,7 +139,9 @@ function deadCode() {
100
139
  return dedent`
101
140
  # Dead Code
102
141
 
103
- Find and remove unused code to improve maintainability and reduce bundle size. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
142
+ Find and remove unused code to improve maintainability and reduce bundle size.
143
+
144
+ ${ideasHint}
104
145
 
105
146
  ## Scope
106
147
 
@@ -135,7 +176,9 @@ function factsVerification() {
135
176
  return dedent`
136
177
  # Facts Verification
137
178
 
138
- Review \`.dust/facts/\` to ensure documented facts match current reality. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
179
+ Review \`.dust/facts/\` to ensure documented facts match current reality.
180
+
181
+ ${ideasHint}
139
182
 
140
183
  ## Scope
141
184
 
@@ -168,7 +211,9 @@ function ideasFromCommits() {
168
211
  return dedent`
169
212
  # Ideas from Commits
170
213
 
171
- Review recent commit history to identify follow-up improvement ideas. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues or opportunities you identify, avoiding duplication.
214
+ Review recent commit history to identify follow-up improvement ideas.
215
+
216
+ ${ideasHint}
172
217
 
173
218
  ## Scope
174
219
 
@@ -200,7 +245,9 @@ function ideasFromPrinciples() {
200
245
  return dedent`
201
246
  # Ideas from Principles
202
247
 
203
- Review \`.dust/principles/\` to generate new improvement ideas. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues or opportunities you identify, avoiding duplication.
248
+ Review \`.dust/principles/\` to generate new improvement ideas.
249
+
250
+ ${ideasHint}
204
251
 
205
252
  ## Scope
206
253
 
@@ -231,7 +278,9 @@ function performanceReview() {
231
278
  return dedent`
232
279
  # Performance Review
233
280
 
234
- Review the application for performance issues and optimization opportunities. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
281
+ Review the application for performance issues and optimization opportunities.
282
+
283
+ ${ideasHint}
235
284
 
236
285
  ## Scope
237
286
 
@@ -264,7 +313,9 @@ function securityReview() {
264
313
  return dedent`
265
314
  # Security Review
266
315
 
267
- Review the codebase for common security vulnerabilities and misconfigurations. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
316
+ Review the codebase for common security vulnerabilities and misconfigurations.
317
+
318
+ ${ideasHint}
268
319
 
269
320
  ## Scope
270
321
 
@@ -299,7 +350,9 @@ function staleIdeas() {
299
350
  return dedent`
300
351
  # Stale Ideas
301
352
 
302
- Review \`.dust/ideas/\` to identify ideas that have become stale or irrelevant. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
353
+ Review \`.dust/ideas/\` to identify ideas that have become stale or irrelevant.
354
+
355
+ ${ideasHint}
303
356
 
304
357
  ## Scope
305
358
 
@@ -331,7 +384,9 @@ function testCoverage() {
331
384
  return dedent`
332
385
  # Test Coverage
333
386
 
334
- Identify untested code paths and areas that need additional test coverage. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
387
+ Identify untested code paths and areas that need additional test coverage.
388
+
389
+ ${ideasHint}
335
390
 
336
391
  ## Scope
337
392
 
@@ -361,6 +416,7 @@ function testCoverage() {
361
416
  }
362
417
  var stockAuditFunctions = {
363
418
  "agent-developer-experience": agentDeveloperExperience,
419
+ "component-reuse": componentReuse,
364
420
  "dead-code": deadCode,
365
421
  "facts-verification": factsVerification,
366
422
  "ideas-from-commits": ideasFromCommits,
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Biome path export
3
+ *
4
+ * Provides the path to the biome directory containing custom GritQL lint rules.
5
+ * Downstream users can reference this path in their biome.json plugins array.
6
+ */
7
+ /**
8
+ * Absolute path to the biome directory containing custom GritQL lint rules.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { biomePath } from "@joshski/dust/biome";
13
+ * // Returns: "/path/to/node_modules/@joshski/dust/biome"
14
+ * ```
15
+ */
16
+ export declare const biomePath: string;
package/dist/biome.js ADDED
@@ -0,0 +1,8 @@
1
+ // lib/biome/index.ts
2
+ import { dirname, join } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ var currentDir = dirname(fileURLToPath(import.meta.url));
5
+ var biomePath = join(currentDir, "..", "biome");
6
+ export {
7
+ biomePath
8
+ };
package/dist/dust.js CHANGED
@@ -275,7 +275,7 @@ async function loadSettings(cwd, fileSystem) {
275
275
  }
276
276
 
277
277
  // lib/version.ts
278
- var DUST_VERSION = "0.1.64";
278
+ var DUST_VERSION = "0.1.65";
279
279
 
280
280
  // lib/cli/dedent.ts
281
281
  function dedent(strings, ...values) {
@@ -590,11 +590,50 @@ function extractOpeningSentence(content) {
590
590
  }
591
591
 
592
592
  // lib/audits/stock-audits.ts
593
+ var ideasHint = "Review existing ideas in `./.dust/ideas/` to understand what has been proposed or considered historically, then create new idea files in `./.dust/ideas/` for any issues you identify, avoiding duplication.";
594
+ function componentReuse() {
595
+ return dedent`
596
+ # Component Reuse
597
+
598
+ Find repeated patterns and code that could be extracted into reusable components.
599
+
600
+ ${ideasHint}
601
+
602
+ ## Scope
603
+
604
+ Focus on these areas:
605
+
606
+ 1. **Repeated patterns** - Similar code blocks that appear multiple times
607
+ 2. **Copy-pasted code** - Near-identical logic across different files
608
+ 3. **Parallel structures** - Code that handles similar cases with minor variations
609
+ 4. **Extraction opportunities** - Logic that could be unified without forcing unrelated concepts together
610
+
611
+ ## Principles
612
+
613
+ - [Reasonably DRY](../principles/reasonably-dry.md)
614
+ - [Decoupled Code](../principles/decoupled-code.md)
615
+ - [Maintainable Codebase](../principles/maintainable-codebase.md)
616
+
617
+ ## Blocked By
618
+
619
+ (none)
620
+
621
+ ## Definition of Done
622
+
623
+ - [ ] Searched for repeated patterns across the codebase
624
+ - [ ] Identified copy-pasted or near-duplicate code
625
+ - [ ] Evaluated each case for whether extraction would be beneficial
626
+ - [ ] Considered whether similar code serves different purposes that may evolve independently
627
+ - [ ] Proposed ideas only for extractions where duplication is truly about the same concept
628
+ `;
629
+ }
593
630
  function agentDeveloperExperience() {
594
631
  return dedent`
595
632
  # Agent Developer Experience
596
633
 
597
- Review the codebase to ensure agents have everything they need to operate effectively. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
634
+ Review the codebase to ensure agents have everything they need to operate effectively.
635
+
636
+ ${ideasHint}
598
637
 
599
638
  ## Scope
600
639
 
@@ -627,7 +666,9 @@ function deadCode() {
627
666
  return dedent`
628
667
  # Dead Code
629
668
 
630
- Find and remove unused code to improve maintainability and reduce bundle size. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
669
+ Find and remove unused code to improve maintainability and reduce bundle size.
670
+
671
+ ${ideasHint}
631
672
 
632
673
  ## Scope
633
674
 
@@ -662,7 +703,9 @@ function factsVerification() {
662
703
  return dedent`
663
704
  # Facts Verification
664
705
 
665
- Review \`.dust/facts/\` to ensure documented facts match current reality. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
706
+ Review \`.dust/facts/\` to ensure documented facts match current reality.
707
+
708
+ ${ideasHint}
666
709
 
667
710
  ## Scope
668
711
 
@@ -695,7 +738,9 @@ function ideasFromCommits() {
695
738
  return dedent`
696
739
  # Ideas from Commits
697
740
 
698
- Review recent commit history to identify follow-up improvement ideas. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues or opportunities you identify, avoiding duplication.
741
+ Review recent commit history to identify follow-up improvement ideas.
742
+
743
+ ${ideasHint}
699
744
 
700
745
  ## Scope
701
746
 
@@ -727,7 +772,9 @@ function ideasFromPrinciples() {
727
772
  return dedent`
728
773
  # Ideas from Principles
729
774
 
730
- Review \`.dust/principles/\` to generate new improvement ideas. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues or opportunities you identify, avoiding duplication.
775
+ Review \`.dust/principles/\` to generate new improvement ideas.
776
+
777
+ ${ideasHint}
731
778
 
732
779
  ## Scope
733
780
 
@@ -758,7 +805,9 @@ function performanceReview() {
758
805
  return dedent`
759
806
  # Performance Review
760
807
 
761
- Review the application for performance issues and optimization opportunities. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
808
+ Review the application for performance issues and optimization opportunities.
809
+
810
+ ${ideasHint}
762
811
 
763
812
  ## Scope
764
813
 
@@ -791,7 +840,9 @@ function securityReview() {
791
840
  return dedent`
792
841
  # Security Review
793
842
 
794
- Review the codebase for common security vulnerabilities and misconfigurations. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
843
+ Review the codebase for common security vulnerabilities and misconfigurations.
844
+
845
+ ${ideasHint}
795
846
 
796
847
  ## Scope
797
848
 
@@ -826,7 +877,9 @@ function staleIdeas() {
826
877
  return dedent`
827
878
  # Stale Ideas
828
879
 
829
- Review \`.dust/ideas/\` to identify ideas that have become stale or irrelevant. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
880
+ Review \`.dust/ideas/\` to identify ideas that have become stale or irrelevant.
881
+
882
+ ${ideasHint}
830
883
 
831
884
  ## Scope
832
885
 
@@ -858,7 +911,9 @@ function testCoverage() {
858
911
  return dedent`
859
912
  # Test Coverage
860
913
 
861
- Identify untested code paths and areas that need additional test coverage. Review existing ideas in \`./.ideas/\` and the recent history of \`./.dust/ideas\` to understand what has been proposed or considered historically, then create new idea files in \`./.ideas/\` for any issues you identify, avoiding duplication.
914
+ Identify untested code paths and areas that need additional test coverage.
915
+
916
+ ${ideasHint}
862
917
 
863
918
  ## Scope
864
919
 
@@ -888,6 +943,7 @@ function testCoverage() {
888
943
  }
889
944
  var stockAuditFunctions = {
890
945
  "agent-developer-experience": agentDeveloperExperience,
946
+ "component-reuse": componentReuse,
891
947
  "dead-code": deadCode,
892
948
  "facts-verification": factsVerification,
893
949
  "ideas-from-commits": ideasFromCommits,
@@ -3740,11 +3796,7 @@ function runBufferedProcess(spawnFn, command, commandArguments, cwd, shell, time
3740
3796
  import { join as join8 } from "node:path";
3741
3797
 
3742
3798
  // lib/lint/validators/content-validator.ts
3743
- var REQUIRED_HEADINGS = [
3744
- "## Principles",
3745
- "## Blocked By",
3746
- "## Definition of Done"
3747
- ];
3799
+ var REQUIRED_HEADINGS = ["## Blocked By", "## Definition of Done"];
3748
3800
  var MAX_OPENING_SENTENCE_LENGTH = 150;
3749
3801
  var NON_IMPERATIVE_STARTERS = new Set([
3750
3802
  "the",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joshski/dust",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "description": "Flow state for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,12 +29,17 @@
29
29
  "./filesystem": {
30
30
  "types": "./dist/filesystem/types.d.ts"
31
31
  },
32
- "./istanbul/minimal-reporter": "./lib/istanbul/minimal-reporter.cjs"
32
+ "./istanbul/minimal-reporter": "./lib/istanbul/minimal-reporter.cjs",
33
+ "./biome": {
34
+ "import": "./dist/biome.js",
35
+ "types": "./dist/biome/index.d.ts"
36
+ }
33
37
  },
34
38
  "files": [
35
39
  "dist",
36
40
  "bin",
37
- "lib/istanbul/minimal-reporter.cjs"
41
+ "lib/istanbul/minimal-reporter.cjs",
42
+ "biome"
38
43
  ],
39
44
  "repository": {
40
45
  "type": "git",