@entelligentsia/forgecli 0.1.0 → 0.2.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/CHANGELOG.md +52 -0
- package/README.md +50 -38
- package/dist/extensions/forgecli/forge-commands.d.ts +21 -0
- package/dist/extensions/forgecli/forge-commands.js +141 -0
- package/dist/extensions/forgecli/forge-commands.js.map +1 -1
- package/dist/extensions/forgecli/forge-init.d.ts +26 -0
- package/dist/extensions/forgecli/forge-init.js +916 -0
- package/dist/extensions/forgecli/forge-init.js.map +1 -0
- package/dist/extensions/forgecli/health-check.d.ts +18 -0
- package/dist/extensions/forgecli/health-check.js +154 -0
- package/dist/extensions/forgecli/health-check.js.map +1 -0
- package/dist/extensions/forgecli/index.js +22 -9
- package/dist/extensions/forgecli/index.js.map +1 -1
- package/dist/extensions/forgecli/init-context.d.ts +99 -0
- package/dist/extensions/forgecli/init-context.js +163 -0
- package/dist/extensions/forgecli/init-context.js.map +1 -0
- package/dist/extensions/forgecli/init-progress.d.ts +39 -0
- package/dist/extensions/forgecli/init-progress.js +117 -0
- package/dist/extensions/forgecli/init-progress.js.map +1 -0
- package/dist/extensions/forgecli/refresh-kb-links.d.ts +18 -0
- package/dist/extensions/forgecli/refresh-kb-links.js +228 -0
- package/dist/extensions/forgecli/refresh-kb-links.js.map +1 -0
- package/dist/forge-payload/.base-pack/commands/approve.md +22 -0
- package/dist/forge-payload/.base-pack/commands/collate.md +22 -0
- package/dist/forge-payload/.base-pack/commands/commit.md +22 -0
- package/dist/forge-payload/.base-pack/commands/enhance.md +37 -0
- package/dist/forge-payload/.base-pack/commands/fix-bug.md +22 -0
- package/dist/forge-payload/.base-pack/commands/implement.md +22 -0
- package/dist/forge-payload/.base-pack/commands/plan.md +22 -0
- package/dist/forge-payload/.base-pack/commands/quiz-agent.md +22 -0
- package/dist/forge-payload/.base-pack/commands/retrospective.md +22 -0
- package/dist/forge-payload/.base-pack/commands/review-code.md +22 -0
- package/dist/forge-payload/.base-pack/commands/review-plan.md +22 -0
- package/dist/forge-payload/.base-pack/commands/run-sprint.md +22 -0
- package/dist/forge-payload/.base-pack/commands/run-task.md +22 -0
- package/dist/forge-payload/.base-pack/commands/sprint-intake.md +22 -0
- package/dist/forge-payload/.base-pack/commands/sprint-plan.md +22 -0
- package/dist/forge-payload/.base-pack/commands/validate.md +22 -0
- package/dist/forge-payload/.claude-plugin/plugin.json +15 -0
- package/dist/forge-payload/.init/discovery/discover-database.md +32 -0
- package/dist/forge-payload/.init/discovery/discover-processes.md +31 -0
- package/dist/forge-payload/.init/discovery/discover-routing.md +31 -0
- package/dist/forge-payload/.init/discovery/discover-stack.md +33 -0
- package/dist/forge-payload/.init/discovery/discover-testing.md +34 -0
- package/dist/forge-payload/.init/generation/generate-kb-doc.md +60 -0
- package/dist/forge-payload/.schemas/bug.schema.json +53 -0
- package/dist/forge-payload/.schemas/collation-state.schema.json +16 -0
- package/dist/forge-payload/.schemas/event-sidecar.schema.json +22 -0
- package/dist/forge-payload/.schemas/event.schema.json +32 -0
- package/dist/forge-payload/.schemas/feature.schema.json +22 -0
- package/dist/forge-payload/.schemas/progress-entry.schema.json +16 -0
- package/dist/forge-payload/.schemas/project-context.schema.json +167 -0
- package/dist/forge-payload/.schemas/project-overlay.schema.json +25 -0
- package/dist/forge-payload/.schemas/sprint.schema.json +27 -0
- package/dist/forge-payload/.schemas/structure-versions.schema.json +57 -0
- package/dist/forge-payload/.schemas/task.schema.json +58 -0
- package/dist/forge-payload/.tools/banners.cjs +435 -0
- package/dist/forge-payload/.tools/build-context-pack.cjs +290 -0
- package/dist/forge-payload/.tools/build-init-context.cjs +322 -0
- package/dist/forge-payload/.tools/build-overlay.cjs +326 -0
- package/dist/forge-payload/.tools/build-persona-pack.cjs +226 -0
- package/dist/forge-payload/.tools/collate.cjs +1041 -0
- package/dist/forge-payload/.tools/generation-manifest.cjs +311 -0
- package/dist/forge-payload/.tools/lib/forge-root.cjs +59 -0
- package/dist/forge-payload/.tools/lib/paths.cjs +29 -0
- package/dist/forge-payload/.tools/lib/pricing.cjs +165 -0
- package/dist/forge-payload/.tools/lib/project-root.cjs +32 -0
- package/dist/forge-payload/.tools/lib/result.js +40 -0
- package/dist/forge-payload/.tools/lib/validate.js +131 -0
- package/dist/forge-payload/.tools/manage-config.cjs +340 -0
- package/dist/forge-payload/.tools/manage-versions.cjs +365 -0
- package/dist/forge-payload/.tools/seed-store.cjs +237 -0
- package/dist/forge-payload/.tools/store-cli.cjs +1123 -0
- package/dist/forge-payload/.tools/store.cjs +315 -0
- package/dist/forge-payload/.tools/substitute-placeholders.cjs +625 -0
- package/dist/forge-payload/.tools/validate-store.cjs +522 -0
- package/package.json +1 -1
- /package/dist/forge-payload/{personas → .base-pack/personas}/architect.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/bug-fixer.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/collator.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/engineer.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/librarian.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/orchestrator.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/product-manager.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/qa-engineer.md +0 -0
- /package/dist/forge-payload/{personas → .base-pack/personas}/supervisor.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/architect-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/bug-fixer-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/collator-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/engineer-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/generic-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/librarian-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/qa-engineer-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/store-custodian-skills.md +0 -0
- /package/dist/forge-payload/{skills → .base-pack/skills}/supervisor-skills.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/CODE_REVIEW_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/COST_REPORT_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/PLAN_REVIEW_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/PLAN_SUMMARY_TEMPLATE.json +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/PLAN_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/PROGRESS_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/RETROSPECTIVE_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/SPRINT_MANIFEST_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/SPRINT_REQUIREMENTS_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{templates → .base-pack/templates}/TASK_PROMPT_TEMPLATE.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/_fragments/context-injection.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/_fragments/event-emission-schema.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/_fragments/finalize.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/_fragments/progress-reporting.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/architect_approve.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/architect_review_sprint_completion.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/architect_sprint_intake.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/architect_sprint_plan.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/collator_agent.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/commit_task.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/fix_bug.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/implement_plan.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/migrate_structural.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/orchestrate_task.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/plan_task.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/quiz_agent.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/review_code.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/review_plan.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/run_sprint.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/sprint_retrospective.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/update_implementation.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/update_plan.md +0 -0
- /package/dist/forge-payload/{workflows → .base-pack/workflows}/validate_task.md +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// init-progress.ts — read/write/delete .forge/init-progress.json
|
|
2
|
+
//
|
|
3
|
+
// Tracks the last completed phase of /forge:init so the command can resume
|
|
4
|
+
// after an interrupted run. Implements stale-checkpoint detection to handle
|
|
5
|
+
// legacy 12-phase checkpoint files from old forge plugin versions.
|
|
6
|
+
//
|
|
7
|
+
// Per INIT_PARITY_SPEC.md §4 and PLAN.md Phase B.
|
|
8
|
+
import * as fs from "node:fs";
|
|
9
|
+
import * as path from "node:path";
|
|
10
|
+
const PROGRESS_FILENAME = ".forge/init-progress.json";
|
|
11
|
+
function progressPath(cwd) {
|
|
12
|
+
return path.join(cwd, PROGRESS_FILENAME);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Read the init-progress checkpoint file.
|
|
16
|
+
*
|
|
17
|
+
* Returns:
|
|
18
|
+
* - `{ kind: "none" }` — file does not exist
|
|
19
|
+
* - `{ kind: "malformed" }` — file exists but JSON parse failed
|
|
20
|
+
* - `{ kind: "stale", reason }` — file is a legacy 12-phase checkpoint
|
|
21
|
+
* - `{ kind: "valid", progress }` — clean 4-phase checkpoint
|
|
22
|
+
*/
|
|
23
|
+
export function readInitProgress(cwd) {
|
|
24
|
+
const filePath = progressPath(cwd);
|
|
25
|
+
let raw;
|
|
26
|
+
try {
|
|
27
|
+
raw = fs.readFileSync(filePath, "utf8");
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
const e = err;
|
|
31
|
+
if (e.code === "ENOENT")
|
|
32
|
+
return { kind: "none" };
|
|
33
|
+
// Unreadable — treat as missing
|
|
34
|
+
return { kind: "none" };
|
|
35
|
+
}
|
|
36
|
+
let obj;
|
|
37
|
+
try {
|
|
38
|
+
obj = JSON.parse(raw);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return { kind: "malformed" };
|
|
42
|
+
}
|
|
43
|
+
if (!obj || typeof obj !== "object") {
|
|
44
|
+
return { kind: "malformed" };
|
|
45
|
+
}
|
|
46
|
+
const record = obj;
|
|
47
|
+
// Stale detection per spec §4:
|
|
48
|
+
// - lastPhase > 4 → old 12-phase run
|
|
49
|
+
// - contains "mode" key → old format
|
|
50
|
+
// - contains "phase-7-substep-map" key → old format
|
|
51
|
+
// - missing "timestamp" → corrupt / incomplete write
|
|
52
|
+
if ("mode" in record) {
|
|
53
|
+
return { kind: "stale", reason: 'contains "mode" field (legacy 12-phase format)' };
|
|
54
|
+
}
|
|
55
|
+
if ("phase-7-substep-map" in record) {
|
|
56
|
+
return { kind: "stale", reason: 'contains "phase-7-substep-map" field (legacy 12-phase format)' };
|
|
57
|
+
}
|
|
58
|
+
if (!("timestamp" in record)) {
|
|
59
|
+
return { kind: "stale", reason: 'missing "timestamp" field' };
|
|
60
|
+
}
|
|
61
|
+
const lastPhase = record.lastPhase;
|
|
62
|
+
if (typeof lastPhase !== "number" || !Number.isInteger(lastPhase)) {
|
|
63
|
+
return { kind: "malformed" };
|
|
64
|
+
}
|
|
65
|
+
if (lastPhase > 4) {
|
|
66
|
+
return { kind: "stale", reason: `lastPhase=${lastPhase} > 4 (legacy 12-phase run)` };
|
|
67
|
+
}
|
|
68
|
+
if (lastPhase < 1) {
|
|
69
|
+
return { kind: "malformed" };
|
|
70
|
+
}
|
|
71
|
+
const timestamp = record.timestamp;
|
|
72
|
+
if (typeof timestamp !== "string") {
|
|
73
|
+
return { kind: "malformed" };
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
kind: "valid",
|
|
77
|
+
progress: {
|
|
78
|
+
lastPhase: lastPhase,
|
|
79
|
+
timestamp,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Write a progress checkpoint. Called at the end of each completed phase.
|
|
85
|
+
*
|
|
86
|
+
* @param cwd - project working directory
|
|
87
|
+
* @param lastPhase - completed phase number (1, 2, or 3; 4 is written then deleted)
|
|
88
|
+
* @param timestamp - ISO 8601 timestamp; defaults to now
|
|
89
|
+
*/
|
|
90
|
+
export function writeInitProgress(cwd, lastPhase, timestamp) {
|
|
91
|
+
const record = {
|
|
92
|
+
lastPhase,
|
|
93
|
+
timestamp: timestamp ?? new Date().toISOString(),
|
|
94
|
+
};
|
|
95
|
+
const filePath = progressPath(cwd);
|
|
96
|
+
// Ensure .forge/ dir exists before writing
|
|
97
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
98
|
+
fs.writeFileSync(filePath, JSON.stringify(record, null, 2) + "\n", "utf8");
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Delete the init-progress checkpoint. Called at the end of Phase 4
|
|
102
|
+
* to signal successful completion.
|
|
103
|
+
*/
|
|
104
|
+
export function deleteInitProgress(cwd) {
|
|
105
|
+
const filePath = progressPath(cwd);
|
|
106
|
+
try {
|
|
107
|
+
fs.unlinkSync(filePath);
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
const e = err;
|
|
111
|
+
// ENOENT is fine — file may not exist if phase was aborted before first write
|
|
112
|
+
if (e.code !== "ENOENT") {
|
|
113
|
+
throw err;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=init-progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-progress.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/init-progress.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,mEAAmE;AACnE,EAAE;AACF,kDAAkD;AAElD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAclC,MAAM,iBAAiB,GAAG,2BAA2B,CAAC;AAEtD,SAAS,YAAY,CAAC,GAAW;IAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC3C,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAEnC,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACJ,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACvB,MAAM,CAAC,GAAG,GAAwB,CAAC;QACnC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACjD,gCAAgC;QAChC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACJ,GAAG,GAAG,IAAI,CAAC,KAAK,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|
+
filesUpdated: number;
|
|
3
|
+
filesSkipped: number;
|
|
4
|
+
messages: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Run the refresh-kb-links operation on the project at `cwd`.
|
|
8
|
+
*
|
|
9
|
+
* Returns a result record with counts and human-readable messages.
|
|
10
|
+
* Never throws — errors are captured as messages.
|
|
11
|
+
*/
|
|
12
|
+
export declare function runRefreshKbLinks(cwd: string): Promise<RefreshKbLinksResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a standalone refresh-kb-links handler suitable for direct invocation
|
|
15
|
+
* from Phase 4 step 4-9. Returns a function that takes cwd and calls
|
|
16
|
+
* runRefreshKbLinks.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getRefreshKbLinksHandler(): (cwd: string) => Promise<RefreshKbLinksResult>;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
// refresh-kb-links.ts — TypeScript port of forge/forge/skills/refresh-kb-links/SKILL.md
|
|
2
|
+
//
|
|
3
|
+
// Scans coding-agent instruction files (CLAUDE.md, AGENTS.md, etc.) and
|
|
4
|
+
// ensures each has up-to-date managed sections linking to the Forge KB and
|
|
5
|
+
// workflows. Called directly by Phase 4 step 4-9 (Tomoshibi) during
|
|
6
|
+
// /forge:init and registered as the /forge:refresh-kb-links command handler.
|
|
7
|
+
//
|
|
8
|
+
// Per PLAN.md sub-decision #5 (F7 fix): TS port is the only valid implementation;
|
|
9
|
+
// forge/forge/skills/refresh-kb-links/SKILL.md is a markdown body with no
|
|
10
|
+
// runnable .cjs entry point.
|
|
11
|
+
//
|
|
12
|
+
// Iron Law 6: no shell-string interpolation.
|
|
13
|
+
// Iron Law 1: reads .forge/config.json — no writes to forge/ source.
|
|
14
|
+
import * as fs from "node:fs";
|
|
15
|
+
import * as path from "node:path";
|
|
16
|
+
// ── Known agent instruction files ─────────────────────────────────────────
|
|
17
|
+
const AGENT_INSTRUCTION_FILES = [
|
|
18
|
+
"CLAUDE.md",
|
|
19
|
+
"AGENTS.md",
|
|
20
|
+
"AGENT.md",
|
|
21
|
+
"GEMINI.md",
|
|
22
|
+
".cursorrules",
|
|
23
|
+
".github/copilot-instructions.md",
|
|
24
|
+
];
|
|
25
|
+
// ── Known workflow files ───────────────────────────────────────────────────
|
|
26
|
+
const WORKFLOW_ENTRIES = [
|
|
27
|
+
{ file: "plan_task.md", label: "Plan", purpose: "Research codebase → implementation plan" },
|
|
28
|
+
{ file: "implement_plan.md", label: "Implement", purpose: "Execute approved plan → code changes" },
|
|
29
|
+
{ file: "fix_bug.md", label: "Fix bug", purpose: "Triage → fix → verify" },
|
|
30
|
+
{
|
|
31
|
+
file: "orchestrate_task.md",
|
|
32
|
+
label: "Run task",
|
|
33
|
+
purpose: "Full task pipeline (plan → implement → review → commit)",
|
|
34
|
+
},
|
|
35
|
+
{ file: "run_sprint.md", label: "Run sprint", purpose: "Full sprint orchestration" },
|
|
36
|
+
{ file: "architect_sprint_plan.md", label: "Sprint plan", purpose: "Sprint planning and task decomposition" },
|
|
37
|
+
{
|
|
38
|
+
file: "architect_sprint_intake.md",
|
|
39
|
+
label: "Sprint intake",
|
|
40
|
+
purpose: "Sprint intake and requirements elicitation",
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
// ── Managed section markers ────────────────────────────────────────────────
|
|
44
|
+
const KB_OPEN_PREFIX = "<!-- forge-kb-links";
|
|
45
|
+
const KB_CLOSE = "<!-- /forge-kb-links -->";
|
|
46
|
+
const WF_OPEN_PREFIX = "<!-- forge-workflow-links";
|
|
47
|
+
const WF_CLOSE = "<!-- /forge-workflow-links -->";
|
|
48
|
+
// ── Content generators ─────────────────────────────────────────────────────
|
|
49
|
+
function buildKbSection(cwd, kbPath) {
|
|
50
|
+
const rows = [
|
|
51
|
+
{ label: "MASTER_INDEX", file: `${kbPath}/MASTER_INDEX.md`, desc: "All sprints, tasks, bugs, and features" },
|
|
52
|
+
{
|
|
53
|
+
label: "Architecture",
|
|
54
|
+
file: `${kbPath}/architecture/INDEX.md`,
|
|
55
|
+
desc: "Stack, processes, database, routing, deployment",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "Business Domain",
|
|
59
|
+
file: `${kbPath}/business-domain/INDEX.md`,
|
|
60
|
+
desc: "Entity model and domain concepts",
|
|
61
|
+
},
|
|
62
|
+
].filter((r) => fs.existsSync(path.join(cwd, r.file)));
|
|
63
|
+
if (rows.length === 0)
|
|
64
|
+
return "";
|
|
65
|
+
const tableRows = rows.map((r) => `| [${r.label}](${r.file}) | ${r.desc} |`).join("\n");
|
|
66
|
+
return [
|
|
67
|
+
`<!-- forge-kb-links: managed by Forge — do not edit manually -->`,
|
|
68
|
+
`## Forge Knowledge Base`,
|
|
69
|
+
``,
|
|
70
|
+
`| Index | Contents |`,
|
|
71
|
+
`|-------|----------|`,
|
|
72
|
+
tableRows,
|
|
73
|
+
``,
|
|
74
|
+
`Personas live in \`.forge/personas/\`.`,
|
|
75
|
+
KB_CLOSE,
|
|
76
|
+
].join("\n");
|
|
77
|
+
}
|
|
78
|
+
function buildWorkflowSection(cwd) {
|
|
79
|
+
const rows = WORKFLOW_ENTRIES.filter((e) => fs.existsSync(path.join(cwd, ".forge", "workflows", e.file)));
|
|
80
|
+
if (rows.length === 0)
|
|
81
|
+
return "";
|
|
82
|
+
const tableRows = rows.map((e) => `| [${e.label}](.forge/workflows/${e.file}) | ${e.purpose} |`).join("\n");
|
|
83
|
+
return [
|
|
84
|
+
`<!-- forge-workflow-links: managed by Forge — do not edit manually -->`,
|
|
85
|
+
`## Forge Workflows`,
|
|
86
|
+
``,
|
|
87
|
+
`| Workflow | Purpose |`,
|
|
88
|
+
`|----------|---------|`,
|
|
89
|
+
tableRows,
|
|
90
|
+
WF_CLOSE,
|
|
91
|
+
].join("\n");
|
|
92
|
+
}
|
|
93
|
+
// ── Section replacement ────────────────────────────────────────────────────
|
|
94
|
+
/**
|
|
95
|
+
* Replace or append a managed section in a file's content.
|
|
96
|
+
* If the section already exists (detected by open-prefix), replaces it.
|
|
97
|
+
* Otherwise, appends it to the end.
|
|
98
|
+
*/
|
|
99
|
+
function upsertSection(content, openPrefix, closeMarker, newSection) {
|
|
100
|
+
if (!newSection)
|
|
101
|
+
return content; // nothing to inject
|
|
102
|
+
// Find existing section
|
|
103
|
+
const openIdx = content.indexOf(openPrefix);
|
|
104
|
+
if (openIdx !== -1) {
|
|
105
|
+
const closeIdx = content.indexOf(closeMarker, openIdx);
|
|
106
|
+
if (closeIdx !== -1) {
|
|
107
|
+
const endIdx = closeIdx + closeMarker.length;
|
|
108
|
+
// Replace existing section
|
|
109
|
+
return content.slice(0, openIdx) + newSection + content.slice(endIdx);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Append at end, ensuring a blank line separator
|
|
113
|
+
const trimmed = content.trimEnd();
|
|
114
|
+
return trimmed + "\n\n" + newSection + "\n";
|
|
115
|
+
}
|
|
116
|
+
// ── Main exported function ─────────────────────────────────────────────────
|
|
117
|
+
/**
|
|
118
|
+
* Run the refresh-kb-links operation on the project at `cwd`.
|
|
119
|
+
*
|
|
120
|
+
* Returns a result record with counts and human-readable messages.
|
|
121
|
+
* Never throws — errors are captured as messages.
|
|
122
|
+
*/
|
|
123
|
+
export async function runRefreshKbLinks(cwd) {
|
|
124
|
+
const result = {
|
|
125
|
+
filesUpdated: 0,
|
|
126
|
+
filesSkipped: 0,
|
|
127
|
+
messages: [],
|
|
128
|
+
};
|
|
129
|
+
// Read kbPath from .forge/config.json
|
|
130
|
+
let kbPath = "engineering";
|
|
131
|
+
try {
|
|
132
|
+
const configRaw = fs.readFileSync(path.join(cwd, ".forge", "config.json"), "utf8");
|
|
133
|
+
const config = JSON.parse(configRaw);
|
|
134
|
+
const paths = config.paths;
|
|
135
|
+
if (paths && typeof paths.engineering === "string" && paths.engineering) {
|
|
136
|
+
kbPath = paths.engineering;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// Config not present — use default kbPath
|
|
141
|
+
}
|
|
142
|
+
const kbSection = buildKbSection(cwd, kbPath);
|
|
143
|
+
const wfSection = buildWorkflowSection(cwd);
|
|
144
|
+
if (!kbSection && !wfSection) {
|
|
145
|
+
result.messages.push("△ refresh-kb-links: no KB or workflow files found to link.");
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
for (const filename of AGENT_INSTRUCTION_FILES) {
|
|
149
|
+
const filePath = path.join(cwd, filename);
|
|
150
|
+
let content;
|
|
151
|
+
try {
|
|
152
|
+
content = fs.readFileSync(filePath, "utf8");
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// File does not exist — skip
|
|
156
|
+
result.filesSkipped++;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
let updated = content;
|
|
160
|
+
if (kbSection) {
|
|
161
|
+
updated = upsertSection(updated, KB_OPEN_PREFIX, KB_CLOSE, kbSection);
|
|
162
|
+
}
|
|
163
|
+
if (wfSection) {
|
|
164
|
+
updated = upsertSection(updated, WF_OPEN_PREFIX, WF_CLOSE, wfSection);
|
|
165
|
+
}
|
|
166
|
+
if (updated !== content) {
|
|
167
|
+
try {
|
|
168
|
+
fs.writeFileSync(filePath, updated, "utf8");
|
|
169
|
+
result.filesUpdated++;
|
|
170
|
+
result.messages.push(`〇 refresh-kb-links: updated ${filename}`);
|
|
171
|
+
}
|
|
172
|
+
catch (err) {
|
|
173
|
+
const e = err;
|
|
174
|
+
result.messages.push(`△ refresh-kb-links: failed to write ${filename}: ${e.message ?? "unknown"}`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
result.filesSkipped++;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Handle .cursor/rules/*.mdc files
|
|
182
|
+
const cursorRulesDir = path.join(cwd, ".cursor", "rules");
|
|
183
|
+
if (fs.existsSync(cursorRulesDir)) {
|
|
184
|
+
try {
|
|
185
|
+
const mdcFiles = fs.readdirSync(cursorRulesDir).filter((f) => f.endsWith(".mdc"));
|
|
186
|
+
for (const mdcFile of mdcFiles) {
|
|
187
|
+
const filePath = path.join(cursorRulesDir, mdcFile);
|
|
188
|
+
let content;
|
|
189
|
+
try {
|
|
190
|
+
content = fs.readFileSync(filePath, "utf8");
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
result.filesSkipped++;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
let updated = content;
|
|
197
|
+
if (kbSection) {
|
|
198
|
+
updated = upsertSection(updated, KB_OPEN_PREFIX, KB_CLOSE, kbSection);
|
|
199
|
+
}
|
|
200
|
+
if (wfSection) {
|
|
201
|
+
updated = upsertSection(updated, WF_OPEN_PREFIX, WF_CLOSE, wfSection);
|
|
202
|
+
}
|
|
203
|
+
if (updated !== content) {
|
|
204
|
+
fs.writeFileSync(filePath, updated, "utf8");
|
|
205
|
+
result.filesUpdated++;
|
|
206
|
+
result.messages.push(`〇 refresh-kb-links: updated .cursor/rules/${mdcFile}`);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
result.filesSkipped++;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// Skip if unreadable
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return result;
|
|
218
|
+
}
|
|
219
|
+
// ── Handler factory ────────────────────────────────────────────────────────
|
|
220
|
+
/**
|
|
221
|
+
* Get a standalone refresh-kb-links handler suitable for direct invocation
|
|
222
|
+
* from Phase 4 step 4-9. Returns a function that takes cwd and calls
|
|
223
|
+
* runRefreshKbLinks.
|
|
224
|
+
*/
|
|
225
|
+
export function getRefreshKbLinksHandler() {
|
|
226
|
+
return runRefreshKbLinks;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=refresh-kb-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-kb-links.js","sourceRoot":"","sources":["../../../src/extensions/forgecli/refresh-kb-links.ts"],"names":[],"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|
|
2
|
+
name: approve
|
|
3
|
+
description: Final architect approval gate for a completed task
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:approve
|
|
7
|
+
|
|
8
|
+
Read the approve workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/architect_approve.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: collate
|
|
3
|
+
description: Regenerate KB documents from the JSON store
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:collate
|
|
7
|
+
|
|
8
|
+
Read the collate workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/collator_agent.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit
|
|
3
|
+
description: Stage and commit completed task artifacts
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:commit
|
|
7
|
+
|
|
8
|
+
Read the commit workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/commit_task.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: enhance
|
|
3
|
+
description: Progressive project-specific enrichment of structural elements
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:enhance
|
|
7
|
+
|
|
8
|
+
Run the enhancement agent to enrich structural elements with project-specific knowledge.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Purpose
|
|
17
|
+
|
|
18
|
+
The enhancement agent observes the project and enriches structural elements
|
|
19
|
+
over time. It makes absolutely essential minimal modifications, preferring
|
|
20
|
+
runtime mix-in (KB references, `{{placeholder}}` substitution, `project-context.json`)
|
|
21
|
+
over modifying base artifacts.
|
|
22
|
+
|
|
23
|
+
## Behavior
|
|
24
|
+
|
|
25
|
+
1. Read `structure-versions.json` to determine current overlay level
|
|
26
|
+
2. Read `project-context.json` for current project specifics
|
|
27
|
+
3. Read KB changes since last enhancement
|
|
28
|
+
4. Scan codebase for patterns discovered since last enhancement
|
|
29
|
+
5. Compare current `.forge/` artifacts against base-pack baseline
|
|
30
|
+
6. For each artifact, determine what project-specific enrichment is warranted
|
|
31
|
+
7. Apply the minimal modification principle
|
|
32
|
+
8. Propose diffs (Phase 2+) or auto-apply (Phase 1)
|
|
33
|
+
9. Create new overlay version in `structure-versions.json` if needed
|
|
34
|
+
|
|
35
|
+
## Arguments
|
|
36
|
+
|
|
37
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-bug
|
|
3
|
+
description: Triage, diagnose, and fix a bug
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:fix-bug
|
|
7
|
+
|
|
8
|
+
Read the fix-bug workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/fix_bug.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implement
|
|
3
|
+
description: Execute the approved implementation plan for a task
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:implement
|
|
7
|
+
|
|
8
|
+
Read the implement workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/implement_plan.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan
|
|
3
|
+
description: Design and document the implementation plan for a task
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:plan
|
|
7
|
+
|
|
8
|
+
Read the plan workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/plan_task.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: quiz-agent
|
|
3
|
+
description: Verify an agent has loaded and understood the project knowledge base
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:quiz-agent
|
|
7
|
+
|
|
8
|
+
Read the quiz-agent workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/quiz_agent.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: retrospective
|
|
3
|
+
description: Produce sprint retrospective and lessons-learned document
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:retrospective
|
|
7
|
+
|
|
8
|
+
Read the retrospective workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/sprint_retrospective.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-code
|
|
3
|
+
description: Code quality review of a completed task implementation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:review-code
|
|
7
|
+
|
|
8
|
+
Read the review-code workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/review_code.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review-plan
|
|
3
|
+
description: Architectural review of a task implementation plan
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:review-plan
|
|
7
|
+
|
|
8
|
+
Read the review-plan workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/review_plan.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run-sprint
|
|
3
|
+
description: Execute all tasks in a sprint (sequential or parallel)
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /{{PREFIX}}:run-sprint
|
|
7
|
+
|
|
8
|
+
Read the run-sprint workflow and follow it.
|
|
9
|
+
|
|
10
|
+
## Locate the Forge plugin
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
FORGE_ROOT: !`echo "${CLAUDE_PLUGIN_ROOT}"`
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Execute
|
|
17
|
+
|
|
18
|
+
Read `.forge/workflows/run_sprint.md` and follow it.
|
|
19
|
+
|
|
20
|
+
## Arguments
|
|
21
|
+
|
|
22
|
+
$ARGUMENTS
|