@forwardimpact/pathway 0.16.0 → 0.17.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 +3 -3
- package/src/commands/agent.js +47 -15
- package/src/components/code-display.js +108 -48
- package/src/components/skill-file-viewer.js +61 -0
- package/src/css/bundles/app.css +1 -0
- package/src/css/components/forms.css +47 -16
- package/src/css/components/skill-file-viewer.css +18 -0
- package/src/css/pages/agent-builder.css +13 -55
- package/src/formatters/agent/dom.js +7 -37
- package/src/formatters/agent/profile.js +0 -29
- package/src/formatters/agent/skill.js +69 -11
- package/src/formatters/job/dom.js +6 -4
- package/src/formatters/skill/dom.js +47 -9
- package/src/formatters/skill/shared.js +2 -0
- package/src/lib/template-loader.js +18 -0
- package/src/lib/yaml-loader.js +5 -0
- package/src/pages/agent-builder.js +94 -31
- package/src/pages/skill.js +27 -1
- package/templates/agent.template.md +18 -48
- package/templates/skill-install.template.sh +4 -0
- package/templates/skill-reference.template.md +3 -0
- package/templates/skill.template.md +37 -34
- package/src/components/markdown-textarea.js +0 -153
|
@@ -25,7 +25,7 @@ handoffs:
|
|
|
25
25
|
|
|
26
26
|
{{{stageDescription}}}
|
|
27
27
|
|
|
28
|
-
## Core
|
|
28
|
+
## Core identity
|
|
29
29
|
|
|
30
30
|
{{{identity}}}
|
|
31
31
|
{{#priority}}
|
|
@@ -34,13 +34,13 @@ handoffs:
|
|
|
34
34
|
{{/priority}}
|
|
35
35
|
{{#roleContext}}
|
|
36
36
|
|
|
37
|
-
## Role
|
|
37
|
+
## Role context
|
|
38
38
|
|
|
39
39
|
{{{roleContext}}}
|
|
40
40
|
{{/roleContext}}
|
|
41
41
|
{{#hasWorkingStyles}}
|
|
42
42
|
|
|
43
|
-
## Working
|
|
43
|
+
## Working style
|
|
44
44
|
{{#workingStyles}}
|
|
45
45
|
|
|
46
46
|
### {{title}}
|
|
@@ -50,31 +50,34 @@ handoffs:
|
|
|
50
50
|
{{/hasWorkingStyles}}
|
|
51
51
|
{{#hasSkills}}
|
|
52
52
|
|
|
53
|
-
## Required
|
|
53
|
+
## Required skills
|
|
54
54
|
|
|
55
55
|
**MANDATORY:** Before starting work, you MUST read the relevant skill files for
|
|
56
56
|
project-specific guidance, required tools, and technology standards. Pre-training
|
|
57
57
|
knowledge alone is insufficient—skills contain organizational standards that
|
|
58
58
|
override general knowledge.
|
|
59
59
|
|
|
60
|
-
Each skill
|
|
60
|
+
Each skill contains marked-up sections and references for precise navigation:
|
|
61
61
|
|
|
62
|
-
-
|
|
62
|
+
- `<read_then_do_{{stageId}}>` — Read-Then-Do checklist for the
|
|
63
63
|
{{stageName}} stage. Read and understand these items BEFORE starting work.
|
|
64
64
|
These are prerequisites and context you must absorb first.
|
|
65
|
-
-
|
|
65
|
+
- `<do_then_confirm_{{stageId}}>` — Do-Then-Confirm checklist for the
|
|
66
66
|
{{stageName}} stage. Complete your work, then verify each item. These are
|
|
67
67
|
quality gates to check AFTER implementation.
|
|
68
|
-
-
|
|
68
|
+
- `<required_tools>` — Mandatory tools for this skill. You MUST use these
|
|
69
69
|
organizational standards that override general knowledge or personal
|
|
70
70
|
preferences.
|
|
71
71
|
{{#isOnboard}}
|
|
72
|
-
-
|
|
73
|
-
|
|
72
|
+
- `scripts/install.sh` — Self-contained install script for environment setup.
|
|
73
|
+
Run this script to install prerequisites and configure the development
|
|
74
74
|
environment. Focus on setup only — do not begin feature implementation.
|
|
75
|
+
- `references/REFERENCE.md` — Detailed code examples and reference material.
|
|
76
|
+
Consult this for implementation patterns, common pitfalls, and verification
|
|
77
|
+
steps.
|
|
75
78
|
{{/isOnboard}}
|
|
76
79
|
|
|
77
|
-
| Skill | Location | Use
|
|
80
|
+
| Skill | Location | Use when |
|
|
78
81
|
| ----- | -------- | -------- |
|
|
79
82
|
{{#skillIndex}}
|
|
80
83
|
| {{{name}}} | `.claude/skills/{{dirname}}/SKILL.md` | {{{useWhen}}} |
|
|
@@ -82,7 +85,7 @@ Each skill file contains XML-tagged sections for precise navigation:
|
|
|
82
85
|
{{/hasSkills}}
|
|
83
86
|
{{#hasAgentIndex}}
|
|
84
87
|
|
|
85
|
-
## Required
|
|
88
|
+
## Required subagent delegations
|
|
86
89
|
|
|
87
90
|
**MANDATORY:** You MUST delegate work outside your speciality using the
|
|
88
91
|
`runSubagent` tool. Do not attempt work that another agent is better suited for.
|
|
@@ -93,52 +96,19 @@ cannot delegate due to a blocking constraint, document in your output: (1) the
|
|
|
93
96
|
specialized work required, (2) the specific constraint preventing delegation,
|
|
94
97
|
and (3) the compromised approach with acknowledged limitations.
|
|
95
98
|
|
|
96
|
-
| Agent
|
|
99
|
+
| Agent name | Speciality | Description |
|
|
97
100
|
| ---------- | ---------- | ----------- |
|
|
98
101
|
{{#agentIndex}}
|
|
99
102
|
| `{{id}}` | {{{name}}} | {{{description}}} |
|
|
100
103
|
{{/agentIndex}}
|
|
101
104
|
{{/hasAgentIndex}}
|
|
102
|
-
{{#hasReadChecklist}}
|
|
103
105
|
|
|
104
|
-
##
|
|
105
|
-
|
|
106
|
-
Before starting work, read and understand these items. They are prerequisites
|
|
107
|
-
and context that must be absorbed before implementation begins:
|
|
108
|
-
|
|
109
|
-
{{#readChecklist}}
|
|
110
|
-
### {{{capability.emojiIcon}}} {{{skill.name}}}
|
|
111
|
-
|
|
112
|
-
{{#items}}
|
|
113
|
-
- [ ] {{{.}}}
|
|
114
|
-
{{/items}}
|
|
115
|
-
|
|
116
|
-
{{/readChecklist}}
|
|
117
|
-
{{/hasReadChecklist}}
|
|
118
|
-
{{#hasConfirmChecklist}}
|
|
119
|
-
|
|
120
|
-
## Do-Then-Confirm Checklist
|
|
121
|
-
|
|
122
|
-
Before offering a handoff, verify and summarize completion of these items:
|
|
123
|
-
|
|
124
|
-
{{#confirmChecklist}}
|
|
125
|
-
### {{{capability.emojiIcon}}} {{{skill.name}}}
|
|
126
|
-
|
|
127
|
-
{{#items}}
|
|
128
|
-
- [ ] {{{.}}}
|
|
129
|
-
{{/items}}
|
|
130
|
-
|
|
131
|
-
{{/confirmChecklist}}
|
|
132
|
-
When verified, summarize what was accomplished then offer the handoff. If items
|
|
133
|
-
are incomplete, explain what remains.
|
|
134
|
-
{{/hasConfirmChecklist}}
|
|
135
|
-
|
|
136
|
-
## Return Format
|
|
106
|
+
## Return format
|
|
137
107
|
|
|
138
108
|
When completing work (for handoff or as a subagent), provide:
|
|
139
109
|
|
|
140
110
|
1. **Work completed**: What was accomplished
|
|
141
|
-
2. **Checklist status**: Items verified from
|
|
111
|
+
2. **Checklist status**: Items verified from skill Do-Then-Confirm checklists
|
|
142
112
|
3. **Recommendation**: Ready for next stage, or needs more work
|
|
143
113
|
|
|
144
114
|
{{#hasConstraints}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{name}}
|
|
3
|
-
description: {{{description}}}{{#hasUseWhen}} Use
|
|
3
|
+
description: {{{description}}}{{#hasUseWhen}} Use when {{{useWhen}}}{{/hasUseWhen}}
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# {{{title}}}
|
|
@@ -8,40 +8,28 @@ description: {{{description}}}{{#hasUseWhen}} Use When: {{{useWhen}}}{{/hasUseWh
|
|
|
8
8
|
{{#descriptionLines}}
|
|
9
9
|
{{{.}}}
|
|
10
10
|
{{/descriptionLines}}
|
|
11
|
-
{{#hasStages}}
|
|
12
|
-
|
|
13
|
-
## Stage Guidance
|
|
14
|
-
{{#stages}}
|
|
15
|
-
|
|
16
|
-
### {{stageName}} Stage
|
|
17
|
-
|
|
18
|
-
**Focus:** {{{focus}}}
|
|
19
|
-
|
|
20
|
-
<{{stageId}}_read_then_do>
|
|
21
11
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{{
|
|
12
|
+
{{#hasInstallScript}}
|
|
13
|
+
Run this to install prerequisites: `scripts/install.sh`
|
|
14
|
+
{{/hasInstallScript}}
|
|
15
|
+
{{#hasReference}}
|
|
16
|
+
See [implementation reference](references/REFERENCE.md) for code examples.
|
|
17
|
+
{{/hasReference}}
|
|
18
|
+
{{#hasUseWhen}}
|
|
26
19
|
|
|
27
|
-
|
|
20
|
+
## When to use this skill
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
Use this skill when {{{useWhen}}}
|
|
23
|
+
{{/hasUseWhen}}
|
|
24
|
+
{{#hasInstructions}}
|
|
30
25
|
|
|
31
|
-
|
|
32
|
-
{{
|
|
33
|
-
- [ ] {{{.}}}
|
|
34
|
-
{{/confirmChecklist}}
|
|
35
|
-
|
|
36
|
-
</{{stageId}}_do_then_confirm>
|
|
37
|
-
{{/stages}}
|
|
38
|
-
{{/hasStages}}
|
|
26
|
+
{{{instructions}}}
|
|
27
|
+
{{/hasInstructions}}
|
|
39
28
|
{{#hasToolReferences}}
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
## Required Tools
|
|
30
|
+
# Required tools
|
|
44
31
|
|
|
32
|
+
<required_tools>
|
|
45
33
|
**MANDATORY:** You MUST use these tools when applying this skill. These are
|
|
46
34
|
organizational standards that override general knowledge or personal preferences.
|
|
47
35
|
|
|
@@ -50,17 +38,32 @@ output: (1) which tool requirement you cannot meet, (2) the specific constraint
|
|
|
50
38
|
preventing compliance, and (3) the alternative approach with acknowledged
|
|
51
39
|
trade-offs.
|
|
52
40
|
|
|
53
|
-
| Tool | Use
|
|
41
|
+
| Tool | Use when |
|
|
54
42
|
| ---- | -------- |
|
|
55
43
|
{{#toolReferences}}
|
|
56
44
|
| {{#url}}[{{{name}}}]({{{url}}}){{/url}}{{^url}}{{{name}}}{{/url}} | {{{useWhen}}} |
|
|
57
45
|
{{/toolReferences}}
|
|
58
|
-
|
|
59
46
|
</required_tools>
|
|
60
47
|
{{/hasToolReferences}}
|
|
61
|
-
{{#
|
|
48
|
+
{{#hasStages}}
|
|
62
49
|
|
|
63
|
-
#
|
|
50
|
+
# Stage checklists
|
|
51
|
+
{{#stages}}
|
|
64
52
|
|
|
65
|
-
{{
|
|
66
|
-
|
|
53
|
+
## {{stageName}} stage
|
|
54
|
+
|
|
55
|
+
**Focus:** {{{focus}}}
|
|
56
|
+
|
|
57
|
+
<read_then_do_{{stageId}}>
|
|
58
|
+
{{#readChecklist}}
|
|
59
|
+
- [ ] {{{.}}}
|
|
60
|
+
{{/readChecklist}}
|
|
61
|
+
</read_then_do_{{stageId}}>
|
|
62
|
+
|
|
63
|
+
<do_then_confirm_{{stageId}}>
|
|
64
|
+
{{#confirmChecklist}}
|
|
65
|
+
- [ ] {{{.}}}
|
|
66
|
+
{{/confirmChecklist}}
|
|
67
|
+
</do_then_confirm_{{stageId}}>
|
|
68
|
+
{{/stages}}
|
|
69
|
+
{{/hasStages}}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Code Display Component
|
|
3
|
-
*
|
|
4
|
-
* Reusable read-only code block with copy buttons and syntax highlighting.
|
|
5
|
-
* Used for markdown content, agent profiles, skills, and code snippets.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/* global Prism */
|
|
9
|
-
import { div, p, span, button } from "../lib/render.js";
|
|
10
|
-
|
|
11
|
-
const COPY_LABEL = "📋 Copy";
|
|
12
|
-
const COPY_HTML_LABEL = "Copy as HTML";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Create a copy button that copies content to clipboard
|
|
16
|
-
* @param {string} content - The text content to copy
|
|
17
|
-
* @returns {HTMLElement}
|
|
18
|
-
*/
|
|
19
|
-
export function createCopyButton(content) {
|
|
20
|
-
const btn = button(
|
|
21
|
-
{
|
|
22
|
-
className: "btn btn-sm copy-btn",
|
|
23
|
-
onClick: async () => {
|
|
24
|
-
try {
|
|
25
|
-
await navigator.clipboard.writeText(content);
|
|
26
|
-
btn.textContent = "✓ Copied!";
|
|
27
|
-
btn.classList.add("copied");
|
|
28
|
-
setTimeout(() => {
|
|
29
|
-
btn.textContent = COPY_LABEL;
|
|
30
|
-
btn.classList.remove("copied");
|
|
31
|
-
}, 2000);
|
|
32
|
-
} catch (err) {
|
|
33
|
-
console.error("Failed to copy:", err);
|
|
34
|
-
btn.textContent = "Copy failed";
|
|
35
|
-
setTimeout(() => {
|
|
36
|
-
btn.textContent = COPY_LABEL;
|
|
37
|
-
}, 2000);
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
COPY_LABEL,
|
|
42
|
-
);
|
|
43
|
-
return btn;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Create a copy button that copies HTML to clipboard (for rich text pasting)
|
|
48
|
-
* @param {string} html - The HTML content to copy
|
|
49
|
-
* @returns {HTMLElement}
|
|
50
|
-
*/
|
|
51
|
-
function createCopyHtmlButton(html) {
|
|
52
|
-
const btn = button(
|
|
53
|
-
{
|
|
54
|
-
className: "btn btn-sm btn-secondary copy-btn",
|
|
55
|
-
onClick: async () => {
|
|
56
|
-
try {
|
|
57
|
-
const blob = new Blob([html], { type: "text/html" });
|
|
58
|
-
const clipboardItem = new ClipboardItem({ "text/html": blob });
|
|
59
|
-
await navigator.clipboard.write([clipboardItem]);
|
|
60
|
-
btn.textContent = "✓ Copied!";
|
|
61
|
-
btn.classList.add("copied");
|
|
62
|
-
setTimeout(() => {
|
|
63
|
-
btn.textContent = COPY_HTML_LABEL;
|
|
64
|
-
btn.classList.remove("copied");
|
|
65
|
-
}, 2000);
|
|
66
|
-
} catch (err) {
|
|
67
|
-
console.error("Failed to copy:", err);
|
|
68
|
-
btn.textContent = "Copy failed";
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
btn.textContent = COPY_HTML_LABEL;
|
|
71
|
-
}, 2000);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
COPY_HTML_LABEL,
|
|
76
|
-
);
|
|
77
|
-
return btn;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Create a code display component with syntax highlighting and copy button
|
|
82
|
-
* @param {Object} options
|
|
83
|
-
* @param {string} options.content - The code content to display
|
|
84
|
-
* @param {string} [options.language="markdown"] - Language for syntax highlighting
|
|
85
|
-
* @param {string} [options.filename] - Optional filename to display in header
|
|
86
|
-
* @param {string} [options.description] - Optional description text
|
|
87
|
-
* @param {Function} [options.toHtml] - Function to convert content to HTML (enables "Copy as HTML" button)
|
|
88
|
-
* @param {number} [options.minHeight] - Optional minimum height in pixels
|
|
89
|
-
* @param {number} [options.maxHeight] - Optional maximum height in pixels
|
|
90
|
-
* @returns {HTMLElement}
|
|
91
|
-
*/
|
|
92
|
-
export function createCodeDisplay({
|
|
93
|
-
content,
|
|
94
|
-
language = "markdown",
|
|
95
|
-
filename,
|
|
96
|
-
description,
|
|
97
|
-
toHtml,
|
|
98
|
-
minHeight,
|
|
99
|
-
maxHeight,
|
|
100
|
-
}) {
|
|
101
|
-
// Create highlighted code block
|
|
102
|
-
const pre = document.createElement("pre");
|
|
103
|
-
pre.className = "code-display";
|
|
104
|
-
if (minHeight) pre.style.minHeight = `${minHeight}px`;
|
|
105
|
-
if (maxHeight) {
|
|
106
|
-
pre.style.maxHeight = `${maxHeight}px`;
|
|
107
|
-
pre.style.overflowY = "auto";
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const code = document.createElement("code");
|
|
111
|
-
if (language) {
|
|
112
|
-
code.className = `language-${language}`;
|
|
113
|
-
}
|
|
114
|
-
code.textContent = content;
|
|
115
|
-
pre.appendChild(code);
|
|
116
|
-
|
|
117
|
-
// Apply Prism highlighting if available and language specified
|
|
118
|
-
if (language && typeof Prism !== "undefined") {
|
|
119
|
-
Prism.highlightElement(code);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Build header content
|
|
123
|
-
const headerLeft = [];
|
|
124
|
-
if (filename) {
|
|
125
|
-
headerLeft.push(span({ className: "code-display-filename" }, filename));
|
|
126
|
-
}
|
|
127
|
-
if (description) {
|
|
128
|
-
headerLeft.push(p({ className: "text-muted" }, description));
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Build buttons
|
|
132
|
-
const buttons = [createCopyButton(content)];
|
|
133
|
-
if (toHtml) {
|
|
134
|
-
buttons.push(createCopyHtmlButton(toHtml(content)));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Only show header if there's content for it
|
|
138
|
-
const hasHeader = headerLeft.length > 0 || buttons.length > 0;
|
|
139
|
-
|
|
140
|
-
return div(
|
|
141
|
-
{ className: "code-display-container" },
|
|
142
|
-
hasHeader
|
|
143
|
-
? div(
|
|
144
|
-
{ className: "code-display-header" },
|
|
145
|
-
headerLeft.length > 0
|
|
146
|
-
? div({ className: "code-display-info" }, ...headerLeft)
|
|
147
|
-
: null,
|
|
148
|
-
div({ className: "button-group" }, ...buttons),
|
|
149
|
-
)
|
|
150
|
-
: null,
|
|
151
|
-
pre,
|
|
152
|
-
);
|
|
153
|
-
}
|