agjan 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -88,7 +88,7 @@ Fiori or BTP, in general or about files you name: `/agjan-ask`.
88
88
 
89
89
  - [User guide](docs/guide.md): setup, workflow, commands, configuration, hosts, CI,
90
90
  troubleshooting
91
- - [Workflows, teams, personas and skills](docs/workflows-and-teams.md): the terms and how
91
+ - [Workflows, teams, roles and skills](docs/workflows-and-teams.md): the terms and how
92
92
  they fit together
93
93
  - [Design](docs/design.md): every decision and its reason
94
94
  - [Host experiments](docs/host-experiments.md): what was verified on each host, and how
package/dist/cli.js CHANGED
@@ -122,10 +122,10 @@ Agent and human:
122
122
  (human) skills and teams from another repository, at an
123
123
  exact commit; shown first, confirmed in a terminal
124
124
  team list | team show <name> the teams a unit can start with (new, fix start, discover
125
- start take --team) and what their personas work with
125
+ start take --team) and the skills of each role
126
126
  workflow list [--json] | workflow show <workflow> [--team <name>] [--light] [--json]
127
127
  the workflows, and one as this project runs it: each step,
128
- the agent that does it, its persona's skills, the review
128
+ the agent that does it, its role's skills, the review
129
129
  tiers and rounds, your gates
130
130
  baseline refresh record the watched files in baseline.json
131
131
  skill <spec|design|build|verify>
@@ -13,7 +13,7 @@ import { acResults, loadResults } from '../test-results.js';
13
13
  import { testRunState } from '../test-run.js';
14
14
  import { workflowOf } from '../workflow.js';
15
15
  import { proposalProblems, proposalReview } from '../discovery.js';
16
- import { mainRole, personasFor, unitTeam } from '../teams.js';
16
+ import { mainRole, rolesFor, unitTeam } from '../teams.js';
17
17
  import { finalSteps, unitModel } from '../progress-view.js';
18
18
  import { splitNow } from '../story.js';
19
19
  import { verification } from '../readiness.js';
@@ -23,7 +23,7 @@ import { QA_STEP, qaState, qaTestFiles } from '../qa.js';
23
23
  import { extraGateState, extraReviewState, extrasOf, pendingExtras, unitWorkflow } from '../customization.js';
24
24
  /**
25
25
  * The unit's team and what the main agent works with in it (decision 92): the skills of its
26
- * role and the team's own roles for it, then each persona's instructions, which the workflow
26
+ * role and the team's own roles for it, then each role's instructions, which the workflow
27
27
  * skills tell the main agent to follow (the reviewer and QA agent get theirs in their contexts).
28
28
  */
29
29
  function teamRow(ctx, unit) {
@@ -34,24 +34,24 @@ function teamRow(ctx, unit) {
34
34
  const skills = mainSkills(ctx, team.team, unit.kind);
35
35
  const changed = team.changed ? ctx.style.yellow(' (its definition changed since this unit started)') : '';
36
36
  row(ctx, 'team', `${team.name}${skills.length ? ctx.style.gray(` · ${role}: ${skills.join(', ')}`) : ''}${changed}`);
37
- for (const p of mainPersonas(ctx, team.team, unit.kind)) {
37
+ for (const p of mainRoles(ctx, team.team, unit.kind)) {
38
38
  if (p.instructions)
39
39
  row(ctx, 'follow', `${p.role}: ${p.instructions}`);
40
40
  }
41
41
  }
42
- /** The main agent's personas: role, skills and instructions (one line). */
43
- function mainPersonas(ctx, team, kind) {
42
+ /** The roles the main agent works as: role, skills and instructions (one line). */
43
+ function mainRoles(ctx, team, kind) {
44
44
  if (!team)
45
45
  return [];
46
- return personasFor(ctx.config, team, kind, 'main').map(({ role, persona }) => ({
46
+ return rolesFor(ctx.config, team, kind, 'main').map(({ role, skills, instructions }) => ({
47
47
  role,
48
- skills: persona.skills,
49
- ...(persona.instructions?.trim() ? { instructions: persona.instructions.trim().replace(/\s+/g, ' ') } : {}),
48
+ skills,
49
+ ...(instructions?.trim() ? { instructions: instructions.trim().replace(/\s+/g, ' ') } : {}),
50
50
  }));
51
51
  }
52
52
  /** The skills the main agent works with: its role's, then those of the team's own roles for it. */
53
53
  function mainSkills(ctx, team, kind) {
54
- return team ? [...new Set(personasFor(ctx.config, team, kind, 'main').flatMap((p) => p.persona.skills))] : [];
54
+ return team ? [...new Set(rolesFor(ctx.config, team, kind, 'main').flatMap((p) => p.skills))] : [];
55
55
  }
56
56
  /** `, workflow hotfix` for a unit of a workflow of the project's own (decision 95). */
57
57
  function workflowNote(unit) {
@@ -467,7 +467,7 @@ function json(ctx, slugs) {
467
467
  ...((() => {
468
468
  const team = unitTeam(ctx.config, unit.approvals.feature.team);
469
469
  const role = mainRole(unit.kind);
470
- return team ? { team: { name: team.name, changed: team.changed, role, skills: mainSkills(ctx, team.team, unit.kind), personas: mainPersonas(ctx, team.team, unit.kind) } } : {};
470
+ return team ? { team: { name: team.name, changed: team.changed, role, skills: mainSkills(ctx, team.team, unit.kind), roles: mainRoles(ctx, team.team, unit.kind) } } : {};
471
471
  })()),
472
472
  ...(verified ? { verified: verified.problems.length === 0, accepted: verified.accepted, problems: verified.problems } : {}),
473
473
  };
@@ -5,7 +5,7 @@ import { BUILT_IN_TEAMS, ROLES, allTeams, defaultTeam, roleAgent, teamProblems }
5
5
  const USAGE = 'usage: agjan team list | agjan team show <name>';
6
6
  /**
7
7
  * agjan team list | show <name> (decision 92): the teams a unit can start with, the default
8
- * per workflow, and what a team's personas work with. A team is chosen when a unit starts
8
+ * per workflow, and the skills each role works with in a team. A team is chosen when a unit starts
9
9
  * (`--team` on new, fix start, discover start), else the workflow's default.
10
10
  */
11
11
  export function run(ctx, argv) {
@@ -28,18 +28,16 @@ export function run(ctx, argv) {
28
28
  if (!team)
29
29
  throw new UsageError(problems[0]);
30
30
  ctx.out(`${s.bold(name)}: ${team.description}`);
31
- // The built-in roles first, then the team's own; a named persona says so.
32
- const definition = ctx.config.teams?.[name] ?? BUILT_IN_TEAMS[name];
33
- const roles = [...ROLES.filter((r) => team.personas[r]), ...Object.keys(team.personas).filter((r) => !ROLES.includes(r))];
31
+ // The built-in roles first, then the team's own.
32
+ const roles = [...ROLES.filter((r) => team.roles[r]), ...Object.keys(team.roles).filter((r) => !ROLES.includes(r))];
34
33
  const width = Math.max(12, ...roles.filter((r) => !ROLES.includes(r)).map((r) => r.length + 2));
35
34
  ctx.out(` ${'workflows'.padEnd(width)}${team.workflows.join(', ')}`);
36
35
  for (const role of roles) {
37
- const persona = team.personas[role];
38
- const ref = definition?.personas[role];
39
- const notes = [typeof ref === 'string' ? `persona ${ref}` : '', ROLES.includes(role) ? '' : `reaches the ${roleAgent(ctx.config, role) ?? 'unknown'} agent`].filter(Boolean);
40
- ctx.out(` ${role.padEnd(width)}${persona.skills.join(', ')}${notes.length ? s.gray(` (${notes.join('; ')})`) : ''}`);
41
- if (persona.instructions?.trim())
42
- ctx.out(` ${''.padEnd(width)}${s.gray(persona.instructions.trim().replace(/\s+/g, ' '))}`);
36
+ const what = team.roles[role];
37
+ const note = ROLES.includes(role) ? '' : `reaches the ${roleAgent(ctx.config, role) ?? 'unknown'} agent`;
38
+ ctx.out(` ${role.padEnd(width)}${what.skills.join(', ')}${note ? s.gray(` (${note})`) : ''}`);
39
+ if (what.instructions?.trim())
40
+ ctx.out(` ${''.padEnd(width)}${s.gray(what.instructions.trim().replace(/\s+/g, ' '))}`);
43
41
  }
44
42
  ctx.out(s.gray(' The workflow decides the steps, reviews and gates; a team adds what its agents work with.'));
45
43
  for (const p of problems)
@@ -30,7 +30,7 @@ const SOURCE = { 'built-in': 'built in', imported: 'imported', project: 'agjan.c
30
30
  /**
31
31
  * agjan workflow list | show <kind> (decision 90): the workflows with their default teams, and
32
32
  * one of them as this project runs it: each stage's steps, the agent that does each, the
33
- * persona it works with, the review tiers and rounds, and the person's gates. `--json` is for
33
+ * skills its roles work with, the review tiers and rounds, and the person's gates. `--json` is for
34
34
  * tools; the list then also gives the teams, for choosing one.
35
35
  */
36
36
  export function run(ctx, argv) {
@@ -38,7 +38,7 @@ export function run(ctx, argv) {
38
38
  const s = ctx.style;
39
39
  if (positionals[0] === 'list' && positionals.length === 1 && values.json) {
40
40
  const workflows = workflowNames(ctx.config).map((name) => listed(ctx, name));
41
- const teams = Object.entries(allTeams(ctx.config)).map(([name, t]) => ({ name, description: t.description, workflows: t.workflows, source: teamSource(ctx.config, name), personas: t.personas }));
41
+ const teams = Object.entries(allTeams(ctx.config)).map(([name, t]) => ({ name, description: t.description, workflows: t.workflows, source: teamSource(ctx.config, name), roles: t.roles }));
42
42
  ctx.out(JSON.stringify({ schema: 1, workflows, teams }, null, 2));
43
43
  return 0;
44
44
  }
@@ -86,15 +86,15 @@ export function run(ctx, argv) {
86
86
  // Each role once, with the agent it reaches: the built-in roles first, then the team's own.
87
87
  const seen = new Map();
88
88
  for (const step of view.stages.flatMap((st) => st.steps))
89
- for (const p of step.personas)
90
- if (!seen.has(p.role))
91
- seen.set(p.role, { agent: step.actor === 'main' ? 'main agent' : step.actor === 'qa' ? 'QA agent' : 'reviewer', persona: p });
89
+ for (const r of step.roles)
90
+ if (!seen.has(r.role))
91
+ seen.set(r.role, { agent: step.actor === 'main' ? 'main agent' : step.actor === 'qa' ? 'QA agent' : 'reviewer', what: r });
92
92
  if (view.team && seen.size) {
93
93
  ctx.out('', s.bold(`What the agents work with (team ${view.team.name})`));
94
- for (const [role, { agent, persona }] of seen) {
95
- ctx.out(` ${role.padEnd(21)} ${persona.skills.length ? persona.skills.join(', ') : s.gray('no skills')}${s.gray(` (${agent}${persona.description ? `: ${persona.description}` : ''})`)}`);
96
- if (persona.instructions?.trim())
97
- ctx.out(` ${''.padEnd(21)} ${s.gray(persona.instructions.trim().replace(/\s+/g, ' '))}`);
94
+ for (const [role, { agent, what }] of seen) {
95
+ ctx.out(` ${role.padEnd(21)} ${what.skills.length ? what.skills.join(', ') : s.gray('no skills')}${s.gray(` (${agent}${what.description ? `: ${what.description}` : ''})`)}`);
96
+ if (what.instructions?.trim())
97
+ ctx.out(` ${''.padEnd(21)} ${s.gray(what.instructions.trim().replace(/\s+/g, ' '))}`);
98
98
  }
99
99
  }
100
100
  const own = Object.entries(view.review.override).map(([key, value]) => (typeof value === 'object' && value ? Object.entries(value).map(([k, v]) => `${key}.${k} ${v}`).join(', ') : `${key} ${value}`));
package/dist/imports.js CHANGED
@@ -51,13 +51,11 @@ function manifestProblems(data) {
51
51
  if (data.teams !== undefined) {
52
52
  for (const p of validate(loadSchema('config'), { teams: data.teams }))
53
53
  problems.push(`${MANIFEST}: ${p}`);
54
- // A package brings no roles or named personas: its teams use the built-in roles, with their personas inline.
54
+ // A package brings no roles of its own: its teams use the built-in roles.
55
55
  for (const [name, team] of Object.entries(data.teams ?? {})) {
56
- for (const [role, persona] of Object.entries(team?.personas ?? {})) {
56
+ for (const role of Object.keys(team?.roles ?? {})) {
57
57
  if (!ROLES.includes(role))
58
58
  problems.push(`${MANIFEST}: teams.${name}: role '${role}' is not a built-in role (${ROLES.join(', ')})`);
59
- if (typeof persona === 'string')
60
- problems.push(`${MANIFEST}: teams.${name}.personas.${role}: a package's personas are written out, not named`);
61
59
  }
62
60
  }
63
61
  }
@@ -130,8 +128,8 @@ export function planImport(source, commit) {
130
128
  throw new AgjanError('the package is larger than 5 MiB');
131
129
  const teams = {};
132
130
  for (const [name, team] of Object.entries(manifest.teams ?? {})) {
133
- const personas = Object.fromEntries(Object.entries(team.personas).map(([role, p]) => [role, { ...p, skills: p.skills.map((s) => skillNames.get(s) ?? s) }]));
134
- teams[`${manifest.name}/${name}`] = { ...team, personas };
131
+ const roles = Object.fromEntries(Object.entries(team.roles).map(([role, r]) => [role, { ...r, skills: r.skills.map((s) => skillNames.get(s) ?? s) }]));
132
+ teams[`${manifest.name}/${name}`] = { ...team, roles };
135
133
  }
136
134
  return { manifest, source, commit, files, teams };
137
135
  }
package/dist/review.js CHANGED
@@ -15,7 +15,7 @@ import { acResults, loadResults, resultLabel } from './test-results.js';
15
15
  import { readTestRun, testRunProblem } from './test-run.js';
16
16
  import { WORKFLOWS, hasReviewStep, workflowOf } from './workflow.js';
17
17
  import { proposalProblems } from './discovery.js';
18
- import { personaText, personasFor, unitTeam } from './teams.js';
18
+ import { roleText, rolesFor, unitTeam } from './teams.js';
19
19
  import { LOG_FILE, appendLog } from './log.js';
20
20
  import { AgjanError } from './errors.js';
21
21
  import { nextRound, resolveQa, roundState } from './review-policy.js';
@@ -238,11 +238,11 @@ export function buildContextText(root, config, feature, parsed) {
238
238
  parts.push(section(`This review: ${parsed.extra.id}`, `An extra review step of this project's ${unitWorkflow(feature)} workflow, on what its ${parsed.extra.stage} stage produced. Focus: ${parsed.extra.description}\n\nThe checklist of the stage's own review below still applies where it bears on this focus.`));
239
239
  parts.push(section('Checklist', CHECKLISTS[parsed.kind]));
240
240
  // The unit's team adds what the reviewer works with; it never removes a check (decision 92).
241
- // An extra review names its role: the reviewer then works with that role's persona.
241
+ // An extra review names its role: the reviewer then works with that role's skills in the team.
242
242
  const team = unitTeam(config, feature.approvals.feature.team);
243
243
  const role = parsed.extra?.role;
244
- const personas = !team?.team ? [] : role && role !== 'reviewer' ? (team.team.personas[role] ? [{ role, persona: team.team.personas[role] }] : []) : personasFor(config, team.team, feature.kind, 'reviewer');
245
- const reviewer = team?.team ? personaText(config, team.name, personas) : null;
244
+ const roles = !team?.team ? [] : role && role !== 'reviewer' ? (team.team.roles[role] ? [{ role, ...team.team.roles[role] }] : []) : rolesFor(config, team.team, feature.kind, 'reviewer');
245
+ const reviewer = team?.team ? roleText(config, team.name, roles) : null;
246
246
  if (reviewer)
247
247
  parts.push(section('Your team', reviewer));
248
248
  const baseline = join(root, FEATURES_DIR, 'project.md');
@@ -567,7 +567,7 @@ export function createQaContext(root, config, { feature: slug }) {
567
567
  section('Run locally (from agjan-docs/project.md)', runLocally || '(not described: start the application as the project README or package.json says)'),
568
568
  ...((() => {
569
569
  const team = unitTeam(config, feature.approvals.feature.team);
570
- const tester = team?.team ? personaText(config, team.name, personasFor(config, team.team, feature.kind, 'qa')) : null;
570
+ const tester = team?.team ? roleText(config, team.name, rolesFor(config, team.team, feature.kind, 'qa')) : null;
571
571
  return tester ? [section('Your team', tester)] : [];
572
572
  })()),
573
573
  section('Test conventions', `${commands}\n- UI tests: ${ui ? '`npx agjan ui-test` runs the Playwright tests (it skips them, with the reason, where no browser can start)' : 'the project has no Playwright setup (no `test:ui` script): write service tests only'}\n- How tests are written in this stack: \`.claude/skills/cap-developer/references/testing.md\` (cds.test) and \`.claude/skills/fiori-developer/references/testing.md\` (Playwright). Read those for the test mechanics only.`),
package/dist/teams.js CHANGED
@@ -20,7 +20,7 @@ export const BUILT_IN_TEAMS = {
20
20
  'sap-delivery': {
21
21
  description: 'Implements a business feature on SAP BTP: CAP, Fiori elements and UI5, BTP services.',
22
22
  workflows: ['feature'],
23
- personas: {
23
+ roles: {
24
24
  implementer: { skills: ROLE_SKILLS },
25
25
  reviewer: { skills: ['solution-reviewer', ...ROLE_SKILLS] },
26
26
  tester: { skills: ['qa-tester'] },
@@ -29,7 +29,7 @@ export const BUILT_IN_TEAMS = {
29
29
  'sap-maintenance': {
30
30
  description: 'Fixes a bounded defect, and maps an existing application.',
31
31
  workflows: ['fix', 'map'],
32
- personas: {
32
+ roles: {
33
33
  implementer: { skills: ['cap-developer', 'fiori-developer'] },
34
34
  analyst: { skills: ROLE_SKILLS },
35
35
  reviewer: { skills: ['solution-reviewer', 'cap-developer', 'fiori-developer'] },
@@ -38,38 +38,34 @@ export const BUILT_IN_TEAMS = {
38
38
  'sap-discovery': {
39
39
  description: 'Explores a question and recommends an option: integration, BTP services, feasibility.',
40
40
  workflows: ['discovery'],
41
- personas: {
41
+ roles: {
42
42
  analyst: { skills: ['btp-architect', 'cap-developer', 'fiori-developer'] },
43
43
  reviewer: { skills: ['solution-reviewer', 'btp-architect'] },
44
44
  },
45
45
  },
46
46
  };
47
- /** A team definition with every persona resolved; a name with no persona under `personas` gives no skills (`teamProblems` reports it). */
48
- function resolveTeam(config, team) {
49
- const personas = Object.fromEntries(Object.entries(team.personas ?? {}).map(([role, p]) => [role, typeof p === 'string' ? (config.personas?.[p] ?? { skills: [] }) : p]));
50
- return { description: team.description, workflows: team.workflows, personas };
51
- }
52
- /** The built-in teams with the imported ones (loadConfig puts them in) and the project's own on top, resolved. */
47
+ /** The built-in teams with the imported ones (loadConfig puts them in) and the project's own on top. */
53
48
  export function allTeams(config) {
54
49
  const defined = { ...BUILT_IN_TEAMS, ...(config.teams ?? {}) };
55
- return Object.fromEntries(Object.entries(defined).map(([name, team]) => [name, resolveTeam(config, team)]));
50
+ return Object.fromEntries(Object.entries(defined).map(([name, team]) => [name, { description: team.description, workflows: team.workflows, roles: team.roles ?? {} }]));
56
51
  }
57
- /** The agent a role's persona reaches: a built-in role's, or the one its definition under `roles` names. */
52
+ /** The agent a role reaches: a built-in role's, or the one its definition under `roles` names. */
58
53
  export function roleAgent(config, role) {
59
54
  return BUILT_IN_AGENT[role] ?? config.roles?.[role]?.agent ?? null;
60
55
  }
61
56
  /**
62
- * The personas an agent works with in a workflow: the built-in role's first (the implementer or
63
- * analyst for the main agent, the reviewer, the tester), then the team's own roles for that agent.
57
+ * The roles an agent works as in a workflow, with their skills: the built-in role first (the
58
+ * implementer or analyst for the main agent, the reviewer, the tester), then the team's own
59
+ * roles for that agent.
64
60
  */
65
- export function personasFor(config, team, kind, agent) {
61
+ export function rolesFor(config, team, kind, agent) {
66
62
  const builtIn = agent === 'main' ? mainRole(kind) : agent === 'reviewer' ? 'reviewer' : 'tester';
67
63
  const out = [];
68
- if (team.personas[builtIn])
69
- out.push({ role: builtIn, persona: team.personas[builtIn] });
70
- for (const [role, persona] of Object.entries(team.personas)) {
64
+ if (team.roles[builtIn])
65
+ out.push({ role: builtIn, ...team.roles[builtIn] });
66
+ for (const [role, what] of Object.entries(team.roles)) {
71
67
  if (!ROLES.includes(role) && roleAgent(config, role) === agent)
72
- out.push({ role, persona });
68
+ out.push({ role, ...what });
73
69
  }
74
70
  return out;
75
71
  }
@@ -109,9 +105,8 @@ export function teamHash(team) {
109
105
  }
110
106
  /** What is wrong with a team, for the workflow it would run (or all it serves). */
111
107
  export function teamProblems(root, config, name, kind) {
112
- const definition = config.teams?.[name] ?? BUILT_IN_TEAMS[name];
113
108
  const team = allTeams(config)[name];
114
- if (!definition || !team)
109
+ if (!team)
115
110
  return [`no team '${name}' (built in: ${Object.keys(BUILT_IN_TEAMS).join(', ')}; or define it under "teams" in agjan.config.json)`];
116
111
  const problems = [];
117
112
  if (!team.workflows?.length)
@@ -122,13 +117,11 @@ export function teamProblems(root, config, name, kind) {
122
117
  if (kind && !serves(config, team, kind))
123
118
  problems.push(`team '${name}' does not serve the ${WORKFLOWS[kind]?.name ?? kind} workflow (it serves: ${team.workflows.join(', ')})`);
124
119
  const custom = Object.keys(config.roles ?? {});
125
- for (const [role, ref] of Object.entries(definition.personas ?? {})) {
120
+ for (const [role, what] of Object.entries(team.roles)) {
126
121
  const agent = roleAgent(config, role);
127
122
  if (!agent)
128
123
  problems.push(`team '${name}': unknown role '${role}' (roles: ${[...ROLES, ...custom].join(', ')}; or define it under "roles")`);
129
- if (typeof ref === 'string' && !config.personas?.[ref])
130
- problems.push(`team '${name}', ${role}: no persona '${ref}' under "personas"`);
131
- for (const skill of team.personas[role]?.skills ?? []) {
124
+ for (const skill of what.skills ?? []) {
132
125
  if (!existsSync(join(root, '.claude', 'skills', skill, 'SKILL.md')))
133
126
  problems.push(`team '${name}', ${role}: no skill '${skill}' in .claude/skills/`);
134
127
  }
@@ -142,21 +135,21 @@ export function teamProblems(root, config, name, kind) {
142
135
  problems.push(`roles: '${role}' is a built-in role`);
143
136
  for (const w of team.workflows ?? []) {
144
137
  for (const role of ROLES_OF[baseOf(config, w) ?? ''] ?? []) {
145
- if (!team.personas?.[role]?.skills?.length)
138
+ if (!team.roles[role]?.skills?.length)
146
139
  problems.push(`team '${name}' serves ${w} but has no ${role} with skills`);
147
140
  }
148
141
  }
149
142
  return problems;
150
143
  }
151
- /** The personas an agent works with, as it reads them: per role, the skill files, then the instructions. */
152
- export function personaText(config, team, personas) {
153
- if (!personas.length)
144
+ /** The roles an agent works as, as it reads them: per role, the skill files, then the instructions. */
145
+ export function roleText(config, team, roles) {
146
+ if (!roles.length)
154
147
  return null;
155
- return personas
156
- .map(({ role, persona }) => {
148
+ return roles
149
+ .map(({ role, skills, instructions }) => {
157
150
  const what = config.roles?.[role]?.description;
158
- const skills = persona.skills.map((s) => `- \`.claude/skills/${s}/SKILL.md\` (and the references its table names for your topic)`).join('\n');
159
- return [`Team ${team}, ${role}${what ? ` (${what})` : ''}. Work with these skills:`, skills, persona.instructions?.trim() ? `\n${persona.instructions.trim()}` : ''].join('\n').trim();
151
+ const files = skills.map((s) => `- \`.claude/skills/${s}/SKILL.md\` (and the references its table names for your topic)`).join('\n');
152
+ return [`Team ${team}, ${role}${what ? ` (${what})` : ''}. Work with these skills:`, files, instructions?.trim() ? `\n${instructions.trim()}` : ''].join('\n').trim();
160
153
  })
161
154
  .join('\n\n');
162
155
  }
@@ -1,4 +1,4 @@
1
- import { BUILT_IN_TEAMS, allTeams, defaultTeam, mainRole, personasFor, teamProblems } from './teams.js';
1
+ import { BUILT_IN_TEAMS, allTeams, defaultTeam, mainRole, rolesFor, teamProblems } from './teams.js';
2
2
  import { resolveBuild, resolveQa, resolveRounds, resolveTier, reviewerFor } from './review-policy.js';
3
3
  import { baseOf, extrasOf } from './customization.js';
4
4
  import { AgjanError } from './errors.js';
@@ -15,13 +15,13 @@ function trackStage(kind, stage, gate) {
15
15
  return stage.charAt(0).toUpperCase() + stage.slice(1);
16
16
  return kind === 'discovery' && gate ? 'Approval' : 'Review';
17
17
  }
18
- /** Persona entries of a role list as the JSON gives them. */
19
- function personaEntries(config, personas) {
20
- return personas.map(({ role, persona }) => ({
18
+ /** A step's roles as the JSON gives them, with each project role's description. */
19
+ function roleEntries(config, roles) {
20
+ return roles.map(({ role, skills, instructions }) => ({
21
21
  role,
22
22
  ...(config.roles?.[role]?.description ? { description: config.roles[role].description } : {}),
23
- skills: persona.skills,
24
- ...(persona.instructions ? { instructions: persona.instructions } : {}),
23
+ skills,
24
+ ...(instructions ? { instructions } : {}),
25
25
  }));
26
26
  }
27
27
  /**
@@ -48,15 +48,14 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
48
48
  steps: stage.steps
49
49
  .filter((step) => !step.mode || step.mode === mode)
50
50
  .map((step) => {
51
- const personas = team && step.actor !== 'human' ? personasFor(config, team, kind, step.actor) : [];
51
+ const roles = team && step.actor !== 'human' ? rolesFor(config, team, kind, step.actor) : [];
52
52
  const builtIn = step.actor === 'main' ? mainRole(kind) : step.actor === 'reviewer' ? 'reviewer' : step.actor === 'qa' ? 'tester' : null;
53
53
  const resolved = {
54
54
  actor: step.actor,
55
55
  agent: step.actor === 'main' ? 'main agent' : 'you',
56
56
  does: step.does,
57
57
  role: builtIn,
58
- persona: builtIn ? (team?.personas[builtIn] ?? null) : null,
59
- personas: personaEntries(config, personas),
58
+ roles: roleEntries(config, roles),
60
59
  };
61
60
  if (step.review) {
62
61
  resolved.agent = reviewerFor(config, step.review, workflowName);
@@ -84,14 +83,13 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
84
83
  if (!stage)
85
84
  continue;
86
85
  const role = r.role ?? 'reviewer';
87
- const persona = team?.personas[role] ?? null;
86
+ const own = team?.roles[role];
88
87
  const step = {
89
88
  actor: 'reviewer',
90
89
  agent: reviewerFor(config, r.id, workflowName),
91
90
  does: r.description,
92
91
  role,
93
- persona,
94
- personas: role === 'reviewer' && team ? personaEntries(config, personasFor(config, team, kind, 'reviewer')) : persona ? personaEntries(config, [{ role, persona }]) : [],
92
+ roles: role === 'reviewer' && team ? roleEntries(config, rolesFor(config, team, kind, 'reviewer')) : own ? roleEntries(config, [{ role, ...own }]) : [],
95
93
  review: ((tier, rounds) => ({ step: r.id, tier: tier.value, rounds: rounds.value, source: { tier: tier.source, rounds: rounds.source } }))(resolveTier(config, r.id, workflowName), resolveRounds(config, r.id, workflowName)),
96
94
  extra: true,
97
95
  };
@@ -104,7 +102,7 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
104
102
  const stage = stages.find((st) => st.name === trackStage(kind, g.stage, true));
105
103
  if (!stage)
106
104
  continue;
107
- const step = { actor: 'human', agent: 'you', does: g.description, role: null, persona: null, personas: [], gate: { name: g.id, command: `npx agjan approve ${g.id}` }, extra: true };
105
+ const step = { actor: 'human', agent: 'you', does: g.description, role: null, roles: [], gate: { name: g.id, command: `npx agjan approve ${g.id}` }, extra: true };
108
106
  const human = stage.steps.findIndex((x) => x.actor === 'human' && !x.extra);
109
107
  stage.steps.splice(human === -1 ? stage.steps.length : human, 0, step);
110
108
  }
package/docs/guide.md CHANGED
@@ -409,7 +409,7 @@ and CI waits for your approval. To build the recommendation, start a feature wit
409
409
  ## Teams
410
410
 
411
411
  A team decides what knowledge the agents bring to a unit of work; the workflow decides the
412
- steps, reviews and gates, and a team cannot remove any of them. [Workflows, teams, personas and
412
+ steps, reviews and gates, and a team cannot remove any of them. [Workflows, teams, roles and
413
413
  skills](workflows-and-teams.md) defines the terms. Three teams are built in:
414
414
 
415
415
  | Team | Workflows | Implementer or analyst | Reviewer | Tester |
@@ -427,7 +427,7 @@ included), and make it the default for a workflow:
427
427
  "company-delivery": {
428
428
  "description": "Delivery with our security standard",
429
429
  "workflows": ["feature"],
430
- "personas": {
430
+ "roles": {
431
431
  "implementer": { "skills": ["cap-developer", "fiori-developer"] },
432
432
  "reviewer": { "skills": ["solution-reviewer", "company-security"], "instructions": "Name the rule of the standard in every finding." },
433
433
  "tester": { "skills": ["qa-tester"] }
@@ -438,26 +438,22 @@ included), and make it the default for a workflow:
438
438
  }
439
439
  ```
440
440
 
441
- **Your own roles and shared personas.** Next to implementer, reviewer, tester and analyst you can
442
- define roles under `roles`; each reaches one of the agents that already run (`main`, `reviewer`,
443
- `qa`), which then works with that role's persona as well. A persona used by several teams can be
444
- defined once under `personas` and named in each team:
441
+ **Your own roles.** Next to implementer, reviewer, tester and analyst you can define roles
442
+ under `roles`; each reaches one of the agents that already run (`main`, `reviewer`, `qa`), which
443
+ then works with the skills a team gives that role as well:
445
444
 
446
445
  ```json
447
446
  {
448
447
  "roles": {
449
448
  "security-reviewer": { "agent": "reviewer", "description": "checks our security standard" }
450
449
  },
451
- "personas": {
452
- "company-reviewer": { "skills": ["solution-reviewer"], "instructions": "Cite file and line." }
453
- },
454
450
  "teams": {
455
451
  "company-delivery": {
456
452
  "description": "Delivery with our security standard",
457
453
  "workflows": ["feature"],
458
- "personas": {
454
+ "roles": {
459
455
  "implementer": { "skills": ["cap-developer", "fiori-developer"] },
460
- "reviewer": "company-reviewer",
456
+ "reviewer": { "skills": ["solution-reviewer", "company-review"] },
461
457
  "security-reviewer": { "skills": ["company-security"] },
462
458
  "tester": { "skills": ["qa-tester"] }
463
459
  }
@@ -469,15 +465,19 @@ defined once under `personas` and named in each team:
469
465
 
470
466
  Here every review of a company-delivery unit works with both the reviewer's and the security
471
467
  reviewer's skills, and the design review gets up to 5 rounds. A role adds knowledge to an agent's
472
- existing steps; it starts no agent and adds no step. Imported packages use the built-in roles,
473
- with their personas written out.
468
+ existing steps; it starts no agent and adds no step. Imported packages use the built-in roles.
469
+
470
+ **Knowledge several teams share** is a skill: write it once as a skill of your own
471
+ (`.claude/skills/company-review/SKILL.md`, with the instructions and references your reviewers
472
+ follow) and list it in each team. A role's `instructions` are for a few lines that belong to one
473
+ team only.
474
474
 
475
475
  A unit starts with the workflow's default team, or the one you name (`--team` on `new`,
476
- `fix start`, `discover start`), and records it with a hash of its definition. A persona
476
+ `fix start`, `discover start`), and records it with a hash of its definition. A team
477
477
  starts no agent of its own: the implementer's or analyst's skills and instructions reach the main agent through `status` (its `team` and `follow` rows),
478
478
  the reviewer's and the tester's through their review and QA contexts. If the team's
479
479
  definition changes while a unit is under way, `status` and `check` say so.
480
- `npx agjan team list` lists the teams, `npx agjan team show <name>` their personas.
480
+ `npx agjan team list` lists the teams, `npx agjan team show <name>` the skills of each role.
481
481
  `npx agjan workflow show feature` shows the whole workflow as your project runs it: each
482
482
  step, the agent that does it and the skills it works with, the review tier and rounds from
483
483
  your configuration, and your gates (`--team <name>` for another team, `--light` for a light
@@ -498,7 +498,7 @@ Another team's skills and teams can come from a git repository that declares the
498
498
  "delivery": {
499
499
  "description": "Delivery with the ACME security review",
500
500
  "workflows": ["feature"],
501
- "personas": { "reviewer": { "skills": ["solution-reviewer", "security-review"] } }
501
+ "roles": { "reviewer": { "skills": ["solution-reviewer", "security-review"] } }
502
502
  }
503
503
  }
504
504
  }
@@ -528,7 +528,7 @@ its own, under `workflows` in `agjan.config.json`:
528
528
 
529
529
  - **Extra review steps** review what a stage produced (the spec, the design, the build, the whole
530
530
  change, the fix, the map, the proposal) with a focus of their own, by the reviewer agent at
531
- their own tier and round limit, optionally with the persona of one of your roles.
531
+ their own tier and round limit, optionally with the skills the team gives one of your roles.
532
532
  - **Extra gates** are a person's approval in a terminal (`npx agjan approve <gate>`), stamped like
533
533
  the built-in gates: a later change to the stage's documents, or to the files in Build, Verify,
534
534
  a fix or a map run, makes the approval stale.
@@ -636,7 +636,7 @@ Run `npx agjan --help` for the full list.
636
636
  | `discover start <slug> --key <KEY> --question "<text>"` | agent | start a discovery: its folder and `proposal.md` from the template |
637
637
  | `approve proposal` | you, in a terminal | decide on a discovery's recommendation |
638
638
  | `import <git url> --commit <id> [--dry-run]` · `import list` · `import remove <name>` | you, in a terminal | skills and teams from another repository at an exact commit, shown before they are written |
639
- | `team list` · `team show <name>` | anyone | the teams, the default per workflow, and what a team's personas work with |
639
+ | `team list` · `team show <name>` | anyone | the teams, the default per workflow, and the skills each role works with in a team |
640
640
  | `workflow list [--json]` · `workflow show <workflow> [--team <name>] [--light] [--json]` | anyone, tools | the workflows, and one as this project runs it: each step, the agent that does it, the skills it works with, review tiers and rounds, your gates |
641
641
  | `status --json` | tools | per unit: its workflow, stage, whose turn, what is next and the command or skill for it, and for a feature in Build whether it is verified and what blocks it |
642
642
  | `progress [--open]` | anyone | regenerate the progress pages, print the overview, open the HTML page |
@@ -708,7 +708,7 @@ is wrong, so a typo is never a silent default.
708
708
  | `models.<host>.<tier>` | model of the reviewer agents per tier (`balanced`, `deep`); `"session"` (the default, written by `init` so you see it) runs the reviewer on the model of the session that starts it. Set it with `npx agjan models set deep <model>` in your terminal (`npx agjan models` lists the settings and, for Copilot, the models it offers). A deep reviewer on another model family than the main agent (for example `gpt-6-sol` while the main agent runs on Claude) misses other things than the main agent. Model names differ per host (Claude Code: `sonnet`, `opus` or a full id; Copilot: for example `claude-opus-5.5`). Copilot uses the agent file's model unless the session was started with `--model`, which overrides it. `doctor` shows what each reviewer runs on |
709
709
  | `mcp.servers.<name>` | documentation MCP servers: `command`, `args`, `env`, `areas`, `enabled` |
710
710
  | `teams`, `team` | your own teams, and the default team per workflow ([Teams](#teams)) |
711
- | `roles`, `personas` | your own roles, each reaching the main agent, the reviewer or the QA agent, and named personas teams refer to ([Teams](#teams)) |
711
+ | `roles` | your own roles, each reaching the main agent, the reviewer or the QA agent ([Teams](#teams)) |
712
712
  | `workflows` | extra review steps and gates for the built-in workflows, and workflows of your own based on them ([Your own workflows](#your-own-workflows)) |
713
713
  | `ci.policy_changes`, `ci.untracked_changes` | `warn` or `fail` in `check --ci`; CI reads them from the base branch, so a pull request cannot lower them for itself |
714
714
 
@@ -1,4 +1,4 @@
1
- # Workflows, teams, personas and skills
1
+ # Workflows, teams, roles and skills
2
2
 
3
3
  agjan separates **how** work is done from **who** does it. A workflow fixes the steps,
4
4
  reviews and approvals. A team decides what knowledge the agents bring to those steps. This
@@ -16,11 +16,11 @@ shows how to use them.
16
16
  | Term | What it is | Examples | Where it is defined |
17
17
  |---|---|---|---|
18
18
  | **Workflow** | A kind of work and its steps: stages, independent reviews, the approvals you give, and what it may change. | feature, fix, map, discovery; your own, such as a hotfix | Built into agjan; a project adds review steps and gates under `workflows`, and workflows of its own based on a built-in one. |
19
- | **Team** | A named group of personas for one or more workflows. It decides the knowledge, never the steps. | sap-delivery, sap-maintenance, sap-discovery | Built into agjan, imported from a package, or in the project's `agjan.config.json`. |
20
- | **Persona** | A role inside a team, with the skills (and optional instructions) that role works with. | the reviewer of sap-delivery | Inside its team, or defined once under `personas` in `agjan.config.json` and named by several teams. |
19
+ | **Team** | Serves one or more workflows and gives each role its skills (and optional instructions). It decides the knowledge, never the steps. | sap-delivery, sap-maintenance, sap-discovery | Built into agjan, imported from a package, or in the project's `agjan.config.json`. |
21
20
  | **Skill** | A folder of instructions and references an agent reads for a specialty. | cap-developer, solution-reviewer, qa-tester | `.claude/skills/<name>/SKILL.md`: agjan's own, the project's own, or imported. |
22
21
 
23
- There are four built-in **roles**, and a persona fills one of them:
22
+ A **role** is the part an agent plays in a workflow. There are four built-in roles; a team says
23
+ which skills each works with:
24
24
 
25
25
  | Role | What it does |
26
26
  |---|---|
@@ -31,7 +31,7 @@ There are four built-in **roles**, and a persona fills one of them:
31
31
 
32
32
  A project can add its own roles under `roles`, such as a `security-reviewer`. Each one reaches an
33
33
  agent that already runs (the main agent, the reviewer or the QA agent), which then works with that
34
- role's persona as well. A role adds knowledge; it never adds an agent or a step.
34
+ role's skills in the team as well. A role adds knowledge; it never adds an agent or a step.
35
35
 
36
36
  A **unit** is one piece of work that runs a workflow: one feature, one fix, one map run or
37
37
  one discovery.
@@ -47,11 +47,11 @@ WORKFLOW feature · fix · map · discovery
47
47
  ▼
48
48
  TEAM sap-delivery · sap-maintenance · sap-discovery · your own
49
49
  │
50
- │ one persona per role the workflow needs
50
+ │ per role the workflow needs: the skills (and instructions) it works with in this team
51
51
  ▼
52
- PERSONA implementer · analyst · reviewer · tester
52
+ ROLE implementer · analyst · reviewer · tester · your own
53
53
  │
54
- │ many-to-many: a persona lists its skills; a skill is reused by many personas
54
+ │ many-to-many: a role lists its skills in each team; a skill is reused by many teams and roles
55
55
  ▼
56
56
  SKILL cap-developer · fiori-developer · btp-architect · solution-reviewer · qa-tester · ...
57
57
  ```
@@ -65,10 +65,11 @@ The rules behind the arrows:
65
65
  - Each unit runs with **exactly one** team: the default, or the one named with `--team`
66
66
  when the unit starts. The unit records the team and a hash of its definition, so a later
67
67
  change to the team is reported.
68
- - A team has one persona per role, and must fill every built-in role its workflows need with
69
- at least one skill. Its own roles are optional extras for the same agents.
70
- - A persona starts no agent of its own. Its skills and instructions go to the agent that
68
+ - A team lists skills per role, and must give every built-in role its workflows need at least
69
+ one skill. Its own roles are optional extras for the same agents.
70
+ - A role starts no agent of its own. Its skills and instructions go to the agent that
71
71
  already does that job: the main agent, the reviewer or the QA agent.
72
+ - Knowledge several teams share is a skill of the project's own, listed in each team.
72
73
  - How many rounds each review gets is a setting: `review.rounds` for all, and
73
74
  `review.step_rounds` for one kind of step (for example 5 for the design review). A workflow
74
75
  can have its own under `workflows.<name>.review` (rounds, tiers, QA), over the project's.
@@ -99,7 +100,7 @@ The rules behind the arrows:
99
100
  ## Example: the built-in teams
100
101
 
101
102
  agjan ships three teams for SAP CAP, Fiori and BTP projects. The same skills appear in
102
- several personas: that is the many-to-many link between personas and skills.
103
+ several teams and roles: that is the many-to-many link between roles and skills.
103
104
 
104
105
  ```text
105
106
  feature ────► sap-delivery
@@ -120,5 +121,5 @@ discovery ──► sap-discovery
120
121
 
121
122
  To define your own team, import one, or make it a workflow's default, see
122
123
  [Teams](guide.md#teams) in the user guide. `npx agjan team list` lists the teams of a
123
- project, `npx agjan team show <name>` their personas, and `npx agjan workflow show <workflow>`
124
+ project, `npx agjan team show <name>` the skills of each role, and `npx agjan workflow show <workflow>`
124
125
  every step of a workflow with the agent and the skills that do it in your project.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agjan",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "description": "Agentic engineering harness for AI coding agents: role agents, human approval gates, independent review and CI-enforced checks. SAP BTP first.",
5
5
  "keywords": [
6
6
  "agentic-engineering",
@@ -31,26 +31,21 @@
31
31
  "type": "object",
32
32
  "additionalProperties": {
33
33
  "type": "object",
34
- "required": ["description", "workflows", "personas"],
34
+ "required": ["description", "workflows", "roles"],
35
35
  "properties": {
36
36
  "description": { "type": "string" },
37
37
  "workflows": { "type": "array", "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" }, "minItems": 1, "description": "Built-in workflows (feature, fix, map, discovery) or ones under \"workflows\"." },
38
- "personas": {
39
- "description": "A persona per role (implementer, reviewer, tester, analyst, or one under \"roles\"): inline, or the name of one under \"personas\".",
38
+ "roles": {
39
+ "description": "What each role works with in this team (implementer, reviewer, tester, analyst, or one under \"roles\"): its skills and optional instructions. Knowledge several teams share is a skill of the project's own.",
40
40
  "type": "object",
41
- "additionalProperties": {
42
- "oneOf": [
43
- { "$ref": "#/definitions/persona" },
44
- { "type": "string", "minLength": 1 }
45
- ]
46
- }
41
+ "additionalProperties": { "$ref": "#/definitions/teamRole" }
47
42
  }
48
43
  },
49
44
  "additionalProperties": false
50
45
  }
51
46
  },
52
47
  "roles": {
53
- "description": "The project's own roles next to implementer, reviewer, tester and analyst (decision 94): each reaches one agent, which works with its persona too.",
48
+ "description": "The project's own roles next to implementer, reviewer, tester and analyst (decision 94): each reaches one agent, which works with the skills a team gives the role too.",
54
49
  "type": "object",
55
50
  "additionalProperties": {
56
51
  "type": "object",
@@ -62,11 +57,6 @@
62
57
  "additionalProperties": false
63
58
  }
64
59
  },
65
- "personas": {
66
- "description": "Named personas teams refer to by name (decision 94).",
67
- "type": "object",
68
- "additionalProperties": { "$ref": "#/definitions/persona" }
69
- },
70
60
  "team": {
71
61
  "description": "The default team per workflow (built-in or under \"workflows\").",
72
62
  "type": "object",
@@ -89,7 +79,7 @@
89
79
  "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]{1,31}$" },
90
80
  "stage": { "enum": ["spec", "design", "build", "verify", "fix", "map", "proposal"] },
91
81
  "description": { "type": "string", "minLength": 1 },
92
- "role": { "type": "string", "description": "The role whose persona the reviewer works with: reviewer (default) or a role under \"roles\" with agent reviewer." },
82
+ "role": { "type": "string", "description": "The role whose skills in the team the reviewer works with: reviewer (default) or a role under \"roles\" with agent reviewer." },
93
83
  "tier": { "enum": ["fast", "balanced", "deep"] },
94
84
  "rounds": { "type": "integer", "minimum": 1 }
95
85
  },
@@ -228,13 +218,12 @@
228
218
  }
229
219
  },
230
220
  "definitions": {
231
- "persona": {
221
+ "teamRole": {
232
222
  "type": "object",
233
223
  "required": ["skills"],
234
224
  "properties": {
235
- "skills": { "type": "array", "items": { "type": "string" } },
236
- "instructions": { "type": "string" },
237
- "description": { "type": "string" }
225
+ "skills": { "type": "array", "items": { "type": "string" }, "description": "Skill folders in .claude/skills/ the role works with." },
226
+ "instructions": { "type": "string", "description": "A few lines the agent in this role also follows." }
238
227
  },
239
228
  "additionalProperties": false
240
229
  }