github-repo-architect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Repository Architect Skill
GitHub Repository Architect Skill
Overview
概述
Repository structure optimization with swarm coordination. This skill handles repository structure analysis, template management, cross-repository synchronization, architecture recommendations, and development workflow optimization.
通过集群协调实现仓库结构优化。该Skill可处理仓库结构分析、模板管理、跨仓库同步、架构建议以及开发工作流优化。
Quick Start
快速开始
bash
undefinedbash
undefinedList repository structure
List repository structure
ls -la
ls -la
Search repositories in organization
Search repositories in organization
gh repo list org --limit 20 --json name,description,languages
gh repo list org --limit 20 --json name,description,languages
Create new repository
Create new repository
gh repo create my-new-repo --public --description "Description"
gh repo create my-new-repo --public --description "Description"
Clone repository
Clone repository
gh repo clone owner/repo
gh repo clone owner/repo
View repository info
View repository info
gh repo view owner/repo --json name,description,topics
undefinedgh repo view owner/repo --json name,description,topics
undefinedWhen to Use
适用场景
- Analyzing repository structure for optimization
- Creating standardized project templates
- Cross-repository synchronization
- Architecture analysis and recommendations
- Multi-repo workflow coordination
- 分析仓库结构以进行优化
- 创建标准化项目模板
- 跨仓库同步
- 架构分析与建议
- 多仓库工作流协调
Core Capabilities
核心能力
| Capability | Description |
|---|---|
| Structure optimization | Best practices implementation |
| Multi-repo coordination | Cross-repo synchronization |
| Template management | Consistent project setup |
| Architecture analysis | Improvement recommendations |
| Workflow coordination | Development process optimization |
| 能力 | 描述 |
|---|---|
| 结构优化 | 最佳实践落地 |
| 多仓库协调 | 跨仓库同步 |
| 模板管理 | 一致的项目配置 |
| 架构分析 | 改进建议 |
| 工作流协调 | 开发流程优化 |
Usage Examples
使用示例
1. Repository Structure Analysis
1. 仓库结构分析
javascript
// Initialize architecture analysis swarm
// Orchestrate structure optimization
task: "Analyze and optimize repository structure for scalability and maintainability",
strategy: "adaptive",
priority: "medium"
})javascript
// Initialize architecture analysis swarm
// Orchestrate structure optimization
task: "Analyze and optimize repository structure for scalability and maintainability",
strategy: "adaptive",
priority: "medium"
})2. Analyze Current Structure
2. 分析当前结构
bash
undefinedbash
undefinedList repository contents
List repository contents
ls -la
ls -la
Find all config files
Find all config files
find . -name ".json" -o -name ".yml" -o -name "*.yaml" | head -20
find . -name ".json" -o -name ".yml" -o -name "*.yaml" | head -20
Analyze package dependencies
Analyze package dependencies
cat package.json | jq '.dependencies, .devDependencies'
cat package.json | jq '.dependencies, .devDependencies'
Search for related repositories
Search for related repositories
gh search repos "language:typescript template architecture"
--limit 10
--json fullName,description,stargazersCount
--sort stars
--limit 10
--json fullName,description,stargazersCount
--sort stars
undefinedgh search repos "language:typescript template architecture"
--limit 10
--json fullName,description,stargazersCount
--sort stars
--limit 10
--json fullName,description,stargazersCount
--sort stars
undefined3. Create Repository Template
3. 创建仓库模板
bash
undefinedbash
undefinedCreate template repository
Create template repository
gh repo create claude-project-template
--public
--description "Standardized template for Claude Code projects"
--template
--public
--description "Standardized template for Claude Code projects"
--template
gh repo create claude-project-template
--public
--description "Standardized template for Claude Code projects"
--template
--public
--description "Standardized template for Claude Code projects"
--template
Clone and setup structure
Clone and setup structure
gh repo clone owner/claude-project-template
cd claude-project-template
gh repo clone owner/claude-project-template
cd claude-project-template
Create directory structure
Create directory structure
mkdir -p .claude/commands/{github,sparc,swarm}
mkdir -p src tests docs config
mkdir -p .claude/commands/{github,sparc,swarm}
mkdir -p src tests docs config
Create core files
Create core files
cat > package.json << 'EOF'
{
"name": "claude-project-template",
"version": "1.0.0",
"description": "Claude Code project with ruv-swarm integration",
"engines": { "node": ">=20.0.0" },
"dependencies": {
"ruv-swarm": "^1.0.11"
}
}
EOF
cat > CLAUDE.md << 'EOF'
cat > package.json << 'EOF'
{
"name": "claude-project-template",
"version": "1.0.0",
"description": "Claude Code project with ruv-swarm integration",
"engines": { "node": ">=20.0.0" },
"dependencies": {
"ruv-swarm": "^1.0.11"
}
}
EOF
cat > CLAUDE.md << 'EOF'
Claude Code Configuration
Claude Code Configuration
Quick Start
Quick Start
bash
npm installbash
npm installFeatures
Features
- ruv-swarm integration
- SPARC development modes
- GitHub workflow automation EOF
- ruv-swarm integration
- SPARC development modes
- GitHub workflow automation EOF
Commit and push
Commit and push
git add -A
git commit -m "feat: Create standardized project template"
git push
undefinedgit add -A
git commit -m "feat: Create standardized project template"
git push
undefined4. Cross-Repository Synchronization
4. 跨仓库同步
bash
undefinedbash
undefinedList organization repositories
List organization repositories
REPOS=$(gh repo list org --limit 100 --json name --jq '.[].name')
REPOS=$(gh repo list org --limit 100 --json name --jq '.[].name')
Update common files across repositories
Update common files across repositories
for repo in $REPOS; do
echo "Updating $repo..."
Clone repo
gh repo clone org/$repo /tmp/$repo -- --depth=1
Update workflow file
mkdir -p /tmp/$repo/.github/workflows
cat > /tmp/$repo/.github/workflows/ci.yml << 'EOF'
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: { node-version: '20' }
- run: npm install && npm test
EOF
Commit and create PR
cd /tmp/$repo
git checkout -b standardize-ci
git add .github/workflows/ci.yml
git commit -m "ci: Standardize CI workflow"
git push origin standardize-ci
gh pr create --title "ci: Standardize CI workflow" --body "Organization-wide standardization"
cd -
rm -rf /tmp/$repo
done
undefinedfor repo in $REPOS; do
echo "Updating $repo..."
Clone repo
gh repo clone org/$repo /tmp/$repo -- --depth=1
Update workflow file
mkdir -p /tmp/$repo/.github/workflows
cat > /tmp/$repo/.github/workflows/ci.yml << 'EOF'
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with: { node-version: '20' }
- run: npm install && npm test
EOF
Commit and create PR
cd /tmp/$repo
git checkout -b standardize-ci
git add .github/workflows/ci.yml
git commit -m "ci: Standardize CI workflow"
git push origin standardize-ci
gh pr create --title "ci: Standardize CI workflow" --body "Organization-wide standardization"
cd -
rm -rf /tmp/$repo
done
undefined5. Batch Architecture Operations
5. 批量架构操作
javascript
[Single Message - Repository Architecture Review]:
// Initialize comprehensive architecture swarm
// Analyze current structures
Bash("ls -la packages/ruv-swarm/")
Read("packages/ruv-swarm/package.json")
// Search for patterns
Bash(`gh search repos "language:javascript monorepo" --limit 5 --json fullName,stargazersCount`)
// Track architecture improvements
TodoWrite({ todos: [
{ id: "arch-analysis", content: "Analyze current structure", status: "completed" },
{ id: "arch-research", content: "Research best practices", status: "completed" },
{ id: "arch-templates", content: "Create standardized templates", status: "pending" },
{ id: "arch-workflows", content: "Implement improved workflows", status: "pending" },
{ id: "arch-docs", content: "Document architecture decisions", status: "pending" }
]})
// Store analysis results
action: "store",
key: "architecture/analysis/results",
value: JSON.stringify({
optimization_areas: ["structure", "workflows", "templates"],
recommendations: ["standardize_structure", "improve_workflows"]
})
})javascript
[Single Message - Repository Architecture Review]:
// Initialize comprehensive architecture swarm
// Analyze current structures
Bash("ls -la packages/ruv-swarm/")
Read("packages/ruv-swarm/package.json")
// Search for patterns
Bash(`gh search repos "language:javascript monorepo" --limit 5 --json fullName,stargazersCount`)
// Track architecture improvements
TodoWrite({ todos: [
{ id: "arch-analysis", content: "Analyze current structure", status: "completed" },
{ id: "arch-research", content: "Research best practices", status: "completed" },
{ id: "arch-templates", content: "Create standardized templates", status: "pending" },
{ id: "arch-workflows", content: "Implement improved workflows", status: "pending" },
{ id: "arch-docs", content: "Document architecture decisions", status: "pending" }
]})
// Store analysis results
action: "store",
key: "architecture/analysis/results",
value: JSON.stringify({
optimization_areas: ["structure", "workflows", "templates"],
recommendations: ["standardize_structure", "improve_workflows"]
})
})Architecture Patterns
架构模式
Monorepo Structure
单体仓库(Monorepo)结构
project-root/
├── packages/
│ ├── package-a/
│ │ ├── src/
│ │ ├── .claude/
│ │ └── package.json
│ ├── package-b/
│ │ ├── src/
│ │ └── package.json
│ └── shared/
│ ├── types/
│ ├── utils/
│ └── config/
├── tools/
│ ├── build/
│ ├── test/
│ └── deploy/
├── docs/
│ ├── architecture/
│ ├── integration/
│ └── examples/
└── .github/
├── workflows/
├── templates/
└── actions/project-root/
├── packages/
│ ├── package-a/
│ │ ├── src/
│ │ ├── .claude/
│ │ └── package.json
│ ├── package-b/
│ │ ├── src/
│ │ └── package.json
│ └── shared/
│ ├── types/
│ ├── utils/
│ └── config/
├── tools/
│ ├── build/
│ ├── test/
│ └── deploy/
├── docs/
│ ├── architecture/
│ ├── integration/
│ └── examples/
└── .github/
├── workflows/
├── templates/
└── actions/Command Structure
命令结构
.claude/
├── commands/
│ ├── github/
│ │ ├── github-modes.md
│ │ ├── pr-manager.md
│ │ └── issue-tracker.md
│ ├── sparc/
│ │ ├── sparc-modes.md
│ │ └── coder.md
│ └── swarm/
│ └── coordination.md
├── templates/
│ ├── issue.md
│ ├── pr.md
│ └── project.md
└── config.json.claude/
├── commands/
│ ├── github/
│ │ ├── github-modes.md
│ │ ├── pr-manager.md
│ │ └── issue-tracker.md
│ ├── sparc/
│ │ ├── sparc-modes.md
│ │ └── coder.md
│ └── swarm/
│ └── coordination.md
├── templates/
│ ├── issue.md
│ ├── pr.md
│ └── project.md
└── config.jsonIntegration Pattern
集成模式
javascript
const integrationPattern = {
packages: {
role: "orchestration_layer",
dependencies: ["ruv-swarm"],
provides: ["CLI", "workflows", "commands"]
},
"ruv-swarm": {
role: "coordination_engine",
dependencies: [],
provides: ["MCP_tools", "neural_networks", "memory"]
}
},
communication: "MCP_protocol",
coordination: "swarm_based",
state_management: "persistent_memory"
}javascript
const integrationPattern = {
packages: {
role: "orchestration_layer",
dependencies: ["ruv-swarm"],
provides: ["CLI", "workflows", "commands"]
},
"ruv-swarm": {
role: "coordination_engine",
dependencies: [],
provides: ["MCP_tools", "neural_networks", "memory"]
}
},
communication: "MCP_protocol",
coordination: "swarm_based",
state_management: "persistent_memory"
}MCP Tool Integration
MCP 工具集成
Swarm Coordination
Swarm 协调
javascript
topology: "mesh",
maxAgents: 4,
strategy: "adaptive"
})
type: "architect",
name: "Repository Architect",
capabilities: ["structure-analysis", "pattern-recognition", "optimization"]
})javascript
topology: "mesh",
maxAgents: 4,
strategy: "adaptive"
})
type: "architect",
name: "Repository Architect",
capabilities: ["structure-analysis", "pattern-recognition", "optimization"]
})Memory for Architecture State
架构状态存储
javascript
action: "store",
key: "architecture/structure/analysis",
namespace: "architecture",
value: JSON.stringify({
repositories: ["repo1", "repo2"],
patterns_found: ["monorepo", "microservices"],
recommendations: ["standardize", "consolidate"]
})
})javascript
action: "store",
key: "architecture/structure/analysis",
namespace: "architecture",
value: JSON.stringify({
repositories: ["repo1", "repo2"],
patterns_found: ["monorepo", "microservices"],
recommendations: ["standardize", "consolidate"]
})
})Best Practices
最佳实践
1. Structure Optimization
1. 结构优化
- Consistent directory organization across repositories
- Standardized configuration files and formats
- Clear separation of concerns and responsibilities
- Scalable architecture for future growth
- 跨仓库保持一致的目录组织
- 标准化配置文件与格式
- 清晰的职责划分
- 面向未来增长的可扩展架构
2. Template Management
2. 模板管理
- Reusable project templates for consistency
- Standardized issue and PR templates
- Workflow templates for common operations
- Documentation templates for clarity
- 可复用的项目模板以确保一致性
- 标准化的Issue与PR模板
- 常见操作的工作流模板
- 清晰的文档模板
3. Multi-Repository Coordination
3. 多仓库协调
- Cross-repository dependency management
- Synchronized version and release management
- Consistent coding standards and practices
- Automated cross-repo validation
- 跨仓库依赖管理
- 同步的版本与发布管理
- 一致的编码标准与实践
- 自动化跨仓库验证
4. Documentation Architecture
4. 文档架构
- Comprehensive architecture documentation
- Clear integration guides and examples
- Maintainable and up-to-date documentation
- User-friendly onboarding materials
- 全面的架构文档
- 清晰的集成指南与示例
- 可维护且实时更新的文档
- 友好的入门材料
Monitoring and Analysis
监控与分析
Architecture Health Metrics
架构健康指标
- Repository structure consistency score
- Documentation coverage percentage
- Cross-repository integration success rate
- Template adoption and usage statistics
- 仓库结构一致性评分
- 文档覆盖率
- 跨仓库集成成功率
- 模板采用与使用统计
Automated Analysis
自动化分析
- Structure drift detection
- Best practices compliance checking
- Performance impact analysis
- Scalability assessment and recommendations
- 结构漂移检测
- 最佳实践合规性检查
- 性能影响分析
- 可扩展性评估与建议
Integration with Other Skills
与其他Skill集成
| Skill | Integration |
|---|---|
| Cross-repo synchronization |
| Coordinated releases |
| Architecture design |
| Multi-agent coordination |
| Skill | 集成方式 |
|---|---|
| 跨仓库同步 |
| 协同发布 |
| 架构设计 |
| 多Agent协调 |
Version History
版本历史
- 1.0.0 (2025-01-02): Initial release - converted from repo-architect agent
- 1.0.0 (2025-01-02): 初始版本 - 从repo-architect agent转换而来