agjan 0.0.29 → 0.0.31
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 +4 -3
- package/dist/adapters/claude-code.js +39 -1
- package/dist/adapters/copilot.js +34 -1
- package/dist/baseline.js +3 -4
- package/dist/cli.js +7 -3
- package/dist/commands/areas.js +47 -0
- package/dist/commands/lint.js +2 -2
- package/dist/commands/map.js +6 -1
- package/dist/commands/review.js +3 -3
- package/dist/commands/setup.js +19 -16
- package/dist/commands/status.js +26 -10
- package/dist/commands/team.js +16 -12
- package/dist/commands/workflow.js +10 -9
- package/dist/config.js +55 -49
- package/dist/defaults-file.js +5 -3
- package/dist/imports.js +4 -6
- package/dist/mcp-config.js +1 -1
- package/dist/mcp.js +31 -3
- package/dist/review.js +12 -7
- package/dist/schema.js +4 -0
- package/dist/teams.js +141 -37
- package/dist/terminal.js +3 -0
- package/dist/validate.js +3 -3
- package/dist/worker.js +120 -0
- package/dist/workflow-view.js +25 -15
- package/docs/guide.md +76 -30
- package/docs/workflows-and-teams.md +53 -18
- package/kit/hooks/guard.mjs +55 -2
- package/kit/presets/generic.json +26 -0
- package/kit/presets/sap-btp.json +34 -0
- package/kit/skills/agjan-build/SKILL.md +9 -3
- package/kit/skills/agjan-design/SKILL.md +14 -11
- package/kit/skills/agjan-discover/SKILL.md +6 -0
- package/kit/skills/agjan-fix/SKILL.md +6 -0
- package/kit/skills/agjan-map/SKILL.md +14 -5
- package/kit/skills/agjan-spec/SKILL.md +6 -0
- package/kit/skills/agjan-worker/SKILL.md +36 -0
- package/kit/skills/agjan-worker/references/hand-off.md +32 -0
- package/kit/skills/backend-developer/SKILL.md +50 -0
- package/kit/skills/solution-architect/SKILL.md +54 -0
- package/kit/skills/technical-architect/SKILL.md +50 -0
- package/kit/skills/ui-developer/SKILL.md +48 -0
- package/kit/templates/project.md +3 -14
- package/package.json +1 -1
- package/schemas/config.defaults.json +8 -10
- package/schemas/config.schema.json +53 -53
- package/kit/domains/btp/domain.json +0 -29
package/kit/hooks/guard.mjs
CHANGED
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
* Only where the host names the calling agent (Claude Code's `agent_type`); a guardrail,
|
|
24
24
|
* not a sandbox: running the application or its tests is allowed.
|
|
25
25
|
*
|
|
26
|
+
* A worker agent (`agjan-worker`, `agjan-worker-deep`, decision 100) does one stage for a role:
|
|
27
|
+
* its file edits are denied outside the paths `role_context` wrote to .agjan/worker-guard.json,
|
|
28
|
+
* and so are commands that record, commit or switch branches. Only where the host names the
|
|
29
|
+
* calling agent (Claude Code's `agent_type`); elsewhere it stays an instruction.
|
|
30
|
+
*
|
|
26
31
|
* The guard only denies. Everything else is left to the host, which asks the user as it
|
|
27
32
|
* is configured to (design decision 76).
|
|
28
33
|
*
|
|
@@ -42,6 +47,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
42
47
|
* A host's tool call as the hook receives it: Copilot's or Claude Code's form.
|
|
43
48
|
* @typedef {{ toolName?: string, toolArgs?: Record<string, any>, tool_name?: string, tool_input?: Record<string, any>, agent_type?: string }} Payload
|
|
44
49
|
* @typedef {{ hidden: string[], visible: string[] }} QaGuard
|
|
50
|
+
* @typedef {{ allow: string[], deny: string[] }} WorkerGuard
|
|
45
51
|
* @typedef {{ agent?: { script_edits?: string } }} GuardConfig
|
|
46
52
|
*/
|
|
47
53
|
|
|
@@ -143,7 +149,7 @@ const RECORD_REASON =
|
|
|
143
149
|
* default, the review contexts that review_record checks a result against): never edited by
|
|
144
150
|
* an agent's edit tool.
|
|
145
151
|
*/
|
|
146
|
-
const RECORD = /^agjan-docs\/(?:.+\/)?(?:approvals\.json|reviews\.json|review\.md|log\.jsonl|progress\.md|report\.md|fix\.json|fix\.md|tests\.json)$|^agjan-docs\/baseline\.json$|^\.agjan\/auto\.json$|^\.agjan\/qa-guard\.json$|^\.agjan\/review-contexts\//;
|
|
152
|
+
const RECORD = /^agjan-docs\/(?:.+\/)?(?:approvals\.json|reviews\.json|review\.md|log\.jsonl|progress\.md|report\.md|fix\.json|fix\.md|tests\.json)$|^agjan-docs\/baseline\.json$|^\.agjan\/auto\.json$|^\.agjan\/qa-guard\.json$|^\.agjan\/worker-guard\.json$|^\.agjan\/review-contexts\//;
|
|
147
153
|
|
|
148
154
|
const AUTO_REASON =
|
|
149
155
|
'The auto mode default (.agjan/auto.json) is the user\'s, set with npx agjan auto on --default in their terminal. Do not read, write, copy or remove it.';
|
|
@@ -157,7 +163,7 @@ const QA_REASON =
|
|
|
157
163
|
const QA_START_REASON = 'Call qa_context first: it names what you may read.';
|
|
158
164
|
|
|
159
165
|
/** The QA guard file: what the QA agent may not read (decision 87). */
|
|
160
|
-
const QA_GUARD = /\.agjan[\\/]+qa-guard\.json/;
|
|
166
|
+
const QA_GUARD = /\.agjan[\\/]+(?:qa|worker)-guard\.json/;
|
|
161
167
|
|
|
162
168
|
/** The files of a glob, as a regular expression: `**` any depth, `*` and `?` within a name. */
|
|
163
169
|
function globRegex(/** @type {string} */ glob) {
|
|
@@ -264,6 +270,49 @@ function decideQa(payload, root) {
|
|
|
264
270
|
return null;
|
|
265
271
|
}
|
|
266
272
|
|
|
273
|
+
const WORKER_REASON =
|
|
274
|
+
'You are an agjan worker: write only the paths role_context gave you, and leave recording, committing and branches to the main agent. If the work needs another file, stop and say which and why.';
|
|
275
|
+
const WORKER_START_REASON = 'You are an agjan worker: call role_context first; it tells you which paths you may write.';
|
|
276
|
+
|
|
277
|
+
/** agjan commands a worker may run: those that only read or check. */
|
|
278
|
+
const WORKER_AGJAN = new RegExp(`${AGJAN}(?!(?:status|check|areas|lint|ui-test|team|workflow|summary|report)\\b)[a-z]`);
|
|
279
|
+
/** git commands that change history, the index or branches. */
|
|
280
|
+
const WORKER_GIT = /\bgit(?:\s+-[cC]\s+\S+|\s+--[\w-]+(?:=\S+)?)*\s+(?:commit|push|reset|rebase|merge|cherry-pick|revert|switch|checkout|stash|tag|branch\s+-[dDmM]|add|rm|mv|restore\s+--staged)\b/;
|
|
281
|
+
|
|
282
|
+
/** The worker guard file; null before role_context wrote it. @returns {WorkerGuard | null} */
|
|
283
|
+
function readWorkerGuard(/** @type {string} */ root) {
|
|
284
|
+
try {
|
|
285
|
+
const guard = JSON.parse(readFileSync(join(root, '.agjan', 'worker-guard.json'), 'utf8'));
|
|
286
|
+
return Array.isArray(guard?.allow) && Array.isArray(guard?.deny) ? guard : null;
|
|
287
|
+
} catch {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* The guard's answer for a tool call of a worker agent, or null (the general rules apply).
|
|
294
|
+
* @param {Payload} payload
|
|
295
|
+
* @param {string} root
|
|
296
|
+
*/
|
|
297
|
+
function decideWorker(payload, root) {
|
|
298
|
+
const tool = payload.tool_name ?? payload.toolName ?? '';
|
|
299
|
+
const args = payload.tool_input ?? payload.toolArgs ?? {};
|
|
300
|
+
if (EDIT_TOOLS.has(tool)) {
|
|
301
|
+
const target = args.path ?? args.file_path ?? args.notebook_path;
|
|
302
|
+
if (typeof target !== 'string' || target === '') return null;
|
|
303
|
+
const rel = repoPath(root, target);
|
|
304
|
+
if (rel === null) return answer(payload, 'deny', WORKER_REASON);
|
|
305
|
+
const guard = readWorkerGuard(root);
|
|
306
|
+
if (!guard) return answer(payload, 'deny', WORKER_START_REASON);
|
|
307
|
+
const matches = (/** @type {string[]} */ globs) => globs.some((g) => globRegex(g).test(rel));
|
|
308
|
+
return matches(guard.allow) && !matches(guard.deny) ? null : answer(payload, 'deny', WORKER_REASON);
|
|
309
|
+
}
|
|
310
|
+
const command = args.command;
|
|
311
|
+
if (typeof command !== 'string') return null;
|
|
312
|
+
if (WORKER_AGJAN.test(command) || WORKER_GIT.test(command)) return answer(payload, 'deny', WORKER_REASON);
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
|
|
267
316
|
const READ_TOOLS = new Set(['Read', 'NotebookRead', 'Grep', 'Glob']);
|
|
268
317
|
|
|
269
318
|
const EDIT_TOOLS = new Set(['edit', 'create', 'Edit', 'Write', 'MultiEdit', 'NotebookEdit']);
|
|
@@ -307,6 +356,10 @@ export function decide(payload, config = {}, root = process.env.CLAUDE_PROJECT_D
|
|
|
307
356
|
const qa = decideQa(payload, root);
|
|
308
357
|
if (qa) return qa;
|
|
309
358
|
}
|
|
359
|
+
if (payload?.agent_type === 'agjan-worker' || payload?.agent_type === 'agjan-worker-deep') {
|
|
360
|
+
const worker = decideWorker(payload, root);
|
|
361
|
+
if (worker) return worker;
|
|
362
|
+
}
|
|
310
363
|
if (READ_TOOLS.has(payload?.tool_name ?? payload?.toolName ?? '')) return null;
|
|
311
364
|
if (EDIT_TOOLS.has(payload?.toolName ?? payload?.tool_name ?? '')) return decideEdit(payload, root);
|
|
312
365
|
const command = payload?.toolArgs?.command ?? payload?.tool_input?.command;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "generic",
|
|
3
|
+
"title": "Any stack: backend, user interface and platform areas",
|
|
4
|
+
"config": {
|
|
5
|
+
"areas": {
|
|
6
|
+
"backend": {
|
|
7
|
+
"title": "Backend",
|
|
8
|
+
"description": "Services and APIs, the data model, authentication, external dependencies.",
|
|
9
|
+
"skills": ["backend-developer"],
|
|
10
|
+
"tests": ["test/**", "tests/**", "**/*.test.*", "**/*.spec.*"],
|
|
11
|
+
"implicit": ["package.json", "package-lock.json"]
|
|
12
|
+
},
|
|
13
|
+
"ui": {
|
|
14
|
+
"title": "User interface",
|
|
15
|
+
"description": "Each application or page: its folder, its framework, the APIs it uses.",
|
|
16
|
+
"skills": ["ui-developer"],
|
|
17
|
+
"tests": ["e2e/**", "test/ui/**"]
|
|
18
|
+
},
|
|
19
|
+
"platform": {
|
|
20
|
+
"title": "Platform",
|
|
21
|
+
"description": "Runtime, infrastructure, configuration and deployment targets.",
|
|
22
|
+
"skills": ["technical-architect"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "sap-btp",
|
|
3
|
+
"title": "SAP BTP: CAP Node.js, Fiori elements and UI5, BTP services",
|
|
4
|
+
"config": {
|
|
5
|
+
"areas": {
|
|
6
|
+
"cap": {
|
|
7
|
+
"title": "CAP",
|
|
8
|
+
"description": "Services, key entities, authentication, external dependencies.",
|
|
9
|
+
"skills": ["cap-developer"],
|
|
10
|
+
"tests": ["test/**"],
|
|
11
|
+
"implicit": ["package.json", "package-lock.json", "tsconfig.json", "tsconfig.cdsbuild.json", "test/fixtures/**", "_i18n/**"],
|
|
12
|
+
"verify": { "test": "npm test" }
|
|
13
|
+
},
|
|
14
|
+
"fiori": {
|
|
15
|
+
"title": "Fiori",
|
|
16
|
+
"description": "Each application: its folder, `app_type` (elements or freestyle), the service it uses.",
|
|
17
|
+
"skills": ["fiori-developer"],
|
|
18
|
+
"tests": ["app/*/webapp/test/**", "app/*/test/**", "test/ui/**"],
|
|
19
|
+
"implicit": ["app/*/package.json", "app/*/package-lock.json", "app/*/tsconfig.json", "app/*/webapp/i18n/**", "playwright.config.ts"],
|
|
20
|
+
"lint": { "command": "npx --yes @ui5/linter", "in": "app/*", "files": "webapp/**/*.{js,ts,xml,json,html}" }
|
|
21
|
+
},
|
|
22
|
+
"btp": {
|
|
23
|
+
"title": "BTP",
|
|
24
|
+
"description": "Runtime, BTP services, deployment targets.",
|
|
25
|
+
"skills": ["btp-architect"]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"application": ["srv/**", "db/**", "app/**"],
|
|
29
|
+
"risk_paths": ["xs-security.json", "ams/**", "mta.yaml", "srv/**/*auth*", "srv/**/*-access.cds"],
|
|
30
|
+
"fix": { "protected": ["mta.yaml", "xs-security.json", "ams/**", "srv/**/*.cds"] },
|
|
31
|
+
"watched": ["db/*.cds", "srv/*.cds", "app/*/webapp/manifest.json", "mta.yaml"],
|
|
32
|
+
"team": { "feature": "sap-delivery", "fix": "sap-maintenance", "map": "sap-maintenance", "discovery": "sap-discovery" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -15,6 +15,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
15
15
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
16
16
|
skill or with the user, this skill and the user win.
|
|
17
17
|
|
|
18
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
19
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
20
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
21
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
22
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
23
|
+
|
|
18
24
|
## Your workflow's extras
|
|
19
25
|
|
|
20
26
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -43,14 +49,14 @@ Repeat until `npx agjan status` says `next: all tasks done and reviewed`:
|
|
|
43
49
|
2. **A task:**
|
|
44
50
|
- `npx agjan log --stage build --task <id> --role <role> --skill agjan-build`
|
|
45
51
|
- Read the task in `tasks.md`, its ACs in `spec.md`, the decisions in
|
|
46
|
-
`design.md`, and the
|
|
47
|
-
`
|
|
52
|
+
`design.md`, and the skills of its area (`npx agjan areas` lists them; for
|
|
53
|
+
example `cap-developer` for `cap`).
|
|
48
54
|
- Change only files matching the task's `paths` (plus implicitly allowed files:
|
|
49
55
|
`package.json`, lockfiles, i18n files, test fixtures).
|
|
50
56
|
- Write tests for the task's ACs. Each test name contains the AC id, for example
|
|
51
57
|
`it('ORDF-AC2: an approved order cannot be edited', ...)`. Manual ACs need no test.
|
|
52
58
|
- Run the task's `verify` command (default: the area's commands in
|
|
53
|
-
`agjan.config.json`, else `npm test`), for a
|
|
59
|
+
`agjan.config.json`, else `npm test`), for a task with UI tests also `npx agjan ui-test`
|
|
54
60
|
(the Playwright UI tests; it skips them where no browser can start: say so, never
|
|
55
61
|
install system libraries), and `npx agjan check`. Fix failures, up to the number of attempts that `npx agjan status` shows (`build.fix_attempts`, default 3); then stop and report to the user.
|
|
56
62
|
- Commit the task with the subject `<KEY>-<id>: <title>`, for example
|
|
@@ -15,6 +15,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
15
15
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
16
16
|
skill or with the user, this skill and the user win.
|
|
17
17
|
|
|
18
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
19
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
20
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
21
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
22
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
23
|
+
|
|
18
24
|
## Your workflow's extras
|
|
19
25
|
|
|
20
26
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -38,21 +44,17 @@ user. Then `npx agjan log --stage design --skill agjan-design`.
|
|
|
38
44
|
## 2. Impact analysis
|
|
39
45
|
|
|
40
46
|
Read `spec.md`, `agjan-docs/project.md` if it exists, and the real files involved.
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
Run `npx agjan areas`: it lists this project's areas and the skills of each. Decide the
|
|
48
|
+
`areas` (a subset of them) with a reason each. Do not load the area skills before you know
|
|
49
|
+
the areas.
|
|
43
50
|
|
|
44
51
|
`npx agjan scaffold design`, then set `mode: full` and `areas` in `design.md`.
|
|
45
52
|
|
|
46
53
|
## 3. Role steps, in this order, only for the chosen areas
|
|
47
54
|
|
|
48
|
-
For each area, read
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|---|---|
|
|
52
|
-
| `btp` | `.claude/skills/btp-architect/SKILL.md` |
|
|
53
|
-
| `cap` | `.claude/skills/cap-developer/SKILL.md` |
|
|
54
|
-
| `fiori` | `.claude/skills/fiori-developer/SKILL.md` |
|
|
55
|
-
|
|
55
|
+
For each area, read the skills `npx agjan areas` lists for it and write its part of
|
|
56
|
+
`## Decisions`. An area without skills is decided from the project's own conventions
|
|
57
|
+
(`agjan-docs/project.md`, the code).
|
|
56
58
|
Every decision states what, why, and the alternative considered. For every new Fiori
|
|
57
59
|
application, record `app_type: elements` or `app_type: freestyle` with reason and
|
|
58
60
|
alternative. Existing applications keep their type (read it from `manifest.json`).
|
|
@@ -64,7 +66,8 @@ entity; "no draft" is only for read-only apps or apps that change data through a
|
|
|
64
66
|
(fiori-developer). An AC the design cannot meet in the UI is a design error, not a
|
|
65
67
|
build problem.
|
|
66
68
|
|
|
67
|
-
Then check the decisions for production, with the rules of the
|
|
69
|
+
Then check the decisions for production, with the rules of the area skills you read. For
|
|
70
|
+
the areas of the sap-btp preset:
|
|
68
71
|
|
|
69
72
|
| Area | Decide for the feature |
|
|
70
73
|
|---|---|
|
|
@@ -18,6 +18,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
18
18
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
19
19
|
skill or with the user, this skill and the user win.
|
|
20
20
|
|
|
21
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
22
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
23
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
24
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
25
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
26
|
+
|
|
21
27
|
## Your workflow's extras
|
|
22
28
|
|
|
23
29
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -15,6 +15,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
15
15
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
16
16
|
skill or with the user, this skill and the user win.
|
|
17
17
|
|
|
18
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
19
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
20
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
21
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
22
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
23
|
+
|
|
18
24
|
## Your workflow's extras
|
|
19
25
|
|
|
20
26
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -15,6 +15,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
15
15
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
16
16
|
skill or with the user, this skill and the user win.
|
|
17
17
|
|
|
18
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
19
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
20
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
21
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
22
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
23
|
+
|
|
18
24
|
## Your workflow's extras
|
|
19
25
|
|
|
20
26
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -53,13 +59,16 @@ It creates the map run folder and, if absent, `agjan-docs/project.md` from the t
|
|
|
53
59
|
|
|
54
60
|
## 2. Read the application
|
|
55
61
|
|
|
56
|
-
Use the project files and the documentation tools configured for
|
|
62
|
+
Use the project files, the skills of each area and the documentation tools configured for
|
|
63
|
+
it (MCP). `npx agjan areas` lists the areas; `project.md` has a heading for each, with what
|
|
64
|
+
to describe under it. For the areas of the sap-btp preset:
|
|
57
65
|
|
|
58
|
-
- `db/` and `srv
|
|
59
|
-
- `app
|
|
66
|
+
- `db/` and `srv/` (CAP): services, key entities, authentication, external dependencies;
|
|
67
|
+
- `app/` (Fiori): each Fiori application, its `app_type` (`sap.fe.templates` in its
|
|
60
68
|
`manifest.json` means elements, else freestyle) and the service it uses;
|
|
61
|
-
- `mta.yaml`, `xs-security.json`, `package.json
|
|
62
|
-
|
|
69
|
+
- `mta.yaml`, `xs-security.json`, `package.json` (BTP): runtime, BTP services, deployment.
|
|
70
|
+
|
|
71
|
+
In every project: tests, lint and naming patterns are the conventions.
|
|
63
72
|
|
|
64
73
|
## 3. Write `agjan-docs/project.md`
|
|
65
74
|
|
|
@@ -16,6 +16,12 @@ your role works with (read them next to the ones this skill names), and each `fo
|
|
|
16
16
|
an instruction of your team for you. Follow those instructions; where one conflicts with this
|
|
17
17
|
skill or with the user, this skill and the user win.
|
|
18
18
|
|
|
19
|
+
A team can also give this skill's writing to a role (design decision 100). A `role` row in
|
|
20
|
+
`npx agjan status` names the role you work as for the current stage and its skills. A
|
|
21
|
+
`hand off` row means a worker agent of your team writes the stage: at the step where you
|
|
22
|
+
would write it, follow `.claude/skills/agjan-worker/references/hand-off.md`; everything else
|
|
23
|
+
in this skill (the user, the checks, the reviews, the gates, the commits) stays yours.
|
|
24
|
+
|
|
19
25
|
## Your workflow's extras
|
|
20
26
|
|
|
21
27
|
The project can add review steps and gates to this workflow (`npx agjan workflow show
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agjan-worker
|
|
3
|
+
description: Knowledge of agjan's worker agents, which do one stage of a unit for a role of the team (design, a build task, ...). Used by the generated agjan-worker agents; do not invoke it directly.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# agjan worker
|
|
7
|
+
|
|
8
|
+
You are an agjan worker. The main agent handed you one stage of a unit of work (a feature's
|
|
9
|
+
design, one build task, a fix, a project map, a proposal) for a role of its team. You do the
|
|
10
|
+
writing for that stage and hand back; the main agent keeps the conversation with the user,
|
|
11
|
+
the reviews, the gates and the commits.
|
|
12
|
+
|
|
13
|
+
## How you work
|
|
14
|
+
|
|
15
|
+
1. **Call `role_context` first**, with the stage (and for `build` the task id, and the unit
|
|
16
|
+
when the main agent names one) from the main agent's request. It returns your role, your
|
|
17
|
+
skills, your job, what to read, the paths you may write and how to hand back. Work only
|
|
18
|
+
from that material and the files it points to.
|
|
19
|
+
2. **Read your skills** before you decide anything: each `SKILL.md` it lists, and the
|
|
20
|
+
references its table names for your topic. The project's own conventions
|
|
21
|
+
(`agjan-docs/project.md`, the existing code) win over a skill's defaults.
|
|
22
|
+
3. **Write only the paths you may write.** Use your file edit tool. If the work needs another
|
|
23
|
+
file, stop and say which file and why: the main agent asks the user for an amendment.
|
|
24
|
+
4. **Check your work** where the stage has checks: for a build task, run its tests (the area's
|
|
25
|
+
test command) until they pass, and `npx agjan check`; fix failures in the code, never by
|
|
26
|
+
weakening a test.
|
|
27
|
+
5. **Hand back** as `role_context` says: a short summary of what you changed and ran, or a
|
|
28
|
+
`QUESTIONS:` section when you need a decision. You cannot ask the user yourself.
|
|
29
|
+
|
|
30
|
+
## Never
|
|
31
|
+
|
|
32
|
+
- Run commands that record or decide: `agjan approve`, `accept`, `reject`, `review`, `log`,
|
|
33
|
+
`amend`, `new`, `branch`, `sync`; never commit, push, rebase or switch branches.
|
|
34
|
+
- Start a reviewer or another agent, or review your own work.
|
|
35
|
+
- Change agjan's records (`approvals.json`, `reviews.json`, `log.jsonl`, `.agjan/`).
|
|
36
|
+
- Decide a question the material leaves open: ask it in `QUESTIONS:` instead.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Handing a stage to a worker agent
|
|
2
|
+
|
|
3
|
+
A team can give a stage of a workflow (spec, design, build, fix, map, proposal) to a role
|
|
4
|
+
whose agent is a **worker** (design decision 100). `npx agjan status` then shows a
|
|
5
|
+
`hand off` row for the current stage, naming the role and the agent, for example
|
|
6
|
+
`hand off design → architect (agent agjan-worker-deep)`. Without that row you do the stage
|
|
7
|
+
yourself, as your skill describes.
|
|
8
|
+
|
|
9
|
+
When the row is there:
|
|
10
|
+
|
|
11
|
+
1. **Prepare as the skill says** (branch, `npx agjan log`, scaffolding such as
|
|
12
|
+
`npx agjan scaffold design`), but do not write the stage's documents or code yourself.
|
|
13
|
+
2. **Start the named agent** with your host's agent tool, with a request that names the
|
|
14
|
+
stage, the unit and, for build, the task:
|
|
15
|
+
`Stage design of feature order-filter: call role_context with stage "design" and feature "order-filter", then do the stage.`
|
|
16
|
+
For a build task: `Stage build, task T2 of feature order-filter: call role_context with stage "build", task "T2" and feature "order-filter".`
|
|
17
|
+
3. **Read what it hands back.**
|
|
18
|
+
- `QUESTIONS:` ask the user each question with your host's question tool, then start the
|
|
19
|
+
agent again with the same request plus the answers.
|
|
20
|
+
- A summary: check it against the stage's files (`git status`, the changed paths). A
|
|
21
|
+
file outside its scope is a scope problem: `npx agjan check` reports it; ask the user
|
|
22
|
+
for an amendment or undo it.
|
|
23
|
+
4. **Continue the skill** from the step after the writing: the checks, the review, the gate,
|
|
24
|
+
and for build the task's commit (`<KEY>-<id>: <title>`), which you make, not the worker.
|
|
25
|
+
5. **Findings and failures go back to the worker**: when a review blocks or a check fails,
|
|
26
|
+
start the agent again with the request, the findings or the failing output, and "fix
|
|
27
|
+
these". You may make a one-line correction yourself only when the user asks you to.
|
|
28
|
+
|
|
29
|
+
The worker cannot talk to the user, review its own work or record anything; you keep all of
|
|
30
|
+
that. If the agent is not available (an older sync, a host without custom agents), run
|
|
31
|
+
`npx agjan sync`, or do the stage yourself with the skills `npx agjan status` lists and say
|
|
32
|
+
so to the user.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: backend-developer
|
|
3
|
+
description: Stack-neutral knowledge for building server-side tasks - APIs, business logic, data access, validation, authorization - with tests. Used by agjan teams in build and fix work; project conventions and the area skills win over it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# backend-developer
|
|
7
|
+
|
|
8
|
+
You implement server-side tasks: APIs, business logic, data access and integrations, each
|
|
9
|
+
with tests that prove its acceptance criteria. The task's paths, the design's decisions,
|
|
10
|
+
the project's conventions and the skills of the task's area (`npx agjan areas`) win over
|
|
11
|
+
these defaults.
|
|
12
|
+
|
|
13
|
+
## Before you write code
|
|
14
|
+
|
|
15
|
+
- Read the task, its ACs in the spec, the decisions in the design, and the existing code
|
|
16
|
+
around the change. Follow the project's structure, naming, error handling and test style.
|
|
17
|
+
- Change only the task's paths (and the area's implicit files). Needing another file is an
|
|
18
|
+
amendment the human approves, not a silent extra change.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
1. **Validate at the boundary.** Every input from a caller is checked for type, range,
|
|
23
|
+
length and format before it is used; the error says which field and why, without
|
|
24
|
+
leaking internals.
|
|
25
|
+
2. **Authorize every operation on the server**, for reads and writes alike, including
|
|
26
|
+
bulk, export and side-channel endpoints. The UI hiding a button is not authorization.
|
|
27
|
+
3. **No injection.** Use the framework's parameterized queries or query builders; never
|
|
28
|
+
build queries, commands or paths by concatenating input.
|
|
29
|
+
4. **Keep data consistent.** Changes that belong together run in one transaction; checks
|
|
30
|
+
that guard a change happen inside it; concurrent edits are detected (version or etag)
|
|
31
|
+
where the design says so.
|
|
32
|
+
5. **Fail clearly.** Expected failures (not found, conflict, invalid input, forbidden) map
|
|
33
|
+
to the right status or error type; unexpected ones are logged with context and never
|
|
34
|
+
swallowed.
|
|
35
|
+
6. **No N+1 work.** Read related data in one query or batch, not one call per row.
|
|
36
|
+
7. **Secrets and configuration** come from the environment or the platform's bindings,
|
|
37
|
+
never from the repository; development defaults stay in the development profile.
|
|
38
|
+
8. **Data changes are migrations.** A schema change that renames, retypes or deletes stored
|
|
39
|
+
data comes with the step that moves the existing data.
|
|
40
|
+
|
|
41
|
+
## Tests
|
|
42
|
+
|
|
43
|
+
- One or more tests per AC, each named with the AC id (`ORDF-AC2: an approved order
|
|
44
|
+
cannot be edited`). Cover the unhappy paths the AC implies.
|
|
45
|
+
- For each authorization rule: a test with the right role, one without it, and one
|
|
46
|
+
anonymous request; for each row-level condition, a user who has the role but is excluded.
|
|
47
|
+
- Tests run against the real framework in-process where the project does so; mock only
|
|
48
|
+
what leaves the process (other services, the network, the clock).
|
|
49
|
+
- Run the area's test command until it passes; a failing test is fixed in the code, not by
|
|
50
|
+
weakening the test.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solution-architect
|
|
3
|
+
description: Stack-neutral knowledge for shaping a solution before it is designed in detail: the business problem, scope, options, trade-offs and non-functional requirements. Used by agjan teams for specs and discoveries; project conventions and the area skills win over it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# solution-architect
|
|
7
|
+
|
|
8
|
+
You turn a business need into a solution someone can decide on and build: what problem it
|
|
9
|
+
solves, for whom, what is in and out, which options exist and why one of them. You do not
|
|
10
|
+
design classes or write code; the technical architect and the developers do that next.
|
|
11
|
+
The project's own map (`agjan-docs/project.md`) and conventions win over these defaults.
|
|
12
|
+
|
|
13
|
+
## Start from the problem
|
|
14
|
+
|
|
15
|
+
1. **Name the problem and who has it** in one or two sentences, in the users' words. A
|
|
16
|
+
request that names a solution ("add a button") gets its problem asked for.
|
|
17
|
+
2. **Find the users and their roles**: who uses it, who approves, who only reads, who must
|
|
18
|
+
not see it. Authorization starts here, not in the code.
|
|
19
|
+
3. **Bound the scope** explicitly: what is in, what is out, and what is deferred. Anything
|
|
20
|
+
not in scope is not built "while we are at it".
|
|
21
|
+
4. **Write testable outcomes**: each acceptance criterion describes one observable behavior
|
|
22
|
+
with its input and expected result, including the unhappy paths (invalid input, missing
|
|
23
|
+
permission, conflicting change, empty results).
|
|
24
|
+
|
|
25
|
+
## Options and decisions
|
|
26
|
+
|
|
27
|
+
- Give **at least two real options** where a choice exists (build or reuse, synchronous or
|
|
28
|
+
asynchronous, extend the existing application or add a new one), each with its costs:
|
|
29
|
+
effort, operations, licences, security, data protection, lock-in.
|
|
30
|
+
- **Recommend one** and say why, what it costs, and what would change the recommendation.
|
|
31
|
+
- Prefer what the project already runs: a new service, framework, store or vendor is a
|
|
32
|
+
decision of its own with a reason, never a side effect.
|
|
33
|
+
- List **open questions** instead of deciding them silently; mark which ones block the
|
|
34
|
+
design.
|
|
35
|
+
|
|
36
|
+
## Non-functional requirements
|
|
37
|
+
|
|
38
|
+
Ask for each one that matters to this change and write it as a measurable statement:
|
|
39
|
+
|
|
40
|
+
| Concern | Ask |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Volume and performance | how many records, users, requests; what response time is acceptable |
|
|
43
|
+
| Availability and recovery | what happens when a dependency is down; what may be lost |
|
|
44
|
+
| Security and privacy | which data is personal or confidential; who may see and change it; audit needs |
|
|
45
|
+
| Integration | which systems send or receive data; their contracts, limits and failure modes |
|
|
46
|
+
| Operations | how it is deployed, configured, monitored and rolled back |
|
|
47
|
+
| Accessibility and languages | who must be able to use it; which languages and locales |
|
|
48
|
+
|
|
49
|
+
## Writing
|
|
50
|
+
|
|
51
|
+
- Short and checkable: every claim about the existing system points to a file or a
|
|
52
|
+
document; every claim about a product or service names the version it is true for.
|
|
53
|
+
- A claim you could not confirm is marked as unverified, never presented as fact.
|
|
54
|
+
- No implementation detail beyond what a decision needs: that belongs in the design.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: technical-architect
|
|
3
|
+
description: Stack-neutral knowledge for designing how an approved spec is built - components, interfaces, data, security, deployment - and splitting it into build tasks. Used by agjan teams in the design stage and for project maps; project conventions and the area skills win over it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# technical-architect
|
|
7
|
+
|
|
8
|
+
You decide how an approved spec is built in this project, and you cut the work into tasks
|
|
9
|
+
a developer can finish and test one by one. The project's map (`agjan-docs/project.md`),
|
|
10
|
+
its existing code and the skills of each area (`npx agjan areas`) win over these defaults.
|
|
11
|
+
|
|
12
|
+
## Decide in this order
|
|
13
|
+
|
|
14
|
+
1. **Follow what exists.** Read the files the change touches before deciding anything.
|
|
15
|
+
Reuse the project's structure, frameworks, naming and patterns; a new framework,
|
|
16
|
+
service, store or dependency is a decision with reason, alternative and cost.
|
|
17
|
+
2. **Interfaces first.** Define each new or changed API, event, message or UI contract:
|
|
18
|
+
operations, inputs, outputs, errors, who may call it. The UI is designed against the
|
|
19
|
+
contract, not against the database.
|
|
20
|
+
3. **Data next.** Entities, keys, relations, constraints, which fields the server sets,
|
|
21
|
+
and how existing data moves when the model changes (renames and deletions need a
|
|
22
|
+
migration path). Personal data is marked and minimized.
|
|
23
|
+
4. **Security in every decision.** Each rule of the spec's authorization is enforced at
|
|
24
|
+
the server for every operation it covers, with a test for a user without the right and
|
|
25
|
+
for an anonymous request. Input is validated at the boundary; secrets never go into
|
|
26
|
+
the repository.
|
|
27
|
+
5. **Failure and concurrency.** Say what happens when two users change the same record,
|
|
28
|
+
when a dependency is slow or down, and when an operation runs twice.
|
|
29
|
+
6. **A way to production.** Every new component says how it is built, configured,
|
|
30
|
+
deployed, monitored and rolled back; demo data never reaches production.
|
|
31
|
+
|
|
32
|
+
Every decision states what, why, and the alternative considered. Each non-functional
|
|
33
|
+
requirement of the spec gets a decision that meets it.
|
|
34
|
+
|
|
35
|
+
## Splitting into tasks
|
|
36
|
+
|
|
37
|
+
- One task is one reviewable change: an area, a few files, and the ACs it covers. Its
|
|
38
|
+
`paths` include every file needed to implement **and test** those ACs.
|
|
39
|
+
- Order: contracts and data first, then the logic behind them, then the UI against the
|
|
40
|
+
finished contract, then deployment and configuration.
|
|
41
|
+
- Every AC is covered by at least one task; a task covers an AC only when it can make it
|
|
42
|
+
pass on its own or after the tasks before it.
|
|
43
|
+
- Add nothing the spec does not ask for; refactoring that the change does not need is a
|
|
44
|
+
separate piece of work.
|
|
45
|
+
|
|
46
|
+
## Mapping an existing application
|
|
47
|
+
|
|
48
|
+
Describe what is there, with pointers to the real files: the components and how they talk,
|
|
49
|
+
the data and where it lives, authentication, external systems, how to run it locally,
|
|
50
|
+
the conventions (naming, tests, lint) and the parts nobody should touch without care.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-developer
|
|
3
|
+
description: Stack-neutral knowledge for building user interface tasks - pages, components, forms, state, accessibility, texts - with UI tests. Used by agjan teams in build and fix work; project conventions and the area skills win over it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ui-developer
|
|
7
|
+
|
|
8
|
+
You implement user interface tasks against the contracts the design decided: pages,
|
|
9
|
+
components, forms and their behavior, each with tests that prove its acceptance criteria.
|
|
10
|
+
The task's paths, the design's decisions, the project's conventions and the skills of the
|
|
11
|
+
task's area (`npx agjan areas`) win over these defaults.
|
|
12
|
+
|
|
13
|
+
## Before you write code
|
|
14
|
+
|
|
15
|
+
- Read the task, its ACs, the design's UI decisions and the API it uses. Use the project's
|
|
16
|
+
framework, component library, styling and state patterns; a new UI dependency is a design
|
|
17
|
+
decision, not a build choice.
|
|
18
|
+
- Change only the task's paths (and the area's implicit files, such as text bundles).
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
1. **The server decides.** The UI shows and hides actions for a better experience, but
|
|
23
|
+
never as the only check: what the server refuses, the UI handles with a clear message.
|
|
24
|
+
2. **Every state is designed**: loading, empty, error, partial data, no permission, and the
|
|
25
|
+
success feedback after an action. A destructive action asks for confirmation.
|
|
26
|
+
3. **Forms validate early and explain**: required fields, formats and limits are shown at
|
|
27
|
+
the field; the server's validation errors appear next to the field they concern.
|
|
28
|
+
4. **Accessible by default**: every control has a label, works with the keyboard in a
|
|
29
|
+
logical order, has visible focus, and meets contrast; images carry text alternatives;
|
|
30
|
+
status changes are announced. Use the component library's accessible components instead
|
|
31
|
+
of hand-built ones.
|
|
32
|
+
5. **No hard-coded texts.** Every user-visible text goes into the project's text bundle or
|
|
33
|
+
translation files; dates, numbers and currencies use the user's locale.
|
|
34
|
+
6. **State stays simple**: derive what can be derived, keep server data in one place, and
|
|
35
|
+
refresh what an action changed instead of reloading everything.
|
|
36
|
+
7. **Large lists page or virtualize**; never load every record to filter in the browser.
|
|
37
|
+
8. **No secrets or business rules in the client**: anything shipped to the browser is
|
|
38
|
+
public.
|
|
39
|
+
|
|
40
|
+
## Tests
|
|
41
|
+
|
|
42
|
+
- For each AC that a user performs on a page (open, create, edit, choose an action), a UI
|
|
43
|
+
test that does it the way the user does, named with the AC id, plus the unhappy path the
|
|
44
|
+
AC implies (invalid input, missing permission).
|
|
45
|
+
- Prefer selectors by role and label over CSS paths; a test that needs a test id gets one
|
|
46
|
+
in the code.
|
|
47
|
+
- Run the UI tests (`npx agjan ui-test` where the project has them); where no browser can
|
|
48
|
+
start, say so instead of installing system libraries.
|
package/kit/templates/project.md
CHANGED
|
@@ -5,22 +5,11 @@ the real files; do not copy them.
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Services, key entities, authentication, external dependencies.
|
|
11
|
-
|
|
12
|
-
## Fiori
|
|
13
|
-
|
|
14
|
-
Each application: its folder, `app_type` (elements or freestyle), the service it uses.
|
|
15
|
-
|
|
16
|
-
## BTP
|
|
17
|
-
|
|
18
|
-
Runtime, BTP services, deployment targets.
|
|
19
|
-
|
|
8
|
+
{{areas}}
|
|
20
9
|
## Run locally
|
|
21
10
|
|
|
22
|
-
How to start the application and try it: the command
|
|
23
|
-
|
|
11
|
+
How to start the application and try it: the start command, the URLs of its pages or
|
|
12
|
+
endpoints, and the test users with their roles and passwords.
|
|
24
13
|
|
|
25
14
|
## Conventions
|
|
26
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agjan",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
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",
|