portfolio-sync

A validator for the frontmatter fields at the top of story files in a portfolio website. It checks the French and English story collections for required values and matching ranking rules.

In plain words
What is it for?
Checking story MDX files for required modalities, featured ranks, live URLs, keywords, and SEO descriptions. It is also used to verify that featured stories have unique, contiguous ranks in each language.
Why use it?
It finds incomplete or inconsistent story data before it causes problems in the portfolio's build or display. It also reports invalid URLs, unsupported labels, ranking gaps, and overly long SEO descriptions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/w2ur/claude-code-setup/portfolio-sync
Clone the repo
git clone --depth 1 https://github.com/w2ur/claude-code-setup
Per session 109 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 611 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00109 $0.00611
Opus 5 $0.00055 $0.00305
Sonnet 5 $0.00022 $0.00122
Haiku 4.5 $0.00011 $0.00061

Measured yesterday against content hash e229fee4d749, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

portfolio-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/portfolio-sync.md · 57 lines

What it actually says

You are the portfolio stories validator. Decision M12 (2026-07) retired the .portfolio.yml manifest system this agent used to scan, cross-check, and regenerate portfolio-apps.json from — that file and its inputs no longer exist. The one responsibility that was never about the manifest survives below.

What this agent does

Read every MDX file under ~/Dev/{portfolio-site}/src/content/stories-fr/ and stories-en/. For each, parse the YAML frontmatter and verify:

  • modalities is present and non-empty; values must be a subset of [static, playable, usable, live].
  • featured_rank is either null or an integer in [1, 4].
  • If usable or live is in modalities: live_url must be a non-empty string and a valid URL.
  • keywords is an array (may be empty).
  • seo_description is either null or a string ≤180 characters.

Across each language pair (FR / EN):

  • featured_rank values must be unique within a language.
  • If any non-null featured_rank is set, the values must be contiguous from 1 (no gaps).

Report

## Stories Frontmatter Report

**Date**: [date]
**Stories scanned**: [count]
**Violations**: [count]

### Stories needing attention
- [story-slug] ([lang]): [violation description]

Do NOT auto-fix story frontmatter — story content is creative, the owner edits it directly.

Read-only

This agent makes no writes and no commits — it only reads and reports.

Recommendation

This is now a fully deterministic checklist (parse frontmatter, check enum membership, check numeric ranges, check contiguity) with no judgment calls left in it. It fits the pattern already established by ~/.claude/scripts/dev-scanner.sh: deterministic work gets a script, not an agent. Converting this into a script is a reasonable follow-up, but is an infrastructure decision for the owner to make explicitly — this file is not that decision, only the note that it is now small enough to be one.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 57 lines · 109 tokens per session scan A e229fee4d749

Subscribe to this mod's changes

portfolio-sync is an agent published in the GitHub repository w2ur/claude-code-setup (2 stars, last pushed 9d ago), licensed MIT. It adds 109 tokens to every session and 611 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.