agjan 0.0.28 → 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 +1 -1
- package/dist/cli.js +2 -2
- package/dist/commands/models.js +4 -1
- package/dist/commands/review.js +2 -1
- package/dist/commands/status.js +13 -12
- package/dist/commands/team.js +8 -10
- package/dist/commands/workflow.js +14 -10
- package/dist/config.js +11 -0
- package/dist/customization.js +26 -0
- package/dist/imports.js +4 -6
- package/dist/progress-view.js +3 -2
- package/dist/progress.js +4 -2
- package/dist/qa.js +4 -2
- package/dist/review-policy.js +78 -12
- package/dist/review.js +7 -7
- package/dist/teams.js +25 -32
- package/dist/workflow-skill.js +6 -2
- package/dist/workflow-view.js +31 -23
- package/docs/guide.md +48 -19
- package/docs/workflows-and-teams.md +16 -14
- package/kit/skills/agjan-verify/SKILL.md +1 -1
- package/package.json +1 -1
- package/schemas/config.schema.json +29 -20
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,
|
|
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
|
|
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
|
|
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>
|
package/dist/commands/models.js
CHANGED
|
@@ -18,7 +18,10 @@ function stepsOf(config, tier) {
|
|
|
18
18
|
if (tier === 'qa')
|
|
19
19
|
return 'tests from the spec in Verify';
|
|
20
20
|
const kinds = Object.keys(DEFAULT_TIERS).filter((kind) => kind !== 'qa' && reviewerFor(config, kind) === AGENTS[tier].agent);
|
|
21
|
-
|
|
21
|
+
// Workflows whose own review.tiers send a step to another agent than the project's.
|
|
22
|
+
const own = Object.keys(config.workflows ?? {}).flatMap((name) => Object.keys(config.workflows[name].review?.tiers ?? {}).filter((kind) => reviewerFor(config, kind, name) === AGENTS[tier].agent && reviewerFor(config, kind) !== AGENTS[tier].agent).map((kind) => `${kind} (${name})`));
|
|
23
|
+
const all = [...kinds, ...own];
|
|
24
|
+
return all.length ? `reviews ${all.join(', ')}` : 'no steps (review.tiers)';
|
|
22
25
|
}
|
|
23
26
|
/** Model names grouped by family, for reading: Claude, GPT, Gemini, the others. */
|
|
24
27
|
function families(models) {
|
package/dist/commands/review.js
CHANGED
|
@@ -5,6 +5,7 @@ import { buildContextText, parseStep } from '../review.js';
|
|
|
5
5
|
import { loadFeature, selectFeature } from '../feature.js';
|
|
6
6
|
import { appendLog } from '../log.js';
|
|
7
7
|
import { reviewerFor, roundState } from '../review-policy.js';
|
|
8
|
+
import { unitWorkflow } from '../customization.js';
|
|
8
9
|
import { highlightMarkdown, tone } from '../ui.js';
|
|
9
10
|
import { AgjanError, UsageError } from '../errors.js';
|
|
10
11
|
/** agjan mcp [--host <name>] [--isolation agent|fork|none] [--role review|qa]: the agjan MCP server on stdio. */
|
|
@@ -75,7 +76,7 @@ export function report(ctx, argv) {
|
|
|
75
76
|
// The reviewer's isolation matters to the user only when it is missing.
|
|
76
77
|
const isolated = record.reviewer?.isolation === 'agent';
|
|
77
78
|
if (values.full || !isolated) {
|
|
78
|
-
out.push(`- reviewer: ${reviewerFor(ctx.config, record.step)} on ${record.reviewer?.host ?? 'unknown host'}, ${isolated ? 'isolated' : `⚠️ isolation ${record.reviewer?.isolation ?? 'unknown'}`}`);
|
|
79
|
+
out.push(`- reviewer: ${reviewerFor(ctx.config, record.step, unitWorkflow(feature))} on ${record.reviewer?.host ?? 'unknown host'}, ${isolated ? 'isolated' : `⚠️ isolation ${record.reviewer?.isolation ?? 'unknown'}`}`);
|
|
79
80
|
}
|
|
80
81
|
const order = { blocker: 0, major: 1, minor: 2 };
|
|
81
82
|
const sorted = [...record.findings].sort((a, b) => order[a.severity] - order[b.severity]);
|
package/dist/commands/status.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
|
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
|
|
43
|
-
function
|
|
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
|
|
46
|
+
return rolesFor(ctx.config, team, kind, 'main').map(({ role, skills, instructions }) => ({
|
|
47
47
|
role,
|
|
48
|
-
skills
|
|
49
|
-
...(
|
|
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(
|
|
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) {
|
|
@@ -75,9 +75,10 @@ function reviewNext(ctx, feature, step) {
|
|
|
75
75
|
return `the ${step} review is still blocked after ${state.round} of ${state.limit} rounds: ask the user whether to run another round (yes: npx agjan review extend ${step}) or to stop and take over (fix with them, accept findings, or change the documents)`;
|
|
76
76
|
}
|
|
77
77
|
const round = state.round ? `, round ${state.next} of ${state.limit}` : '';
|
|
78
|
+
const reviewer = reviewerFor(ctx.config, step, unitWorkflow(feature));
|
|
78
79
|
if (step === QA_STEP)
|
|
79
|
-
return `QA (step qa) with ${
|
|
80
|
-
return `review step ${step} with ${
|
|
80
|
+
return `QA (step qa) with ${reviewer}${round}`;
|
|
81
|
+
return `review step ${step} with ${reviewer}${round}`;
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* What a pending extra of the workflow needs (decision 95): an extra review is run like the
|
|
@@ -466,7 +467,7 @@ function json(ctx, slugs) {
|
|
|
466
467
|
...((() => {
|
|
467
468
|
const team = unitTeam(ctx.config, unit.approvals.feature.team);
|
|
468
469
|
const role = mainRole(unit.kind);
|
|
469
|
-
return team ? { team: { name: team.name, changed: team.changed, role, skills: mainSkills(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) } } : {};
|
|
470
471
|
})()),
|
|
471
472
|
...(verified ? { verified: verified.problems.length === 0, accepted: verified.accepted, problems: verified.problems } : {}),
|
|
472
473
|
};
|
package/dist/commands/team.js
CHANGED
|
@@ -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
|
|
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
|
|
32
|
-
const
|
|
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
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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)
|
|
@@ -22,13 +22,15 @@ function listed(ctx, name) {
|
|
|
22
22
|
extraStages: STAGES[base],
|
|
23
23
|
team: defaultTeam(ctx.config, name),
|
|
24
24
|
extras: { reviews: extras.reviews.map((r) => r.id), gates: extras.gates.map((g) => g.id) },
|
|
25
|
+
/** The workflow's own review settings (`workflows.<name>.review`), as written; `workflow show` resolves them. */
|
|
26
|
+
review: { ...(ctx.config.workflows?.[name]?.review ?? {}) },
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
const SOURCE = { 'built-in': 'built in', imported: 'imported', project: 'agjan.config.json' };
|
|
28
30
|
/**
|
|
29
31
|
* agjan workflow list | show <kind> (decision 90): the workflows with their default teams, and
|
|
30
32
|
* one of them as this project runs it: each stage's steps, the agent that does each, the
|
|
31
|
-
*
|
|
33
|
+
* skills its roles work with, the review tiers and rounds, and the person's gates. `--json` is for
|
|
32
34
|
* tools; the list then also gives the teams, for choosing one.
|
|
33
35
|
*/
|
|
34
36
|
export function run(ctx, argv) {
|
|
@@ -36,7 +38,7 @@ export function run(ctx, argv) {
|
|
|
36
38
|
const s = ctx.style;
|
|
37
39
|
if (positionals[0] === 'list' && positionals.length === 1 && values.json) {
|
|
38
40
|
const workflows = workflowNames(ctx.config).map((name) => listed(ctx, name));
|
|
39
|
-
const teams = Object.entries(allTeams(ctx.config)).map(([name, t]) => ({ name, description: t.description, workflows: t.workflows, source: teamSource(ctx.config, name),
|
|
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 }));
|
|
40
42
|
ctx.out(JSON.stringify({ schema: 1, workflows, teams }, null, 2));
|
|
41
43
|
return 0;
|
|
42
44
|
}
|
|
@@ -84,18 +86,20 @@ export function run(ctx, argv) {
|
|
|
84
86
|
// Each role once, with the agent it reaches: the built-in roles first, then the team's own.
|
|
85
87
|
const seen = new Map();
|
|
86
88
|
for (const step of view.stages.flatMap((st) => st.steps))
|
|
87
|
-
for (const
|
|
88
|
-
if (!seen.has(
|
|
89
|
-
seen.set(
|
|
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 });
|
|
90
92
|
if (view.team && seen.size) {
|
|
91
93
|
ctx.out('', s.bold(`What the agents work with (team ${view.team.name})`));
|
|
92
|
-
for (const [role, { agent,
|
|
93
|
-
ctx.out(` ${role.padEnd(21)} ${
|
|
94
|
-
if (
|
|
95
|
-
ctx.out(` ${''.padEnd(21)} ${s.gray(
|
|
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, ' '))}`);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
|
|
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}`));
|
|
101
|
+
ctx.out('', s.gray(own.length ? `Review settings of this workflow (workflows.${name}.review): ${own.join(', ')}; the others are the project's (review) or agjan's defaults.` : `Review settings: the project's (review) or agjan's defaults; workflows.${name}.review overrides them for this workflow.`));
|
|
102
|
+
ctx.out(s.gray(`Every workflow keeps: ${view.controls.join(', ')}. A team adds knowledge; it cannot remove a step.`));
|
|
99
103
|
for (const p of view.team?.problems ?? [])
|
|
100
104
|
ctx.out(`${s.red('problem')} ${p}`);
|
|
101
105
|
return view.team?.problems.length ? 1 : 0;
|
package/dist/config.js
CHANGED
|
@@ -64,6 +64,16 @@ export function loadDomain(id) {
|
|
|
64
64
|
throw new AgjanError(`unknown domain '${id}'`);
|
|
65
65
|
return domain;
|
|
66
66
|
}
|
|
67
|
+
/** The project's own `review` settings (agjan.config.json as written), by the configuration loadConfig made of it. */
|
|
68
|
+
const writtenReview = new WeakMap();
|
|
69
|
+
/**
|
|
70
|
+
* Whether agjan.config.json itself sets `review.<key>` (so a resolved value is the project's,
|
|
71
|
+
* not agjan's default); undefined for a configuration loadConfig did not make.
|
|
72
|
+
*/
|
|
73
|
+
export function projectSetsReview(config, key) {
|
|
74
|
+
const written = writtenReview.get(config);
|
|
75
|
+
return written ? written[key] !== undefined : undefined;
|
|
76
|
+
}
|
|
67
77
|
/**
|
|
68
78
|
* Loads the effective configuration of the project at `root`: package defaults, then
|
|
69
79
|
* the enabled domains' defaults, then agjan.config.json. Also resolves the areas of all
|
|
@@ -121,6 +131,7 @@ export function loadConfig(root) {
|
|
|
121
131
|
config.teams = { ...imported, ...(config.teams ?? {}) };
|
|
122
132
|
config.domains = domainIds;
|
|
123
133
|
config.areas = areas;
|
|
134
|
+
writtenReview.set(config, isObject(project.review) ? project.review : {});
|
|
124
135
|
return config;
|
|
125
136
|
}
|
|
126
137
|
/**
|
package/dist/customization.js
CHANGED
|
@@ -78,6 +78,32 @@ export function workflowConfigProblems(config) {
|
|
|
78
78
|
if (r.role && !roles(r.role))
|
|
79
79
|
problems.push(`${where}.reviews.${r.id}: role '${r.role}' does not reach the reviewer (the reviewer, or a role under "roles" with agent "reviewer")`);
|
|
80
80
|
}
|
|
81
|
+
if (base && w.review)
|
|
82
|
+
problems.push(...workflowReviewProblems(where, base, w.review));
|
|
83
|
+
}
|
|
84
|
+
return problems;
|
|
85
|
+
}
|
|
86
|
+
/** The review steps of a built-in workflow by kind: `build:` is `build`. */
|
|
87
|
+
export function reviewKinds(base) {
|
|
88
|
+
return WORKFLOWS[base].reviewSteps.map((s) => (s === 'build:' ? 'build' : s));
|
|
89
|
+
}
|
|
90
|
+
/** Keys of `workflows.<name>.review` that its base does not have: a step it has no review of, QA or build reviews outside a feature. */
|
|
91
|
+
function workflowReviewProblems(where, base, review) {
|
|
92
|
+
const problems = [];
|
|
93
|
+
const kinds = reviewKinds(base);
|
|
94
|
+
for (const key of Object.keys(review.step_rounds ?? {})) {
|
|
95
|
+
if (!kinds.includes(key))
|
|
96
|
+
problems.push(`${where}.review.step_rounds: '${key}' is not a review step of ${base} (${kinds.join(', ')})`);
|
|
97
|
+
}
|
|
98
|
+
const tiered = kinds.filter((k) => k !== 'qa');
|
|
99
|
+
for (const key of Object.keys(review.tiers ?? {})) {
|
|
100
|
+
if (!tiered.includes(key))
|
|
101
|
+
problems.push(`${where}.review.tiers: '${key}' is not a review step of ${base} with a tier (${tiered.join(', ')})`);
|
|
102
|
+
}
|
|
103
|
+
if (base !== 'feature') {
|
|
104
|
+
for (const key of ['qa', 'build'])
|
|
105
|
+
if (review[key] !== undefined)
|
|
106
|
+
problems.push(`${where}.review.${key}: only a feature-based workflow has ${key === 'qa' ? 'a QA step' : 'build reviews'}`);
|
|
81
107
|
}
|
|
82
108
|
return problems;
|
|
83
109
|
}
|
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
|
|
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
|
|
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
|
|
134
|
-
teams[`${manifest.name}/${name}`] = { ...team,
|
|
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/progress-view.js
CHANGED
|
@@ -7,6 +7,7 @@ import { readLog } from './log.js';
|
|
|
7
7
|
import { buildProgress, headHistory, prefetchFiles, repoMemo, verifyState } from './progress.js';
|
|
8
8
|
import { verification } from './readiness.js';
|
|
9
9
|
import { reviewerFor, roundLimit } from './review-policy.js';
|
|
10
|
+
import { unitWorkflow } from './customization.js';
|
|
10
11
|
import { acTestFiles } from './tests-map.js';
|
|
11
12
|
import { acResults, loadResults } from './test-results.js';
|
|
12
13
|
import { freshReview } from './fix.js';
|
|
@@ -198,7 +199,7 @@ export function unitModel(ctx, slug, { onBase = false, now = Date.now(), memo =
|
|
|
198
199
|
round: r.round,
|
|
199
200
|
verdict: r.verdict,
|
|
200
201
|
at: r.at_utc,
|
|
201
|
-
tier: { 'agjan-reviewer-deep': 'deep', 'agjan-qa': 'qa' }[reviewerFor(config, r.step)] ?? 'balanced',
|
|
202
|
+
tier: { 'agjan-reviewer-deep': 'deep', 'agjan-qa': 'qa' }[reviewerFor(config, r.step, unitWorkflow(unit))] ?? 'balanced',
|
|
202
203
|
host: r.reviewer?.host ?? null,
|
|
203
204
|
isolation: r.reviewer?.isolation ?? null,
|
|
204
205
|
findings: (r.findings ?? []).map((f) => f.id),
|
|
@@ -322,7 +323,7 @@ export function unitModel(ctx, slug, { onBase = false, now = Date.now(), memo =
|
|
|
322
323
|
decisions: shown,
|
|
323
324
|
reviewers,
|
|
324
325
|
humans,
|
|
325
|
-
roundLimits: Object.fromEntries([...new Set(reviews.map((r) => r.step))].map((step) => [step, roundLimit(config, step)])),
|
|
326
|
+
roundLimits: Object.fromEntries([...new Set(reviews.map((r) => r.step))].map((step) => [step, roundLimit(config, step, unitWorkflow(unit))])),
|
|
326
327
|
stats: {
|
|
327
328
|
activeMs: steps.reduce((t, s) => t + (s.to - s.from), 0),
|
|
328
329
|
waitingMs: gates.reduce((t, s) => t + (s.to - s.from), 0),
|
package/dist/progress.js
CHANGED
|
@@ -3,6 +3,8 @@ import { resolveArea } from './config.js';
|
|
|
3
3
|
import { matcher } from './scope.js';
|
|
4
4
|
import { latestReview, stillBlocked } from './feature.js';
|
|
5
5
|
import { isRecord, treeHash } from './review.js';
|
|
6
|
+
import { resolveBuild } from './review-policy.js';
|
|
7
|
+
import { unitWorkflow } from './customization.js';
|
|
6
8
|
export function repoMemo() {
|
|
7
9
|
return { files: new Map(), ancestry: new Map(), texts: new Map() };
|
|
8
10
|
}
|
|
@@ -94,7 +96,7 @@ function reviewedSince(root, feature, step, sha, memo) {
|
|
|
94
96
|
}
|
|
95
97
|
/**
|
|
96
98
|
* Tasks with their state, the next task, and the build reviews that are due
|
|
97
|
-
* (design 7.3): per completed area by default, per task with `review.build: task
|
|
99
|
+
* (design 7.3): per completed area by default, per task with `review.build: task` (the unit's workflow's, else the project's), and
|
|
98
100
|
* always per task for tasks whose commit touched a risk path.
|
|
99
101
|
*/
|
|
100
102
|
export function buildProgress(root, config, feature, options = {}) {
|
|
@@ -109,7 +111,7 @@ export function buildProgress(root, config, feature, options = {}) {
|
|
|
109
111
|
const dueReviews = () => {
|
|
110
112
|
const isRisk = matcher(config.risk_paths ?? []);
|
|
111
113
|
const due = [];
|
|
112
|
-
const perTask = config.
|
|
114
|
+
const perTask = resolveBuild(config, unitWorkflow(feature)).value === 'task';
|
|
113
115
|
for (const task of list.filter((t) => t.commit)) {
|
|
114
116
|
const risky = filesOf(root, task.commit, memo).some(isRisk);
|
|
115
117
|
if ((perTask || risky) && !reviewedSince(root, feature, `build:${task.id}`, task.commit, memo)) {
|
package/dist/qa.js
CHANGED
|
@@ -4,6 +4,8 @@ import { dirname, join } from 'node:path';
|
|
|
4
4
|
import { contentIds } from './git.js';
|
|
5
5
|
import { writeJson } from './json-file.js';
|
|
6
6
|
import { FEATURES_DIR, latestReview, stillBlocked } from './feature.js';
|
|
7
|
+
import { resolveQa } from './review-policy.js';
|
|
8
|
+
import { unitWorkflow } from './customization.js';
|
|
7
9
|
/**
|
|
8
10
|
* The QA step (design decision 81): in Verify, the QA agent (`agjan-qa`, the qa-tester
|
|
9
11
|
* skill) writes and runs tests from the spec alone, without the design, the diff or the
|
|
@@ -38,9 +40,9 @@ export function writeQaGuard(root, config, slug) {
|
|
|
38
40
|
mkdirSync(dirname(file), { recursive: true });
|
|
39
41
|
writeJson(file, qaGuard(config, slug));
|
|
40
42
|
}
|
|
41
|
-
/** QA runs for full-mode features unless the project turns it off (`review.qa: "off"`). */
|
|
43
|
+
/** QA runs for full-mode features unless the unit's workflow or the project turns it off (`review.qa: "off"`). */
|
|
42
44
|
export function qaApplies(config, feature) {
|
|
43
|
-
return feature.kind === 'feature' && feature.design?.parsed.mode === 'full' && config.
|
|
45
|
+
return feature.kind === 'feature' && feature.design?.parsed.mode === 'full' && resolveQa(config, unitWorkflow(feature)).value !== 'off';
|
|
44
46
|
}
|
|
45
47
|
function filesUnder(root, dir) {
|
|
46
48
|
const abs = join(root, dir);
|
package/dist/review-policy.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Review settings from agjan.config.json (design 7.3, 7.4): which reviewer agent runs a
|
|
3
3
|
* step (`review.tiers`), how many correction rounds a step gets (`review.rounds`, or its
|
|
4
|
-
* kind's own under `review.step_rounds`),
|
|
4
|
+
* kind's own under `review.step_rounds`), whether QA runs (`review.qa`), each also per
|
|
5
|
+
* workflow under `workflows.<name>.review` over the project's, and
|
|
5
6
|
* how many attempts the main agent has for failing deterministic checks
|
|
6
7
|
* (`build.fix_attempts`). `agjan status` shows them; the skills follow `status`.
|
|
7
8
|
*/
|
|
8
9
|
import { stillBlocked } from './feature.js';
|
|
9
10
|
import { readLog } from './log.js';
|
|
10
|
-
import {
|
|
11
|
+
import { projectSetsReview } from './config.js';
|
|
12
|
+
import { findExtraReview, unitWorkflow } from './customization.js';
|
|
11
13
|
/** Default tier per kind of review step. */
|
|
12
14
|
export const DEFAULT_TIERS = {
|
|
13
15
|
spec: 'balanced',
|
|
@@ -24,20 +26,84 @@ export const DEFAULT_TIERS = {
|
|
|
24
26
|
export function stepKind(step) {
|
|
25
27
|
return step.startsWith('build:') ? 'build' : step;
|
|
26
28
|
}
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
+
/** A value of the project's `review`: agjan's default when agjan.config.json does not set it (loadConfig merged it in). */
|
|
30
|
+
function projectValue(config, key, value) {
|
|
31
|
+
return { value, source: projectSetsReview(config, key) === false ? 'default' : 'project' };
|
|
32
|
+
}
|
|
33
|
+
function workflowReview(config, workflow) {
|
|
34
|
+
return workflow ? config.workflows?.[workflow]?.review : undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The tier of a step in `workflow`: the workflow's `review.tiers`, else the project's
|
|
38
|
+
* `review.tiers`, else an extra review step's own (decision 95), else agjan's default.
|
|
39
|
+
*/
|
|
40
|
+
export function resolveTier(config, step, workflow) {
|
|
29
41
|
const kind = stepKind(step);
|
|
30
|
-
|
|
42
|
+
const own = workflowReview(config, workflow)?.tiers?.[kind];
|
|
43
|
+
if (own)
|
|
44
|
+
return { value: own, source: 'workflow' };
|
|
45
|
+
const project = config.review?.tiers?.[kind];
|
|
46
|
+
if (project)
|
|
47
|
+
return { value: project, source: 'project' };
|
|
48
|
+
const extra = findExtraReview(config, kind)?.tier;
|
|
49
|
+
if (extra)
|
|
50
|
+
return { value: extra, source: 'workflow' };
|
|
51
|
+
return { value: DEFAULT_TIERS[kind] ?? 'balanced', source: 'default' };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The round limit of a review step in `workflow`. The workflow's settings come first: its
|
|
55
|
+
* `review.step_rounds` for the step's kind, then (when it sets `review.rounds`) an extra
|
|
56
|
+
* step's own `rounds` and the workflow's `review.rounds`. Then the project's: its
|
|
57
|
+
* `review.step_rounds`, an extra step's own `rounds`, its `review.rounds`; else 3.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveRounds(config, step, workflow) {
|
|
60
|
+
const kind = step ? stepKind(step) : undefined;
|
|
61
|
+
const wf = workflowReview(config, workflow);
|
|
62
|
+
const extra = kind ? findExtraReview(config, kind)?.rounds : undefined;
|
|
63
|
+
const own = kind ? wf?.step_rounds?.[kind] : undefined;
|
|
64
|
+
if (own !== undefined)
|
|
65
|
+
return { value: own, source: 'workflow' };
|
|
66
|
+
if (wf?.rounds !== undefined)
|
|
67
|
+
return { value: extra ?? wf.rounds, source: 'workflow' };
|
|
68
|
+
const project = kind ? config.review?.step_rounds?.[kind] : undefined;
|
|
69
|
+
if (project !== undefined)
|
|
70
|
+
return { value: project, source: 'project' };
|
|
71
|
+
if (extra !== undefined)
|
|
72
|
+
return { value: extra, source: 'workflow' };
|
|
73
|
+
if (config.review?.rounds !== undefined)
|
|
74
|
+
return projectValue(config, 'rounds', config.review.rounds);
|
|
75
|
+
return { value: 3, source: 'default' };
|
|
76
|
+
}
|
|
77
|
+
/** Whether the QA step runs in `workflow` (feature-based): the workflow's `review.qa`, else the project's, else on. */
|
|
78
|
+
export function resolveQa(config, workflow) {
|
|
79
|
+
const own = workflowReview(config, workflow)?.qa;
|
|
80
|
+
if (own)
|
|
81
|
+
return { value: own, source: 'workflow' };
|
|
82
|
+
if (config.review?.qa)
|
|
83
|
+
return projectValue(config, 'qa', config.review.qa);
|
|
84
|
+
return { value: 'on', source: 'default' };
|
|
85
|
+
}
|
|
86
|
+
/** How builds are reviewed in `workflow` (feature-based): per area or per task. */
|
|
87
|
+
export function resolveBuild(config, workflow) {
|
|
88
|
+
const own = workflowReview(config, workflow)?.build;
|
|
89
|
+
if (own)
|
|
90
|
+
return { value: own, source: 'workflow' };
|
|
91
|
+
if (config.review?.build)
|
|
92
|
+
return projectValue(config, 'build', config.review.build);
|
|
93
|
+
return { value: 'area', source: 'default' };
|
|
94
|
+
}
|
|
95
|
+
/** The tier of a step (in `workflow`, the unit's; see resolveTier). */
|
|
96
|
+
export function tierOf(config, step, workflow) {
|
|
97
|
+
return resolveTier(config, step, workflow).value;
|
|
31
98
|
}
|
|
32
99
|
/** The generated reviewer agent for a step. There is no fast agent; `fast` uses the balanced one. */
|
|
33
|
-
export function reviewerFor(config, step) {
|
|
34
|
-
const tier = tierOf(config, step);
|
|
100
|
+
export function reviewerFor(config, step, workflow) {
|
|
101
|
+
const tier = tierOf(config, step, workflow);
|
|
35
102
|
return tier === 'qa' ? 'agjan-qa' : tier === 'deep' ? 'agjan-reviewer-deep' : 'agjan-reviewer';
|
|
36
103
|
}
|
|
37
|
-
/** The round limit of a review step
|
|
38
|
-
export function roundLimit(config, step) {
|
|
39
|
-
|
|
40
|
-
return own ?? config.review?.rounds ?? 3;
|
|
104
|
+
/** The round limit of a review step (in `workflow`, the unit's; see resolveRounds). */
|
|
105
|
+
export function roundLimit(config, step, workflow) {
|
|
106
|
+
return resolveRounds(config, step, workflow).value;
|
|
41
107
|
}
|
|
42
108
|
export function fixAttempts(config) {
|
|
43
109
|
return config.build?.fix_attempts ?? 3;
|
|
@@ -81,7 +147,7 @@ export function roundState(feature, config, step) {
|
|
|
81
147
|
const records = feature.reviews.records.filter((r) => r.step === step);
|
|
82
148
|
const last = records.at(-1) ?? null;
|
|
83
149
|
const extra = extraRounds(feature, step);
|
|
84
|
-
const limit = roundLimit(config, step) + extra;
|
|
150
|
+
const limit = roundLimit(config, step, unitWorkflow(feature)) + extra;
|
|
85
151
|
const round = last?.round ?? 0;
|
|
86
152
|
// Exhausted: still blocked, and the next round would pass the limit; a loop that an approval
|
|
87
153
|
// or a passing verify review closed starts again at round 1 (nextRound).
|
package/dist/review.js
CHANGED
|
@@ -15,10 +15,10 @@ 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 {
|
|
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
|
-
import { nextRound, roundState } from './review-policy.js';
|
|
21
|
+
import { nextRound, resolveQa, roundState } from './review-policy.js';
|
|
22
22
|
import { designProblems, documentProblems } from './validate.js';
|
|
23
23
|
import { QA_STEP, qaApplies, qaDirs, writeQaGuard, qaProblem, qaState, qaTestFiles, qaTestsHash } from './qa.js';
|
|
24
24
|
import { buildProgress } from './progress.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
|
|
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
|
|
245
|
-
const reviewer = team?.team ?
|
|
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');
|
|
@@ -542,7 +542,7 @@ export function recordReview(root, config, input, recorder) {
|
|
|
542
542
|
export function createQaContext(root, config, { feature: slug }) {
|
|
543
543
|
const feature = loadFeature(root, slug);
|
|
544
544
|
if (!qaApplies(config, feature))
|
|
545
|
-
throw new AgjanError(`QA does not apply to ${slug}: it runs for full-mode features (review.qa is ${config.
|
|
545
|
+
throw new AgjanError(`QA does not apply to ${slug}: it runs for full-mode features (review.qa is ${resolveQa(config, unitWorkflow(feature)).value})`);
|
|
546
546
|
if (feature.stage !== 'build' || !feature.spec)
|
|
547
547
|
throw new AgjanError(`${slug} is not in Build yet; QA runs in Verify`);
|
|
548
548
|
const progress = buildProgress(root, config, feature);
|
|
@@ -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 ?
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
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,
|
|
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
|
|
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
|
|
63
|
-
* analyst for the main agent, the reviewer, the tester), then the team's own
|
|
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
|
|
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.
|
|
69
|
-
out.push({ role: builtIn,
|
|
70
|
-
for (const [role,
|
|
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,
|
|
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 (!
|
|
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,
|
|
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
|
-
|
|
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.
|
|
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
|
|
152
|
-
export function
|
|
153
|
-
if (!
|
|
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
|
|
156
|
-
.map(({ role,
|
|
148
|
+
return roles
|
|
149
|
+
.map(({ role, skills, instructions }) => {
|
|
157
150
|
const what = config.roles?.[role]?.description;
|
|
158
|
-
const
|
|
159
|
-
return [`Team ${team}, ${role}${what ? ` (${what})` : ''}. Work with these skills:`,
|
|
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
|
}
|
package/dist/workflow-skill.js
CHANGED
|
@@ -4,7 +4,7 @@ import { WORKFLOWS } from './workflow.js';
|
|
|
4
4
|
* The skill of a workflow of the project's own (decision 95): `agjan sync` writes it to
|
|
5
5
|
* `.claude/skills/agjan-<name>/SKILL.md`, generated from the configuration, so nobody writes
|
|
6
6
|
* agent instructions for it by hand. It follows the base workflow's skill, starts the unit
|
|
7
|
-
* with `--workflow`, and names the workflow's extra review steps and gates.
|
|
7
|
+
* with `--workflow`, and names the workflow's extra review steps and gates and its own review settings.
|
|
8
8
|
*/
|
|
9
9
|
export function workflowSkill(config, name) {
|
|
10
10
|
const base = baseOf(config, name);
|
|
@@ -33,8 +33,12 @@ export function workflowSkill(config, name) {
|
|
|
33
33
|
'',
|
|
34
34
|
`1. Start the unit with \`--workflow ${name}\`: \`${start}\`. Everything else it says about starting (the branch, the key, asking the user) stays.`,
|
|
35
35
|
`2. The extra review steps and gates below belong to this workflow. \`npx agjan status\` names each when it is due (\`next\`), and the stage's gate or the acceptance waits for them. \`npx agjan workflow show ${name}\` shows the whole workflow.`,
|
|
36
|
-
'',
|
|
37
36
|
];
|
|
37
|
+
const review = Object.entries(definition.review ?? {}).map(([key, value]) => (typeof value === 'object' ? Object.entries(value).map(([k, v]) => `${key}.${k} ${v}`).join(', ') : `${key} ${value}`));
|
|
38
|
+
if (review.length) {
|
|
39
|
+
lines.push(`3. This workflow has review settings of its own (\`workflows.${name}.review\`: ${review.join(', ')}). Where the ${workflow.name} skill speaks of the project's \`review\` settings (round limits, tiers, QA), its units use these instead; follow the reviewer agent and the round limit that \`npx agjan status\` names for each review.`);
|
|
40
|
+
}
|
|
41
|
+
lines.push('');
|
|
38
42
|
if (reviews.length) {
|
|
39
43
|
lines.push('## Extra review steps', '');
|
|
40
44
|
for (const r of reviews)
|
package/dist/workflow-view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BUILT_IN_TEAMS, allTeams, defaultTeam, mainRole,
|
|
2
|
-
import {
|
|
1
|
+
import { BUILT_IN_TEAMS, allTeams, defaultTeam, mainRole, rolesFor, teamProblems } from './teams.js';
|
|
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';
|
|
5
5
|
import { WORKFLOWS } from './workflow.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
|
-
/**
|
|
19
|
-
function
|
|
20
|
-
return
|
|
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
|
|
24
|
-
...(
|
|
23
|
+
skills,
|
|
24
|
+
...(instructions ? { instructions } : {}),
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -40,33 +40,37 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
|
|
|
40
40
|
const fallback = defaultTeam(config, workflowName);
|
|
41
41
|
const name = options.team ?? fallback;
|
|
42
42
|
const team = name ? (allTeams(config)[name] ?? null) : null;
|
|
43
|
-
const
|
|
43
|
+
const qa = resolveQa(config, workflowName);
|
|
44
|
+
const build = resolveBuild(config, workflowName);
|
|
44
45
|
const extras = extrasOf(config, workflowName);
|
|
45
46
|
const stages = workflow.track.map((stage) => ({
|
|
46
47
|
name: stage.name,
|
|
47
48
|
steps: stage.steps
|
|
48
49
|
.filter((step) => !step.mode || step.mode === mode)
|
|
49
50
|
.map((step) => {
|
|
50
|
-
const
|
|
51
|
+
const roles = team && step.actor !== 'human' ? rolesFor(config, team, kind, step.actor) : [];
|
|
51
52
|
const builtIn = step.actor === 'main' ? mainRole(kind) : step.actor === 'reviewer' ? 'reviewer' : step.actor === 'qa' ? 'tester' : null;
|
|
52
53
|
const resolved = {
|
|
53
54
|
actor: step.actor,
|
|
54
55
|
agent: step.actor === 'main' ? 'main agent' : 'you',
|
|
55
56
|
does: step.does,
|
|
56
57
|
role: builtIn,
|
|
57
|
-
|
|
58
|
-
personas: personaEntries(config, personas),
|
|
58
|
+
roles: roleEntries(config, roles),
|
|
59
59
|
};
|
|
60
60
|
if (step.review) {
|
|
61
|
-
resolved.agent = reviewerFor(config, step.review);
|
|
61
|
+
resolved.agent = reviewerFor(config, step.review, workflowName);
|
|
62
|
+
const tier = step.review === 'qa' ? { value: 'qa', source: 'default' } : resolveTier(config, step.review, workflowName);
|
|
63
|
+
const rounds = resolveRounds(config, step.review, workflowName);
|
|
64
|
+
const per = step.review === 'build:' ? build : null;
|
|
62
65
|
resolved.review = {
|
|
63
66
|
step: step.review,
|
|
64
|
-
tier:
|
|
65
|
-
rounds:
|
|
66
|
-
...(
|
|
67
|
+
tier: tier.value,
|
|
68
|
+
rounds: rounds.value,
|
|
69
|
+
...(per ? { per: per.value } : {}),
|
|
70
|
+
source: { tier: tier.source, rounds: rounds.source, ...(per ? { per: per.source } : {}) },
|
|
67
71
|
};
|
|
68
|
-
if (step.review === 'qa' &&
|
|
69
|
-
resolved.off = 'review.qa is off
|
|
72
|
+
if (step.review === 'qa' && qa.value === 'off')
|
|
73
|
+
resolved.off = `${qa.source === 'workflow' ? `workflows.${workflowName}.review.qa` : 'review.qa'} is off`;
|
|
70
74
|
}
|
|
71
75
|
if (step.gate)
|
|
72
76
|
resolved.gate = { name: step.gate, command: `npx agjan approve ${step.gate}` };
|
|
@@ -79,15 +83,14 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
|
|
|
79
83
|
if (!stage)
|
|
80
84
|
continue;
|
|
81
85
|
const role = r.role ?? 'reviewer';
|
|
82
|
-
const
|
|
86
|
+
const own = team?.roles[role];
|
|
83
87
|
const step = {
|
|
84
88
|
actor: 'reviewer',
|
|
85
|
-
agent: reviewerFor(config, r.id),
|
|
89
|
+
agent: reviewerFor(config, r.id, workflowName),
|
|
86
90
|
does: r.description,
|
|
87
91
|
role,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
review: { step: r.id, tier: tierOf(config, r.id), rounds: roundLimit(config, r.id) },
|
|
92
|
+
roles: role === 'reviewer' && team ? roleEntries(config, rolesFor(config, team, kind, 'reviewer')) : own ? roleEntries(config, [{ role, ...own }]) : [],
|
|
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)),
|
|
91
94
|
extra: true,
|
|
92
95
|
};
|
|
93
96
|
// Right after the stage's reviews (its own, then earlier extras); else before its gate.
|
|
@@ -99,7 +102,7 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
|
|
|
99
102
|
const stage = stages.find((st) => st.name === trackStage(kind, g.stage, true));
|
|
100
103
|
if (!stage)
|
|
101
104
|
continue;
|
|
102
|
-
const step = { actor: 'human', agent: 'you', does: g.description, role: null,
|
|
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 };
|
|
103
106
|
const human = stage.steps.findIndex((x) => x.actor === 'human' && !x.extra);
|
|
104
107
|
stage.steps.splice(human === -1 ? stage.steps.length : human, 0, step);
|
|
105
108
|
}
|
|
@@ -123,6 +126,11 @@ export function resolveWorkflow(root, config, workflowName, options = {}) {
|
|
|
123
126
|
problems: teamProblems(root, config, name, workflowName),
|
|
124
127
|
}
|
|
125
128
|
: null,
|
|
129
|
+
review: {
|
|
130
|
+
rounds: resolveRounds(config, undefined, workflowName),
|
|
131
|
+
...(kind === 'feature' ? { qa, build } : {}),
|
|
132
|
+
override: { ...(config.workflows?.[workflowName]?.review ?? {}) },
|
|
133
|
+
},
|
|
126
134
|
stages,
|
|
127
135
|
controls: workflow.controls,
|
|
128
136
|
};
|
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,
|
|
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
|
-
"
|
|
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
|
|
442
|
-
|
|
443
|
-
|
|
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
|
-
"
|
|
454
|
+
"roles": {
|
|
459
455
|
"implementer": { "skills": ["cap-developer", "fiori-developer"] },
|
|
460
|
-
"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
|
-
|
|
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
|
|
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>`
|
|
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
|
-
"
|
|
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
|
|
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.
|
|
@@ -568,6 +568,34 @@ lowercase letters, digits and `-`, unique across all workflows, and not one of a
|
|
|
568
568
|
(`check` reports mistakes). `npx agjan workflow list` and `npx agjan workflow show <workflow>`
|
|
569
569
|
show the result, extras marked.
|
|
570
570
|
|
|
571
|
+
### Review settings per workflow
|
|
572
|
+
|
|
573
|
+
`workflows.<name>.review` gives one workflow review settings of its own, in the shapes of the
|
|
574
|
+
project's `review`: `rounds`, `step_rounds`, `tiers`, and for a feature-based workflow `qa` and
|
|
575
|
+
`build`. Each one it does not set falls back to the project's `review`, then to agjan's default,
|
|
576
|
+
so a `hotfix` can have fewer rounds and a cheaper reviewer than `fix`:
|
|
577
|
+
|
|
578
|
+
```json
|
|
579
|
+
{
|
|
580
|
+
"review": { "rounds": 3 },
|
|
581
|
+
"workflows": {
|
|
582
|
+
"hotfix": { "base": "fix", "review": { "rounds": 1, "tiers": { "fix": "fast" } } },
|
|
583
|
+
"feature": { "review": { "qa": "off", "step_rounds": { "design": 5 } } }
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
A unit uses the settings of the workflow it recorded at its start: `status` names its reviewer
|
|
589
|
+
agent and round limit, and the skills follow `status`. The workflow's settings come before the
|
|
590
|
+
project's: its `step_rounds` for the step, then its `rounds` (an extra review's own `rounds` still
|
|
591
|
+
comes first), then the project's `step_rounds` and `rounds`. Tiers: the workflow's, the project's,
|
|
592
|
+
an extra review's own, the default. A workflow of your own does not take its base's settings
|
|
593
|
+
(`workflows.fix.review` is not `hotfix`'s). Keys of `step_rounds` and `tiers` are the base's
|
|
594
|
+
review steps (`tiers.spec` on a fix-based workflow is a mistake `check` reports), and `qa` and
|
|
595
|
+
`build` exist only on a feature-based one. `npx agjan workflow show <workflow> --json` gives each
|
|
596
|
+
review's resolved tier and rounds with where each comes from (`workflow`, `project` or `default`);
|
|
597
|
+
`models` (per host and tier) stays project-wide.
|
|
598
|
+
|
|
571
599
|
## Asking questions
|
|
572
600
|
|
|
573
601
|
**`/agjan-ask`** answers a general question about SAP CAP, Fiori and UI5, SAP BTP,
|
|
@@ -608,7 +636,7 @@ Run `npx agjan --help` for the full list.
|
|
|
608
636
|
| `discover start <slug> --key <KEY> --question "<text>"` | agent | start a discovery: its folder and `proposal.md` from the template |
|
|
609
637
|
| `approve proposal` | you, in a terminal | decide on a discovery's recommendation |
|
|
610
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 |
|
|
611
|
-
| `team list` · `team show <name>` | anyone | the teams, the default per workflow, and
|
|
639
|
+
| `team list` · `team show <name>` | anyone | the teams, the default per workflow, and the skills each role works with in a team |
|
|
612
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 |
|
|
613
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 |
|
|
614
642
|
| `progress [--open]` | anyone | regenerate the progress pages, print the overview, open the HTML page |
|
|
@@ -671,6 +699,7 @@ is wrong, so a typo is never a silent default.
|
|
|
671
699
|
| `review.rounds` | correction rounds per review step (default 3); if blockers remain, the agent asks you whether to run another round (one more per yes, recorded with `npx agjan review extend <step>`) or to stop |
|
|
672
700
|
| `review.step_rounds.<step>` | the round limit of one kind of review step (`spec`, `design:light`, `design`, `build`, `qa`, `verify`, `fix`, `map`, `proposal`) over `review.rounds`, for example `{ "design": 5 }` |
|
|
673
701
|
| `review.qa` | `on` (default) or `off`: the QA step in Verify for full-mode features |
|
|
702
|
+
| `workflows.<name>.review` | review settings of one workflow (`rounds`, `step_rounds`, `tiers`, `qa`, `build`) over the project's `review` ([Review settings per workflow](#review-settings-per-workflow)) |
|
|
674
703
|
| `test_evidence` | `run` (default): CI and the acceptance need a passing `agjan test` run on the change; `names`: a test whose name contains the AC id is enough |
|
|
675
704
|
| `review.tiers.<step>` | `balanced` or `deep` per step kind (`spec`, `design:light`, `design`, `build`, `verify`, `fix`, `map`); decides which reviewer agent runs it. Defaults: `deep` for `design` and `verify`, else `balanced`; `fast` uses the balanced agent |
|
|
676
705
|
| `build.fix_attempts` | attempts for failing deterministic checks before the agent stops (default 3) |
|
|
@@ -679,7 +708,7 @@ is wrong, so a typo is never a silent default.
|
|
|
679
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 |
|
|
680
709
|
| `mcp.servers.<name>` | documentation MCP servers: `command`, `args`, `env`, `areas`, `enabled` |
|
|
681
710
|
| `teams`, `team` | your own teams, and the default team per workflow ([Teams](#teams)) |
|
|
682
|
-
| `roles
|
|
711
|
+
| `roles` | your own roles, each reaching the main agent, the reviewer or the QA agent ([Teams](#teams)) |
|
|
683
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)) |
|
|
684
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 |
|
|
685
714
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Workflows, teams,
|
|
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** |
|
|
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
|
|
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
|
|
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
|
-
│
|
|
50
|
+
│ per role the workflow needs: the skills (and instructions) it works with in this team
|
|
51
51
|
▼
|
|
52
|
-
|
|
52
|
+
ROLE implementer · analyst · reviewer · tester · your own
|
|
53
53
|
│
|
|
54
|
-
│ many-to-many: a
|
|
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,12 +65,14 @@ 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
|
|
69
|
-
|
|
70
|
-
- A
|
|
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
|
-
`review.step_rounds` for one kind of step (for example 5 for the design review).
|
|
74
|
+
`review.step_rounds` for one kind of step (for example 5 for the design review). A workflow
|
|
75
|
+
can have its own under `workflows.<name>.review` (rounds, tiers, QA), over the project's.
|
|
74
76
|
- A team cannot remove a step. Every workflow keeps an independent review, approvals
|
|
75
77
|
stamped by a script, scope checks, and a person who decides at the end.
|
|
76
78
|
- A project can add extra review steps and gates to a workflow, and define workflows of its
|
|
@@ -98,7 +100,7 @@ The rules behind the arrows:
|
|
|
98
100
|
## Example: the built-in teams
|
|
99
101
|
|
|
100
102
|
agjan ships three teams for SAP CAP, Fiori and BTP projects. The same skills appear in
|
|
101
|
-
several
|
|
103
|
+
several teams and roles: that is the many-to-many link between roles and skills.
|
|
102
104
|
|
|
103
105
|
```text
|
|
104
106
|
feature ────► sap-delivery
|
|
@@ -119,5 +121,5 @@ discovery ──► sap-discovery
|
|
|
119
121
|
|
|
120
122
|
To define your own team, import one, or make it a workflow's default, see
|
|
121
123
|
[Teams](guide.md#teams) in the user guide. `npx agjan team list` lists the teams of a
|
|
122
|
-
project, `npx agjan team show <name>`
|
|
124
|
+
project, `npx agjan team show <name>` the skills of each role, and `npx agjan workflow show <workflow>`
|
|
123
125
|
every step of a workflow with the agent and the skills that do it in your project.
|
|
@@ -74,7 +74,7 @@ since the baseline, and commit both.
|
|
|
74
74
|
|
|
75
75
|
## 5. QA (step `qa`)
|
|
76
76
|
|
|
77
|
-
For full-mode features (unless `review.qa
|
|
77
|
+
For full-mode features (unless `review.qa`, the workflow's or the project's, is `off`; `npx agjan status` shows a `qa`
|
|
78
78
|
row), a tester checks the feature from the spec alone before the final review: the
|
|
79
79
|
`agjan-qa` agent writes tests into `test/qa/<slug>/` (and `test/ui/qa/<slug>/`), runs
|
|
80
80
|
them and records the result. Its tests stay in the project as regression tests.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agjan",
|
|
3
|
-
"version": "0.0.
|
|
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", "
|
|
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
|
-
"
|
|
39
|
-
"description": "
|
|
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
|
|
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
|
|
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
|
},
|
|
@@ -108,6 +98,26 @@
|
|
|
108
98
|
},
|
|
109
99
|
"additionalProperties": false
|
|
110
100
|
}
|
|
101
|
+
},
|
|
102
|
+
"review": {
|
|
103
|
+
"description": "This workflow's own review settings over the project's \"review\": each one not set falls back to it, then to agjan's default. Keys of step_rounds and tiers are the base's review steps; qa and build only for a feature-based workflow (agjan check reports others).",
|
|
104
|
+
"type": "object",
|
|
105
|
+
"properties": {
|
|
106
|
+
"build": { "enum": ["area", "task"] },
|
|
107
|
+
"rounds": { "type": "integer", "minimum": 1 },
|
|
108
|
+
"step_rounds": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"propertyNames": { "enum": ["spec", "design:light", "design", "build", "qa", "verify", "fix", "map", "proposal"] },
|
|
111
|
+
"additionalProperties": { "type": "integer", "minimum": 1 }
|
|
112
|
+
},
|
|
113
|
+
"tiers": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"propertyNames": { "enum": ["spec", "design:light", "design", "build", "verify", "fix", "map", "proposal"] },
|
|
116
|
+
"additionalProperties": { "enum": ["fast", "balanced", "deep"] }
|
|
117
|
+
},
|
|
118
|
+
"qa": { "enum": ["on", "off"] }
|
|
119
|
+
},
|
|
120
|
+
"additionalProperties": false
|
|
111
121
|
}
|
|
112
122
|
},
|
|
113
123
|
"additionalProperties": false
|
|
@@ -208,13 +218,12 @@
|
|
|
208
218
|
}
|
|
209
219
|
},
|
|
210
220
|
"definitions": {
|
|
211
|
-
"
|
|
221
|
+
"teamRole": {
|
|
212
222
|
"type": "object",
|
|
213
223
|
"required": ["skills"],
|
|
214
224
|
"properties": {
|
|
215
|
-
"skills": { "type": "array", "items": { "type": "string" } },
|
|
216
|
-
"instructions": { "type": "string" }
|
|
217
|
-
"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." }
|
|
218
227
|
},
|
|
219
228
|
"additionalProperties": false
|
|
220
229
|
}
|