@wwkit/harness 1.0.45 → 1.0.46

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.
Files changed (104) hide show
  1. package/package.json +1 -1
  2. package/skills/convert-files/scripts/convert.js +1 -1
  3. package/skills/pea/SKILL.md +6 -1
  4. package/skills/pea/references/tpl-prd/epic.md +10 -0
  5. package/skills/pea/references/tpl-prd/us.md +4 -4
  6. package/skills/peago/SKILL.md +113 -0
  7. package/skills/peago/references/extract/baseline.md +17 -0
  8. package/skills/peago/references/extract/spec.md +117 -0
  9. package/skills/peago/references/res2kb/spec.md +113 -0
  10. package/skills/peago/references/spec-format.md +123 -0
  11. package/skills/peago/references/translate/baseline.md +26 -0
  12. package/skills/peago/references/translate/spec.md +132 -0
  13. package/skills/shared/references/template/pea/spec-agile.md +15 -6
  14. package/skills/shared/references/template/pea/spec-common.md +12 -2
  15. package/skills/shared/scripts/format.md +1 -1
  16. package/skills/extract/SKILL.md +0 -251
  17. package/skills/extract/references/detail_schema.json5 +0 -49
  18. package/skills/extract/references/detail_workflow.md +0 -55
  19. package/skills/extract/references/list_rule_gen.md +0 -109
  20. package/skills/extract/references/list_schema.json5 +0 -34
  21. package/skills/extract/references/list_workflow.md +0 -135
  22. package/skills/extract/references/navi_schema.json5 +0 -23
  23. package/skills/extract/references/navi_workflow.md +0 -45
  24. package/skills/extract/references/planning_template.md +0 -206
  25. package/skills/extract/references/text_schema.json5 +0 -22
  26. package/skills/extract/references/text_workflow.md +0 -41
  27. package/skills/extract/scripts/build_xpath.js +0 -31
  28. package/skills/extract/scripts/clean_html.js +0 -91
  29. package/skills/extract/scripts/extract_detail.js +0 -72
  30. package/skills/extract/scripts/extract_regex.js +0 -82
  31. package/skills/extract/scripts/extract_sample.js +0 -49
  32. package/skills/extract/scripts/to_text.js +0 -21
  33. package/skills/extract/scripts/validate_schema.js +0 -40
  34. package/skills/revise/SKILL.md +0 -66
  35. package/skills/revise/references/article.md +0 -37
  36. package/skills/revise/references/article.schema.json5 +0 -40
  37. package/skills/revise/references/gallery.md +0 -35
  38. package/skills/revise/references/gallery.schema.json5 +0 -40
  39. package/skills/revise/references/question.md +0 -33
  40. package/skills/revise/references/question.schema.json5 +0 -31
  41. package/skills/revise/references/sprint_for_revise.md +0 -46
  42. package/skills/revise/references/status.md +0 -32
  43. package/skills/revise/references/status.schema.json5 +0 -27
  44. package/skills/revise/scripts/check_input_vars.js +0 -127
  45. package/skills/revise/scripts/init.js +0 -84
  46. package/skills/revise/scripts/resolve_run_vars.js +0 -71
  47. package/skills/revise/scripts/validate-schema.js +0 -94
  48. package/skills/translate/SKILL.md +0 -398
  49. package/skills/translate/app.json5 +0 -70
  50. package/skills/translate/package.json +0 -11
  51. package/skills/translate/references/failure-diagnosis.md +0 -43
  52. package/skills/translate/references/format-prompt.md +0 -62
  53. package/skills/translate/references/format-rules.md +0 -39
  54. package/skills/translate/references/global-review-rules.md +0 -23
  55. package/skills/translate/references/glossary-prompt.md +0 -86
  56. package/skills/translate/references/glossary-rules.md +0 -44
  57. package/skills/translate/references/prepare-prompt.md +0 -110
  58. package/skills/translate/references/prepare-rules.md +0 -20
  59. package/skills/translate/references/resume-detection.md +0 -51
  60. package/skills/translate/references/rulings.md +0 -15
  61. package/skills/translate/references/translation-prompt.md +0 -73
  62. package/skills/translate/references/translation-rules.md +0 -51
  63. package/skills/translate/scripts/check-boundaries.js +0 -169
  64. package/skills/translate/scripts/check-paragraphs.js +0 -71
  65. package/skills/translate/scripts/chunk-bilingual.js +0 -123
  66. package/skills/translate/scripts/chunk-text.js +0 -145
  67. package/skills/translate/scripts/clean-text.js +0 -121
  68. package/skills/translate/scripts/count-terms.js +0 -54
  69. package/skills/translate/scripts/extract-pdf.js +0 -94
  70. package/skills/translate/scripts/generate-review.js +0 -179
  71. package/skills/translate/scripts/init-progress.js +0 -144
  72. package/skills/translate/scripts/md-to-docx.js +0 -381
  73. package/skills/translate/scripts/merge-format.js +0 -110
  74. package/skills/translate/scripts/merge-result.js +0 -113
  75. package/skills/translate/scripts/verify-chunk.js +0 -185
  76. package/skills/translate/todos.md +0 -38
  77. package/skills/translate-file/SKILL.md +0 -45
  78. package/skills/translate-file/package.json +0 -10
  79. package/skills/translate-file/references/sprint_for_preprocess.md +0 -14
  80. package/skills/translate-file/references/sprint_for_teardown.md +0 -15
  81. package/skills/translate-file/references/sprint_for_translate.md +0 -74
  82. package/skills/translate-file/references/translation_prompt.md +0 -43
  83. package/skills/translate-file/scripts/check_input_vars.js +0 -53
  84. package/skills/translate-file/scripts/chunk_text.js +0 -167
  85. package/skills/translate-file/scripts/clean_text.js +0 -121
  86. package/skills/translate-file/scripts/extract.js +0 -98
  87. package/skills/translate-file/scripts/generate_review.js +0 -155
  88. package/skills/translate-file/scripts/init.js +0 -86
  89. package/skills/translate-file/scripts/merge_results.js +0 -112
  90. package/skills/translate-file/scripts/resolve_run_vars.js +0 -123
  91. package/skills/translate-file/scripts/verify_chunk.js +0 -144
  92. package/skills/translate-format/SKILL.md +0 -45
  93. package/skills/translate-format/references/format-prompt.md +0 -80
  94. package/skills/translate-format/references/format-rules.md +0 -39
  95. package/skills/translate-format/references/sprint_for_format.md +0 -208
  96. package/skills/translate-format/scripts/check-paragraphs.js +0 -81
  97. package/skills/translate-format/scripts/check_input_vars.js +0 -51
  98. package/skills/translate-format/scripts/chunk-bilingual.js +0 -135
  99. package/skills/translate-format/scripts/count-words.js +0 -38
  100. package/skills/translate-format/scripts/diagnose-failure.js +0 -54
  101. package/skills/translate-format/scripts/init.js +0 -71
  102. package/skills/translate-format/scripts/md-to-docx.js +0 -398
  103. package/skills/translate-format/scripts/merge-format.js +0 -118
  104. package/skills/translate-format/scripts/resolve_run_vars.js +0 -78
@@ -1,91 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import * as cheerio from 'cheerio';
3
-
4
- const STRIP_TAGS = new Set([
5
- 'script', 'style', 'noscript', 'iframe', 'svg', 'canvas', 'template',
6
- 'form', 'video', 'audio', 'object', 'embed', 'nav', 'footer', 'aside',
7
- ]);
8
-
9
- const WRAPPER_TAGS = new Set([
10
- 'strong', 'b', 'i', 'em', 'span', 'u', 's', 'strike', 'mark',
11
- 'small', 'sub', 'sup', 'code', 'kbd', 'q', 'abbr', 'cite',
12
- ]);
13
-
14
- const KEEP_ATTRS = new Set(['href', 'src', 'alt']);
15
-
16
- export function cleanHtml(html) {
17
- if (!html) return '';
18
- let $ = cheerio.load(html);
19
-
20
- // 1. Strip blocks
21
- STRIP_TAGS.forEach(tag => { $(tag).remove(); });
22
-
23
- // 2. Strip comments
24
- $.root().find('*').contents().filter((i, el) => el.type === 'comment').remove();
25
-
26
- // 3. Extract body
27
- const body = $('body').html();
28
- if (body) {
29
- $ = cheerio.load(body);
30
- }
31
-
32
- // 4. Strip attributes (keep only href/src/alt)
33
- $('*').each((i, el) => {
34
- const attrs = el.attribs;
35
- Object.keys(attrs).forEach(attr => {
36
- if (!KEEP_ATTRS.has(attr)) delete attrs[attr];
37
- });
38
- });
39
-
40
- // 5. Strip wrapper tags (unwrap content)
41
- WRAPPER_TAGS.forEach(tag => {
42
- $(tag).each((i, el) => {
43
- const $el = $(el);
44
- $el.replaceWith($el.contents());
45
- });
46
- });
47
-
48
- // 6. Strip void elements (img, br, hr, etc.) and empty paired elements
49
- const VOID_TAGS = new Set([
50
- 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input',
51
- 'link', 'meta', 'param', 'source', 'track', 'wbr',
52
- ]);
53
- VOID_TAGS.forEach(tag => { $(tag).remove(); });
54
-
55
- // Remove empty elements repeatedly
56
- let prev = '';
57
- let curr = $.html();
58
- while (curr !== prev) {
59
- prev = curr;
60
- $ = cheerio.load(curr);
61
- $('*').each((i, el) => {
62
- const $el = $(el);
63
- if ($el.text().trim() === '' && !$el.children().length) {
64
- $el.remove();
65
- }
66
- });
67
- curr = $.html();
68
- }
69
-
70
- // 7. Strip base64 images
71
- $ = cheerio.load(curr);
72
- $('img[src^="data:image/"]').remove();
73
-
74
- // 8. Minify
75
- let result = $.html();
76
- result = result.replace(/\s+/g, ' ');
77
- result = result.replace(/>\s+</g, '><');
78
- return result.trim();
79
- }
80
-
81
- function main() {
82
- const chunks = [];
83
- process.stdin.on('data', chunk => chunks.push(chunk));
84
- process.stdin.on('end', () => {
85
- const html = Buffer.concat(chunks).toString();
86
- process.stdout.write(cleanHtml(html));
87
- });
88
- }
89
-
90
- export default cleanHtml;
91
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,72 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import * as cheerio from 'cheerio';
3
-
4
- const IMG_RE = /<img\s[^>]*src=["'](.*?)["'][^>]*>/gi;
5
-
6
- export function extractDetail(html, maxLength = -1, maxImageCount = -1) {
7
- if (!html || !html.trim()) return { paras: [] };
8
-
9
- const parts = html.split(IMG_RE);
10
- const rawParas = [];
11
-
12
- for (let i = 0; i < parts.length; i++) {
13
- if (i % 2 === 0) {
14
- const text = cleanText(parts[i]);
15
- if (text) rawParas.push({ type: 'text', value: text });
16
- } else {
17
- const imgUrl = (parts[i] || '').trim();
18
- if (imgUrl) rawParas.push({ type: 'image', value: imgUrl });
19
- }
20
- }
21
-
22
- return { paras: applyLimits(rawParas, maxLength, maxImageCount) };
23
- }
24
-
25
- function cleanText(raw) {
26
- const $ = cheerio.load(raw);
27
- let text = $.text();
28
- text = text.replace(/\s+/g, ' ').trim();
29
- return text;
30
- }
31
-
32
- function applyLimits(paras, maxLength, maxImageCount) {
33
- if (maxLength === -1 && maxImageCount === -1) return paras;
34
- const result = [];
35
- let accLen = 0;
36
- let imgCount = 0;
37
-
38
- for (const entry of paras) {
39
- if (entry.type === 'image') {
40
- if (maxImageCount !== -1 && imgCount >= maxImageCount) break;
41
- if (maxLength !== -1 && accLen >= maxLength) break;
42
- imgCount++;
43
- result.push(entry);
44
- } else {
45
- let text = entry.value;
46
- if (maxLength !== -1) {
47
- if (accLen >= maxLength) break;
48
- const remaining = maxLength - accLen;
49
- if (text.length > remaining) {
50
- text = text.slice(0, remaining);
51
- result.push({ type: 'text', value: text });
52
- break;
53
- }
54
- }
55
- result.push({ type: 'text', value: text });
56
- accLen += text.length;
57
- }
58
- }
59
- return result;
60
- }
61
-
62
- function main() {
63
- const chunks = [];
64
- process.stdin.on('data', chunk => chunks.push(chunk));
65
- process.stdin.on('end', () => {
66
- const html = Buffer.concat(chunks).toString();
67
- process.stdout.write(JSON.stringify(extractDetail(html), null, 2));
68
- });
69
- }
70
-
71
- export default extractDetail;
72
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,82 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
-
3
- export function extractRegex(html, rules) {
4
- if (!html || !rules) return [];
5
-
6
- const { container_regex, fields } = rules;
7
- if (!container_regex || !fields) return [];
8
-
9
- const containerPattern = new RegExp(container_regex, 'gs');
10
- const items = [];
11
- let match;
12
-
13
- while ((match = containerPattern.exec(html)) !== null) {
14
- const block = match[1] !== undefined ? match[1] : match[0];
15
- const item = {};
16
-
17
- for (const [fieldName, fieldPattern] of Object.entries(fields)) {
18
- if (fieldPattern) {
19
- const fm = new RegExp(fieldPattern, 's').exec(block);
20
- if (fm) {
21
- item[fieldName] = (fm[1] !== undefined ? fm[1] : fm[0]).trim();
22
- } else {
23
- item[fieldName] = '';
24
- }
25
- } else {
26
- item[fieldName] = '';
27
- }
28
- }
29
-
30
- item.selector = makeSelector(item.title || '');
31
- items.push(item);
32
- }
33
-
34
- return items;
35
- }
36
-
37
- const CURLY_CHARS = '\u201c\u201d\u2018\u2019';
38
- const EXCLUDE = ' and not(ancestor::script)';
39
-
40
- function makeSelector(title) {
41
- if (!title) return '';
42
- const hasCurly = [...CURLY_CHARS].some(c => title.includes(c));
43
-
44
- if (!hasCurly) {
45
- if (!title.includes("'")) return `//text()[contains(.,'${title}')${EXCLUDE}]/..`;
46
- if (!title.includes('"')) return `//text()[contains(.,"${title}")${EXCLUDE}]/..`;
47
- const parts = title.split("'");
48
- const inner = parts.map(p => `'${p}'`).join(",\"'\",");
49
- return `//text()[contains(.,concat(${inner}))${EXCLUDE}]/..`;
50
- }
51
-
52
- const allQuotes = CURLY_CHARS + '"\'';
53
- const segs = title.split(new RegExp(`[${allQuotes}]+`)).filter(Boolean);
54
- if (!segs.length) return '';
55
-
56
- const clauses = segs.map(s => {
57
- if (!s.includes("'")) return `contains(.,'${s}')`;
58
- if (!s.includes('"')) return `contains(.,"${s}")`;
59
- const sub = s.split("'");
60
- const inner = sub.map(p => `'${p}'`).join(",\"'\",");
61
- return `contains(.,concat(${inner}))`;
62
- });
63
-
64
- return `//text()[${clauses.join(' and ')}${EXCLUDE}]/..`;
65
- }
66
-
67
- function main() {
68
- const chunks = [];
69
- process.stdin.on('data', chunk => chunks.push(chunk));
70
- process.stdin.on('end', () => {
71
- try {
72
- const input = JSON.parse(Buffer.concat(chunks).toString());
73
- const result = extractRegex(input.html, input.rules);
74
- process.stdout.write(JSON.stringify(result, null, 2));
75
- } catch (e) {
76
- process.stdout.write('[]');
77
- }
78
- });
79
- }
80
-
81
- export { makeSelector };
82
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,49 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import * as cheerio from 'cheerio';
3
- import { cleanHtml } from './clean_html.js';
4
-
5
- export function extractSample(html, keepItems = 3) {
6
- const cleaned = cleanHtml(html);
7
- const $ = cheerio.load(cleaned);
8
-
9
- // Find content items: look for list items or repeated block elements
10
- const items = [];
11
-
12
- // Try <li> first
13
- $('li').each((i, el) => {
14
- if (items.length < keepItems) items.push($(el).html() || '');
15
- });
16
-
17
- if (items.length > 0) {
18
- return `<ul>${items.map(item => `<li>${item}</li>`).join('')}</ul>`;
19
- }
20
-
21
- // Fallback: look for repeated block elements
22
- const blockTags = ['p', 'div', 'section', 'article', 'tr', 'td'];
23
- for (const tag of blockTags) {
24
- items.length = 0;
25
- $(tag).each((i, el) => {
26
- if (items.length < keepItems) items.push($.html(el));
27
- });
28
- if (items.length > 0) break;
29
- }
30
-
31
- return items.join('\n');
32
- }
33
-
34
- function main() {
35
- const chunks = [];
36
- process.stdin.on('data', chunk => chunks.push(chunk));
37
- process.stdin.on('end', () => {
38
- try {
39
- const input = JSON.parse(Buffer.concat(chunks).toString());
40
- const result = extractSample(input.html, input.keep_items || 3);
41
- process.stdout.write(result);
42
- } catch (e) {
43
- process.stdout.write('');
44
- }
45
- });
46
- }
47
-
48
- export default extractSample;
49
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,21 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
-
3
- export function htmlToText(raw) {
4
- if (!raw) return '';
5
- let text = raw.replace(/<[^>]+>/g, '');
6
- text = text.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&').replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&nbsp;/g, ' ');
7
- text = text.replace(/\s+/g, ' ').trim();
8
- return text;
9
- }
10
-
11
- function main() {
12
- const chunks = [];
13
- process.stdin.on('data', chunk => chunks.push(chunk));
14
- process.stdin.on('end', () => {
15
- const html = Buffer.concat(chunks).toString();
16
- process.stdout.write(htmlToText(html));
17
- });
18
- }
19
-
20
- export default htmlToText;
21
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,40 +0,0 @@
1
- import { fileURLToPath } from 'url';
2
- import { readFileSync } from 'fs';
3
- import Ajv from 'ajv';
4
- import json5 from 'json5';
5
-
6
- const ajv = new Ajv({ strict: false, validateFormats: true });
7
- ajv.addFormat('uri', /^[a-z][a-z0-9+.-]*:(\/\/)?[^\s]*$/i);
8
-
9
- export function validateSchema(data, schemaPath) {
10
- const schemaContent = readFileSync(schemaPath, 'utf-8');
11
- let schema;
12
- try {
13
- schema = JSON.parse(schemaContent);
14
- } catch {
15
- schema = json5.parse(schemaContent);
16
- }
17
-
18
- const validate = ajv.compile(schema);
19
- const valid = validate(data);
20
-
21
- if (valid) return { valid: true, message: 'VALID' };
22
- return { valid: false, message: 'INVALID: ' + (validate.errors?.[0]?.message || 'unknown error') };
23
- }
24
-
25
- function main() {
26
- const chunks = [];
27
- process.stdin.on('data', chunk => chunks.push(chunk));
28
- process.stdin.on('end', () => {
29
- try {
30
- const input = JSON.parse(Buffer.concat(chunks).toString());
31
- const result = validateSchema(input.data, input.schema_path);
32
- console.log(result.message);
33
- } catch (e) {
34
- console.log('INVALID: ' + e.message);
35
- }
36
- });
37
- }
38
-
39
- export default validateSchema;
40
- if (process.argv[1] === fileURLToPath(import.meta.url)) main();
@@ -1,66 +0,0 @@
1
- ---
2
- name: revise
3
- description: |
4
- Use when creating social media content (questions, status posts, galleries, articles) from source material into schema-validated JSON arrays. Triggers on: revise, 内容创作, 创作, question, status, gallery, article, 问题, 动态, 图集, 文章.
5
- format=question/status/gallery/article(支持中文别名),count 控制条目数(默认1),language 控制输出语言(默认中文)。
6
- license: MIT
7
- metadata:
8
- workflow: sequential
9
- ---
10
-
11
- 作为 Scrum 开发者,我想要把原始素材按指定格式创作成通过 schema 校验的 JSON 数组,以便交付可直接消费的结构化社交媒体内容。using the **fixed-sequence Sprint workflow** (seq)。
12
-
13
- # When not to use
14
-
15
- - 需要网络抓取内容 → 用 `extract` skill
16
- - 只需生成自由文本(无 schema 约束)→ 用 `query` skill
17
- - 需要翻译文档 → 用 `translate` skill
18
-
19
- # Product Goal
20
-
21
- 按 `format` 从素材创作 `count` 条通过 schema 校验的 JSON 数组,按输出语义(文件或 stdout)交付。
22
-
23
- # Extract Variables
24
-
25
- 从上下文提取输入变量(入参为调用方传入的**原始任务消息**,可为 JSON、key=value 或自然语言形态):
26
-
27
- | 变量 | 类型 | 必填 | 说明 |
28
- |---|---|---|---|
29
- | `format` | string | ✅ | 创作格式,标准值 `question`/`status`/`gallery`/`article`,可用别名指定(见别名对照) |
30
- | `source` | string | ✅ | 原始素材:文本 / JSON 字符串 / 文件路径 |
31
- | `count` | integer | ❌ | 生成 item 数量,默认 1(非整数或 <1 按 1) |
32
- | `language` | string | ❌ | 输出语言,默认 中文(空白按中文) |
33
- | `style` | string | ❌ | 创作风格描述(自由文本),缺省用 format 默认风格(`references/{{format}}.md` 的 Style 模块) |
34
- | `output` | string | ❌ | 输出文件路径(提供则写文件,否则 stdout) |
35
-
36
- 仅使用上表六个字段,忽略所有其他字段(如 `url`)。
37
-
38
- **format 别名对照**(本表为别名的唯一定义处):
39
-
40
- | format 标准值 | 别名 terms |
41
- |---|---|
42
- | `question` | 问题 / 提问 / 互动话题 / 话题 / question |
43
- | `status` | 动态 / 微博 / 朋友圈 / 状态 / 一句话 / status |
44
- | `gallery` | 图集 / 相册 / 多图 / 图片合集 / gallery |
45
- | `article` | 文章 / 图文 / 长文 / 推文 / article |
46
-
47
- # Environment Initialization
48
-
49
- 1. 运行 `node scripts/init.js '{{原始任务消息}}'`(消息整体加引号传入):校验入参并解析字段(JSON/key=value 形态输出「已解析字段」表,自然语言形态交由 Sprint Item1 提取),解析 run 变量(`run_dir`:临时文件与回顾报告目录)并检查依赖(`ajv`/`json5`,已声明于 harness `package.json`)。脚本输出约定(status 行与退出码)见 `scripts/` 各脚本顶部注释;失败短路的处理规则见 Sprint Backlog Item1。
50
- 2. Read **Sprint Standards** `{{shared_dir}}/references/sprint_standards.md`。
51
-
52
- # Product Increment
53
-
54
- | Product | Type | Description | DoD |
55
- |---|---|---|---|
56
- | JSON 数组 | file / stdout | `{{count}}` 条 `{{format}}` 格式、`{{language}}` 语言的内容条目 | `node scripts/validate-schema.js` 输出 `VALID` 且退出码 0;提供 `output` 时文件已落盘且 stdout 输出路径,否则 stdout 输出裸数组 |
57
-
58
- # Sprint Backlogs
59
-
60
- | Sprint Name | Backlog File | Description |
61
- |---|---|---|
62
- | Sprint for content | `{{skill_dir}}/references/sprint_for_revise.md` | 固定 4 项:解析入参加载 references → 生成+schema 校验 → 输出 → 回顾 |
63
-
64
- # Sprint Now!
65
-
66
- Read all **Sprint Backlogs**, follow **Sprint Workflow** `{{shared_dir}}/references/run/run_sprint_one.md`, then *sprint*.
@@ -1,37 +0,0 @@
1
- # 社交媒体图文文章(article)创作 Sprint
2
-
3
- ## Sprint Goal
4
-
5
- 产出 `{{count}}` 篇适合社交媒体传播的图文文章,整体为 JSON 数组。
6
-
7
- ## Style(默认创作风格,可由 `style` 参数覆盖)
8
-
9
- 基于原始素材创作:
10
-
11
- 1. **标题抓人**:有吸引力、有冲突点,读者靠标题决定是否点开
12
- 2. **节奏快**:段落短、节奏快,适合快速阅读
13
-
14
- ## Format(输出契约,不可被 `style` 覆盖)
15
-
16
- - **结构**:每 item = `title`(10-30 cn_length)+ `blocks`(array,1-20 个,每个含 `type`(text/image)+ `content`)
17
- - **图文混排**:文本块与图片块交替出现,建议文本为主、图片辅助
18
- - **图片**:从素材中提取图片地址作为 `{"type": "image"}` 块,最多 5 个图片块;素材无图片时全部用 `{"type": "text"}` 块
19
- - **真实性**:从素材中提炼核心信息,重组为流畅文章,不能凭空编造
20
- - **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;裸 JSON 输出约束遵循 `sprint_for_revise.md` Item2「裸 JSON 契约」
21
-
22
- > 字数计算采用 **cn_length** 规则(唯一定义见 `sprint_for_revise.md`「执行约束」)。
23
-
24
- 示例:
25
-
26
- ```json
27
- [
28
- {
29
- "title": "三星二季度营业利润暴涨18倍,AI存储成最大赢家",
30
- "blocks": [
31
- {"type": "text", "content": "市场对DRAM、NAND的供不应求,助推三星电子迎来史上空前的盈利预期。"},
32
- {"type": "image", "content": "https://example.com/pic1.jpg"},
33
- {"type": "text", "content": "花旗研究所报告显示,二季度DRAM均价环比上涨44%,NAND涨幅达53%。"}
34
- ]
35
- }
36
- ]
37
- ```
@@ -1,40 +0,0 @@
1
- {
2
- // 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
3
- "title": "文章格式",
4
- "description": "社交媒体图文文章(article)输出校验 schema(数组,至少 1 个 item)",
5
- "type": "array",
6
- "minItems": 1,
7
- "items": {
8
- "type": "object",
9
- "properties": {
10
- "title": {
11
- "type": "string",
12
- "description": "文章标题,10-30 字(cn_length),需有吸引力"
13
- },
14
- "blocks": {
15
- "type": "array",
16
- "description": "正文块列表,1-20 行,图文混排",
17
- "minItems": 1,
18
- "maxItems": 20,
19
- "items": {
20
- "type": "object",
21
- "properties": {
22
- "type": {
23
- "type": "string",
24
- "enum": ["text", "image"],
25
- "description": "块类型:text 文本 / image 图片"
26
- },
27
- "content": {
28
- "type": "string",
29
- "description": "文本段落内容或图片地址"
30
- }
31
- },
32
- "required": ["type", "content"],
33
- "additionalProperties": false
34
- }
35
- }
36
- },
37
- "required": ["title", "blocks"],
38
- "additionalProperties": false
39
- }
40
- }
@@ -1,35 +0,0 @@
1
- # 社交媒体图集(gallery)创作 Sprint
2
-
3
- ## Sprint Goal
4
-
5
- 产出 `{{count}}` 个适合社交媒体传播的图集内容,整体为 JSON 数组。
6
-
7
- ## Style(默认创作风格,可由 `style` 参数覆盖)
8
-
9
- 基于原始素材创作:
10
-
11
- 1. **标题吸引**:点明图集主题,有看点、让人想点开
12
-
13
- ## Format(输出契约,不可被 `style` 覆盖)
14
-
15
- - **结构**:每 item = `title`(10-30 cn_length)+ `images`(array,1-50 个,每个含 `url` + `title`(10-30 cn_length))
16
- - **配说明**:每张图必须带 `title` 简要说明图片内容——schema 必填,不可省略
17
- - **图片来源**:从原始素材中提取图片地址,素材中图片不足时可适当精选
18
- - **真实性**:从素材中提炼主题,不能凭空编造
19
- - **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;裸 JSON 输出约束遵循 `sprint_for_revise.md` Item2「裸 JSON 契约」
20
-
21
- > 字数计算采用 **cn_length** 规则(唯一定义见 `sprint_for_revise.md`「执行约束」)。
22
-
23
- 示例:
24
-
25
- ```json
26
- [
27
- {
28
- "title": "三星电子二季度财报亮点图集",
29
- "images": [
30
- {"url": "https://example.com/pic1.jpg", "title": "三星第二季度初步财报发布"},
31
- {"url": "https://example.com/pic2.jpg", "title": "全球存储芯片供需格局"}
32
- ]
33
- }
34
- ]
35
- ```
@@ -1,40 +0,0 @@
1
- {
2
- // 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
3
- "title": "图集格式",
4
- "description": "社交媒体图集(gallery)输出校验 schema(数组,至少 1 个 item)",
5
- "type": "array",
6
- "minItems": 1,
7
- "items": {
8
- "type": "object",
9
- "properties": {
10
- "title": {
11
- "type": "string",
12
- "description": "图集标题,10-30 字(cn_length)"
13
- },
14
- "images": {
15
- "type": "array",
16
- "description": "图片列表,1-50 张",
17
- "minItems": 1,
18
- "maxItems": 50,
19
- "items": {
20
- "type": "object",
21
- "properties": {
22
- "url": {
23
- "type": "string",
24
- "format": "uri",
25
- "description": "图片地址"
26
- },
27
- "title": {
28
- "type": "string",
29
- "description": "图片标题/简短说明,10-30 字(cn_length)"
30
- }
31
- },
32
- "required": ["url", "title"],
33
- "additionalProperties": false
34
- }
35
- }
36
- },
37
- "required": ["title", "images"],
38
- "additionalProperties": false
39
- }
40
- }
@@ -1,33 +0,0 @@
1
- # 社交媒体风格问题(question)创作 Sprint
2
-
3
- ## Sprint Goal
4
-
5
- 产出 `{{count}}` 条适合社交媒体传播的问题内容,整体为 JSON 数组。
6
-
7
- ## Style(默认创作风格,可由 `style` 参数覆盖)
8
-
9
- 基于原始素材创作:
10
-
11
- 1. **标题尖锐**:有争议性、冲突点,能激发讨论欲和互动
12
- 2. **描述简洁**:说明背景,引出矛盾点,不要太长
13
-
14
- ## Format(输出契约,不可被 `style` 覆盖)
15
-
16
- - **结构**:每 item = `title`(10-30 cn_length)+ `content`(20-500 cn_length)+ `images`(string[],≤5 张)
17
- - **图片**:从素材提取图片地址,最多 5 张;素材无图片时为空数组
18
- - **真实性**:从素材中提取核心矛盾点,不能凭空编造
19
- - **输出形式**:整体为 JSON 数组,含 `{{count}}` 个 item;裸 JSON 输出约束遵循 `sprint_for_revise.md` Item2「裸 JSON 契约」
20
-
21
- > 字数计算采用 **cn_length** 规则(唯一定义见 `sprint_for_revise.md`「执行约束」)。
22
-
23
- 示例:
24
-
25
- ```json
26
- [
27
- {
28
- "title": "为什么同样的努力,有人成功有人失败?",
29
- "content": "在职场中发现,同样勤奋的两个人,结局却天差地别。差距到底在哪里?",
30
- "images": ["https://example.com/pic1.jpg"]
31
- }
32
- ]
33
- ```
@@ -1,31 +0,0 @@
1
- {
2
- // 省略 $schema 字段,避免 bash -c "" 中 $ 展开问题
3
- "title": "社交媒体问题格式",
4
- "description": "社交媒体风格问题的输出校验 schema(数组,至少 1 个 item)",
5
- "type": "array",
6
- "minItems": 1,
7
- "items": {
8
- "type": "object",
9
- "properties": {
10
- "title": {
11
- "type": "string",
12
- "description": "问题标题,10-30 cn_length"
13
- },
14
- "content": {
15
- "type": "string",
16
- "description": "问题描述,20-500 cn_length"
17
- },
18
- "images": {
19
- "type": "array",
20
- "description": "问题图片地址列表,最多 5 张",
21
- "items": {
22
- "type": "string",
23
- "format": "uri"
24
- },
25
- "maxItems": 5
26
- }
27
- },
28
- "required": ["title", "content", "images"],
29
- "additionalProperties": false
30
- }
31
- }