readme-sync

Automatically synchronize README.md with actual project components. Scans .codex directory and updates Agents, Skills, Hooks, Commands sections.

tygwan/ultra-codex-init1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: readme-sync
description: Automatically synchronize README.md with actual project components. Scans .codex directory and updates Agents, Skills, Hooks, Commands sections.
license: MIT
---

# README Sync Skill

Automatically keeps README.md synchronized with actual project components. Scans the `.codex` directory structure and updates documentation to match reality.

## Usage

```bash
/readme-sync [--section <name>] [--validate] [--dry-run]
```

### Options

| Option | Description |
|--------|-------------|
| `--section <name>` | Sync specific section: agents, skills, hooks, commands, stats |
| `--validate` | Check for mismatches without making changes |
| `--dry-run` | Show what would change without actually changing |
| (default) | Sync all sections |

## What Gets Synced

### 1. Agents Section
Scans `.codex/agents/*.md` and updates:
- Agent count
- Agent table with names, purposes, keywords
- Auto-detects from frontmatter: `name`, `description`

### 2. Skills Section
Scans `.codex/skills/*/SKILL.md` and `.codex/skills/*.md`:
- Skill count
- Skill table with usage, description
- Auto-detects from frontmatter

### 3. Hooks Section
Scans `.codex/hooks/*.sh` and `.codex/hooks/*.md`:
- Hook count
- Hook table with events, purposes
- Auto-detects from frontmatter or comments

### 4. Commands Section
Scans `.codex/commands/*.md` and `.codex/commands/*/`:
- Command count
- Command table with descriptions
- Includes subcommand files

### 5. Stats Section
Updates summary statistics:
```markdown
| Category | Count |
|----------|-------|
| Agents | 16 |
| Skills | 14 |
| Hooks | 4 |
| Commands | 2 |
| Templates | 5 |
| **Total** | **41** |
```

## Workflow

### Step 1: Scan Components
```bash
# Scan all .codex directories
find .codex/agents -name "*.md" -type f
find .codex/skills -name "SKILL.md" -o -name "*.md" -type f
find .codex/hooks -name "*.sh" -o -name "*.md" -type f
find .codex/commands -name "*.md" -type f
```

### Step 2: Extract Metadata
For each file, extract:
```yaml
# From frontmatter
name: component-name
description: Brief description
tools: [Tool1, Tool2]  # for agents
keywords: [key1, key2]
```

### Step 3: Generate Section Content
```markdown
## Sub-Agents (16)

### Development & Analysis

| Agent | Purpose | Keywords |
|-------|---------|----------|
| `project-analyzer` | Analyze project structure | "analyze", "structure" |
| `code-reviewer` | Review code quality | "review", "PR" |
...
```

### Step 4: Update README
- Find existing section by header
- Replace content between headers
- Preserve custom content outside synced sections

## Section Markers

Use these markers to define sync boundaries:

```markdown
<!-- README-SYNC:agents:start -->
## Sub-Agents (16)
...content auto-generated...
<!-- README-SYNC:agents:end -->

<!-- README-SYNC:skills:start -->
## Skills (14)
...content auto-generated...
<!-- README-SYNC:skills:end -->
```

Without markers, the skill will find sections by `## Sub-Agents` or `## Agents` headers.

## Output Examples

### Sync Report
```
πŸ“ README-SYNC: Synchronizing README.md...

[1/4] Scanning agents...
      Found: 16 agents
      New: file-explorer (+1)
      Removed: none

[2/4] Scanning skills...
      Found: 14 skills
      New: agile-sync, readme-sync (+2)
      Removed: none

[3/4] Scanning hooks...
      Found: 4 hooks
      New: auto-doc-sync (+1)
      Removed: none

[4/4] Updating stats...
      Total: 36 β†’ 40 (+4)

πŸ“ README-SYNC: Complete!
   Sections updated: 4
   Components added: 4
   Components removed: 0
```

### Validation Report
```
πŸ“ README-SYNC: Validation Report

## Agents
βœ… 16 agents in README matches 16 files
⚠️ `old-agent` in README but file not found

## Skills
❌ README shows 12 skills, found 14 files
   Missing in README:
   - agile-sync
   - readme-sync

## Hooks
βœ… All hooks accounted for

## Stats
❌ Stats section outdated
   README: 33 total
   Actual: 40 total

Issues: 3
Recommendations:
- Run `/readme-sync` to fix mismatches
- Remove reference to `old-agent`
```

## Configuration

### Auto-Sync Settings
```json
{
  "readme-sync": {
    "auto_on_change": true,
    "sections": ["agents", "skills", "hooks", "commands", "stats"],
    "preserve_custom": true,
    "use_markers": true,
    "table_format": "markdown"
  }
}
```

### Section Templates
```yaml
# .codex/readme-sync-config.yml
sections:
  agents:
    header: "## Sub-Agents ({count})"
    columns:
      - name: "Agent"
        source: "name"
        format: "`{value}`"
      - name: "Purpose"
        source: "description"
        truncate: 50
      - name: "Keywords"
        source: "keywords"
        format: "\"{value}\""

  skills:
    header: "## Skills ({count})"
    group_by: "category"
    columns:
      - name: "Skill"
        source: "name"
      - name: "Usage"
        source: "usage"
      - name: "Description"
        source: "description"
```

## Integration

### With auto-doc-sync Hook
```bash
# Hook triggers readme-sync when .codex files change
# In hooks/auto-doc-sync.sh:
if [[ "$TOOL_INPUT" == *".codex/"* ]]; then
    # Trigger README sync suggestion
fi
```

### With /agile-sync
```bash
# agile-sync includes readme-sync as step 3
/agile-sync  # Includes README stats update
```

### Manual Trigger
```bash
# Full sync
/readme-sync

# Specific section
/readme-sync --section skills

# Validate only
/readme-sync --validate
```

## Best Practices

### DO
- βœ… Use section markers for precise updates
- βœ… Run after adding new agents/skills
- βœ… Include in PR checklist
- βœ… Keep frontmatter accurate in source files

### DON'T
- ❌ Manually edit synced sections (will be overwritten)
- ❌ Remove section markers
- ❌ Skip validation before releases

## Troubleshooting

### "Section not found in README"
```bash
# Add section markers or headers:
## Sub-Agents
<!-- or -->
<!-- README-SYNC:agents:start -->
<!-- README-SYNC:agents:end -->
```

### "Component not detected"
```bash
# Ensure frontmatter is valid:
---
name: my-component
description: Brief description
---
```

### "Stats mismatch"
```bash
# Force full recalculation:
/readme-sync --section stats
```

## Related Skills

| Skill | Purpose |
|-------|---------|
| `/agile-sync` | Full agile artifact sync |
| `/init` | Project initialization |
| `/doc` | Documentation generation |

More Writing & Documentation skills

paper-context-resolver

lllllllama/rigorpilot-skills

Rigor Paper Context helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacing README guidance by default.

450.8k

repo-intake-and-plan

lllllllama/rigorpilot-skills

Rigor Intake helper for README-first deep learning repo reproduction. Use when the task is specifically to scan a repository, read the README and common project files, extract documented commands, classify inference, evaluation, and training candidates, and return the smallest trustworthy reproduction plan to the main orchestrator. Do not use for environment setup, asset download, command execution, final reporting, paper lookup, or end-to-end orchestration.

450.0k

minimal-run-and-audit

lllllllama/rigorpilot-skills

Rigor Run skill for README-first deep learning repo reproduction. Use when the task is specifically to capture or normalize evidence from the selected smoke test or documented inference or evaluation command and write standardized `repro_outputs/` files, including patch notes when repository files changed. Do not use for training execution, initial repo intake, generic environment setup, paper lookup, target selection, hidden scientific-meaning changes, or end-to-end orchestration by itself.

449.9k

← All Writing & Documentation skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free Β· No signup Β· No trial clock

SEE THE DIRECTORY