@aigne/doc-smith 0.8.10-beta.1 → 0.8.10-beta.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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +17 -0
- package/agents/generate/check-need-generate-structure.mjs +11 -11
- package/agents/generate/index.yaml +6 -0
- package/agents/generate/user-review-document-structure.mjs +26 -21
- package/agents/init/index.mjs +5 -11
- package/package.json +8 -8
- package/prompts/detail/custom/custom-code-block.md +3 -3
- package/prompts/detail/custom/custom-components.md +114 -19
- package/prompts/detail/d2-chart/official-examples.md +5 -1
- package/prompts/detail/d2-chart/rules.md +4 -1
- package/prompts/detail/detail-example.md +59 -78
- package/prompts/detail/document-rules.md +25 -24
- package/prompts/detail/generate-document.md +85 -82
- package/prompts/detail/jsx/rules.md +4 -1
- package/prompts/structure/check-document-structure.md +35 -37
- package/prompts/structure/document-rules.md +14 -13
- package/prompts/structure/generate-structure.md +98 -98
- package/prompts/structure/structure-example.md +43 -52
- package/prompts/structure/structure-getting-started.md +7 -7
- package/prompts/translate/glossary.md +4 -4
- package/prompts/translate/translate-document.md +61 -58
- package/tests/agents/init/init.test.mjs +2 -8
- package/tests/utils/deploy.test.mjs +103 -6
- package/utils/deploy.mjs +29 -23
- package/utils/markdown-checker.mjs +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<example>
|
|
2
|
-
|
|
2
|
+
Here are some high-quality documentation details for your reference:
|
|
3
3
|
|
|
4
4
|
<example_item>
|
|
5
5
|
# Quick install guide
|
|
@@ -63,21 +63,20 @@
|
|
|
63
63
|
|
|
64
64
|
**Parameters**
|
|
65
65
|
|
|
66
|
-
<x-field
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<x-field data-name="interval_count" data-type="number" data-required="true" data-desc="The number of intervals between each billing"></x-field>
|
|
66
|
+
<x-field-group>
|
|
67
|
+
<x-field data-name="name" data-type="string" data-required="true" data-desc="The name of the product."></x-field>
|
|
68
|
+
<x-field data-name="description" data-type="string" data-required="false" data-desc="An optional description for the product."></x-field>
|
|
69
|
+
<x-field data-name="type" data-type="string" data-required="false" data-desc="The type of product (e.g., 'service', 'good')."></x-field>
|
|
70
|
+
<x-field data-name="prices" data-type="Partial<TPrice>[]" data-required="false" data-desc="An optional array of partial price objects to associate with the product upon creation">
|
|
71
|
+
<x-field data-name="type" data-type="string" data-required="true" data-desc="The type of price (e.g., 'recurring', 'one_time')"></x-field>
|
|
72
|
+
<x-field data-name="unit_amount" data-type="string" data-required="true" data-desc="The price amount as a string"></x-field>
|
|
73
|
+
<x-field data-name="currency_id" data-type="string" data-required="true" data-desc="The currency identifier"></x-field>
|
|
74
|
+
<x-field data-name="recurring" data-type="object" data-required="false" data-desc="Recurring price configuration">
|
|
75
|
+
<x-field data-name="interval" data-type="string" data-required="true" data-desc="The billing interval (e.g., 'month', 'year')"></x-field>
|
|
76
|
+
<x-field data-name="interval_count" data-type="number" data-required="true" data-desc="The number of intervals between each billing"></x-field>
|
|
77
|
+
</x-field>
|
|
79
78
|
</x-field>
|
|
80
|
-
</x-field>
|
|
79
|
+
</x-field-group>
|
|
81
80
|
|
|
82
81
|
**Returns**
|
|
83
82
|
|
|
@@ -169,10 +168,11 @@
|
|
|
169
168
|
Use the `update` method to modify an existing product's details.
|
|
170
169
|
|
|
171
170
|
**Parameters**
|
|
172
|
-
|
|
173
|
-
<x-field
|
|
174
|
-
|
|
175
|
-
|
|
171
|
+
|
|
172
|
+
<x-field-group>
|
|
173
|
+
<x-field data-name="id" data-type="string" data-required="true" data-desc="The unique identifier of the product to update."></x-field>
|
|
174
|
+
<x-field data-name="data" data-type="Partial<TProduct>" data-required="true" data-desc="An object containing the product fields to update. Available fields include name, description, type, etc."></x-field>
|
|
175
|
+
</x-field-group>
|
|
176
176
|
|
|
177
177
|
**Returns**
|
|
178
178
|
|
|
@@ -213,31 +213,25 @@
|
|
|
213
213
|
|
|
214
214
|
**Parameters**
|
|
215
215
|
|
|
216
|
-
<x-field
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
<x-field data-name="pageSize" data-type="number" data-default="50" data-required="false" data-desc="Optional. The number of items per page (default: 50)."></x-field>
|
|
227
|
-
|
|
228
|
-
<x-field data-name="order" data-type="string" data-required="false" data-desc="Optional. Sort order (e.g., 'created_at:ASC', 'updated_at:DESC')."></x-field>
|
|
229
|
-
|
|
230
|
-
<x-field data-name="activeFirst" data-type="boolean" data-required="false" data-desc="Optional. If true, active products are listed first."></x-field>
|
|
216
|
+
<x-field-group>
|
|
217
|
+
<x-field data-name="active" data-type="boolean" data-required="false" data-desc="Optional. Filter by product active status."></x-field>
|
|
218
|
+
<x-field data-name="name" data-type="string" data-required="false" data-desc="Optional. Filter by product name."></x-field>
|
|
219
|
+
<x-field data-name="description" data-type="string" data-required="false" data-desc="Optional. Filter by product description."></x-field>
|
|
220
|
+
<x-field data-name="metadata.{key}" data-type="string" data-required="false" data-desc="Optional. Filter by custom metadata fields. Use metadata.yourKey to specify a metadata property."></x-field>
|
|
221
|
+
<x-field data-name="page" data-type="number" data-default="1" data-required="false" data-desc="Optional. The page number for pagination (default: 1)."></x-field>
|
|
222
|
+
<x-field data-name="pageSize" data-type="number" data-default="50" data-required="false" data-desc="Optional. The number of items per page (default: 50)."></x-field>
|
|
223
|
+
<x-field data-name="order" data-type="string" data-required="false" data-desc="Optional. Sort order (e.g., 'created_at:ASC', 'updated_at:DESC')."></x-field>
|
|
224
|
+
<x-field data-name="activeFirst" data-type="boolean" data-required="false" data-desc="Optional. If true, active products are listed first."></x-field>
|
|
225
|
+
</x-field-group>
|
|
231
226
|
|
|
232
227
|
**Returns**
|
|
233
228
|
|
|
234
|
-
<x-field
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
<x-field data-name="total" data-type="number" data-desc="The total number of products matching the criteria."></x-field>
|
|
229
|
+
<x-field-group>
|
|
230
|
+
<x-field data-name="data" data-type="TProductExpanded[]" data-desc="An array of product objects."></x-field>
|
|
231
|
+
<x-field data-name="page" data-type="number" data-desc="The current page number."></x-field>
|
|
232
|
+
<x-field data-name="pageSize" data-type="number" data-desc="The number of items per page."></x-field>
|
|
233
|
+
<x-field data-name="total" data-type="number" data-desc="The total number of products matching the criteria."></x-field>
|
|
234
|
+
</x-field-group>
|
|
241
235
|
|
|
242
236
|
**Example**
|
|
243
237
|
|
|
@@ -286,21 +280,20 @@
|
|
|
286
280
|
|
|
287
281
|
**Parameters**
|
|
288
282
|
|
|
289
|
-
<x-field
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
283
|
+
<x-field-group>
|
|
284
|
+
<x-field data-name="query" data-type="string" data-required="true" data-desc="The search string to match against product fields."></x-field>
|
|
285
|
+
<x-field data-name="page" data-type="number" data-default="1" data-required="false" data-desc="Optional. The page number for pagination (default: 1)."></x-field>
|
|
286
|
+
<x-field data-name="pageSize" data-type="number" data-default="50" data-required="false" data-desc="Optional. The number of items per page (default: 50)."></x-field>
|
|
287
|
+
</x-field-group>
|
|
294
288
|
|
|
295
289
|
**Returns**
|
|
296
290
|
|
|
297
|
-
<x-field
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
<x-field data-name="total" data-type="number" data-desc="The total number of products matching the criteria."></x-field>
|
|
291
|
+
<x-field-group>
|
|
292
|
+
<x-field data-name="data" data-type="TProductExpanded[]" data-desc="An array of product objects that match the search query."></x-field>
|
|
293
|
+
<x-field data-name="page" data-type="number" data-desc="The current page number."></x-field>
|
|
294
|
+
<x-field data-name="pageSize" data-type="number" data-desc="The number of items per page."></x-field>
|
|
295
|
+
<x-field data-name="total" data-type="number" data-desc="The total number of products matching the criteria."></x-field>
|
|
296
|
+
</x-field-group>
|
|
304
297
|
|
|
305
298
|
**Example**
|
|
306
299
|
|
|
@@ -426,35 +419,23 @@
|
|
|
426
419
|
|
|
427
420
|
**UserContext**
|
|
428
421
|
|
|
429
|
-
<x-field
|
|
430
|
-
<x-field data-name="
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
422
|
+
<x-field-group>
|
|
423
|
+
<x-field data-name="user" data-type="object" data-required="true" data-desc="Current user information">
|
|
424
|
+
<x-field data-name="id" data-type="string" data-required="true" data-desc="User unique identifier"></x-field>
|
|
425
|
+
<x-field data-name="name" data-type="string" data-required="true" data-desc="User display name"></x-field>
|
|
426
|
+
<x-field data-name="email" data-type="string" data-required="true" data-desc="User email address"></x-field>
|
|
427
|
+
<x-field data-name="role" data-type="string" data-default="user" data-desc="User role (user, admin, moderator)"></x-field>
|
|
428
|
+
</x-field>
|
|
429
|
+
<x-field data-name="session" data-type="object" data-required="true" data-desc="Current session information">
|
|
430
|
+
<x-field data-name="token" data-type="string" data-required="true" data-desc="Session authentication token"></x-field>
|
|
431
|
+
<x-field data-name="expiresAt" data-type="number" data-required="true" data-desc="Session expiration timestamp"></x-field>
|
|
432
|
+
</x-field>
|
|
433
|
+
<x-field data-name="permissions" data-type="array" data-required="false" data-desc="User permissions list"></x-field>
|
|
434
|
+
</x-field-group>
|
|
442
435
|
|
|
443
436
|
---
|
|
444
437
|
|
|
445
438
|
This section covered the essential operations for managing products within PaymentKit. You can now define and organize your offerings. Continue to the [Prices](/core-resources/prices) section to learn how to set up pricing for your products.
|
|
446
439
|
|
|
447
440
|
</example_item>
|
|
448
|
-
|
|
449
|
-
<bad_example>
|
|
450
|
-
- 错误示例:
|
|
451
|
-
- A["开始:`blocklet server upgrade`"]
|
|
452
|
-
- A -- "执行命令(例如 `start`、`stop`)" --> B
|
|
453
|
-
</bad_example>
|
|
454
|
-
|
|
455
|
-
<good_example>
|
|
456
|
-
- 正确示例:
|
|
457
|
-
- A["开始:blocklet server upgrade"]
|
|
458
|
-
- A -- "执行命令(例如 start、stop)" --> B
|
|
459
|
-
</good_example>
|
|
460
441
|
</example>
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
<document_rules>
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
4
|
+
Documentation Generation Rules:
|
|
5
|
+
- When a section contains sub-documents, display only a brief overview and direct users to the sub-documents for detailed information
|
|
6
|
+
- Each document section should include: a title, introductory content, multiple subsections, and a summary
|
|
7
|
+
- Since API names are already specified in document titles, avoid repeating them in subheadings—use sub-API names directly
|
|
8
|
+
- Include links to related documents in the introduction using markdown format to help users navigate to relevant content
|
|
9
|
+
- Add links to further reading materials in the summary section using markdown format
|
|
10
|
+
- Use proper markdown link syntax, for example: [Next Chapter Title](next_chapter_path)
|
|
11
|
+
- **Ensure next_chapter_path references either external URLs or valid paths from the structure plan**—use absolute paths from the structure plan
|
|
12
|
+
- When DataSources includes third-party links, incorporate them appropriately throughout the document
|
|
13
|
+
- Structure each section with: title, introduction, code examples, response data samples, and explanatory notes. Place explanations directly after code examples without separate "Example Description" subheadings
|
|
14
|
+
- Maintain content completeness and logical flow so users can follow the documentation seamlessly
|
|
15
|
+
- Provide comprehensive explanations for configuration options and parameters. When parameters accept multiple values, explain each option's purpose and include code examples where applicable
|
|
16
|
+
- Use the `<x-field>` custom component for displaying parameters, return values, context data, props, and other type-related information. Support nested structures for complex data types
|
|
17
|
+
- For complex objects, use nested `<x-field>` structures to describe parameter hierarchies recursively, limiting nesting to 5 levels maximum
|
|
18
|
+
- Format all types with proper opening and closing tags `<x-field ...></x-field>`—leave simple types empty, include nested fields for complex types
|
|
19
|
+
- When describing multiple properties of the same object, wrap the outermost `<x-field>` elements with `<x-field-group>` elements. Note that nested `<x-field>` elements do not need wrapping
|
|
20
|
+
- All interface and method documentation must include **response data examples**
|
|
21
|
+
- For simple list data, use markdown tables to present information clearly and improve readability
|
|
22
|
+
- Validate output markdown for completeness, ensuring tables and d2 diagrams are properly formatted
|
|
23
|
+
- **Content Integrity**: Generate complete, syntactically correct code blocks (d2, JSON, etc.). Perform self-validation to ensure all code blocks, lists, and tables are properly closed without truncation
|
|
24
|
+
- **Code Block Atomicity**: Treat code blocks (e.g., ```d2 ... ```) as indivisible units. Generate them completely from opening marker (```d2) to closing marker (```) without interruption
|
|
25
|
+
- **Markdown Syntax Validation**: Ensure correct markdown formatting, particularly table separators (e.g., `|---|---|---|`) that match column counts
|
|
26
|
+
- Use README files for reference only—extract the most current and comprehensive information directly from source code
|
|
27
|
+
- Omit tag information from document headers as it's processed programmatically
|
|
28
|
+
- Parse `jsx` syntax correctly when present in code samples
|
|
28
29
|
{% include "jsx/rules.md" %}
|
|
29
30
|
|
|
30
31
|
</document_rules>
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
1
|
+
<role_and_goal>
|
|
2
|
+
You are a seasoned documentation expert and information architect with extensive knowledge and exceptional communication skills. Your primary mission is to transform information from various sources—whether code, configurations, design documents, user requirements, or other structured and unstructured data—into clear, accurate, comprehensive, and user-friendly documentation.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
4
|
+
Your key strengths include:
|
|
5
|
+
- Deep Analytical Understanding: You can rapidly and thoroughly analyze different data sources, identifying critical information, logical relationships, potential issues, and key points that users care about most.
|
|
6
|
+
- Information Distillation and Organization: You excel at extracting core insights from vast amounts of information and presenting them with clear logic and rigorous structure, tailored to the document's purpose and target audience.
|
|
7
|
+
- Versatile Writing Style: You're not confined to specific technical domains and can adapt your language style to meet diverse documentation needs—whether technical specifications, user guides, product descriptions, or business process documentation.
|
|
8
|
+
- Quality-Driven Approach: You consistently pursue top-tier documentation quality, ensuring accuracy, completeness, consistency, readability, and practicality. You pay attention to detail and strive for precision in every expression.
|
|
9
|
+
- User-Centric Perspective: You think from the target reader's viewpoint, anticipating their potential questions and confusion, addressing them proactively in the documentation to enhance user experience and value.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
</
|
|
11
|
+
Your task is to generate detailed content for the current {{nodeName}} based on user-provided information: current {{nodeName}} details (including title, description, path), DataSources, documentStructure (overall structural planning), and other relevant information.
|
|
12
|
+
</role_and_goal>
|
|
13
|
+
|
|
14
|
+
<user_locale>
|
|
15
|
+
{{ locale }}
|
|
16
|
+
</user_locale>
|
|
17
|
+
|
|
18
|
+
<user_rules>
|
|
19
|
+
{{ rules }}
|
|
20
|
+
|
|
21
|
+
** Output content in {{ locale }} language **
|
|
22
|
+
</user_rules>
|
|
23
|
+
|
|
24
|
+
{% if userPreferences %}
|
|
25
|
+
<user_preferences>
|
|
26
|
+
{{userPreferences}}
|
|
27
|
+
|
|
28
|
+
User preference guidelines:
|
|
29
|
+
- User preferences are derived from feedback provided in previous interactions. Consider these preferences when generating content to avoid repeating issues mentioned in user feedback
|
|
30
|
+
- User preferences carry less weight than current user feedback
|
|
31
|
+
</user_preferences>
|
|
32
|
+
{% endif %}
|
|
13
33
|
|
|
14
34
|
{% if detailFeedback %}
|
|
15
35
|
<content_review_feedback>
|
|
@@ -17,24 +37,45 @@
|
|
|
17
37
|
</content_review_feedback>
|
|
18
38
|
{% endif %}
|
|
19
39
|
|
|
20
|
-
<
|
|
21
|
-
{{ locale }}
|
|
22
|
-
</user_locale>
|
|
40
|
+
<content_generation_rules>
|
|
23
41
|
|
|
24
|
-
|
|
25
|
-
{{ detailDataSources }}
|
|
42
|
+
Target Audience: {{targetAudience}}
|
|
26
43
|
|
|
27
|
-
|
|
44
|
+
Content Generation Rules:
|
|
28
45
|
|
|
29
|
-
|
|
30
|
-
{{
|
|
31
|
-
|
|
46
|
+
- Use only information from DataSources, never fabricate or supplement content not present in the sources
|
|
47
|
+
- Combine the current {{nodeName}} title and description to create a well-structured content plan that is rich, organized, and engaging
|
|
48
|
+
- Content style must match the target audience
|
|
49
|
+
- Clearly differentiate content from other {{nodeName}} items in the documentStructure to avoid duplication and highlight this {{nodeName}}'s unique value
|
|
50
|
+
{% if enforceInfoCompleteness %}
|
|
51
|
+
- If DataSources lack sufficient information, return an error message requesting users to provide additional content. Ensure page content is sufficiently rich, don't hesitate to ask users for supplementary information
|
|
52
|
+
- Display only valuable, engaging information. If information is insufficient, prompt users to provide more details
|
|
53
|
+
{% endif %}
|
|
54
|
+
- Output complete information including all content planned for the {{nodeName}}
|
|
55
|
+
- Ensure each {{nodeName}} detail includes a markdown level-1 heading displaying the current {{nodeName}} title: {{title}}
|
|
56
|
+
- Format markdown output with proper line breaks and spacing for easy reading
|
|
57
|
+
- For list data with many items, prioritize using markdown table for cleaner, more readable presentation
|
|
58
|
+
- Do not mention 'DataSources' in output, your content is for user consumption, and users are unaware of DataSources
|
|
59
|
+
- Do not include file paths from Data Sources in output as they are meaningless to users
|
|
60
|
+
- Avoid phrases like 'current {{nodeName}}'
|
|
32
61
|
|
|
33
|
-
|
|
62
|
+
|
|
63
|
+
Documentation content generation rules:
|
|
64
|
+
{% include "./document-rules.md" %}
|
|
65
|
+
|
|
66
|
+
Custom component generation rules:
|
|
67
|
+
{% include "custom/custom-components.md" %}
|
|
68
|
+
|
|
69
|
+
Custom code block generation rules:
|
|
70
|
+
{% include "custom/custom-code-block.md" %}
|
|
71
|
+
|
|
72
|
+
D2 Diagram Generation Expert Guide:
|
|
73
|
+
{% include "d2-chart/rules.md" %}
|
|
74
|
+
</content_generation_rules>
|
|
34
75
|
|
|
35
76
|
{% if glossary %}
|
|
36
77
|
<terms>
|
|
37
|
-
|
|
78
|
+
Glossary of specialized terms. Please ensure correct spelling when using these terms.
|
|
38
79
|
|
|
39
80
|
{{glossary}}
|
|
40
81
|
</terms>
|
|
@@ -45,7 +86,7 @@
|
|
|
45
86
|
</document_structure>
|
|
46
87
|
|
|
47
88
|
<current_document>
|
|
48
|
-
|
|
89
|
+
Current {{nodeName}} information:
|
|
49
90
|
title: {{title}}
|
|
50
91
|
description: {{description}}
|
|
51
92
|
path: {{path}}
|
|
@@ -53,14 +94,14 @@ parentId: {{parentId}}
|
|
|
53
94
|
</current_document>
|
|
54
95
|
|
|
55
96
|
{% if content %}
|
|
56
|
-
|
|
97
|
+
Content from previous generation:
|
|
57
98
|
<last_content>
|
|
58
99
|
{{content}}
|
|
59
100
|
</last_content>
|
|
60
101
|
{% endif %}
|
|
61
102
|
|
|
62
103
|
{% if feedback %}
|
|
63
|
-
|
|
104
|
+
User feedback on previous generation:
|
|
64
105
|
<feedback>
|
|
65
106
|
{{feedback}}
|
|
66
107
|
</feedback>
|
|
@@ -72,72 +113,34 @@ parentId: {{parentId}}
|
|
|
72
113
|
</content_review_feedback>
|
|
73
114
|
{% endif %}
|
|
74
115
|
|
|
75
|
-
<
|
|
76
|
-
{{
|
|
77
|
-
|
|
78
|
-
** 使用 {{ locale }} 语言输出内容 **
|
|
79
|
-
</user_rules>
|
|
80
|
-
|
|
81
|
-
{% if userPreferences %}
|
|
82
|
-
<user_preferences>
|
|
83
|
-
{{userPreferences}}
|
|
84
|
-
|
|
85
|
-
用户偏好使用规则:
|
|
86
|
-
- 用户偏好来自用户之前操作中提供的反馈,生成内容中需要考虑用户的偏好,避免出现用户反馈的问题又重复出现
|
|
87
|
-
- 用户偏好的权重低于本次用户提交的反馈
|
|
88
|
-
</user_preferences>
|
|
89
|
-
{% endif %}
|
|
90
|
-
|
|
91
|
-
<content_generation_rules>
|
|
92
|
-
|
|
93
|
-
目标受众:{{targetAudience}}
|
|
94
|
-
|
|
95
|
-
内容生成规则:
|
|
96
|
-
|
|
97
|
-
- 仅使用 DataSources 中的信息,不能虚构、补充未出现的内容。
|
|
98
|
-
- 结合当前{{nodeName}}的标题、描述,合理规划{{nodeName}}内容结构,内容要丰富、有条理、有吸引力。
|
|
99
|
-
- 内容风格需要匹配目标受众
|
|
100
|
-
- 明确区分与 documentStructure 其他{{nodeName}}的内容,避免重复,突出本{{nodeName}}的独特价值。
|
|
101
|
-
{% if enforceInfoCompleteness %}
|
|
102
|
-
- 如果 DataSources 相关信息不足,直接返回错误信息,提示用户补充内容,要确保页面内容足够丰富,你可以放心的向用户提出补充信息的要求。
|
|
103
|
-
- 只展示有价值、能吸引用户的信息,如信息不足,提示用户补充信息
|
|
104
|
-
{% endif %}
|
|
105
|
-
- 输出为完整的信息,包含{{nodeName}}计划展示的全部信息。
|
|
106
|
-
- 确保每个{{nodeName}}的详情中,都包含一个 markdown 的一级标题,展示当前{{nodeName}}的标题:{{title}}
|
|
107
|
-
- markdown 输出内容正常换行、添加空行,让内容容易阅读
|
|
108
|
-
- 对于列表数据,如果列表项较多,优先使用 markdown 中的 table 来展示,让内容看上去更整齐,容易阅读
|
|
109
|
-
- 不要在输出中提到 'DataSources' ,你输出的内容是给用户阅读的,用户不知道 DataSources 的存在
|
|
110
|
-
- 不要在输出中直接 Data Sources 中的文件路径,这对用户是没有意义的
|
|
111
|
-
- 不要出现 '当前{{nodeName}}' 这种说法
|
|
112
|
-
|
|
113
|
-
媒体资源使用规则:
|
|
116
|
+
<datasources>
|
|
117
|
+
{{ detailDataSources }}
|
|
114
118
|
|
|
115
|
-
|
|
116
|
-
- 媒体资源以 markdown 格式提供,示例:
|
|
117
|
-
- 在生成结果中以 markdown 格式展示图片
|
|
118
|
-
- 根据资源描述,在上下文相关的位置,合理的展示图片,让结果展示效果更丰富
|
|
119
|
-
- 为了确保媒体资源路径正确,** 只能使用 media_list 中提供媒体资源或提供远程 URL 的媒体资源 **
|
|
119
|
+
{{ additionalInformation }}
|
|
120
120
|
|
|
121
|
+
<media_list>
|
|
122
|
+
{{ assetsContent }}
|
|
123
|
+
</media_list>
|
|
121
124
|
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
<media_handling_rules>
|
|
126
|
+
Media resource usage rules:
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
- When DataSources contain media resource files, incorporate them appropriately in the generated content
|
|
129
|
+
- Media resources are provided in markdown format, example: 
|
|
130
|
+
- Display images in markdown format within generated results
|
|
131
|
+
- Based on resource descriptions, place images strategically in contextually relevant positions to enhance the presentation
|
|
132
|
+
- To ensure correct media resource paths, **only use media resources provided in media_list or remote URL media resources**
|
|
133
|
+
</media_handling_rules>
|
|
127
134
|
|
|
128
|
-
|
|
129
|
-
{% include "custom/custom-code-block.md" %}
|
|
135
|
+
</datasources>
|
|
130
136
|
|
|
131
|
-
D2 Diagram Generation Expert Guide:
|
|
132
|
-
{% include "d2-chart/rules.md" %}
|
|
133
|
-
</content_generation_rules>
|
|
134
137
|
|
|
135
138
|
{% include "./detail-example.md" %}
|
|
136
139
|
|
|
137
|
-
<
|
|
140
|
+
<output_constraints>
|
|
138
141
|
|
|
139
|
-
1.
|
|
140
|
-
2.
|
|
141
|
-
3.
|
|
142
|
+
1. Output detailed text content for {{nodeName}}.
|
|
143
|
+
2. Output {{nodeName}} content directly without including other information.
|
|
144
|
+
3. Reference the style from examples only, **output content in {{locale}} language**
|
|
142
145
|
|
|
143
|
-
</
|
|
146
|
+
</output_constraints>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
<jsx_constraints>
|
|
2
|
+
- **Very Important**: In JSX syntax, component names do not include `<` or `/>`. When component names are used in titles, charts, or descriptions, always ensure you use the correct name format
|
|
2
3
|
- bad: `<Uploader />`
|
|
3
4
|
- good: `Uploader`
|
|
5
|
+
|
|
6
|
+
</jsx_constraints>
|
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<role_and_goal>
|
|
2
|
+
You are a meticulous AI Agent responsible for quality control. Your task is to compare new document structures with previous versions based on specific user feedback. You must act as a strict gatekeeper, ensuring that only intended and explicitly requested changes occur.
|
|
3
|
+
|
|
4
|
+
Your primary objective is to validate three critical rules:
|
|
5
|
+
1. **Feedback Implementation**: The new document structure **must** correctly implement all changes requested in the user feedback.
|
|
6
|
+
2. **Unrelated Node Stability**: Nodes not mentioned in user feedback **must not have their path or sourcesIds attributes modified**
|
|
7
|
+
- `path` and `sourcesIds` are critical identifiers linking existing content, and their stability is paramount.
|
|
8
|
+
- For scenarios where users request adding new nodes, the new nodes may affect the order of existing nodes, which is acceptable.
|
|
9
|
+
3. **Data Validity**: All {{ nodeName }} items must have associated data sources with values in sourceIds.
|
|
10
|
+
</role_and_goal>
|
|
4
11
|
|
|
5
12
|
<context>
|
|
6
|
-
-
|
|
13
|
+
- **Original document structure (originalDocumentStructure)**:
|
|
7
14
|
<original_document_structure>
|
|
8
15
|
{{ originalDocumentStructure }}
|
|
9
16
|
</original_document_structure>
|
|
10
17
|
|
|
11
18
|
{% if feedback %}
|
|
12
|
-
-
|
|
19
|
+
- **User feedback**:
|
|
13
20
|
```
|
|
14
21
|
{{ feedback }}
|
|
15
22
|
```
|
|
16
23
|
{% endif %}
|
|
17
24
|
|
|
18
|
-
-
|
|
25
|
+
- **Newly generated document structure (documentStructure)**:
|
|
19
26
|
<document_structure>
|
|
20
27
|
{{ documentStructure }}
|
|
21
28
|
</document_structure>
|
|
22
29
|
</context>
|
|
23
30
|
|
|
24
|
-
<goal>
|
|
25
|
-
你的主要目标是验证三条关键规则:
|
|
26
|
-
1. **反馈的实现**:新的结构规划(document_structure)**必须**正确地实现用户反馈中要求的所有变更。
|
|
27
|
-
2. **无关节点的稳定性**:没有在用户反馈中被提及的节点 ** path、sourcesIds 属性不能被修改 **
|
|
28
|
-
- `path`、`sourcesIds` 是关联现有内容的关键标识符,其稳定性至关重要。
|
|
29
|
-
- 对于用户要求新增节点的场景,新增的节点可能会影响原来节点的顺序,这是允许的。
|
|
30
|
-
4. **数据有效性**: 所有 {{ nodeName }} 都有关联数据源,sourceIds 中都有值。
|
|
31
|
-
</goal>
|
|
32
|
-
|
|
33
31
|
<quality_control_rules>
|
|
34
|
-
###
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
*
|
|
46
|
-
*
|
|
32
|
+
### Scenario 1: Initial Run (No Original document Structure)
|
|
33
|
+
If `original_document_structure` is null, empty, or not provided, this indicates the first structure generation. There is no baseline for comparison.
|
|
34
|
+
Your validation automatically passes.
|
|
35
|
+
|
|
36
|
+
### Scenario 2: Iterative Run (Original Structure Exists)
|
|
37
|
+
This is the primary scenario. You must perform a detailed comparison.
|
|
38
|
+
|
|
39
|
+
**Step-by-step Analysis**:
|
|
40
|
+
1. **Analyze Feedback**: Carefully read and understand each change request in the user feedback. Identify which nodes need to be modified, added, or deleted.
|
|
41
|
+
2. **Verify Feedback Implementation**: Confirm that all requested changes have been executed in `document_structure`. For example, if feedback requests "remove the 'Examples' section," you must verify that this section no longer exists in `document_structure`.
|
|
42
|
+
3. **Verify Unrelated Node Stability**: This is the most critical check. Iterate through all nodes in `document_structure`. For each node that exists in `original_document_structure` but was not mentioned in the feedback:
|
|
43
|
+
* **Critical**: Its `path` and `sourcesIds` attributes **must** be identical to those in `original_document_structure`.
|
|
44
|
+
* Ideally, other attributes (such as `title`, `description`) should also remain stable, unless these changes are directly caused by a requested modification or result from DataSource updates.
|
|
47
45
|
</quality_control_rules>
|
|
48
46
|
|
|
49
|
-
<
|
|
50
|
-
|
|
47
|
+
<output_constraints>
|
|
48
|
+
Your output must be a valid JSON object containing `isValid` and `reason`, returned in English.
|
|
51
49
|
|
|
52
|
-
*
|
|
50
|
+
* **If all rules are satisfied**:
|
|
53
51
|
|
|
54
52
|
```json
|
|
55
53
|
{
|
|
@@ -58,7 +56,7 @@
|
|
|
58
56
|
}
|
|
59
57
|
```
|
|
60
58
|
|
|
61
|
-
*
|
|
59
|
+
* **If Rule 1 (Feedback Implementation) is violated**:
|
|
62
60
|
|
|
63
61
|
```json
|
|
64
62
|
{
|
|
@@ -67,7 +65,7 @@
|
|
|
67
65
|
}
|
|
68
66
|
```
|
|
69
67
|
|
|
70
|
-
*
|
|
68
|
+
* **If Rule 2 (Stability) is violated**:
|
|
71
69
|
|
|
72
70
|
```json
|
|
73
71
|
{
|
|
@@ -76,7 +74,7 @@
|
|
|
76
74
|
}
|
|
77
75
|
```
|
|
78
76
|
|
|
79
|
-
*
|
|
77
|
+
* **If data is invalid**:
|
|
80
78
|
```json
|
|
81
79
|
{
|
|
82
80
|
"isValid": false,
|
|
@@ -84,12 +82,12 @@
|
|
|
84
82
|
}
|
|
85
83
|
```
|
|
86
84
|
|
|
87
|
-
*
|
|
85
|
+
* **If this is the initial run**:
|
|
88
86
|
|
|
89
87
|
```json
|
|
90
88
|
{
|
|
91
89
|
"isValid": true,
|
|
92
|
-
"reason": "
|
|
90
|
+
"reason": "Initial document structure generation with no previous version for comparison."
|
|
93
91
|
}
|
|
94
92
|
```
|
|
95
|
-
</
|
|
93
|
+
</output_constraints>
|