rhachet-roles-bhrain 0.2.0 → 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.
Files changed (130) hide show
  1. package/dist/.test/getContextOpenAI.js +1 -1
  2. package/dist/.test/getContextOpenAI.js.map +1 -1
  3. package/dist/domain.operations/review/compileReviewPrompt.d.ts +22 -0
  4. package/dist/domain.operations/review/compileReviewPrompt.js +95 -0
  5. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -0
  6. package/dist/domain.operations/review/enumFilesFromDiffs.d.ts +8 -0
  7. package/dist/domain.operations/review/enumFilesFromDiffs.js +74 -0
  8. package/dist/domain.operations/review/enumFilesFromDiffs.js.map +1 -0
  9. package/dist/domain.operations/review/enumFilesFromGlob.d.ts +8 -0
  10. package/dist/domain.operations/review/enumFilesFromGlob.js +31 -0
  11. package/dist/domain.operations/review/enumFilesFromGlob.js.map +1 -0
  12. package/dist/domain.operations/review/estimateTokenCount.d.ts +9 -0
  13. package/dist/domain.operations/review/estimateTokenCount.js +20 -0
  14. package/dist/domain.operations/review/estimateTokenCount.js.map +1 -0
  15. package/dist/domain.operations/review/formatReviewOutput.d.ts +14 -0
  16. package/dist/domain.operations/review/formatReviewOutput.js +42 -0
  17. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -0
  18. package/dist/domain.operations/review/genTokenBreakdownMarkdown.d.ts +19 -0
  19. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js +110 -0
  20. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js.map +1 -0
  21. package/dist/domain.operations/review/genTokenBreakdownReport.d.ts +24 -0
  22. package/dist/domain.operations/review/genTokenBreakdownReport.js +64 -0
  23. package/dist/domain.operations/review/genTokenBreakdownReport.js.map +1 -0
  24. package/dist/domain.operations/review/invokeClaudeCode.d.ts +22 -0
  25. package/dist/domain.operations/review/invokeClaudeCode.js +92 -0
  26. package/dist/domain.operations/review/invokeClaudeCode.js.map +1 -0
  27. package/dist/domain.operations/review/writeInputArtifacts.d.ts +27 -0
  28. package/dist/domain.operations/review/writeInputArtifacts.js +50 -0
  29. package/dist/domain.operations/review/writeInputArtifacts.js.map +1 -0
  30. package/dist/domain.operations/review/writeOutputArtifacts.d.ts +12 -0
  31. package/dist/domain.operations/review/writeOutputArtifacts.js +46 -0
  32. package/dist/domain.operations/review/writeOutputArtifacts.js.map +1 -0
  33. package/dist/roles/getRoleRegistry.js +2 -1
  34. package/dist/roles/getRoleRegistry.js.map +1 -1
  35. package/dist/roles/getRoleRegistry.readme.js +6 -0
  36. package/dist/roles/getRoleRegistry.readme.js.map +1 -1
  37. package/dist/roles/reviewer/briefs/review.tactics.md +60 -0
  38. package/dist/roles/reviewer/getReviewerRole.d.ts +6 -0
  39. package/dist/roles/reviewer/getReviewerRole.js +80 -0
  40. package/dist/roles/reviewer/getReviewerRole.js.map +1 -0
  41. package/dist/roles/reviewer/skills/review/review.d.ts +57 -0
  42. package/dist/roles/reviewer/skills/review/review.js +445 -0
  43. package/dist/roles/reviewer/skills/review/review.js.map +1 -0
  44. package/dist/roles/reviewer/skills/review/review.sh +21 -0
  45. package/dist/roles/reviewer/skills/review/review.ts +575 -0
  46. package/dist/roles/thinker/getThinkerRole.js +1 -1
  47. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  48. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19..i1.via_chatgpt.md +47 -0
  49. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19.i2.via_rhachet.md +60 -0
  50. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.md +62 -0
  51. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.with_feedback.md +89 -0
  52. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i2.md +47 -0
  53. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i1.md +44 -0
  54. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i2.md +63 -0
  55. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i3.md +51 -0
  56. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i1.md +62 -0
  57. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i2.md +49 -0
  58. package/dist/roles/thinker/skills/brief.articulate/.readme.md +0 -0
  59. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js +1 -1
  60. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js.map +1 -1
  61. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.ts +168 -0
  62. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.ts +157 -0
  63. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i1.md +93 -0
  64. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i2.md +84 -0
  65. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i1.no_focus_context.md +8 -0
  66. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i2.md +54 -0
  67. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i1.md +62 -0
  68. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i2.md +64 -0
  69. package/dist/roles/thinker/skills/brief.catalogize/.readme.md +5 -0
  70. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js +1 -1
  71. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js.map +1 -1
  72. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.ts +173 -0
  73. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.ts +132 -0
  74. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i4.md +3 -0
  75. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i5.md +3 -0
  76. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i6.md +3 -0
  77. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.md +3 -0
  78. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i1.md +52 -0
  79. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i2.md +51 -0
  80. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i3.md +47 -0
  81. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i4.md +62 -0
  82. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i5.md +47 -0
  83. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i6.md +53 -0
  84. package/dist/roles/thinker/skills/brief.demonstrate/.readme +3 -0
  85. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js +1 -1
  86. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js.map +1 -1
  87. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.ts +190 -0
  88. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.ts +164 -0
  89. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i1.md +72 -0
  90. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i2.md +53 -0
  91. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i3.which_objectives.md +58 -0
  92. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i5.which_personas.md +64 -0
  93. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i1.md +67 -0
  94. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i2.md +49 -0
  95. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i3.md +59 -0
  96. package/dist/roles/thinker/skills/khue.cluster/.readme.md +0 -0
  97. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js +1 -1
  98. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js.map +1 -1
  99. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.ts +174 -0
  100. package/dist/roles/thinker/skills/khue.cluster/stepCluster.ts +150 -0
  101. package/dist/roles/thinker/skills/khue.decompose/.readme.md +9 -0
  102. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i2.md +23 -0
  103. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i3.md +23 -0
  104. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.varieties.v2025_08_17.i1.md +23 -0
  105. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i1.md +9 -0
  106. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i2.md +9 -0
  107. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i3.md +23 -0
  108. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i4.folksy.md +9 -0
  109. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i5.folksy.md +23 -0
  110. package/dist/roles/thinker/skills/khue.diverge/.readme.md +0 -0
  111. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js +1 -1
  112. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js.map +1 -1
  113. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.ts +149 -0
  114. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.ts +151 -0
  115. package/dist/roles/thinker/skills/khue.encompose/.readme.md +7 -0
  116. package/dist/roles/thinker/skills/khue.instantiate/.readme.md +14 -0
  117. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js +1 -1
  118. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js.map +1 -1
  119. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.ts +190 -0
  120. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.ts +132 -0
  121. package/dist/roles/thinker/skills/khue.triage/.demo/laughs.v2025_08_18.i1.md +29 -0
  122. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i1.md +86 -0
  123. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i2.md +68 -0
  124. package/dist/roles/thinker/skills/khue.triage/.readme.md +0 -0
  125. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js +1 -1
  126. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js.map +1 -1
  127. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.ts +174 -0
  128. package/dist/roles/thinker/skills/khue.triage/stepTriage.ts +153 -0
  129. package/package.json +7 -6
  130. package/readme.md +55 -0
@@ -0,0 +1,132 @@
1
+ import { UnexpectedCodePathError } from 'helpful-errors';
2
+ import {
3
+ asStitcherFlat,
4
+ type GStitcher,
5
+ genStepImagineViaTemplate,
6
+ genStitchRoute,
7
+ genTemplate,
8
+ getTemplatePathByCallerPath,
9
+ getTemplateValFromArtifacts,
10
+ getTemplateVarsFromRoleInherit,
11
+ type RoleContext,
12
+ type Threads,
13
+ } from 'rhachet';
14
+ import type { Artifact } from 'rhachet-artifact';
15
+ import type { GitFile } from 'rhachet-artifact-git';
16
+ import { withRetry, withTimeout } from 'wrapper-fns';
17
+
18
+ import type { Focus } from '@src/_topublish/rhachet-roles-bhrain/src/domain/objects/Focus';
19
+ import { type ContextOpenAI, sdkOpenAi } from '@src/access/sdk/sdkOpenAi';
20
+ import { genLoopFeedback } from '@src/domain.operations/artifact/genLoopFeedback';
21
+ import { genStepArtSet } from '@src/domain.operations/artifact/genStepArtSet';
22
+ import { getThinkerBriefs } from '@src/roles/thinker/getThinkerBrief';
23
+
24
+ export const BRIEFS_FOR_INSTANTIATE = getThinkerBriefs([
25
+ 'knowledge/kno101.primitives.1.ontology.[article].frame.docs_as_materializations.md',
26
+ 'knowledge/kno101.primitives.1.ontology.[article].frame.docs_as_references.md',
27
+ 'knowledge/kno101.primitives.2.rel.many_to_many.[article].md',
28
+ 'knowledge/kno101.primitives.3.instances.[article].md',
29
+ 'knowledge/kno301.doc.enbrief.1.from_instances.[article].md',
30
+ 'knowledge/kno351.docs.are_instances.[article].md',
31
+ ]);
32
+
33
+ type StitcherDesired = GStitcher<
34
+ Threads<{
35
+ caller: RoleContext<
36
+ 'caller',
37
+ {
38
+ art: {
39
+ feedback: Artifact<typeof GitFile>;
40
+ 'foci.goal.concept': Focus['concept'];
41
+ 'foci.goal.context': Focus['context'];
42
+ };
43
+ refs: Artifact<typeof GitFile>[];
44
+ }
45
+ >;
46
+ thinker: RoleContext<
47
+ 'thinker',
48
+ {
49
+ art: {
50
+ 'focus.concept': Focus['concept'];
51
+ 'focus.context': Focus['context'];
52
+ };
53
+ briefs: Artifact<typeof GitFile>[];
54
+ }
55
+ >;
56
+ }>,
57
+ ContextOpenAI & GStitcher['context'],
58
+ { content: string }
59
+ >;
60
+
61
+ const template = genTemplate<StitcherDesired['threads']>({
62
+ ref: { uri: getTemplatePathByCallerPath({ auto: true }) },
63
+ getVariables: async ({ threads }) => ({
64
+ ...(await getTemplateVarsFromRoleInherit({ thread: threads.thinker })),
65
+
66
+ guide: {
67
+ goal:
68
+ (await threads.caller.context.stash.art['foci.goal.concept'].get())
69
+ ?.content ||
70
+ UnexpectedCodePathError.throw('goal not declared', {
71
+ art: threads.caller.context.stash.art['foci.goal.concept'],
72
+ }),
73
+ feedback:
74
+ (await threads.caller.context.stash.art.feedback.get())?.content || '',
75
+ },
76
+
77
+ focus: {
78
+ context:
79
+ (await threads.thinker.context.stash.art['focus.context'].get())
80
+ ?.content || '',
81
+ concept:
82
+ (await threads.thinker.context.stash.art['focus.concept'].get())
83
+ ?.content || '',
84
+ },
85
+
86
+ skill: {
87
+ briefs: await getTemplateValFromArtifacts({
88
+ artifacts: (() => {
89
+ const briefs = [
90
+ ...BRIEFS_FOR_INSTANTIATE,
91
+ ...threads.thinker.context.stash.briefs,
92
+ ];
93
+ // console.log(briefs.map((brief) => brief.ref)); // ?: left here to aid in debug, when needed
94
+ return briefs;
95
+ })(),
96
+ }),
97
+ },
98
+
99
+ references: await getTemplateValFromArtifacts({
100
+ artifacts: threads.caller.context.stash.refs,
101
+ }),
102
+ }),
103
+ });
104
+
105
+ const stepImagine = genStepImagineViaTemplate<StitcherDesired>({
106
+ slug: '@[thinker]<instantiate>',
107
+ stitchee: 'thinker',
108
+ readme: '',
109
+ template,
110
+ imagine: withRetry(
111
+ withTimeout(sdkOpenAi.imagine, { threshold: { seconds: 60 } }), // allow up to 60 sec, for longer files
112
+ ),
113
+ });
114
+
115
+ const stepPersist = genStepArtSet({
116
+ stitchee: 'thinker',
117
+ artee: 'focus.concept',
118
+ });
119
+
120
+ export const stepInstantiate = asStitcherFlat<StitcherDesired>(
121
+ genStitchRoute({
122
+ slug: '@[thinker]<instantiate>',
123
+ readme: '@[thinker]<instantiate> -> [instance]',
124
+ sequence: [stepImagine, stepPersist],
125
+ }),
126
+ );
127
+
128
+ export const loopInstantiate = genLoopFeedback({
129
+ stitchee: 'thinker',
130
+ artee: 'focus.concept',
131
+ repeatee: stepInstantiate,
132
+ });
@@ -0,0 +1,29 @@
1
+ {
2
+ "most_laughs": [
3
+ { "item": "Why don't scientists trust atoms? Because they make up everything!", "rationale": "This joke is likely to elicit the most laughs due to its clever play on words and the surprising insight into the nature of atoms." },
4
+ { "item": "What do you call cheese that isn't yours? Nacho cheese!", "rationale": "This joke has broad appeal and is a classic example of wordplay, likely generating consistent laughter." },
5
+ { "item": "Why don’t skeletons fight each other? They don’t have the guts.", "rationale": "This joke plays on both literal and metaphorical meanings of having 'guts,' making it an effective and humorous pun." }
6
+ ],
7
+ "moderate_laughs": [
8
+ { "item": "Why did the chicken cross the road? To get to the other side!", "rationale": "As a classic and familiar setup, it may generate moderate laughs due to its simplicity and nostalgic appeal." },
9
+ { "item": "Why was the math book sad? Because it had too many problems.", "rationale": "This joke ties into a common school subject and its inherent challenges, which makes it relatable and mildly amusing." },
10
+ { "item": "Why did the scarecrow win an award? Because he was outstanding in his field!", "rationale": "This joke is clever due to its play on the word 'outstanding,' offering a good example of wordplay." },
11
+ { "item": "Why couldn’t the bicycle stand up by itself? It was two tired.", "rationale": "This relies on a pun involving the homophones 'too' and 'two,' delivering moderate humor." },
12
+ { "item": "What do you call fake spaghetti? An impasta!", "rationale": "A pun that combines a common food with a clever play on the word 'imposter,' likely to evoke moderate laughter." },
13
+ { "item": "What did one wall say to the other wall? I'll meet you at the corner!", "rationale": "A simple and predictable punchline that provides a chuckle through personifying walls." }
14
+ ],
15
+ "fewest_laughs": [
16
+ { "item": "How do you organize a space party? You planet!", "rationale": "This joke may elicit fewer laughs due to its predictability, although the pun on 'planet' is moderately clever." },
17
+ { "item": "What did the janitor say when he jumped out of the closet? Supplies!", "rationale": "While surprising, it may generate limited laughter unless aligned with specific situational contexts." },
18
+ { "item": "Why did the picture go to jail? Because it was framed!", "rationale": "This joke offers a straightforward pun, but the humor might not resonate as profoundly." },
19
+ { "item": "Why can’t your nose be 12 inches long? Because then it would be a foot!", "rationale": "This joke leverages a play on measurement units but might not be inherently hilarious." },
20
+ { "item": "What do you call a boomerang that won’t come back? A stick.", "rationale": "A simple observation, this joke often receives chuckles more than outright laughter." },
21
+ { "item": "What do you call a fish with no eye? Fsh!", "rationale": "A minimalist joke that relies on spelling humor, setting it apart with minimalistic appeal." },
22
+ { "item": "What do you call a bear with no teeth? A gummy bear!", "rationale": "A straightforward pun, its humor might be niche or context-reliant." },
23
+ { "item": "What do you get when you cross a snowman with a vampire? Frostbite.", "rationale": "While creative, the humor might not strike everyone." },
24
+ { "item": "How does a penguin build its house? Igloos it together!", "rationale": "The joke relies on a basic pun combining 'igloos' and 'glues,' delivering straightforward humor." },
25
+ { "item": "Why did the golfer bring two pairs of pants? In case he got a hole in one!", "rationale": "This joke delivers a golfing pun but might not resonate with those unfamiliar with golfing terms." },
26
+ { "item": "What do you get if you put a radio in the fridge? Cool music.", "rationale": "This joke involves a play on words relating to temperature but may not yield substantial laughter." },
27
+ { "item": "Why did the tomato turn red? Because it saw the salad dressing!", "rationale": "A play on words using 'dressing,' it may elicit small laughs based on its predictable punchline." }
28
+ ]
29
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "high_priority": [
3
+ {
4
+ "item": "A road tripper planning a route with a digital map for scenic stops.",
5
+ "rationale": "This reflects a proactive, planning-focused user journey, critical for ensuring a positive travel experience and suitable for demonstrating effective digital mapping interfaces."
6
+ },
7
+ {
8
+ "item": "A parent navigating a grocery store app to build their weekly shopping list.",
9
+ "rationale": "Demonstrates a time-sensitive and frequently repeated task, highlighting user interaction with essential everyday applications."
10
+ },
11
+ {
12
+ "item": "A small business owner managing orders and inventory via an online platform.",
13
+ "rationale": "Involves complex user interactions with high impact on business operations and is crucial for illustrating commercial application use cases."
14
+ }
15
+ ],
16
+ "medium_priority": [
17
+ {
18
+ "item": "A fitness enthusiast booking classes and tracking goals in a workout app.",
19
+ "rationale": "Emphasizes goal-setting and tracking over time, providing a clear depiction of personalized user experiences."
20
+ },
21
+ {
22
+ "item": "A cafe regular pre-ordering their daily coffee through a mobile app.",
23
+ "rationale": "Represents habitual, low-effort usage scenarios, suitable for showing user retention strategies."
24
+ },
25
+ {
26
+ "item": "A student using an online learning platform to complete daily algebra exercises.",
27
+ "rationale": "Illustrates educational technology use, particularly in structured learning environments."
28
+ },
29
+ {
30
+ "item": "A traveler using a language app daily to build vocabulary before a trip.",
31
+ "rationale": "Focuses on consistent, long-term user engagement, showcasing how apps support progression and readiness for specific goals."
32
+ },
33
+ {
34
+ "item": "A yoga practitioner following an online video series for daily sessions.",
35
+ "rationale": "Highlights user commitment to maintaining fitness habits through digital resources, reflective of user journey consistency."
36
+ }
37
+ ],
38
+ "low_priority": [
39
+ {
40
+ "item": "A new pet owner researching breed-specific care tips on a vet's website.",
41
+ "rationale": "Represents an informative, sporadic interaction, more reflective of ad-hoc information-seeking than continuous engagement."
42
+ },
43
+ {
44
+ "item": "A book lover cataloging and reviewing recent reads in a book community app.",
45
+ "rationale": "Emphasizes community interaction and content contribution, which are secondary compared to more active use journeys."
46
+ },
47
+ {
48
+ "item": "An environmentalist tracking local wildlife sightings with a citizen science app.",
49
+ "rationale": "Reflects a niche interest and periodic use, providing specific but less universally relatable user journeys."
50
+ },
51
+ {
52
+ "item": "A commuter reading news headlines on their phone while on the train.",
53
+ "rationale": "Represents passive content consumption, providing weaker demonstrations of interactive user journeys."
54
+ },
55
+ {
56
+ "item": "A babysitter logging hours and generating invoices via a babysitting service app.",
57
+ "rationale": "Focuses on transactional operations rather than highlighting broader user journey dynamics."
58
+ },
59
+ {
60
+ "item": "A gardener logging plant growth in a digital garden journal app.",
61
+ "rationale": "Involves self-monitoring and hobbyist engagement, suitable for niche content rather than core interactions."
62
+ }
63
+ ],
64
+ "special_interest": [
65
+ {
66
+ "item": "An influencer planning photo shoots and posting schedules with a content calendar app.",
67
+ "rationale": "Demonstrates unique needs around content scheduling and social media engagement, useful for highlighting specialized user journeys."
68
+ },
69
+ {
70
+ "item": "An event organizer sending out e-invites and tracking RSVPs through an event app.",
71
+ "rationale": "Provides insights into event management-related user journeys, substantial in scope but typically less frequent."
72
+ },
73
+ {
74
+ "item": "A high school student organizing study schedules and assignment deadlines in a planner app.",
75
+ "rationale": "Good for illustrating goal management and organizational skills within educational contexts, particularly for younger users."
76
+ },
77
+ {
78
+ "item": "A DIY enthusiast following step-by-step guides on a home improvement site.",
79
+ "rationale": "Applicable for showcasing self-guided learning and resourcefulness, fitting for outcome-oriented journeys but peripheral in daily routines."
80
+ },
81
+ {
82
+ "item": "A home cook using a meal kit service website to pick new recipes.",
83
+ "rationale": "Emphasizes decision-making and culinary exploration, albeit within limited, hobby-driven scope."
84
+ }
85
+ ]
86
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "top_examples": [
3
+ {
4
+ "item": "A customer's morning routine as they use their smartwatch to track steps.",
5
+ "rationale": "This example represents a daily habit observable in many users, demonstrating a routine interaction with technology for health tracking, which is a common use case in user journeys."
6
+ },
7
+ {
8
+ "item": "A parent navigating a grocery store app to build their weekly shopping list.",
9
+ "rationale": "This example illustrates a practical application of technology in managing household tasks, which resonates with a wide audience and exemplifies the integration of digital tools in everyday life."
10
+ },
11
+ {
12
+ "item": "A student using an online learning platform to complete daily algebra exercises.",
13
+ "rationale": "Represents the educational sector's shift towards online platforms, highlighting a user journey centered around learning and skill development, key for demonstrating educational technology use cases."
14
+ },
15
+ {
16
+ "item": "A traveler using a language app daily to build vocabulary before a trip.",
17
+ "rationale": "Captures the intentional use of technology for personal growth and preparation, common in user journeys involving self-improvement or learning, especially in travel contexts."
18
+ },
19
+ {
20
+ "item": "A fitness enthusiast booking classes and tracking goals in a workout app.",
21
+ "rationale": "This scenario reflects the fitness industry's use of digital solutions to enhance user engagement and motivation, making it a strong example of goal-oriented user journeys."
22
+ }
23
+ ],
24
+ "secondary_examples": [
25
+ {
26
+ "item": "A road tripper planning a route with a digital map for scenic stops.",
27
+ "rationale": "Highlights the use of digital maps for travel planning, a specialized user journey relevant to context-specific applications, offering modest demonstration value."
28
+ },
29
+ {
30
+ "item": "A new pet owner researching breed-specific care tips on a vet's website.",
31
+ "rationale": "Demonstrates an informative user journey for pet care, showing how digital resources aid in decision-making and learning specific to pet ownership."
32
+ },
33
+ {
34
+ "item": "A cafe regular pre-ordering their daily coffee through a mobile app.",
35
+ "rationale": "Illustrates routine-based interaction catering to convenience, common in food service applications, offering limited variability."
36
+ },
37
+ {
38
+ "item": "A gardener logging plant growth in a digital garden journal app.",
39
+ "rationale": "Represents niche user journeys in self-directed projects using digital tracking tools, but may have less general appeal."
40
+ },
41
+ {
42
+ "item": "A music lover exploring new playlists and artists on a streaming service.",
43
+ "rationale": "Shows a leisure-focused interaction with music technology, reflecting exploratory behavior typical in entertainment-driven journeys."
44
+ }
45
+ ],
46
+ "low_priority_examples": [
47
+ {
48
+ "item": "A home cook using a meal kit service website to pick new recipes.",
49
+ "rationale": "While it represents practical use of digital solutions, its appeal and impact are limited compared to more broadly relevant examples."
50
+ },
51
+ {
52
+ "item": "An influencer planning photo shoots and posting schedules with a content calendar app.",
53
+ "rationale": "This use case is industry-specific and less relatable to the general user demographic, reducing its appeal for broad demonstration."
54
+ },
55
+ {
56
+ "item": "An event organizer sending out e-invites and tracking RSVPs through an event app.",
57
+ "rationale": "Though relevant, it caters to specific roles rather than general user behavior, thus is less impactful in demonstrating a general user journey."
58
+ },
59
+ {
60
+ "item": "A commuter reading news headlines on their phone while on the train.",
61
+ "rationale": "Represents a passive interaction with minimal engagement, providing limited insights into complex user journeys."
62
+ },
63
+ {
64
+ "item": "A small business owner managing orders and inventory via an online platform.",
65
+ "rationale": "Reflects a professional use case with business-specific applications, reducing its representativeness in demonstrating consumer-focused user journeys."
66
+ }
67
+ ]
68
+ }
@@ -108,7 +108,7 @@ exports.SKILL_TRIAGE = (0, rhachet_1.genRoleSkill)({
108
108
  lookup: {
109
109
  apiKeyOpenai: {
110
110
  source: 'process.env',
111
- envar: 'PREP_OPENAI_KEY',
111
+ envar: 'OPENAI_API_KEY',
112
112
  desc: 'the openai key to use',
113
113
  type: 'string',
114
114
  },
@@ -1 +1 @@
1
- {"version":3,"file":"stepTriage.skill.js","sourceRoot":"","sources":["../../../../../src/roles/thinker/skills/khue.triage/stepTriage.skill.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AACrD,+DAA6E;AAE7E,sEAAmE;AACnE,4EAAyE;AACzE,kEAA+D;AAE/D,6CAA6D;AAEhD,QAAA,YAAY,GAAG,IAAA,sBAAY,EAAC;IACvC,IAA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AAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,QAAQ;aACf;SACF;QACD,MAAM,EAAE,CAAC,KAAK,EAAqC,EAAE,CACnD,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACxC,WAAW,EAAE,GAAG,EAAE;YAChB,OAAO;gBACL,GAAG,IAAA,mCAAgB,GAAE;gBACrB,GAAG,IAAA,uCAAkB,GAAE;gBACvB,GAAG,IAAA,6CAAqB,GAAE;aAC3B,CAAC;QACJ,CAAC;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
1
+ {"version":3,"file":"stepTriage.skill.js","sourceRoot":"","sources":["../../../../../src/roles/thinker/skills/khue.triage/stepTriage.skill.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AACrD,+DAA6E;AAE7E,sEAAmE;AACnE,4EAAyE;AACzE,kEAA+D;AAE/D,6CAA6D;AAEhD,QAAA,YAAY,GAAG,IAAA,sBAAY,EAAC;IACvC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,uBAAU;IACjB,OAAO,EAAE;QACP,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,kCAAkC;gBACxC,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,6BAA6B;gBACnC,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,SAAS;aAChB;YACD,UAAU,EAAE;gBACV,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,wDAAwD;gBAC9D,IAAI,EAAE,SAAS;aAChB;YACD,MAAM,EAAE;gBACN,MAA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AC,OAAO;4BAC3C,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO;4BAC3C,oBAAoB,EAAE,SAAS,CAAC,KAAK;4BACrC,QAAQ,EAAE,SAAS,CAAC,QAAQ;yBAC7B;wBACD,IAAI,EAAE,SAAS,CAAC,UAAU;qBAC3B;iBACF,CAAC;gBACF,OAAO,EAAE,MAAM,IAAA,sBAAY,EAAC;oBAC1B,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE;wBACL,GAAG,EAAE;4BACH,eAAe,EAAE,SAAS,CAAC,eAAe,CAAC;4BAC3C,eAAe,EAAE,SAAS,CAAC,eAAe,CAAC;yBAC5C;wBACD,MAAM,EAAE;4BACN,GAAG,SAAS,CAAC,MAAM;4BACnB,GAAG,8BAAiB,EAAE,kJAAkJ;yBACzK;qBACF;iBACF,CAAC;aACH,CAAC;QACJ,CAAC;KACF;IACD,OAAO,EAAE;QACP,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ,MAAM,EAAE,aAAa;gBACrB,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,QAAQ;aACf;SACF;QACD,MAAM,EAAE,CAAC,KAAK,EAAqC,EAAE,CACnD,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACxC,WAAW,EAAE,GAAG,EAAE;YAChB,OAAO;gBACL,GAAG,IAAA,mCAAgB,GAAE;gBACrB,GAAG,IAAA,uCAAkB,GAAE;gBACvB,GAAG,IAAA,6CAAqB,GAAE;aAC3B,CAAC;QACJ,CAAC;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
@@ -0,0 +1,174 @@
1
+ import { enrollThread, genRoleSkill } from 'rhachet';
2
+ import { genArtifactGitFile, getArtifactObsDir } from 'rhachet-artifact-git';
3
+
4
+ import { genContextLogTrail } from '@src/.test/genContextLogTrail';
5
+ import { genContextStitchTrail } from '@src/.test/genContextStitchTrail';
6
+ import { getContextOpenAI } from '@src/.test/getContextOpenAI';
7
+
8
+ import { BRIEFS_FOR_TRIAGE, loopTriage } from './stepTriage';
9
+
10
+ export const SKILL_TRIAGE = genRoleSkill({
11
+ slug: 'triage',
12
+ route: loopTriage,
13
+ threads: {
14
+ lookup: {
15
+ output: {
16
+ source: 'process.argv',
17
+ char: 'o',
18
+ desc: 'the output file to write against',
19
+ type: 'string',
20
+ },
21
+ input: {
22
+ source: 'process.argv',
23
+ char: 'i',
24
+ desc: 'the input file to seed from',
25
+ type: 'string',
26
+ },
27
+ goal: {
28
+ source: 'process.argv',
29
+ char: 'g',
30
+ desc: 'the goal of the request',
31
+ type: '?string',
32
+ },
33
+ references: {
34
+ source: 'process.argv',
35
+ char: 'f',
36
+ desc: 'reference files to to use, if any; delimit with commas',
37
+ type: '?string',
38
+ },
39
+ briefs: {
40
+ source: 'process.argv',
41
+ char: 'b',
42
+ desc: 'brief files to to use, if any; delimit with commas',
43
+ type: '?string',
44
+ },
45
+ },
46
+ assess: (
47
+ input,
48
+ ): input is {
49
+ output: string;
50
+ input: string;
51
+ goal: string;
52
+ references: string;
53
+ briefs: string;
54
+ ask: string;
55
+ } => typeof input.output === 'string',
56
+ instantiate: async (input: {
57
+ output: string;
58
+ input: string;
59
+ goal: string;
60
+ references: string;
61
+ briefs: string;
62
+ ask: string;
63
+ }) => {
64
+ // declare where all the artifacts will be found
65
+ const obsDir = getArtifactObsDir({ uri: input.output });
66
+ const artifacts = {
67
+ goal: {
68
+ concept: genArtifactGitFile(
69
+ { uri: obsDir + '.goal.concept.md' },
70
+ { versions: true },
71
+ ),
72
+ context: genArtifactGitFile(
73
+ { uri: obsDir + '.goal.context.md' },
74
+ { versions: true },
75
+ ),
76
+ },
77
+ feedback: genArtifactGitFile(
78
+ { uri: obsDir + '.feedback.md' },
79
+ { versions: true },
80
+ ),
81
+ 'focus.context': genArtifactGitFile(
82
+ { uri: obsDir + '.focus.context.md' },
83
+ { versions: true },
84
+ ),
85
+ 'focus.concept': genArtifactGitFile(
86
+ { uri: input.output },
87
+ { versions: true },
88
+ ),
89
+ input: genArtifactGitFile({ uri: input.input }, { versions: true }),
90
+ references:
91
+ input.references
92
+ ?.split(',')
93
+ .filter((uri) => !!uri)
94
+ .map((reference) =>
95
+ genArtifactGitFile({ uri: reference }, { access: 'readonly' }),
96
+ ) ?? [],
97
+ briefs:
98
+ input.briefs
99
+ ?.split(',')
100
+ .filter((uri) => !!uri)
101
+ .map((brief) =>
102
+ genArtifactGitFile({ uri: brief }, { access: 'readonly' }),
103
+ ) ?? [],
104
+ };
105
+
106
+ // detect the goal of the caller
107
+ const goalConcept: string = await (async () => {
108
+ // if goal explicitly defined, use it
109
+ if (input.goal)
110
+ return (
111
+ (
112
+ await genArtifactGitFile(
113
+ { uri: input.goal },
114
+ { access: 'readonly' },
115
+ ).get()
116
+ )?.content ?? input.ask
117
+ );
118
+
119
+ // otherwise, assume its the ask
120
+ return input.ask;
121
+ })();
122
+ await artifacts.goal.concept.set({ content: goalConcept });
123
+
124
+ return {
125
+ caller: await enrollThread({
126
+ role: 'caller',
127
+ stash: {
128
+ ask: '',
129
+ art: {
130
+ 'foci.goal.concept': artifacts.goal.concept,
131
+ 'foci.goal.context': artifacts.goal.context,
132
+ 'foci.input.concept': artifacts.input,
133
+ feedback: artifacts.feedback,
134
+ },
135
+ refs: artifacts.references,
136
+ },
137
+ }),
138
+ thinker: await enrollThread({
139
+ role: 'thinker',
140
+ stash: {
141
+ art: {
142
+ 'focus.context': artifacts['focus.context'],
143
+ 'focus.concept': artifacts['focus.concept'],
144
+ },
145
+ briefs: [
146
+ ...artifacts.briefs,
147
+ ...BRIEFS_FOR_TRIAGE, // flow the triage briefs down so that <ponder> has them in context too; this approach does cause duplicate briefs for triage, but thats no biggie
148
+ ],
149
+ },
150
+ }),
151
+ };
152
+ },
153
+ },
154
+ context: {
155
+ lookup: {
156
+ apiKeyOpenai: {
157
+ source: 'process.env',
158
+ envar: 'OPENAI_API_KEY',
159
+ desc: 'the openai key to use',
160
+ type: 'string',
161
+ },
162
+ },
163
+ assess: (input): input is { apiKeyOpenai: string } =>
164
+ typeof input.apiKeyOpenai === 'string',
165
+ instantiate: () => {
166
+ return {
167
+ ...getContextOpenAI(),
168
+ ...genContextLogTrail(),
169
+ ...genContextStitchTrail(),
170
+ };
171
+ },
172
+ },
173
+ readme: '',
174
+ });