@event4u/agent-config 2.24.0 → 2.26.0

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 (161) hide show
  1. package/.agent-src/commands/bug-fix.md +1 -0
  2. package/.agent-src/commands/create-pr/description-only.md +39 -11
  3. package/.agent-src/commands/create-pr.md +59 -5
  4. package/.agent-src/commands/feature/roadmap.md +2 -2
  5. package/.agent-src/commands/fix/seeder.md +3 -2
  6. package/.agent-src/commands/memory/add.md +3 -3
  7. package/.agent-src/commands/module/create.md +1 -0
  8. package/.agent-src/commands/module/explore.md +10 -6
  9. package/.agent-src/commands/onboard.md +9 -1
  10. package/.agent-src/commands/optimize/augmentignore.md +52 -20
  11. package/.agent-src/commands/optimize/rtk.md +56 -30
  12. package/.agent-src/commands/package-test.md +86 -10
  13. package/.agent-src/commands/quality-fix.md +49 -27
  14. package/.agent-src/commands/update-form-request-messages.md +2 -1
  15. package/.agent-src/commands/video/from-script.md +5 -5
  16. package/.agent-src/commands/video/storyboard.md +1 -1
  17. package/.agent-src/contexts/augment-infrastructure.md +4 -7
  18. package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -1
  19. package/.agent-src/contexts/contracts/research-schema.md +1 -1
  20. package/.agent-src/contexts/execution/interrupt-examples.md +34 -0
  21. package/.agent-src/contexts/execution/roadmap-process-loop.md +69 -14
  22. package/.agent-src/contexts/skills-and-commands.md +2 -2
  23. package/.agent-src/personas/README.md +3 -2
  24. package/.agent-src/personas/ai-video-technical-director.md +2 -2
  25. package/.agent-src/personas/hollywood-director.md +3 -3
  26. package/.agent-src/profiles/content_creator.yml +5 -0
  27. package/.agent-src/rules/architecture.md +24 -10
  28. package/.agent-src/rules/artifact-drafting-protocol.md +6 -0
  29. package/.agent-src/rules/augment-edit-discipline.md +28 -0
  30. package/.agent-src/rules/augment-source-of-truth.md +2 -2
  31. package/.agent-src/rules/autonomous-execution.md +31 -0
  32. package/.agent-src/rules/context-hygiene.md +1 -1
  33. package/.agent-src/rules/domain-adoption-policy.md +4 -5
  34. package/.agent-src/rules/domain-safety-disclaimer.md +114 -0
  35. package/.agent-src/rules/domain-safety-pii.md +142 -0
  36. package/.agent-src/rules/domain-safety-retention.md +86 -0
  37. package/.agent-src/rules/downstream-changes.md +4 -4
  38. package/.agent-src/rules/framework-neutrality-in-generic-skills.md +130 -0
  39. package/.agent-src/rules/git-history-discipline.md +99 -0
  40. package/.agent-src/rules/media-governance-routing.md +82 -0
  41. package/.agent-src/rules/minimal-safe-diff.md +6 -0
  42. package/.agent-src/rules/no-roadmap-references.md +4 -2
  43. package/.agent-src/rules/persona-governance.md +90 -0
  44. package/.agent-src/rules/provider-lifecycle-discipline.md +75 -0
  45. package/.agent-src/rules/roadmap-ci-steps-policy.md +145 -0
  46. package/.agent-src/rules/roadmap-progress-sync.md +11 -5
  47. package/.agent-src/rules/user-interrupt-priority.md +46 -0
  48. package/.agent-src/rules/verify-before-complete.md +11 -2
  49. package/.agent-src/skills/adversarial-review/SKILL.md +1 -1
  50. package/.agent-src/skills/ai-council/SKILL.md +1 -0
  51. package/.agent-src/skills/api-endpoint/SKILL.md +58 -154
  52. package/.agent-src/skills/api-testing/SKILL.md +11 -0
  53. package/.agent-src/skills/character-consistency/SKILL.md +12 -1
  54. package/.agent-src/skills/code-refactoring/SKILL.md +36 -30
  55. package/.agent-src/skills/code-review/SKILL.md +41 -36
  56. package/.agent-src/skills/context-authoring/SKILL.md +1 -1
  57. package/.agent-src/skills/dashboard-design/SKILL.md +1 -2
  58. package/.agent-src/skills/database/SKILL.md +8 -3
  59. package/.agent-src/skills/dependency-upgrade/SKILL.md +65 -19
  60. package/.agent-src/skills/developer-like-execution/SKILL.md +25 -14
  61. package/.agent-src/skills/eloquent/SKILL.md +1 -1
  62. package/.agent-src/skills/feature-planning/SKILL.md +1 -1
  63. package/.agent-src/skills/file-editor/SKILL.md +45 -19
  64. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  65. package/.agent-src/skills/git-workflow/SKILL.md +135 -2
  66. package/.agent-src/skills/laravel-api-endpoint/SKILL.md +187 -0
  67. package/.agent-src/skills/{dto-creator → laravel-dto}/SKILL.md +5 -4
  68. package/.agent-src/skills/{migration-creator → laravel-migration}/SKILL.md +11 -10
  69. package/.agent-src/skills/laravel-reverb/SKILL.md +3 -3
  70. package/.agent-src/skills/{websocket → laravel-websocket}/SKILL.md +4 -3
  71. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +1 -1
  72. package/.agent-src/skills/merge-conflicts/SKILL.md +49 -17
  73. package/.agent-src/skills/migration-architect/SKILL.md +6 -6
  74. package/.agent-src/skills/module-management/SKILL.md +1 -0
  75. package/.agent-src/skills/motion-choreographer/SKILL.md +12 -0
  76. package/.agent-src/skills/multi-tenancy/SKILL.md +15 -8
  77. package/.agent-src/skills/pest-testing/SKILL.md +18 -0
  78. package/.agent-src/skills/php-debugging/SKILL.md +28 -0
  79. package/.agent-src/skills/php-service/SKILL.md +3 -3
  80. package/.agent-src/skills/pixar-storyteller/SKILL.md +19 -6
  81. package/.agent-src/skills/playwright-testing/SKILL.md +16 -1
  82. package/.agent-src/skills/project-analyzer/SKILL.md +68 -42
  83. package/.agent-src/skills/readme-writing-package/SKILL.md +94 -23
  84. package/.agent-src/skills/roadmap-management/SKILL.md +1 -1
  85. package/.agent-src/skills/roadmap-writing/SKILL.md +10 -0
  86. package/.agent-src/skills/rtk-output-filtering/SKILL.md +23 -8
  87. package/.agent-src/skills/rule-refactor/SKILL.md +145 -0
  88. package/.agent-src/skills/rule-writing/SKILL.md +34 -8
  89. package/.agent-src/skills/scene-expander/SKILL.md +22 -7
  90. package/.agent-src/skills/security/SKILL.md +38 -29
  91. package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
  92. package/.agent-src/skills/test-driven-development/SKILL.md +4 -4
  93. package/.agent-src/skills/test-performance/SKILL.md +6 -5
  94. package/.agent-src/skills/verify-completion-evidence/SKILL.md +24 -27
  95. package/.agent-src/skills/video-director/SKILL.md +13 -0
  96. package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  97. package/.agent-src/templates/copilot-instructions.md +2 -2
  98. package/.agent-src/templates/roadmaps.md +16 -0
  99. package/.agent-src/templates/rule.md +2 -2
  100. package/.claude-plugin/marketplace.json +6 -4
  101. package/AGENTS.md +1 -1
  102. package/CHANGELOG.md +80 -133
  103. package/README.md +6 -4
  104. package/config/agent-settings.template.yml +26 -0
  105. package/docs/architecture.md +2 -2
  106. package/docs/archive/CHANGELOG-pre-2.25.0.md +191 -0
  107. package/docs/catalog.md +20 -12
  108. package/docs/contracts/file-ownership-matrix.json +588 -90
  109. package/docs/contracts/kernel-membership.md +17 -0
  110. package/docs/contracts/provider-lifecycle.md +122 -0
  111. package/docs/contracts/smoke-contracts.md +8 -8
  112. package/docs/decisions/ADR-011-domain-pack-readiness.md +213 -0
  113. package/docs/decisions/INDEX.md +1 -0
  114. package/docs/getting-started-by-role.md +10 -0
  115. package/docs/getting-started.md +1 -1
  116. package/docs/guidelines/php/api-design.md +1 -1
  117. package/docs/guidelines/php/controllers.md +1 -1
  118. package/docs/guidelines/php/resources.md +1 -1
  119. package/docs/guidelines/php/validations.md +1 -1
  120. package/docs/personas.md +73 -26
  121. package/docs/profiles.md +9 -4
  122. package/package.json +1 -1
  123. package/scripts/_tmp_scan_framework_leakage.py +119 -0
  124. package/scripts/ai-video/adapters/gemini-veo.sh +5 -0
  125. package/scripts/ai-video/adapters/higgsfield.sh +6 -0
  126. package/scripts/ai-video/adapters/kling.sh +5 -0
  127. package/scripts/ai-video/adapters/openai-images.sh +5 -0
  128. package/scripts/ai-video/adapters/sora.sh +6 -0
  129. package/scripts/build_linear_digest.py +0 -1
  130. package/scripts/check_portability.py +6 -0
  131. package/scripts/lint_framework_leakage.py +348 -0
  132. package/scripts/lint_framework_leakage_allowlist.json +476 -0
  133. package/scripts/lint_media_policy_linkage.py +140 -0
  134. package/scripts/lint_persona_governance.py +164 -0
  135. package/scripts/lint_roadmap_ci_steps.py +182 -0
  136. package/scripts/measure_augment_budget.py +6 -0
  137. package/scripts/schemas/command.schema.json +5 -0
  138. package/scripts/schemas/skill.schema.json +5 -0
  139. package/scripts/skill_linter.py +60 -7
  140. package/scripts/smoke/kernel.sh +4 -4
  141. package/scripts/smoke/router.sh +2 -2
  142. package/scripts/smoke/schema.sh +1 -1
  143. package/.agent-src/personas/pixar-storyboard-artist.md +0 -98
  144. package/.agent-src/rules/agent-docs.md +0 -20
  145. package/.agent-src/rules/augment-portability.md +0 -23
  146. package/.agent-src/rules/capture-learnings.md +0 -19
  147. package/.agent-src/rules/docs-sync.md +0 -20
  148. package/.agent-src/rules/domain-safety-disclaimer-consulting.md +0 -52
  149. package/.agent-src/rules/domain-safety-disclaimer-financial.md +0 -54
  150. package/.agent-src/rules/domain-safety-disclaimer-legal.md +0 -49
  151. package/.agent-src/rules/domain-safety-disclaimer-medical.md +0 -56
  152. package/.agent-src/rules/domain-safety-export-redact.md +0 -65
  153. package/.agent-src/rules/domain-safety-logging-pii-floor.md +0 -55
  154. package/.agent-src/rules/domain-safety-pii-finance.md +0 -57
  155. package/.agent-src/rules/domain-safety-pii-marketing.md +0 -60
  156. package/.agent-src/rules/domain-safety-pii-recruiting.md +0 -56
  157. package/.agent-src/rules/domain-safety-pii-support.md +0 -57
  158. package/.agent-src/rules/domain-safety-retention-finance.md +0 -48
  159. package/.agent-src/rules/domain-safety-retention-support.md +0 -55
  160. package/.agent-src/rules/e2e-testing.md +0 -19
  161. package/.agent-src/rules/no-unsolicited-rebase.md +0 -107
@@ -13,26 +13,40 @@ triggers:
13
13
 
14
14
  # Architecture Rules
15
15
 
16
+ ```
17
+ HTTP HANDLERS STAY THIN. BUSINESS LOGIC LIVES IN SERVICES OR USE-CASES.
18
+ ALWAYS VALIDATE AT THE REQUEST BOUNDARY. NEVER INLINE-VALIDATE INSIDE THE HANDLER.
19
+ ALWAYS READ AGENTS.MD AND PROJECT-LOCAL DOCS BEFORE STRUCTURAL DECISIONS.
20
+ ```
21
+
16
22
  ## General Principles
17
23
 
18
- - **Controllers are thin** — no business logic, delegate to services.
19
- - **Only Single Action Controllers** — every new controller MUST use `__invoke()`. No multi-action / resource controllers. See `../docs/guidelines/php/controllers.md` for naming conventions.
20
- - **Every controller needs a FormRequest** — never validate inline with `$request->validate()`. Use a dedicated `FormRequest` subclass.
21
- - **Services contain business logic** — calculations, orchestration, validation.
22
- - **Models have no business logic** — only relationships, scopes, accessors/mutators.
24
+ - **HTTP handlers stay thin** — no business logic; delegate to a service / use-case / domain layer.
25
+ - **Validate at the request boundary** — never inline-validate user input inside the handler. Use the framework's request-validation primitive (Laravel `FormRequest`, Symfony validator, Zod / class-validator in TS, Pydantic in Python).
26
+ - **One handler, one responsibility** — prefer single-purpose handlers over multi-action controllers when the framework supports it (Laravel `__invoke`, Next.js route handlers, Express handler-per-route).
27
+ - **Business logic lives in services / use-cases** — calculations, orchestration, cross-aggregate validation.
28
+ - **Domain models stay behavior-rich but I/O-free** — no HTTP, no DB transactions in the model; only domain rules, relationships, derived properties.
23
29
  - Always check the existing directory structure before creating new files.
24
30
  - Respect existing patterns — apply modern standards to **new** code only.
25
31
 
32
+ → Laravel-specific patterns (FormRequest, single-action `__invoke`, Eloquent scopes): see [`laravel`](../skills/laravel/SKILL.md), [`laravel-validation`](../skills/laravel-validation/SKILL.md).
33
+ → Symfony: see [`symfony-workflow`](../skills/symfony-workflow/SKILL.md).
34
+ → Next.js / TypeScript backends: see [`nextjs-patterns`](../skills/nextjs-patterns/SKILL.md).
35
+
26
36
  ## Project Detection
27
37
 
28
38
  Detect the current project type from the **Git remote URL**, **directory name**, or **project files**:
29
39
 
30
- - Check `composer.json` for framework (Laravel, Symfony, standalone).
31
- - Check if `artisan` exists Laravel project.
32
- - Check `package.json` for frontend framework (React, Vue, Next.js, etc.).
40
+ - **PHP** `composer.json` (framework slot: Laravel via `artisan`, Symfony via `bin/console`, standalone otherwise).
41
+ - **JS / TS** — `package.json` (framework slot: Next.js via `next` dep, Nuxt via `nuxt`, Express / Fastify / NestJS via deps; plain Node otherwise).
42
+ - **Python** `pyproject.toml` / `requirements.txt` (framework slot: Django via `django`, FastAPI via `fastapi`, Flask via `flask`).
43
+ - **Go** — `go.mod` (framework slot: `gin`, `echo`, `fiber`, stdlib `net/http`).
44
+ - **Ruby** — `Gemfile` (framework slot: Rails via `rails` gem, Sinatra otherwise).
45
+ - **Rust** — `Cargo.toml` (framework slot: `axum`, `actix-web`, `rocket`).
33
46
  - Check `AGENTS.md` or `agents/` for project-specific documentation.
34
47
 
35
- For tooling detection (artisan vs composer), check if `artisan` exists in the project root.
48
+ Tooling lives in a runner file at the project root detect once and reuse the result:
49
+ `Taskfile.yml` → `task`, `Makefile` → `make`, `package.json` `scripts:` → `npm` / `pnpm` / `yarn`, `pyproject.toml` `[tool.poetry.scripts]` or `[project.scripts]` → `poetry` / `uv`, framework CLIs (`artisan`, `bin/console`, `manage.py`, `bin/rails`) when the matching manifest is present.
36
50
 
37
51
  ## Project-Specific Architecture
38
52
 
@@ -51,7 +65,7 @@ projects use `docs/decisions/`. Reversible refactors and minor cleanups do **not
51
65
 
52
66
  ## Module-Level Documentation
53
67
 
54
- Some projects use a module system (e.g. `app/Modules/` in Laravel projects).
68
+ Some projects use a module system (e.g. `app/Modules/` in Laravel, `apps/`/`packages/` in a Turborepo, `src/modules/` in NestJS, `internal/` in Go).
55
69
  Modules may have their own agent docs in `app/Modules/*/agents/` with:
56
70
 
57
71
  - Module descriptions and feature docs
@@ -13,6 +13,12 @@ triggers:
13
13
 
14
14
  # Artifact Drafting Protocol
15
15
 
16
+ ```
17
+ NEVER START WRITING WITHOUT THE UNDERSTAND → RESEARCH → DRAFT PHASES.
18
+ EVERY PHASE ENDS WITH A NUMBERED-OPTIONS PROMPT. NO SILENT PROGRESSION.
19
+ ZERO AUTOPILOT. AGENT PROPOSES, HUMAN DECIDES. COMMIT ONLY ON APPROVAL.
20
+ ```
21
+
16
22
  When the user asks to build or significantly rewrite a **skill, rule,
17
23
  command, or guideline**, the agent does **not** start writing. It runs
18
24
  three phases: **Understand → Research → Draft**. Each phase ends with a
@@ -0,0 +1,28 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "Editing inside .augment/ or .agent-src.uncompressed/ — files MUST stay project-agnostic AND any add/rename/delete syncs counts and cross-references in the same edit"
5
+ source: package
6
+ triggers:
7
+ - path_prefix: ".augment/"
8
+ - path_prefix: ".agent-src.uncompressed/"
9
+ - keyword: "portable"
10
+ - keyword: "rename"
11
+ - keyword: "delete"
12
+ routes_to:
13
+ - "guideline:augment-portability-patterns"
14
+ - "skill:agent-docs-writing"
15
+ validator_ignore:
16
+ - type: "substring"
17
+ pattern: ".agent-src.uncompressed/"
18
+ reason: "Rule scopes the portability gate to the uncompressed authoring tree."
19
+ ---
20
+
21
+ # Augment Edit Discipline
22
+
23
+ **Iron Law (portability).** Files inside `.augment/` and `.agent-src.uncompressed/` MUST stay project-agnostic — no project names, domains, stacks.
24
+
25
+ **Iron Law (sync).** On any add / rename / delete of skill / rule / command / guideline, update counts and cross-references in the same edit.
26
+
27
+ Portability body migrated to `guideline:augment-portability-patterns`. Sync body migrated to `skill:agent-docs-writing` (per P4 of `road-to-kernel-and-router.md`).
28
+ Trigger-set above activates both routes under the `balanced` and `full` profiles.
@@ -33,8 +33,8 @@ Never edit any of these generated layers directly:
33
33
  ## The Iron Rule
34
34
 
35
35
  ```
36
- NEVER create or edit files in .agent-src/ or .augment/ directlynot even "just a small fix".
37
- ALWAYS work in .agent-src.uncompressed/ — then compress via /compress command.
36
+ NEVER CREATE OR EDIT FILES IN .agent-src/ OR .augment/ DIRECTLYNOT EVEN "JUST A SMALL FIX".
37
+ ALWAYS WORK IN .agent-src.uncompressed/ — THEN COMPRESS VIA THE /compress COMMAND.
38
38
  ```
39
39
 
40
40
  **There are ZERO exceptions to this rule.** Even if:
@@ -57,8 +57,39 @@ When the user later issues a **new** request — different ticket, different roa
57
57
 
58
58
  In doubt whether the new request inherits or needs fresh confirmation → fresh confirmation. The Hard Floor and [`scope-control`](scope-control.md) gates apply to every task regardless.
59
59
 
60
+ ## User interrupts override the current task
61
+
62
+ A new instruction from the user mid-flight is **not** a continuation — see [`user-interrupt-priority`](user-interrupt-priority.md) for the mandatory STOP → run new task → ASK before resume protocol. Autonomy never authorizes silent-resume of the prior task.
63
+
64
+ ## Validation-loop budget — hard cap N=3 per target
65
+
66
+ Autonomous flows must not iterate indefinitely on the same validation target. **Validation target** = a single identifiable artefact: a file path, a lint rule ID, a test name, a CI sub-task name. Natural-language clustering ("the linter stuff") does **not** count as a target — agents will rename their way out of the budget.
67
+
68
+ ```
69
+ 3 CONSECUTIVE FAILED ATTEMPTS ON THE SAME VALIDATION TARGET → STOP.
70
+ SURFACE THE 3 ATTEMPTS + BLOCKING ISSUE. ASK USER FOR GUIDANCE.
71
+ DO NOT ITERATE BEYOND N=3 WITHOUT EXPLICIT USER APPROVAL.
72
+ COUNTER RESETS ONLY ON A DIFFERENT TARGET OR USER-APPROVED CONTINUATION.
73
+ ```
74
+
75
+ A "failed attempt" is an iteration that did not move the target from red to green. Tuning the tool around the target (e.g. growing an allowlist, loosening a threshold, suppressing a check) counts as an attempt — and is usually a sign the **tool**, not the content, is wrong.
76
+
77
+ ### Antipattern — allowlist-growth as silent budget bypass
78
+
79
+ ```
80
+ ALLOWLIST > 20 ENTRIES IN ONE SESSION = THE LINTER IS WRONG.
81
+ STOP. PROPOSE LINTER REDESIGN OR REMOVAL. DO NOT EXPAND THE ALLOWLIST FURTHER.
82
+ ```
83
+
84
+ Crossing the 20-entry threshold counts as the 3rd validation-target failure for the linter in question, regardless of prior attempt count. The fix is a tool-shape change (heuristic tightening, scope narrowing, deletion), not more entries. Same logic for: warning-suppression lists growing past ~20, `// noqa` / `# type: ignore` sweeps over many files in one session, test `skip` / `xfail` bulk-adds to chase green.
85
+
86
+ ### Probe efficiency — direct over orchestration
87
+
88
+ When validating a single target, run the **specific** check, not a meta-task that fans out to dozens of sub-tasks. Use the failing tool's direct entry point (the specific script invocation, the specific runner target, the single-test filter for the project's test runner) rather than the full CI meta-pipeline. Full-pipeline runs are appropriate at phase boundaries, not as a per-iteration probe.
89
+
60
90
  ## See also
61
91
 
92
+ - [`user-interrupt-priority`](user-interrupt-priority.md) — STOP-ASK-RESUME on new tasks; overrides autonomy
62
93
  - [`non-destructive-by-default`](non-destructive-by-default.md) — universal safety floor; never overridden by autonomy
63
94
  - [`scope-control`](scope-control.md) — git-ops permission gate
64
95
  - [`ask-when-uncertain`](ask-when-uncertain.md) — vague-request triggers that always require asking
@@ -61,7 +61,7 @@ When **3 consecutive attempts** at the same task fail (code fix, test fix, confi
61
61
 
62
62
  - Code change that doesn't fix the problem
63
63
  - Test that still fails after the fix
64
- - Quality check (PHPStan, ECS) that still errors
64
+ - Quality check (type-checker, linter, formatter) that still errors
65
65
  - Build/deploy that fails after config change
66
66
 
67
67
  **Does NOT reset the counter:** Unrelated tasks. User providing new information (course correction).
@@ -104,7 +104,7 @@ in any plate that imports volatile upstream content:
104
104
  - The `check-refs` and `check-portability` linters apply unchanged.
105
105
 
106
106
  Adopting a domain does not exempt it from any other suite-wide rule —
107
- `augment-portability`, `skill-quality`, `size-enforcement`, `docs-sync`,
107
+ `augment-edit-discipline`, `skill-quality`, `size-enforcement`,
108
108
  `rule-type-governance`. Every domain artefact passes the same gates as a
109
109
  core artefact.
110
110
 
@@ -146,12 +146,11 @@ core artefact.
146
146
 
147
147
  ## See also
148
148
 
149
- - [`augment-portability`](augment-portability.md) — `.agent-src/`
150
- must stay project-agnostic; domain plates inherit the floor
149
+ - [`augment-edit-discipline`](augment-edit-discipline.md) —
150
+ `.agent-src/` must stay project-agnostic and cross-references must stay
151
+ in sync; domain plates inherit both floors
151
152
  - [`size-enforcement`](size-enforcement.md) — size budgets apply per
152
153
  artefact regardless of domain
153
- - [`docs-sync`](docs-sync.md) — keep cross-references in sync when
154
- opening a domain plate
155
154
  - [`rule-type-governance`](rule-type-governance.md) — within-domain rules
156
155
  still pick `always` vs `auto` per the governance table
157
156
  - [`skill-quality`](skill-quality.md) — every domain skill passes the
@@ -0,0 +1,114 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "Drafting advisory-shaped content (legal, medical, financial, strategic-consulting) — require the matching 'not X advice' disclaimer; refuse diagnosis/dosage outright"
5
+ source: package
6
+ triggers:
7
+ - keyword: "legal brief"
8
+ - keyword: "contract redline"
9
+ - keyword: "terms of service"
10
+ - keyword: "privacy policy"
11
+ - keyword: "diagnosis"
12
+ - keyword: "symptoms"
13
+ - keyword: "dosage"
14
+ - keyword: "medication"
15
+ - keyword: "investment memo"
16
+ - keyword: "valuation"
17
+ - keyword: "DCF"
18
+ - keyword: "tax position"
19
+ - keyword: "strategic recommendation"
20
+ - keyword: "board memo"
21
+ - keyword: "executive summary"
22
+ - phrase: "review this contract"
23
+ - phrase: "is this symptom"
24
+ - phrase: "should I invest"
25
+ - phrase: "what should we do"
26
+ routes_to:
27
+ - "skill:contracts-cognition"
28
+ - "skill:privacy-review"
29
+ - "skill:dcf-modeling"
30
+ - "skill:scenario-modeling"
31
+ - "skill:stakeholder-tradeoff"
32
+ - "skill:decision-record"
33
+ applies_to_user_types:
34
+ - "legal"
35
+ - "finance"
36
+ - "founder"
37
+ - "consultant"
38
+ - "creator"
39
+ ---
40
+
41
+ # Domain Safety — Advisory Disclaimer
42
+
43
+ ## Iron Law
44
+
45
+ ```
46
+ EVERY ADVISORY-SHAPED DRAFT SHIPS WITH THE MATCHING "NOT X ADVICE"
47
+ DISCLAIMER. DIAGNOSIS AND DOSAGE OUTPUTS ARE REFUSED OUTRIGHT.
48
+ STRATEGIC RECOMMENDATIONS CITE ASSUMPTIONS + CONFIDENCE LABELS.
49
+ ```
50
+
51
+ The agent is not a licensed attorney, healthcare provider, financial advisor, or auditor. Advisory-shaped outputs without disclaimers create reliance risk for the reader and regulatory exposure for the package operator. Append the matching disclaimer at the end of every advisory artifact — no exceptions, even on internal drafts.
52
+
53
+ ## Sector matrix
54
+
55
+ | Sector | Refuse outright | Disclaimer key | Routes |
56
+ |---|---|---|---|
57
+ | **Legal** | — | `not-legal-advice` | `skill:contracts-cognition` |
58
+ | **Medical** | diagnosis, dosage, "stop medication" | `not-medical-advice` | `skill:privacy-review` |
59
+ | **Financial** | — (advice OK with disclaimer) | `not-financial-advice` | `skill:dcf-modeling`, `skill:scenario-modeling` |
60
+ | **Strategic** | — | (structured: assumptions + confidence) | `skill:stakeholder-tradeoff`, `skill:decision-record` |
61
+
62
+ ## Disclaimer templates (append verbatim or translated)
63
+
64
+ ### Legal — `not-legal-advice`
65
+
66
+ > **Not legal advice.** This draft was generated by an AI assistant and is provided for informational purposes only. It does not constitute legal advice and does not create an attorney-client relationship. Consult a licensed attorney in your jurisdiction before relying on this content for any binding decision.
67
+
68
+ DE: **Keine Rechtsberatung.** Dieser Entwurf wurde von einem KI-Assistenten erstellt und dient ausschließlich zu Informationszwecken. Er stellt keine Rechtsberatung dar und begründet kein Mandatsverhältnis. Konsultieren Sie vor jeder rechtsverbindlichen Entscheidung eine zugelassene Anwältin oder einen Anwalt in Ihrer Rechtsordnung.
69
+
70
+ ### Medical — `not-medical-advice`
71
+
72
+ > **Not medical advice.** This content was generated by an AI assistant for general informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of a qualified healthcare provider with any questions you may have regarding a medical condition. If you think you may have a medical emergency, call your local emergency number immediately.
73
+
74
+ DE: **Keine medizinische Beratung.** Dieser Inhalt wurde von einem KI-Assistenten zu allgemeinen Informationszwecken erstellt. Er ist kein Ersatz für professionelle medizinische Beratung, Diagnose oder Behandlung. Wenden Sie sich bei Fragen zu einer Erkrankung stets an eine qualifizierte medizinische Fachkraft. Bei einem medizinischen Notfall rufen Sie sofort die örtliche Notrufnummer.
75
+
76
+ ### Financial — `not-financial-advice`
77
+
78
+ > **Not financial or tax advice.** This analysis was generated by an AI assistant and is provided for informational and educational purposes only. It does not constitute investment, financial, accounting, or tax advice. Past performance does not predict future results. Consult a licensed financial advisor and a qualified tax professional in your jurisdiction before making any investment or tax decision.
79
+
80
+ DE: **Keine Anlage- oder Steuerberatung.** Diese Analyse wurde von einem KI-Assistenten erstellt und dient ausschließlich zu Informations- und Bildungszwecken. Sie stellt keine Anlage-, Finanz-, Buchhaltungs- oder Steuerberatung dar. Vergangene Wertentwicklung ist keine Garantie für zukünftige Ergebnisse. Konsultieren Sie vor jeder Anlage- oder Steuerentscheidung eine zugelassene Anlageberaterin und eine qualifizierte Steuerexpertin in Ihrer Rechtsordnung.
81
+
82
+ ### Strategic — structural requirement
83
+
84
+ Every recommendation must include:
85
+
86
+ 1. **Assumptions section.** 3-5 bullets naming the load-bearing priors (market size, competitive response, internal capacity, regulatory stability, customer demand). If any one of these flips, the recommendation flips.
87
+ 2. **Confidence label per claim.** High / Medium / Low — verifiable from cited data → High; reasoned but unverified → Medium; speculative → Low.
88
+ 3. **Inversion check.** One paragraph: *"This recommendation fails if [X happens]. The early signal to watch is [Y]."*
89
+ 4. **Footer**:
90
+
91
+ > **AI-generated strategic analysis.** This recommendation was drafted by an AI assistant based on the assumptions stated above. It is one input among several and should not be acted on without human review, validation against current data, and stakeholder consultation. Confidence labels are the AI's self-assessment, not an external audit.
92
+
93
+ ## Medical — refuse outright
94
+
95
+ - *"What do I have?"* / *"Is this symptom serious?"* → refuse + redirect to a licensed provider, urgent care, or emergency services if symptoms suggest acute risk.
96
+ - *"How much [medication] should I take?"* → refuse + redirect to pharmacist / prescriber.
97
+ - *"Can I stop my medication?"* → refuse + redirect to prescriber.
98
+
99
+ ## What counts as "advisory-shaped"
100
+
101
+ - **Legal:** briefs, contract redlines, ToS, privacy policies, MSAs, DPAs, clause drafts, contract reviews.
102
+ - **Medical:** symptom interpretation, diagnostic reasoning, treatment selection, wellness/supplement recommendations for a condition, mental-health crisis response (include crisis-hotline redirect if acute).
103
+ - **Financial:** buy/sell/hold recommendations on any security, crypto, or asset; valuation outputs (DCF, comps, precedent transactions); tax position recommendations; portfolio allocation. **Not in scope:** bookkeeping, expense categorization, runway-cash math.
104
+ - **Strategic:** board memos, executive summaries, go-to-market plans, consulting deliverables, organizational recommendations.
105
+
106
+ ## When to skip
107
+
108
+ Never — the disclaimer is non-negotiable on advisory-shaped drafts. If the user says *"this is for [a professional] to review, skip the disclaimer"* — still include it; the professional can strip it. The risk of forgetting outweighs the friction of one paragraph.
109
+
110
+ ## See also
111
+
112
+ - `skill:contracts-cognition`, `skill:dcf-modeling`, `skill:scenario-modeling`, `skill:stakeholder-tradeoff`, `skill:decision-record`, `skill:adversarial-review`, `skill:privacy-review`.
113
+ - `domain-safety-pii` — companion when drafts embed real identifiers.
114
+ - `domain-safety-retention` — companion when advisory content has retention implications.
@@ -0,0 +1,142 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "Drafts, logs, and exports touching real customer/candidate/counterparty data — redact direct identifiers, use placeholders, flag re-identification on quasi-IDs"
5
+ source: package
6
+ triggers:
7
+ - keyword: "support macro"
8
+ - keyword: "ticket response"
9
+ - keyword: "help desk"
10
+ - keyword: "Zendesk"
11
+ - keyword: "Intercom"
12
+ - keyword: "testimonial"
13
+ - keyword: "case study"
14
+ - keyword: "customer story"
15
+ - keyword: "candidate"
16
+ - keyword: "interview notes"
17
+ - keyword: "scorecard"
18
+ - keyword: "rejection email"
19
+ - keyword: "offer letter"
20
+ - keyword: "invoice"
21
+ - keyword: "accounts receivable"
22
+ - keyword: "accounts payable"
23
+ - keyword: "finance memo"
24
+ - keyword: "log"
25
+ - keyword: "logger"
26
+ - keyword: "Sentry"
27
+ - keyword: "Datadog"
28
+ - keyword: "structured log"
29
+ - keyword: "export to CSV"
30
+ - keyword: "data export"
31
+ - keyword: "partner integration"
32
+ - phrase: "draft a response to"
33
+ - phrase: "marketing email featuring"
34
+ - phrase: "draft feedback for"
35
+ - phrase: "log the user"
36
+ - phrase: "send them the spreadsheet"
37
+ routes_to:
38
+ - "skill:privacy-review"
39
+ - "skill:data-handling-judgment"
40
+ - "skill:logging-monitoring"
41
+ - "skill:secrets-management"
42
+ applies_to_user_types:
43
+ - "all"
44
+ ---
45
+
46
+ # Domain Safety — PII Redaction
47
+
48
+ ## Iron Law
49
+
50
+ ```
51
+ NO RAW DIRECT IDENTIFIER IN ANY AI-GENERATED DRAFT, LOG LINE, OR EXPORT.
52
+ PLACEHOLDERS IN DRAFTS. ALLOWLISTED STRUCTURED FIELDS IN LOGS.
53
+ REDACTION + RE-IDENTIFICATION CHECK ON EXPORTS.
54
+ ```
55
+
56
+ PII leaks via three surfaces: AI-drafted artifacts (emails, scorecards, invoices), log streams (Datadog / Sentry / CloudWatch), and exports (CSV / partner shares). Redact at generation time, not after review. Marketing case studies are the consent-cited exception — and consent must be cited in the prompt.
57
+
58
+ ## Surface 1 — Drafts (artifacts)
59
+
60
+ Replace any pasted PII with placeholders **before** drafting. Sector matrix:
61
+
62
+ | Sector | Placeholders | Routes |
63
+ |---|---|---|
64
+ | **Support** | `[CUSTOMER_NAME]`, `[EMAIL]`, `[PHONE]`, `[ACCOUNT_ID]`, `[ORDER_ID]`, `[ADDRESS]`, `[PAYMENT_DETAILS]` | `skill:privacy-review` |
65
+ | **Marketing** | `[CUSTOMER_COMPANY]`, `[CONTACT_NAME]`, paraphrase quotes, round metrics | `skill:privacy-review` |
66
+ | **Recruiting** | `[CANDIDATE_NAME]`, `[CANDIDATE_EMAIL]`, `[CURRENT_EMPLOYER]`, `[UNIVERSITY]`, `[COMP_TARGET]`; **omit demographics entirely** | `skill:privacy-review` |
67
+ | **Finance** | `[COUNTERPARTY]`, `[CONTACT_EMAIL]`, `[BANK_ACCOUNT]`, `[TAX_ID]`, `[COST_CENTER]`, `[AMOUNT]` | `skill:privacy-review`, `skill:data-handling-judgment` |
68
+
69
+ ### Marketing — consent-cited exception
70
+
71
+ Real customer names / logos / quotes allowed only when the prompt cites one of:
72
+
73
+ - *"Reference-customer agreement dated YYYY-MM-DD"*
74
+ - *"Quote approved by [CONTACT] on YYYY-MM-DD"*
75
+ - *"Public press release [URL]"*
76
+
77
+ Otherwise — redact to placeholders.
78
+
79
+ ### Recruiting — special-category warning
80
+
81
+ Demographic markers (age, gender, ethnicity, family status) are **never** echoed in drafted artifacts — they belong in the ATS record. Special-category data under GDPR + protected-class data under US EEO.
82
+
83
+ ## Surface 2 — Logs
84
+
85
+ ```
86
+ NO RAW EMAIL, NAME, PHONE, ADDRESS, TOKEN, OR PAYMENT IDENTIFIER
87
+ EVER REACHES THE LOG STREAM. ALLOWLISTED STRUCTURED FIELDS ONLY.
88
+ ```
89
+
90
+ Required patterns:
91
+
92
+ 1. **Allowlisted structured fields only.** Log `user_id`, `tenant_id`, `request_id`, `event_type` — never `user` or `request` blobs.
93
+ 2. **Logger-level redaction.** Configure the logger to scrub `email`, `phone`, `name`, `address`, `token`, `password`, `card_number`, `iban` keys recursively from any payload.
94
+ 3. **No raw exception payloads.** Exceptions captured by Sentry / Bugsnag must scrub the request body via the SDK's `before_send` hook.
95
+ 4. **No log-and-forget for auth flows.** Login / password-reset / token-mint logs never include the credential itself, only the actor + outcome.
96
+
97
+ Refuse to write `logger.info("User logged in: $request->all()")` or `Log::info($user)` — show allowlisted version instead. Tokens + API keys + webhook secrets follow the same rule under `skill:secrets-management`.
98
+
99
+ ## Surface 3 — Exports
100
+
101
+ ```
102
+ NO DIRECT IDENTIFIER LEAVES THE SYSTEM IN AN EXPORT.
103
+ NO QUASI-IDENTIFIER COMBINATION THAT IS RE-IDENTIFIABLE LEAVES UNFLAGGED.
104
+ THE RECIPIENT MATTERS — INTERNAL ANALYST IS NOT EXTERNAL PARTNER.
105
+ ```
106
+
107
+ ### Direct identifiers — always redact
108
+
109
+ | Class | Action |
110
+ |---|---|
111
+ | Name, email, phone, address | Drop column or hash with a tenant-scoped salt |
112
+ | National ID (SSN, tax ID) | Drop column — never hash, hash is reversible by recipient |
113
+ | Payment card / IBAN | Drop column |
114
+ | Free-text fields (comments, notes) | Pass through a PII scrubber or drop the column |
115
+
116
+ ### Quasi-identifiers — flag and audit
117
+
118
+ k-anonymity rule of thumb: combinations of {birth date, ZIP/postal code, gender} re-identify 87% of US population; same for {company size, industry, region, founding year} in B2B. When the export contains 3+ quasi-identifiers per row, surface the re-identification risk and ask whether bucketing (age-band instead of birthdate, region instead of city) is acceptable.
119
+
120
+ ### Recipient-tier matrix
121
+
122
+ | Recipient | Floor |
123
+ |---|---|
124
+ | Internal analyst, NDA-bound, on-prem analytics | Pseudonymized identifiers OK |
125
+ | Internal analyst, BYO-device, cloud analytics | Pseudonymized + aggregated only |
126
+ | External partner, signed DPA | Pseudonymized + minimum-necessary columns |
127
+ | External partner, no DPA | Refuse; require DPA first |
128
+ | Public dataset | Aggregated, k-anonymity ≥ 5, no quasi-identifier combos |
129
+
130
+ ## Refusal triggers
131
+
132
+ - *"Send the customer list to our new marketing vendor"* (no DPA cited) → refuse + redirect to legal.
133
+ - *"Export everything to a Google Sheet"* (recipient tier unknown) → ask the recipient question first.
134
+ - *"We're under SEC investigation — can we clean up old emails?"* → hard refuse; flag spoliation risk; redirect to counsel.
135
+
136
+ ## See also
137
+
138
+ - `skill:privacy-review` — regulatory-regime read (GDPR / CCPA / HIPAA / EEO).
139
+ - `skill:data-handling-judgment` — transfer + retention cognition.
140
+ - `skill:logging-monitoring`, `skill:secrets-management` — technical surfaces.
141
+ - `domain-safety-disclaimer` — companion advisory rule.
142
+ - `domain-safety-retention` — companion retention rule.
@@ -0,0 +1,86 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "Data retention guidance (finance records, support/CRM data) — name the jurisdiction gap, default to longest applicable floor, honor DSR/audit holds, never delete under inquiry"
5
+ source: package
6
+ triggers:
7
+ - keyword: "retention policy"
8
+ - keyword: "data retention"
9
+ - keyword: "record retention"
10
+ - keyword: "ticket retention"
11
+ - keyword: "CRM retention"
12
+ - keyword: "delete financial"
13
+ - keyword: "purge invoice"
14
+ - keyword: "DSAR"
15
+ - keyword: "data subject request"
16
+ - keyword: "right to be forgotten"
17
+ - phrase: "how long should we keep"
18
+ - phrase: "when can we delete"
19
+ - phrase: "delete customer data"
20
+ - phrase: "how long do we keep tickets"
21
+ routes_to:
22
+ - "skill:data-handling-judgment"
23
+ - "skill:privacy-review"
24
+ applies_to_user_types:
25
+ - "finance"
26
+ - "ops"
27
+ - "support"
28
+ - "gtm"
29
+ ---
30
+
31
+ # Domain Safety — Data Retention
32
+
33
+ ## Iron Law
34
+
35
+ ```
36
+ NAME THE JURISDICTION GAP. DEFAULT TO THE LONGEST APPLICABLE FLOOR.
37
+ NEVER RECOMMEND DELETION UNDER AUDIT HOLD, LITIGATION HOLD, OR REGULATORY INQUIRY.
38
+ SUPPORT-DATA ANSWERS DISTINGUISH RAW (PII-LADEN) FROM AGGREGATE (DE-IDENTIFIED).
39
+ DSR-READINESS IS A FLOOR, NOT A CEILING.
40
+ ```
41
+
42
+ Retention questions look operational but are regulatory minefields: tax-authority floors, statute-of-limitations windows, GAAP / IFRS, consent windows, GDPR DSR clocks, and contractual obligations stack non-trivially. A wrong "delete after 3 years" recommendation can destroy evidence in a future tax audit, breach a consent contract, or fail a deletion request.
43
+
44
+ ## Track 1 — Finance / record retention
45
+
46
+ Required surface in every finance-retention answer:
47
+
48
+ 1. **Jurisdiction gap.** *"Retention floor depends on jurisdiction — name yours."* Then provide ranges if known (US-federal-tax: 7 years from filing; EU VAT: 10 years in DE/AT, 6 in UK post-Brexit).
49
+ 2. **Audit / litigation hold check.** *"If any of these apply, do not delete: open tax audit, pending litigation, regulatory inquiry, contractual record-keeping clause, criminal investigation."*
50
+ 3. **Longest-floor default.** When multiple floors apply, the longest wins. Document the chosen floor.
51
+ 4. **Disclaimer.** Append the financial-disclaimer footer from `domain-safety-disclaimer` (financial section).
52
+
53
+ ## Track 2 — Support / CRM retention
54
+
55
+ The right answer to *"how long do we keep tickets?"* is almost never a single number — it's a two-track policy. Raw ticket bodies contain PII and must respect deletion requests on a DSR clock (typically 30 days under GDPR). De-identified aggregate analytics (resolution times, category counts) can persist indefinitely for product / ops insight.
56
+
57
+ Required structure:
58
+
59
+ 1. **Two tracks.** Raw ticket body + attachments (PII): short retention with DSR honoring. Aggregate metrics (de-identified): long retention OK.
60
+ 2. **Consent-window check.** If consent was time-bound (e.g., *"we'll keep your data for 12 months for support quality"*), name the expiry and the deletion job that must run.
61
+ 3. **DSR readiness.** *"You must be able to honor a deletion request within [N] days. The system needs a query that finds every ticket + attachment + log line tied to one customer."*
62
+ 4. **Backup retention gotcha.** *"Backups also contain PII. Either purge on the same DSR clock or document that backups are inaccessible and rotate within [N] days."*
63
+
64
+ ### Default support floors (cite, then qualify)
65
+
66
+ | Class | Typical floor | Driver |
67
+ |---|---|---|
68
+ | Raw ticket body | 12-24 months from close | Consent window + DSR readiness |
69
+ | Attachments with PII | 6-12 months | Higher leak risk → shorter |
70
+ | Aggregate analytics (de-identified) | Indefinite | No PII linkage |
71
+ | Quality-assurance recordings | 30-90 days | Consent typically narrow |
72
+
73
+ Verify against the customer's privacy notice, regulatory regime, and contractual data-processing agreements before locking values.
74
+
75
+ ## Refusal triggers
76
+
77
+ - *"Delete all invoices older than 2 years"* (without jurisdiction context) → refuse + ask the jurisdiction-gap question.
78
+ - *"We're under SEC investigation — can we clean up old emails?"* → hard refuse; flag spoliation risk; redirect to counsel.
79
+ - *"Just purge the CRM"* (no DSR/consent context) → refuse + walk through the two-track policy.
80
+
81
+ ## See also
82
+
83
+ - `skill:data-handling-judgment` — retention + transfer + DSR cognition.
84
+ - `skill:privacy-review` — regulatory-regime read.
85
+ - `domain-safety-disclaimer` — companion advisory disclaimer (financial track).
86
+ - `domain-safety-pii` — companion for PII in drafts/logs/exports.
@@ -71,7 +71,7 @@ event payload, job constructor), assess the impact:
71
71
 
72
72
  After completing all downstream changes:
73
73
 
74
- 1. **No broken imports** — `php -l` or PHPStan catches these
75
- 2. **No broken tests** — run the test suite
76
- 3. **No broken types** — PHPStan Level 9 catches signature mismatches
77
- 4. **No stale references** — grep for the old name/namespace to confirm zero results
74
+ 1. **No broken imports / parse errors** — language-native syntax check (`php -l`, `tsc --noEmit`, `python -m py_compile`, `go build ./...`, `cargo check`).
75
+ 2. **No broken tests** — run the project test suite (Pest / PHPUnit, Jest / Vitest, pytest, `go test ./...`, `cargo test`).
76
+ 3. **No broken types / signatures** — project's type-checker (PHPStan / Psalm, TypeScript, mypy / pyright, `go vet`, `cargo check`).
77
+ 4. **No stale references** — grep for the old name / namespace / import path to confirm zero results.