[Skills] Persona generator from YAML template open

← Forge
scidex new-persona renders AGENTS.md+SKILL.md+registry row from a single YAML conforming to JSON Schema.
Spec File

Effort: standard

Goal

The 30+ personas under personas/<name>/ (aristotle, andrej-karpathy,
falsifier, evidence-auditor, …) each ship a hand-written AGENTS.md, SKILL.md, optional references/, and an avatar. Adding a new persona
is a copy-paste-fix-the-frontmatter exercise that diverges in subtle
ways (some lack frontmatter, some reference dead skills, some
hard-code a model). Ship scidex new-persona <slug> — generates a
persona from a single YAML spec, validates it against the persona
schema, and registers it with the senate persona registry.

Acceptance Criteria

Persona schema scidex/skills/persona_schema.json (JSON
Schema draft-07): required fields slug, display_name,
domain (enum: Theorist|Skeptic|Expert|Methodologist|
Synthesizer|Falsifier|Auditor|Mentor|Other), default_stance
(≥3 bullets), core_principles (≥3 entries with name +
practice + quote), model_preference (string, defaults to
claude-auto), tools (list of skill ids the persona may
invoke), co_authors (list of human references).
CLI scidex new-persona --from <yaml> reads a YAML
conforming to the schema, scaffolds:
- personas/<slug>/AGENTS.md rendered from
templates/persona_agents_md.j2 (header, default stance,
core principles).
- personas/<slug>/SKILL.md (one-paragraph summary used by
the skill auto-discovery in scidex/skills/loader.py).
- personas/<slug>/references/ directory with a placeholder
README.md so the persona has a citation surface from day
one.
- Optional personas/<slug>/avatar.png if --avatar
<path>
provided (copied; otherwise a 1px placeholder is
emitted with a TODO).
Validation pass scidex new-persona --validate <slug>
walks an existing persona dir, checks the rendered AGENTS.md
contains the required sections (regex match on ## Default
stance
, ## Core principles), checks every tool listed in
the YAML resolves to a known skill, and warns on missing
references.
Registry write. Inserts (or upserts) a row into the
personas registry table the senate already uses
(scidex/senate/personas / scidex/agents/registry.py) so
the senate UI lists the new persona without a redeploy.
Round-trip test tests/test_persona_generator.py:
- Builds a YAML for "test-philosopher" → scaffolds → asserts
every file exists and parses → asserts registry row
present.
- Re-run aborts with non-zero exit unless --overwrite.
- --validate against personas/aristotle/ exits 0.
Backfill helper scripts/backfill_persona_yaml.py: walks
personas/*/AGENTS.md, reverse-engineers a YAML for each
persona, writes personas/<slug>/persona.yaml. Future
regenerations then go YAML → AGENTS.md instead of edit-md
directly.

Approach

  • Inventory persona dirs (read personas/aristotle/AGENTS.md end-
  • to-end + 3 others) to fix the canonical AGENTS.md shape.
  • Define schema first; iterate on a YAML for aristotle that
  • round-trips losslessly.
  • Build the renderer (jinja2 if already a dep, otherwise
  • string.Template again).
  • Wire CLI subcommand into cli.py.
  • Backfill script — best-effort; record any persona that resists
  • reverse-engineering in a follow-up.

    Dependencies

    • scidex/skills/loader.py — auto-discovers personas at boot.
    • scidex/agents/registry.py — persona registry row writer.

    Dependents

    • q-devx-skill-scaffolder (sibling) — same template machinery.

    Work Log

    Sibling Tasks in Quest (Forge) ↗