agjan 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,8 +86,9 @@ Approval commands are meant for humans in a terminal. agjan makes it hard for an
86
86
  to run them (instructions, deny rules and hooks, and a confirmation read from the
87
87
  terminal), but a model with unrestricted shell access could in principle get around
88
88
  that. The trust boundary is the reviewed merge of the pull request; branch protection
89
- with the required `agjan-check` status and CODEOWNERS are the recommended hardening.
90
- See section 9.4 of the design.
89
+ with the required `agjan-check` status and CODEOWNERS are the recommended hardening
90
+ ([guide](docs/guide.md#protecting-the-main-branch-on-github-optional)). See section 9.4
91
+ of the design.
91
92
 
92
93
  ## Contributing
93
94
 
package/docs/guide.md CHANGED
@@ -10,7 +10,7 @@ in the [design](design.md); this guide is about using it.
10
10
  - [Commands](#commands)
11
11
  - [Configuration](#configuration)
12
12
  - [Hosts](#hosts)
13
- - [CI and repository settings](#ci-and-repository-settings)
13
+ - [Protecting the main branch on GitHub](#protecting-the-main-branch-on-github-optional)
14
14
  - [Upgrading](#upgrading)
15
15
  - [Troubleshooting](#troubleshooting)
16
16
 
@@ -48,14 +48,21 @@ Then:
48
48
 
49
49
  1. Open the project in Claude Code once and **trust the folder**: the reviewer's tools
50
50
  load only in a trusted folder. Allow the project MCP servers when asked (`cap`, `ui5`,
51
- `fiori`: documentation tools for the role skills).
52
- 2. Follow what `init` printed for branch protection and CODEOWNERS (see
53
- [CI and repository settings](#ci-and-repository-settings)).
51
+ `fiori`: documentation tools for the role skills). In GitHub Copilot CLI, answer
52
+ "Do you trust the files in this folder?" with **"Yes, and remember this folder for
53
+ future sessions"**: with plain "Yes", Copilot does not load the MCP servers in
54
+ `.mcp.json`. `/mcp` (or `copilot mcp list`) then shows them under the workspace
55
+ servers; `npx agjan doctor` warns when the folder is not remembered.
56
+ 2. Later, when a team shares the repository on GitHub, consider
57
+ [protecting the main branch](#protecting-the-main-branch-on-github-optional)
58
+ (optional).
54
59
  3. For an existing application, run `/agjan-map` once (see below).
55
60
 
56
61
  ## The workflow
57
62
 
58
- Each feature on a branch of its own.
63
+ Each feature on a branch of its own. When one is needed, the agent asks you: create the
64
+ name it proposes, use a branch that already exists (it lists them), or provide a new
65
+ name (it confirms the name before creating the branch).
59
66
 
60
67
  **Spec**: in Claude Code or Copilot:
61
68
 
@@ -115,8 +122,9 @@ records (step, review, approval, amendment, fix record):
115
122
 
116
123
  `npx agjan progress` regenerates the pages and prints the overview; `--open` opens the
117
124
  HTML page in your browser. A unit shows **your turn** when it waits for you: a gate to
118
- approve, an amendment, or the next skill to start (`/agjan-design`, `/agjan-build`,
119
- `/agjan-verify`; a skill counts as running once it logged its start). A verified feature
125
+ approve, an amendment, the next skill to start (`/agjan-design`, `/agjan-build`,
126
+ `/agjan-verify`; a skill counts as running once it logged its start), or the agent
127
+ stopped and needs you (it logs the reason with `npx agjan log --waiting`). A verified feature
120
128
  is **done**: trying it locally, manual checks and the pull request are optional next
121
129
  steps. `npx agjan status --done` prints just that block. Units already on the base branch appear in the overview but
122
130
  get no new page on another branch.
@@ -143,10 +151,10 @@ Run `npx agjan --help` for the full list.
143
151
  | Command | Who | Purpose |
144
152
  |---|---|---|
145
153
  | `init`, `sync [--force]` | you | set up; regenerate managed files after an upgrade |
146
- | `doctor` | anyone | check Node, git, versions, managed files, hook, CI, the MCP server, guards, trust |
154
+ | `doctor` | anyone | check Node, git, versions, managed files, hook, CI, the MCP server, guards, folder trust (Claude Code, Copilot CLI) |
147
155
  | `status [--feature <id> \| --all]` | anyone | state, blockers, tasks, due reviews, next step |
148
156
  | `progress [--open]` | anyone | regenerate the progress pages, print the overview, open the HTML page |
149
- | `branch <name>` | agent, or you with `git.branch.create: confirm` | create the branch of a unit |
157
+ | `branch <name>` · `--list` · `--use <name>` | agent, after asking you | create the branch of a unit, list the existing branches, or switch to one |
150
158
  | `check [--staged \| --ci] [--base <ref>]` | anyone, hook, CI | enforce the rules |
151
159
  | `review show [--step <step>]` | anyone | review records, or the material a reviewer gets |
152
160
  | `pr-summary`, `report` | anyone | PR description; `report.md` with time and tokens |
@@ -187,14 +195,13 @@ lists replace. The schema is `node_modules/agjan/schemas/config.schema.json`.
187
195
  | `domains` | enabled domains; phase 1 has `btp` (areas `cap`, `fiori`, `btp`) |
188
196
  | `hosts` | `claude-code`, `copilot`; decides which files `sync` generates |
189
197
  | `git.base` | the branch features merge into; default: the remote's default branch |
190
- | `git.branch.create` | who creates the branch of a feature, fix or map run: `agent` (default; the agent runs `npx agjan branch <name>`) or `confirm` (the agent proposes a name; a human runs `npx agjan branch <name>` in a terminal, may edit the name, and the guard hook blocks `git switch -c` and similar for agents) |
191
- | `git.branch.pattern` | a regular expression for branch names, for teams with naming rules: `agjan branch` refuses other names, `check` warns about them (an error with `--ci`) |
192
198
  | `verify.<area>` | `build`, `test`, `lint` commands for the skills; `results`: a JUnit XML, Jest or Mocha JSON file that `check` reads to require a passing test per AC |
199
+ | `lint.<area>` | the linter `npx agjan lint` runs in each folder `in` (for example `app/*`) on the changed files matching `files`; the btp domain sets the UI5 linter for `fiori`; `null` turns it off |
193
200
  | `tests.<area>`, `scope.implicit.<area>` | test file globs; files every task of the area may change (i18n, lockfiles, fixtures) |
194
201
  | `risk_paths` | paths whose change needs a review per task and are never a fix |
195
202
  | `fix` | `max_total`, `max_per_file`, `protected`, `ignored`, `new_file_paths` |
196
203
  | `review.build` | `area` (default: one build review per completed area) or `task` |
197
- | `review.rounds` | correction rounds per review step (default 3); after that, `status` tells the agent to stop and hand over to you |
204
+ | `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 |
198
205
  | `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 |
199
206
  | `build.fix_attempts` | attempts for failing deterministic checks before the agent stops (default 3) |
200
207
  | `language` | language of the documents' text (default `en`); headings, ids and keywords stay English |
@@ -259,24 +266,63 @@ Set `agent.script_edits` to `"allow"` in `agjan.config.json` to turn this off.
259
266
  Copilot keeps your own "don't ask again" answers per folder in
260
267
  `~/.copilot/permissions-config.json`; that file is personal and not part of the project.
261
268
 
262
- ## CI and repository settings
269
+ ## Protecting the main branch on GitHub (optional)
270
+
271
+ Not needed to work with agjan; recommended once a team shares the repository on GitHub.
272
+
273
+ **Why.** On your machine, agjan's checks (the pre-commit hook, the guard, `agjan check`)
274
+ make it hard for an agent to skip a step, but a model with full shell access could get
275
+ around them in principle. What reaches `main` is decided when a pull request is merged,
276
+ so that is where the last check belongs.
277
+
278
+ **What agjan already adds.** `init` creates `.github/workflows/agjan.yml`, a GitHub
279
+ Actions workflow. On every pull request, GitHub runs `agjan check --ci` and shows the
280
+ result as a check named **agjan-check** on the pull request: green, or red with the
281
+ reason (a document changed after its approval, code outside the approved paths, a stale
282
+ final review). It uses the agjan version pinned on `main`, so a pull request cannot
283
+ bring its own, weaker checker.
284
+
285
+ **What you turn on.** By default, GitHub lets you merge even when a check is red. A
286
+ *branch rule* makes the check, and a review, required:
287
+
288
+ 1. Push the repository to GitHub and open one pull request, so that the check has run
289
+ once and GitHub knows its name.
290
+ 2. In the repository: **Settings → Rules → Rulesets → New ruleset → New branch ruleset**.
291
+ Name it, set **Enforcement status** to *Active*, and under **Target branches** add the
292
+ default branch.
293
+ 3. Turn on **Require a pull request before merging**, with 1 required approval.
294
+ 4. Turn on **Require status checks to pass**, choose **Add checks** and select
295
+ `agjan-check`.
296
+ 5. Save. A pull request with a red `agjan-check`, or one that removes the workflow (the
297
+ check then never reports), can no longer be merged.
298
+
299
+ **Optionally, owners for the rules.** A `CODEOWNERS` file names who must review changes
300
+ to certain files. With **Require review from Code Owners** turned on in the same rule,
301
+ changes to agjan's configuration, approvals, hooks and workflows need your review.
302
+ Create `.github/CODEOWNERS` (replace `@<owner>` with your GitHub user or team):
263
303
 
264
- `init` creates `.github/workflows/agjan.yml`. On every pull request it runs
265
- `agjan check --ci` with the agjan version **pinned on the base branch**, fetched from
266
- the registry, so a pull request cannot change the checker that checks it.
267
-
268
- Recommended settings for the base branch:
304
+ ```text
305
+ # agjan: changes to the rules need an owner's review
306
+ /agjan.config.json @<owner>
307
+ /agjan.lock.json @<owner>
308
+ /docs/agjan/**/approvals.json @<owner>
309
+ /.claude/ @<owner>
310
+ /.github/agents/ @<owner>
311
+ /.github/hooks/ @<owner>
312
+ /.github/workflows/ @<owner>
313
+ /package.json @<owner>
314
+ /package-lock.json @<owner>
315
+ ```
269
316
 
270
- - branch protection with the status check **`agjan-check`** required, and a required
271
- review;
272
- - CODEOWNERS for the files that change the rules (`init` prints a block):
273
- `agjan.config.json`, `agjan.lock.json`, `docs/agjan/**/approvals.json`, `.claude/`,
274
- `.github/agents/`, `.github/hooks/`, `.github/workflows/`, `package.json`,
275
- `package-lock.json`.
317
+ Good to know:
276
318
 
277
- The trust boundary is the reviewed merge. The approval commands are guardrails, not a
278
- proof that a human approved: a model with unrestricted shell access could get around
279
- them in principle.
319
+ - GitHub Actions minutes: private repositories have a monthly quota. When it is used up,
320
+ the check cannot run, and a required check blocks every merge until the quota resets
321
+ (or an admin bypasses the rule). Public repositories are not affected.
322
+ - Working alone: GitHub does not let you approve your own pull request. Leave the
323
+ required review off, or add yourself to the rule's **Bypass list**.
324
+ - The approval commands are guardrails, not proof that a human approved; the reviewed
325
+ merge is the trust boundary.
280
326
 
281
327
  ## Upgrading
282
328
 
@@ -292,6 +338,7 @@ Commit the result in a pull request of its own: CI reports it as a policy change
292
338
 
293
339
  | Symptom | Cause and fix |
294
340
  |---|---|
341
+ | Copilot shows only `github-mcp-server`, not `cap`, `ui5`, `fiori` | The folder is not remembered as trusted (`doctor`: copilot trust). Restart `copilot` in the folder and choose "Yes, and remember this folder for future sessions", or add the folder to `trustedFolders` in `~/.copilot/config.json` while Copilot is closed. `/add-dir` does not help: it only allows file access. |
295
342
  | The reviewer has no `review_context` tool | Claude Code: the folder is not trusted yet (`doctor` says so); open it once and accept. Copilot CLI: trust the folder when asked. |
296
343
  | `approve` says it needs a human at an interactive terminal | It was run without a terminal, for example by an agent. Run it yourself in a terminal. |
297
344
  | `approve` refuses: the review did not see the current files | Something changed after the last review; let the agent ask for the review again. |
@@ -12,7 +12,8 @@
12
12
  "role": "fiori-developer",
13
13
  "tests": ["app/*/webapp/test/**", "app/*/test/**"],
14
14
  "implicit": ["app/*/package.json", "app/*/package-lock.json", "app/*/webapp/i18n/**"],
15
- "verify": {}
15
+ "verify": {},
16
+ "lint": { "command": "npx --yes @ui5/linter", "in": "app/*", "files": "webapp/**" }
16
17
  },
17
18
  "btp": {
18
19
  "role": "btp-architect",
@@ -41,12 +41,13 @@ const REASON =
41
41
  const HUMAN_ONLY = /\bagjan(?:\.mjs)?["']?\s+(?:--\s+)?["']?(approve|accept|reject)\b/;
42
42
 
43
43
  const BRANCH_REASON =
44
- 'In this project a human creates branches (git.branch.create: confirm in agjan.config.json). Propose a branch name and ask the user to run in a terminal: npx agjan branch <name>';
44
+ 'Create branches with npx agjan branch, not with git. Ask the user first: create the proposed name, use an existing branch (npx agjan branch --list, then npx agjan branch --use <name>), or another name.';
45
45
 
46
46
  /**
47
47
  * Commands that create or rename a branch: git switch -c/-C, git checkout -b/-B/--orphan,
48
- * git branch <name> (also -m/-c), git worktree add -b. Denied when git.branch.create is
49
- * "confirm" (design decision 62); git options such as `-C <dir>` may come before.
48
+ * git branch <name> (also -m/-c), git worktree add -b. Always denied: agents create branches
49
+ * with npx agjan branch after asking the user (design decision 62); git options such as
50
+ * `-C <dir>` may come before.
50
51
  */
51
52
  const BRANCH_CREATE = new RegExp(
52
53
  String.raw`\bgit(?:\s+-[cC]\s+\S+|\s+--[\w-]+(?:=\S+)?)*\s+` +
@@ -213,7 +214,7 @@ export function decide(payload, config = {}, root = process.env.CLAUDE_PROJECT_D
213
214
  const command = payload?.toolArgs?.command ?? payload?.tool_input?.command;
214
215
  if (typeof command !== 'string') return null;
215
216
  if (HUMAN_ONLY.test(command)) return answer(payload, 'deny', REASON);
216
- if (config?.git?.branch?.create === 'confirm' && BRANCH_CREATE.test(command)) return answer(payload, 'deny', BRANCH_REASON);
217
+ if (BRANCH_CREATE.test(command)) return answer(payload, 'deny', BRANCH_REASON);
217
218
  if (config?.agent?.script_edits !== 'allow' && SCRIPT_EDITS.some((matches) => matches(command))) return answer(payload, 'deny', EDIT_REASON);
218
219
  const allow = config?.agent?.allow ?? [];
219
220
  const shell = /^(bash|powershell|shell)$/i.test(payload.toolName ?? payload.tool_name ?? '');
@@ -36,7 +36,8 @@ Repeat until `npx agjan status` says `next: all tasks done and reviewed`:
36
36
  `Review step build:<area or task> of feature <slug>.` The work must be committed
37
37
  first. Read the result with `npx agjan review show`; fix
38
38
  blockers in a new commit with the same task subject prefix, then ask for the review
39
- again, up to the round limit that `npx agjan status` shows (default 3); if blockers remain, stop and tell the user.
39
+ again, up to the round limit that `npx agjan status` shows (default 3).
40
+ If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend <step>` and continue; on `Stop here`, stop and tell the user. (`<step>` is the step under review, for example `build:fiori`.)
40
41
 
41
42
  ## 3. When a file outside the paths is needed
42
43
 
@@ -72,7 +72,7 @@ Run `npx agjan check` and fix every error.
72
72
  When all your edits are saved, delegate, on its own (not in parallel with other tool calls), to the reviewer agent that `npx agjan status` names for the step (default `agjan-reviewer-deep`), with exactly this prompt (Claude Code: the Agent tool with that subagent type; GitHub Copilot: the task tool with that custom agent and a short `name`, for example `spec review`):
73
73
  `Review step design of feature <slug>.`
74
74
 
75
- Read the result with `npx agjan review show`. With minor notes only, leave them open and go on to the gate (a change would need another round). Fix blockers (and majors where you agree) and re-review, up to the round limit that `npx agjan status` shows (default 3); if blockers remain, stop and tell the user. Never edit review files or review
75
+ Read the result with `npx agjan review show`. With minor notes only, leave them open and go on to the gate (a change would need another round). Fix blockers (and majors where you agree) and re-review, up to the round limit that `npx agjan status` shows (default 3). If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend design` and continue; on `Stop here`, stop and tell the user. Never edit review files or review
76
76
  yourself. Any change after a review needs a new review; make no edits after the last
77
77
  passing one.
78
78
 
@@ -20,9 +20,22 @@ change, or a business decision: stop and recommend `/agjan-spec`.
20
20
 
21
21
  ## 2. Start
22
22
 
23
- Work on a branch of its own, without features. If you are on the base branch, create
24
- it with `npx agjan branch <name>`, or, when `npx agjan status` says a human creates
25
- branches, propose the name and ask the user to run that command; never with git directly.
23
+ Work on a branch of its own, without features. If you are on the base branch,
24
+ ask the user one question with your host's question tool. Offer exactly these three
25
+ choices, with these labels; do not merge them into one free-text question:
26
+
27
+ "Work needs its own branch. Create one, or use an existing branch?"
28
+
29
+ 1. `Create branch "<name>"`: your proposal (following the team's naming rule if
30
+ AGENTS.md names one). Run `npx agjan branch <name>`.
31
+ 2. `Use an existing branch`: run `npx agjan branch --list`, ask which one (offer the
32
+ names as choices), then run `npx agjan branch --use <picked>`.
33
+ 3. `Provide new branch name`: ask for the name, then confirm it in a second question,
34
+ `Create branch "<their name>"?` with the choices `Yes, create it` and
35
+ `No, change the name`. Run `npx agjan branch <their name>` only after yes.
36
+ If `agjan branch` refuses a name (invalid, already exists), say why and ask again.
37
+ Never create or switch branches with git directly.
38
+
26
39
  Pick a slug and a key of 2 to 6 capitals:
27
40
 
28
41
  `npx agjan fix start <slug> --key <KEY> --what "<one sentence: what the fix changes>"`
@@ -40,7 +53,7 @@ Pick a slug and a key of 2 to 6 capitals:
40
53
  When all your edits are saved, delegate, on its own (not in parallel with other tool calls), to the reviewer agent that `npx agjan status` names for the step (default `agjan-reviewer`), with exactly this prompt (Claude Code: the Agent tool with that subagent type; GitHub Copilot: the task tool with that custom agent and a short `name`, for example `spec review`):
41
54
  `Review step fix of feature fixes/<id>.` (the id is the folder name under
42
55
  `docs/agjan/fixes/`). Read the result with `npx agjan review show`. Fix blockers in a
43
- new commit and review again, up to the round limit that `npx agjan status` shows (default 3); then stop and tell the user. Make no
56
+ new commit and review again, up to the round limit that `npx agjan status` shows (default 3). If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend fix` and continue; on `Stop here`, stop and tell the user. Make no
44
57
  change after the last passing review.
45
58
 
46
59
  ## 5. Record and hand over
@@ -10,9 +10,23 @@ The merge of this branch is its approval.
10
10
 
11
11
  ## 1. Start
12
12
 
13
- On a branch of its own, without features or fixes (create it with
14
- `npx agjan branch <name>`, or ask the user to when `npx agjan status` says a human
15
- creates branches; never with git directly):
13
+ On a branch of its own, without features or fixes. If you are on the base branch,
14
+ ask the user one question with your host's question tool. Offer exactly these three
15
+ choices, with these labels; do not merge them into one free-text question:
16
+
17
+ "Work needs its own branch. Create one, or use an existing branch?"
18
+
19
+ 1. `Create branch "<name>"`: your proposal (following the team's naming rule if
20
+ AGENTS.md names one). Run `npx agjan branch <name>`.
21
+ 2. `Use an existing branch`: run `npx agjan branch --list`, ask which one (offer the
22
+ names as choices), then run `npx agjan branch --use <picked>`.
23
+ 3. `Provide new branch name`: ask for the name, then confirm it in a second question,
24
+ `Create branch "<their name>"?` with the choices `Yes, create it` and
25
+ `No, change the name`. Run `npx agjan branch <their name>` only after yes.
26
+ If `agjan branch` refuses a name (invalid, already exists), say why and ask again.
27
+ Never create or switch branches with git directly.
28
+
29
+ Then:
16
30
 
17
31
  `npx agjan map start`
18
32
 
@@ -44,6 +58,7 @@ user if unsure. These paths are protected for `/agjan-fix`.
44
58
  2. When all your edits are saved, delegate, on its own (not in parallel with other tool calls), to the reviewer agent that `npx agjan status` names for the step (default `agjan-reviewer`), with exactly this prompt (Claude Code: the Agent tool with that subagent type; GitHub Copilot: the task tool with that custom agent and a short `name`, for example `spec review`):
45
59
  `Review step map of feature maps/<id>.` Read the result with `npx agjan review show`;
46
60
  fix blockers and review again, up to the round limit that `npx agjan status` shows (default 3).
61
+ If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend map` and continue; on `Stop here`, stop and tell the user.
47
62
  3. Commit `docs/agjan/`. `npx agjan check --ci` must pass.
48
63
  4. Tell the user it is ready for a PR; the merge approves the baseline.
49
64
 
@@ -14,11 +14,21 @@ design. You write; the agjan reviewer checks; the human approves.
14
14
  Run `npx agjan status`. If a feature is already in progress on this branch, continue
15
15
  it instead of starting a new one. Otherwise:
16
16
 
17
- - If you are on the base branch, the work needs a branch of its own. The settings line
18
- of `npx agjan status` says who creates it. Propose a name (and follow the branch
19
- pattern if it names one): if the agent creates branches, run `npx agjan branch <name>`;
20
- if a human does, ask the user to run `npx agjan branch <name>` in their terminal (they
21
- may edit the name) and stop until they did. Never create branches with git directly.
17
+ - If you are on the base branch, the work needs a branch of its own. Ask the user one
18
+ question with your host's question tool. Offer exactly these three choices, with these
19
+ labels; do not merge them into one free-text question:
20
+ "Work needs its own branch. Create one, or use an existing branch?"
21
+ 1. `Create branch "<name>"`: your proposal (following the team's naming rule if
22
+ AGENTS.md names one). Run `npx agjan branch <name>`.
23
+ 2. `Use an existing branch`: run `npx agjan branch --list`, ask which one (offer the
24
+ names as choices), then run `npx agjan branch --use <picked>`.
25
+ 3. `Provide new branch name`: ask for the name, then confirm it in a second question,
26
+ `Create branch "<their name>"?` with the choices `Yes, create it` and
27
+ `No, change the name`. Run `npx agjan branch <their name>` only after yes.
28
+ If `agjan branch` refuses a name (invalid, already exists), say why and ask again.
29
+ Never create or switch branches with git directly.
30
+ After switching, run `npx agjan status` again: an existing branch may already carry a
31
+ feature to continue.
22
32
  - Pick a slug (lowercase, `-`, short: `order-status-filter`) and a key of 2 to 6
23
33
  capitals (`OSF`).
24
34
  - `npx agjan new <slug> --key <KEY>`
@@ -62,8 +72,8 @@ cannot be skipped (`npx agjan doctor` shows why).
62
72
  Then run `npx agjan review show`:
63
73
 
64
74
  - `blocked`: fix every blocker in `spec.md` (and majors where you agree), then ask for
65
- the review again, up to the round limit that `npx agjan status` shows (default 3). If blockers remain, stop and tell the user which
66
- ones and why; do not continue.
75
+ the review again, up to the round limit that `npx agjan status` shows (default 3).
76
+ If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend <step>` and continue; on `Stop here`, stop and tell the user. (`<step>` is `spec`, or `design:light` for a light design.) Never go on to the gate while blockers are open.
67
77
  - `pass-with-notes`: fix majors where you agree and ask for another round. With minor
68
78
  notes only, leave them open and go on to the gate: changing the spec for them would
69
79
  need another round.
@@ -16,7 +16,7 @@ tell the user what is open. Then `npx agjan log --stage verify --skill agjan-ver
16
16
  ## 2. Full checks
17
17
 
18
18
  Run every area's build, test and lint commands from `agjan.config.json` (else
19
- `npm test`). Where an area configures `results`, its test command writes that file;
19
+ `npm test`), and `npx agjan lint` (the UI5 linter for Fiori apps). Where an area configures `results`, its test command writes that file;
20
20
  `agjan check` then requires a passing test for every automated AC, so run the tests
21
21
  again after the last change. Fix failures within the approved task paths and commit them with the
22
22
  subject of the task they belong to (`<KEY>-<id>: …`). A fix makes that area's build
@@ -37,7 +37,8 @@ Everything must be committed. When all your edits are saved, delegate, on its ow
37
37
  `Review step verify of feature <slug>.`
38
38
 
39
39
  Read the result with `npx agjan review show`. If it is blocked, fix the blockers in new
40
- commits and ask for the review again, up to the round limit that `npx agjan status` shows (default 3); then stop and tell the user.
40
+ commits and ask for the review again, up to the round limit that `npx agjan status` shows (default 3).
41
+ If blockers remain at the limit, ask the user with your host's question tool, naming the open blockers, with the choices `Run another round` and `Stop here`. On `Run another round`, run `npx agjan review extend verify` and continue; on `Stop here`, stop and tell the user.
41
42
  Any change after the final review makes it stale; review again after the last change.
42
43
 
43
44
  ## 5. Check and summary
@@ -20,11 +20,15 @@ baseline `docs/agjan/project.md`, the apps that exist) win over these defaults.
20
20
  - Fiori MCP server: `search_docs` for Fiori elements, annotations and Fiori tools;
21
21
  `list_functionality` and `get_functionality_details` to see how an existing app can
22
22
  be changed.
23
- 3. Use the checks whenever they are available: `run_ui5_linter` after a change,
24
- `run_manifest_validation` after a change to `manifest.json`.
25
- 4. Offline or without the tools: follow the skill and the patterns already in the app,
26
- and say in your output which question could not be checked and that the linter did
27
- not run.
23
+ 3. Run `npx agjan lint` after every change to an app. It runs the UI5 linter (no MCP
24
+ server needed) in each app folder with changed files, on those files;
25
+ it also checks `manifest.json`. Fix what it reports in the files your task changed.
26
+ A finding that needs a wider change (migrating `manifest.json` to version 2, raising
27
+ `minUI5Version`) is not part of the task unless the task says so: report it. If the
28
+ linter cannot run (offline), say so in your output.
29
+ 4. When the Fiori MCP server is available, also run `run_manifest_validation` after a
30
+ change to `manifest.json`. Without the documentation tools, follow the skill and the
31
+ patterns already in the app, and say which question could not be checked.
28
32
 
29
33
  Generator and modification tools (`create_ui5_app`, `generate_fiori_app_*`,
30
34
  `execute_functionality`) change files: use them only for a task whose approved `paths`
@@ -61,5 +65,5 @@ then building blocks or custom sections and columns, and controller extensions l
61
65
  - Authorization lives in the service, never in the UI; the UI only hides what the service
62
66
  already forbids.
63
67
  - Texts in i18n files, in every locale the app has.
64
- - After a change: `run_ui5_linter`, `run_manifest_validation` (if `manifest.json` changed),
65
- the tests, then `npx agjan check`.
68
+ - After a change: `npx agjan lint`, `run_manifest_validation` (if `manifest.json` changed
69
+ and the Fiori MCP server is available), the tests, then `npx agjan check`.
@@ -121,7 +121,7 @@ sap.ui.define(['sap/fe/core/AppComponent'], (AppComponent) => AppComponent.exten
121
121
 
122
122
  ## Check
123
123
 
124
- 1. `run_manifest_validation` on `webapp/manifest.json` and `run_ui5_linter` on the app
125
- folder (UI5 MCP server): no findings.
124
+ 1. `npx agjan lint` (the UI5 linter on the app's changed files) and, with the Fiori MCP
125
+ server, `run_manifest_validation` on `webapp/manifest.json`: no findings.
126
126
  2. `npx cds watch`, open the app as each role of the spec (a private window per user),
127
127
  and try what the ACs describe, including buttons and messages.
@@ -29,4 +29,5 @@ MCP server and from the UI5 MCP server's guidelines (Apache-2.0), retrieved on
29
29
 
30
30
  ## After every UI change
31
31
 
32
- - `run_ui5_linter` and `run_manifest_validation` (UI5 MCP server), then the tests.
32
+ - `npx agjan lint` (the UI5 linter), `run_manifest_validation` if the Fiori MCP server is
33
+ available, then the tests.
@@ -47,7 +47,7 @@ Distilled from the UI5 MCP server's development guidelines (`get_guidelines`,
47
47
  ## Tools
48
48
 
49
49
  - `get_api_reference` for any control or API, for the UI5 version of the project.
50
- - `run_ui5_linter` after every change (deprecated APIs, accessibility, bugs); use its
51
- `fix` option only after asking the user, then run it again.
50
+ - `npx agjan lint` after every change (deprecated APIs, accessibility, bugs, `manifest.json`).
51
+ Never run the linter's `--fix`; fix findings in your editor.
52
52
  - `run_manifest_validation` after every change to `manifest.json`.
53
53
  - The UI5 tooling server serves no default file: open `…/index.html`, not `…/`.
@@ -18,14 +18,24 @@ Rules for agents:
18
18
  results.
19
19
  - During Build, change only files within the approved task paths; otherwise revert, or
20
20
  propose `npx agjan amend`.
21
- - Create branches only with `npx agjan branch <name>`, never with git directly. When
22
- `npx agjan status` says a human creates branches, propose the name and ask the user.
21
+ - Branches: ask the user first (create your proposed name, use an existing branch, or
22
+ provide a new name, confirmed before creating), then use `npx agjan branch <name>`, `--list` or `--use <name>`; never
23
+ git directly.
23
24
  - Run commands from the project root; do not `cd` into folders. Edit files with your
24
25
  editor tool, not with scripts. Check behavior with the project's tests (add one if
25
26
  needed), not with throwaway scripts.
26
27
  - After a review, fix blockers, and majors where you agree. Minor findings may stay open
27
28
  (the PR summary lists them): do not spend a review round on minor findings alone. Any
28
29
  change after a review needs another round before the gate.
30
+ - Never choose a commit subject, split or squash commits, or delay a commit to avoid a
31
+ review that would be due. When a step is still blocked at its round limit, ask the
32
+ user whether to run another round (`npx agjan review extend <step>` after a yes).
29
33
  - Start a review only when all your edits are saved, and on its own: never in parallel
30
34
  with other tool calls. The reviewer must see the finished change.
31
35
  - Run `npx agjan check` before you report a step as done.
36
+ - When you stop in the middle of a skill to wait for the user (an error you cannot
37
+ resolve, a decision, an action only they can take, a limit reached), first run
38
+ `npx agjan log --waiting "<what the user must do, in one sentence>"`, so the progress
39
+ pages show it is their turn. When you continue, log the step again
40
+ (`npx agjan log --stage <stage> …`). Gates need no extra event: `--gate-requested`
41
+ covers them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agjan",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Spec-driven workflow kit for AI coding agents, with human approval gates and a read-only reviewer at every step.",
5
5
  "keywords": [
6
6
  "ai",
@@ -13,21 +13,7 @@
13
13
  "git": {
14
14
  "type": "object",
15
15
  "properties": {
16
- "base": { "type": ["string", "null"] },
17
- "branch": {
18
- "type": "object",
19
- "properties": {
20
- "create": {
21
- "description": "Who creates branches: 'agent' (default; with npx agjan branch) or 'confirm' (the agent proposes a name, a human runs npx agjan branch in a terminal and may edit it).",
22
- "enum": ["agent", "confirm"]
23
- },
24
- "pattern": {
25
- "description": "Regular expression every branch name must match (npx agjan branch refuses others; check reports them).",
26
- "type": ["string", "null"]
27
- }
28
- },
29
- "additionalProperties": false
30
- }
16
+ "base": { "type": ["string", "null"] }
31
17
  },
32
18
  "additionalProperties": false
33
19
  },
@@ -57,6 +43,21 @@
57
43
  "additionalProperties": false
58
44
  }
59
45
  },
46
+ "lint": {
47
+ "description": "Linters that agjan lint runs per area, in every folder matching 'in' with changed files matching 'files'; null turns an area's linter off.",
48
+ "type": "object",
49
+ "additionalProperties": {
50
+ "oneOf": [
51
+ { "type": "null" },
52
+ {
53
+ "type": "object",
54
+ "required": ["command", "in", "files"],
55
+ "properties": { "command": { "type": "string" }, "in": { "type": "string" }, "files": { "type": "string" } },
56
+ "additionalProperties": false
57
+ }
58
+ ]
59
+ }
60
+ },
60
61
  "build": { "type": "object", "properties": { "fix_attempts": { "type": "integer", "minimum": 0 } }, "additionalProperties": false },
61
62
  "review": {
62
63
  "type": "object",
@@ -7,7 +7,7 @@
7
7
  "required": ["at_utc", "event"],
8
8
  "properties": {
9
9
  "at_utc": { "type": "string" },
10
- "event": { "enum": ["step", "gate-requested", "approved", "rejected", "accepted", "amendment-proposed", "review-recorded"] },
10
+ "event": { "enum": ["step", "gate-requested", "approved", "rejected", "accepted", "amendment-proposed", "review-recorded", "round-granted", "waiting"] },
11
11
  "stage": { "enum": ["map", "spec", "design", "build", "verify", "fix"] },
12
12
  "role": { "type": "string" },
13
13
  "task": { "type": "string" },
@@ -15,6 +15,7 @@
15
15
  "host": { "type": "string" },
16
16
  "configured_model": { "type": "string" },
17
17
  "gate": { "type": "string" },
18
+ "reason": { "type": "string" },
18
19
  "amendment": { "type": "string" },
19
20
  "finding": { "type": "string" },
20
21
  "severity": { "type": "string" },
package/src/cli.mjs CHANGED
@@ -14,6 +14,7 @@ import * as fix from './commands/fix.mjs';
14
14
  import * as mapCommand from './commands/map.mjs';
15
15
  import * as branch from './commands/branch.mjs';
16
16
  import * as progress from './commands/progress.mjs';
17
+ import * as lint from './commands/lint.mjs';
17
18
  import { onEvent } from './log.mjs';
18
19
  import { refreshAfterEvent } from './progress-view.mjs';
19
20
 
@@ -28,11 +29,12 @@ const COMMANDS = {
28
29
  scaffold: newCommand.scaffold,
29
30
  status: status.run,
30
31
  check: check.run,
32
+ lint: lint.run,
31
33
  amend: gates.amend,
32
34
  approve: gates.approve,
33
35
  accept: gates.accept,
34
36
  reject: gates.reject,
35
- review: review.show,
37
+ review: review.run,
36
38
  log: log.run,
37
39
  'pr-summary': prSummary.run,
38
40
  report: report.run,
@@ -58,8 +60,9 @@ Setup (human):
58
60
  doctor check the environment and the project setup
59
61
 
60
62
  Agent and human:
61
- branch <name> create the branch for a feature, fix or map run (with
62
- git.branch.create "confirm": a human, who may edit the name)
63
+ branch <name> | --list | --use <name>
64
+ create the branch for a feature, fix or map run, list
65
+ the existing ones, or switch to one (after asking the user)
63
66
  new <slug> --key <KEY> create a feature folder with approvals.json and spec.md
64
67
  scaffold design create design.md and tasks.md from the templates
65
68
  progress [--open] regenerate the progress pages and show the overview
@@ -68,6 +71,8 @@ Agent and human:
68
71
  show the state of the changed (or every) feature
69
72
  check [--staged | --ci] [--base <ref>]
70
73
  enforce the workflow rules
74
+ lint [--all] [--base <ref>] run the area linters (UI5 linter for fiori) on the changed
75
+ files of each app, without MCP
71
76
  amend --task <id> --paths <p,...> --reason "<why>"
72
77
  propose a scope amendment during Build
73
78
  fix start <slug> --key <KEY> --what "<text>" | fix check | fix record [--verify "…"]
@@ -75,6 +80,8 @@ Agent and human:
75
80
  map start start mapping an existing application (project.md)
76
81
  baseline refresh record the watched files in baseline.json
77
82
  review show [--step <step>] list review records, or print a step's review context
83
+ review extend <step> one more round for a step still blocked at its round
84
+ limit (after the user said yes)
78
85
  log --stage <stage> [--role r] [--task T1] [--skill s]
79
86
  log --gate-requested <gate> [--message "<commit message>"]
80
87
  record a step start or a gate handed to the human