wp-portfolio-sync
Migrate a researcher's final CIHR / Canadian Common CV XML export into their WordPress portfolio once, through the WordPress REST API, between cvsync markers…
от LARi-UQAC★ 16 звёзд на GitHub
Установить wp-portfolio-sync в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
WordPress Portfolio Sync
A one-shot migration (D1): a researcher's final CIHR / Canadian Common CV (CCV) XML
export is parsed, mapped to WordPress pages, previewed, and pushed through the WordPress
REST API between <!-- cvsync:MARKER --> comments. Once pushed, the website is the source
of truth for that data; the XML is never read again, and this skill is never re-run over
the same section.
No student data is parsed from the XML. cihr_cv.py recognises no supervision section
at all. A mapping entry with renderer: phq is refused everywhere this skill checks a
mapping. Student data is published from ThesisTracker, once its own consent flow ships
(Phase 2) - out of scope here.
Phase 2 (ThesisTracker calling a stateless endpoint that reuses render_phq) and Phase 3
(narrative-cv through a stateless /cv/build) are separate, later efforts; this skill ships
none of their wiring.
Prerequisites
pip install -r scripts/requirements.txt(PyYAML,requests- imported lazily, only when a network call is about to be made).- WordPress credentials in the environment, never committed:
WP_APP_USERandWP_APP_PASSWORD- a WordPress Application Password, created once under Users -> Profile -> Application passwords while signed in.- Fallback: a cookie file (
config/cookies.json, seetemplates/cookies.json.example), path fromWP_COOKIESor<data-dir>/config/cookies.json- still contained to
--data-dirthe same as every other researcher-supplied path. Works, but expires with the session that produced it. A write (push_wp.py) additionally needsWP_NONCEset to the nonce a logged-in WordPress session returns; without it a cookie-authenticated push refuses up front rather than failing on every individual PUT. A read-only cookie session (discover.py, which never writes) does not need it.
- still contained to
Data folder
All researcher data (the XML, cihr.json, config/) lives under an explicit --data-dir
given on every command, which must resolve outside this repository (the repository is
public). Layout:
<data-dir>/
cv.xml input, supplied by the researcher
cihr.json written by cihr_cv.py
config/mapping.yaml required
config/pages.json written by discover.py
config/exclusions.yaml, implications_extra.yaml, services_extra.yaml,
distinctions_extra.yaml, contributions.yaml, historique/*.md all optional
config/cookies.json optional, fallback authentication, a secret
mapping.yaml
See templates/mapping.example.yaml for a fully worked, fictitious example. Top level, all
required: site (https URL), ref_year (int), recent_window (int >= 1), recent_label
(string), excluded_funding_statuses (list, may be empty), entries (non-empty list). Each
entry has cv_path, page_id, mode (markers | replace | split), and mode-specific
keys - marker for markers; renderer, recent_marker, history_marker and (for
distinctions) subkey for split; nothing more for replace. validate_mapping refuses
a missing key, a wrong type, renderer: phq, an unknown renderer, a duplicate
(page_id, marker) pair, and a replace page shared with another entry.
Workflow
Run every command below from this skill's own .claude/skills/wp-portfolio-sync/ directory
(where scripts/ and wp-sync-config.json sit beside each other) - scripts/cihr_cv.py is
relative to that working directory, not to the repository root or to <data-dir>.
# 1. Parse the CV XML (CIHR/CCV export)
python scripts/cihr_cv.py cv.xml --data-dir <data-dir> --json
# 2. First run only: discover WordPress pages, then fill config/mapping.yaml's page_id values
python scripts/discover.py --data-dir <data-dir> --json
# 3. Preview every planned change - no network write
python scripts/preview.py --data-dir <data-dir> --json
# 4. Push, dry run first (no --apply writes nothing)
python scripts/push_wp.py --data-dir <data-dir> --json
# 5. Push for real, only after reviewing the dry run
python scripts/push_wp.py --data-dir <data-dir> --apply --yes --json
The /portfolio command and the wp-portfolio-agent agent drive this same sequence with
the researcher's approval gates built in.
Exit codes
0 success; 1 failure (network, HTTP, unreadable input, a write that did not verify);
2 refusal by design (missing or invalid argument or config, gate failure, --apply
without --yes, an output path outside --data-dir, --data-dir inside the repository,
missing credentials, an empty section). Every state-changing or network CLI accepts
--json and prints one JSON object on stdout besides its human text on stderr - on success
AND on a refusal or failure, where it is {"error": ..., "exit_code": ...} rather than
nothing, so a caller scripting against --json can tell the two apart without parsing
stderr. Secrets never appear in either.
Guardrails
- Markers only.
markers
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- scripts/cihr_cv.py
- scripts/cihr_labels.json
- scripts/discover.py
- scripts/parse_cv.py
- scripts/preview.py
- scripts/push_wp.py
- scripts/render.py
- scripts/requirements.txt
- scripts/sensitive_keys.json
- scripts/verify_titles.py
- scripts/wp-sync-config.json
- scripts/wp_common.py
- scripts/wp_config.py
- scripts/wp_errors.py
- scripts/wp_paths.py
- templates/cookies.json.example
- templates/mapping.example.yaml
FAQ
Что делает скилл wp-portfolio-sync?
Migrate a researcher's final CIHR / Canadian Common CV XML export into their WordPress portfolio once, through the WordPress REST API, between cvsync markers. Trigger on: WordPress portfolio, CV XML to WordPress, CCV migration, portfolio.uqac.ca, /portfolio.
Как установить скилл wp-portfolio-sync?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wp-portfolio-sync запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…