1
0
mirror of https://github.com/aicode-standard/prompt-config.git synced 2025-10-07 06:45:14 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

improve the content of the proposal

This commit is contained in:
小墨
2025-09-29 17:15:43 +00:00
parent 32b4a18c0b
commit da0d5bc188
2 changed files with 589 additions and 175 deletions

383
README.md
View File

@@ -23,34 +23,89 @@ Create a unified standard for AI code editor prompt configuration files to addre
### Core Standard Path ### Core Standard Path
``` ```
.aicode/ .prompt/
├── prompts/ ├─ rules/
├── project.md # Project-level prompts (primary file) ─ project[.<editor-identifer>].md # Project-level prompts (primary file)
├── context.md # Context rules ─ context[.<editor-identifer>].md # Context rules (optional)
├── style.md # Code style guidelines └─ code_style[.<editor-identifer>].md # Code style guidelines (optional)
│ └── editor-specific/ # Editor-specific configurations (optional) ├─ config.json # Configuration file
├── config.json # Configuration file └─ README.md # Documentation (optional)
└── README.md # Documentation
``` ```
### Configuration File Format (`config.json`) The `[.<editor-identifer>]` indicates editor-specific configurations. When omitted, it represents globally shared prompt files.
### Configuration Examples
**Basic Configuration:**
If we want to configure project-level prompts, we can do this:
```
.prompt/
└─ rules/
├─ project.md # Project-level prompts (primary file)
├─ project.vscode.md # Enhance `project.md` in VSCode editor (optional)
├─ project.cursor.md # Enhance `project.md` in Cursor editor (optional)
└─ project.trae.md # Enhance `project.md` in TRAE editor (optional)
```
**Advanced Configuration (Multi-file Structure):**
When prompt content is extensive and needs to be split into multiple files, you can create corresponding directories to organize prompts according to custom directory structures. Similarly, files should end with `[.<editor-identifer>].md`. All files are optional.
```
.prompt/
└─ rules/
├─ project/
│ ├─ [foo].vscode.md
│ ├─ [foo].cursor.md
│ ├─ [foo].trae.md
│ └─ index.md
├─ project.md
├─ project.vscode.md
├─ project.cursor.md
└─ project.trae.md
```
In this example, `.prompt/rules/project/index.md` serves the same purpose as `.prompt/rules/project.md`. When both exist, they will both take effect.
For the VSCode editor, in this example, the following markdown files will be loaded as prompts:
- `.prompt/rules/project/[foo].vscode.md`
- `.prompt/rules/project/index.md`
- `.prompt/rules/project.md`
- `.prompt/rules/project.vscode.md`
### File Loading Rules
1. **Global Files**: `.prompt/rules/project.md` (shared by all editors)
2. **Editor-Specific Files**: `.prompt/rules/project.{editor}.md` (loaded by specific editors)
3. **Directory Structure**: Supports subdirectory organization, with `index.md` as the directory entry file
4. **Merge Strategy**: Content from all matching files will be merged, with editor-specific configurations extending global configurations
## Configuration File Format (`.prompt/config.json`)
```json ```json
{ {
"version": "1.0.0", "promptFileVersion": "1.0",
"prompts": { "response_language": "en-US", // Specify the language for model responses
"project": ".aicode/prompts/project.md", "defaultMergeStrategy": "append", // Default merge strategy: append|overwrite|smart
"context": ".aicode/prompts/context.md", "fileLoadingOrder": ["global", "editor-specific"], // File loading order
"style": ".aicode/prompts/style.md" "supportedEditors": ["vscode", "cursor", "trae", "codeium"],
},
"editorSpecific": { "editorSpecific": {
"vscode": {
"promptPriority": ["project.md", "project.vscode.md"],
"maxTokenLimit": 4000
},
"cursor": { "cursor": {
"rulesFile": ".cursor/rules.md", "promptPriority": ["project.md", "project.cursor.md"],
"source": ".aicode/prompts/project.md" "maxTokenLimit": 8000
}, },
"trae": { "trae": {
"rulesFile": ".trae/rules/project_rules.md", "promptPriority": ["project.md", "project.trae.md"],
"source": ".aicode/prompts/project.md" "maxTokenLimit": 6000
},
"[editor_name]": {
...
} }
} }
} }
@@ -60,47 +115,84 @@ Create a unified standard for AI code editor prompt configuration files to addre
### Phase 1: Compatibility Layer (Immediately Feasible) ### Phase 1: Compatibility Layer (Immediately Feasible)
Create conversion tools and installation scripts: Create conversion tools and symbolic link scripts:
```bash ```bash
# install-aicode-prompts.sh # migrate-prompts.sh
#!/bin/bash #!/bin/bash
mkdir -p .aicode/prompts
# Detect installed editors and create symbolic links # Create standard directory structure
if [ -d ".cursor" ]; then mkdir -p .prompt/rules
ln -sf ../.aicode/prompts/project.md .cursor/rules.md
# Migrate existing configurations and create symbolic links
migrate_editor_config() {
local editor=$1
local source_path=$2
local target_name=$3
if [ -f "$source_path" ]; then
# Migrate to new location
cp "$source_path" ".prompt/rules/${target_name}.${editor}.md"
# Create symbolic link for backward compatibility
ln -sf "../.prompt/rules/${target_name}.${editor}.md" "$source_path"
echo "Migrated ${editor} configuration"
fi fi
}
if [ -d ".trae" ]; then # Migrate various editor configurations
mkdir -p .trae/rules migrate_editor_config "cursor" ".cursor/rules.md" "project"
ln -sf ../../.aicode/prompts/project.md .trae/rules/project_rules.md migrate_editor_config "trae" ".trae/rules/project_rules.md" "project"
migrate_editor_config "codeium" ".codeium/context.md" "context"
# Create basic configuration file
if [ ! -f ".prompt/config.json" ]; then
cat > ".prompt/config.json" << EOF
{
"promptFileVersion": "1.0",
"response_language": "",
"defaultMergeStrategy": "append",
"supportedEditors": ["vscode", "cursor", "trae", "codeium"]
}
EOF
fi fi
``` ```
### Phase 2: Editor Adaptation ### Phase 2: Editor Adaptation
Encourage editor vendors to support standard paths: Encourage editor vendors to natively support standard paths:
```json ```json
// Editor configuration example // Editor configuration example (VSCode settings.json)
{ {
"promptSources": [ "aiPrompts.standardPath": ".prompt/rules",
".aicode/prompts/project.md", // Standard path (priority) "aiPrompts.loadOrder": [
".cursor/rules.md" // Legacy path (fallback) "project.md",
] "project.vscode.md",
"context.md",
"context.vscode.md"
],
"aiPrompts.mergeStrategy": "smart"
} }
``` ```
### Phase 3: Ecosystem Development ### Phase 3: Ecosystem Development
1. Create validation tools to check configuration integrity 1. **Develop Core Tools**:
2. Develop configuration generation plugins for VS Code and other editors - Configuration validation tool: `prompt-validator`
3. Establish template libraries and best practices - File merging tool: `prompt-merger`
- Migration assistance tool: `prompt-migrate`
2. **Editor Plugins**:
- VSCode extension: `vscode-prompt-config-integration`
- Cursor plugin: `cursor-prompt-config-integration`
3. **Template Library**:
- Configuration templates for common project types
- Best practice examples for various languages
## Detailed Configuration Specifications ## Detailed Configuration Specifications
### `project.md` Template ### Project Prompts Template (`.prompt/rules/project.md`)
```markdown ```markdown
# Project Prompts # Project Prompts
@@ -110,30 +202,61 @@ Encourage editor vendors to support standard paths:
## Coding Standards ## Coding Standards
- Language: {{Programming language}} - Language: {{Programming language}}
- Style: {{Code style}} - Code Style: {{Code style guidelines}}
- Constraints: {{Technical constraints}} - Naming Conventions: {{Naming rules}}
## Architecture Constraints
- Design Patterns: {{Patterns used}}
- Layered Architecture: {{Architecture layers}}
- Dependency Management: {{Dependency specifications}}
## Business Rules ## Business Rules
{{Specific business logic}} {{Specific business logic and requirements}}
``` ```
### Complete `config.json` Specification ### Editor-Specific Extension Example (`.prompt/rules/project.vscode.md`)
```markdown
# VSCode Specific Configuration
## Editor Integration
- Preferred VSCode Extensions: {{Extension list}}
- Debug Configuration: {{Debug settings}}
- Code Snippets: {{Custom snippets}}
## Performance Optimization
- Large File Handling Strategy: {{Handling approach}}
- Memory Management: {{Optimization suggestions}}
```
### Complete config.json Specification
```json ```json
{ {
"version": "string", "promptFileVersion": "string", // Configuration version number
"name": "string", "responseLanguage": "string", // Default response language
"prompts": { "defaultMergeStrategy": "string", // Default merge strategy
"project": "string", "fileLoadingOrder": ["string"], // File loading order
"context": "string", "maxFileSizeKB": number, // Maximum file size limit
"style": "string", "encoding": "string", // File encoding format
"testing": "string" "validationRules": { // Validation rules
"maxLength": number,
"allowedSections": ["string"],
"requiredSections": ["string"]
}, },
"mergeStrategy": "overwrite|append|smart", "editorSpecific": {
"editorSupport": { "[editor_name]": {
"cursor": "boolean", "promptPriority": ["string"], // Prompt priority
"trae": "boolean", "maxTokenLimit": number, // Maximum token limit
"codeium": "boolean" "temperature": number, // Temperature parameter
"modelPreferences": ["string"] // Model preferences
}
},
"extensions": { // Extension configuration
"customSections": ["string"], // Custom sections
"templateVariables": { // Template variables
"key": "value"
}
} }
} }
``` ```
@@ -142,58 +265,142 @@ Encourage editor vendors to support standard paths:
### Migrating from Existing Systems ### Migrating from Existing Systems
1. **Incremental Migration**: 1. **Automatic Migration**:
```bash ```bash
# 1. Create standard directory # Use migration tool
mkdir -p .aicode/prompts npx @prompt-standard/migrate --editor cursor --editor trae
# 2. Move existing configuration # Or use interactive migration
cp .cursor/rules.md .aicode/prompts/project.md npx @prompt-standard/migrate-interactive
# 3. Create symbolic links
ln -s .aicode/prompts/project.md .cursor/rules.md
``` ```
2. **Validation Tool**: 2. **Manual Migration**:
```bash ```bash
npx aicode-validate # 1. Create standard directory
mkdir -p .prompt/rules
# 2. Migrate and rename existing configurations
mv .cursor/rules.md .prompt/rules/project.cursor.md
mv .trae/rules/project_rules.md .prompt/rules/project.trae.md
# 3. Create symbolic links (optional, for compatibility)
ln -s ../.prompt/rules/project.cursor.md .cursor/rules.md
ln -s ../.prompt/rules/project.trae.md .trae/rules/project_rules.md
```
3. **Validation**:
```bash
# Install validation tool
npm install -g @prompt-standard/validator
# Validate configuration integrity
prompt-validate
```
### Validation Tool Features
```bash
# Check configuration completeness
prompt-validate --check-completeness
# Validate syntax correctness
prompt-validate --check-syntax
# Generate configuration report
prompt-validate --generate-report
# Check editor compatibility
prompt-validate --check-editor vscode cursor
``` ```
## Benefits Analysis ## Benefits Analysis
### For Developers ### For Developers
- ✅ **Consistency**: Unified experience across editors, reduced context switching
-**Consistency**: Unified experience across editors - ✅ **Maintainability**: Centralized management, single source of truth
-**Maintainability**: Single source of truth - ✅ **Flexibility**: Support for global configurations and editor-specific extensions
-**Collaboration**: Standardized team configurations - ✅ **Collaboration**: Standardized team configurations, easy sharing
### For Editor Vendors ### For Editor Vendors
- ✅ **Interoperability**: Reduce user migration costs, increase user retention
-**Interoperability**: Reduce user migration costs - ✅ **Ecosystem**: Promote toolchain integration and plugin development
-**Ecosystem**: Promote toolchain integration - ✅ **Standards Compliance**: Demonstrate professionalism and foresight, enhance competitiveness
-**Standards Compliance**: Demonstrate professionalism and foresight - ✅ **Extensibility**: Support for custom configurations and advanced features
## Action Plan ## Action Plan
1. **Immediate Actions** (1-2 weeks): ### Immediate Actions (1-2 weeks)
- Create reference implementation and conversion tools - [ ] Create core tool library: `@prompt-standard/core`
- Write detailed documentation and examples - [ ] Develop configuration validation tool: `@prompt-standard/validator`
- Establish community discussion groups - [ ] Write detailed documentation and examples
- [ ] Establish community discussion groups (Discord/GitHub Discussions)
2. **Short-term Goals** (1-3 months): ### Short-term Goals (1-3 months)
- Gain support from 2-3 mainstream editors - [ ] Gain support from 2-3 mainstream editors
- Create configuration templates for popular projects - [ ] Create configuration templates for popular projects
- Develop IDE plugins - [ ] Develop IDE plugin prototypes
- [ ] Establish automated testing processes
3. **Long-term Vision** (6-12 months): ### Long-term Vision (6-12 months)
- Become a de facto standard - [ ] Become a de facto standard, natively supported by multiple editors
- Establish certification programs - [ ] Establish certification programs and compatibility testing
- Extend support to more AI development tools - [ ] Extend support to more AI development tools
- [ ] Develop graphical configuration management tools
## Technical Support
### Development Tools
```bash
# Core library installation
npm install @prompt-standard/core
# Validation tool installation
npm install -g @prompt-standard/validator
# Migration tool installation
npm install -g @prompt-standard/migrate
```
### API Examples
```javascript
// Using core library
import { PromptLoader, PromptValidator } from '@prompt-standard/core'
const loader = new PromptLoader('.prompt/rules')
const prompts = await loader.loadForEditor('vscode')
const validator = new PromptValidator()
const results = await validator.validate(prompts)
```
## Call for Participation ## Call for Participation
We invite participation from: We invite participation from:
- **Editor Developers**: Implement standard support
- **Open Source Projects**: Early adoption of the standard ### For Editor Developers
- **Community Members**: Provide feedback and contributions - Implement native standard support
- **Enterprise Users**: Share real-world requirements - Provide feedback and improvement suggestions
- Participate in standard specification development
### For Open Source Projects
- Adopt standard configurations early
- Contribute project configuration templates
- Share usage experiences and best practices
### For Community Members
- Test and report issues
- Participate in documentation writing and translation
- Develop auxiliary tools and plugins
### For Enterprise Users
- Provide real business requirements
- Share enterprise-level application scenarios
- Participate in standard promotion and implementation
**Participation Methods**:
- 📝 Submit Issues and Feature Requests
- 🔄 Submit Pull Requests
- 💬 Join community discussions
- 🚀 Share your configuration examples
**GitHub Repository**: https://github.com/aicode-standard/prompt-config

View File

@@ -18,39 +18,94 @@
3. **版本控制冲突**:不同编辑器的配置文件需要分别添加到 `.gitignore` 3. **版本控制冲突**:不同编辑器的配置文件需要分别添加到 `.gitignore`
4. **迁移成本高**:切换编辑器时需要重新配置提示词 4. **迁移成本高**:切换编辑器时需要重新配置提示词
## proposed 标准 ## Proposed 标准
### 核心标准路径 ### 核心标准路径
``` ```
.aicode/ .prompt/
├── prompts/ ├─ rules/
├── project.md # 项目级提示词(主要文件) ─ project[.<editor-identifer>].md # 项目级提示词(主要文件)
├── context.md # 上下文规则 ─ context[.<editor-identifer>].md # 上下文规则(可选)
├── style.md # 代码风格规范 └─ code_style[.<editor-identifer>].md # 代码风格规范(可选)
└── editor-specific/ # 编辑器特定配置(可选) ├─ config.json # 配置文件
├── config.json # 配置文件 └─ README.md # 说明文档(可选)
└── README.md # 说明文档
``` ```
### 配置文件格式 (`config.json`) 其中,`[.<editor-identifer>]` 是编辑器特定配置。不添加则是全局使用的公共提示词文件。
### 配置示例
**基础配置:**
如果我们想配置项目级提示词,我们可以这样做:
```
.prompt/
└─ rules/
├─ project.md # 项目级提示词(主要文件)
├─ project.vscode.md # 在 VSCode 编辑器中扩展 `project.md` 文件(可选)
├─ project.cursor.md # 在 Cursor 编辑器中扩展 `project.md` 文件(可选)
└─ project.trae.md # 在 TRAE 编辑器中扩展 `project.md` 文件(可选)
```
**高级配置(多文件结构):**
当提示词内容较多,需要拆分成多个文件时,可以创建对应目录,将提示词按照自定义目录结构进行分类。同样的,也以 `[.<editor-identifer>].md` 结尾。所有的文件都是可选的。
```
.prompt/
└─ rules/
├─ project/
│ ├─ [foo].vscode.md
│ ├─ [foo].cursor.md
│ ├─ [foo].trae.md
│ └─ index.md
├─ project.md
├─ project.vscode.md
├─ project.cursor.md
└─ project.trae.md
```
在这个示例中,`.prompt/rules/project/index.md``.prompt/rules/project.md` 作用相同,同时存在时,他们都将生效。
对于 VSCode 编辑器,在这个示例中,会加载以下 markdown 文件作为提示词:
- `.prompt/rules/project/[foo].vscode.md`
- `.prompt/rules/project/index.md`
- `.prompt/rules/project.md`
- `.prompt/rules/project.vscode.md`
### 文件加载规则
1. **全局文件**`.prompt/rules/project.md`(所有编辑器共享)
2. **编辑器特定文件**`.prompt/rules/project.{editor}.md`(按编辑器加载)
3. **目录结构**:支持子目录组织,`index.md` 作为目录入口文件
4. **合并策略**:所有匹配的文件内容会被合并,编辑器特定配置会扩展全局配置
## 配置文件格式 (`.prompt/config.json`)
```json ```json
{ {
"version": "1.0.0", "promptFileVersion": "1.0",
"prompts": { "response_language": "zh-CN", // 指定模型返回的语言
"project": ".aicode/prompts/project.md", "defaultMergeStrategy": "append", // 默认合并策略append|overwrite|smart
"context": ".aicode/prompts/context.md", "fileLoadingOrder": ["global", "editor-specific"], // 文件加载顺序
"style": ".aicode/prompts/style.md" "supportedEditors": ["vscode", "cursor", "trae", "codeium"],
},
"editorSpecific": { "editorSpecific": {
"vscode": {
"promptPriority": ["project.md", "project.vscode.md"],
"maxTokenLimit": 4000
},
"cursor": { "cursor": {
"rulesFile": ".cursor/rules.md", "promptPriority": ["project.md", "project.cursor.md"],
"source": ".aicode/prompts/project.md" "maxTokenLimit": 8000
}, },
"trae": { "trae": {
"rulesFile": ".trae/rules/project_rules.md", "promptPriority": ["project.md", "project.trae.md"],
"source": ".aicode/prompts/project.md" "maxTokenLimit": 6000
},
"[editor_name]": {
...
} }
} }
} }
@@ -60,47 +115,84 @@
### 阶段一:兼容层(立即可行) ### 阶段一:兼容层(立即可行)
创建转换工具和安装脚本: 创建转换工具和符号链接脚本:
```bash ```bash
# install-aicode-prompts.sh # migrate-prompts.sh
#!/bin/bash #!/bin/bash
mkdir -p .aicode/prompts
# 检测已安装的编辑器并创建符号链接 # 创建标准目录结构
if [ -d ".cursor" ]; then mkdir -p .prompt/rules
ln -sf ../.aicode/prompts/project.md .cursor/rules.md
# 迁移现有配置并创建符号链接
migrate_editor_config() {
local editor=$1
local source_path=$2
local target_name=$3
if [ -f "$source_path" ]; then
# 迁移到新位置
cp "$source_path" ".prompt/rules/${target_name}.${editor}.md"
# 创建符号链接保持向后兼容
ln -sf "../.prompt/rules/${target_name}.${editor}.md" "$source_path"
echo "Migrated ${editor} configuration"
fi fi
}
if [ -d ".trae" ]; then # 迁移各编辑器配置
mkdir -p .trae/rules migrate_editor_config "cursor" ".cursor/rules.md" "project"
ln -sf ../../.aicode/prompts/project.md .trae/rules/project_rules.md migrate_editor_config "trae" ".trae/rules/project_rules.md" "project"
migrate_editor_config "codeium" ".codeium/context.md" "context"
# 创建基础配置文件
if [ ! -f ".prompt/config.json" ]; then
cat > ".prompt/config.json" << EOF
{
"promptFileVersion": "1.0",
"response_language": "",
"defaultMergeStrategy": "append",
"supportedEditors": ["vscode", "cursor", "trae", "codeium"]
}
EOF
fi fi
``` ```
### 阶段二:编辑器适配 ### 阶段二:编辑器适配
鼓励编辑器厂商支持标准路径: 鼓励编辑器厂商原生支持标准路径:
```json ```json
// 编辑器配置示例 // 编辑器配置示例 (VSCode settings.json)
{ {
"promptSources": [ "aiPrompts.standardPath": ".prompt/rules",
".aicode/prompts/project.md", // 标准路径(优先) "aiPrompts.loadOrder": [
".cursor/rules.md" // 传统路径(回退) "project.md",
] "project.vscode.md",
"context.md",
"context.vscode.md"
],
"aiPrompts.mergeStrategy": "smart"
} }
``` ```
### 阶段三:生态系统建设 ### 阶段三:生态系统建设
1. 创建验证工具检查配置完整性 1. **开发核心工具**
2. 开发 VS Code 等编辑器的配置文件生成插件 - 配置验证工具:`prompt-validator`
3. 建立模板库和最佳实践 - 文件合并工具:`prompt-merger`
- 迁移辅助工具:`prompt-migrate`
2. **编辑器插件**
- VSCode 扩展:`vscode-prompt-config-integration`
- Cursor 插件:`cursor-prompt-config-integration`
3. **模板库**
- 常见项目类型的配置模板
- 各语言的最佳实践示例
## 配置文件详细规范 ## 配置文件详细规范
### `project.md` 模板 ### 项目提示词模板 (`.prompt/rules/project.md`)
```markdown ```markdown
# 项目提示词 # 项目提示词
@@ -110,30 +202,61 @@ fi
## 编码规范 ## 编码规范
- 语言: {{编程语言}} - 语言: {{编程语言}}
- 风格: {{代码风格}} - 代码风格: {{代码风格指南}}
- 限制: {{技术限制}} - 命名约定: {{命名规则}}
## 架构约束
- 设计模式: {{使用的模式}}
- 分层架构: {{架构层次}}
- 依赖管理: {{依赖规范}}
## 业务规则 ## 业务规则
{{具体业务逻辑}} {{具体业务逻辑和要求}}
``` ```
### `config.json` 完整规范 ### 编辑器特定扩展示例 (`.prompt/rules/project.vscode.md`)
```markdown
# VSCode 特定配置
## 编辑器集成
- 优先使用 VSCode 扩展: {{扩展列表}}
- 调试配置: {{调试设置}}
- 代码片段: {{自定义片段}}
## 性能优化
- 大文件处理策略: {{处理方式}}
- 内存管理: {{优化建议}}
```
### 完整 config.json 规范
```json ```json
{ {
"version": "string", "promptFileVersion": "string", // 配置版本号
"name": "string", "responseLanguage": "string", // 默认响应语言
"prompts": { "defaultMergeStrategy": "string", // 默认合并策略
"project": "string", "fileLoadingOrder": ["string"], // 文件加载顺序
"context": "string", "maxFileSizeKB": number, // 最大文件大小限制
"style": "string", "encoding": "string", // 文件编码格式
"testing": "string" "validationRules": { // 验证规则
"maxLength": number,
"allowedSections": ["string"],
"requiredSections": ["string"]
}, },
"mergeStrategy": "overwrite|append|smart", "editorSpecific": {
"editorSupport": { "[editor_name]": {
"cursor": "boolean", "promptPriority": ["string"], // 提示词优先级
"trae": "boolean", "maxTokenLimit": number, // 最大 token 限制
"codeium": "boolean" "temperature": number, // 温度参数
"modelPreferences": ["string"] // 模型偏好
}
},
"extensions": { // 扩展配置
"customSections": ["string"], // 自定义章节
"templateVariables": { // 模板变量
"key": "value"
}
} }
} }
``` ```
@@ -142,58 +265,142 @@ fi
### 从现有系统迁移 ### 从现有系统迁移
1. **渐进式迁移** 1. **自动迁移**
```bash ```bash
# 1. 创建标准目录 # 使用迁移工具
mkdir -p .aicode/prompts npx @prompt-standard/migrate --editor cursor --editor trae
# 2. 移动现有配置 # 或使用交互式迁移
cp .cursor/rules.md .aicode/prompts/project.md npx @prompt-standard/migrate-interactive
# 3. 创建符号链接
ln -s .aicode/prompts/project.md .cursor/rules.md
``` ```
2. **验证工具** 2. **手动迁移**
```bash ```bash
npx aicode-validate # 1. 创建标准目录
mkdir -p .prompt/rules
# 2. 迁移并重命名现有配置
mv .cursor/rules.md .prompt/rules/project.cursor.md
mv .trae/rules/project_rules.md .prompt/rules/project.trae.md
# 3. 创建符号链接(可选,保持兼容)
ln -s ../.prompt/rules/project.cursor.md .cursor/rules.md
ln -s ../.prompt/rules/project.trae.md .trae/rules/project_rules.md
```
3. **验证配置**
```bash
# 安装验证工具
npm install -g @prompt-standard/validator
# 验证配置完整性
prompt-validate
```
### 验证工具功能
```bash
# 检查配置完整性
prompt-validate --check-completeness
# 验证语法正确性
prompt-validate --check-syntax
# 生成配置报告
prompt-validate --generate-report
# 检查编辑器兼容性
prompt-validate --check-editor vscode cursor
``` ```
## 收益分析 ## 收益分析
### 对开发者 ### 对开发者
- ✅ **一致性**:跨编辑器统一体验,减少上下文切换
-**一致性**:跨编辑器统一体验 - ✅ **可维护性**:集中管理,单一事实来源
-**可维护性**:单一事实来源 - ✅ **灵活性**:支持全局配置和编辑器特定扩展
-**协作性**:团队配置标准化 - ✅ **协作性**:团队配置标准化,易于共享
### 对编辑器厂商 ### 对编辑器厂商
- ✅ **互操作性**:降低用户迁移成本,提高用户粘性
-**互操作性**:降低用户迁移成本 - ✅ **生态系统**:促进工具链集成和插件开发
-**生态系统**:促进工具链集成 - ✅ **标准遵从**:体现专业性和前瞻性,增强竞争力
-**标准遵从**:体现专业性和前瞻性 - ✅ **扩展性**:支持自定义配置和高级功能
## 行动计划 ## 行动计划
1. **立即行动**1-2周 ### 立即行动1-2周
- 创建参考实现和转换工具 - [ ] 创建核心工具库:`@prompt-standard/core`
- 编写详细文档和示例 - [ ] 开发配置验证工具:`@prompt-standard/validator`
- 建立社区讨论组 - [ ] 编写详细文档和示例
- [ ] 建立社区讨论组Discord/GitHub Discussions
2. **短期目标**1-3月 ### 短期目标1-3月
- 争取 2-3 个主流编辑器支持 - [ ] 争取 2-3 个主流编辑器支持
- 创建流行项目的配置模板 - [ ] 创建流行项目的配置模板
- 开发 IDE 插件 - [ ] 开发 IDE 插件原型
- [ ] 建立自动化测试流程
3. **长期愿景**6-12月 ### 长期愿景6-12月
- 成为事实标准 - [ ] 成为事实标准,被多个编辑器原生支持
- 建立认证程序 - [ ] 建立认证程序和兼容性测试
- 扩展更多 AI 开发工具支持 - [ ] 扩展支持更多 AI 开发工具
- [ ] 开发图形化配置管理工具
## 技术支持
### 开发工具
```bash
# 核心库安装
npm install @prompt-standard/core
# 验证工具安装
npm install -g @prompt-standard/validator
# 迁移工具安装
npm install -g @prompt-standard/migrate
```
### API 示例
```javascript
// 使用核心库
import { PromptLoader, PromptValidator } from '@prompt-standard/core'
const loader = new PromptLoader('.prompt/rules')
const prompts = await loader.loadForEditor('vscode')
const validator = new PromptValidator()
const results = await validator.validate(prompts)
```
## 呼吁参与 ## 呼吁参与
我们邀请以下各方参与: 我们邀请以下各方参与:
- **编辑器开发者**:实现标准支持
- **开源项目**:率先采用标准 ### 对于编辑器开发者
- **社区成员**:提供反馈和贡献 - 实现原生标准支持
- **企业用户**:分享实际需求 - 提供反馈和改进建议
- 参与标准规范的制定
### 对于开源项目
- 率先采用标准配置
- 贡献项目配置模板
- 分享使用经验和最佳实践
### 对于社区成员
- 测试和报告问题
- 参与文档编写和翻译
- 开发辅助工具和插件
### 对于企业用户
- 提供实际业务需求
- 分享企业级应用场景
- 参与标准推广和实施
**参与方式**
- 📝 提交 Issue 和 Feature Request
- 🔄 提交 Pull Request
- 💬 加入社区讨论
- 🚀 分享你的配置案例
**GitHub 仓库**: https://github.com/aicode-standard/prompt-config