@forwardimpact/pathway 0.9.0 → 0.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/pathway",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Career progression web app and CLI for exploring roles and generating agents",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@forwardimpact/schema": "^0.4.0",
44
- "@forwardimpact/model": "^0.4.0",
44
+ "@forwardimpact/model": "^0.5.0",
45
45
  "mustache": "^4.2.0",
46
46
  "simple-icons": "^16.7.0",
47
47
  "yaml": "^2.3.4"
@@ -18,6 +18,13 @@ import { trimValue, trimRequired, trimFields } from "../shared.js";
18
18
  * @property {string} content - Working style content (markdown)
19
19
  */
20
20
 
21
+ /**
22
+ * @typedef {Object} BeforeHandoffEntry
23
+ * @property {{id: string, name: string}} skill - Skill info
24
+ * @property {{id: string, name: string, emojiIcon: string}} capability - Capability info
25
+ * @property {string[]} items - Checklist items
26
+ */
27
+
21
28
  /**
22
29
  * Prepare agent profile data for template rendering
23
30
  * Normalizes string values by trimming trailing newlines for consistent template output.
@@ -35,7 +42,7 @@ import { trimValue, trimRequired, trimFields } from "../shared.js";
35
42
  * @param {Array<{name: string, dirname: string, useWhen: string}>} params.bodyData.skillIndex - Skill index entries
36
43
  * @param {string} params.bodyData.roleContext - Role context text
37
44
  * @param {WorkingStyleEntry[]} params.bodyData.workingStyles - Working style entries
38
- * @param {string} [params.bodyData.beforeHandoff] - Before handoff checklist markdown
45
+ * @param {BeforeHandoffEntry[]} [params.bodyData.beforeHandoff] - Before handoff checklist entries
39
46
  * @param {string[]} params.bodyData.constraints - List of constraints
40
47
  * @param {Array<{id: string, name: string, description: string}>} [params.bodyData.agentIndex] - List of all available agents
41
48
  * @param {boolean} [params.bodyData.hasAgentIndex] - Whether agent index is available
@@ -60,6 +67,13 @@ function prepareAgentProfileData({ frontmatter, bodyData }) {
60
67
  content: "required",
61
68
  });
62
69
 
70
+ // Process beforeHandoff: trim items in each entry
71
+ const beforeHandoff = (bodyData.beforeHandoff || []).map((entry) => ({
72
+ skill: entry.skill,
73
+ capability: entry.capability,
74
+ items: (entry.items || []).map((item) => trimRequired(item)),
75
+ }));
76
+
63
77
  return {
64
78
  // Frontmatter
65
79
  name: frontmatter.name,
@@ -77,7 +91,8 @@ function prepareAgentProfileData({ frontmatter, bodyData }) {
77
91
  roleContext: trimValue(bodyData.roleContext),
78
92
  workingStyles,
79
93
  hasWorkingStyles: workingStyles.length > 0,
80
- beforeHandoff: trimValue(bodyData.beforeHandoff),
94
+ beforeHandoff,
95
+ hasBeforeHandoff: beforeHandoff.length > 0,
81
96
  constraints,
82
97
  hasConstraints: constraints.length > 0,
83
98
  agentIndex,
@@ -102,7 +117,7 @@ function prepareAgentProfileData({ frontmatter, bodyData }) {
102
117
  * @param {Array<{name: string, dirname: string, useWhen: string}>} profile.bodyData.skillIndex - Skill index entries
103
118
  * @param {string} profile.bodyData.roleContext - Role context text
104
119
  * @param {WorkingStyleEntry[]} profile.bodyData.workingStyles - Working style entries
105
- * @param {string} [profile.bodyData.beforeHandoff] - Before handoff checklist markdown (optional)
120
+ * @param {BeforeHandoffEntry[]} [profile.bodyData.beforeHandoff] - Before handoff checklist entries (optional)
106
121
  * @param {string[]} profile.bodyData.constraints - List of constraints
107
122
  * @param {string} template - Mustache template string
108
123
  * @returns {string} Complete .agent.md file content
@@ -88,17 +88,23 @@ and (3) the compromised approach with acknowledged limitations.
88
88
  | `{{id}}` | {{{name}}} | {{{description}}} |
89
89
  {{/agentIndex}}
90
90
  {{/hasAgentIndex}}
91
- {{#beforeHandoff}}
91
+ {{#hasBeforeHandoff}}
92
92
 
93
93
  ## Before Handoff
94
94
 
95
95
  Before offering a handoff, verify and summarize completion of these items:
96
96
 
97
- {{{beforeHandoff}}}
97
+ {{#beforeHandoff}}
98
+ ### {{{capability.emojiIcon}}} {{{skill.name}}}
99
+
100
+ {{#items}}
101
+ - [ ] {{{.}}}
102
+ {{/items}}
98
103
 
104
+ {{/beforeHandoff}}
99
105
  When verified, summarize what was accomplished then offer the handoff. If items
100
106
  are incomplete, explain what remains.
101
- {{/beforeHandoff}}
107
+ {{/hasBeforeHandoff}}
102
108
 
103
109
  ## Return Format
104
110
 
@@ -1,20 +1,17 @@
1
1
  ---
2
2
  name: {{name}}
3
3
  description: |
4
- {{#descriptionLines}}
5
- {{{.}}}
6
- {{/descriptionLines}}
4
+ {{#descriptionLines}}{{{.}}} {{/descriptionLines}}
7
5
  {{#hasUseWhen}}
8
- **Use When:** {{#useWhenLines}}{{{.}}}{{/useWhenLines}}
6
+ Use When: {{#useWhenLines}}{{{.}}} {{/useWhenLines}}
9
7
  {{/hasUseWhen}}
10
8
  ---
11
9
 
12
10
  # {{{title}}}
13
- {{#hasUseWhen}}
14
11
 
15
- **Use This Skill When:**
16
- {{#useWhenLines}}{{{.}}}{{/useWhenLines}}
17
- {{/hasUseWhen}}
12
+ {{#descriptionLines}}
13
+ {{{.}}}
14
+ {{/descriptionLines}}
18
15
  {{#hasStages}}
19
16
 
20
17
  ## Stage Guidance