mcpField
P
ppw:update

ppw:update

github.com/lylll9436Agent workflows39075 installsUpdated 32w ago
Repository

About ppw:update

ppw:update is a skill for keeping local `.claude/skills/` and `references/` synchronized with the Paper-Polish-Workflow-skill GitHub repository. It compares remote files with local copies and reports new, changed, and unchanged items.

Key features

  1. 01Fetches remote skills and references
  2. 02Compares remote and local files
  3. 03Direct and interactive update modes
  4. 04Reports update status and file counts

Use cases

  1. 01Sync local skills with GitHub
  2. 02Review changes before applying updates
  3. 03Refresh reference documents

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/lylll9436/paper-polish-workflow-skill --skill ppw:update

After installing, type/ppw:updatein Claude Code to confirm it loaded.

Details

From the project README

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:

  • Update or sync skills from the remote repo
  • 更新或同步技能包

Example invocations:

  • "update skills"
  • "sync skills from GitHub"
  • "更新技能"

Modes

ModeDefaultBehavior
directYesFetch, compare, update, report — no intermediate confirmation
interactiveShow diff summary before applying each update

Default mode: direct

Workflow

Step 0: Workflow Memory Check
  • Read .planning/workflow-memory.json. If file missing or empty, skip to Step 1.
  • Check if the last 1-2 log entries form a recognized pattern with ppw:update that has appeared >= threshold times in the log. See skill-conventions.md > Workflow Memory > Pattern Detection for the full algorithm.
  • If a pattern is found, present recommendation via AskUserQuestion:
    • Question: "检测到常用流程:[pattern](已出现 N 次)。是否直接以 direct 模式运行 ppw:update?"
    • Options: "Yes, proceed" / "No, continue normally"
  • If user accepts: set mode to direct, skip Ask Strategy questions.
  • If user declines or AskUserQuestion unavailable: continue in normal mode.
Step 1: Pre-flight Check
  • Verify gh CLI is available and authenticated: gh auth status
  • Verify the upstream repo is accessible: gh api repos/Lylll9436/Paper-Polish-Workflow-skill --jq '.full_name'
  • If either check fails, report the error and stop.
  • Record workflow: Append {"skill": "ppw:update", "ts": "<ISO timestamp>"} to .planning/workflow-memory.json. Create file as [] if missing. Drop oldest entry if log length >= 50.
Step 2: Fetch Remote File Index
  • List all skill directories from the remote repo:
    gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/.claude/skills --jq '.[].name'
    
  • List all reference files from the remote repo:
    gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/references --jq '.[] | .name + " " + .type'
    
  • For reference subdirectories (type=dir), also list their contents recursively.
Step 3: Compare and Update Skills

For each remote skill directory:

  1. Fetch the remote SKILL.md content:
    gh api repos/Lylll9436/Paper-Polish-Workflow-skill/contents/.claude/skills/{skill-name}/SKILL.md --jq '.content' | base64 -d
    
  2. Read the local .claude/skills/{skill-name}/SKILL.md if it exists.
  3. Compare the two:
    • If local file does not exist → NEW skill, create directory and write file.
    • If content differs → UPDATED, overwrite local file.
    • If content is identical → UNCHANGED, skip.
  4. 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

OutputFormatCondition
Update reportMarkdown tableAlways produced
File count summaryTextAlways reported

Edge Cases

SituationHandling
gh CLI not installed or not authenticatedReport error, suggest gh auth login
Remote repo not accessibleReport network/permission error
Local skill has modifications not in remoteOverwrite with remote (remote is source of truth)
New skill in remote not present locallyCreate directory and write SKILL.md
Remote skill deleted but exists locallyKeep local (do not delete; report as "local-only")
Reference subdirectory doesn't exist locallyCreate it

Fallbacks

ScenarioFallback
gh api rate limitedWait and retry once, then report error
Base64 decode failsTry gh api with Accept: application/vnd.github.raw header
Single file fetch failsSkip file, continue with remaining, report in summary

Conventions: references/skill-conventions.md

Comments

Markdown supported