geo-ai-search-optimization 1.2.1 → 1.2.3
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/README.md +52 -0
- package/package.json +1 -1
- package/resources/geo-ai-search-optimization/references/quick-start.md +5 -1
- package/resources/geo-ai-search-optimization-export-pack/SKILL.md +26 -0
- package/resources/geo-ai-search-optimization-share-pack/SKILL.md +27 -0
- package/resources/geo-ai-search-optimization-usage/SKILL.md +10 -2
- package/resources/geo-ai-search-optimization-usage/references/usage-patterns.md +16 -0
- package/src/cli.js +55 -0
- package/src/export-pack.js +111 -0
- package/src/index.js +2 -0
- package/src/quick-start.js +3 -1
- package/src/share-pack.js +131 -0
package/README.md
CHANGED
|
@@ -207,6 +207,42 @@ geo-ai-search-optimization handoff-bundle https://example.com
|
|
|
207
207
|
- completion report 摘要
|
|
208
208
|
- 下一步该先做哪一个任务
|
|
209
209
|
|
|
210
|
+
## Share Pack 命令
|
|
211
|
+
|
|
212
|
+
如果你希望把同一份 GEO 结果直接分享给 PM、工程、管理层和下一位 agent,现在可以用 `share-pack`:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
geo-ai-search-optimization share-pack ./your-site
|
|
216
|
+
geo-ai-search-optimization share-pack ./your-site --task fix-01 --format json --out ./reports/share-pack.json
|
|
217
|
+
geo-ai-search-optimization share-pack https://example.com
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
`share-pack` 会输出:
|
|
221
|
+
|
|
222
|
+
- 给 PM 的摘要
|
|
223
|
+
- 给工程 / 执行团队的任务视图
|
|
224
|
+
- 给管理层的高层摘要
|
|
225
|
+
- 给下一位 agent 的交接入口
|
|
226
|
+
- 建议分享顺序
|
|
227
|
+
|
|
228
|
+
## Export Pack 命令
|
|
229
|
+
|
|
230
|
+
如果你希望直接导出一整包可外发文件,而不是自己一个个生成,现在可以用 `export-pack`:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
geo-ai-search-optimization export-pack ./your-site --out-dir ./exports/your-site-pack
|
|
234
|
+
geo-ai-search-optimization export-pack ./your-site --task fix-01 --format json --out-dir ./exports/your-site-json
|
|
235
|
+
geo-ai-search-optimization export-pack https://example.com --out-dir ./exports/example-pack
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
`export-pack` 会生成:
|
|
239
|
+
|
|
240
|
+
- `pm-brief`
|
|
241
|
+
- `owner-board`
|
|
242
|
+
- `exec-summary`
|
|
243
|
+
- `agent-handoff-bundle`
|
|
244
|
+
- `share-pack`
|
|
245
|
+
|
|
210
246
|
## Fix Plan 命令
|
|
211
247
|
|
|
212
248
|
如果你已经跑过 `audit`、`report` 或 `onboard-url`,下一步就可以直接把结果转成 PM 待办清单:
|
|
@@ -361,6 +397,8 @@ geo-ai-search-optimization agent-handoff ./my-site
|
|
|
361
397
|
geo-ai-search-optimization apply-plan ./my-site
|
|
362
398
|
geo-ai-search-optimization completion-report ./my-site
|
|
363
399
|
geo-ai-search-optimization handoff-bundle ./my-site
|
|
400
|
+
geo-ai-search-optimization share-pack ./my-site
|
|
401
|
+
geo-ai-search-optimization export-pack ./my-site --out-dir ./exports/my-site-pack
|
|
364
402
|
geo-ai-search-optimization exec-summary ./my-site
|
|
365
403
|
geo-ai-search-optimization fix-plan ./my-site
|
|
366
404
|
geo-ai-search-optimization owner-board ./my-site
|
|
@@ -376,6 +414,20 @@ geo-ai-search-optimization version
|
|
|
376
414
|
geo-ai-search-optimization help
|
|
377
415
|
```
|
|
378
416
|
|
|
417
|
+
## New in 1.2.3
|
|
418
|
+
|
|
419
|
+
- 新增 `export-pack`
|
|
420
|
+
- 直接生成一组可外发文件,而不是只在终端显示
|
|
421
|
+
- 一次导出 PM、工程、管理层、Agent 四类视图
|
|
422
|
+
- 新增 `geo-ai-search-optimization-export-pack` skill,帮助消费导出结果
|
|
423
|
+
|
|
424
|
+
## New in 1.2.2
|
|
425
|
+
|
|
426
|
+
- 新增 `share-pack`
|
|
427
|
+
- 让同一份 GEO 结果按 PM、工程、管理层、Agent 四种视图分享
|
|
428
|
+
- 更适合直接转发,而不是人工重新整理内容
|
|
429
|
+
- 新增 `geo-ai-search-optimization-share-pack` skill,帮助消费分享包
|
|
430
|
+
|
|
379
431
|
## New in 1.2.1
|
|
380
432
|
|
|
381
433
|
- 新增 `handoff-bundle`
|
package/package.json
CHANGED
|
@@ -46,6 +46,8 @@ geo-ai-search-optimization agent-handoff ./your-site --out ./reports/agent-hando
|
|
|
46
46
|
geo-ai-search-optimization apply-plan ./your-site --out ./reports/apply-plan.md
|
|
47
47
|
geo-ai-search-optimization completion-report ./your-site --out ./reports/completion-report.md
|
|
48
48
|
geo-ai-search-optimization handoff-bundle ./your-site --out ./reports/handoff-bundle.md
|
|
49
|
+
geo-ai-search-optimization share-pack ./your-site --out ./reports/share-pack.md
|
|
50
|
+
geo-ai-search-optimization export-pack ./your-site --out-dir ./exports/your-site-pack
|
|
49
51
|
geo-ai-search-optimization owner-board ./your-site --out ./reports/owner-board.md
|
|
50
52
|
geo-ai-search-optimization meeting-pack ./your-site --out ./reports/meeting-pack.md
|
|
51
53
|
geo-ai-search-optimization pm-brief ./your-site --out ./reports/pm-brief.md
|
|
@@ -63,7 +65,9 @@ geo-ai-search-optimization roadmap ./your-site --out ./reports/roadmap.md
|
|
|
63
65
|
5. 需要 agent 直接开始做时,生成 apply-plan
|
|
64
66
|
6. 完成一轮后生成 completion-report
|
|
65
67
|
7. 需要完整交接包时生成 handoff-bundle
|
|
66
|
-
8.
|
|
68
|
+
8. 需要发给不同角色时生成 share-pack
|
|
69
|
+
9. 需要一整包文件时生成 export-pack
|
|
70
|
+
10. 重跑 scan / audit / report 验证是否改善
|
|
67
71
|
|
|
68
72
|
## 推荐节奏
|
|
69
73
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: geo-ai-search-optimization-export-pack
|
|
3
|
+
description: Export GEO results into a shareable folder structure for different audiences. Use when a PM or agent wants ready-to-send files such as pm-brief, owner-board, exec-summary, and agent handoff bundle generated together.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GEO Export Pack
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants one command to generate a folder of GEO deliverables.
|
|
9
|
+
|
|
10
|
+
`GEO = Generative Engine Optimization`
|
|
11
|
+
|
|
12
|
+
## What it exports
|
|
13
|
+
|
|
14
|
+
- `pm-brief`
|
|
15
|
+
- `owner-board`
|
|
16
|
+
- `exec-summary`
|
|
17
|
+
- `agent-handoff-bundle`
|
|
18
|
+
- `share-pack`
|
|
19
|
+
|
|
20
|
+
## How to use it
|
|
21
|
+
|
|
22
|
+
- export once
|
|
23
|
+
- send `pm-brief` to PM
|
|
24
|
+
- send `owner-board` to execution teams
|
|
25
|
+
- send `exec-summary` to management
|
|
26
|
+
- send `agent-handoff-bundle` to the next agent
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: geo-ai-search-optimization-share-pack
|
|
3
|
+
description: Use when a GEO result needs to be shared to different audiences. It combines PM, execution, executive, and agent-facing views into one package so teams can distribute the right output without manually repackaging artifacts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GEO Share Pack
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants a shareable GEO package for multiple audiences.
|
|
9
|
+
|
|
10
|
+
`GEO = Generative Engine Optimization`
|
|
11
|
+
|
|
12
|
+
## What it contains
|
|
13
|
+
|
|
14
|
+
A share pack combines:
|
|
15
|
+
|
|
16
|
+
- PM-facing summary
|
|
17
|
+
- execution-team task view
|
|
18
|
+
- executive summary
|
|
19
|
+
- agent handoff bundle
|
|
20
|
+
|
|
21
|
+
## How to use it
|
|
22
|
+
|
|
23
|
+
- read the audience order first
|
|
24
|
+
- send the PM section to prioritization owners
|
|
25
|
+
- send the owner board section to execution teams
|
|
26
|
+
- send the executive section to management
|
|
27
|
+
- send the handoff bundle section to the next agent
|
|
@@ -13,7 +13,7 @@ Treat this tool as a PM-friendly GEO workflow for websites.
|
|
|
13
13
|
|
|
14
14
|
`GEO = Generative Engine Optimization`
|
|
15
15
|
|
|
16
|
-
The package is best explained as
|
|
16
|
+
The package is best explained as eleven layers:
|
|
17
17
|
|
|
18
18
|
1. `onboard-url` / `onboard`: first look
|
|
19
19
|
2. `scan`: raw signal check
|
|
@@ -23,7 +23,9 @@ The package is best explained as nine layers:
|
|
|
23
23
|
6. `apply-plan`: execution loop
|
|
24
24
|
7. `completion-report`: closeout
|
|
25
25
|
8. `handoff-bundle`: all-in-one package
|
|
26
|
-
9. `
|
|
26
|
+
9. `share-pack`: audience-ready delivery
|
|
27
|
+
10. `export-pack`: folder export
|
|
28
|
+
11. `pm-brief` / `roadmap`: stakeholder alignment
|
|
27
29
|
|
|
28
30
|
## Recommended command order
|
|
29
31
|
|
|
@@ -45,6 +47,8 @@ npx geo-ai-search-optimization agent-handoff ./your-site
|
|
|
45
47
|
npx geo-ai-search-optimization apply-plan ./your-site
|
|
46
48
|
npx geo-ai-search-optimization completion-report ./your-site
|
|
47
49
|
npx geo-ai-search-optimization handoff-bundle ./your-site
|
|
50
|
+
npx geo-ai-search-optimization share-pack ./your-site
|
|
51
|
+
npx geo-ai-search-optimization export-pack ./your-site
|
|
48
52
|
npx geo-ai-search-optimization owner-board ./your-site
|
|
49
53
|
npx geo-ai-search-optimization roadmap ./your-site
|
|
50
54
|
```
|
|
@@ -61,6 +65,8 @@ npx geo-ai-search-optimization roadmap ./your-site
|
|
|
61
65
|
- `apply-plan`: turn handoff into execution packets with validation commands and completion template
|
|
62
66
|
- `completion-report`: summarize what the agent finished, residual risks, and next-round work
|
|
63
67
|
- `handoff-bundle`: combine handoff, execution, and closeout into one artifact
|
|
68
|
+
- `share-pack`: prepare role-specific shareable outputs for PM, engineering, management, and agents
|
|
69
|
+
- `export-pack`: generate a folder with multiple ready-to-send files
|
|
64
70
|
- `owner-board`: group tasks by PM / engineering / SEO / content
|
|
65
71
|
- `pm-brief`: prepare a PM summary for meetings and prioritization
|
|
66
72
|
- `roadmap`: turn tasks into a 2-week / 4-week execution sequence
|
|
@@ -76,6 +82,8 @@ When explaining the tool to a user:
|
|
|
76
82
|
- if the user wants the next agent to start executing, move them to `apply-plan`
|
|
77
83
|
- if the user wants a closeout summary after one round, move them to `completion-report`
|
|
78
84
|
- if the user wants one consolidated artifact, move them to `handoff-bundle`
|
|
85
|
+
- if the user wants something ready to forward to multiple audiences, move them to `share-pack`
|
|
86
|
+
- if the user wants actual files on disk for each audience, move them to `export-pack`
|
|
79
87
|
- if the user already has a report, move them to `fix-plan`, `owner-board`, or `roadmap`
|
|
80
88
|
|
|
81
89
|
Read [references/usage-patterns.md](references/usage-patterns.md) when you need response patterns and command selection examples.
|
|
@@ -95,6 +95,22 @@ Recommend:
|
|
|
95
95
|
npx geo-ai-search-optimization handoff-bundle ./your-site
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
## If the user says "我想直接分享给不同角色"
|
|
99
|
+
|
|
100
|
+
Recommend:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npx geo-ai-search-optimization share-pack ./your-site
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## If the user says "我想直接导出一整包文件"
|
|
107
|
+
|
|
108
|
+
Recommend:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx geo-ai-search-optimization export-pack ./your-site --out-dir ./exports/your-site-pack
|
|
112
|
+
```
|
|
113
|
+
|
|
98
114
|
## If the user says "我要开会同步"
|
|
99
115
|
|
|
100
116
|
Recommend:
|
package/src/cli.js
CHANGED
|
@@ -17,6 +17,7 @@ import { createLlmsTxt } from "./llms-txt.js";
|
|
|
17
17
|
import { auditProject, renderAuditMarkdown, writeAuditOutput } from "./audit.js";
|
|
18
18
|
import { createFixPlan, renderFixPlanMarkdown, writeFixPlanOutput } from "./fix-plan.js";
|
|
19
19
|
import { createExecSummary, renderExecSummaryMarkdown, writeExecSummaryOutput } from "./exec-summary.js";
|
|
20
|
+
import { renderExportPackMarkdown, writeExportPack } from "./export-pack.js";
|
|
20
21
|
import { createOwnerBoard, renderOwnerBoardMarkdown, writeOwnerBoardOutput } from "./owner-board.js";
|
|
21
22
|
import { createMeetingPack, renderMeetingPackMarkdown, writeMeetingPackOutput } from "./meeting-pack.js";
|
|
22
23
|
import { createPmBrief, renderPmBriefMarkdown, writePmBriefOutput } from "./pm-brief.js";
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
} from "./interactive-onboarding.js";
|
|
30
31
|
import { createQuickStartPlan, renderQuickStartMarkdown, writeQuickStartOutput } from "./quick-start.js";
|
|
31
32
|
import { createSchemaTemplate } from "./schema.js";
|
|
33
|
+
import { createSharePack, renderSharePackMarkdown, writeSharePackOutput } from "./share-pack.js";
|
|
32
34
|
import { analyzeWebsiteUrl, renderWebsiteOnboardingMarkdown, writeWebsiteOnboardingOutput } from "./url-onboarding.js";
|
|
33
35
|
|
|
34
36
|
let cachedVersion;
|
|
@@ -64,6 +66,8 @@ function printHelp() {
|
|
|
64
66
|
" geo-ai-search-optimization apply-plan <input> [--task <id>] [--format <markdown|json>] [--out <file>]",
|
|
65
67
|
" geo-ai-search-optimization completion-report <input> [--format <markdown|json>] [--out <file>]",
|
|
66
68
|
" geo-ai-search-optimization handoff-bundle <input> [--task <id>] [--format <markdown|json>] [--out <file>]",
|
|
69
|
+
" geo-ai-search-optimization share-pack <input> [--task <id>] [--format <markdown|json>] [--out <file>]",
|
|
70
|
+
" geo-ai-search-optimization export-pack <input> [--task <id>] [--format <markdown|json>] [--out-dir <dir>]",
|
|
67
71
|
" geo-ai-search-optimization exec-summary <input> [--format <markdown|json>] [--out <file>]",
|
|
68
72
|
" geo-ai-search-optimization fix-plan <input> [--format <markdown|json>] [--out <file>]",
|
|
69
73
|
" geo-ai-search-optimization owner-board <input> [--format <markdown|json>] [--out <file>]",
|
|
@@ -445,6 +449,47 @@ async function handleHandoffBundle(args) {
|
|
|
445
449
|
process.stdout.write(renderedOutput);
|
|
446
450
|
}
|
|
447
451
|
|
|
452
|
+
async function handleSharePack(args) {
|
|
453
|
+
const input = args.find((value) => !value.startsWith("-"));
|
|
454
|
+
if (!input) {
|
|
455
|
+
throw new Error("share-pack 需要一个输入值,可以是项目路径、网站网址或已导出的 JSON 工件");
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
const format = getFlagValue(args, "--format");
|
|
459
|
+
const pack = await createSharePack(input, {
|
|
460
|
+
format,
|
|
461
|
+
taskId: getFlagValue(args, "--task")
|
|
462
|
+
});
|
|
463
|
+
const outputJson = format === "json";
|
|
464
|
+
const renderedOutput = outputJson
|
|
465
|
+
? `${JSON.stringify(pack, null, 2)}\n`
|
|
466
|
+
: renderSharePackMarkdown(pack);
|
|
467
|
+
|
|
468
|
+
const outputPath = getFlagValue(args, "--out");
|
|
469
|
+
if (outputPath) {
|
|
470
|
+
const resolvedOutputPath = await writeSharePackOutput(outputPath, renderedOutput);
|
|
471
|
+
process.stdout.write(`已保存 share pack:${resolvedOutputPath}\n`);
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
process.stdout.write(renderedOutput);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
async function handleExportPack(args) {
|
|
479
|
+
const input = args.find((value) => !value.startsWith("-"));
|
|
480
|
+
if (!input) {
|
|
481
|
+
throw new Error("export-pack 需要一个输入值,可以是项目路径、网站网址或已导出的 JSON 工件");
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const pack = await writeExportPack(input, {
|
|
485
|
+
format: getFlagValue(args, "--format"),
|
|
486
|
+
taskId: getFlagValue(args, "--task"),
|
|
487
|
+
outputDir: getFlagValue(args, "--out-dir")
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
process.stdout.write(renderExportPackMarkdown(pack));
|
|
491
|
+
}
|
|
492
|
+
|
|
448
493
|
async function handleExecSummary(args) {
|
|
449
494
|
const input = args.find((value) => !value.startsWith("-"));
|
|
450
495
|
if (!input) {
|
|
@@ -638,6 +683,16 @@ export async function runCli(args = []) {
|
|
|
638
683
|
return;
|
|
639
684
|
}
|
|
640
685
|
|
|
686
|
+
if (command === "share-pack") {
|
|
687
|
+
await handleSharePack(rest);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
if (command === "export-pack") {
|
|
692
|
+
await handleExportPack(rest);
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
|
|
641
696
|
if (command === "exec-summary") {
|
|
642
697
|
await handleExecSummary(rest);
|
|
643
698
|
return;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createExecSummary, renderExecSummaryMarkdown } from "./exec-summary.js";
|
|
4
|
+
import { createHandoffBundle, renderHandoffBundleMarkdown } from "./handoff-bundle.js";
|
|
5
|
+
import { createOwnerBoard, renderOwnerBoardMarkdown } from "./owner-board.js";
|
|
6
|
+
import { createPmBrief, renderPmBriefMarkdown } from "./pm-brief.js";
|
|
7
|
+
import { createSharePack, renderSharePackMarkdown } from "./share-pack.js";
|
|
8
|
+
|
|
9
|
+
const VALID_FORMATS = new Set(["markdown", "json"]);
|
|
10
|
+
|
|
11
|
+
function normalizeFormat(format) {
|
|
12
|
+
const resolved = (format || "markdown").toLowerCase();
|
|
13
|
+
if (!VALID_FORMATS.has(resolved)) {
|
|
14
|
+
throw new Error(`不支持的 export-pack 格式:${format}。可选值:${Array.from(VALID_FORMATS).join(", ")}`);
|
|
15
|
+
}
|
|
16
|
+
return resolved;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function sanitizeSegment(value) {
|
|
20
|
+
return String(value)
|
|
21
|
+
.replace(/[^a-z0-9-_]+/gi, "-")
|
|
22
|
+
.replace(/^-+|-+$/g, "")
|
|
23
|
+
.toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function buildBaseName(sourceType, source) {
|
|
27
|
+
if (sourceType === "url") {
|
|
28
|
+
try {
|
|
29
|
+
const hostname = new URL(source).hostname || "website";
|
|
30
|
+
return sanitizeSegment(hostname) || "website";
|
|
31
|
+
} catch {
|
|
32
|
+
return "website";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return sanitizeSegment(path.basename(source)) || "site";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getExtension(format) {
|
|
40
|
+
return format === "json" ? "json" : "md";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function renderByFormat(payload, renderMarkdown, format) {
|
|
44
|
+
return format === "json" ? `${JSON.stringify(payload, null, 2)}\n` : renderMarkdown(payload);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export async function createExportPack(input, options = {}) {
|
|
48
|
+
const format = normalizeFormat(options.format);
|
|
49
|
+
const taskId = options.taskId || null;
|
|
50
|
+
const [sharePack, pmBrief, ownerBoard, execSummary, handoffBundle] = await Promise.all([
|
|
51
|
+
createSharePack(input, { format: "json", taskId }),
|
|
52
|
+
createPmBrief(input, { format: "json" }),
|
|
53
|
+
createOwnerBoard(input, { format: "json" }),
|
|
54
|
+
createExecSummary(input, { format: "json" }),
|
|
55
|
+
createHandoffBundle(input, { format: "json", taskId })
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
const baseName = buildBaseName(sharePack.sourceType, sharePack.source);
|
|
59
|
+
const extension = getExtension(format);
|
|
60
|
+
const outputDir = path.resolve(options.outputDir || `./exports/${baseName}-geo-pack`);
|
|
61
|
+
|
|
62
|
+
const files = [
|
|
63
|
+
{ key: "share_pack", filename: `share-pack.${extension}`, content: renderByFormat(sharePack, renderSharePackMarkdown, format) },
|
|
64
|
+
{ key: "pm", filename: `pm-brief.${extension}`, content: renderByFormat(pmBrief, renderPmBriefMarkdown, format) },
|
|
65
|
+
{ key: "engineering", filename: `owner-board.${extension}`, content: renderByFormat(ownerBoard, renderOwnerBoardMarkdown, format) },
|
|
66
|
+
{ key: "exec", filename: `exec-summary.${extension}`, content: renderByFormat(execSummary, renderExecSummaryMarkdown, format) },
|
|
67
|
+
{ key: "agent", filename: `agent-handoff-bundle.${extension}`, content: renderByFormat(handoffBundle, renderHandoffBundleMarkdown, format) }
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
kind: "geo-export-pack",
|
|
72
|
+
source: sharePack.source,
|
|
73
|
+
sourceType: sharePack.sourceType,
|
|
74
|
+
format,
|
|
75
|
+
outputDir,
|
|
76
|
+
files
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export async function writeExportPack(input, options = {}) {
|
|
81
|
+
const pack = await createExportPack(input, options);
|
|
82
|
+
await fs.mkdir(pack.outputDir, { recursive: true });
|
|
83
|
+
|
|
84
|
+
const writtenFiles = [];
|
|
85
|
+
for (const file of pack.files) {
|
|
86
|
+
const targetPath = path.join(pack.outputDir, file.filename);
|
|
87
|
+
await fs.writeFile(targetPath, file.content, "utf8");
|
|
88
|
+
writtenFiles.push({ ...file, path: targetPath });
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return { ...pack, files: writtenFiles };
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function renderExportPackMarkdown(pack) {
|
|
95
|
+
const lines = [
|
|
96
|
+
"# GEO Export Pack",
|
|
97
|
+
"",
|
|
98
|
+
`- 输入来源:\`${pack.source}\``,
|
|
99
|
+
`- 来源类型:\`${pack.sourceType}\``,
|
|
100
|
+
`- 导出目录:\`${pack.outputDir}\``,
|
|
101
|
+
"",
|
|
102
|
+
"## 导出文件",
|
|
103
|
+
""
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
for (const file of pack.files) {
|
|
107
|
+
lines.push(`- ${file.key}:\`${file.path || path.join(pack.outputDir, file.filename)}\``);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return `${lines.join("\n")}\n`;
|
|
111
|
+
}
|
package/src/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { runCli } from "./cli.js";
|
|
|
15
15
|
export { runDoctor, renderDoctorMarkdown } from "./doctor.js";
|
|
16
16
|
export { createLlmsTxt } from "./llms-txt.js";
|
|
17
17
|
export { createExecSummary, renderExecSummaryMarkdown, writeExecSummaryOutput } from "./exec-summary.js";
|
|
18
|
+
export { createExportPack, renderExportPackMarkdown, writeExportPack } from "./export-pack.js";
|
|
18
19
|
export { createMeetingPack, renderMeetingPackMarkdown, writeMeetingPackOutput } from "./meeting-pack.js";
|
|
19
20
|
export { createOwnerBoard, renderOwnerBoardMarkdown, writeOwnerBoardOutput } from "./owner-board.js";
|
|
20
21
|
export { createPmBrief, renderPmBriefMarkdown, writePmBriefOutput } from "./pm-brief.js";
|
|
@@ -23,4 +24,5 @@ export { generateReport, writeReportOutput } from "./report.js";
|
|
|
23
24
|
export { createRoadmap, renderRoadmapMarkdown, writeRoadmapOutput } from "./roadmap.js";
|
|
24
25
|
export { createSchemaTemplate } from "./schema.js";
|
|
25
26
|
export { scanProject, renderScanMarkdown, writeScanOutput } from "./scan.js";
|
|
27
|
+
export { createSharePack, renderSharePackMarkdown, writeSharePackOutput } from "./share-pack.js";
|
|
26
28
|
export { analyzeWebsiteUrl, renderWebsiteOnboardingMarkdown, writeWebsiteOnboardingOutput } from "./url-onboarding.js";
|
package/src/quick-start.js
CHANGED
|
@@ -61,7 +61,9 @@ function buildSteps() {
|
|
|
61
61
|
"geo-ai-search-optimization agent-handoff ./your-site --out ./reports/agent-handoff.md",
|
|
62
62
|
"geo-ai-search-optimization apply-plan ./your-site --out ./reports/apply-plan.md",
|
|
63
63
|
"geo-ai-search-optimization completion-report ./your-site --out ./reports/completion-report.md",
|
|
64
|
-
"geo-ai-search-optimization handoff-bundle ./your-site --out ./reports/handoff-bundle.md"
|
|
64
|
+
"geo-ai-search-optimization handoff-bundle ./your-site --out ./reports/handoff-bundle.md",
|
|
65
|
+
"geo-ai-search-optimization share-pack ./your-site --out ./reports/share-pack.md",
|
|
66
|
+
"geo-ai-search-optimization export-pack ./your-site --out-dir ./exports/your-site-pack"
|
|
65
67
|
]
|
|
66
68
|
},
|
|
67
69
|
{
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { createExecSummary, writeExecSummaryOutput } from "./exec-summary.js";
|
|
2
|
+
import { createHandoffBundle } from "./handoff-bundle.js";
|
|
3
|
+
import { createOwnerBoard } from "./owner-board.js";
|
|
4
|
+
import { createPmBrief } from "./pm-brief.js";
|
|
5
|
+
|
|
6
|
+
const VALID_FORMATS = new Set(["markdown", "json"]);
|
|
7
|
+
|
|
8
|
+
function normalizeFormat(format) {
|
|
9
|
+
const resolved = (format || "markdown").toLowerCase();
|
|
10
|
+
if (!VALID_FORMATS.has(resolved)) {
|
|
11
|
+
throw new Error(`不支持的 share-pack 格式:${format}。可选值:${Array.from(VALID_FORMATS).join(", ")}`);
|
|
12
|
+
}
|
|
13
|
+
return resolved;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function buildRecommendedAudienceOrder(pack) {
|
|
17
|
+
const order = ["PM", "工程", "管理层", "Agent"];
|
|
18
|
+
if (pack.execSummary.thisWeek.length === 0) {
|
|
19
|
+
return ["PM", "管理层", "工程", "Agent"];
|
|
20
|
+
}
|
|
21
|
+
return order;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function buildShareGuidance(pack) {
|
|
25
|
+
const guidance = [];
|
|
26
|
+
|
|
27
|
+
guidance.push("先把 PM brief 发给负责排优先级和推进的人。");
|
|
28
|
+
guidance.push("把 owner board 发给执行团队,用来分工。");
|
|
29
|
+
guidance.push("把 exec summary 发给管理层,只保留为什么现在要做与本周重点。");
|
|
30
|
+
guidance.push("把 handoff bundle 发给下一位 agent,让它直接接手。");
|
|
31
|
+
|
|
32
|
+
if (pack.handoffBundle.summary.executionMode === "advice-only") {
|
|
33
|
+
guidance.push("当前还是建议模式,分享时要明确:还缺仓库或 CMS 上下文。");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return guidance;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export async function createSharePack(input, options = {}) {
|
|
40
|
+
const format = normalizeFormat(options.format);
|
|
41
|
+
const [pmBrief, ownerBoard, execSummary, handoffBundle] = await Promise.all([
|
|
42
|
+
createPmBrief(input, { format: "json" }),
|
|
43
|
+
createOwnerBoard(input, { format: "json" }),
|
|
44
|
+
createExecSummary(input, { format: "json" }),
|
|
45
|
+
createHandoffBundle(input, { format: "json", taskId: options.taskId })
|
|
46
|
+
]);
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
kind: "geo-share-pack",
|
|
50
|
+
source: pmBrief.source,
|
|
51
|
+
sourceType: pmBrief.sourceType,
|
|
52
|
+
format,
|
|
53
|
+
audienceOrder: buildRecommendedAudienceOrder({
|
|
54
|
+
pmBrief,
|
|
55
|
+
ownerBoard,
|
|
56
|
+
execSummary,
|
|
57
|
+
handoffBundle
|
|
58
|
+
}),
|
|
59
|
+
guidance: buildShareGuidance({
|
|
60
|
+
pmBrief,
|
|
61
|
+
ownerBoard,
|
|
62
|
+
execSummary,
|
|
63
|
+
handoffBundle
|
|
64
|
+
}),
|
|
65
|
+
pmBrief,
|
|
66
|
+
ownerBoard,
|
|
67
|
+
execSummary,
|
|
68
|
+
handoffBundle
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function renderSharePackMarkdown(pack) {
|
|
73
|
+
const lines = [
|
|
74
|
+
"# GEO Share Pack",
|
|
75
|
+
"",
|
|
76
|
+
`- 输入来源:\`${pack.source}\``,
|
|
77
|
+
`- 来源类型:\`${pack.sourceType}\``,
|
|
78
|
+
`- 建议分享顺序:${pack.audienceOrder.join(" -> ")}`,
|
|
79
|
+
"",
|
|
80
|
+
"## 分享建议",
|
|
81
|
+
""
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
for (const item of pack.guidance) {
|
|
85
|
+
lines.push(`- ${item}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
lines.push(
|
|
89
|
+
"",
|
|
90
|
+
"## 给 PM",
|
|
91
|
+
"",
|
|
92
|
+
`- 一句话总结:${pack.pmBrief.oneLiner}`,
|
|
93
|
+
`- 当前状态:${pack.pmBrief.status}`,
|
|
94
|
+
`- 本周先做:${pack.pmBrief.thisWeek[0]?.action ?? "暂无"}`,
|
|
95
|
+
"",
|
|
96
|
+
"## 给工程 / 执行团队",
|
|
97
|
+
""
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
for (const column of pack.ownerBoard.columns.filter((column) => column.count > 0)) {
|
|
101
|
+
lines.push(`- ${column.name}:${column.count} 项`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
lines.push(
|
|
105
|
+
"",
|
|
106
|
+
"## 给管理层",
|
|
107
|
+
"",
|
|
108
|
+
`- Headline:${pack.execSummary.headline}`,
|
|
109
|
+
`- Why Now:${pack.execSummary.whyNow}`,
|
|
110
|
+
`- Business Impact:${pack.execSummary.businessImpact}`,
|
|
111
|
+
"",
|
|
112
|
+
"## 给下一个 Agent",
|
|
113
|
+
"",
|
|
114
|
+
`- 执行模式:${pack.handoffBundle.summary.executionMode}`,
|
|
115
|
+
`- 执行类型:${pack.handoffBundle.summary.executionType}`,
|
|
116
|
+
`- 第一包:${pack.handoffBundle.applyPlan.packets[0]?.title ?? "无"}`,
|
|
117
|
+
"",
|
|
118
|
+
"## 下一步",
|
|
119
|
+
""
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
lines.push("- PM 先确认本周优先级。");
|
|
123
|
+
lines.push("- 工程按 owner board 分工。");
|
|
124
|
+
lines.push("- Agent 直接从 handoff bundle 的第一包开始。");
|
|
125
|
+
|
|
126
|
+
return `${lines.join("\n")}\n`;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export async function writeSharePackOutput(outputPath, content) {
|
|
130
|
+
return writeExecSummaryOutput(outputPath, content);
|
|
131
|
+
}
|