@forwardimpact/pathway 0.25.8 → 0.25.9
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 +1 -1
- package/src/commands/agent.js +32 -0
- package/src/formatters/agent/dom.js +13 -0
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
deriveToolkit,
|
|
39
39
|
getDisciplineAbbreviation,
|
|
40
40
|
toKebabCase,
|
|
41
|
+
interpolateTeamInstructions,
|
|
41
42
|
} from "@forwardimpact/libskill";
|
|
42
43
|
import { formatAgentProfile } from "../formatters/agent/profile.js";
|
|
43
44
|
import {
|
|
@@ -207,6 +208,21 @@ async function writeProfile(profile, baseDir, template) {
|
|
|
207
208
|
return profilePath;
|
|
208
209
|
}
|
|
209
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Write team instructions to CLAUDE.md
|
|
213
|
+
* @param {string|null} teamInstructions - Interpolated team instructions content
|
|
214
|
+
* @param {string} baseDir - Base output directory
|
|
215
|
+
* @returns {string|null} Path written, or null if skipped
|
|
216
|
+
*/
|
|
217
|
+
async function writeTeamInstructions(teamInstructions, baseDir) {
|
|
218
|
+
if (!teamInstructions) return null;
|
|
219
|
+
const filePath = join(baseDir, ".claude", "CLAUDE.md");
|
|
220
|
+
await ensureDir(filePath);
|
|
221
|
+
await writeFile(filePath, teamInstructions.trim() + "\n", "utf-8");
|
|
222
|
+
console.log(formatSuccess(`Created: ${filePath}`));
|
|
223
|
+
return filePath;
|
|
224
|
+
}
|
|
225
|
+
|
|
210
226
|
/**
|
|
211
227
|
* Write skill files (SKILL.md, scripts/install.sh, references/REFERENCE.md)
|
|
212
228
|
* @param {Array} skills - Generated skills
|
|
@@ -434,10 +450,18 @@ export async function runAgentCommand({
|
|
|
434
450
|
|
|
435
451
|
// Output to console (default) or write to files (with --output)
|
|
436
452
|
if (!options.output) {
|
|
453
|
+
const teamInstructions = interpolateTeamInstructions(agentTrack, humanDiscipline);
|
|
454
|
+
if (teamInstructions) {
|
|
455
|
+
console.log("# Team Instructions (CLAUDE.md)\n");
|
|
456
|
+
console.log(teamInstructions.trim());
|
|
457
|
+
console.log("\n---\n");
|
|
458
|
+
}
|
|
437
459
|
console.log(formatAgentProfile(profile, agentTemplate));
|
|
438
460
|
return;
|
|
439
461
|
}
|
|
440
462
|
|
|
463
|
+
const teamInstructions = interpolateTeamInstructions(agentTrack, humanDiscipline);
|
|
464
|
+
await writeTeamInstructions(teamInstructions, baseDir);
|
|
441
465
|
await writeProfile(profile, baseDir, agentTemplate);
|
|
442
466
|
await generateClaudeCodeSettings(baseDir, agentData.claudeCodeSettings);
|
|
443
467
|
console.log("");
|
|
@@ -516,6 +540,12 @@ export async function runAgentCommand({
|
|
|
516
540
|
|
|
517
541
|
// Output to console (default) or write to files (with --output)
|
|
518
542
|
if (!options.output) {
|
|
543
|
+
const teamInstructions = interpolateTeamInstructions(agentTrack, humanDiscipline);
|
|
544
|
+
if (teamInstructions) {
|
|
545
|
+
console.log("# Team Instructions (CLAUDE.md)\n");
|
|
546
|
+
console.log(teamInstructions.trim());
|
|
547
|
+
console.log("\n---\n");
|
|
548
|
+
}
|
|
519
549
|
for (const profile of profiles) {
|
|
520
550
|
console.log(formatAgentProfile(profile, agentTemplate));
|
|
521
551
|
console.log("\n---\n");
|
|
@@ -523,6 +553,8 @@ export async function runAgentCommand({
|
|
|
523
553
|
return;
|
|
524
554
|
}
|
|
525
555
|
|
|
556
|
+
const teamInstructions = interpolateTeamInstructions(agentTrack, humanDiscipline);
|
|
557
|
+
await writeTeamInstructions(teamInstructions, baseDir);
|
|
526
558
|
for (const profile of profiles) {
|
|
527
559
|
await writeProfile(profile, baseDir, agentTemplate);
|
|
528
560
|
}
|
|
@@ -18,6 +18,7 @@ import { getStageEmoji } from "../stage/shared.js";
|
|
|
18
18
|
* @param {Array} deployment.skills - Agent skills
|
|
19
19
|
* @param {Array} [deployment.roleAgents] - Role variant agents (plan, review)
|
|
20
20
|
* @param {Object} [deployment.claudeCodeSettings] - Claude Code settings to include in download
|
|
21
|
+
* @param {string|null} [deployment.teamInstructions] - Team instructions content for CLAUDE.md
|
|
21
22
|
* @returns {HTMLElement}
|
|
22
23
|
*/
|
|
23
24
|
export function agentDeploymentToDOM({
|
|
@@ -25,6 +26,7 @@ export function agentDeploymentToDOM({
|
|
|
25
26
|
skills,
|
|
26
27
|
roleAgents = [],
|
|
27
28
|
claudeCodeSettings = {},
|
|
29
|
+
teamInstructions = null,
|
|
28
30
|
}) {
|
|
29
31
|
const profileContent = formatAgentProfile(profile);
|
|
30
32
|
const agentName = profile.frontmatter.name;
|
|
@@ -39,6 +41,7 @@ export function agentDeploymentToDOM({
|
|
|
39
41
|
roleAgents,
|
|
40
42
|
claudeCodeSettings,
|
|
41
43
|
agentName,
|
|
44
|
+
teamInstructions,
|
|
42
45
|
),
|
|
43
46
|
|
|
44
47
|
// Profile section
|
|
@@ -92,6 +95,7 @@ export function agentDeploymentToDOM({
|
|
|
92
95
|
* @param {Array} roleAgents - Role variant agents
|
|
93
96
|
* @param {Object} claudeCodeSettings - Claude Code settings to include
|
|
94
97
|
* @param {string} agentName - Agent name for zip filename
|
|
98
|
+
* @param {string|null} teamInstructions - Team instructions content for CLAUDE.md
|
|
95
99
|
* @returns {HTMLElement}
|
|
96
100
|
*/
|
|
97
101
|
function createDownloadButton(
|
|
@@ -100,6 +104,7 @@ function createDownloadButton(
|
|
|
100
104
|
roleAgents,
|
|
101
105
|
claudeCodeSettings,
|
|
102
106
|
agentName,
|
|
107
|
+
teamInstructions,
|
|
103
108
|
) {
|
|
104
109
|
const btn = button(
|
|
105
110
|
{ className: "btn btn-primary download-all-btn" },
|
|
@@ -117,6 +122,7 @@ function createDownloadButton(
|
|
|
117
122
|
roleAgents,
|
|
118
123
|
claudeCodeSettings,
|
|
119
124
|
agentName,
|
|
125
|
+
teamInstructions,
|
|
120
126
|
);
|
|
121
127
|
} finally {
|
|
122
128
|
btn.disabled = false;
|
|
@@ -169,6 +175,7 @@ function createRoleAgentCard(agent) {
|
|
|
169
175
|
* @param {Array} roleAgents - Role variant agents
|
|
170
176
|
* @param {Object} claudeCodeSettings - Claude Code settings to include
|
|
171
177
|
* @param {string} agentName - Agent name for zip filename
|
|
178
|
+
* @param {string|null} teamInstructions - Team instructions content for CLAUDE.md
|
|
172
179
|
*/
|
|
173
180
|
async function downloadAllAsZip(
|
|
174
181
|
profile,
|
|
@@ -176,6 +183,7 @@ async function downloadAllAsZip(
|
|
|
176
183
|
roleAgents,
|
|
177
184
|
claudeCodeSettings,
|
|
178
185
|
agentName,
|
|
186
|
+
teamInstructions,
|
|
179
187
|
) {
|
|
180
188
|
// Dynamically import JSZip
|
|
181
189
|
const JSZip = await importJSZip();
|
|
@@ -185,6 +193,11 @@ async function downloadAllAsZip(
|
|
|
185
193
|
const profileContent = formatAgentProfile(profile);
|
|
186
194
|
zip.file(`.claude/agents/${profile.filename}`, profileContent);
|
|
187
195
|
|
|
196
|
+
// Add team instructions to .claude/CLAUDE.md
|
|
197
|
+
if (teamInstructions) {
|
|
198
|
+
zip.file(".claude/CLAUDE.md", teamInstructions.trim() + "\n");
|
|
199
|
+
}
|
|
200
|
+
|
|
188
201
|
// Add role agent profiles to .claude/agents/ folder
|
|
189
202
|
for (const roleAgent of roleAgents) {
|
|
190
203
|
const roleContent = formatAgentProfile(roleAgent);
|