@mrciphersmith/keryx 0.4.34 → 0.4.36

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.
Files changed (89) hide show
  1. package/dist/cli.js +6055 -3656
  2. package/dist/core.js +239 -48
  3. package/dist/keryx-general-worker-entry.js +265 -48
  4. package/package.json +1 -1
  5. package/src/gdskills/bundled/install-manifest.json +132 -95
  6. package/src/gdskills/bundled/rules/activity/implement.mdc +55 -0
  7. package/src/gdskills/bundled/rules/activity/review.mdc +47 -0
  8. package/src/gdskills/bundled/rules/activity/test.mdc +46 -0
  9. package/src/gdskills/bundled/rules/core/async-patterns.mdc +10 -9
  10. package/src/gdskills/bundled/rules/core/concurrency-patterns.mdc +2 -2
  11. package/src/gdskills/bundled/rules/core/definition-of-done.mdc +6 -5
  12. package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +4 -3
  13. package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +2 -18
  14. package/src/gdskills/bundled/rules/process/agent-conduct.mdc +79 -0
  15. package/src/gdskills/bundled/rules/{core → process}/documentation-management.mdc +1 -1
  16. package/src/gdskills/bundled/rules/{core → process}/git-rules.mdc +1 -1
  17. package/src/gdskills/bundled/rules/{core → process}/skills-storage-workflow.mdc +1 -1
  18. package/src/gdskills/bundled/skills/core/reviewer-skill-creator/SKILL.detail.md +1 -1
  19. package/src/gdskills/bundled/skills/orchestration/context-collector/SKILL.md +6 -6
  20. package/src/gdskills/bundled/skills/orchestration/context-collector/orchestrator-prompt.md +4 -0
  21. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/SKILL.md +4 -4
  22. package/src/gdskills/bundled/skills/orchestration/feature-analyzer/orchestrator-prompt.md +2 -0
  23. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/SKILL.md +19 -19
  24. package/src/gdskills/bundled/skills/orchestration/flow-orchestrator/input-contract.schema.json +1 -1
  25. package/src/gdskills/bundled/skills/orchestration/issue-analyzer/orchestrator-prompt.md +2 -0
  26. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/SKILL.md +9 -9
  27. package/src/gdskills/bundled/skills/orchestration/job-orchestrator/orchestrator-prompt.md +10 -0
  28. package/src/gdskills/bundled/skills/orchestration/task-implementer/SKILL.md +16 -17
  29. package/src/gdskills/bundled/skills/orchestration/task-implementer/orchestrator-prompt.md +4 -0
  30. package/src/gdskills/bundled/skills/planning/autodoc-orchestrator/SKILL.md +2 -2
  31. package/src/gdskills/bundled/skills/planning/docpack-orchestrator/SKILL.md +2 -2
  32. package/src/gdskills/bundled/skills/planning/prd-creator/SKILL.md +1 -1
  33. package/src/gdskills/bundled/skills/quality/test-gen/SKILL.md +2 -10
  34. package/src/gdskills/bundled/skills/quality/tests-creator/SKILL.md +1 -1
  35. package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +7 -18
  36. package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +2 -10
  37. package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +2 -14
  38. package/src/gdskills/bundled/skills/review/review-core-boundaries/SKILL.md +1 -9
  39. package/src/gdskills/bundled/skills/review/review-degradation/SKILL.md +1 -4
  40. package/src/gdskills/bundled/skills/review/review-flow-graph/SKILL.md +1 -9
  41. package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +4 -12
  42. package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +4 -12
  43. package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +1 -12
  44. package/src/gdskills/bundled/skills/review/review-jev-comments/SKILL.md +1 -4
  45. package/src/gdskills/bundled/skills/review/review-jev-contract/SKILL.md +1 -4
  46. package/src/gdskills/bundled/skills/review/review-jev-docs/SKILL.md +1 -4
  47. package/src/gdskills/bundled/skills/review/review-jev-risk/SKILL.md +1 -4
  48. package/src/gdskills/bundled/skills/review/review-jev-rules/SKILL.md +1 -4
  49. package/src/gdskills/bundled/skills/review/review-jev-scenarios/SKILL.md +1 -4
  50. package/src/gdskills/bundled/skills/review/review-layout/SKILL.md +1 -4
  51. package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +5 -13
  52. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.detail.md +2 -2
  53. package/src/gdskills/bundled/skills/review/review-orchestrator/SKILL.md +5 -12
  54. package/src/gdskills/bundled/skills/review/review-orchestrator/reviewer-input.schema.json +6 -0
  55. package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +5 -13
  56. package/src/gdskills/bundled/skills/review/review-pr-contract/SKILL.md +1 -6
  57. package/src/gdskills/bundled/skills/review/review-regression/SKILL.md +1 -6
  58. package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +1 -9
  59. package/src/gdskills/bundled/skills/review/review-style/SKILL.md +1 -9
  60. package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +2 -7
  61. package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +1 -4
  62. package/src/gdskills/bundled/{rules/core → stacks/mobx/rules}/mobx-store-template.mdc +4 -2
  63. package/src/gdskills/bundled/{rules/core → stacks/nestjs/rules}/nestjs-dto.mdc +4 -3
  64. package/src/gdskills/bundled/stacks/playwright/governance/scout.json +1 -0
  65. package/src/gdskills/bundled/stacks/playwright/pack.json +19 -0
  66. package/src/gdskills/bundled/{rules/core → stacks/playwright/rules}/playwright-testing.mdc +6 -6
  67. package/src/gdskills/bundled/{rules/core → stacks/react/rules}/code-style-patterns.mdc +11 -9
  68. package/src/gdskills/bundled/stacks/storybook/governance/scout.json +1 -0
  69. package/src/gdskills/bundled/stacks/storybook/pack.json +19 -0
  70. package/src/gdskills/bundled/{rules/core → stacks/storybook/rules}/storybook-guidelines.mdc +4 -3
  71. package/src/gdskills/bundled/stacks/ts-js-node/rules/coding-style.mdc +17 -1
  72. package/src/gdskills/bundled/stacks/ts-js-node/rules/patterns.mdc +18 -0
  73. package/src/gdskills/contracts/subagent-dispatch.schema.json +4 -1
  74. /package/src/gdskills/bundled/rules/{core → process}/commit-message-formatting.mdc +0 -0
  75. /package/src/gdskills/bundled/rules/{core → process}/execution-metrics.md +0 -0
  76. /package/src/gdskills/bundled/rules/{core → process}/git-concurrency.mdc +0 -0
  77. /package/src/gdskills/bundled/rules/{core → process}/implementation-doc-mandate.mdc +0 -0
  78. /package/src/gdskills/bundled/rules/{core → process}/implementation-plans.mdc +0 -0
  79. /package/src/gdskills/bundled/rules/{core → process}/jobs-documentation.mdc +0 -0
  80. /package/src/gdskills/bundled/rules/{core → process}/model-selection.mdc +0 -0
  81. /package/src/gdskills/bundled/rules/{core → process}/opus-5-5-prompting.mdc +0 -0
  82. /package/src/gdskills/bundled/rules/{core → process}/requirements-management.mdc +0 -0
  83. /package/src/gdskills/bundled/rules/{core → process}/requirements-package-standard.mdc +0 -0
  84. /package/src/gdskills/bundled/rules/{core → process}/rule-management-workflow.mdc +0 -0
  85. /package/src/gdskills/bundled/rules/{core → process}/session-plan-bridge.mdc +0 -0
  86. /package/src/gdskills/bundled/rules/{core → process}/skill-authoring.mdc +0 -0
  87. /package/src/gdskills/bundled/rules/{core → process}/skill-lifecycle.mdc +0 -0
  88. /package/src/gdskills/bundled/rules/{core → process}/subagent-context-construction.md +0 -0
  89. /package/src/gdskills/bundled/rules/{core → process}/subagent-status-protocol.md +0 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ description: "Test design whatever the stack: what a test pins, the cases at the boundaries, fixtures and test doubles, determinism, and what to do with a failing test. Use when writing or changing tests, including failing stubs before implementation."
3
+ alwaysApply: false
4
+ ---
5
+
6
+ # Activity: test
7
+
8
+ How a test writer applies the testing rules. This rule sets method only. It
9
+ rates nothing: `rules/core/tdd-workflow.mdc` and the installed stack pack's
10
+ `testing.mdc` hold the testing rules and their severities.
11
+
12
+ ## What a test pins
13
+
14
+ - Write tests that describe WHAT the code should do, not HOW. Assert observable behaviour.
15
+ - Cover every acceptance criterion with at least one test.
16
+ - One behaviour per test, and let the description name it.
17
+ - A test that passes before the implementation is broken.
18
+
19
+ ## Cases: the boundaries
20
+
21
+ **Functions:** happy path, edge cases (empty/null/zero/negative), error cases, boundary values
22
+
23
+ **Components:** renders, props, interactions, conditional rendering, states
24
+
25
+ **Endpoints:** success (200), validation (400), not found (404), auth (401/403)
26
+
27
+ **Classes:** constructor, methods, state transitions, errors
28
+
29
+ ## Fixtures and doubles
30
+
31
+ - Match existing test patterns in the project: read 1-2 neighboring test files to match import style, describe/it structure, mock patterns, assertion style.
32
+ - Arrange/Act/Assert; mock external dependencies, not internal module logic (`tdd-workflow.mdc` Rule 4). A test whose collaborators are all mocked asserts that your mocks agree with each other.
33
+
34
+ ## Determinism
35
+
36
+ `tdd-workflow.mdc` Rules 5–7: a unit test uses no real network and no
37
+ wall-clock time, never waits with a sleep or a fixed delay, and a flaky test is
38
+ fixed by waiting on the state it races.
39
+
40
+ ## A failing test
41
+
42
+ A test that asserts nothing covers nothing while reporting coverage — strictly
43
+ worse than no test. Never loosen an assertion to get green. When the test is
44
+ right and the code is wrong, an implementer fixes the code (GREEN in
45
+ `rules/activity/implement.mdc`); a test writer who may not edit the source
46
+ reports the failure.
@@ -1,18 +1,18 @@
1
1
  ---
2
- description: "Async patterns standard shared by code writers and reviewers, with the severities reviewers use: independent awaits run in parallel, a timeout on every external call, bounded fan-out, no event-loop blocking. Use when writing or reviewing async/await code, parallel operations, or queue consumers."
2
+ description: "Async patterns standard shared by code writers and reviewers, with the severities reviewers use: independent awaits run in parallel, a timeout on every external call, bounded fan-out, no blocking of the thread that serves requests. Use when writing or reviewing async/await code, parallel operations, or queue consumers."
3
3
  alwaysApply: false
4
4
  ---
5
5
 
6
6
  # Async Patterns
7
7
 
8
- Canon applies: `Promise.all` / `allSettled` semantics (MDN), the Node.js "Don't Block the Event Loop" guide, `@typescript-eslint/no-floating-promises`. This rule holds only this project's decisions.
8
+ Canon applies: the concurrency documentation of the project's language and runtime. The concrete values for a stack are in its language pack (Node.js: `stacks/ts-js-node/patterns.mdc`). This rule holds only this project's decisions.
9
9
 
10
10
  ## Rules
11
11
 
12
- 1. **Independent awaits run in parallel.** If B does not depend on A, use `Promise.all`; use `Promise.allSettled` when some results are optional, and handle each rejection.
13
- 2. **Every external call has a timeout**, set with `AbortSignal.timeout(ms)`. Defaults: internal service 3s, external API 10s, long-running work 60s with progress events; database queries at the connection-pool level.
14
- 3. **Bound fan-out.** Mapping a large collection to promises uses a concurrency limit; default 10.
15
- 4. **Do not block the event loop.** `JSON.parse` / `JSON.stringify` of a payload over 1MB, sync file reads in hot paths and CPU-heavy loops go to a stream, `fs.promises` or a worker thread.
12
+ 1. **Independent awaits run in parallel.** If B does not depend on A, start both and wait for both; when some results are optional, wait so that an optional result's failure cannot discard a required one, and handle each failure.
13
+ 2. **Every external call has a timeout**, set through the client's or the runtime's cancellation mechanism. Defaults: internal service 3s, external API 10s, long-running work 60s with progress events; database queries at the connection-pool level.
14
+ 3. **Bound fan-out.** Mapping a large collection to concurrent tasks uses a concurrency limit; default 10.
15
+ 4. **Do not block the thread that serves requests.** Parsing or serialising a payload over 1MB, synchronous file reads in hot paths and CPU-heavy loops go to a stream, an asynchronous API or a worker.
16
16
  5. **Rejections** are handled per `error-handling.mdc` Rule 4.
17
17
 
18
18
  ---
@@ -24,9 +24,10 @@ Canon applies: `Promise.all` / `allSettled` semantics (MDN), the Node.js "Don't
24
24
  | Signal | A finding when | Default | Not a finding |
25
25
  |---|---|---|---|
26
26
  | Sequential independent awaits (Rule 1) | always | `minor`; `major` on a hot path or when the calls are many | an ordering the code depends on |
27
- | `Promise.all` where an optional result's failure discards a required one (Rule 1) | a named optional call can reject | `major` | all results required |
27
+ | A combined wait where an optional result's failure discards a required one (Rule 1) | a named optional call can reject | `major` | all results required |
28
28
  | External call with no timeout (Rule 2) | the call can hang a request or worker | `major` | a timeout set at the client or pool |
29
- | Timeout built from `AbortController` + `setTimeout` (Rule 2) | always | `minor` | — |
30
29
  | Unbounded fan-out over a caller-sized collection (Rule 3) | the size is not fixed small | `major` on a hot path, else `minor` | a collection of known small size |
31
- | Event-loop blocking on a request path (Rule 4) | a named input size or path reaches it | `major` | startup or one-off scripts |
30
+ | Blocking the request-serving thread on a request path (Rule 4) | a named input size or path reaches it | `major` | startup or one-off scripts |
32
31
  | Unhandled rejection (Rule 5) | per `error-handling.mdc` **Review severities** | as there | as there |
32
+
33
+ A stack's own forms of these signals, and any signal only one stack has, are in its language pack (Node.js: `stacks/ts-js-node/patterns.mdc` Review severities).
@@ -5,11 +5,11 @@ alwaysApply: false
5
5
 
6
6
  # Concurrency Patterns
7
7
 
8
- Canon applies: POSIX `rename(2)` atomicity, `O_EXCL` / the Node.js `wx` open flag, and `child_process` stream semantics. This rule holds only this project's decisions for state shared by concurrent sessions and processes.
8
+ Canon applies: POSIX `rename(2)` atomicity, `O_EXCL` exclusive create, and the runtime's child-process stream semantics. The Node.js forms are in `stacks/ts-js-node/patterns.mdc`. This rule holds only this project's decisions for state shared by concurrent sessions and processes.
9
9
 
10
10
  ## Rules
11
11
 
12
- 1. **A lock file is taken by exclusive create** (`wx`), never check-then-create. It is released in `finally`, and a stale lock is recovered by the holder's PID or age without taking a live holder's lock.
12
+ 1. **A lock file is taken by exclusive create** (`O_EXCL`), never check-then-create. It is released in `finally`, and a stale lock is recovered by the holder's PID or age without taking a live holder's lock.
13
13
  2. **A shared state file is written to a temp file in the same directory and renamed over the target.** A read-modify-write of it holds a lock (Rule 1).
14
14
  3. **One JSONL record is one write.** A record is serialised whole, with its newline, and appended in a single call.
15
15
  4. **Child-process fan-out is bounded.** One child per file, flow, finding or input item goes through a concurrency limit; default 4.
@@ -54,13 +54,14 @@ this list is what says whether the bar moved.
54
54
 
55
55
  | Document | Owns |
56
56
  |---|---|
57
- | `rules/core/tdd-workflow.mdc` | Clause 2 for tests specifically: the red-green-refactor sequence, and the invariant that `STATUS: DONE` requires a green suite (its Iron Law 1, and Iron Law 3 forbidding deletion of tests to get there — clause 4's test case). |
57
+ | `rules/core/tdd-workflow.mdc` | Clause 2 for tests specifically: the invariant that `STATUS: DONE` requires a green suite (its Iron Law 1, and Iron Law 3 forbidding deletion of tests to get there — clause 4's test case). |
58
+ | `rules/activity/implement.mdc` | The red-green-refactor sequence that produces the evidence for clauses 1 and 2, and the change scope a task stays inside. |
58
59
  | `.metaproject/skills/gdskills/orchestration/code-verifier/SKILL.md` | Clause 3: the gate decision, and the ruling that a check which did not run reports `status: skipped`, never `pass`. It also owns the distinction between the gate's result and the skill's own `STATUS:`. |
59
- | `rules/core/implementation-doc-mandate.mdc` | The shape of the evidence for clauses 1 and 2 — the Verification Gate block, the Acceptance Criteria Met list, and its Iron Law 3: the numbers must come from an independent verifier, not from self-assessment. |
60
- | `rules/core/subagent-status-protocol.md` | How the result is reported: `STATUS:` on line one, the five statuses, and the verification block every `DONE` response carries. |
61
- | `rules/core/git-concurrency.mdc` | Clause 5: a task is not done until its diff is committed, whether the worker or the orchestrator commits it. |
60
+ | `rules/process/implementation-doc-mandate.mdc` | The shape of the evidence for clauses 1 and 2 — the Verification Gate block, the Acceptance Criteria Met list, and its Iron Law 3: the numbers must come from an independent verifier, not from self-assessment. |
61
+ | `rules/process/subagent-status-protocol.md` | How the result is reported: `STATUS:` on line one, the five statuses, and the verification block every `DONE` response carries. |
62
+ | `rules/process/git-concurrency.mdc` | Clause 5: a task is not done until its diff is committed, whether the worker or the orchestrator commits it. |
62
63
  | `.metaproject/skills/gdskills/orchestration/task-implementer/SKILL.md` | The worker-side reading of clause 3: skipped verification is a failed verification, and partial is not done. |
63
- | `rules/core/requirements-package-standard.mdc` | Clause 2 for a documentation package, where the gates are structural (required files, versions, links, honest status) rather than lint and tests. |
64
+ | `rules/process/requirements-package-standard.mdc` | Clause 2 for a documentation package, where the gates are structural (required files, versions, links, honest status) rather than lint and tests. |
64
65
 
65
66
  Two readings of `DONE_WITH_CONCERNS` are in circulation, and this rule settles
66
67
  them: it is for information the orchestrator needs about work that **cleared
@@ -15,9 +15,10 @@ TypeScript (strict), React, MobX, Ant Design for components, Tailwind CSS for la
15
15
 
16
16
  ## Where the standard is
17
17
 
18
- - Components, layers, state placement, accessibility and TypeScript: `code-style-patterns.mdc`.
19
- - Stores: `mobx-store-template.mdc`.
20
- - Stories: `storybook-guidelines.mdc`.
18
+ - Components, layers, state placement and accessibility: `stacks/react/code-style-patterns.mdc`.
19
+ - TypeScript (`any`, `!`, import paths): `stacks/ts-js-node/coding-style.mdc`.
20
+ - Stores: `stacks/mobx/mobx-store-template.mdc`.
21
+ - Stories: `stacks/storybook/storybook-guidelines.mdc`.
21
22
 
22
23
  Each holds the severities reviewers use, so code written to these rules is what the reviewer checks.
23
24
 
@@ -1,27 +1,11 @@
1
1
  ---
2
- description: "Testing standard shared by code writers and reviewers: red-green order, no done without green, tests colocated, new logic gets a test, mock at the boundary, no real network or clock, flaky tests fixed by waiting on a state, and the severities reviewers use. Use when implementing features, fixing bugs, writing or reviewing unit and integration tests."
2
+ description: "Testing standard shared by code writers and reviewers: no done without green, tests colocated, new logic gets a test, mock at the boundary, no real network or clock, flaky tests fixed by waiting on a state, and the severities reviewers use. Use when implementing features, fixing bugs, writing or reviewing unit and integration tests."
3
3
  alwaysApply: false
4
4
  ---
5
5
 
6
6
  # TDD Workflow
7
7
 
8
- Canon applies: the test framework's documentation. This rule holds this project's decisions and the order an implementer works in.
9
-
10
- ## Process (implementer)
11
-
12
- 1. **RED.** Write the failing test first, from the task's `acceptance_criteria` (each criterion maps to at least one test; use `test_case_specs` or run `tests-creator` when none exist). Run it and confirm it fails for the right reason: a test that passes before the implementation is broken.
13
- 2. **GREEN.** Write the minimal code that passes it. Run the tests after each logical chunk.
14
- 3. **REFACTOR.** Clean up with the suite green; re-run it after every step.
15
- 4. **Report.** The full suite (`bun test`, `npm test`, `pytest` or the project's equivalent) passes with 0 failures before `STATUS: DONE`.
16
-
17
- Output contract on completion:
18
-
19
- ```
20
- tests_written: <N>
21
- tests_passing: <N>
22
- tests_failing: 0
23
- coverage_notes: "<which acceptance criteria are covered>"
24
- ```
8
+ Canon applies: the test framework's documentation. This rule holds this project's decisions. The order an implementer works in (red, green, refactor, report) is `rules/activity/implement.mdc`; test design is `rules/activity/test.mdc`.
25
9
 
26
10
  **Iron laws.** Never claim `STATUS: DONE` with a failing test. Never write implementation before a failing test exists for that behaviour. Never delete or skip a test to make the suite green; fix the code.
27
11
 
@@ -0,0 +1,79 @@
1
+ ---
2
+ description: "Mandatory agent conduct for every agent Keryx starts: no AI attribution lines, no commit/push/merge/release without an explicit ask, never destroy others' work, no secrets or personal data, honest reporting. Always applies; nothing overrides it."
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Agent Conduct
7
+
8
+ ## Purpose
9
+ Five constraints that hold for every agent Keryx starts — the top-level session, a flow or job worker, a reviewer, a shell subagent, an external agent, a scheduled run — whether it was started directly or through a dispatch. They are the process layer of ADR-0001 (`docs/decisions/rules-layers/ADR-0001-rules-layer-model.md`): no other rule, skill, stack pack or prompt overrides them.
10
+
11
+ The short form is rendered from one constant (`src/lib/agent-conduct.ts`) into `.metaproject/index.md`, the CLAUDE.md / AGENTS.md managed block, every runtime system prompt and every orchestrator dispatch. This file is the rationale and the examples.
12
+
13
+ ---
14
+
15
+ ## Rules
16
+
17
+ ### 1. No AI attribution
18
+ No `Co-Authored-By:` trailer that names an AI model, agent or tool, and no "Generated by …" / "Generated with …" line that names one, in commit messages, PR descriptions, ticket descriptions, or comments.
19
+
20
+ The author of a change is the person who asked for it and owns it. An attribution line advertises the tool, adds noise to every log and review, and in public repositories leaks which tooling a team uses.
21
+
22
+ Allowed: a human co-author (`Co-Authored-By: Jane Doe <jane@example.com>`), a code-generator note (`Generated by protoc`, `Generated by the OpenAPI generator`), and a model name given as technical provenance, where the reader needs it to judge the output — for example the "reviewers that ran, with models" section of a review report. An identifier that happens to contain an agent id (`External write run <id> (<agentId>)`) is an identifier, not attribution.
23
+
24
+ BAD:
25
+ ```text
26
+ fix(review): drop stale lens rows
27
+
28
+ Co-Authored-By: Claude <noreply@anthropic.com>
29
+ 🤖 Generated with Codex
30
+ ```
31
+
32
+ GOOD:
33
+ ```text
34
+ fix(review): drop stale lens rows
35
+ ```
36
+
37
+ The Keryx-managed `commit-msg` hook rejects the two forms above when the trailer's identity is an AI (its name is exactly an AI product or model name, or its address is an AI vendor's or an AI agent's, such as `copilot-swe-agent[bot]` or `claude[bot]`; non-AI bots like `dependabot[bot]` pass) or the Generated line's object is an AI tool; the tables are in `src/lib/managed-git-hook.ts`. A human co-author passes even when the first name matches a product (`Claude Monet`, `Devin Smith`), and so does a product name elsewhere: a subject that mentions `CLAUDE.md` or names a runtime is legitimate.
38
+
39
+ ### 2. No commit, push, merge or release without an explicit ask
40
+ Writing files is the task; committing, pushing, merging and releasing are separate decisions the owner makes.
41
+
42
+ - Invoking an orchestrator (`flow-orchestrator`, `job-orchestrator`, `autodoc-orchestrator`, `review-orchestrator`) is the explicit ask for that orchestrator's own task-boundary commits.
43
+ - Merge and release always need their own explicit ask. A flow with `completion_outcome: create-pr-and-merge` opens the PR and stops before merging until the owner asks for the merge.
44
+ - "Looks good" about a diff is not an ask to push it.
45
+
46
+ ### 3. Never destroy others' work
47
+ Other sessions and lanes may share the checkout, the stash stack and the branch.
48
+
49
+ - No `git stash` in a dirty tree — the stash stack is shared by every worktree; another lane's `pop` can restore your entry over its work, or yours over theirs.
50
+ - No blanket `git add -A` / `git add .` while parallel lanes share a checkout — stage explicit paths.
51
+ - No force-push to a shared branch.
52
+
53
+ Details and the safe alternatives: `rules/process/git-concurrency.mdc`.
54
+
55
+ ### 4. No secrets or personal data
56
+ No API keys, tokens, passwords, private keys, connection strings, or personal data (names, emails, phone numbers of real people) in agent output, logs, commit messages, PR text or committed files. Redact before quoting a log or a config. `keryx security check-output` scans a text before it leaves the session.
57
+
58
+ ### 5. Honest reporting
59
+ A report names what failed, what was skipped and what was not verified, as plainly as what passed. "Done" means the completion criterion was checked, not that the edit was made. A test that was not run is reported as not run, never as passing; a step skipped because a tool was unavailable is reported as skipped, with the reason.
60
+
61
+ ---
62
+
63
+ ## Dispatch form
64
+ An orchestrator dispatch carries the block as one line — a `constraints[]` entry of a `subagent-dispatch`, the `conduct` field of a reviewer input, or a line of a prompt template. Paste it verbatim:
65
+
66
+ ```text
67
+ Agent conduct (mandatory): (1) No AI attribution: no `Co-Authored-By:` trailer or "Generated by/with …" line naming an AI model, agent or tool in commit messages, PR or ticket descriptions, or comments. A human co-author, a code-generator note and a model name as technical provenance are allowed. (2) No commit, push, merge or release without an explicit ask. Invoking an orchestrator is the ask for its own task-boundary commits; merge and release always need their own ask. (3) Never destroy others' work: no `git stash` in a dirty tree, no blanket `git add -A` while parallel lanes share a checkout, no force-push to a shared branch. (4) No secrets or personal data in output, logs or commits. (5) Report honestly: name what failed, what was skipped and what was not verified.
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Enforcement
73
+ - The constant in `src/lib/agent-conduct.ts` reaches every prompt path; orchestrator dispatch schemas require a conduct entry in `constraints`.
74
+ - The managed `commit-msg` check (`.git/hooks/keryx-commit-msg`, called from `commit-msg`) enforces rule 1 for commits. Keryx never edits a foreign `commit-msg` hook; it prints the line to add instead. The check does not run under a foreign `core.hooksPath`, from a hook that does not call it, or with `--no-verify`; `keryx doctor` reports when it is inactive and how to fix it, and reports **unverified** when a hook calls it from a place Keryx cannot prove runs (after an `exec`, inside an `if`).
75
+ - A project can turn the check off with `"hooks": { "commitMsg": false }` in `.metaproject/metaproject.json`; `init`, `update` and `sync install-hooks` then remove it, and `keryx doctor` reports it disabled by config. An unreadable file or a non-boolean value leaves the hook as it is, with a warning. Rule 1 still binds every agent.
76
+ - Known limits of the check — rule 1 binds agents whatever the hook catches:
77
+ - A `--cleanup=` flag on the command line is invisible to a hook; only `commit.cleanup` from config is read. With `-F` plus `commit.cleanup=scissors` or `commit.verbose`, the check may read slightly more or less of the message than git keeps.
78
+ - Other attribution forms are not matched: `Co-developed-by:`, `Assisted-by:`, a product name followed by more words ("Generated with Claude Code CLI"), look-alike Unicode.
79
+ - `hooks.commitMsg` is read per checkout, while `.git/hooks` is shared by every worktree of a repository.
@@ -91,7 +91,7 @@ docs/analysis/<feature-name>/
91
91
  - `jobs/` — orchestrator pipeline artifacts. Each job folder documents one orchestrated task end-to-end.
92
92
 
93
93
  Standalone skill invocations continue to use `docs/analysis/`. Only orchestrator-driven work produces output in `jobs/`.
94
- See `core/jobs-documentation.mdc` for the `jobs/` system.
94
+ See `process/jobs-documentation.mdc` for the `jobs/` system.
95
95
 
96
96
  ## Prohibited
97
97
  - Date-stamped folders anywhere under `<DOCS_ROOT>`.
@@ -23,7 +23,7 @@ Apply before any git operation: commit, branch creation, or PR creation. Always
23
23
  4. If declined: do not create branch/commit/PR.
24
24
 
25
25
  ## Commit Message Rules
26
- Follow `core/commit-message-formatting.mdc`.
26
+ Follow `process/commit-message-formatting.mdc`.
27
27
 
28
28
  ## Red Flags — Stop and re-read this rule if you are thinking:
29
29
 
@@ -130,7 +130,7 @@ cites this section by name, so the finding and the rule cannot drift apart. The
130
130
 
131
131
  > Split the skill, or move reference material into a sibling document, and lower
132
132
  > the ceiling to the new count in the same change. A ceiling only ever moves
133
- > DOWN: raising it is the one edit rules/core/skills-storage-workflow.mdc
133
+ > DOWN: raising it is the one edit rules/process/skills-storage-workflow.mdc
134
134
  > ("Length Ceilings") forbids, because it converts a measured limit into a record
135
135
  > of whatever the file grew to.
136
136
 
@@ -539,7 +539,7 @@ How each field of a `project` entry in `--json` is derived:
539
539
  Printed under "rules cited but not in .metaproject/rules". The reviewer is
540
540
  still dispatched; add the rule, or accept that it reviews without it.
541
541
  - **`shadowedRules`** — `[{ ref, resolved }]`: rules the text cites as
542
- `<dir>/<name>.mdc` that the project-slot copy answers first — above,
542
+ `<dir>/<name>.mdc` that the project-slot copy (or a moved rule's new path) answers first — above,
543
543
  `{ "ref": "core/error-handling.mdc", "resolved":
544
544
  ".metaproject/rules/project/core/error-handling.mdc" }`. Printed under
545
545
  "rules read from .metaproject/rules/project". Expected after a `differs` or
@@ -161,18 +161,18 @@ Scan local sources for relevant context. Be selective — only include what is d
161
161
  - Note: "Previous job <name> addressed <related topic>"
162
162
  ```
163
163
 
164
- ### 2.3 Rules (`<PROJECT_DIR>/rules/core/` or repo rules path)
164
+ ### 2.3 Rules (`<PROJECT_DIR>/rules/core/` and the installed stack-pack rules, such as `.metaproject/rules/stacks/ts-js-node/coding-style.mdc`, or repo rules path)
165
165
 
166
166
  ```
167
167
  1. Based on focus_areas and task_description, identify applicable rules:
168
168
 
169
169
  | Focus Area | Relevant Rules |
170
170
  |------------|---------------|
171
- | React components | code-style-patterns.mdc, frontend-assistant.mdc, storybook-guidelines.mdc |
172
- | MobX stores | code-style-patterns.mdc, mobx-store-template.mdc |
173
- | API / DTOs | nestjs-dto.mdc, code-style-patterns.mdc, api-contracts.mdc |
174
- | Testing | playwright-testing.mdc, storybook-guidelines.mdc, tdd-workflow.mdc |
175
- | General code | code-style-patterns.mdc, frontend-assistant.mdc |
171
+ | React components | stacks/react/code-style-patterns.mdc, frontend-assistant.mdc, stacks/storybook/storybook-guidelines.mdc |
172
+ | MobX stores | stacks/react/code-style-patterns.mdc, stacks/mobx/mobx-store-template.mdc |
173
+ | API / DTOs | stacks/nestjs/nestjs-dto.mdc, api-contracts.mdc |
174
+ | Testing | stacks/playwright/playwright-testing.mdc, stacks/storybook/storybook-guidelines.mdc, tdd-workflow.mdc |
175
+ | General code | stacks/react/code-style-patterns.mdc, frontend-assistant.mdc |
176
176
  | TDD / test-first | tdd-workflow.mdc |
177
177
  | Architecture / layers | clean-architecture.mdc, solid-principles.mdc |
178
178
  | Error handling | error-handling.mdc |
@@ -60,6 +60,8 @@ a context document for the current job.
60
60
 
61
61
  Load the skill from: .metaproject/skills/gdskills/orchestration/context-collector/SKILL.md
62
62
 
63
+ Agent conduct (mandatory): <the "Dispatch form" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>
64
+
63
65
  DO NOT ask the user any questions. Execute all phases autonomously.
64
66
 
65
67
  ACTION: collect
@@ -87,6 +89,8 @@ context document for this job.
87
89
 
88
90
  Load the skill from: .metaproject/skills/gdskills/orchestration/context-collector/SKILL.md
89
91
 
92
+ Agent conduct (mandatory): <the "Dispatch form" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>
93
+
90
94
  DO NOT ask the user any questions. Execute the update flow autonomously.
91
95
 
92
96
  ACTION: update
@@ -269,7 +269,7 @@ When focus specified: boost files matching focus keywords to P0; select ALL focu
269
269
  - Large files (> 500 lines): use outline/grep to locate relevant sections, then read only those ranges
270
270
  2. **Understand context**: architecture role, dependencies, what depends on it
271
271
  3. **Find and analyze tests**: look for matching test files, understand coverage
272
- 4. **Check rules compliance**: verify against `code-style-patterns.mdc`
272
+ 4. **Check rules compliance**: verify against `stacks/react/code-style-patterns.mdc` (installed where React is detected)
273
273
 
274
274
  ---
275
275
 
@@ -278,13 +278,13 @@ When focus specified: boost files matching focus keywords to P0; select ALL focu
278
278
  1. **Dependency search**: find all target files importing changed DTOs/APIs from source
279
279
  2. **Contract divergence**: compare new source contracts with current target implementation
280
280
  3. **Target deep dive**: read 2-3 key components that will need changes
281
- 4. **Target rules compliance**: check `.metaproject/rules/core/*.mdc` in target repo
281
+ 4. **Target rules compliance**: check `.metaproject/rules/core/*.mdc` and the installed stack-pack rules (such as `.metaproject/rules/stacks/ts-js-node/coding-style.mdc`) in target repo
282
282
 
283
283
  ---
284
284
 
285
285
  ## Step 7: UI Analysis (if applicable)
286
286
 
287
- Check `AGENTS.md` for available tools (`playwright-testing.mdc`, `storybook-guidelines.mdc`). Analyze visual regression requirements, component behavior changes, accessibility impact.
287
+ Check `AGENTS.md` for available tools (`stacks/playwright/playwright-testing.mdc`, `stacks/storybook/storybook-guidelines.mdc`). Analyze visual regression requirements, component behavior changes, accessibility impact.
288
288
 
289
289
  ---
290
290
 
@@ -403,7 +403,7 @@ Follow `documentation-management.mdc`: update `<DOCS_ROOT>/readme.md`, add entry
403
403
  ## Rules and Guidelines
404
404
 
405
405
  1. **Always follow** `documentation-management.mdc` for doc structure
406
- 2. **Always check** `code-style-patterns.mdc` for compliance
406
+ 2. **Always check** `stacks/react/code-style-patterns.mdc` (where installed) for compliance
407
407
  3. **Always use** AGENTS.md to discover available skills and tools
408
408
  4. **Never assume** — ask user when unclear
409
409
  5. **Never skip** intermediate review for complex analyses (P0 files > 3)
@@ -98,6 +98,8 @@ DO NOT stop for confirmation. Execute the full workflow end-to-end.
98
98
 
99
99
  Load the skill: feature-analyzer (from .metaproject/skills/gdskills/orchestration/feature-analyzer/SKILL.md)
100
100
 
101
+ Agent conduct (mandatory): <the "Dispatch form" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>
102
+
101
103
  ═══════════════════════════════════════════════
102
104
  PRE-RESOLVED CONTEXT (Guard Clause SATISFIED)
103
105
  ═══════════════════════════════════════════════
@@ -213,20 +213,20 @@ Required context sources:
213
213
 
214
214
  Required rules:
215
215
 
216
- - `.metaproject/rules/core/requirements-management.mdc`
217
- - `.metaproject/rules/core/implementation-plans.mdc`
218
- - `.metaproject/rules/core/subagent-context-construction.md`
219
- - `.metaproject/rules/core/subagent-status-protocol.md`
220
- - `.metaproject/rules/core/tdd-workflow.mdc`
221
- - `.metaproject/rules/core/code-style-patterns.mdc`
216
+ - `.metaproject/rules/process/requirements-management.mdc`
217
+ - `.metaproject/rules/process/implementation-plans.mdc`
218
+ - `.metaproject/rules/process/subagent-context-construction.md`
219
+ - `.metaproject/rules/process/subagent-status-protocol.md`
220
+ - `.metaproject/rules/core/tdd-workflow.mdc`, and per role `.metaproject/rules/activity/implement.mdc`, `test.mdc` or `review.mdc`
221
+ - `.metaproject/rules/stacks/react/code-style-patterns.mdc`
222
222
  - `.metaproject/rules/core/error-handling.mdc`
223
- - `.metaproject/rules/core/implementation-doc-mandate.mdc`
224
- - `.metaproject/rules/core/execution-metrics.md`
225
- - `.metaproject/rules/core/git-concurrency.mdc` — no `git stash`, no unscoped `git add`, pin every dispatch to its worktree
223
+ - `.metaproject/rules/process/implementation-doc-mandate.mdc`
224
+ - `.metaproject/rules/process/execution-metrics.md`
225
+ - `.metaproject/rules/process/git-concurrency.mdc` — no `git stash`, no unscoped `git add`, pin every dispatch to its worktree
226
226
 
227
227
  Execution metrics (opt-in): when a USER runs this orchestrator directly, at the
228
228
  start ask "Collect execution statistics for this run? (yes/no)" per
229
- `rules/core/execution-metrics.md`. If yes, append the `## Execution Metrics`
229
+ `rules/process/execution-metrics.md`. If yes, append the `## Execution Metrics`
230
230
  section at the end and save it under the flow dir (`<flow-dir>/metrics/`). Never
231
231
  ask or emit it when dispatched as a subagent.
232
232
 
@@ -297,20 +297,20 @@ Recommended worker routing:
297
297
  ### Worker communication is schema-governed
298
298
 
299
299
  Workers do not inherit session state; every dispatch is constructed explicitly
300
- (`.metaproject/rules/core/subagent-context-construction.md`). Each dispatch is a
300
+ (`.metaproject/rules/process/subagent-context-construction.md`). Each dispatch is a
301
301
  `subagent-dispatch` object
302
302
  (`.metaproject/core/gdskills/contracts/subagent-dispatch.schema.json`) and each
303
303
  worker reply is a `subagent-result` object
304
304
  (`.metaproject/core/gdskills/contracts/subagent-result.schema.json`) whose first
305
305
  line is `STATUS: <status>`
306
- (`.metaproject/rules/core/subagent-status-protocol.md`).
306
+ (`.metaproject/rules/process/subagent-status-protocol.md`).
307
307
 
308
308
  `<worktree_path>` below is the absolute root of the checkout this flow's work
309
309
  happens in: the git worktree the flow runs in, or the project root when it runs
310
310
  in the main checkout. Resolve it once, before the first dispatch
311
311
  (`git rev-parse --show-toplevel` from that checkout), check
312
312
  `git -C <worktree_path> branch --show-current` is the branch the work belongs
313
- on, and pin every dispatch to it (`rules/core/git-concurrency.mdc`, "Pinning A
313
+ on, and pin every dispatch to it (`rules/process/git-concurrency.mdc`, "Pinning A
314
314
  Dispatch To Its Worktree").
315
315
 
316
316
  Workers do not commit: flow-orchestrator owns every commit and dispatches with
@@ -343,7 +343,7 @@ Dispatch payload, bound to the flow (map `target_skill` from the routing table):
343
343
  "Never edit frozen acceptance criteria.",
344
344
  "resolved_context_file: .metaproject/flows/<dir>/resolved/<Tn>.<for>.json — read its must_read entries and cite each in project_context_applied; an entry promoted by a condition also needs its anchor and a summary.",
345
345
  "Return a subagent-result; first line must be STATUS:.",
346
- "Follow rules/core/git-concurrency.mdc: never git stash; never git add -A.",
346
+ "Agent conduct (mandatory): <the \"Dispatch form\" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>", "Follow rules/process/git-concurrency.mdc: never git stash; never git add -A.",
347
347
  "Root: <worktree_path>. Before the first write run `cd <worktree_path> && pwd && git branch --show-current`; run every git command as `git -C <worktree_path>`.",
348
348
  "Auto-commit is off (automation.auto_commit: false): do not commit; list every path you changed in changed_files. flow-orchestrator commits them at the task boundary."
349
349
  ],
@@ -357,7 +357,7 @@ Dispatch payload, bound to the flow (map `target_skill` from the routing table):
357
357
  **Task boundary commit, after every accepted worker result** (`DONE` or
358
358
  `DONE_WITH_CONCERNS`), then mark task progress. It commits exactly those
359
359
  `changed_files` from the worker's `subagent-result` that git still shows as
360
- changed, never `-A`/`--all`/`.` (`rules/core/git-concurrency.mdc` rule 4 and
360
+ changed, never `-A`/`--all`/`.` (`rules/process/git-concurrency.mdc` rule 4 and
361
361
  "Reporting Back"). It skips cleanly when none remain (expected for a worker that
362
362
  reported no files or committed on its own, like tests-creator's stubs):
363
363
 
@@ -437,12 +437,12 @@ Before accepting implementation:
437
437
  - **Red probes → ONE implementer.** When reviewers left red probes (failing tests or commands on the findings), pass them as `test_case_specs` to one `task-implementer` dispatch — no separate `tests-creator` task. `tests-creator` runs only for a new contract no probe covers.
438
438
  - **A held finding is not fixed.** A finding `review-premise` held (`challenged` or `owner-decision`) is neither fixable nor clean: it never goes into `fix_context.review_feedback` and it blocks the loop until answered. Ask the operator about it as `review-orchestrator` "Wave D" says (the card in keryx shell; elsewhere the host's question tool, naming the finding id, then `keryx review decide-premise` with `--answered-by <source>:<ref> --answer-text … --question-text …` to record the answer) and journal the recorded answer; only an upheld finding enters a fix round, carrying `premise_verdict` and `premise_answer` as task-implementer's `FIX_CONTEXT` defines them. A dispatched run leaves it held and journals it.
439
439
  - **`suggested_fix` is a hypothesis.** Pass each finding's `id` and `suggested_fix` in `fix_context.review_feedback`; the implementer reproduces the finding (red), checks the suggestion against the state × event matrix, then fixes (task-implementer 1.3). Journal every `suggested_fix diverged` / `did not reproduce` note it returns.
440
- 7. Close the skill-learning loop (see `rules/core/skill-lifecycle.mdc`). Collect
440
+ 7. Close the skill-learning loop (see `rules/process/skill-lifecycle.mdc`). Collect
441
441
  the `skill_drift` fields from task-implementer results and the
442
442
  `## Skill Learning` block from review-orchestrator. For each flagged
443
443
  project-skill, dispatch a subagent — on a cheaper / non-flagship model if one
444
444
  is available (`keryx review tier --findings 1 --diff-lines 0` resolves one from runtime
445
- provider detection; see `rules/core/model-selection.mdc`), otherwise the session model — to run
445
+ provider detection; see `rules/process/model-selection.mdc`), otherwise the session model — to run
446
446
  `keryx skills learn --from-review <report> --skill <m>/<s>` and return the
447
447
  proposal. Then read the proposal and `skills learn apply` it, or discard it.
448
448
  Never apply unread; never put `learn` in a hook.
@@ -511,7 +511,7 @@ answered it and who is behind it.
511
511
  | Input | Obey it as |
512
512
  |---|---|
513
513
  | `base_branch` | Cut the flow branch from **that** branch and merge back into it. Never substitute the repository default: a fix aimed at a pull request's own branch has to land inside that pull request, and the default branch is a different review. Absent, resolve the base yourself and record what you resolved. |
514
- | `completion_outcome: create-pr-and-merge` | Skip the Completion Choice question, run the PR review/fix loop, merge into `base_branch`, complete the flow. |
514
+ | `completion_outcome: create-pr-and-merge` | Skip the Completion Choice question and run the PR review/fix loop. Merge into `base_branch` only on the explicit merge ask (`rules/process/agent-conduct.mdc` rule 2). For a dispatch that ask is `operator_confirmed`, which the input contract requires with this outcome: it must name the human who asked. |
515
515
  | `operator_confirmed` | The human decision behind an outward-facing completion. See the row below for when its absence is a refusal. |
516
516
  | `review: the caller owns the reply on #<n>` | Pass it through to every `review-orchestrator` dispatch. Reviews of **this flow's own** PR reply as normal — that is a separate conversation. What the round must not do is answer `#<n>`, which the caller is already answering. |
517
517
  | `attempt budget: at most <n> attempts` | A numeric ceiling BELOW your own bound is obeyed. One at or above it is not — the bound is yours, and the paragraph under this table says why. |
@@ -572,7 +572,7 @@ the bound plus an escalation — never an unbounded loop.
572
572
  re-planned approach still cannot produce a mergeable PR, leave the flow
573
573
  `in-progress` and report the blocker instead of forcing completion.
574
574
 
575
- When the PR is mergeable and required checks are green, merge it into the
575
+ When the PR is mergeable, required checks are green and the merge was explicitly asked for (the user picked A in this session, or `operator_confirmed`; otherwise stop and ask — agent-conduct rule 2), merge it into the
576
576
  recorded base branch (the branch from which the flow branch was created),
577
577
  verify that the merge completed, and only then record it through the CLI:
578
578
 
@@ -53,7 +53,7 @@
53
53
  "verified-handoff",
54
54
  "keep-open"
55
55
  ],
56
- "description": "Answers the Phase 4 Completion Choice for a dispatched run, which has no user to ask. REQUIRED: an absent outcome used to mean 'ask', prescribed by the same section that says asking is how a dispatched run stalls on a prompt nobody reads \u2014 and it left the create-pr-and-merge conditional below unreachable by simply omitting the field. A dispatch that cannot name its outcome is BLOCKED, not questioned."
56
+ "description": "Answers the Phase 4 Completion Choice for a dispatched run, which has no user to ask. REQUIRED: an absent outcome used to mean 'ask', prescribed by the same section that says asking is how a dispatched run stalls on a prompt nobody reads \u2014 and it left the create-pr-and-merge conditional below unreachable by simply omitting the field. A dispatch that cannot name its outcome is BLOCKED, not questioned. `create-pr-and-merge` merges only on the explicit merge ask (agent-conduct rule 2), which for a dispatched run is `operator_confirmed` — required with this outcome by the if/then below."
57
57
  },
58
58
  "operator_confirmed": {
59
59
  "type": "object",
@@ -64,6 +64,8 @@ DO NOT ask the user any questions. Execute the full workflow end-to-end.
64
64
 
65
65
  Load the skill: issue-analyzer (from skills/gdskills/orchestration/issue-analyzer/SKILL.md)
66
66
 
67
+ Agent conduct (mandatory): <the "Dispatch form" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>
68
+
67
69
  ═══════════════════════════════════════════════
68
70
  INPUT PARAMETERS
69
71
  ═══════════════════════════════════════════════
@@ -34,7 +34,7 @@ Dynamic orchestrator that builds execution plans based on user intent. Unlike a
34
34
 
35
35
  **The package is the state.** `keryx job` is the only writer of `state.json`; it validates every write against the registered contract `job-orchestrator-state` and refuses one that does not conform. Never hand-write `state.json`, and never hold a step's outcome only in this session — a step recorded nowhere is a step that did not happen as far as the next session is concerned.
36
36
 
37
- **Execution metrics (opt-in):** when a USER runs this orchestrator directly (not as a dispatched subagent), at the start ask "Collect execution statistics for this run? (yes/no)" per `.metaproject/rules/core/execution-metrics.md`. If yes, append the `## Execution Metrics` section at the end and save it under the job dir (`jobs/<job>/metrics/`). Never ask or emit it when dispatched as a subagent.
37
+ **Execution metrics (opt-in):** when a USER runs this orchestrator directly (not as a dispatched subagent), at the start ask "Collect execution statistics for this run? (yes/no)" per `.metaproject/rules/process/execution-metrics.md`. If yes, append the `## Execution Metrics` section at the end and save it under the job dir (`jobs/<job>/metrics/`). Never ask or emit it when dispatched as a subagent.
38
38
 
39
39
  **Key design principle** (from Anthropic's "Building Effective Agents"):
40
40
  > "The key difference from parallelization is its flexibility — subtasks aren't pre-defined, but determined by the orchestrator based on the specific input."
@@ -691,7 +691,7 @@ fi
691
691
 
692
692
  > **IMPORTANT**: After creating the worktree, ALL subsequent operations (implementation, review, lint, test, git) MUST run in the **worktree directory**, NOT in the original project directory.
693
693
 
694
- > **Concurrency**: every subsequent git command MUST use `git -C <worktree_path>`, never a bare `git`, and MUST NOT `git stash` or `git add -A`/`--all`/`.` — see `rules/core/git-concurrency.mdc`. Pin each dispatch to `<worktree_path>` explicitly; a dispatched agent's first action is `cd <worktree_path> && pwd && git branch --show-current`, re-checked before its first write.
694
+ > **Concurrency**: every subsequent git command MUST use `git -C <worktree_path>`, never a bare `git`, and MUST NOT `git stash` or `git add -A`/`--all`/`.` — see `rules/process/git-concurrency.mdc`. Pin each dispatch to `<worktree_path>` explicitly; a dispatched agent's first action is `cd <worktree_path> && pwd && git branch --show-current`, re-checked before its first write.
695
695
 
696
696
  **Record state:**
697
697
  ```
@@ -845,7 +845,7 @@ leaves it out gets a worker that commits even when `implementer_settings.auto_co
845
845
  is `false`.
846
846
 
847
847
  **Task boundary commit, for every accepted result, whatever `auto_commit` was:**
848
- a task is not done until its diff is committed (`rules/core/git-concurrency.mdc`
848
+ a task is not done until its diff is committed (`rules/process/git-concurrency.mdc`
849
849
  rule 4, "Reporting Back"). As soon as a result is accepted (`STATUS: DONE` or
850
850
  `DONE_WITH_CONCERNS`), take its reported `files_modified`/`files_created`/
851
851
  `files_deleted` from the result file and commit the ones git still shows as
@@ -1458,7 +1458,7 @@ keryx job step <job-name> perf-check --status completed|skipped --reason "<resul
1458
1458
 
1459
1459
  ### 2.8.3 Step: SKILL LEARNING (conditional)
1460
1460
 
1461
- Close the self-learning loop (see `rules/core/skill-lifecycle.mdc`). Collect the
1461
+ Close the self-learning loop (see `rules/process/skill-lifecycle.mdc`). Collect the
1462
1462
  learning signals produced upstream:
1463
1463
  - `skill_drift` fields from each task-implementer result (`stale:`/`missing:`).
1464
1464
  - the `## Skill Learning` block from `review-orchestrator`.
@@ -1474,7 +1474,7 @@ ELSE for each flagged project-skill:
1474
1474
  and paste the `model` block into the dispatch. The command names no model:
1475
1475
  it ranks what the provider reports at runtime, and when it cannot rank
1476
1476
  anything it prints `inherit: true`, which means the dispatch runs on the
1477
- session model. See rules/core/model-selection.mdc for what the tiers mean.
1477
+ session model. See rules/process/model-selection.mdc for what the tiers mean.
1478
1478
  - Command: keryx skills learn --from-review <review-report-path> \
1479
1479
  --skill <module>/<skill>
1480
1480
  (or --from-test / --from-failure when the signal came from verification)
@@ -1805,7 +1805,7 @@ a resumed session does not depend on remembering where it was.
1805
1805
 
1806
1806
  ## Interpreting Subagent Results
1807
1807
 
1808
- **Rule:** `rules/core/subagent-status-protocol.md`
1808
+ **Rule:** `rules/process/subagent-status-protocol.md`
1809
1809
 
1810
1810
  All subagents dispatched by this orchestrator MUST begin their final response with `STATUS: <STATUS>`. The orchestrator reads this line first and routes accordingly.
1811
1811
 
@@ -1813,7 +1813,7 @@ All subagents dispatched by this orchestrator MUST begin their final response wi
1813
1813
 
1814
1814
  **IF A SUBAGENT DOES NOT START WITH `STATUS:`, TREAT IT AS `NEEDS_CONTEXT` AND REQUEST A PROPERLY FORMATTED RESPONSE**
1815
1815
 
1816
- Do not attempt to infer status from prose. Do not trust a response that "looks fine" but lacks the status line. Run one explicit retry: "Your response did not start with STATUS: <STATUS>. Please reformat using the subagent status protocol (rules/core/subagent-status-protocol.md) and resend your result."
1816
+ Do not attempt to infer status from prose. Do not trust a response that "looks fine" but lacks the status line. Run one explicit retry: "Your response did not start with STATUS: <STATUS>. Please reformat using the subagent status protocol (rules/process/subagent-status-protocol.md) and resend your result."
1817
1817
 
1818
1818
  ### How to handle each status
1819
1819
 
@@ -1855,7 +1855,7 @@ Do not accept this. A subagent that ignores the status protocol is unpredictable
1855
1855
 
1856
1856
  ## Constructing Subagent Context
1857
1857
 
1858
- **Rule:** `rules/core/subagent-context-construction.md`
1858
+ **Rule:** `rules/process/subagent-context-construction.md`
1859
1859
 
1860
1860
  Every prompt dispatched to a subagent must be **explicitly constructed** by the orchestrator. Subagents do not inherit session context, job state, or prior agent output — they only know what the orchestrator tells them.
1861
1861
 
@@ -1884,7 +1884,7 @@ Task({
1884
1884
 
1885
1885
  ## Constraints
1886
1886
  - Do NOT modify <file or pattern>
1887
- - <other hard stops>
1887
+ - Agent conduct (mandatory): <the "Dispatch form" line of .metaproject/rules/process/agent-conduct.mdc, verbatim>; then <other hard stops>
1888
1888
  })
1889
1889
  ```
1890
1890