Ppw update

From Chanw-research/claude-code-paper-writing · View interactive version

Ppw update is an AI agent skill from the GitHub repository Chanw-research/claude-code-paper-writing. Sync local skills and references from the GitHub repo. Triggers on update skills, sync skills, 更新技能, 同步技能

How to use this skill

Skill file

Purpose

This Skill syncs local .claude/skills/ and references/ from the upstream GitHub repository Lylll9436/Paper-Polish-Workflow-skill. It downloads the latest SKILL.md files and reference documents, compares them with local versions, and updates any changed files.

Trigger

Activates when the user asks to:

Example invocations:

Modes

| Mode | Default | Behavior |

|------|---------|----------|

| direct | Yes | Fetch, compare, update, report — no intermediate confirmation |

| interactive | | Show diff summary before applying each update |

Default mode: direct

Workflow

Step 0: Workflow Memory Check

Step 1: Pre-flight Check

Step 2: Fetch Remote File Index

```bash

gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/.claude/skills --jq '.[].name'

```

```bash

gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/references --jq '.[] | .name + " " + .type'

```

Step 3: Compare and Update Skills

For each remote skill directory:

  1. Fetch the remote SKILL.md content:

```bash

gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/.claude/skills/{skill-name}/SKILL.md --jq '.content' | base64 -d

```

  1. Read the local .claude/skills/{skill-name}/SKILL.md if it exists.
  2. Compare the two:
  1. Track results for the final report.

In interactive mode: Before applying each update, show a summary of changes and ask for confirmation.

Step 4: Compare and Update References

For each remote reference file:

  1. Fetch the remote file content via gh api with base64 decode.
  2. Read the local references/{filename} if it exists.
  3. Compare and apply the same NEW/UPDATED/UNCHANGED logic as Step 3.
  4. For subdirectories (e.g., references/journals/, references/expression-patterns/), recurse into each file.

Step 5: Output Report

Present a summary table:

## Skills Update Report

| Skill | Status |
|-------|--------|
| polish-skill | ✓ Updated |
| de-ai-skill | - Unchanged |
| new-skill | + New |

## References Update Report

| File | Status |
|------|--------|
| expression-patterns.md | ✓ Updated |
| skill-conventions.md | - Unchanged |

**Summary:** {updated_count} updated, {new_count} new, {unchanged_count} unchanged

Output Contract

| Output | Format | Condition |

|--------|--------|-----------|

| Update report | Markdown table | Always produced |

| File count summary | Text | Always reported |

Edge Cases

| Situation | Handling |

|-----------|----------|

| gh CLI not installed or not authenticated | Report error, suggest gh auth login |

| Remote repo not accessible | Report network/permission error |

| Local skill has modifications not in remote | Overwrite with remote (remote is source of truth) |

| New skill in remote not present locally | Create directory and write SKILL.md |

| Remote skill deleted but exists locally | Keep local (do not delete; report as "local-only") |

| Reference subdirectory doesn't exist locally | Create it |

Fallbacks

| Scenario | Fallback |

|----------|----------|

| gh api rate limited | Wait and retry once, then report error |

| Base64 decode fails | Try gh api with Accept: application/vnd.github.raw header |

| Single file fetch fails | Skip file, continue with remaining, report in summary |


Conventions: references/skill-conventions.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.