# GitHub Copilot Prompts Synchronization

**Completed**: 2026-01-15
**Branch**: 023-copilot-prompts-sync
**Priority**: P1

## Overview

Synchronize GitHub Copilot prompt files with DoIt command templates, ensuring both Claude Code and GitHub Copilot users have consistent workflow instructions. The `doit sync-prompts` command generates and maintains prompt files in `.github/prompts/` from the source templates in `.doit/templates/commands/`.

## Features

### Prompt File Generation

- Scans `.doit/templates/commands/` for all `doit.*.md` command templates
- Creates corresponding `doit.*.prompt.md` files in `.github/prompts/`
- Preserves core instructional content while adapting for Copilot format
- Automatically creates `.github/prompts/` directory if it doesn't exist

### Naming Convention

Command templates map to prompt files with consistent naming:
- `doit.specit.md` → `doit.specit.prompt.md`
- `doit.checkin.md` → `doit.checkin.prompt.md`
- `doit.documentit.md` → `doit.documentit.prompt.md`

### Content Adaptation

- Transforms YAML frontmatter to Copilot-compatible format
- Handles `$ARGUMENTS` placeholder for Copilot's input mechanism
- Maintains `## Outline` section workflow steps
- Preserves script paths to `.doit/scripts/`

### Drift Detection

- `doit sync-prompts --check` detects out-of-sync files
- Reports when command templates have been modified more recently than prompts
- Identifies missing prompt files for new commands

### Selective Synchronization

- Sync specific commands: `doit sync-prompts doit.checkin`
- Test changes incrementally without affecting other prompts

## Requirements Implemented

| ID | Description | Status |
|----|-------------|--------|
| FR-001 | Scan command templates directory | Done |
| FR-002 | Create prompts directory if missing | Done |
| FR-003 | Generate prompt files with correct naming | Done |
| FR-004 | Preserve instructional content | Done |
| FR-005 | Transform YAML frontmatter | Done |
| FR-007 | Handle $ARGUMENTS placeholder | Done |
| FR-008 | Report created/updated/skipped files | Done |
| FR-009 | Detect modified templates | Done |
| FR-010 | Support single command sync | Done |

## Usage

```bash
# Synchronize all command templates to prompts
doit sync-prompts

# Check for synchronization drift
doit sync-prompts --check

# Sync a specific command
doit sync-prompts doit.checkin
```

## Testing

- All 11 command templates generate corresponding prompt files
- Naming pattern verification across all files
- Drift detection accuracy validation
- Completion time under 30 seconds

## Related Features

- [Unified Template Management](./024-unified-templates.md)
- [Template Context Injection](./027-template-context-injection.md)

---

Generated by `/doit.documentit` on 2026-01-22
