Skip to content

persona sources: rename display labels (built-in / repo / personal)#84

Merged
willwashburn merged 2 commits into
mainfrom
claude/persona-source-labels
May 11, 2026
Merged

persona sources: rename display labels (built-in / repo / personal)#84
willwashburn merged 2 commits into
mainfrom
claude/persona-source-labels

Conversation

@willwashburn
Copy link
Copy Markdown
Member

Summary

Follow-up to #83 — this commit was on the branch but didn't make the merge window.

Renames the cascade's user-facing labels to match the three conceptual tiers:

  • built-in — bundled with @agentworkforce/cli (e.g. persona-maker, persona-improver). Reserved for personas about Agent Workforce itself; intentionally small.
  • personal~/.agentworkforce/workforce/personas/. One user, many repos.
  • repo<cwd>/.agentworkforce/workforce/personas/. Codified in the working tree so the whole team gets them on checkout. Both installed library packs (the shadcn copy-and-own model, e.g. @agentrelay/personas) and hand-authored team overrides live here.

What changes for users

Surface Before After
agentworkforce list SOURCE column library / cwd / user / dir:N built-in / repo / personal / dir:N
agentworkforce sources list SOURCE column same as above same as above
Interactive picker (TUI) source label same as above same as above

What doesn't change (deliberate)

  • Internal PersonaSource literals ('cwd' \| 'user' \| 'library' \| 'dir:N')
  • --save-in-directory <target> flag values
  • --json output of list and sources list
  • Launch metadata stamp (personaSource=…)

So any tooling that pinned on the existing strings keeps working.

Implementation

  • New formatPersonaSourceLabel(source) helper in local-personas.ts centralizes the mapping; tested in local-personas.test.ts.
  • README gains a "Persona sources" section under the CLI heading explaining the three tiers and linking to the relay #839 worked example.
  • USAGE banner for the picker spells out the four SOURCE values so the inline help matches what the user sees.

Test plan

  • pnpm --filter @agentworkforce/cli test — 165/165 pass
  • pnpm -r typecheck — clean
  • Smoke: `agentworkforce list` now shows `built-in` / `personal` rows
  • Manual sanity in a real terminal — confirm picker SOURCE column reads correctly

🤖 Generated with Claude Code

The cascade has three conceptual tiers users should see:

  built-in  — bundled with @agentworkforce/cli (e.g. persona-maker,
              persona-improver). Reserved for personas about Agent
              Workforce itself; intentionally small.
  personal  — ~/.agentworkforce/workforce/personas/. One user, many repos.
  repo      — <cwd>/.agentworkforce/workforce/personas/. Codified in the
              working tree so the whole team gets them on checkout. Both
              installed library packs (the shadcn copy-and-own model) and
              hand-authored team overrides live here.

Internally the cascade keys are still 'cwd' / 'user' / 'library' / 'dir:N'
so --save-in-directory <target> and the JSON outputs of `list` and
`sources list` are unchanged for any tooling that pinned on them. Only
the user-facing SOURCE column gets the new vocabulary:

  - `agentworkforce list` (table)
  - `agentworkforce sources list` (table)
  - the interactive picker

A new formatPersonaSourceLabel() helper centralizes the mapping, with a
test that locks the four cases. README gains a "Persona sources" section
that explains the three categories and where library packs fit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97988e06-5163-45e4-abf2-250b210ad270

📥 Commits

Reviewing files that changed from the base of the PR and between af701e8 and ebc1cc0.

📒 Files selected for processing (4)
  • README.md
  • packages/cli/src/cli.ts
  • packages/cli/src/local-personas.test.ts
  • packages/cli/src/local-personas.ts
✅ Files skipped from review due to trivial changes (2)
  • README.md
  • packages/cli/src/cli.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/cli/src/local-personas.ts

📝 Walkthrough

Walkthrough

Adds an exported helper formatPersonaSourceLabel to map internal persona source keys to user-facing labels, integrates it into CLI help text, listing tables, and the TUI picker, adds tests for the mapping, and documents persona source layers and cascade order in the README.

Changes

Persona Source Label Formatting

Layer / File(s) Summary
Helper Function Definition
packages/cli/src/local-personas.ts
New exported function formatPersonaSourceLabel maps internal persona source keys (library, user) to user-facing labels (built-in, personal) and returns other source strings unchanged.
Helper Function Tests
packages/cli/src/local-personas.test.ts
Unit test added verifying librarybuilt-in, userpersonal, cwdcwd, and passthrough behavior for dir:N.
CLI Import and Help Text
packages/cli/src/cli.ts
CLI imports formatPersonaSourceLabel and updates the interactive persona picker USAGE/help text to document possible SOURCE column values.
CLI Display Rendering
packages/cli/src/cli.ts
sources list, list, and TUI candidate rendering now display formatted source labels via formatPersonaSourceLabel(...) while keeping raw source values in JSON output.
User Documentation
README.md
Adds "Persona sources" section describing built-in, personal, and cwd layers (including two cwd flavors) and the cascade resolution order cwd → configured dirs → personalbuilt-in.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hop through labels, tidy and neat,
Turning library into built-in sweet,
user becomes personal, cwd stays true,
CLI lists gleam with clearer view,
A small helper hop — clarity for you!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: renaming user-facing display labels for persona sources from internal names (library/user) to user-friendly names (built-in/personal).
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the label renaming, affected surfaces, implementation details, and test results.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/persona-source-labels

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment thread packages/cli/src/cli.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 show command outputs raw internal source label instead of user-facing label

The formatPersonaShow function at packages/cli/src/cli.ts:2288 prints the raw internal source value (e.g., library, cwd, user) directly in the human-readable output. All other human-facing displays in this PR — formatPersonaTable (packages/cli/src/cli.ts:2046), formatSourcesTable (packages/cli/src/cli.ts:1704), and buildTuiCandidates (packages/cli/src/cli.ts:3552) — now call formatPersonaSourceLabel() to map these to the new vocabulary (built-in, repo, personal). This means agentworkforce show code-reviewer will display SOURCE library while agentworkforce list displays built-in for the same persona.

(Refers to line 2288)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Per feedback: `cwd` is a more precise pointer than `repo` — it names the
actual directory the persona was loaded from. Only `library → built-in`
and `user → personal` remain as display renames; `cwd` and `dir:N` pass
through unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@willwashburn willwashburn merged commit fc50388 into main May 11, 2026
2 checks passed
@willwashburn willwashburn deleted the claude/persona-source-labels branch May 11, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant