同步上下文
- 作者仓库星标 0
- 作者仓库 skills-registry
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @tomevault-io · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- Docker
- 运行环境要求
- Node.js · Python · Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 读取环境变量
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
UPDATE .github/copilot-instructions.md
━━━━━━━━━━━━━━━━
Analyzing codebase...
✓ Found 47 Python files
✓ Found 12 test files
✓ Found 28 agents
✓ Found 8 commands
Detected patterns:
✓ Dataclass pattern (15 usages)
✓ Parser pattern (4 files)
✓ Generator pattern (8 usages)
Section updates:
• Architecture: UPDATED (new components detected)
• Project Structure: UPDATED (3 new folders)
• Agent Usage: UPDATED (2 new agents)
• Coding Standards: MERGED (1 new pattern)
• Commands: UPDATED (1 new command)
• Project Context: PRESERVED (manual content)
━━━━━━━━━━━━━━━━
.github/copilot-instructions.md updated successfully
# Sync Context Command
Analyzes codebase and intelligently updates `.github/copilot-instructions.md` with current project context.
## Usage
```bash
/sync-context # Full analysis and update
/sync-context --section agents # Update specific section
/sync-context --dry-run # Preview changes without saving
```
---
## What It Does
1. **Analyzes** current codebase structure
2. **Extracts** patterns, conventions, and architecture
3. **Merges** with existing copilot-instructions.md content
4. **Preserves** manual customizations
5. **Updates** sections that need refresh
---
## Analysis Process
### Step 1: Scan Codebase Structure
```text
# Discover project structure
Glob("**/*.py") # Python files
Glob("**/*.ts") # TypeScript files
Glob("**/package.json") # Node projects
Glob("**/pyproject.toml") # Python projects
Glob("**/Dockerfile") # Container configs
Glob("**/*.tf") # Terraform
```
### Step 2: Extract Patterns
```text
# Code patterns
Grep("@dataclass") # Dataclass usage
Grep("class.*Parser") # Parser patterns
Grep("def test_") # Test patterns
Grep("async def") # Async patterns
# Architecture patterns
Grep("from src") # Import structure
Grep("@router") # API patterns
Grep("@lambda_handler") # Lambda patterns
```
### Step 3: Analyze Agents
```text
# List available agents
Glob(".github/agents/*.agent.md")
# Categorize by name prefix
- workflow-* → SDD pipeline agents (brainstorm, define, design, build, ship, iterate)
- architect-* → System design (schema, pipeline, lakehouse, genai, the-planner)
- cloud-* → AWS, GCP, CI/CD, deployment agents
- fabric-* → Microsoft Fabric specialists
- python-* → Code review, clean, document, prompt engineering
- test-* → Testing, data quality, data contracts
- de-* → Data engineering: Spark, dbt, Airflow, Lakeflow, streaming, SQL
- dev-* → Codebase explorer, meeting analyst, prompt crafter
```
### Step 4: Merge Updates
```text
# Sections to update
- Project Structure (from scan)
- Coding Standards (from patterns)
- Agent Usage (from agent analysis)
- Commands (from commands/)
- Environment (from config files)
# Sections to preserve
- Project Context (manual)
- Core Mission (manual)
- Important Dates (manual)
- Getting Help (manual)
```
---
## copilot-instructions.md Template
Generated `.github/copilot-instructions.md` follows this structure:
```markdown
# {Project Name}
## Project Context
{Manual: What this project does and why}
---
## Architecture Overview
{Auto-generated from codebase scan}
```text
{Data flow diagram}
```
| Stage | Technology | Purpose |
| ----- | ---------- | ------- |
| {stage} | {tech} | {purpose} |
---
## Project Structure
{Auto-generated from Glob scans}
```text
{project}/
├── src/
│ ├── {folders discovered}
├── tests/
├── .github/
│ ├── agents/
│ ├── kb/
│ ├── sdd/
│ ├── skills/
│ └── storage/
```
---
## Agent Usage Guidelines
{Auto-generated from agents/ folder}
### Available Agents by Category
| Category | Agents | Use When |
| -------- | ------ | -------- |
| Workflow | brainstorm-agent, define-agent, ... | Building features with SDD |
| Code Quality | python-code-reviewer, test-generator, ... | Improving code |
| {category} | {agents} | {trigger} |
---
## Coding Standards
{Auto-generated from detected patterns}
### Language: {Python/TypeScript/etc}
- **Version:** {detected from config}
- **Style:** {detected patterns}
- **Testing:** {detected framework}
### Detected Patterns
| Pattern | Usage | Example File |
| ------- | ----- | ------------ |
| {pattern} | {where used} | {file path} |
---
## Commands
{Auto-generated from commands/ folder}
| Command | Purpose |
| ------- | ------- |
| /build-feature | Full SDD pipeline |
| /memory | Save session insights |
| {command} | {purpose} |
---
## Environment Variables
{Auto-generated from .env.example, config files}
| Variable | Purpose |
| -------- | ------- |
| {var} | {purpose} |
---
## MCP Tools Available
{Auto-generated from settings}
| MCP Server | Purpose |
| ---------- | ------- |
| context7-mcp | Library documentation |
| exa | Code context search |
| {mcp} | {purpose} |
---
## Important Dates
{Manual: Project-specific dates}
---
## Getting Help
{Auto-generated from structure}
- **Documentation**: Start with relevant docs
- **Agents**: Review .github/agents/
- **Commands**: Use /help for available commands
```
---
## Section Update Rules
| Section | Source | Update Mode |
| ------- | ------ | ----------- |
| Project Context | Manual | Preserve |
| Architecture | Codebase scan | Replace |
| Project Structure | Glob patterns | Replace |
| Agent Usage | agents/ folder | Replace |
| Coding Standards | Pattern detection | Merge |
| Commands | commands/ folder | Replace |
| Environment | Config files | Merge |
| MCP Tools | settings.json | Replace |
| Important Dates | Manual | Preserve |
| Getting Help | Structure | Replace |
**Replace**: Fully regenerate from source
**Merge**: Add new, preserve custom
**Preserve**: Never auto-modify
---
## Execution Flow
```text
1. Read existing .github/copilot-instructions.md
│
▼
2. Parse into sections
│
▼
3. Analyze codebase (parallel)
├── Glob for structure
├── Grep for patterns
├── Read config files
└── List agents/commands
│
▼
4. Generate new sections
│
▼
5. Apply update rules
├── Replace auto sections
├── Merge semi-auto sections
└── Preserve manual sections
│
▼
6. Validate (dry-run or save)
│
▼
7. Write updated .github/copilot-instructions.md
```
---
## Example Output
```text
UPDATE .github/copilot-instructions.md
━━━━━━━━━━━━━━━━
Analyzing codebase...
✓ Found 47 Python files
✓ Found 12 test files
✓ Found 28 agents
✓ Found 8 commands
Detected patterns:
✓ Dataclass pattern (15 usages)
✓ Parser pattern (4 files)
✓ Generator pattern (8 usages)
Section updates:
• Architecture: UPDATED (new components detected)
• Project Structure: UPDATED (3 new folders)
• Agent Usage: UPDATED (2 new agents)
• Coding Standards: MERGED (1 new pattern)
• Commands: UPDATED (1 new command)
• Project Context: PRESERVED (manual content)
━━━━━━━━━━━━━━━━
.github/copilot-instructions.md updated successfully
```
---
## Flags
| Flag | Description |
| ---- | ----------- |
| `--dry-run` | Preview changes without saving |
| `--section {name}` | Update only specific section |
| `--force` | Replace all sections (ignores preserve rules) |
| `--verbose` | Show detailed analysis |
---
## Best Practices
### When to Run
- After adding new agents or commands
- After significant architecture changes
- After adding new file types
- When onboarding new team members
### What to Customize
After running, manually update:
1. **Project Context** - Add business context
2. **Important Dates** - Add milestone dates
3. **Architecture** - Add business-specific details
4. **Coding Standards** - Add team conventions
### Version Control
```bash
# Review changes before committing
git diff .github/copilot-instructions.md
# Commit with context
git add .github/copilot-instructions.md
git commit -m "chore: update copilot-instructions.md with latest project structure"
```
---
> Source: [Arthur1511/agentspec-copilot](https://github.com/Arthur1511/agentspec-copilot) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->
章节与文件索引
按说明文件中的顺序排列。
它的作用
copilot-instructions.md 模板
章节更新规则
旗帜
何时跑步
文件/命令 -> .github/copilot-instructions.md · --dry-run · --section {name} · --force · --verbose
内容校验值 -> f82871bb684e
当前原文的自动摘译,尚未人工审校。
它的作用
分析当前代码库结构 提取模式、约定和架构 与现有 copilot-instructions.md 内容合并 保留手动自定义 更新需要刷新的部分
copilot-instructions.md 模板
生成的
.github/copilot-instructions.md遵循以下结构:{数据流图} {项目}/ ├── src/ │ ├── {发现的文件夹}章节更新规则
部分·源·更新模式项目上下文·手册·保留架构·代码库扫描·替换项目结构·全局模式·替换代理用法·代理/文件夹·替换
旗帜
标志 · 描述
--dry-run· 预览更改而不保存--section {name}· 仅更新特定部分--force· 替换所有部分(忽略保留规则)--verbose· 显示详细分析何时跑步
添加新代理或命令后 重大架构更改后 添加新文件类型后 加入新团队成员时