@event4u/agent-config 2.25.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 (122) hide show
  1. package/.agent-src/commands/bug-fix.md +1 -0
  2. package/.agent-src/commands/feature/roadmap.md +2 -2
  3. package/.agent-src/commands/fix/seeder.md +3 -2
  4. package/.agent-src/commands/memory/add.md +3 -3
  5. package/.agent-src/commands/module/create.md +1 -0
  6. package/.agent-src/commands/module/explore.md +10 -6
  7. package/.agent-src/commands/onboard.md +9 -1
  8. package/.agent-src/commands/optimize/augmentignore.md +52 -20
  9. package/.agent-src/commands/optimize/rtk.md +56 -30
  10. package/.agent-src/commands/package-test.md +86 -10
  11. package/.agent-src/commands/quality-fix.md +49 -27
  12. package/.agent-src/commands/update-form-request-messages.md +2 -1
  13. package/.agent-src/contexts/augment-infrastructure.md +4 -7
  14. package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +1 -1
  15. package/.agent-src/contexts/contracts/research-schema.md +1 -1
  16. package/.agent-src/contexts/execution/interrupt-examples.md +34 -0
  17. package/.agent-src/contexts/skills-and-commands.md +2 -2
  18. package/.agent-src/rules/architecture.md +24 -10
  19. package/.agent-src/rules/artifact-drafting-protocol.md +6 -0
  20. package/.agent-src/rules/augment-edit-discipline.md +28 -0
  21. package/.agent-src/rules/augment-source-of-truth.md +2 -2
  22. package/.agent-src/rules/autonomous-execution.md +31 -0
  23. package/.agent-src/rules/context-hygiene.md +1 -1
  24. package/.agent-src/rules/domain-adoption-policy.md +4 -5
  25. package/.agent-src/rules/domain-safety-disclaimer.md +114 -0
  26. package/.agent-src/rules/domain-safety-pii.md +142 -0
  27. package/.agent-src/rules/domain-safety-retention.md +86 -0
  28. package/.agent-src/rules/downstream-changes.md +4 -4
  29. package/.agent-src/rules/framework-neutrality-in-generic-skills.md +130 -0
  30. package/.agent-src/rules/git-history-discipline.md +99 -0
  31. package/.agent-src/rules/minimal-safe-diff.md +6 -0
  32. package/.agent-src/rules/no-roadmap-references.md +4 -2
  33. package/.agent-src/rules/user-interrupt-priority.md +46 -0
  34. package/.agent-src/rules/verify-before-complete.md +11 -2
  35. package/.agent-src/skills/adversarial-review/SKILL.md +1 -1
  36. package/.agent-src/skills/ai-council/SKILL.md +1 -0
  37. package/.agent-src/skills/api-endpoint/SKILL.md +58 -154
  38. package/.agent-src/skills/api-testing/SKILL.md +11 -0
  39. package/.agent-src/skills/code-refactoring/SKILL.md +36 -30
  40. package/.agent-src/skills/code-review/SKILL.md +41 -36
  41. package/.agent-src/skills/context-authoring/SKILL.md +1 -1
  42. package/.agent-src/skills/dashboard-design/SKILL.md +1 -2
  43. package/.agent-src/skills/database/SKILL.md +8 -3
  44. package/.agent-src/skills/dependency-upgrade/SKILL.md +65 -19
  45. package/.agent-src/skills/developer-like-execution/SKILL.md +25 -14
  46. package/.agent-src/skills/eloquent/SKILL.md +1 -1
  47. package/.agent-src/skills/feature-planning/SKILL.md +1 -1
  48. package/.agent-src/skills/file-editor/SKILL.md +45 -19
  49. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +2 -2
  50. package/.agent-src/skills/git-workflow/SKILL.md +4 -4
  51. package/.agent-src/skills/laravel-api-endpoint/SKILL.md +187 -0
  52. package/.agent-src/skills/{dto-creator → laravel-dto}/SKILL.md +5 -4
  53. package/.agent-src/skills/{migration-creator → laravel-migration}/SKILL.md +11 -10
  54. package/.agent-src/skills/laravel-reverb/SKILL.md +3 -3
  55. package/.agent-src/skills/{websocket → laravel-websocket}/SKILL.md +4 -3
  56. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +1 -1
  57. package/.agent-src/skills/merge-conflicts/SKILL.md +49 -17
  58. package/.agent-src/skills/migration-architect/SKILL.md +6 -6
  59. package/.agent-src/skills/module-management/SKILL.md +1 -0
  60. package/.agent-src/skills/multi-tenancy/SKILL.md +15 -8
  61. package/.agent-src/skills/pest-testing/SKILL.md +18 -0
  62. package/.agent-src/skills/php-debugging/SKILL.md +28 -0
  63. package/.agent-src/skills/php-service/SKILL.md +3 -3
  64. package/.agent-src/skills/playwright-testing/SKILL.md +16 -1
  65. package/.agent-src/skills/project-analyzer/SKILL.md +68 -42
  66. package/.agent-src/skills/readme-writing-package/SKILL.md +94 -23
  67. package/.agent-src/skills/roadmap-management/SKILL.md +1 -1
  68. package/.agent-src/skills/rtk-output-filtering/SKILL.md +23 -8
  69. package/.agent-src/skills/rule-refactor/SKILL.md +145 -0
  70. package/.agent-src/skills/rule-writing/SKILL.md +34 -8
  71. package/.agent-src/skills/security/SKILL.md +38 -29
  72. package/.agent-src/skills/skill-reviewer/SKILL.md +1 -1
  73. package/.agent-src/skills/test-driven-development/SKILL.md +4 -4
  74. package/.agent-src/skills/test-performance/SKILL.md +6 -5
  75. package/.agent-src/skills/verify-completion-evidence/SKILL.md +24 -27
  76. package/.agent-src/templates/agents/agent-project-settings.example.yml +1 -1
  77. package/.agent-src/templates/copilot-instructions.md +2 -2
  78. package/.agent-src/templates/rule.md +2 -2
  79. package/.claude-plugin/marketplace.json +6 -4
  80. package/AGENTS.md +1 -1
  81. package/CHANGELOG.md +74 -170
  82. package/README.md +2 -2
  83. package/docs/architecture.md +2 -2
  84. package/docs/archive/CHANGELOG-pre-2.25.0.md +191 -0
  85. package/docs/catalog.md +17 -12
  86. package/docs/contracts/file-ownership-matrix.json +473 -43
  87. package/docs/contracts/kernel-membership.md +17 -0
  88. package/docs/contracts/smoke-contracts.md +8 -8
  89. package/docs/getting-started.md +1 -1
  90. package/docs/guidelines/php/api-design.md +1 -1
  91. package/docs/guidelines/php/controllers.md +1 -1
  92. package/docs/guidelines/php/resources.md +1 -1
  93. package/docs/guidelines/php/validations.md +1 -1
  94. package/package.json +1 -1
  95. package/scripts/build_linear_digest.py +0 -1
  96. package/scripts/lint_framework_leakage.py +348 -0
  97. package/scripts/lint_framework_leakage_allowlist.json +476 -0
  98. package/scripts/measure_augment_budget.py +6 -0
  99. package/scripts/schemas/command.schema.json +5 -0
  100. package/scripts/schemas/skill.schema.json +5 -0
  101. package/scripts/skill_linter.py +60 -7
  102. package/scripts/smoke/kernel.sh +4 -4
  103. package/scripts/smoke/router.sh +2 -2
  104. package/.agent-src/rules/agent-docs.md +0 -20
  105. package/.agent-src/rules/augment-portability.md +0 -23
  106. package/.agent-src/rules/capture-learnings.md +0 -19
  107. package/.agent-src/rules/docs-sync.md +0 -20
  108. package/.agent-src/rules/domain-safety-disclaimer-consulting.md +0 -52
  109. package/.agent-src/rules/domain-safety-disclaimer-financial.md +0 -54
  110. package/.agent-src/rules/domain-safety-disclaimer-legal.md +0 -49
  111. package/.agent-src/rules/domain-safety-disclaimer-medical.md +0 -56
  112. package/.agent-src/rules/domain-safety-export-redact.md +0 -65
  113. package/.agent-src/rules/domain-safety-logging-pii-floor.md +0 -55
  114. package/.agent-src/rules/domain-safety-pii-finance.md +0 -57
  115. package/.agent-src/rules/domain-safety-pii-marketing.md +0 -60
  116. package/.agent-src/rules/domain-safety-pii-recruiting.md +0 -56
  117. package/.agent-src/rules/domain-safety-pii-support.md +0 -57
  118. package/.agent-src/rules/domain-safety-retention-finance.md +0 -48
  119. package/.agent-src/rules/domain-safety-retention-support.md +0 -55
  120. package/.agent-src/rules/e2e-testing.md +0 -19
  121. package/.agent-src/rules/no-unsolicited-rebase.md +0 -107
  122. package/.agent-src/rules/post-push-rewrite-discipline.md +0 -70
@@ -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.
@@ -0,0 +1,130 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ description: "When editing a generic skill/rule/command — block single-stack mandates; use language-agnostic procedures with carve-out pointers."
5
+ source: package
6
+ triggers:
7
+ - path_prefix: ".agent-src.uncompressed/skills/"
8
+ - path_prefix: ".agent-src.uncompressed/rules/"
9
+ - path_prefix: ".agent-src.uncompressed/commands/"
10
+ - keyword: "FormRequest"
11
+ - keyword: "PHPStan"
12
+ - keyword: "php artisan"
13
+ - keyword: "composer.json"
14
+ - keyword: "Eloquent"
15
+ - keyword: "Pest"
16
+ - keyword: "Blade"
17
+ - keyword: "vendor/bin"
18
+ - keyword: "Artisan"
19
+ - keyword: "Rector"
20
+ - phrase: "every controller"
21
+ - phrase: "all controllers"
22
+ - phrase: "generic skill"
23
+ applies_to_user_types:
24
+ - "maintainer"
25
+ validator_ignore:
26
+ - type: "substring"
27
+ pattern: ".agent-src.uncompressed/"
28
+ reason: "Rule's subject is generic artifacts under .agent-src.uncompressed/; every body link points there by design."
29
+ - type: "substring"
30
+ pattern: "scripts/lint_framework_leakage"
31
+ reason: "Rule cites the enforcing linter script by name in body and enforcement section."
32
+ ---
33
+
34
+ # framework-neutrality-in-generic-skills
35
+
36
+ ## The Iron Law
37
+
38
+ ```
39
+ NO GENERIC ARTIFACT MAY MANDATE A SPECIFIC FRAMEWORK.
40
+ SPECIFICS BELONG IN CARVE-OUT ARTIFACTS (laravel-*, symfony-*,
41
+ nextjs-*, pest-*, eloquent, quality-tools).
42
+ ```
43
+
44
+ A generic skill, rule, or command names a *procedure* — what to do.
45
+ A carve-out artifact names a *stack* — how that procedure looks in
46
+ Laravel, Next.js, Pest, etc. Mixing the two leaks framework assumptions
47
+ into surfaces the agent must trigger on regardless of project stack.
48
+
49
+ ## Scope
50
+
51
+ This rule fires on edits under:
52
+
53
+ - `.agent-src.uncompressed/skills/`
54
+ - `.agent-src.uncompressed/rules/`
55
+ - `.agent-src.uncompressed/commands/`
56
+
57
+ **Exempt** (file or directory name matches — these are correctly
58
+ framework-specific): `laravel*`, `symfony*`, `nextjs*`, `react-*`,
59
+ `^php-*`, `^pest-*`, `^eloquent`, `^blade*`, `^livewire`, `^flux`,
60
+ `^artisan-*`, `^composer-*`, `^docker*`, `^aws-*`, `^grafana`,
61
+ `^openapi$`, `^quality-tools`, `^sql-writing`, `^tailwind*`,
62
+ `^terraform*`, `^terragrunt*`, `^traefik`, `^mobile-e2e`,
63
+ `-routing$`, `project-analysis-(laravel|symfony|nextjs|react|node-express|zend-laminas)`.
64
+
65
+ ## Forbidden patterns in generic artifacts
66
+
67
+ | Pattern | Why it leaks | Fix |
68
+ |---|---|---|
69
+ | `FormRequest` as a mandate | Laravel-only validation class | Say "request-validation primitive (FormRequest in Laravel, zod in Next.js, pydantic in FastAPI)" or move to `laravel-validation` carve-out |
70
+ | `php artisan …` as a canonical command | Laravel CLI | Generalize to "the framework's CLI" or move to `artisan-commands` carve-out |
71
+ | `PHPStan` as the only example | PHP-only static analyser | List peers (`mypy` for Python, `tsc` for TypeScript) or move to `quality-tools` carve-out |
72
+ | `composer.json` mentioned alone | PHP package manifest | Add `package.json` / `pyproject.toml` peers, or move to a PHP-scoped carve-out |
73
+ | `Eloquent` / `Model::…` | Laravel ORM | Generalize to "the project's ORM/data layer" or move to `eloquent` carve-out |
74
+ | `Pest` as the only test runner | PHP/Laravel test framework | List peers (`pytest`, `vitest`, `jest`) or move to `pest-testing` carve-out |
75
+ | `Blade` / `Livewire` / `Flux` as default UI | Laravel view stack | Generalize to "the project's UI layer" or move to `blade-ui` / `livewire` / `flux` carve-outs |
76
+ | `vendor/bin/<tool>` as a canonical path | PHP/Composer-specific binary path | Say "the project's quality CLI" or carve-out it |
77
+ | `Rector` as the only refactor tool | PHP-only refactorer | List peers (`ts-morph`, `libcst`) or carve-out it |
78
+ | "every controller" / "all controllers" | Assumes MVC PHP framework | Generalize to "every request handler" / "every endpoint" |
79
+
80
+ ## Allowed: cross-stack documentation
81
+
82
+ Multi-stack tables or detection maps with **at least two ecosystems
83
+ side-by-side** are documentation, not leakage. The linter's
84
+ auto-detect heuristic (Step 0.5 of the audit roadmap) skips a hit when
85
+ its ±2-line window contains patterns from a different ecosystem family
86
+ (`php_family` vs `js_family` vs `python_family`).
87
+
88
+ Example (allowed):
89
+
90
+ ```
91
+ - PHP/Composer project → `composer.json` present
92
+ - Node project → `package.json` present
93
+ - Python project → `pyproject.toml` present
94
+ ```
95
+
96
+ ## Allowed: carve-out pointers
97
+
98
+ A generic artifact may end a section with a one-line handoff to its
99
+ framework-specific peers. Canonical shape:
100
+
101
+ ```
102
+ → Laravel-specific: see [laravel-validation](../skills/laravel-validation/SKILL.md)
103
+ → Next.js-specific: see [nextjs-patterns](../skills/nextjs-patterns/SKILL.md)
104
+ ```
105
+
106
+ The pointer is a link, not a procedure — the generic artifact never
107
+ inlines stack-specific code.
108
+
109
+ ## Enforcement
110
+
111
+ `scripts/lint_framework_leakage.py` runs in the package CI pipeline.
112
+ Exit codes:
113
+
114
+ - `0` — no hits, or every hit is auto-detected as cross-stack, or
115
+ every hit is allowlisted in
116
+ `scripts/lint_framework_leakage_allowlist.json` with a `reason`.
117
+ - `1` — at least one hit in a generic artifact (non-carve-out) that
118
+ is neither cross-stack nor allowlisted.
119
+
120
+ The linter is intentionally noisy on first introduction — the audit
121
+ roadmap drives hits to zero phase by phase.
122
+
123
+ ## See also
124
+
125
+ - [`roadmap-ci-steps-policy`](roadmap-ci-steps-policy.md) — sibling
126
+ Tier-2a rule that drove this pattern.
127
+ - [`skill-quality`](skill-quality.md) — every skill must remain
128
+ executable; carve-outs must still pass skill-quality.
129
+ - [`scope-control`](scope-control.md) — neutralizing a skill is not
130
+ a refactor pretext; only touch the leaking sentences.
@@ -0,0 +1,99 @@
1
+ ---
2
+ type: "auto"
3
+ tier: "2a"
4
+ alwaysApply: false
5
+ description: "Git history operations — never rebase/squash/amend without explicit request; once pushed, rewrites must pair with immediate re-push in same turn"
6
+ source: package
7
+ triggers:
8
+ - intent: "rebase the branch"
9
+ - intent: "squash commits"
10
+ - intent: "clean up commit history"
11
+ - intent: "fold this into the previous commit"
12
+ - intent: "tidy history after pushing"
13
+ - keyword: "git rebase"
14
+ - keyword: "fixup"
15
+ - keyword: "--amend"
16
+ - keyword: "force-push"
17
+ - keyword: "--force-with-lease"
18
+ - keyword: "squash-merge"
19
+ - phrase: "branch diverged"
20
+ - phrase: "pull --rebase failed"
21
+ - phrase: "ahead and behind"
22
+ routes_to:
23
+ - "skill:git-workflow"
24
+ ---
25
+
26
+ # Git History Discipline
27
+
28
+ ## Iron Law — Gate (no unsolicited rewrites)
29
+
30
+ ```
31
+ NEVER REBASE, SQUASH, FIXUP, OR AMEND PUBLISHED OR LOCAL HISTORY
32
+ WITHOUT THE USER ASKING FOR IT THIS TURN.
33
+ LINEAR HISTORY IS A PREFERENCE, NOT A DEFAULT.
34
+ COMMIT-CHUNK ORDER IS NOT A CORRECTNESS GOAL.
35
+ ```
36
+
37
+ Add the next commit on top. Never reorder, fold, drop, or rewrite earlier
38
+ commits to make the log "look right".
39
+
40
+ ## Iron Law — Protocol (once authorized)
41
+
42
+ ```
43
+ ONCE PUSHED, A COMMIT IS PUBLISHED.
44
+ ANY REWRITE OF PUSHED HISTORY MUST PAIR WITH AN IMMEDIATE RE-PUSH
45
+ IN THE SAME TURN — OR DON'T REWRITE.
46
+ NEVER END A SESSION WITH REWRITTEN-BUT-UNPUSHED LOCAL HISTORY.
47
+ ```
48
+
49
+ ## When rewrite is allowed
50
+
51
+ Exactly three:
52
+
53
+ 1. **User says so this turn** — "rebase onto main", "squash these two", "amend that". This operation only, not a standing rule.
54
+ 2. **Standing instruction not yet revoked** — the user said earlier in the conversation "always squash before pushing"; honor it.
55
+ 3. **Conflict resolution forced by `git pull --rebase`** — the user already invoked the rebase via pull; finish it.
56
+
57
+ Anything else — chunk-tidiness, "logical order", folding a follow-up fix into its parent — **forbidden**. The follow-up ships as its own commit (`fix: …`, `chore: …`).
58
+
59
+ ## Two protective stops (for the protocol phase)
60
+
61
+ 1. **Pre-rewrite stop.** Before any squash / amend / rebase on a branch that is on origin: `git fetch && git rev-list --left-right --count HEAD...@{u}`. If **either** side is non-zero — STOP and route to `skill:git-workflow § Divergent-State Recovery`. A blind `git pull --rebase` in this state is the documented failure mode.
62
+
63
+ 2. **Post-rewrite stop.** After the rewrite, push in the **same turn** with `--force-with-lease=<branch>:<fetched-sha>` and verify `git rev-parse origin/<branch>` equals `git rev-parse HEAD`. If the push fails (hook, network, token budget) — fix the cause and re-push **before** ending the session, committing new work, or handing off.
64
+
65
+ If either stop fires and resolution is not immediate → tag the state (`git tag local-rewritten-tip-<ISO-date>`) and hand control back to the user. Do not let a new session inherit a dirty divergence.
66
+
67
+ ## Equivalents that are also forbidden by default
68
+
69
+ - `git rebase -i` (interactive)
70
+ - `git rebase --autosquash`
71
+ - `git commit --fixup` / `--squash` (helpers that feed autosquash)
72
+ - `git commit --amend` on already-pushed commits
73
+ - `git push --force` / `--force-with-lease` (unless paired with the protocol)
74
+ - `git reset --hard` past unpushed work the user might want
75
+ - Squash-merge of a PR via API or CLI when the user has not picked the merge strategy
76
+ - Cherry-pick rewriting that drops or reorders commits
77
+
78
+ `--amend` on the *current local* commit before the first push is the narrow exception (treated as continuing to compose the commit, not rewriting history).
79
+
80
+ ## Why this rule exists
81
+
82
+ Interactive rebase + fixup loops generate disproportionate token cost on every iteration: re-running CI per replayed commit, resolving the same content conflict in three derived files (`.compression-hashes.json`, `router.json`, `.windsurfrules`), losing the working tree to a stash that silently re-introduces older state. A single conflict can burn the budget of an entire feature.
83
+
84
+ A previous session squashed a pushed branch, the push hook failed at the token boundary, the session ended — and the next session saw local and origin pointing at different SHAs for the same logical work. A blind `git pull --rebase` cascaded into conflicts across every derived file. Recovery required forensic SHA-archaeology. The pre/post-rewrite stops make that sequence structurally impossible.
85
+
86
+ ## When you'd be tempted
87
+
88
+ - "I want commit 3 to come before commit 2 because the topic flows better." → don't. Reviewers read the PR diff.
89
+ - "There are two `chore: regenerate` commits, ugly." → don't. They are honest checkpoints.
90
+ - "A linter caught an issue in commit 2 — let me fold the fix in." → don't. Add `fix(scope): …` on top.
91
+ - "I want to drop the WIP commit before pushing." → ask the user first.
92
+ - "Squash-merge when I open the PR will clean it anyway." → also true, also irrelevant — let the merge strategy do that work, not you.
93
+
94
+ ## See also
95
+
96
+ - [`scope-control`](scope-control.md) — git-ops permission gate ("rebase" already named in the canonical list).
97
+ - [`commit-policy`](commit-policy.md) — commits are the user's call; rewriting them is a stronger version of the same restriction.
98
+ - [`token-efficiency`](token-efficiency.md) — Iron Law on burning the user's tokens for cosmetic gain.
99
+ - [`skill:git-workflow`](../skills/git-workflow/SKILL.md) — Safe Squash-After-Push protocol and Divergent-State Recovery decision tree.
@@ -12,6 +12,12 @@ triggers:
12
12
 
13
13
  # Minimal Safe Diff
14
14
 
15
+ ```
16
+ THE DIFF CONTAINS THE SMALLEST CHANGE THAT SOLVES THE STATED PROBLEM.
17
+ NEVER REFORMAT, RENAME, OR RESTRUCTURE UNTOUCHED CODE IN THE SAME DIFF.
18
+ NEVER ADD DRIVE-BY EDITS, OPPORTUNISTIC REFACTORS, OR DEPENDENCY BUMPS.
19
+ ```
20
+
15
21
  A diff is **safe** when every line in it is traceable to the stated task.
16
22
  Every other line is scope creep and must be removed or moved to a separate
17
23
  change.
@@ -126,8 +126,10 @@ Failure modes:
126
126
 
127
127
  ## See also
128
128
 
129
- - [`docs-sync`](docs-sync.md) — cross-reference sync after rename / delete
130
- - [`agent-docs`](agent-docs.md) roadmap layer conventions
129
+ - [`augment-edit-discipline`](augment-edit-discipline.md) — portability
130
+ + cross-reference sync after rename / delete
131
+ - [`skill:agent-docs-writing`](../skills/agent-docs-writing/SKILL.md) —
132
+ roadmap layer conventions
131
133
  - [`roadmap-progress-sync`](roadmap-progress-sync.md) — sync dashboard
132
134
  on roadmap touch
133
135
  - [`augment-source-of-truth`](augment-source-of-truth.md) — edit
@@ -0,0 +1,46 @@
1
+ ---
2
+ type: "always"
3
+ tier: "1"
4
+ description: "User interrupts override the current task — STOP, complete new task in full, then ASK before resuming; never silently return to prior work"
5
+ alwaysApply: true
6
+ source: package
7
+ load_context:
8
+ - ../contexts/execution/interrupt-examples.md
9
+ ---
10
+
11
+ # User-Interrupt Priority
12
+
13
+ A new instruction mid-flight is **not** a continuation. Examples and failure modes: [`contexts/execution/interrupt-examples.md`](../contexts/execution/interrupt-examples.md).
14
+
15
+ ## The Iron Law
16
+
17
+ ```
18
+ NEW TASK FROM USER MID-FLIGHT → STOP CURRENT TASK.
19
+ COMPLETE NEW TASK IN FULL.
20
+ THEN ASK BEFORE RESUMING THE OLD TASK.
21
+ NEVER SILENTLY RESUME.
22
+ ```
23
+
24
+ Holds regardless of `personal.autonomy`, a standing autonomy directive, or roadmap authorization. Autonomy narrows trivial workflow questions — it does not authorize ignoring a fresh instruction.
25
+
26
+ ## Classify every user turn
27
+
28
+ | Bucket | Signal | Action |
29
+ |---|---|---|
30
+ | **Continuation** | Same deliverable + target + success criterion. "weiter", "next step". | Keep working. |
31
+ | **Clarification** | Question / correction about the current task. No new deliverable. | Answer, then continue. |
32
+ | **Interrupt** | Different deliverable, target, or success criterion. Meta-tasks ("audit", "stop and analyze") count. | STOP. Run new task. ASK before resume. |
33
+
34
+ In doubt → treat as interrupt. Cost of a spurious ask is one turn; cost of silent-resume is the rest of the unwanted work.
35
+
36
+ ## Stop-ask-resume protocol
37
+
38
+ 1. **STOP** — abandon the current tool plan. No "one more check" unless the new instruction says so.
39
+ 2. **EXECUTE** the new task in full. All other rules (Hard Floor, scope, autonomy) apply.
40
+ 3. **ASK** when done — name the interrupted task and request a resume decision:
41
+
42
+ ```
43
+ Done with <new task>. Resume <interrupted task name>? (yes / no / different)
44
+ ```
45
+
46
+ Only resume on `yes` or a restatement. "and then continue with X" = explicit resume authorization; no re-ask.
@@ -22,7 +22,7 @@ If you haven't run the verification command **in this message**, you cannot clai
22
22
 
23
23
  Before claiming ANY work is complete:
24
24
 
25
- 1. **IDENTIFY** — What command proves this claim? (tests, PHPStan, build, etc.)
25
+ 1. **IDENTIFY** — What command proves this claim? (tests, type-checker, linter, build — whichever the project actually runs)
26
26
  2. **RUN** — Execute the full command (fresh, complete, not cached)
27
27
  3. **READ** — Full output, check exit code, count failures
28
28
  4. **VERIFY** — Does the output actually confirm the claim?
@@ -43,7 +43,7 @@ Skip any step = the claim is unverified.
43
43
  - Expressing satisfaction before running verification
44
44
  - About to commit/push without running tests + quality
45
45
  - Trusting a previous run from earlier in the conversation
46
- - Relying on partial verification (ran tests but not PHPStan)
46
+ - Relying on partial verification (ran tests but skipped the type-checker / linter)
47
47
  - ANY wording implying success without fresh evidence
48
48
 
49
49
  ## Verification commands
@@ -64,3 +64,12 @@ all live in
64
64
  The Iron Law and the Gate above are the obligation surface; the
65
65
  mechanics context is the lookup material the agent pulls when the
66
66
  gate fires.
67
+
68
+ ## Examples
69
+
70
+ Pattern Memory — wrong / right / why demos for the Iron Law and the
71
+ red-flags list:
72
+ [`verify-before-complete-demos`](../docs/guidelines/agent-infra/verify-before-complete-demos.md)
73
+ (hedged claims, trusting earlier runs, partial-verification creep).
74
+ Outcome baseline locked at
75
+ [`tests/golden/outcomes/verify_before_complete.json`](../../tests/golden/outcomes/verify_before_complete.json).
@@ -104,7 +104,7 @@ Only surface trade-offs or concerns that need the user's input.
104
104
  - **feature-planning** — adversarial review after Understanding Lock, before presenting the plan.
105
105
  - **bug-analyzer** — review the proposed fix before implementing.
106
106
  - **code-review** — self-review before creating a PR.
107
- - **migration-creator** — review migration for data safety.
107
+ - **laravel-migration** (or framework-native equivalent) — review migration for data safety.
108
108
  - **api-design** — review API design for consistency and breaking changes.
109
109
  - **security** — review security-sensitive changes for attack surface.
110
110
 
@@ -3,6 +3,7 @@ name: ai-council
3
3
  description: "Use when polling external AIs (OpenAI, Anthropic) outside the host session for a neutral second opinion on a roadmap, diff, prompt, or file set — or 'cross-check with another model'."
4
4
  source: package
5
5
  domain: process
6
+ meta_skill: true
6
7
  ---
7
8
 
8
9
  <!-- cloud_safe: degrade -->