@k0t0vich/meta-agents-template 0.1.10 → 0.1.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## 0.1.12 - 2026-03-20
6
+
7
+ ### Added
8
+ - Added hard docs-first law in canonical rules: no code before PRD + architecture + verification matrix.
9
+ - Added explicit scope-control rule: if dialogue exits current task scope, agent must propose creating a task or finishing current one before coding.
10
+ - Added mandatory verification matrix fields for task artifacts: `tests_unit`, `tests_system`, `tests_e2e_playwright`, `external_analysis`.
11
+
12
+ ### Changed
13
+ - Upgraded `meta:ops` runtime flow to execute governance verification before operational commands.
14
+ - Expanded GitHub issue body validation for `SET_STATUS -> IN_PROGRESS` and implementation gate to require `Architecture`, `Verification Plan`, and extended verification rows.
15
+ - Updated governance prompts and templates to enforce docs-first execution discipline.
16
+
17
+ ### Fixed
18
+ - Eliminated policy/runtime gap where code-stage commands could start without task-scoped docs-first validation.
19
+
20
+ ## 0.1.11 - 2026-03-20
21
+
22
+ ### Added
23
+ - Added a hard pre-implementation command `VERIFY_IMPLEMENTATION_GATE` to enforce task readiness before coding starts.
24
+ - Added canonical Status Agent output contract (6 required sections) and corresponding smoke validation.
25
+ - Added robust empty-repository branch-routing behavior for `meta:task-start --apply` (no-commit bootstrap path).
26
+
27
+ ### Fixed
28
+ - Fixed TrackerGateway local script resolution for `PREPARE_TASK_BRANCH`, `RUN_MR_REVIEW_GATE`, and `VERIFY_IMPLEMENTATION_GATE` in npm-linked execution mode.
29
+ - Enforced structured verifiability schema (`strict`, `statistical`, `human`) for task creation and `SET_STATUS -> IN_PROGRESS`.
30
+ - Expanded local post-publish smoke checks for source repo, generated project, and unborn repository scenarios.
31
+
5
32
  ## 0.1.10 - 2026-03-20
6
33
 
7
34
  ### Fixed
package/README.md CHANGED
@@ -83,13 +83,14 @@ my-project/
83
83
  1. `CREATE_TASK`
84
84
  2. `PREPARE_TASK_BRANCH`
85
85
  3. `SET_STATUS`
86
- 4. `RUN_REVIEW_GATE`
87
- 5. `COMMIT_BY_NAME`
88
- 6. `RUN_MR_REVIEW_GATE`
89
- 7. `ASSIGN_SPRINT`
90
- 8. `PREPARE_RELEASE_NOTE`
91
- 9. `MARK_TASKS_PUBLISH`
92
- 10. `STATUS_SNAPSHOT`
86
+ 4. `VERIFY_IMPLEMENTATION_GATE`
87
+ 5. `RUN_REVIEW_GATE`
88
+ 6. `COMMIT_BY_NAME`
89
+ 7. `RUN_MR_REVIEW_GATE`
90
+ 8. `ASSIGN_SPRINT`
91
+ 9. `PREPARE_RELEASE_NOTE`
92
+ 10. `MARK_TASKS_PUBLISH`
93
+ 11. `STATUS_SNAPSHOT`
93
94
 
94
95
  `VERIFY_GOVERNANCE_GATE` выполняет `Governance Watchdog Agent` перед любой операцией и блокирует выполнение при нарушении PRD/acceptance/user-confirmation правил.
95
96
  `RUN_REVIEW_GATE` выполняет `Reviewer/Judge Agent` перед коммитом:
@@ -140,6 +141,7 @@ npm run self:bootstrap
140
141
  npm run meta:verify
141
142
  npm run meta:branch
142
143
  npm run meta:task-start -- --task #12 --slug api-redirect
144
+ npm run meta:implementation-gate -- --task #12
143
145
  npm run meta:review
144
146
  npm run meta:review-approve
145
147
  npm run meta:mr-review
@@ -155,6 +157,7 @@ npm run meta:status
155
157
  `meta:task-start` делает branch-routing preflight: сравнивает задачу с текущей веткой, показывает dirty/ahead блокеры и готовит маршрут (`stay_on_current_branch` или `create_new_branch`).
156
158
  `meta:task-start` также делает context-protection check для `AGENTS.md` (fallback: `agents.md`) между текущей и базовой веткой и требует явного подтверждения при diff.
157
159
  Именование branch task ref: использовать GitHub issue ref в формате `issue-<number>`.
160
+ `meta:implementation-gate` блокирует старт реализации, если не выполнены условия `IN_PROGRESS + PRD sections + structured verifiability(strict/statistical/human) + branch alignment`.
158
161
  `meta:mr-review` формирует сводный pre-merge отчёт по MR/PR, `meta:mr-review-approve` фиксирует финальный PASS после подтверждения пользователя.
159
162
  `meta:status` отдаёт единый статус-срез: trackers used, current sprint, current task, current branch context, git uncommitted и summary.
160
163
  В `github` режиме локальные `tasks/*` по умолчанию считаются cache/legacy и не являются источником истины.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k0t0vich/meta-agents-template",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Template system for verification-first agentic development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,6 +14,7 @@
14
14
  "meta:status": "node template/.meta-agents/scripts/sync-status.mjs",
15
15
  "meta:branch": "node template/.meta-agents/scripts/verify-branch-strategy.mjs",
16
16
  "meta:task-start": "node template/.meta-agents/scripts/task-branch-router.mjs",
17
+ "meta:implementation-gate": "node template/.meta-agents/scripts/verify-implementation-gate.mjs",
17
18
  "meta:verify": "node template/.meta-agents/scripts/verify-governance.mjs",
18
19
  "meta:review": "node template/.meta-agents/scripts/run-review-gate.mjs",
19
20
  "meta:review-approve": "node template/.meta-agents/scripts/run-review-gate.mjs --approve yes",
package/src/init.mjs CHANGED
@@ -110,6 +110,7 @@ function buildMetaScripts(packageName) {
110
110
  "meta:status": `${base}/sync-status.mjs`,
111
111
  "meta:branch": `${base}/verify-branch-strategy.mjs`,
112
112
  "meta:task-start": `${base}/task-branch-router.mjs`,
113
+ "meta:implementation-gate": `${base}/verify-implementation-gate.mjs`,
113
114
  "meta:verify": `${base}/verify-governance.mjs`,
114
115
  "meta:review": `${base}/run-review-gate.mjs`,
115
116
  "meta:review-approve": `${base}/run-review-gate.mjs --approve yes`,
@@ -217,14 +218,19 @@ async function mergePackageJsonMeta({
217
218
 
218
219
  function buildAgentsLinkBlock(packageName) {
219
220
  const packageRoot = `./node_modules/${packageName}`;
221
+ const templateAgentsPath = `${packageRoot}/template/agents.md`;
222
+ const trackerTemplatePath = `${packageRoot}/template/tracker-command-template.md`;
220
223
  const lines = [
221
224
  AGENTS_LINK_BLOCK_START,
222
225
  "## Meta Agents Template (npm-linked)",
223
226
  "ОБЯЗАТЕЛЬНО: перед выполнением любой команды сначала прочитай canonical rules по ссылкам ниже.",
224
227
  "При конфликте локального текста и шаблона приоритет у canonical files из node_modules.",
225
228
  "Базовые правила шаблона:",
226
- `- [Template agents.md](${packageRoot}/template/agents.md)`,
227
- `- [Template tracker-command-template.md](${packageRoot}/template/tracker-command-template.md)`,
229
+ `- [Template agents.md](${templateAgentsPath})`,
230
+ `- [Template tracker-command-template.md](${trackerTemplatePath})`,
231
+ "Canonical files (read by path in this exact order):",
232
+ `1. \`${templateAgentsPath}\``,
233
+ `2. \`${trackerTemplatePath}\``,
228
234
  "Локальные конфиги проекта:",
229
235
  "- [.meta-agents/config/project-context.yaml](./.meta-agents/config/project-context.yaml)",
230
236
  "- [.meta-agents/config/trackers.yaml](./.meta-agents/config/trackers.yaml)",
@@ -62,6 +62,23 @@ system:
62
62
  - local
63
63
  - custom
64
64
  require_provider_consistency: true
65
+ coding_law:
66
+ no_code_before_prd_and_verification: true
67
+ required_before_coding:
68
+ - prd_description_complete
69
+ - architecture_documented
70
+ - verification_matrix_complete
71
+ - tests_unit_defined
72
+ - tests_system_defined
73
+ - tests_e2e_playwright_defined
74
+ - external_analysis_defined
75
+ - implementation_gate_passed
76
+ dialogue_scope_control:
77
+ enabled: true
78
+ if_request_out_of_scope:
79
+ - propose_create_task
80
+ - or_finish_current_task
81
+ code_actions_blocked_until_scope_resolved: true
65
82
  user_confirmation_required_for:
66
83
  - review_gate_pass
67
84
  - mr_review_gate_pass
@@ -103,6 +120,7 @@ system:
103
120
  required: true
104
121
  required_before_commands:
105
122
  - CREATE_TASK
123
+ - VERIFY_IMPLEMENTATION_GATE
106
124
  - SET_STATUS
107
125
  - COMMIT_BY_NAME
108
126
  routing_command: "meta:task-start"
@@ -160,6 +178,7 @@ system:
160
178
  required: true
161
179
  before_commands:
162
180
  - VERIFY_GOVERNANCE_GATE
181
+ - VERIFY_IMPLEMENTATION_GATE
163
182
  - CREATE_TASK
164
183
  - PREPARE_TASK_BRANCH
165
184
  - SET_STATUS
@@ -171,8 +190,13 @@ system:
171
190
  - MARK_TASKS_PUBLISH
172
191
  minimum_checks:
173
192
  - prd_sections_complete
193
+ - architecture_documented
194
+ - verification_matrix_complete
195
+ - tests_unit_system_playwright_defined
196
+ - external_analysis_defined
174
197
  - acceptance_criteria_defined
175
198
  - user_confirmation_policy_respected
199
+ - no_code_before_prd
176
200
  review_gate:
177
201
  required_before_commit: true
178
202
  command: RUN_REVIEW_GATE
@@ -218,13 +242,21 @@ system:
218
242
  acceptance:
219
243
  hard_criteria:
220
244
  - prd_sections_complete
245
+ - architecture_documented_before_coding
221
246
  - auto_select_prefix_present
222
247
  - strict_checks_passed
223
248
  - statistical_thresholds_met
224
249
  - human_approvals_passed
250
+ - verification_matrix_contains_unit_tests
251
+ - verification_matrix_contains_system_tests
252
+ - verification_matrix_contains_e2e_playwright
253
+ - external_agent_analysis_completed_for_key_tasks
254
+ - no_code_changes_before_implementation_gate_pass
225
255
  - evidence_pack_complete
226
256
  - tracker_sync_complete
257
+ - out_of_scope_dialogue_requires_task_decision
227
258
  - branch_routing_dialog_completed
259
+ - implementation_gate_passed
228
260
  - branch_routing_e2e_verified
229
261
  - agents_context_consistency_verified
230
262
  - watchdog_gate_passed
@@ -1,6 +1,7 @@
1
1
  Role: Agile Manager Agent
2
2
  Goal: управлять задачами и статусами через TrackerGateway.
3
3
  Commands: CREATE_TASK, SET_STATUS, COMMIT_BY_NAME, ASSIGN_SPRINT.
4
+ Law: не начинать кодовые изменения до PASS по docs-first gate (`PRD + Architecture + Verification Plan + tests_unit/tests_system/tests_e2e_playwright/external_analysis`).
4
5
  Status semantics: READY = commit+push on feature/release/hotfix + open PR; DONE = integrated to main + back-merge to develop (release/hotfix); PUBLISH = published in latest version.
5
6
  Git Flow Lite rule: использовать `feature/* -> develop`, `release/* -> main` + back-merge, `hotfix/* -> main` + back-merge.
6
7
  Rule: для большой фичи в GitHub tracker сначала предложить связку `feature issue` + `epic issue` и выделенную ветку.
@@ -25,3 +26,5 @@ Task ref naming rule:
25
26
  Pre-merge rule:
26
27
  - после commit+push и открытия PR обязательно выполнить `RUN_MR_REVIEW_GATE`;
27
28
  - merge допускается только после `RUN_MR_REVIEW_GATE: PASS_CONFIRMED` и явного `MR Review Approved: yes` от пользователя.
29
+ Scope rule:
30
+ - если запрос уходит за границы текущей задачи, сначала предложить `CREATE_TASK` или завершение текущей задачи; до решения не переходить к коду.
@@ -1,6 +1,8 @@
1
1
  Role: Clarifier Agent
2
2
  Goal: выявить цель, ограничения, неоднозначности и критерии успеха.
3
+ Law: никаких кодовых изменений до заполнения PRD, архитектуры и verification matrix (`tests_unit`, `tests_system`, `tests_e2e_playwright`, `external_analysis`).
3
4
  Rule: если задача классифицируется как большая фича, обязательно предложить создать `feature issue` и `epic issue` в GitHub tracker, а также отдельную ветку.
4
5
  Git rule: для задач реализации в Git Flow Lite по умолчанию выбирать `feature/<task-or-issue-id>-<slug>` (или `codex/feature/...`) от `develop`.
5
6
  Task granularity rule: если задача атомарная и относится к текущей feature-ветке, это фиксируется как `Task Type: atomic`, иначе создаётся отдельная рабочая ветка.
7
+ Scope rule: если запрос вышел за рамки текущей задачи, сначала предложить завести новую задачу или завершить текущую; не переходить к коду до решения.
6
8
  Output: PRD Step с заполненными "Описание" и "Проверяемость".
@@ -1,3 +1,5 @@
1
1
  Role: Governance Watchdog Agent
2
2
  Goal: блокировать выполнение команды, если не выполнены PRD/acceptance/user-confirmation требования.
3
3
  Rule: без PASS от governance gate команда не исполняется.
4
+ Rule: перед началом кодирования обязателен docs-first PASS (`PRD + Architecture + Verification Plan + tests_unit/tests_system/tests_e2e_playwright/external_analysis`).
5
+ Rule: если запрос вышел за рамки текущей задачи, агент обязан остановить кодовые действия и предложить `CREATE_TASK` или завершение текущей задачи.
@@ -2,6 +2,7 @@ Role: Reviewer/Judge Agent
2
2
  Goal: независимая приёмка по критериям и обязательный pre-commit review gate.
3
3
  Output format: что сделано, критические замечания, потенциальные риски, рекомендация PASS_CANDIDATE/FAIL.
4
4
  Rule: финальный PASS_CONFIRMED только после явного `Review Approved: yes` от пользователя.
5
+ Rule: review обязан подтвердить docs-first дисциплину: код не начат до `PRD + Architecture + Verification Plan + tests_unit/tests_system/tests_e2e_playwright/external_analysis`.
5
6
  Handoff rule: после pre-commit PASS_CONFIRMED задача передаётся в `MR Review Agent` для pre-merge gate.
6
7
  Status rule: перед review gate задача должна быть в статусе `REVIEW`; статус `READY` выставляется только после `PASS_CONFIRMED`.
7
8
  Delivery rule: `READY` требует commit+push на `feature/*|release/*|hotfix/*` (или `codex/*` эквиваленты) и PR в целевую ветку; `DONE` требует интеграцию в `main` и back-merge в `develop` для `release/*|hotfix/*`; `PUBLISH` только после фактической публикации.
@@ -1,3 +1,4 @@
1
1
  Role: Verifier Designer Agent
2
2
  Goal: определить strict/statistical/human проверки.
3
+ Rule: verification plan обязан включать `tests_unit`, `tests_system`, `tests_e2e_playwright` и `external_analysis`.
3
4
  Output: verification plan и evidence mapping.
@@ -568,23 +568,29 @@ async function main() {
568
568
 
569
569
  console.log("# Status Snapshot");
570
570
  console.log("");
571
- console.log("## Trackers");
571
+ console.log("## 1) Trackers Used");
572
572
  console.log(`- locked provider: ${report.tracker.lockedProvider}`);
573
573
  console.log(`- available providers: ${report.tracker.availableProviders.join(", ") || "unknown"}`);
574
574
  console.log(`- workflow source: ${report.tracker.workflowSource}`);
575
575
 
576
576
  console.log("");
577
- console.log("## Process");
578
- console.log(`- current sprint: ${report.process.currentSprint}`);
579
- console.log(`- current task: ${report.process.currentTask}`);
580
- console.log(`- current task ref: ${report.process.currentTaskRef}`);
581
- console.log(`- branch/task alignment: ${report.process.branchTaskAlignment}`);
577
+ console.log("## 2) Current Sprint");
578
+ console.log(`- ${report.process.currentSprint}`);
582
579
 
583
580
  console.log("");
584
- console.log("## Git");
581
+ console.log("## 3) Current Task");
582
+ console.log(`- task: ${report.process.currentTask}`);
583
+ console.log(`- task ref: ${report.process.currentTaskRef}`);
584
+
585
+ console.log("");
586
+ console.log("## 4) Current Branch Context");
585
587
  console.log(`- branch: ${report.git.branch}`);
586
588
  console.log(`- branch type: ${report.git.branchType}`);
587
589
  console.log(`- branch task ref: ${report.git.branchTaskRef}`);
590
+ console.log(`- task/branch alignment: ${report.process.branchTaskAlignment}`);
591
+
592
+ console.log("");
593
+ console.log("## 5) Git Uncommitted");
588
594
  console.log(`- upstream: ${report.git.upstream}`);
589
595
  console.log(`- ahead/behind: ${report.git.ahead}/${report.git.behind}`);
590
596
  console.log(`- modified_or_staged: ${report.git.modifiedOrStaged}`);
@@ -601,7 +607,7 @@ async function main() {
601
607
  }
602
608
 
603
609
  console.log("");
604
- console.log("## Summary");
610
+ console.log("## 6) Summary");
605
611
  if (report.summary.length === 0) {
606
612
  console.log("- no additional notes");
607
613
  } else {
@@ -163,6 +163,7 @@ function collectGitContext() {
163
163
  branch,
164
164
  branchType: classifyBranch(branch),
165
165
  branchTaskRef: extractBranchTaskRef(branch),
166
+ hasCommits: hasCommits(),
166
167
  upstream: parsed.upstream || "not configured",
167
168
  ahead: parsed.ahead,
168
169
  behind: parsed.behind,
@@ -259,6 +260,10 @@ function hasRef(ref) {
259
260
  return Boolean(git(["show-ref", "--verify", ref], true));
260
261
  }
261
262
 
263
+ function hasCommits() {
264
+ return Boolean(git(["rev-parse", "--verify", "HEAD"], true));
265
+ }
266
+
262
267
  function hasOrigin() {
263
268
  return Boolean(git(["remote", "get-url", "origin"], true));
264
269
  }
@@ -333,6 +338,25 @@ function executePlan(plan, gitContext) {
333
338
  git(["fetch", "origin"], false);
334
339
  }
335
340
 
341
+ if (!gitContext.hasCommits) {
342
+ const baseRemote = hasRef(`refs/remotes/origin/${baseBranch}`);
343
+ if (baseRemote) {
344
+ git(["checkout", "-b", baseBranch, "--track", `origin/${baseBranch}`], false);
345
+ } else if (gitContext.branch !== baseBranch) {
346
+ git(["checkout", "-B", baseBranch], false);
347
+ }
348
+
349
+ if (plan.targetBranch !== baseBranch) {
350
+ git(["checkout", "-B", plan.targetBranch], false);
351
+ }
352
+
353
+ return {
354
+ changedBranch: plan.targetBranch !== gitContext.branch,
355
+ branch: plan.targetBranch,
356
+ message: `Repository has no commits yet. Bootstrapped branch routing and switched to '${plan.targetBranch}'.`,
357
+ };
358
+ }
359
+
336
360
  const baseLocal = hasRef(`refs/heads/${baseBranch}`);
337
361
  const baseRemote = hasRef(`refs/remotes/origin/${baseBranch}`);
338
362
 
@@ -411,12 +435,27 @@ function buildPlan(options, gitContext) {
411
435
  requiresDialogue.push(
412
436
  "Задача атомарная и относится к текущей feature-ветке. Подтвердите, что продолжаем работу в этой ветке.",
413
437
  );
438
+ } else if (!gitContext.hasCommits) {
439
+ requiresDialogue.push(
440
+ "Репозиторий без коммитов. Подтвердите bootstrap маршрута: создать базовую ветку и рабочую ветку без ручного обхода.",
441
+ );
414
442
  } else {
415
443
  requiresDialogue.push(
416
444
  "Задача не относится к текущей ветке. Подтвердите переключение на базовую ветку, обновление и создание новой рабочей ветки.",
417
445
  );
418
446
  }
419
447
 
448
+ const suggestedCommands = sameFeature
449
+ ? []
450
+ : !gitContext.hasCommits
451
+ ? [`git checkout -B ${baseBranch}`, `git checkout -B ${targetBranch}`]
452
+ : [
453
+ "git fetch origin",
454
+ `git checkout ${baseBranch}`,
455
+ `git pull --ff-only origin ${baseBranch}`,
456
+ `git checkout -b ${targetBranch}`,
457
+ ];
458
+
420
459
  return {
421
460
  requested: {
422
461
  task: options.task,
@@ -431,14 +470,7 @@ function buildPlan(options, gitContext) {
431
470
  namingWarnings,
432
471
  contextWarnings: getContextWarnings(baseBranch),
433
472
  requiresDialogue,
434
- suggestedCommands: sameFeature
435
- ? []
436
- : [
437
- "git fetch origin",
438
- `git checkout ${baseBranch}`,
439
- `git pull --ff-only origin ${baseBranch}`,
440
- `git checkout -b ${targetBranch}`,
441
- ],
473
+ suggestedCommands,
442
474
  };
443
475
  }
444
476
 
@@ -449,6 +481,7 @@ function printPlan(plan, applyResult) {
449
481
  console.log(`- branch: ${plan.current.branch}`);
450
482
  console.log(`- branch type: ${plan.current.branchType}`);
451
483
  console.log(`- branch task ref: ${plan.current.branchTaskRef || "not detected"}`);
484
+ console.log(`- repository state: ${plan.current.hasCommits ? "has commits" : "no commits yet"}`);
452
485
  console.log(`- upstream: ${plan.current.upstream}`);
453
486
  console.log(`- ahead/behind: ${plan.current.ahead}/${plan.current.behind}`);
454
487
  console.log(`- modified_or_staged: ${plan.current.modifiedOrStaged}`);