diff --git a/resource/package.registry.json b/resource/package.registry.json
index 8564cd3..b74fa0d 100644
--- a/resource/package.registry.json
+++ b/resource/package.registry.json
@@ -4,9 +4,9 @@
"metadata": {
"version": "2.0.0",
"description": "package 级资源注册表",
- "createdAt": "2025-06-28T11:53:03.703Z",
- "updatedAt": "2025-06-28T11:53:03.717Z",
- "resourceCount": 29
+ "createdAt": "2025-06-28T13:36:34.963Z",
+ "updatedAt": "2025-06-28T13:36:34.978Z",
+ "resourceCount": 30
},
"resources": [
{
@@ -17,9 +17,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/assistant/assistant.role.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.708Z",
- "updatedAt": "2025-06-28T11:53:03.708Z",
- "scannedAt": "2025-06-28T11:53:03.708Z",
+ "createdAt": "2025-06-28T13:36:34.968Z",
+ "updatedAt": "2025-06-28T13:36:34.968Z",
+ "scannedAt": "2025-06-28T13:36:34.968Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/assistant.role.md",
"fileType": "role"
}
@@ -32,9 +32,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/luban/luban.role.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.708Z",
- "updatedAt": "2025-06-28T11:53:03.708Z",
- "scannedAt": "2025-06-28T11:53:03.708Z",
+ "createdAt": "2025-06-28T13:36:34.968Z",
+ "updatedAt": "2025-06-28T13:36:34.968Z",
+ "scannedAt": "2025-06-28T13:36:34.968Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/luban.role.md",
"fileType": "role"
}
@@ -47,9 +47,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/noface/noface.role.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.708Z",
- "updatedAt": "2025-06-28T11:53:03.708Z",
- "scannedAt": "2025-06-28T11:53:03.708Z",
+ "createdAt": "2025-06-28T13:36:34.968Z",
+ "updatedAt": "2025-06-28T13:36:34.968Z",
+ "scannedAt": "2025-06-28T13:36:34.968Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/noface.role.md",
"fileType": "role"
}
@@ -62,9 +62,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/nuwa/nuwa.role.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.709Z",
- "updatedAt": "2025-06-28T11:53:03.709Z",
- "scannedAt": "2025-06-28T11:53:03.709Z",
+ "createdAt": "2025-06-28T13:36:34.969Z",
+ "updatedAt": "2025-06-28T13:36:34.969Z",
+ "scannedAt": "2025-06-28T13:36:34.969Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/nuwa.role.md",
"fileType": "role"
}
@@ -77,9 +77,9 @@
"description": "专业角色,提供特定领域的专业能力",
"reference": "@package://resource/role/sean/sean.role.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.709Z",
- "updatedAt": "2025-06-28T11:53:03.709Z",
- "scannedAt": "2025-06-28T11:53:03.709Z",
+ "createdAt": "2025-06-28T13:36:34.969Z",
+ "updatedAt": "2025-06-28T13:36:34.969Z",
+ "scannedAt": "2025-06-28T13:36:34.969Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/sean.role.md",
"fileType": "role"
}
@@ -92,9 +92,9 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/core/_deprecated/recall_v1.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.710Z",
- "updatedAt": "2025-06-28T11:53:03.710Z",
- "scannedAt": "2025-06-28T11:53:03.710Z",
+ "createdAt": "2025-06-28T13:36:34.970Z",
+ "updatedAt": "2025-06-28T13:36:34.970Z",
+ "scannedAt": "2025-06-28T13:36:34.970Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/_deprecated/recall_v1.thought.md",
"fileType": "thought"
}
@@ -107,9 +107,9 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/core/_deprecated/remember_v1.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.710Z",
- "updatedAt": "2025-06-28T11:53:03.710Z",
- "scannedAt": "2025-06-28T11:53:03.710Z",
+ "createdAt": "2025-06-28T13:36:34.970Z",
+ "updatedAt": "2025-06-28T13:36:34.970Z",
+ "scannedAt": "2025-06-28T13:36:34.970Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/_deprecated/remember_v1.thought.md",
"fileType": "thought"
}
@@ -122,9 +122,9 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/core/remember-xml.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.711Z",
- "updatedAt": "2025-06-28T11:53:03.711Z",
- "scannedAt": "2025-06-28T11:53:03.711Z",
+ "createdAt": "2025-06-28T13:36:34.971Z",
+ "updatedAt": "2025-06-28T13:36:34.971Z",
+ "scannedAt": "2025-06-28T13:36:34.971Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/remember-xml.thought.md",
"fileType": "thought"
}
@@ -137,9 +137,9 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/core/remember.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.711Z",
- "updatedAt": "2025-06-28T11:53:03.711Z",
- "scannedAt": "2025-06-28T11:53:03.711Z",
+ "createdAt": "2025-06-28T13:36:34.971Z",
+ "updatedAt": "2025-06-28T13:36:34.971Z",
+ "scannedAt": "2025-06-28T13:36:34.971Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/core/remember.thought.md",
"fileType": "thought"
}
@@ -152,25 +152,70 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/role/assistant/thought/assistant.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.711Z",
- "updatedAt": "2025-06-28T11:53:03.711Z",
- "scannedAt": "2025-06-28T11:53:03.711Z",
+ "createdAt": "2025-06-28T13:36:34.971Z",
+ "updatedAt": "2025-06-28T13:36:34.971Z",
+ "scannedAt": "2025-06-28T13:36:34.971Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/thought/assistant.thought.md",
"fileType": "thought"
}
},
{
- "id": "craftsmanship",
+ "id": "design",
"source": "package",
"protocol": "thought",
- "name": "Craftsmanship 思维模式",
+ "name": "Design 思维模式",
"description": "思维模式,指导AI的思考方式",
- "reference": "@package://resource/role/luban/thought/craftsmanship.thought.md",
+ "reference": "@package://resource/role/luban/thought/design.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.711Z",
- "updatedAt": "2025-06-28T11:53:03.711Z",
- "scannedAt": "2025-06-28T11:53:03.711Z",
- "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/craftsmanship.thought.md",
+ "createdAt": "2025-06-28T13:36:34.972Z",
+ "updatedAt": "2025-06-28T13:36:34.972Z",
+ "scannedAt": "2025-06-28T13:36:34.972Z",
+ "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/design.thought.md",
+ "fileType": "thought"
+ }
+ },
+ {
+ "id": "engineering",
+ "source": "package",
+ "protocol": "thought",
+ "name": "Engineering 思维模式",
+ "description": "思维模式,指导AI的思考方式",
+ "reference": "@package://resource/role/luban/thought/engineering.thought.md",
+ "metadata": {
+ "createdAt": "2025-06-28T13:36:34.972Z",
+ "updatedAt": "2025-06-28T13:36:34.972Z",
+ "scannedAt": "2025-06-28T13:36:34.972Z",
+ "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/engineering.thought.md",
+ "fileType": "thought"
+ }
+ },
+ {
+ "id": "requirements",
+ "source": "package",
+ "protocol": "thought",
+ "name": "Requirements 思维模式",
+ "description": "思维模式,指导AI的思考方式",
+ "reference": "@package://resource/role/luban/thought/requirements.thought.md",
+ "metadata": {
+ "createdAt": "2025-06-28T13:36:34.972Z",
+ "updatedAt": "2025-06-28T13:36:34.972Z",
+ "scannedAt": "2025-06-28T13:36:34.972Z",
+ "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/requirements.thought.md",
+ "fileType": "thought"
+ }
+ },
+ {
+ "id": "validation",
+ "source": "package",
+ "protocol": "thought",
+ "name": "Validation 思维模式",
+ "description": "思维模式,指导AI的思考方式",
+ "reference": "@package://resource/role/luban/thought/validation.thought.md",
+ "metadata": {
+ "createdAt": "2025-06-28T13:36:34.972Z",
+ "updatedAt": "2025-06-28T13:36:34.972Z",
+ "scannedAt": "2025-06-28T13:36:34.972Z",
+ "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/thought/validation.thought.md",
"fileType": "thought"
}
},
@@ -182,9 +227,9 @@
"description": "思维模式,指导AI的思考方式",
"reference": "@package://resource/role/nuwa/thought/role-creation.thought.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.711Z",
- "updatedAt": "2025-06-28T11:53:03.711Z",
- "scannedAt": "2025-06-28T11:53:03.711Z",
+ "createdAt": "2025-06-28T13:36:34.972Z",
+ "updatedAt": "2025-06-28T13:36:34.972Z",
+ "scannedAt": "2025-06-28T13:36:34.972Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/thought/role-creation.thought.md",
"fileType": "thought"
}
@@ -197,9 +242,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/assistant/execution/assistant.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.712Z",
- "updatedAt": "2025-06-28T11:53:03.712Z",
- "scannedAt": "2025-06-28T11:53:03.712Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/assistant/execution/assistant.execution.md",
"fileType": "execution"
}
@@ -212,9 +257,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/luban/execution/tool-development-workflow.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/execution/tool-development-workflow.execution.md",
"fileType": "execution"
}
@@ -227,9 +272,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/luban/execution/toolsandbox-mastery.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/execution/toolsandbox-mastery.execution.md",
"fileType": "execution"
}
@@ -242,9 +287,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/noface/execution/adaptive-learning.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/execution/adaptive-learning.execution.md",
"fileType": "execution"
}
@@ -257,9 +302,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/noface/execution/content-preservation.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/noface/execution/content-preservation.execution.md",
"fileType": "execution"
}
@@ -272,9 +317,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/dpml-authoring.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.974Z",
+ "updatedAt": "2025-06-28T13:36:34.974Z",
+ "scannedAt": "2025-06-28T13:36:34.974Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/dpml-authoring.execution.md",
"fileType": "execution"
}
@@ -287,9 +332,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/role-design-patterns.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.713Z",
- "updatedAt": "2025-06-28T11:53:03.713Z",
- "scannedAt": "2025-06-28T11:53:03.713Z",
+ "createdAt": "2025-06-28T13:36:34.975Z",
+ "updatedAt": "2025-06-28T13:36:34.975Z",
+ "scannedAt": "2025-06-28T13:36:34.975Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/role-design-patterns.execution.md",
"fileType": "execution"
}
@@ -302,9 +347,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/role-generation.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.714Z",
- "updatedAt": "2025-06-28T11:53:03.714Z",
- "scannedAt": "2025-06-28T11:53:03.714Z",
+ "createdAt": "2025-06-28T13:36:34.975Z",
+ "updatedAt": "2025-06-28T13:36:34.975Z",
+ "scannedAt": "2025-06-28T13:36:34.975Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/role-generation.execution.md",
"fileType": "execution"
}
@@ -317,9 +362,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/nuwa/execution/visualization-enhancement.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.714Z",
- "updatedAt": "2025-06-28T11:53:03.714Z",
- "scannedAt": "2025-06-28T11:53:03.714Z",
+ "createdAt": "2025-06-28T13:36:34.975Z",
+ "updatedAt": "2025-06-28T13:36:34.975Z",
+ "scannedAt": "2025-06-28T13:36:34.975Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/nuwa/execution/visualization-enhancement.execution.md",
"fileType": "execution"
}
@@ -332,9 +377,9 @@
"description": "执行模式,定义具体的行为模式",
"reference": "@package://resource/role/sean/execution/template-adherence.execution.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.714Z",
- "updatedAt": "2025-06-28T11:53:03.714Z",
- "scannedAt": "2025-06-28T11:53:03.714Z",
+ "createdAt": "2025-06-28T13:36:34.975Z",
+ "updatedAt": "2025-06-28T13:36:34.975Z",
+ "scannedAt": "2025-06-28T13:36:34.975Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/execution/template-adherence.execution.md",
"fileType": "execution"
}
@@ -347,28 +392,13 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/dpml-tool-tagging.knowledge.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.715Z",
- "updatedAt": "2025-06-28T11:53:03.715Z",
- "scannedAt": "2025-06-28T11:53:03.715Z",
+ "createdAt": "2025-06-28T13:36:34.976Z",
+ "updatedAt": "2025-06-28T13:36:34.976Z",
+ "scannedAt": "2025-06-28T13:36:34.976Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/dpml-tool-tagging.knowledge.md",
"fileType": "knowledge"
}
},
- {
- "id": "javascript-ecosystem",
- "source": "package",
- "protocol": "knowledge",
- "name": "Javascript Ecosystem 知识库",
- "description": "知识库,提供专业知识和信息",
- "reference": "@package://resource/role/luban/knowledge/javascript-ecosystem.knowledge.md",
- "metadata": {
- "createdAt": "2025-06-28T11:53:03.715Z",
- "updatedAt": "2025-06-28T11:53:03.715Z",
- "scannedAt": "2025-06-28T11:53:03.715Z",
- "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/javascript-ecosystem.knowledge.md",
- "fileType": "knowledge"
- }
- },
{
"id": "promptx-tool-architecture",
"source": "package",
@@ -377,28 +407,13 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/luban/knowledge/promptx-tool-architecture.knowledge.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.715Z",
- "updatedAt": "2025-06-28T11:53:03.715Z",
- "scannedAt": "2025-06-28T11:53:03.715Z",
+ "createdAt": "2025-06-28T13:36:34.977Z",
+ "updatedAt": "2025-06-28T13:36:34.977Z",
+ "scannedAt": "2025-06-28T13:36:34.976Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/promptx-tool-architecture.knowledge.md",
"fileType": "knowledge"
}
},
- {
- "id": "tool-best-practices",
- "source": "package",
- "protocol": "knowledge",
- "name": "Tool Best Practices 知识库",
- "description": "知识库,提供专业知识和信息",
- "reference": "@package://resource/role/luban/knowledge/tool-best-practices.knowledge.md",
- "metadata": {
- "createdAt": "2025-06-28T11:53:03.716Z",
- "updatedAt": "2025-06-28T11:53:03.716Z",
- "scannedAt": "2025-06-28T11:53:03.716Z",
- "filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/luban/knowledge/tool-best-practices.knowledge.md",
- "fileType": "knowledge"
- }
- },
{
"id": "contradiction-methodology",
"source": "package",
@@ -407,9 +422,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/contradiction-methodology.knowledge.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.716Z",
- "updatedAt": "2025-06-28T11:53:03.716Z",
- "scannedAt": "2025-06-28T11:53:03.716Z",
+ "createdAt": "2025-06-28T13:36:34.977Z",
+ "updatedAt": "2025-06-28T13:36:34.977Z",
+ "scannedAt": "2025-06-28T13:36:34.977Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/contradiction-methodology.knowledge.md",
"fileType": "knowledge"
}
@@ -422,9 +437,9 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/product-philosophy.knowledge.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.716Z",
- "updatedAt": "2025-06-28T11:53:03.716Z",
- "scannedAt": "2025-06-28T11:53:03.716Z",
+ "createdAt": "2025-06-28T13:36:34.977Z",
+ "updatedAt": "2025-06-28T13:36:34.977Z",
+ "scannedAt": "2025-06-28T13:36:34.977Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/product-philosophy.knowledge.md",
"fileType": "knowledge"
}
@@ -437,24 +452,24 @@
"description": "知识库,提供专业知识和信息",
"reference": "@package://resource/role/sean/knowledge/promptx-evolution.knowledge.md",
"metadata": {
- "createdAt": "2025-06-28T11:53:03.716Z",
- "updatedAt": "2025-06-28T11:53:03.716Z",
- "scannedAt": "2025-06-28T11:53:03.716Z",
+ "createdAt": "2025-06-28T13:36:34.977Z",
+ "updatedAt": "2025-06-28T13:36:34.977Z",
+ "scannedAt": "2025-06-28T13:36:34.977Z",
"filePath": "/Users/sean/Management/ContradictionManagement/projects/PromptX/resource/role/sean/knowledge/promptx-evolution.knowledge.md",
"fileType": "knowledge"
}
}
],
"stats": {
- "totalResources": 29,
+ "totalResources": 30,
"byProtocol": {
"role": 5,
- "thought": 7,
+ "thought": 10,
"execution": 10,
- "knowledge": 7
+ "knowledge": 5
},
"bySource": {
- "package": 29
+ "package": 30
}
}
}
diff --git a/resource/role/luban/knowledge/javascript-ecosystem.knowledge.md b/resource/role/luban/knowledge/javascript-ecosystem.knowledge.md
deleted file mode 100644
index 959adf7..0000000
--- a/resource/role/luban/knowledge/javascript-ecosystem.knowledge.md
+++ /dev/null
@@ -1,549 +0,0 @@
-# JavaScript生态系统精通
-
-
-
-## 🚀 现代JavaScript精通
-
-### ES6+核心特性
-```javascript
-// 解构赋值与默认参数
-function createTool({ name, version = '1.0.0', dependencies = [] }) {
- return { name, version, dependencies };
-}
-
-// 箭头函数与Promise
-const processAsync = async (data) => {
- const results = await Promise.all(
- data.map(item => processItem(item))
- );
- return results.filter(Boolean);
-};
-
-// 模板字符串与标签函数
-function sqlQuery(strings, ...values) {
- return strings.reduce((query, string, i) => {
- const value = values[i] ? sanitize(values[i]) : '';
- return query + string + value;
- }, '');
-}
-
-// 类与继承
-class ToolBase {
- constructor(name) {
- this.name = name;
- this.startTime = Date.now();
- }
-
- async execute(params) {
- throw new Error('子类必须实现execute方法');
- }
-
- getExecutionTime() {
- return Date.now() - this.startTime;
- }
-}
-
-// Symbol与迭代器
-const PRIVATE_KEY = Symbol('private');
-class Tool {
- constructor() {
- this[PRIVATE_KEY] = { cache: new Map() };
- }
-
- *[Symbol.iterator]() {
- yield* this.getResults();
- }
-}
-```
-
-### 异步编程精通
-```javascript
-// Promise链式处理
-function processChain(data) {
- return Promise.resolve(data)
- .then(validate)
- .then(transform)
- .then(save)
- .catch(handleError)
- .finally(cleanup);
-}
-
-// async/await错误处理
-async function safeExecute(fn, ...args) {
- try {
- const result = await fn(...args);
- return { success: true, data: result };
- } catch (error) {
- return { success: false, error: error.message };
- }
-}
-
-// 并发控制
-class ConcurrencyManager {
- constructor(limit = 3) {
- this.limit = limit;
- this.running = 0;
- this.queue = [];
- }
-
- async execute(fn) {
- return new Promise((resolve, reject) => {
- this.queue.push({ fn, resolve, reject });
- this.process();
- });
- }
-
- async process() {
- if (this.running >= this.limit || this.queue.length === 0) {
- return;
- }
-
- this.running++;
- const { fn, resolve, reject } = this.queue.shift();
-
- try {
- const result = await fn();
- resolve(result);
- } catch (error) {
- reject(error);
- } finally {
- this.running--;
- this.process();
- }
- }
-}
-
-// 超时控制
-function withTimeout(promise, ms) {
- const timeout = new Promise((_, reject) =>
- setTimeout(() => reject(new Error('操作超时')), ms)
- );
- return Promise.race([promise, timeout]);
-}
-```
-
-## 📦 npm生态系统精通
-
-### package.json深度配置
-```json
-{
- "name": "my-awesome-tool",
- "version": "1.0.0",
- "description": "一个很棒的工具",
- "main": "index.js",
- "engines": {
- "node": ">=14.0.0",
- "npm": ">=6.0.0"
- },
- "scripts": {
- "start": "node index.js",
- "test": "jest",
- "lint": "eslint .",
- "format": "prettier --write .",
- "preinstall": "node scripts/check-env.js"
- },
- "dependencies": {
- "lodash": "^4.17.21",
- "axios": "^1.6.0"
- },
- "devDependencies": {
- "jest": "^29.0.0",
- "eslint": "^8.0.0",
- "prettier": "^2.8.0"
- },
- "peerDependencies": {
- "react": ">=16.8.0"
- },
- "optionalDependencies": {
- "fsevents": "^2.3.0"
- },
- "keywords": ["tool", "automation", "utility"],
- "author": "鲁班 ",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/promptx/awesome-tool.git"
- },
- "bugs": {
- "url": "https://github.com/promptx/awesome-tool/issues"
- },
- "homepage": "https://github.com/promptx/awesome-tool#readme"
-}
-```
-
-### 版本管理策略
-```javascript
-// 语义化版本控制
-const semver = require('semver');
-
-function updateVersion(currentVersion, changeType) {
- switch (changeType) {
- case 'patch': // 1.0.0 -> 1.0.1 (bug fixes)
- return semver.inc(currentVersion, 'patch');
- case 'minor': // 1.0.0 -> 1.1.0 (new features)
- return semver.inc(currentVersion, 'minor');
- case 'major': // 1.0.0 -> 2.0.0 (breaking changes)
- return semver.inc(currentVersion, 'major');
- default:
- throw new Error('无效的版本类型');
- }
-}
-
-// 版本兼容性检查
-function checkCompatibility(required, current) {
- return semver.satisfies(current, required);
-}
-```
-
-### 依赖管理最佳实践
-```javascript
-// 依赖安全检查
-const auditDependencies = async () => {
- const { exec } = require('child_process');
- const { promisify } = require('util');
- const execAsync = promisify(exec);
-
- try {
- const { stdout } = await execAsync('npm audit --json');
- const auditResult = JSON.parse(stdout);
-
- if (auditResult.vulnerabilities) {
- console.warn('发现安全漏洞:', auditResult.vulnerabilities);
- }
-
- return auditResult;
- } catch (error) {
- console.error('安全审计失败:', error.message);
- }
-};
-
-// 依赖大小分析
-const analyzeBundleSize = (packageName) => {
- const bundlePhobia = require('bundle-phobia');
- return bundlePhobia.getPackageStats(packageName);
-};
-
-// 依赖树分析
-const analyzeDependencyTree = () => {
- const fs = require('fs');
- const packageLock = JSON.parse(fs.readFileSync('package-lock.json'));
-
- function walkDependencies(deps, level = 0) {
- for (const [name, info] of Object.entries(deps)) {
- console.log(' '.repeat(level) + `${name}@${info.version}`);
- if (info.dependencies) {
- walkDependencies(info.dependencies, level + 1);
- }
- }
- }
-
- walkDependencies(packageLock.dependencies);
-};
-```
-
-## 🔧 模块系统精通
-
-### CommonJS深度应用
-```javascript
-// 模块导出模式
-// 1. 单一导出
-module.exports = class Tool {
- execute() { /* ... */ }
-};
-
-// 2. 多重导出
-module.exports = {
- Tool,
- ToolManager,
- createTool: (config) => new Tool(config)
-};
-
-// 3. 动态导出
-const tools = {};
-const toolFiles = fs.readdirSync('./tools');
-toolFiles.forEach(file => {
- const name = path.basename(file, '.js');
- tools[name] = require(`./tools/${file}`);
-});
-module.exports = tools;
-
-// 4. 条件导出
-if (process.env.NODE_ENV === 'development') {
- module.exports.debug = require('./debug');
-}
-```
-
-### require缓存机制
-```javascript
-// 缓存清理
-function clearRequireCache(modulePath) {
- const resolved = require.resolve(modulePath);
- delete require.cache[resolved];
-}
-
-// 热重载实现
-class HotReloader {
- constructor() {
- this.watchers = new Map();
- }
-
- watch(modulePath, callback) {
- const watcher = fs.watch(modulePath, () => {
- clearRequireCache(modulePath);
- const newModule = require(modulePath);
- callback(newModule);
- });
-
- this.watchers.set(modulePath, watcher);
- }
-
- unwatch(modulePath) {
- const watcher = this.watchers.get(modulePath);
- if (watcher) {
- watcher.close();
- this.watchers.delete(modulePath);
- }
- }
-}
-
-// 模块路径解析
-function resolveModule(moduleName, fromPath) {
- const Module = require('module');
- const originalResolveFilename = Module._resolveFilename;
-
- return originalResolveFilename.call(Module, moduleName, {
- id: fromPath,
- filename: fromPath,
- paths: Module._nodeModulePaths(path.dirname(fromPath))
- });
-}
-```
-
-## 🛠️ 开发工具精通
-
-### ESLint配置优化
-```javascript
-// .eslintrc.js
-module.exports = {
- env: {
- node: true,
- es2021: true,
- jest: true
- },
- extends: [
- 'eslint:recommended',
- 'plugin:security/recommended'
- ],
- parserOptions: {
- ecmaVersion: 'latest',
- sourceType: 'module'
- },
- plugins: ['security'],
- rules: {
- 'no-console': 'warn',
- 'no-unused-vars': 'error',
- 'prefer-const': 'error',
- 'no-var': 'error',
- 'security/detect-eval-with-expression': 'error',
- 'security/detect-non-literal-fs-filename': 'warn'
- },
- overrides: [
- {
- files: ['*.test.js', '*.spec.js'],
- rules: {
- 'no-console': 'off'
- }
- }
- ]
-};
-```
-
-### Prettier格式化配置
-```json
-{
- "semi": true,
- "trailingComma": "es5",
- "singleQuote": true,
- "printWidth": 80,
- "tabWidth": 2,
- "useTabs": false,
- "bracketSpacing": true,
- "arrowParens": "avoid",
- "endOfLine": "lf"
-}
-```
-
-### Jest测试框架
-```javascript
-// jest.config.js
-module.exports = {
- testEnvironment: 'node',
- roots: ['/src', '/tests'],
- testMatch: [
- '**/__tests__/**/*.js',
- '**/?(*.)+(spec|test).js'
- ],
- collectCoverageFrom: [
- 'src/**/*.js',
- '!src/**/*.test.js'
- ],
- coverageDirectory: 'coverage',
- coverageReporters: ['text', 'lcov', 'html'],
- setupFilesAfterEnv: ['/tests/setup.js']
-};
-
-// 测试示例
-describe('Tool', () => {
- let tool;
-
- beforeEach(() => {
- tool = new Tool();
- });
-
- afterEach(async () => {
- await tool.cleanup();
- });
-
- test('should execute successfully', async () => {
- const result = await tool.execute({ input: 'test' });
- expect(result).toHaveProperty('success', true);
- });
-
- test('should handle errors gracefully', async () => {
- await expect(tool.execute({})).rejects.toThrow('Missing input');
- });
-
- test('should validate parameters', () => {
- const validation = tool.validate({ input: 'valid' });
- expect(validation.valid).toBe(true);
- });
-});
-```
-
-## 🔒 安全编程实践
-
-### 输入验证与清理
-```javascript
-const validator = require('validator');
-
-class InputValidator {
- static sanitizeString(input, maxLength = 1000) {
- if (typeof input !== 'string') {
- throw new Error('输入必须是字符串');
- }
-
- // 长度限制
- if (input.length > maxLength) {
- throw new Error(`输入长度超过限制: ${maxLength}`);
- }
-
- // XSS防护
- return validator.escape(input);
- }
-
- static validateEmail(email) {
- if (!validator.isEmail(email)) {
- throw new Error('无效的邮箱地址');
- }
- return validator.normalizeEmail(email);
- }
-
- static validateURL(url) {
- if (!validator.isURL(url)) {
- throw new Error('无效的URL');
- }
- return url;
- }
-
- static sanitizeFilename(filename) {
- // 移除危险字符
- return filename.replace(/[^a-zA-Z0-9._-]/g, '');
- }
-}
-```
-
-### 错误处理与日志
-```javascript
-class ToolLogger {
- constructor(toolName) {
- this.toolName = toolName;
- this.startTime = Date.now();
- }
-
- info(message, data = {}) {
- console.log(JSON.stringify({
- level: 'info',
- tool: this.toolName,
- message,
- data,
- timestamp: new Date().toISOString()
- }));
- }
-
- error(message, error = {}) {
- console.error(JSON.stringify({
- level: 'error',
- tool: this.toolName,
- message,
- error: {
- message: error.message,
- stack: error.stack
- },
- timestamp: new Date().toISOString()
- }));
- }
-
- performance(operation, duration) {
- this.info(`Performance: ${operation}`, { duration });
- }
-}
-```
-
-### 资源管理与限制
-```javascript
-class ResourceManager {
- constructor(options = {}) {
- this.maxMemory = options.maxMemory || 100 * 1024 * 1024; // 100MB
- this.maxExecutionTime = options.maxExecutionTime || 30000; // 30s
- this.activeOperations = new Set();
- }
-
- async executeWithLimits(operation, context) {
- const operationId = Math.random().toString(36);
- this.activeOperations.add(operationId);
-
- const timeoutPromise = new Promise((_, reject) => {
- setTimeout(() => {
- reject(new Error('操作超时'));
- }, this.maxExecutionTime);
- });
-
- try {
- // 内存监控
- const initialMemory = process.memoryUsage().heapUsed;
-
- const result = await Promise.race([
- operation(),
- timeoutPromise
- ]);
-
- const finalMemory = process.memoryUsage().heapUsed;
- const memoryUsed = finalMemory - initialMemory;
-
- if (memoryUsed > this.maxMemory) {
- console.warn(`内存使用超限: ${memoryUsed / 1024 / 1024}MB`);
- }
-
- return result;
- } finally {
- this.activeOperations.delete(operationId);
- }
- }
-
- getActiveOperations() {
- return this.activeOperations.size;
- }
-}
-```
-
-
\ No newline at end of file
diff --git a/resource/role/luban/knowledge/tool-best-practices.knowledge.md b/resource/role/luban/knowledge/tool-best-practices.knowledge.md
deleted file mode 100644
index 1903914..0000000
--- a/resource/role/luban/knowledge/tool-best-practices.knowledge.md
+++ /dev/null
@@ -1,348 +0,0 @@
-# 工具设计最佳实践
-
-
-
-## 🎯 工具设计哲学
-
-### 极简主义原则
-- **单一职责**:每个工具只解决一个核心问题
-- **接口优雅**:参数设计直观易懂,返回值结构清晰
-- **依赖最小**:只引入必要的依赖,避免过度膨胀
-- **错误友好**:提供清晰的错误信息和处理建议
-
-### 用户体验至上
-- **即装即用**:工具无需复杂配置即可使用
-- **文档自描述**:通过Schema和Metadata实现自我说明
-- **性能优先**:执行效率和响应速度优化
-- **跨平台兼容**:确保在不同环境下稳定运行
-
-## 🏗️ 架构设计原则
-
-### ToolInterface标准化实现
-```javascript
-// 完美的工具接口示例
-module.exports = {
- // 🔧 依赖管理:明确、最小、版本锁定
- getDependencies() {
- return [
- 'lodash@^4.17.21', // 工具函数库
- 'validator@^13.11.0' // 数据验证
- ];
- },
-
- // 📊 元信息:完整、准确、描述性
- getMetadata() {
- return {
- name: 'text-processor',
- description: '智能文本处理工具,支持清理、格式化、验证等功能',
- version: '1.2.0',
- category: 'text-processing',
- author: '鲁班',
- tags: ['text', 'processing', 'utility']
- };
- },
-
- // 📝 Schema定义:结构化、类型安全、示例丰富
- getSchema() {
- return {
- type: 'object',
- properties: {
- text: {
- type: 'string',
- description: '需要处理的文本内容',
- example: 'Hello World!'
- },
- operations: {
- type: 'array',
- items: {
- type: 'string',
- enum: ['clean', 'format', 'validate']
- },
- description: '要执行的操作列表',
- default: ['clean']
- },
- options: {
- type: 'object',
- properties: {
- encoding: { type: 'string', default: 'utf-8' },
- strict: { type: 'boolean', default: false }
- }
- }
- },
- required: ['text']
- };
- },
-
- // ✅ 参数验证:严格、友好、早期失败
- validate(params) {
- const errors = [];
-
- if (!params.text || typeof params.text !== 'string') {
- errors.push('text参数必须是非空字符串');
- }
-
- if (params.text && params.text.length > 50000) {
- errors.push('text长度不能超过50000字符');
- }
-
- return {
- valid: errors.length === 0,
- errors
- };
- },
-
- // 🚀 核心执行:健壮、高效、可观测
- async execute(params) {
- const startTime = Date.now();
-
- try {
- // 核心处理逻辑
- const result = await this.processText(params);
-
- return {
- success: true,
- data: result,
- metadata: {
- executionTime: Date.now() - startTime,
- timestamp: new Date().toISOString()
- }
- };
- } catch (error) {
- return {
- success: false,
- error: {
- message: error.message,
- code: error.code || 'UNKNOWN_ERROR'
- },
- metadata: {
- executionTime: Date.now() - startTime,
- timestamp: new Date().toISOString()
- }
- };
- }
- }
-};
-```
-
-## 🛡️ 安全与性能最佳实践
-
-### 输入安全防护
-```javascript
-// 输入验证模式
-class InputValidator {
- static validateText(text, maxLength = 10000) {
- if (typeof text !== 'string') {
- throw new Error('输入必须是字符串类型');
- }
-
- if (text.length > maxLength) {
- throw new Error(`文本长度超过限制: ${maxLength}`);
- }
-
- // XSS防护
- if (/